| 1 |
!function($){"use strict";const initEelGalleryPopup=function($scope){const $gallery=$scope.find(".eel-gallery-grid.eel-popup-enabled");if(!$gallery.length)return;let currentIndex=0;const $lightbox=$scope.find(".eel-lightbox-gallery"),$lightboxImg=$lightbox.find(".eel-lightbox-image"),$galleryLinks=$gallery.find(".eel-popup-link");function showNext(){currentIndex=(currentIndex+1)%$galleryLinks.length,$lightboxImg.attr("src",$galleryLinks.eq(currentIndex).attr("href"))}function showPrev(){currentIndex=(currentIndex-1+$galleryLinks.length)%$galleryLinks.length,$lightboxImg.attr("src",$galleryLinks.eq(currentIndex).attr("href"))}$galleryLinks.off("click").on("click",(function(e){e.preventDefault();!function(index){currentIndex=index;const imgSrc=$galleryLinks.eq(currentIndex).attr("href");$lightboxImg.attr("src",imgSrc),$lightbox.fadeIn(300).css("display","grid")}($(this).data("index"))})),$lightbox.find(".eel-next").off("click").on("click",showNext),$lightbox.find(".eel-prev").off("click").on("click",showPrev),$lightbox.find(".eel-close").off("click").on("click",(function(){$lightbox.fadeOut(200)})),$lightbox.off("click").on("click",(function(e){$(e.target).is(".eel-lightbox-gallery, .eel-close")&&$lightbox.fadeOut(200)})),$(document).off("keydown.eelLightbox").on("keydown.eelLightbox",(function(e){$lightbox.is(":visible")&&("ArrowRight"===e.key?showNext():"ArrowLeft"===e.key?showPrev():"Escape"===e.key&&$lightbox.fadeOut(200))}))};$(window).on("elementor/frontend/init",(function(){elementorFrontend.hooks.addAction("frontend/element_ready/eel-gallery.default",initEelGalleryPopup)}))}(jQuery),function($){"use strict";const initEelCarouselPopup=function($scope){const $galleryLinks=$scope.find(".eel-popup-link-carousel"),$lightbox=$scope.find(".eel-lightbox-carousel"),$lightboxImg=$lightbox.find(".eel-lightbox-image-carousel");let currentIndex=0;function updateLightboxImage(index){currentIndex=index;const imgSrc=$galleryLinks.eq(currentIndex).attr("href");$lightboxImg.attr("src",imgSrc)}$galleryLinks.length&&($galleryLinks.off("click").on("click",(function(e){e.preventDefault();updateLightboxImage(parseInt($(this).attr("data-index"))||0),$lightbox.fadeIn(300).css("display","grid")})),$lightbox.find(".eel-next").off("click").on("click",(function(e){e.stopPropagation(),updateLightboxImage((currentIndex+1)%$galleryLinks.length)})),$lightbox.find(".eel-prev").off("click").on("click",(function(e){e.stopPropagation(),updateLightboxImage((currentIndex-1+$galleryLinks.length)%$galleryLinks.length)})),$lightbox.find(".eel-close").off("click").on("click",(function(){$lightbox.fadeOut(200)})),$(document).off("keydown.eelCarousel").on("keydown.eelCarousel",(function(e){$lightbox.is(":visible")&&("ArrowRight"===e.key&&$lightbox.find(".eel-next").click(),"ArrowLeft"===e.key&&$lightbox.find(".eel-prev").click(),"Escape"===e.key&&$lightbox.fadeOut(200))})))};$(window).on("elementor/frontend/init",(function(){elementorFrontend.hooks.addAction("frontend/element_ready/eel-image-carousel.default",initEelCarouselPopup)}))}(jQuery); |