datamad2017/js/scripts.min.js

1 line
12 KiB
JavaScript
Raw Normal View History

2017-10-11 00:10:22 +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 q=g(this).scrollTop();var u=g("#top-header");var t=g("#logo-header .logo");var r=g(".right-nav-button");var s=u.height()+g(".track-header").height();if(q>=100){u.addClass("after-scroll");t.removeClass("logo-light").addClass("logo-dark")}else{u.removeClass("after-scroll");t.removeClass("logo-dark").addClass("logo-light")}if(q>=g(".top-section").height()&&g(window).width()>767){r.removeClass("right-nav-button-hidden")}else{if(q<g(".top-section").height()&&g(window).width()>767){r.addClass("right-nav-button-hidden")}}g(".slot").each(function(){var w=g(this).offset().top-q;var v=s+g(this).find(".slot-title").height();if(w<=v&&w>=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(n.hasClass("st-menu-open")){n.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")}});g(function(){g("a[href*=#]:not([href=#])").click(function(){if(location.pathname.replace(/^\//,"")==this.pathname.replace(/^\//,"")&&location.hostname==this.hostname){var q=g(this.hash);q=q.length?q:g("[name="+this.hash.slice(1)+"]");if(q.length){g("html,body").animate({scrollTop:q.offset().top},1000);return false}}})});g(function(){g("a[href=#]").click(function(){event.preventDefault()})});g(function(){if(window.location.href.indexOf("schedule")>-1&&window.location.hash){var q=window.location.hash;g(q).click()}});g(function(){var t,r,s,w,v,q,u;u=g(".appear-animation");for(v=0,q=u.length;v<q;v++){s=u[v];w=s.offsetLeft+s.offsetTop;r=w/1000;g(s).css("transition-delay",""+(r*0.47)+"s");g(s).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 r=g(this);var s=r.data("animation");var q=r.data("delay");if(q){setTimeout(function(){r.addClass(s+" visible");r.removeClass("hiding");if(r.hasClass("counter")){r.find(".timer").countTo()}},q)}else{r.addClass(s+" visible");r.removeClass("hiding");if(r.hasClass("counter")){r.find(".timer").countTo()}}},{accY:-150});equalheight=function(r){var q=0,s=0,v=new Array(),u,t=0;g(r).each(function(){u=g(this);g(u).height("auto");topPostion=u.position().top;if(s!=topPostion){for(currentDiv=0;currentDiv<v.length;currentDiv++){v[currentDiv].height(q)}v.length=0;s=topPostion;q=u.height();v.push(u)}else{v.push(u);q=(q<u.height())?(u.height()):(q)}for(currentDiv=0;currentDiv<v.length;currentDiv++){v[currentDiv].height(q)}})};var n=g(".st-container");g("#menu-trigger").click(function(q){q.stopPropagation();n.toggleClass("st-menu-open")});g(".st-pusher").click(function(){if(n.hasClass("st-menu-open")){n.removeClass("st-menu-open")}});g(".track-header").each