You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
22 KiB
JavaScript

function getCookie(e){"use strict";var t=null;if(document.cookie&&""!==document.cookie)for(var n=document.cookie.split(";"),i=0;i<n.length;i++){var o=jQuery.trim(n[i]);if(o.substring(0,e.length+1)===e+"="){t=decodeURIComponent(o.substring(e.length+1));break}}return t}function setCookie(e,t,n){"use strict";var i=new Date;i.setTime(i.getTime()+24*n*60*60*1e3),document.cookie=e+"="+t+";path=/;expires="+i.toUTCString()}function deleteCookie(e){setCookie(e,0,-1)}function csrfSafeMethod(e){"use strict";return/^(GET|HEAD|OPTIONS|TRACE)$/.test(e)}parent.location!=self.location&&(parent.location=self.location);var csrftoken=getCookie("csrftoken");function init_map(){var n,i,o,a={lat:47.20388,lng:8.58176},e=840<$(window).width()?{lat:a.lat,lng:a.lng+.06}:{lat:a.lat-.06,lng:a.lng},t=new google.maps.Map(document.getElementById("map"),{zoom:12,center:e,disableDefaultUI:!0,scrollwheel:!1,zoomControl:!0,zoomControlOptions:{position:google.maps.ControlPosition.RIGHT_TOP},styles:[{featureType:"administrative.neighborhood",stylers:[{visibility:"off"}]},{featureType:"poi",elementType:"labels.text",stylers:[{visibility:"off"}]},{featureType:"road",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"water",elementType:"labels.text",stylers:[{visibility:"off"}]}]}),e={url:"/static/img/marker.png",size:new google.maps.Size(50,60),origin:new google.maps.Point(0,0),anchor:new google.maps.Point(25,60),scaledSize:new google.maps.Size(50,60)},r=(new google.maps.Marker({position:a,map:t,icon:e}),document.getElementById("journey_calculator__input"));r&&(n=r.parentNode.querySelector(".journey_calculator__result"),(i=new google.maps.places.Autocomplete(r,{types:["geocode"],componentRestrictions:{country:"ch"}})).addListener("place_changed",function(){r.parentNode.classList.remove("error"),r.parentNode.classList.add("loaded"),n.classList.add("loading");var e=i.getPlace();e.geometry||(r.blur(),r.parentNode.classList.add("error"));var t="https://www.google.com/maps/dir/?api=1&origin="+r.value+"&origin_place_id="+e.id+"&destination="+encodeURI("Tagesschule Elementa, Sarbachstrasse 8, 6345 Neuheim");$(".journey_calculator__button").attr("href",t);t=new google.maps.LatLng(e.geometry.location.lat(),e.geometry.location.lng()),e=new google.maps.LatLng(a);(new google.maps.DistanceMatrixService).getDistanceMatrix({origins:[t],destinations:[e],travelMode:"DRIVING"},function(t,e){window.clearTimeout(o),o=window.setTimeout(function(){var e=t.rows[0].elements[0].duration.value,e=Math.round(e/60);n.setAttribute("data-duration",e),n.classList.remove("loading")},300)})}))}$(function(){"use strict";$.ajaxSetup({crossDomain:!1,beforeSend:function(e,t){csrfSafeMethod(t.type)||e.setRequestHeader("X-CSRFToken",csrftoken)}})}),window.transitionend="webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend",window.on_transitionend=function(e,t){Modernizr.csstransitions?e.on(window.transitionend,t):t(!1)},$(function(){var a=$("body");window.enable_touch_swipe=function(e,t,n){var i=0,o=0;a.on("touchstart",e,function(e){i=e.originalEvent.touches[0].pageX}),a.on("touchmove",e,function(e){o=e.originalEvent.touches[0].pageX-i}),a.on("touchend",e,function(e){50<o?t($(this)):o<-50&&n($(this)),o=0})},window.document_height=$(document).height(),window.window_height=$(window).height(),window.window_width=$(window).width(),window.scroll_top=$(window).scrollTop(),$(window).on("scroll",function(e){window.scroll_top=$(window).scrollTop()}),$(window).on("resize",function(e){window.document_height=$(document).height(),window.window_height=$(window).height(),window.window_width=$(window).width()})}),$(function(){function e(e){e.find(".reveal_container").each(function(){var e=this,t=scrollMonitor.create(e);t.enterViewport(function(){n(e)}),t.fullyEnterViewport(function(){n(e)})}),e.find(".reveal_self").each(function(){var e=this,t=scrollMonitor.create(e);t.enterViewport(function(){i(e)}),t.fullyEnterViewport(function(){i(e)})})}function t(e){e&&e.target!==this||($(this).removeClass("reveal_animation"),$(this).off(window.transitionend,t))}function n(e){$(e).find(".reveal").each(function(){i(this)})}function i(e){window.requestAnimationFrame(function(){window.on_transitionend($(e),t),$(e).removeClass("reveal")})}e($("html")),window.create_reveal_elements=e,i($(".header")),i($(".header__logo")),n($(".timetable__clock__frame")),i($(".timetable__next")),i($(".timetable__button")),i($(".timetable__start__background"))}),$(function(){$("body").find(".animated_icon").each(function(){$(this).html("");var e=$(this).attr("data-icon");bodymovin.loadAnimation({container:this,path:"/static/animation/"+e+".json",renderer:"svg",loop:!0,autoplay:!0})})}),$(function(){var e,t=$("body"),i=$(".content__navigation"),n=$(".content"),o="content__navigation__anchor";if(0===i.length)return!1;n.find(".section").each(function(){var e=$(this),t=e.attr("id"),n=e.find("h2").text(),t='<a class="'+o+'" href="#'+t+'">'+n+"</a>";i.find("ul").append("<li>"+t+"</li>"),e.find(".section__title__content").html(n)}),window.location.hash&&(e=window.location.hash,window.requestAnimationFrame(function(){window.location.hash=e})),t.on("click","."+o,function(e){e.preventDefault();e=$(this);i.find(".active").removeClass("active"),e.addClass("active"),TweenLite.to(window,.5,{scrollTo:e.attr("href")})}),n.find(".section").each(function(){var e=this;scrollMonitor.create(e).fullyEnterViewport(function(){i.find(".active").removeClass("active"),i.find('a[href="#'+$(e).attr("id")+'"]').addClass("active")})});var a=i.offset().top;$(window).on("resize",function(){a=i.offset().top});var r=$(".content__navigation__progress__fill");!function e(){var t;window.navigation_is_open||(t=Math.round(100/window.document_height*(window.scroll_top+window.window_height)),r.height(t+"%"),a&&window.scroll_top>=a?i.addClass("fixed"):i.removeClass("fixed")),window.requestAnimationFrame(e)}()}),$(function(){"use strict";var e=$("body");e.on("click",".control__item__open",function(e){e.preventDefault();var e=$(this),i=e.parents(".control__item");i.addClass("loading"),$.get(e.attr("data-href"),function(e){var t=i.find(".control__item__content"),n=t.find(".control__item__content__main"),e=e.replace(/autofocus/g,"");n.html(e),t.height(n.outerHeight(!0)),i.addClass("active"),window.on_transitionend(t,function(e){e&&e.target!==this||(t.off(window.transitionend),t.removeAttr("style"),i.removeClass("loading"))})})}),e.on("click",".control__item__close",function(e){e.preventDefault();var t=$(this).parents(".control__item"),n=t.find(".control__item__content"),i=n.find(".control__item__content__main");n.height(i.outerHeight(!0)),window.on_transitionend(n,function(e){e&&e.target!==this||(n.off(window.transitionend),i.html(""))}),window.requestAnimationFrame(function(){t.removeClass("active"),n.removeAttr("style")})}),e.on("submit",".control__item form",function(e){e.preventDefault();var t=$(this);t.addClass("loading"),$.ajax({type:t.attr("method"),url:t.attr("action"),data:t.serialize(),success:function(e){t.replaceWith(e)}})});e=$(".task__form");e.hasClass("errors")&&(window.location="#form"),e.on("formAdded",function(e){var t=$(e.target).find("h3"),e=parseInt(t.attr("data-id").match(/\d+/)[0]);t.html(t.html().replace("%(id)",e+1))}),e.on("formDeleted",function(e){$(e.target).hide()}),$(".downloads__frame").each(function(){var l=$(this),c=[];l.find(".download__item__title").each(function(){var e;e=(e=(e=$(this).text().toLowerCase())+" "+$(this).next().text().toLowerCase())+" "+$(this).next().next().text().toLowerCase(),c.push({$element:$(this).parents("li"),text:e})}),l.on("input",".downloads_search",function(e){for(var t=$(this).val().toLowerCase(),n=$.trim(t).split(" "),i=[],o=0;o<c.length;o++)for(var a=c[o],r=0;r<n.length;r++){var s=n[r];0<=a.text.indexOf(s)&&i.push(a.$element)}for(l.find("li").each(function(){$(this).parents(".downloads__section").css("display","none"),$(this).css("display","none")}),o=0;o<i.length;o++)i[o].removeAttr("style"),i[o].parents(".downloads__section").removeAttr("style")}),l.find("#downloads_search").trigger("input")})});var initPhotoSwipeFromDOM=function(s){function l(e,t){return e&&(t(e)?e:l(e.parentNode,t))}function e(e){(e=e||window.event).preventDefault?e.preventDefault():e.returnValue=!1;var e=e.target||e.srcElement,t=l(e,function(e){return e.tagName&&"FIGURE"===e.tagName.toUpperCase()});if(t){for(var n,e=$(t).parents(s)[0],i=e.querySelectorAll("figure"),o=i.length,a=0,r=0;r<o;r++)if(1===i[r].nodeType){if(i[r]===t){n=a;break}a++}return 0<=n&&c(n,e),!1}}function c(e,t,n,i){var o=document.querySelectorAll(".pswp")[0],a=d(t),r={showHideOpacity:!0,shareButtons:[{id:"download",label:"Bild herunterladen",url:"{{raw_image_url}}",download:!0}],galleryUID:t.getAttribute("data-pswp-uid"),getThumbBoundsFn:function(e){var t=a[e].el.getElementsByTagName("img")[0],e=window.pageYOffset||document.documentElement.scrollTop,t=t.getBoundingClientRect();return{x:t.left,y:t.top+e,w:t.width}}};if(i)if(r.galleryPIDs){for(var s=0;s<a.length;s++)if(a[s].pid==e){r.index=s;break}}else r.index=parseInt(e,10)-1;else r.index=parseInt(e,10);isNaN(r.index)||(n&&(r.showAnimationDuration=0),new PhotoSwipe(o,PhotoSwipeUI_Default,a,r).init())}for(var d=function(e){for(var t,n,i,o=e.querySelectorAll("figure"),a=o.length,r=[],s=0;s<a;s++)1===(t=o[s]).nodeType&&(i=(n=t.children[0]).getAttribute("data-size").split("x"),i={src:n.getAttribute("href"),w:parseInt(i[0],10),h:parseInt(i[1],10)},1<t.children.length&&(i.title=t.children[1].innerHTML),0<n.children.length&&(i.msrc=n.children[0].getAttribute("src")),i.el=t,r.push(i));return r},t=document.querySelectorAll(s),n=0,i=t.length;n<i;n++)t[n].setAttribute("data-pswp-uid",n+1),t[n].onclick=e;var o=function(){var e=window.location.hash.substring(1),t={};if(e.length<5)return t;for(var n,i=e.split("&"),o=0;o<i.length;o++)i[o]&&((n=i[o].split("=")).length<2||(t[n[0]]=n[1]));return t.gid&&(t.gid=parseInt(t.gid,10)),t}();o.pid&&o.gid&&c(o.pid,t[o.gid-1],!0,!0)};initPhotoSwipeFromDOM(".gallery");var search=window.location.search;-1===search.indexOf("?page=1")&&(0<=search.indexOf("?page=")||0<=search.indexOf("&page="))&&(document.getElementsByTagName("body")[0].classList.add("hidden"),window.location=window.location.pathname),$(function(){"use strict";function a(){$(".load__replace--auto").each(function(){var e=this;scrollMonitor.create(e).enterViewport(function(){$(e).find("a").trigger("click")})})}$("body").on("click",".list__button",function(e){e.preventDefault();var t=$(this),o=t.parents(".load__frame");t.width(t.width()),window.requestAnimationFrame(function(){o.addClass("loading"),o.height(o.outerHeight());var n=o.attr("id"),i=t.parents(".load__replace");$.get(t.attr("href"),function(e){var t=$(e).find("#"+n+" .load__main").html();o.addClass("loaded"),window.setTimeout(function(){i.replaceWith(t),window.on_transitionend(o,function(e){e&&e.target!==this||(o.removeAttr("style"),o.removeClass("loading loaded"),o.off(window.transitionend))}),o.height(o.find(".load__main").height()),window.create_reveal_elements(o),a()},200)})})}),a()}),$(function(){var a=$("body"),t=$("#canvas"),n=$("#navigation");window.onpageshow=function(e){e.persisted&&window.location.reload()},a.on("click","a",function(e){var t=$(this).attr("href"),n=$(this).attr("target"),i=$(this).hasClass("event"),o=$(this).hasClass("button--load");0!==t.indexOf("/")||o||n||i||e.ctrlKey||e.metaKey||e.altKey||e.shiftKey||$("html").hasClass("cms-ready")||(e.preventDefault(),a.addClass("unload loading"),window.setTimeout(function(){window.location=t},50))}),a.on("click",".navigation__item__title",function(e){e.preventDefault();var t=$(this),n=t.parents(".navigation__main");n.attr("data-active")?n.removeAttr("data-active"):(n.attr("data-active",""),window.setTimeout(function(){n.attr("data-active",t.attr("data-id"))},220))}),a.on("mouseenter",".navigation__item",function(e){var t=$(this);t.parents(".navigation__main").attr("data-focus",t.attr("data-id"))}),a.on("mouseleave",".navigation__item",function(e){$(this).parents(".navigation__main").removeAttr("data-focus")}),a.on("mouseenter",".navigation__item__list a",function(e){var t=$(this);t.parents(".navigation__main").attr("data-hover",t.parents(".navigation__item").attr("data-id"))}),a.on("mouseleave",".navigation__item__list a",function(e){$(this).parents(".navigation__main").removeAttr("data-hover")}),a.on("click",".header__button--navigation",function(e){a.hasClass("search_open")?a.hasClass("_search")||a.hasClass("search_results")?($(this).removeClass("event"),$(this).click()):(e.preventDefault(),window.close_search()):a.hasClass("navigation_open")?(e.preventDefault(),function(){a.removeClass("notification_open"),n.removeAttr("style");var e=n.find(".navigation__main");a.removeClass("navigation_open"),window.requestAnimationFrame(function(){e.removeAttr("data-focus"),e.removeAttr("data-hover"),e.removeAttr("data-active"),t.removeAttr("style"),$(window).scrollTop(i),window.navigation_is_open=!1,window.timetable_can_scroll=!0})}()):(e.preventDefault(),window.timetable_can_scroll=!1,window.navigation_is_open=!0,a.removeClass("notification_open"),window.on_transitionend(n,function(){window.requestAnimationFrame(function(){n.css("position","relative"),n.off(window.transitionend)})}),window.requestAnimationFrame(function(){i=$(window).scrollTop(),t.css({top:-1*i,position:"fixed"}),window.requestAnimationFrame(function(){a.addClass("navigation_open")})}))});var i=0}),$(function(){var t=$("body"),n="last_notification_update",e=getCookie(n),i=$(".header__button--notification"),o=i.attr("data-updated");e!==o&&i.addClass("new"),t.on("click",".header__button--notification",function(e){e.preventDefault(),setCookie(n,o,90),$(this).removeClass("new"),t.toggleClass("notification_open")}),t.on("click",".notification__close",function(e){e.preventDefault(),t.removeClass("notification_open")})}),$(function(){var t=$("body"),n=$("#privacy-message"),i="tracking-accepted";window.privacy_accepted=getCookie(i),null===window.privacy_accepted?(n.removeAttr("style"),t.on("click",".privacy_action--accept",function(e){e.preventDefault(),setCookie(i,"true",60),n.remove(),t.trigger("enable_tracking")}),t.on("click",".privacy_action--decline",function(e){e.preventDefault(),setCookie(i,"false",60),n.remove()}),t.on("click",".privacy_action--close",function(e){e.preventDefault(),n.remove()})):(window.privacy_accepted="true"===window.privacy_accepted,n.remove())}),$(function(){var s=[];function n(){s=[];for(var e=document.querySelectorAll(".scroll"),t=0;t<e.length;t++){var n=e[t],i=n.offsetHeight,o=$(n).offset().top+i/2,i=(i=parseFloat(n.getAttribute("data-ease-multiplier")))||1;s.push({offset:o,element:n,mod:n.getAttribute("data-scroll-mod"),ease_multiplier:i})}}window.prevent_scroll_calc=!1,0<$("#timetable").length&&(window.prevent_scroll_calc=!0),window.prevent_scroll_calc||n(),window.calc_scrolls=n;var l=0;function i(){var e=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,t=document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop;l=t+e/2;for(var n=0;n<s.length;n++){var i=s[n],o=i.offset-l,a="translateY",r="px",o=(o*=.05)*i.ease_multiplier;"rotate"===i.mod&&(a="rotate",r="deg"),"horizontal"===i.mod&&(a="translateX"),i.element.style.transform=a+"("+o+r+")",i.element.style.webkitTransform=a+"("+o+r+")",i.element.style.MozTransform=a+"("+o+r+")",i.element.style.msTransform=a+"("+o+r+")",i.element.style.OTransform=a+"("+o+r+")"}}window.requestAnimationFrame(function e(){window.navigation_is_open||i(),window.requestAnimationFrame(e)});var o=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;window.addEventListener("resize",function(e){var t=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;if(document.querySelector("html").classList.contains("touchevents")&&o===t)return!1;o=t,window.prevent_scroll_calc||n(),window.requestAnimationFrame(function(){i()})},!1)}),$(function(){var o=$("body"),t=$("#canvas");o.on("click",".header__button--search",function(e){e.preventDefault(),window.timetable_can_scroll=!1,window.navigation_is_open=!0,window.requestAnimationFrame(function(){i=$(window).scrollTop(),t.css({top:-1*i,position:"fixed"}),window.requestAnimationFrame(function(){o.addClass("search_open"),window.clearTimeout(n),n=window.setTimeout(function(){o.find("#search__query").focus()},800)})})});var n,i=0;window.close_search=function(){window.clearTimeout(n),o.find("#search__query").blur(),window.requestAnimationFrame(function(){o.removeClass("search_open"),t.removeAttr("style"),$(window).scrollTop(i),window.navigation_is_open=!1,window.timetable_can_scroll=!0})},o.on("submit",".search__form",function(e){e.preventDefault();var t=$(this);o.find("#search__query").blur();var n,i=t.attr("action"),e=t.serialize();history.pushState({},"search",i+"?"+e),"q="!==e?((n=o.find(".search__content__main")).addClass("loading"),$.ajax({type:t.attr("method"),url:i,data:e,success:function(e){o.find("#canvas").remove(),o.addClass("_search"),n.removeClass("loading"),o.find(".search__results").replaceWith($(e).find(".search__results")),window.requestAnimationFrame(function(){o.addClass("search_results")})}})):o.removeClass("search_results")})}),$(function(){$("body").on("click",".search__contest__item",function(e){e.preventDefault(),$(this).hide()})}),$(function(){$("body").on("submit",".form",function(e){e.preventDefault();var t=$(this),n=t.attr("id");t.addClass("loading"),$.ajax({type:t.attr("method"),url:t.attr("action"),data:t.serialize(),success:function(e){django_recaptcha_callbacks=[];e=$(e).find("#"+n);e.find(".reveal").each(function(){$(this).removeClass("reveal reveal_animation")}),e.removeClass("reveal reveal_animation"),t.replaceWith(e),djangoRecaptchaOnLoadCallback()}})})}),$(function(){$("body").on("click",".reference_list__item",function(e){e.preventDefault();var t,n=$(this),i=n.parents(".reference_list"),e=i.attr("data-active"),n=n.parents(".reference_list__item__frame").attr("data-id");e&&(t=i.find(".reference_list__video__item.data_id_"+e).find("iframe").get(0),new Vimeo.Player(t).pause()),"x"===n?i.removeAttr("data-active"):(i.attr("data-active",n),t=i.find(".reference_list__video__item.data_id_"+n).find("iframe").get(0),new Vimeo.Player(t).play())})}),$(function(){var e=$("body");function n(e){var t=parseInt(e.attr("data-active"));0<t&&window.requestAnimationFrame(function(){e.attr("data-active",t-1)})}function i(e){var t=parseInt(e.attr("data-active")),n=parseInt(e.attr("data-last"));t<n&&window.requestAnimationFrame(function(){e.attr("data-active",t+1)})}e.on("click",".slider__navigation",function(e){e.preventDefault();var t=$(this),e=t.parents(".slider");0===e.length&&(e=t.parents(".text_slider")),(t.hasClass("slider__navigation--prev")?n:i)(e)}),e.on("click",".slider__next",function(e){e.preventDefault(),i($(this).parents(".slider"))}),window.enable_touch_swipe(".slider",n,i),window.enable_touch_swipe(".text_slider",n,i)}),$(function(){var t=$("body"),i=$("#timetable");if(0===i.length)return!1;$(window).scrollTop(0),window.timetable_can_scroll=!1,window.setTimeout(function(){window.timetable_can_scroll=!0},2500);var n=!1;function o(){i.attr("data-active",1),i.find(".timetable__item").each(function(){$(this).addClass("reveal_container")}),window.setTimeout(function(){i.addClass("active"),window.requestAnimationFrame(function(){i.find(".timetable__item").each(function(){var e=parseInt($(this).attr("data-id"));scrollMonitor.create(this).enterViewport(function(){f(e)})}),window.create_reveal_elements(i),window.prevent_scroll_calc=!1,window.calc_scrolls(),n=!0})},1500)}window.requestAnimationFrame(function e(){window.navigation_is_open||(n?$(window).scrollTop()<.05*$(window).height()&&window.timetable_can_scroll&&(t.removeClass("notification_open"),window.prevent_scroll_calc=!0,i.attr("data-active",0),i.removeClass("active"),n=!1):$(window).scrollTop()>.05*$(window).height()&&window.timetable_can_scroll&&(t.removeClass("notification_open"),o())),window.requestAnimationFrame(e)});var a=0,r=parseInt(i.attr("data-last")),s=document.getElementsByClassName("timetable__item"),l=$(".timetable__next"),c=$("#timetable__clock__digital__time"),d=$("#timetable__clock__progress"),u=parseFloat(d.attr("stroke-dasharray"));function f(e){var t,n;e<=r&&0<=e&&(a=e,i.attr("data-active",a),a===r?l.addClass("hidden"):l.removeClass("hidden"),t=$(s[a-1]),n=60*parseInt(t.attr("data-hour"))+parseInt(t.attr("data-minute")),e=1/720*(n-360),t=c.text().split(":"),t=60*parseInt(t[0])+parseInt(t[1]),new CountUp("timetable__clock__digital__time",t,n,0,1.5,{useEasing:!0,separator:""}).start(),n&&d.attr("stroke-dashoffset",u*Math.abs(e-1)))}t.on("click",".timetable__next",function(e){e.preventDefault(),n||($(window).scrollTop($(window).height()),o())}),document.querySelector(".timetable__button a").addEventListener("click",function(e){e.preventDefault();var t=document.querySelector(".timetable__button").getAttribute("data-video-vimeo-id"),e=document.querySelectorAll(".pswp")[0],t=new PhotoSwipe(e,PhotoSwipeUI_Default,[{html:'<div class="gallery__iframe"><div class="gallery__iframe__main"><iframe src="https://player.vimeo.com/video/'+t+'" width="100%" height="100%" frameborder="0" allow="autoplay; fullscreen" allowfullscreen></iframe></div></div>'}],{showHideOpacity:!0,download:!1,fullscreenEl:!1,shareEl:!1});t.listen("close",function(){document.querySelector("#timetable").style.height="",n.pause()}),t.init(),document.querySelector("#timetable").style.height="100%";var n,t=document.querySelector(".pswp iframe");(n=new Vimeo.Player(t)).play()})}),$(function(){$("body").find(".video").each(function(){var e=$(this),t=this.querySelector("iframe"),n=new Vimeo.Player(t),i=!1;e.on("click",".video__thumbnail",function(e){e.preventDefault(),i?n.pause():n.play()}),n.on("play",function(){i=!0,window.requestAnimationFrame(function(){e.addClass("playing")})}),n.on("pause",function(){i=!1,window.requestAnimationFrame(function(){e.removeClass("playing")})}),n.on("ended",function(){i=!1,window.requestAnimationFrame(function(){e.removeClass("playing")})})})});