1(function($) { 2 "use strict"; 3 4 function initIsotopeGrid($grid) { 5 if (!$grid.length || typeof $.fn.isotope !== "function") { 6 return; 7 } 8 9 var layoutMode = String($grid.attr("data-layout-mode") || $grid.data("layout-mode") || "masonry"); 10 var layoutModeNormalized = layoutMode.toLowerCase(); 11 var previousLayoutMode = $grid.data("eth-layout-mode") || ""; 12 13 if (layoutModeNormalized === "none") { 14 if ($grid.data("isotope")) { 15 try { 16 $grid.isotope("destroy"); 17 } catch (e) {} 18 } 19 20 $grid.removeData("isotope"); 21 $grid.removeData("eth-layout-mode"); 22 $grid.css("height", ""); 23 $grid.find(".g_item").css({ 24 position: "", 25 left: "", 26 top: "", 27 transform: "", 28 width: "" 29 }); 30 return; 31 } 32 33 if ($grid.data("isotope") && previousLayoutMode !== layoutMode) { 34 try { 35 $grid.isotope("destroy"); 36 } catch (e) {} 37 } 38 39 if (!$grid.data("isotope")) { 40 $grid.isotope({ 41 itemSelector: ".g_item", 42 percentPosition: true, 43 layoutMode: layoutMode 44 }); 45 } 46 47 $grid.data("eth-layout-mode", layoutMode); 48 49 if (typeof $.fn.imagesLoaded === "function") { 50 $grid.imagesLoaded().progress(function() { 51 $grid.isotope("layout"); 52 }); 53 54 $grid.find('[loading="lazy"]').off("load.ethGalleryLazy").on("load.ethGalleryLazy", function() { 55 $grid.isotope("layout"); 56 }); 57 } 58 } 59 60 function initShortcodeGallery($scope) { 61 var $root = $scope && $scope.length ? $scope : $(document); 62 var $grids = $root.find(".gallery_items[data-layout-mode], .eth-gallery-grid.gallery_items, .grid.gallery_items[data-layout-mode]"); 63 64 $grids.each(function() { 65 initIsotopeGrid($(this)); 66 }); 67 68 $root.find(".grid_filters").each(function(i, buttonGroup) { 69 var $buttonGroup = $(buttonGroup); 70 var targetSelector = $buttonGroup.attr("data-gallery-grid") || $buttonGroup.data("gallery-grid"); 71 var $targetGrid = $(); 72 73 if (targetSelector) { 74 $targetGrid = $(targetSelector); 75 } 76 77 if (!$targetGrid.length) { 78 $targetGrid = $buttonGroup.closest(".row").next(".row").find(".gallery_items[data-layout-mode], .eth-gallery-grid.gallery_items, .grid.gallery_items[data-layout-mode]").first(); 79 } 80 81 if (!$targetGrid.length) { 82 $targetGrid = $(".gallery_items[data-layout-mode], .eth-gallery-grid.gallery_items, .grid.gallery_items[data-layout-mode]").first(); 83 } 84 85 if (!$targetGrid.length) { 86 return; 87 } 88 89 $buttonGroup.off("click.ethGallery").on("click.ethGallery", "a", function(e) { 90 e.preventDefault(); 91 var filterValue = $(this).attr("data-filter"); 92 93 if (!$targetGrid.data("isotope")) { 94 return; 95 } 96 97 $targetGrid.isotope({ 98 filter: filterValue 99 }); 100 101 $buttonGroup.find(".active").removeClass("active"); 102 $(this).addClass("active"); 103 }); 104 }); 105 } 106 107 function initGalleryCarousel($scope) { 108 var $root = $scope && $scope.length ? $scope : $(document); 109 if (typeof $.fn.owlCarousel !== "function") { 110 return; 111 } 112 113 $root.find(".gallery-slider.owl-carousel").each(function() { 114 var $carousel = $(this); 115 var perView = parseInt($carousel.attr("data-carousel-per-view"), 10); 116 var rtlAttr = String($carousel.attr("data-carousel-rtl")).toLowerCase(); 117 var rtl = (rtlAttr === "true") || $("html").attr("dir") === "rtl"; 118 var arrowsAttr = String($carousel.attr("data-carousel-arrows")).toLowerCase(); 119 var autoplayAttr = String($carousel.attr("data-carousel-autoplay")).toLowerCase(); 120 var showArrows = (arrowsAttr === "false") ? false : true; 121 var autoplay = (autoplayAttr === "false") ? false : true; 122 123 if (isNaN(perView) || perView < 1) { 124 perView = 3; 125 } 126 127 if ($carousel.hasClass("owl-loaded")) { 128 try { 129 $carousel.trigger("destroy.owl.carousel"); 130 } catch (e) {} 131 132 $carousel.removeClass("owl-loaded owl-hidden"); 133 $carousel.find(".owl-stage-outer").children().unwrap(); 134 $carousel.find(".owl-stage-outer").remove(); 135 $carousel.find(".owl-nav, .owl-dots").remove(); 136 } 137 138 $carousel.owlCarousel({ 139 rtl: rtl, 140 loop: true, 141 margin: 0, 142 nav: showArrows, 143 dots: false, 144 mouseDrag: true, 145 touchDrag: true, 146 pullDrag: true, 147 autoplay: autoplay, 148 navText: [ 149 '<span class="las la-angle-left" aria-hidden="true"></span>', 150 '<span class="las la-angle-right" aria-hidden="true"></span>' 151 ], 152 responsive: { 153 0: { 154 items: 1 155 }, 156 600: { 157 items: 3 158 }, 159 1200: { 160 items: perView 161 } 162 } 163 }); 164 }); 165 } 166 167 function initServicesSlider($scope) { 168 var $root = $scope && $scope.length ? $scope : $(document); 169 170 $root.find(".zante-services-slider").each(function() { 171 var $slider = $(this); 172 if ($slider.data("ethServicesReady")) { 173 return; 174 } 175 176 var autoplayAttr = String($slider.attr("data-services-autoplay") || "").toLowerCase(); 177 var transition = String($slider.attr("data-services-transition") || "fade").toLowerCase(); 178 var speed = parseInt($slider.attr("data-services-autoplay-speed"), 10); 179 var autoplay = autoplayAttr === "true"; 180 181 if (isNaN(speed) || speed < 1000) { 182 speed = 4000; 183 } 184
185 var $main = $slider.find(".slider-main-image").first(); 186 var $items = $main.find(".slider-main-item"); 187 var $thumbs = $slider.find(".slider-thumbs-item"); 188 var total = Math.min($items.length, $thumbs.length); 189 190 if (!total) { 191 return; 192 } 193 194 var current = 0; 195 var autoplayTimer = null; 196 var isSlide = transition === "slide"; 197 198 function normalizeIndex(index) { 199 if (index < 0) { 200 return total - 1; 201 } 202 if (index >= total) { 203 return 0; 204 } 205 return index; 206 } 207 208 function setMainHeight() { 209 var height = $items.eq(current).outerHeight(); 210 211 if (height > 0) { 212 $main.css("height", height + "px"); 213 } 214 } 215 216 function stopAutoplay() { 217 if (autoplayTimer) { 218 clearInterval(autoplayTimer); 219 autoplayTimer = null; 220 } 221 } 222 223 function startAutoplay() { 224 stopAutoplay(); 225 if (!autoplay || total < 2) { 226 return; 227 } 228 229 autoplayTimer = setInterval(function() { 230 showSlide(current + 1, false); 231 }, speed); 232 } 233 234 function showSlide(index, userTriggered) { 235 index = normalizeIndex(index); 236 if (index === current && !userTriggered) { 237 return; 238 } 239 240 var prev = current; 241 current = index; 242 243 var $currentItem = $items.eq(prev); 244 var $nextItem = $items.eq(index); 245 246 $thumbs.removeClass("active").eq(index).addClass("active"); 247 $items.stop(true, true); 248 249 if (isSlide && total > 1) { 250 var direction = (index > prev) ? 1 : -1; 251 if (prev === total - 1 && index === 0) { 252 direction = 1; 253 } else if (prev === 0 && index === total - 1) { 254 direction = -1; 255 } 256 257 $main.css("height", Math.max($currentItem.outerHeight(), $nextItem.outerHeight()) + "px"); 258 $currentItem.addClass("active").css({ position: "absolute", left: "0%", opacity: 1, visibility: "visible" }); 259 $nextItem.addClass("active").css({ position: "absolute", left: (100 * direction) + "%", opacity: 1, visibility: "visible" }); 260 261 $currentItem.animate({ left: (-100 * direction) + "%" }, 320, function() { 262 $(this).removeClass("active").css({ position: "", left: "", opacity: "", visibility: "" }); 263 }); 264 265 $nextItem.animate({ left: "0%" }, 320, function() { 266 $(this).css({ position: "", left: "", opacity: "", visibility: "" }); 267 setMainHeight(); 268 }); 269 } else { 270 $items.removeClass("active").css({ position: "", left: "", opacity: "", visibility: "" }); 271 $nextItem.addClass("active"); 272 setMainHeight(); 273 } 274 275 if (userTriggered) { 276 startAutoplay(); 277 } 278 } 279 280 $items.removeClass("active").css({ left: "0%" }).eq(0).addClass("active"); 281 $thumbs.removeClass("active").eq(0).addClass("active"); 282 283 setMainHeight(); 284 $slider.find("img").off("load.ethServices").on("load.ethServices", setMainHeight); 285 $(window).off("resize.ethServices-" + $slider.attr("id")).on("resize.ethServices-" + $slider.attr("id"), setMainHeight); 286 287 $thumbs.off("click.ethServices").on("click.ethServices", function(e) { 288 e.preventDefault(); 289 showSlide($(this).index(), true); 290 }); 291 292 startAutoplay(); 293 $slider.data("ethServicesReady", true); 294 }); 295 } 296 297 function bindElementorWidgetHooks() { 298 if (!window.elementorFrontend || !window.elementorFrontend.hooks) { 299 return; 300 } 301 302 if (window.ethWidgetHooksBound) { 303 return; 304 } 305 window.ethWidgetHooksBound = true; 306 307 elementorFrontend.hooks.addAction("frontend/element_ready/zante_gallery.default", function($scope) { 308 initShortcodeGallery($scope); 309 initGalleryCarousel($scope); 310 }); 311 elementorFrontend.hooks.addAction("frontend/element_ready/zante-gallery.default", function($scope) { 312 initShortcodeGallery($scope); 313 initGalleryCarousel($scope); 314 }); 315 elementorFrontend.hooks.addAction("frontend/element_ready/zante_services.default", function($scope) { 316 initServicesSlider($scope); 317 }); 318 elementorFrontend.hooks.addAction("frontend/element_ready/zante-services-v2.default", function($scope) { 319 initServicesSlider($scope); 320 }); 321 elementorFrontend.hooks.addAction("frontend/element_ready/global", function($scope) { 322 if ( 323 $scope && 324 $scope.find && 325 ( 326 $scope.find(".gallery_items[data-layout-mode], .eth-gallery-grid.gallery_items, .grid.gallery_items[data-layout-mode]").length || 327 $scope.find(".gallery-slider.owl-carousel").length || 328 $scope.find(".zante-services-slider").length 329 ) 330 ) { 331 initShortcodeGallery($scope);
332 initGalleryCarousel($scope); 333 initServicesSlider($scope); 334 } 335 }); 336 } 337 338 $(document).ready(function() { 339 initShortcodeGallery($(document)); 340 initGalleryCarousel($(document)); 341 initServicesSlider($(document)); 342 bindElementorWidgetHooks(); 343 }); 344 345 $(window).on("elementor/frontend/init", function() { 346 bindElementorWidgetHooks(); 347 initShortcodeGallery($(document)); 348 initGalleryCarousel($(document)); 349 initServicesSlider($(document)); 350 }); 351 352 $(window).on("load", function() { 353 initShortcodeGallery($(document)); 354 initGalleryCarousel($(document)); 355 initServicesSlider($(document)); 356 }); 357})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.