mirror of
https://github.com/medialab-prado/datamad2017.git
synced 2024-12-26 12:41:23 +01:00
1 line
No EOL
7.5 KiB
JavaScript
1 line
No EOL
7.5 KiB
JavaScript
(function(c){c(document).ready(function(){c(window).load(function(){c("#st-container").removeClass("disable-scrolling");c("#loading-animation").fadeOut();c("#preloader").delay(350).fadeOut(800);a();equalheight(".same-height")});if(c(window).width()>1500){c(".effect-wrapper").addClass("col-lg-3")}if(c(window).width()<768){c(".animated").removeClass("animated").removeClass("hiding");c(".stat span").removeClass("timer");c(".timeslot-label").addClass("stick-label")}if(c(window).height()<512){c("#bottom-navlinks").removeClass("bottom-navlinks").addClass("bottom-navlinks-small")}if(c(window).scrollTop()>=100){c("#top-header").addClass("after-scroll");c("#logo-header .logo").removeClass("logo-light").addClass("logo-dark")}c(window).scroll(function(){var h=c(this).scrollTop();var l=c("#top-header");var k=c("#logo-header .logo");var i=c(".right-nav-button");var j=l.height()+c(".track-header").height();if(h>=100){l.addClass("after-scroll");k.removeClass("logo-light").addClass("logo-dark")}else{l.removeClass("after-scroll");k.removeClass("logo-dark").addClass("logo-light")}if(h>=c(".top-section").height()&&c(window).width()>767){i.removeClass("right-nav-button-hidden")}else{if(h<c(".top-section").height()&&c(window).width()>767){i.addClass("right-nav-button-hidden")}}c(".slot").each(function(){var n=c(this).offset().top-h;var m=j+c(this).find(".slot-title").height();if(n<=m&&n>=0){c(".track-header.sticky").find(".slot-detail").html(c(this).data("slotDetail"))}})});c(window).resize(function(){if(c(window).width()>1500){c(".effect-wrapper").addClass("col-lg-3")}else{c(".effect-wrapper").removeClass("col-lg-3")}if(c(window).width()<768){c(".same-height").css("height","100%");c(".timeslot-label").addClass("stick-label")}else{c(".timeslot-label").removeClass("stick-label");if(e.hasClass("st-menu-open")){e.removeClass("st-menu-open");c("body").css("overflow","auto")}equalheight(".same-height")}if(c(window).height()<512){c(".st-menu").addClass("scrollable");c("#bottom-navlinks").removeClass("bottom-navlinks").addClass("bottom-navlinks-small")}else{c(".st-menu").removeClass("scrollable");c("#bottom-navlinks").removeClass("bottom-navlinks-small").addClass("bottom-navlinks")}});c(function(){c("a[href*=#]:not([href=#])").click(function(){if(location.pathname.replace(/^\//,"")==this.pathname.replace(/^\//,"")&&location.hostname==this.hostname){var h=c(this.hash);h=h.length?h:c("[name="+this.hash.slice(1)+"]");if(h.length){c("html,body").animate({scrollTop:h.offset().top},1000);return false}}})});c(function(){c("a[href=#]").click(function(){event.preventDefault()})});c(function(){if(window.location.href.indexOf("schedule")>-1&&window.location.hash){var h=window.location.hash;c(h).click()}});c(function(){var l,j,k,o,n,h,m;m=c(".appear-animation");for(n=0,h=m.length;n<h;n++){k=m[n];o=k.offsetLeft+k.offsetTop;j=o/1000;c(k).css("transition-delay",""+(j*0.47)+"s");c(k).css("transition-duration",""+0.2+"s")}});c(".appear-animation-trigger").appear(function(){setTimeout(function(){c(".appear-animation-trigger").parent("div").find(".appear-animation").addClass("visible")},1000)});c(".animated").appear(function(){var i=c(this);var j=i.data("animation");var h=i.data("delay");if(h){setTimeout(function(){i.addClass(j+" visible");i.removeClass("hiding");if(i.hasClass("counter")){i.find(".timer").countTo()}},h)}else{i.addClass(j+" visible");i.removeClass("hiding");if(i.hasClass("counter")){i.find(".timer").countTo()}}},{accY:-150});equalheight=function(i){var h=0,j=0,m=new Array(),l,k=0;c(i).each(function(){l=c(this);c(l).height("auto");topPostion=l.position().top;if(j!=topPostion){for(currentDiv=0;currentDiv<m.length;currentDiv++){m[currentDiv].height(h)}m.length=0;j=topPostion;h=l.height();m.push(l)}else{m.push(l);h=(h<l.height())?(l.height()):(h)}for(currentDiv=0;currentDiv<m.length;currentDiv++){m[currentDiv].height(h)}})};var e=c(".st-container");c("#menu-trigger").click(function(h){h.stopPropagation();e.toggleClass("st-menu-open")});c(".st-pusher").click(function(){if(e.hasClass("st-menu-open")){e.removeClass("st-menu-open")}});c(".track-header").each(function(){var i=c(this).closest(".schedule-table").find(".slot").first();var h;while(h===undefined){h=i.data("slotDetail");i=i.next()}c(this).find(".slot-detail").html(h)});c("#post-section .post-body p").each(function(){if(c(this).find(".feature-image").length){var h=c(this).find(".feature-image").prop("src");c("#top-section").css("background-image","url("+h+")").addClass("enable-overlay")}});c(".slider").each(function(){c(this).find(".slider-item").first().addClass("slider-current-item").removeClass("hidden");if(c(this).find(".slider-item").length>1){c(this).closest(".speaker-item").find(".slider-next-item").removeClass("hidden")}});c(".slider-next-item").click(function(){var i=c(this).closest("div");var h=i.find(".slider-current-item").next();if(h.length){h.addClass("slider-current-item").removeClass("hidden");i.find(".slider-current-item").first().removeClass("slider-current-item").addClass("hidden")}else{i.find(".slider-item").first().addClass("slider-current-item").removeClass("hidden");i.find(".slider-current-item").last().removeClass("slider-current-item").addClass("hidden")}});c(".modal").on("hidden.bs.modal",function(){var h=c(this).find("iframe");h.attr("src",h.attr("src"))});c(".slot").click(function(){location.hash=c(this).attr("id")});if(typeof twitterFeedUrl!=="undefined"){c.getJSON(twitterFeedUrl,function(h){c.each(h,function(k,j){var l='<div class="tweet animated fadeInUp hidden"><p class="tweet-text">'+f(j.text)+'</p><p class="tweet-meta">by <a href="https://twitter.com/'+j.user.screen_name+'" target="_blank">@'+j.user.screen_name+"</a></p></div>";c("#tweets").append(l)});g()});function f(m){var j,i,h,l,k;i=/(\b(https?|ftp):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim;j=m.replace(i,'<a href="$1" target="_blank">$1</a>');h=/(^|[^\/])(www\.[\S]+(\b|$))/gim;j=j.replace(h,'$1<a href="http://$2" target="_blank">$2</a>');l=/#(\S*)/g;j=j.replace(l,'<a href="https://twitter.com/search?q=%23$1" target="_blank">#$1</a>');k=/\B@([\w-]+)/gm;j=j.replace(k,'<a href="https://twitter.com/$1" target="_blank">@$1</a>');return j}function g(){var h=c("#tweets").find(".tweet"),k=0;c(h.get(0)).removeClass("hidden");function l(){var i=(++k%h.length);c(h.get(i-1)).addClass("hidden");c(h.get(i)).removeClass("hidden")}var j=setInterval(l,5000)}}});var b={zoomControl:false,scrollWheelZoom:false,zoom:17,minZoom:17,maxZoom:18,dragging:false};if(c(window).width()<768){b.center=[40.41282,-3.69406]}else{b.center=[40.41063,-3.69366]}var d=L.map("canvas-map-osm",b);L.tileLayer("http://{s}.tile.osm.org/{z}/{x}/{y}.png",{attribution:'© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'}).addTo(d);L.marker([40.41082,-3.69366]).addTo(d).bindPopup("Medialab-Prado<br>Plaza de las Letras. Calle Alameda, 15, Madrid");function a(){var e=document.createElement("script");e.type="text/javascript";e.async=true;e.src="https://apis.google.com/js/platform.js";var f=document.getElementsByTagName("script")[0];f.parentNode.insertBefore(e,f)}if(typeof staticGoogleMaps!=="undefined"){c("#canvas-map").addClass("image-section").css("background-image","url(https://maps.googleapis.com/maps/api/staticmap?zoom=17¢er="+mobileCenterMapCoordinates+"&size="+c(window).width()+"x700&scale=2&language=en&markers=icon:"+icon+"|"+eventPlaceCoordinates+"&maptype=roadmap&style=visibility:on|lightness:40|gamma:1.1|weight:0.9&style=element:labels|visibility:off&style=feature:water|hue:0x0066ff&style=feature:road|visibility:on&style=feature:road|element:labels|saturation:-30)")}})(jQuery); |