1(function ($) { 2 "use strict"; 3 4 if ($(".sticky-header").length) { 5 $(".sticky-header") 6 .clone() 7 .insertAfter(".sticky-header") 8 .addClass("sticky-header--cloned"); 9 } 10 11 if ($(".main-menu__list").length) { 12 let menuElement = $(".main-menu__list"); 13 let currentMenuItem = menuElement.find("li.current-menu-item"); 14 let currentMenuParent = menuElement.find("li.current-menu-parent"); 15 let currentMenuAncestor = menuElement.find("li.current-menu-ancestor"); 16 let currentPageItem = menuElement.find("li.current_page_item"); 17 currentMenuItem.addClass("current"); 18 currentMenuParent.addClass("current"); 19 currentMenuAncestor.addClass("current"); 20 currentPageItem.addClass("current"); 21 } 22 23 if ($(".service-details__category-list").length) { 24 let menuElement = $(".service-details__category-list"); 25 let currentMenuItem = menuElement.find("li.current-menu-item"); 26 let currentMenuParent = menuElement.find("li.current-menu-parent"); 27 let currentMenuAncestor = menuElement.find("li.current-menu-ancestor"); 28 let currentPageItem = menuElement.find("li.current_page_item"); 29 currentMenuItem.addClass("active"); 30 currentMenuParent.addClass("active"); 31 currentMenuAncestor.addClass("active"); 32 currentPageItem.addClass("active"); 33 } 34 35 // Accrodion 36 if ($(".accrodion-grp").length) { 37 var accrodionGrp = $(".accrodion-grp"); 38 accrodionGrp.each(function () { 39 var accrodionName = $(this).data("grp-name"); 40 var Self = $(this); 41 var accordion = Self.find(".accrodion"); 42 Self.addClass(accrodionName); 43 Self.find(".accrodion .accrodion-content").hide(); 44 Self.find(".accrodion.active").find(".accrodion-content").show(); 45 accordion.each(function () { 46 $(this) 47 .find(".accrodion-title") 48 .on("click", function () { 49 if ($(this).parent().hasClass("active") === false) { 50 $(".accrodion-grp." + accrodionName) 51 .find(".accrodion") 52 .removeClass("active"); 53 $(".accrodion-grp." + accrodionName) 54 .find(".accrodion") 55 .find(".accrodion-content") 56 .slideUp(); 57 $(this).parent().addClass("active"); 58 $(this).parent().find(".accrodion-content").slideDown(); 59 } 60 }); 61 }); 62 }); 63 } 64 65 if ($(".scroll-to-target").length) { 66 $(".scroll-to-target").on("click", function () { 67 var target = $(this).attr("data-target"); 68 // animate 69 $("html, body").animate( 70 { 71 scrollTop: $(target).offset().top 72 }, 73 1000 74 ); 75 76 return false; 77 }); 78 } 79 80 if ($(".video-popup").length) { 81 $(".video-popup").magnificPopup({ 82 type: "iframe", 83 mainClass: "mfp-fade", 84 removalDelay: 160, 85 preloader: true, 86 87 fixedContentPos: false 88 }); 89 } 90 91 if ($(".img-popup").length) { 92 var groups = {}; 93 $(".img-popup").each(function () { 94 var id = parseInt($(this).attr("data-group"), 10); 95 96 if (!groups[id]) { 97 groups[id] = []; 98 } 99 100 groups[id].push(this); 101 }); 102 103 $.each(groups, function () { 104 $(this).magnificPopup({ 105 type: "image", 106 closeOnContentClick: true, 107 closeBtnInside: false, 108 gallery: { 109 enabled: true 110 } 111 }); 112 }); 113 } 114 115 $(document).on("click", ".add", function () { 116 if ($(this).prev().val() < 999) { 117 $(this) 118 .prev() 119 .val(+$(this).prev().val() + 1); 120 } 121 $(this).prev().trigger("change"); 122 }); 123 124 $(document).on("click", ".sub", function () { 125 if ($(this).next().val() > 0) { 126 if ($(this).next().val() > 0) 127 $(this) 128 .next() 129 .val(+$(this).next().val() - 1); 130 } 131 $(this).next().trigger("change"); 132 }); 133 134 if ($(".main-menu__list").length && $(".mobile-nav__container").length) { 135 let navContent = document.querySelector(".main-menu__list").outerHTML; 136 let mobileNavContainer = document.querySelector(".mobile-nav__container"); 137 mobileNavContainer.innerHTML = navContent; 138 } 139 if ($(".sticky-header__content").length) { 140 let navContent = document.querySelector(".main-menu").innerHTML; 141 let mobileNavContainer = document.querySelector(".sticky-header__content"); 142 mobileNavContainer.innerHTML = navContent; 143 } 144 145 if ($(".mobile-nav__container .main-menu__list").length) { 146 let dropdownAnchor = $( 147 ".mobile-nav__container .main-menu__list .menu-item-has-children > a" 148 ); 149 dropdownAnchor.each(function () { 150 let self = $(this); 151 let toggleBtn = document.createElement("BUTTON"); 152 toggleBtn.setAttribute("aria-label", "dropdown toggler"); 153 toggleBtn.innerHTML = "<i class='fa fa-angle-down'></i>"; 154 self.append(function () { 155 return toggleBtn; 156 }); 157 self.find("button").on("click", function (e) { 158 e.preventDefault(); 159 let self = $(this); 160 self.toggleClass("expanded"); 161 self.parent().toggleClass("expanded"); 162 self.parent().parent().children("ul").slideToggle(); 163 }); 164 });
165 } 166 167 if ($(".mobile-nav__toggler").length) { 168 $(".mobile-nav__toggler").on("click", function (e) { 169 e.preventDefault(); 170 $(".mobile-nav__wrapper").toggleClass("expanded"); 171 $("body").toggleClass("locked"); 172 }); 173 } 174 175 if ($(".search-toggler").length) { 176 $(".search-toggler").on("click", function (e) { 177 e.preventDefault(); 178 $(".search-popup").toggleClass("active"); 179 $(".mobile-nav__wrapper").removeClass("expanded"); 180 $("body").toggleClass("locked"); 181 }); 182 } 183 184 if ($(".dynamic-year").length) { 185 let date = new Date(); 186 $(".dynamic-year").html(date.getFullYear()); 187 } 188 189 // window load event 190 191 $(window).on("load", function () { 192 if ($(".preloader").length) { 193 $(".preloader").fadeOut(); 194 } 195 196 if ($(".product__items ul.products").length) { 197 $(".product__items ul.products").imagesLoaded(function () { 198 $(".product__items ul.products").isotope({ 199 layoutMode: "masonry" 200 }); 201 }); 202 } 203 204 }); 205 206 // window scroll event 207 function stickyMenuUpScroll($targetMenu, $toggleClass) { 208 var lastScrollTop = 0; 209 window.addEventListener( 210 "scroll", 211 function () { 212 var st = window.pageYOffset || document.documentElement.scrollTop; 213 if (st > 500) { 214 if (st > lastScrollTop) { 215 // downscroll code 216 $targetMenu.removeClass($toggleClass); 217 // console.log("down"); 218 } else { 219 // upscroll code 220 $targetMenu.addClass($toggleClass); 221 // console.log("up"); 222 } 223 } else { 224 $targetMenu.removeClass($toggleClass); 225 } 226 lastScrollTop = st; 227 }, 228 false 229 ); 230 } 231 stickyMenuUpScroll($(".sticky-header--normal"), "active"); 232 233 /*-- Handle Scrollbar --*/ 234 function handleScrollbar() { 235 const bodyHeight = $("body").height(); 236 const scrollPos = $(window).innerHeight() + $(window).scrollTop(); 237 let percentage = (scrollPos / bodyHeight) * 100; 238 if (percentage > 100) { 239 percentage = 100; 240 } 241 $(".scroll-to-top .scroll-to-top__inner").css("width", percentage + "%"); 242 } 243 244 function OnePageMenuScroll() { 245 var windscroll = $(window).scrollTop(); 246 if (windscroll >= 117) { 247 var menuAnchor = $(".one-page-scroll-menu .scrollToLink").children("a"); 248 menuAnchor.each(function () { 249 var sections = $(this).attr("href"); 250 $(sections).each(function () { 251 if ($(this).offset().top <= windscroll + 100) { 252 var Sectionid = $(sections).attr("id"); 253 $(".one-page-scroll-menu").find("li").removeClass("current"); 254 $(".one-page-scroll-menu") 255 .find("li") 256 .removeClass("current-menu-ancestor"); 257 $(".one-page-scroll-menu") 258 .find("li") 259 .removeClass("current_page_item"); 260 $(".one-page-scroll-menu") 261 .find("li") 262 .removeClass("current-menu-parent"); 263 $(".one-page-scroll-menu") 264 .find("a[href*=\\#" + Sectionid + "]") 265 .parent() 266 .addClass("current"); 267 } 268 }); 269 }); 270 } else { 271 $(".one-page-scroll-menu li.current").removeClass("current"); 272 $(".one-page-scroll-menu li:first").addClass("current"); 273 } 274 } 275 276 // window scroll event 277 278 $(window).on("scroll", function () { 279 OnePageMenuScroll(); 280 handleScrollbar(); 281 if ($(".sticky-header--one-page").length) { 282 var headerScrollPos = 130; 283 var stricky = $(".sticky-header--one-page"); 284 if ($(window).scrollTop() > headerScrollPos) { 285 stricky.addClass("active"); 286 } else if ($(this).scrollTop() <= headerScrollPos) { 287 stricky.removeClass("active"); 288 } 289 } 290 291 var scrollToTopBtn = ".scroll-to-top"; 292 if (scrollToTopBtn.length) { 293 if ($(window).scrollTop() > 500) { 294 $(scrollToTopBtn).addClass("show"); 295 } else { 296 $(scrollToTopBtn).removeClass("show"); 297 } 298 } 299 }); 300 301 $(document).on("click", ".shop-one__cart.digihub_ajax ", function (e) { 302 $(".digihub-overlay").fadeIn(300); 303 }); 304 305 $(document.body).on( 306 "added_to_cart", 307 function (event, fragments, cart_hash, $button) { 308 $(".digihub-overlay").fadeOut(300);
309 } 310 ); 311 312 // custom coursor 313 if ($(".custom-cursor").length) { 314 var cursor = document.querySelector(".custom-cursor__cursor"); 315 var cursorinner = document.querySelector(".custom-cursor__cursor-two"); 316 var a = document.querySelectorAll("a"); 317 318 document.addEventListener("mousemove", function (e) { 319 var x = e.clientX; 320 var y = e.clientY; 321 cursor.style.transform = `translate3d(calc(${e.clientX}px - 50%), calc(${e.clientY}px - 50%), 0)`; 322 }); 323 324 document.addEventListener("mousemove", function (e) { 325 var x = e.clientX; 326 var y = e.clientY; 327 cursorinner.style.left = x + "px"; 328 cursorinner.style.top = y + "px"; 329 }); 330 331 document.addEventListener("mousedown", function () { 332 cursor.classList.add("click"); 333 cursorinner.classList.add("custom-cursor__innerhover"); 334 }); 335 336 document.addEventListener("mouseup", function () { 337 cursor.classList.remove("click"); 338 cursorinner.classList.remove("custom-cursor__innerhover"); 339 }); 340 341 a.forEach((item) => { 342 item.addEventListener("mouseover", () => { 343 cursor.classList.add("custom-cursor__hover"); 344 }); 345 item.addEventListener("mouseleave", () => { 346 cursor.classList.remove("custom-cursor__hover"); 347 }); 348 }); 349 } 350 351 //Show Popup menu 352 $(document).on("click", ".megamenu-clickable--toggler > a", function (e) { 353 $("body").toggleClass("megamenu-popup-active"); 354 $(this).parent().find("ul").toggleClass("megamenu-clickable--active"); 355 e.preventDefault(); 356 }); 357 $(document).on("click", ".megamenu-clickable--close", function (e) { 358 $("body").removeClass("megamenu-popup-active"); 359 $(".megamenu-clickable--active").removeClass("megamenu-clickable--active"); 360 e.preventDefault(); 361 }); 362 363 if ($(".scroll-to-target").length) { 364 $(".scroll-to-target").on("click", function () { 365 var target = $(this).attr("data-target"); 366 // animate 367 $("html, body").animate( 368 { 369 scrollTop: $(target).offset().top 370 }, 371 1000 372 ); 373 374 return false; 375 }); 376 } 377 378 /*-- Dynamic year --*/ 379 let dynamicyearElm = $(".dynamic-year"); 380 if (dynamicyearElm.length) { 381 let currentYear = new Date().getFullYear(); 382 dynamicyearElm.html(currentYear); 383 } 384 385 // window scroll event 386 $(window).on("scroll", function () { 387 if ($(".stricked-menu").length) { 388 var headerScrollPos = 130; 389 var stricky = $(".stricked-menu"); 390 if ($(window).scrollTop() > headerScrollPos) { 391 stricky.addClass("stricky-fixed"); 392 } else if ($(this).scrollTop() <= headerScrollPos) { 393 stricky.removeClass("stricky-fixed"); 394 } 395 } 396 if ($(".scroll-to-top").length) { 397 var strickyScrollPos = 100; 398 if ($(window).scrollTop() > strickyScrollPos) { 399 $(".scroll-to-top").fadeIn(500); 400 } else if ($(this).scrollTop() <= strickyScrollPos) { 401 $(".scroll-to-top").fadeOut(500); 402 } 403 } 404 }); 405})(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.