-
Notifications
You must be signed in to change notification settings - Fork 0
/
dlwDemoWebComp.min.js
1 lines (1 loc) · 2.28 KB
/
dlwDemoWebComp.min.js
1
const observer=new IntersectionObserver(e=>{e.forEach(e=>{if(e.isIntersecting)e.target.classList.add("show-on-scroll")})});let hiddenElements=document.querySelectorAll(".hidden-on-scroll");hiddenElements.forEach(e=>observer.observe(e));const observerLeft=new IntersectionObserver(e=>{e.forEach(e=>{if(e.isIntersecting)e.target.classList.add("show-on-scroll-left")})});let hiddenElementsLeft=document.querySelectorAll(".hidden-on-scroll-left");hiddenElementsLeft.forEach(e=>observerLeft.observe(e));const observerRight=new IntersectionObserver(e=>{e.forEach(e=>{if(e.isIntersecting)e.target.classList.add("show-on-scroll-right")})});let hiddenElementsRight=document.querySelectorAll(".hidden-on-scroll-right");hiddenElementsRight.forEach(e=>observerRight.observe(e));const observerTop=new IntersectionObserver(e=>{e.forEach(e=>{if(e.isIntersecting)e.target.classList.add("show-on-scroll-top")})});let hiddenElementsTop=document.querySelectorAll(".hidden-on-scroll-top");hiddenElementsTop.forEach(e=>observerTop.observe(e));const observerBottom=new IntersectionObserver(e=>{e.forEach(e=>{if(e.isIntersecting)e.target.classList.add("show-on-scroll-bottom")})});let hiddenElementsBottom=document.querySelectorAll(".hidden-on-scroll-bottom");hiddenElementsBottom.forEach(e=>observerBottom.observe(e));let navButtons=document.querySelectorAll(".cc-video-slider-nav-btn");let videoSlides=document.querySelectorAll(".cc-video-bg");let videoContents=document.querySelectorAll(".cc-content");if(navButtons&&videoSlides&&videoContents){let t=function(e){navButtons.forEach(e=>{e.classList.remove("active-video-slide")});videoSlides.forEach(e=>{e.classList.remove("active-video-slide")});videoContents.forEach(e=>{e.classList.remove("active-video-slide")});navButtons[e].classList.add("active-video-slide");videoSlides[e].classList.add("active-video-slide");videoContents[e].classList.add("active-video-slide")};navButtons.forEach((e,o)=>{e.addEventListener("click",()=>{t(o)})})}let ccHamburgerInput=document.querySelector("#cc-hamburger-menu");let ccFooterIcons=document.querySelectorAll(".footer__layout nav .cc-icon");document.addEventListener("DOMContentLoaded",function(){ccHamburgerInput.addEventListener("change",changeHandler)});function changeHandler(){[].forEach.call(ccFooterIcons,function(e){e.classList.toggle("visibility-hidden")})}