datamad2017/js/scripts.min.js

1 line
11 KiB
JavaScript
Raw Normal View History

2014-08-25 13:15:21 +02:00
(function(g){g(document).ready(function(){g(window).load(function(){g("#st-container").removeClass("disable-scrolling");g("#loading-animation").fadeOut();g("#preloader").delay(350).fadeOut(800);d();equalheight(".same-height")});if(g(window).width()>1500){g(".effect-wrapper").addClass("col-lg-3")}if(g(window).width()<768){g(".animated").removeClass("animated").removeClass("hiding");g(".stat span").removeClass("timer");g(".timeslot-label").addClass("stick-label")}if(g(window).height()<512){g("#bottom-navlinks").removeClass("bottom-navlinks").addClass("bottom-navlinks-small")}if(g(window).scrollTop()>=100){g("#top-header").addClass("after-scroll");g("#logo-header .logo").removeClass("logo-light").addClass("logo-dark")}g(window).scroll(function(){var r=g(this).scrollTop();var v=g("#top-header");var u=g("#logo-header .logo");var s=g(".right-nav-button");var t=v.height()+g(".track-header").height();if(r>=100){v.addClass("after-scroll");u.removeClass("logo-light").addClass("logo-dark")}else{v.removeClass("after-scroll");u.removeClass("logo-dark").addClass("logo-light")}if(r>=g(".top-section").height()){s.removeClass("right-nav-button-hidden")}else{s.addClass("right-nav-button-hidden")}g(".slot").each(function(){var x=g(this).offset().top-r;var w=t+g(this).find(".slot-title").height();if(x<=w&&x>=0){g(".track-header.sticky").find(".slot-detail").html(g(this).data("slotDetail"))}})});g(window).resize(function(){if(g(window).width()>1500){g(".effect-wrapper").addClass("col-lg-3")}else{g(".effect-wrapper").removeClass("col-lg-3")}if(g(window).width()<768){g(".same-height").css("height","100%");g(".timeslot-label").addClass("stick-label")}else{g(".timeslot-label").removeClass("stick-label");if(m.hasClass("st-menu-open")){m.removeClass("st-menu-open");g("body").css("overflow","auto")}equalheight(".same-height")}if(g(window).height()<512){g(".st-menu").addClass("scrollable");g("#bottom-navlinks").removeClass("bottom-navlinks").addClass("bottom-navlinks-small")}else{g(".st-menu").removeClass("scrollable");g("#bottom-navlinks").removeClass("bottom-navlinks-small").addClass("bottom-navlinks")}});var p=1;g(document).on("touchmove",function(r){if(p==0){r.preventDefault()}else{return true}});g("body").on("touchmove",".scrollable",function(r){r.stopPropagation()});function o(){if(p==0){g("body").removeClass("disable-scrolling");p=1}else{g("body").addClass("disable-scrolling");p=0}}g(function(){g("a[href*=#]:not([href=#])").click(function(){if(location.pathname.replace(/^\//,"")==this.pathname.replace(/^\//,"")&&location.hostname==this.hostname){var r=g(this.hash);r=r.length?r:g("[name="+this.hash.slice(1)+"]");if(r.length){g("html,body").animate({scrollTop:r.offset().top},1000);return false}}})});g(function(){g("a[href=#]").click(function(){event.preventDefault()})});g(function(){var u,s,t,x,w,r,v;v=g(".appear-animation");for(w=0,r=v.length;w<r;w++){t=v[w];x=t.offsetLeft+t.offsetTop;s=x/1000;g(t).css("transition-delay",""+(s*0.47)+"s");g(t).css("transition-duration",""+0.2+"s")}});g(".appear-animation-trigger").appear(function(){setTimeout(function(){g(".appear-animation-trigger").parent("div").find(".appear-animation").addClass("visible")},1000)});g(".animated").appear(function(){var s=g(this);var t=s.data("animation");var r=s.data("delay");if(r){setTimeout(function(){s.addClass(t+" visible");s.removeClass("hiding");if(s.hasClass("counter")){s.find(".timer").countTo()}},r)}else{s.addClass(t+" visible");s.removeClass("hiding");if(s.hasClass("counter")){s.find(".timer").countTo()}}},{accY:-150});equalheight=function(s){var r=0,t=0,w=new Array(),v,u=0;g(s).each(function(){v=g(this);g(v).height("auto");topPostion=v.position().top;if(t!=topPostion){for(currentDiv=0;currentDiv<w.length;currentDiv++){w[currentDiv].height(r)}w.length=0;t=topPostion;r=v.height();w.push(v)}else{w.push(v);r=(r<v.height())?(v.height()):(r)}for(currentDiv=0;currentDiv<w.length;currentDiv++){w[currentDiv].height(r)}})};var m=g(".st-container");g("#menu-trigger").click(function(s){s.stopPropagation();var r=g(this).attr("data-effect");if(!m.hasClass("st-menu-open")){m.add