{"version":3,"file":"gallery-carousel.js","mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,qDAAqD,0CAA0C;AAC/F,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA,CAAC","sources":["webpack://nv-base-template/./src/js/gallery-carousel.js"],"sourcesContent":["/**\r\n * Gallery Carousel\r\n * @description :\r\n */\r\n\r\n(function () {\r\n\r\n document.querySelectorAll('.js-image-popout-src').forEach(function(item) {\r\n item.addEventListener('click', function(e) {\r\n e.preventDefault();\r\n window.galleryModal.classList.add('c-image-modal--open');\r\n window.gallerySwiper.slideTo(item.dataset.swiperIndex);\r\n })\r\n });\r\n\r\n document.querySelectorAll('.js-image-modal').forEach(item => {\r\n window.galleryModal = item;\r\n item.querySelector('.js-image-modal-close').addEventListener('click', function(e) {\r\n item.classList.remove('c-image-modal--open');\r\n })\r\n })\r\n\r\n document.querySelectorAll('.js-gallery-carousel').forEach(rootEl => {\r\n const swiperEl = rootEl;\r\n const slideEls = rootEl.querySelectorAll('.js-gallery-carousel-slide');\r\n\r\n const prevEl = document.querySelector('.js-gallery-carousel-prev');\r\n const nextEl = document.querySelector('.js-gallery-carousel-next');\r\n\r\n if (slideEls.length < 2) {\r\n // We only have one slide, so don't create a Swiper instance.\r\n return;\r\n }\r\n\r\n window.gallerySwiper = new Swiper(swiperEl, {\r\n loop: true,\r\n slidesPerView: 1,\r\n navigation: {\r\n prevEl,\r\n nextEl\r\n },\r\n pagination: {\r\n clickable: true\r\n },\r\n speed: 800\r\n });\r\n })\r\n\r\n if (window.innerWidth > 768) {\r\n window.addEventListener('scroll', e => {\r\n document.querySelectorAll('.js-movement-track').forEach(item => {\r\n const prevSibling = item.previousElementSibling;\r\n item.style.transform = `translateY(${prevSibling.getBoundingClientRect().top/5}px)`;\r\n })\r\n })\r\n window.scroll();\r\n }\r\n\r\n})();\r\n"],"names":[],"sourceRoot":""}