Untitled
unknown
javascript
a year ago
2.4 kB
2
Indexable
Never
import{$,$$,currentDirection,debounce,multipleClassToggle,screenType}from"./utils.min.js";function mobileMenu(){const e=e=>{$("#m-menu-section").classList["show"===e?"add":"remove"]("opacity-100","visible"),$("#m-menu-section").classList["show"===e?"remove":"add"]("opacity-0","invisible"),document.documentElement.style.overflowY="show"===e?"hidden":"auto"};$("#m-menu-open").addEventListener("click",(()=>e("show"))),$$(".m-menu-close").forEach((t=>{t.addEventListener("click",(()=>e("hide")))}))}function changeDir(){$$(`#${"mobile"===screenType()?"m":"d"}-change-dir-section-toggle`).forEach((e=>{e.addEventListener("click",(()=>{multipleClassToggle($(`#${"mobile"===screenType()?"m":"d"}-change-dir-section`),["opacity-0","invisible"]),"desktop"===screenType()&&$("#d-change-dir-section-toggle-chevron").classList.toggle("rotate-180")}))})),$$(".change-dir-btn").forEach((e=>{e.addEventListener("click",(()=>{$(`#${"mobile"===screenType()?"m":"d"}-change-dir-section`).classList.add("opacity-0","invisible"),"desktop"===screenType()&&$("#d-change-dir-section-toggle-chevron").classList.toggle("rotate-180"),e.getAttribute("data-direction")!==document.documentElement.getAttribute("dir")&&window.location.reload()}))}))}window.addEventListener("DOMContentLoaded",(()=>{mobileMenu()})),["resize","DOMContentLoaded"].forEach((e=>{window.addEventListener(e,debounce((()=>{changeDir()}),100))}));const hideMobileNavBottomMenuAfterDetectFooter=()=>{window.scrollY+window.innerHeight>=document.documentElement.scrollHeight-800?$("#m-nav-bottom-menu").classList.add("!-bottom-48"):$("#m-nav-bottom-menu").classList.remove("!-bottom-48")};["scroll","DOMContentLoaded"].forEach((e=>{window.addEventListener(e,debounce((()=>{window.scrollY+window.innerHeight>=document.documentElement.scrollHeight-800?$("#m-nav-bottom-menu").classList.add("!-bottom-48"):$("#m-nav-bottom-menu").classList.remove("!-bottom-48")}),100))})),window.addEventListener("DOMContentLoaded",(()=>{const e=new Swiper("#footer-slider",{loop:!0,autoplay:!0,allowTouchMove:!0,disableOnInteraction:!0,navigation:{nextEl:"#footer-slider .swiper-navigation-next",prevEl:"#footer-slider .swiper-navigation-prev"},pagination:{el:"#footer-slider .swiper-pagination",clickable:!0},breakpoints:{0:{slidesPerView:1},640:{slidesPerView:2},768:{slidesPerView:3},1024:{slidesPerView:4},1280:{slidesPerView:5}}});e.rtl="rtl"===currentDirection(),e.rtlTranslate="rtl"===currentDirection()}));