mirror of
https://github.com/ianramzy/decentralized-video-chat.git
synced 2024-11-15 14:49:21 +08:00
1 line
7.5 KiB
JavaScript
1 line
7.5 KiB
JavaScript
|
!function(){"use strict";const e=document.getElementsByClassName("accordion-header");function t(e,t){e.classList.add("is-active"),t.style.maxHeight=t.scrollHeight+"px"}function n(e,t){e.classList.remove("is-active"),t.style.maxHeight=null}if(e.length>0)for(let i=0;i<e.length;i++){const s=e[i],a=s.parentNode,l=s.nextElementSibling;a.classList.contains("is-active")&&t(a,l),s.addEventListener("click",function(){a.classList.contains("is-active")?n(a,l):t(a,l)})}}(),function(){"use strict";let e={touchStartX:0,touchEndX:0,minSwipePixels:30,detectionZone:void 0,swipeCallback:function(){},init:function(t,n){e.swipeCallback=n,t.addEventListener("touchstart",function(t){e.touchStartX=t.changedTouches[0].screenX},!1),t.addEventListener("touchend",function(t){e.touchEndX=t.changedTouches[0].screenX,e.handleSwipeGesture()},!1)},handleSwipeGesture:function(){let t,n;e.touchEndX<=e.touchStartX&&(n=e.touchStartX-e.touchEndX,t="left"),e.touchEndX>=e.touchStartX&&(n=e.touchEndX-e.touchStartX,t="right"),n>e.minSwipePixels&&"undefined"!==t&&e.swipe(t,n)},swipe:function(t,n){let i={};i.direction=t,i.movedPixels=n,e.swipeCallback(i)}};const t=document.getElementsByClassName("carousel-items");function n(e,t){void 0===t&&(t="next");let n=e.getElementsByClassName("carousel-item is-active")[0],i="next"===t?n.nextElementSibling:n.previousElementSibling,s=n.getAttribute("data-carousel"),a=e.parentNode.getElementsByClassName("carousel-bullet")[s],l="next"===t?a.nextElementSibling:a.previousElementSibling;n.classList.remove("is-active"),a.classList.remove("is-active"),i?(i.classList.add("is-active"),l.classList.add("is-active")):"next"===t?(e.firstElementChild.classList.add("is-active"),e.parentNode.getElementsByClassName("carousel-bullets")[0].firstElementChild.classList.add("is-active")):(e.lastElementChild.classList.add("is-active"),e.parentNode.getElementsByClassName("carousel-bullets")[0].lastElementChild.classList.add("is-active"))}function i(e,t){let n,i=0;for(let e=0;e<t.length;e++)t[0].parentNode.style.minHeight=i+"px",t[e].classList.add("is-loading"),n=t[e].offsetHeight,t[e].classList.remove("is-loading"),n>i&&(i=n);t[0].parentNode.style.minHeight=i+"px"}function s(e){e&&clearInterval(e)}if(t.length>0)for(let a=0;a<t.length;a++){let l=t[a],c=l.getElementsByClassName("carousel-item"),o=0,r=l.getAttribute("data-autorotate");const d=document.createElement("div");d.className="carousel-bullets",l.parentNode.insertBefore(d,l.nextSibling);for(let e=0;e<c.length;e++){c[e].setAttribute("data-carousel",e),c[e].classList.contains("is-active")&&(o=e);let t=document.createElement("button");t.className="carousel-bullet",t.setAttribute("data-bullet",e),l.parentNode.getElementsByClassName("carousel-bullets")[0].appendChild(t)}c[o].classList.add("is-active");let u=l.parentNode.getElementsByClassName("carousel-bullet");u[o].classList.add("is-active"),i(0,c),window.addEventListener("resize",function(){i(0,c)});let m=!1;r&&(m=setInterval(function(){n(l,"next")},r));for(let e=0;e<u.length;e++){let t=u[e];t.addEventListener("click",function(e){if(e.preventDefault(),t.classList.contains("is-active"))return;for(let e=0;e<u.length;e++)u[e].classList.remove("is-active");for(let e=0;e<c.length;e++)c[e].classList.remove("is-active");let n=this.getAttribute("data-bullet");c[n].classList.add("is-active"),this.classList.add("is-active"),s(m)})}e.init(l,function(e){"left"===e.direction?n(l,"next"):"right"===e.direction&&n(l,"prev"),s(m)})}}(),function(){"use strict";document.documentElement.classList.remove("no-js"),document.documentElement.classList.add("js"),window.addEventListener("load",function(){document.body.classList.add("is-loaded")})}(),function(){"use strict";const e=document.getElementById("header-nav-toggle"),t=document.getElementById("header-nav");e&&(e.addEventListener("click",function(){document.body.classList.toggle("off-nav-is-active"),t.classList.toggle("is-active"),t.style.maxHeight?t.style.maxHeight=null:t.style.maxHeight=t.scrollHeight+"px","true"===this.getAttribute("aria-expanded")?this.setAttribute("aria-expanded","false"):this.setAttribute("ari
|