mirror of
https://github.com/medialab-prado/datamad2017.git
synced 2024-12-27 05:01:23 +01:00
1 line
11 KiB
JavaScript
1 line
11 KiB
JavaScript
|
(function(f){f(document).ready(function(){f("body").css("overflow","hidden");f(window).load(function(){var u=350,s=800;function t(){var w=f("#loading-animation"),v=f("#preloader");w.fadeOut();v.delay(u).fadeOut(s)}f("body").css("overflow","auto");t();q()});if(f(window).width()>1500){f(".team-item-wrapper").each(function(){f(this).addClass("col-lg-3")})}if(f(window).width()<768){f(".animated").removeClass("animated").removeClass("hiding");f(".stat span").removeClass("timer")}if(f(window).height()<512){f("#bottom-navlinks").removeClass("bottom-navlinks").addClass("bottom-navlinks-small")}if(f(window).scrollTop()>=100){f("#top-header").addClass("after-scroll");f("#logo-header").removeClass("logo-light").addClass("logo-dark")}f(window).scroll(function(){var s=f(this).scrollTop();var w=f("#top-header");var u=f("#logo-header");var v=u.attr("src");var t=f("#buy-tickets-button");if(s>=100){w.addClass("after-scroll");u.removeClass("logo-light").addClass("logo-dark")}else{w.removeClass("after-scroll");if(!w.hasClass("dark-header")){u.removeClass("logo-dark").addClass("logo-light")}}if(s>=f(window).height()){t.fadeIn(400);t.removeClass("hidden")}else{t.fadeOut(400,function(){t.addClass("hidden")})}});f(function(){var t=[];f(".rockstar-speakers-item").each(function(){t[t.length]=f(this).attr("data-id")});t=p(t);for(var s=0;s<4;s++){f("#rockstar-speaker-"+t[s]).removeClass("hidden")}});function p(v){for(var t,s,u=v.length;u;t=parseInt(Math.random()*u),s=v[--u],v[u]=v[t],v[t]=s){}return v}var m=parseInt(f(".increment-animation").attr("data-delay"));f(".increment-animation").not("hidden").each(function(s){f(this).attr("data-delay",s*m)});f(".animated").appear(function(){var t=f(this);var u=t.data("animation");var s=t.data("delay");if(s){setTimeout(function(){t.addClass(u+" visible");t.removeClass("hiding");if(t.hasClass("counter")){t.find(".timer").countTo()}},s)}else{t.addClass(u+" visible");t.removeClass("hiding");if(t.hasClass("counter")){t.find(".timer").countTo()}}},{accY:-150});f(function(){f("a[href*=#]:not([href=#])").click(function(){if(location.pathname.replace(/^\//,"")==this.pathname.replace(/^\//,"")&&location.hostname==this.hostname){var s=f(this.hash);s=s.length?s:f("[name="+this.hash.slice(1)+"]");if(s.length){f("html,body").animate({scrollTop:s.offset().top},1000);return false}}})});f(function(){f("a[href=#]").click(function(){event.preventDefault()})});function q(){if(f(window).width()>767){f(".same-height-wrapper").each(function(){var s=0;f(".same-height").each(function(){var t=f(this).height();if(t>s){s=t}});f(".same-height").each(function(){f(this).height(s)})})}}f("#post-section .post-body p").each(function(){if(f(this).find(".feature-image").length){var s=f(this).find(".feature-image").prop("src");f("#top-section").css("background-image","url("+s+")").addClass("enable-overlay")}});f(".slider").each(function(){f(this).find(".slider-item").first().addClass("slider-current-item").removeClass("hidden");if(f(this).find(".slider-item").length>1){f(this).closest(".speaker-item").find(".slider-next-item").removeClass("hidden")}});f(".slider-next-item").click(function(){var s=f(this).closest(".speaker-item");var t=s.find(".slider-current-item").next();if(t.length){t.addClass("slider-current-item").removeClass("hidden");s.find(".slider-current-item").first().removeClass("slider-current-item").addClass("hidden")}else{s.find(".slider-item").first().addClass("slider-current-item").removeClass("hidden");s.find(".slider-current-item").last().removeClass("slider-current-item").addClass("hidden")}});var l=f(".st-container");f("#menu-trigger").click(function(t){t.stopPropagation();var v=f(window).scrollTop();var u=f(window).scrollLeft();var s=f(this).attr("data-effect");if(!l.hasClass("st-menu-open")){l.addClass(s).delay(25).addClass("st-menu-open");f("body").css("overflow","hidden")}else{l.removeClass("st-menu-open");f("body").css("overflow","auto")}});f(".st-pusher").click(function(){if(l.hasClass("st-menu-open")){l.removeClass("st-menu-open");f("body").css("overflow","auto")}});f(window).resize(function(){if(f(window).width()>
|