1(function ($) { 2 "use strict"; 3 4 if ($(".main-menu__list").length) { 5 let menuElement = $(".main-menu__list"); 6 let currentMenuItem = menuElement.find("li.current-menu-item"); 7 let currentMenuParent = menuElement.find("li.current-menu-parent"); 8 let currentMenuAncestor = menuElement.find("li.current-menu-ancestor"); 9 let currentPageItem = menuElement.find("li.current_page_item"); 10 currentMenuItem.addClass("current"); 11 currentMenuParent.addClass("current"); 12 currentMenuAncestor.addClass("current"); 13 currentPageItem.addClass("current"); 14 } 15 16 if ($(".service-details__category-list").length) { 17 let menuElement = $(".service-details__category-list"); 18 let currentMenuItem = menuElement.find("li.current-menu-item"); 19 let currentMenuParent = menuElement.find("li.current-menu-parent"); 20 let currentMenuAncestor = menuElement.find("li.current-menu-ancestor"); 21 let currentPageItem = menuElement.find("li.current_page_item"); 22 currentMenuItem.addClass("active"); 23 currentMenuParent.addClass("active"); 24 currentMenuAncestor.addClass("active"); 25 currentPageItem.addClass("active"); 26 } 27 28 // Accrodion 29 if ($(".accrodion-grp").length) { 30 var accrodionGrp = $(".accrodion-grp"); 31 accrodionGrp.each(function () { 32 var accrodionName = $(this).data("grp-name"); 33 var Self = $(this); 34 var accordion = Self.find(".accrodion"); 35 Self.addClass(accrodionName); 36 Self.find(".accrodion .accrodion-content").hide(); 37 Self.find(".accrodion.active").find(".accrodion-content").show(); 38 accordion.each(function () { 39 $(this) 40 .find(".accrodion-title") 41 .on("click", function () { 42 if ($(this).parent().hasClass("active") === false) { 43 $(".accrodion-grp." + accrodionName) 44 .find(".accrodion") 45 .removeClass("active"); 46 $(".accrodion-grp." + accrodionName) 47 .find(".accrodion") 48 .find(".accrodion-content") 49 .slideUp(); 50 $(this).parent().addClass("active"); 51 $(this).parent().find(".accrodion-content").slideDown(); 52 } 53 }); 54 }); 55 }); 56 } 57 58 if ($(".scroll-to-target").length) { 59 $(".scroll-to-target").on("click", function () { 60 var target = $(this).attr("data-target"); 61 // animate 62 $("html, body").animate( 63 { 64 scrollTop: $(target).offset().top 65 }, 66 1000 67 ); 68 69 return false; 70 }); 71 } 72 73 if ($(".video-popup").length) { 74 $(".video-popup").magnificPopup({ 75 type: "iframe", 76 mainClass: "mfp-fade", 77 removalDelay: 160, 78 preloader: true, 79 80 fixedContentPos: false 81 }); 82 } 83 84 if ($(".img-popup").length) { 85 var groups = {}; 86 $(".img-popup").each(function () { 87 var id = parseInt($(this).attr("data-group"), 10); 88 89 if (!groups[id]) { 90 groups[id] = []; 91 } 92 93 groups[id].push(this); 94 }); 95 96 $.each(groups, function () { 97 $(this).magnificPopup({ 98 type: "image", 99 closeOnContentClick: true, 100 closeBtnInside: false, 101 gallery: { 102 enabled: true 103 } 104 }); 105 }); 106 } 107 108 $(document).on("click", ".add", function () { 109 if ($(this).prev().val() < 999) { 110 $(this) 111 .prev() 112 .val(+$(this).prev().val() + 1); 113 } 114 $(this).prev().trigger("change"); 115 }); 116 117 $(document).on("click", ".sub", function () { 118 if ($(this).next().val() > 0) { 119 if ($(this).next().val() > 0) 120 $(this) 121 .next() 122 .val(+$(this).next().val() - 1); 123 } 124 $(this).next().trigger("change"); 125 }); 126 127 if ($(".main-menu__list").length && $(".mobile-nav__container").length) { 128 let navContent = document.querySelector(".main-menu__list").outerHTML; 129 let mobileNavContainer = document.querySelector(".mobile-nav__container"); 130 mobileNavContainer.innerHTML = navContent; 131 } 132 if ($(".sticky-header__content").length) { 133 let navContent = document.querySelector(".main-menu").innerHTML; 134 let mobileNavContainer = document.querySelector(".sticky-header__content"); 135 mobileNavContainer.innerHTML = navContent; 136 } 137 138 if ($(".mobile-nav__container .main-menu__list").length) { 139 let dropdownAnchor = $( 140 ".mobile-nav__container .main-menu__list .menu-item-has-children > a" 141 ); 142 dropdownAnchor.each(function () { 143 let self = $(this); 144 let toggleBtn = document.createElement("BUTTON"); 145 toggleBtn.setAttribute("aria-label", "dropdown toggler"); 146 toggleBtn.innerHTML = "<i class='fa fa-angle-down'></i>"; 147 self.append(function () { 148 return toggleBtn; 149 }); 150 self.find("button").on("click", function (e) { 151 e.preventDefault(); 152 let self = $(this); 153 self.toggleClass("expanded"); 154 self.parent().toggleClass("expanded"); 155 self.parent().parent().children("ul").slideToggle(); 156 }); 157 });
158 } 159 160 if ($(".mobile-nav__toggler").length) { 161 $(".mobile-nav__toggler").on("click", function (e) { 162 e.preventDefault(); 163 $(".mobile-nav__wrapper").toggleClass("expanded"); 164 $("body").toggleClass("locked"); 165 }); 166 } 167 168 if ($(".search-toggler").length) { 169 $(".search-toggler").on("click", function (e) { 170 e.preventDefault(); 171 $(".search-popup").toggleClass("active"); 172 $(".mobile-nav__wrapper").removeClass("expanded"); 173 $("body").toggleClass("locked"); 174 }); 175 } 176 177 if ($(".dynamic-year").length) { 178 let date = new Date(); 179 $(".dynamic-year").html(date.getFullYear()); 180 } 181 182 // window load event 183 184 $(window).on("load", function () { 185 if ($(".preloader").length) { 186 $(".preloader").fadeOut(); 187 } 188 189 if ($(".product__items ul.products").length) { 190 $(".product__items ul.products").imagesLoaded(function () { 191 $(".product__items ul.products").isotope({ 192 layoutMode: "masonry" 193 }); 194 }); 195 } 196 }); 197 198 // window scroll event 199 200 $(window).on("scroll", function () { 201 if ($(".stricked-menu").length) { 202 var headerScrollPos = 130; 203 var stricky = $(".stricked-menu"); 204 if ($(window).scrollTop() > headerScrollPos) { 205 stricky.addClass("stricky-fixed"); 206 } else if ($(this).scrollTop() <= headerScrollPos) { 207 stricky.removeClass("stricky-fixed"); 208 } 209 } 210 if ($(".scroll-to-top").length) { 211 var strickyScrollPos = 100; 212 if ($(window).scrollTop() > strickyScrollPos) { 213 $(".scroll-to-top").fadeIn(500); 214 } else if ($(this).scrollTop() <= strickyScrollPos) { 215 $(".scroll-to-top").fadeOut(500); 216 } 217 } 218 }); 219 220 $(document).on("click", ".shop-one__cart.govity_ajax ", function (e) { 221 $(".govity-overlay").fadeIn(300); 222 }); 223 224 $(document.body).on( 225 "added_to_cart", 226 function (event, fragments, cart_hash, $button) { 227 $(".govity-overlay").fadeOut(300); 228 } 229 ); 230 231 // custom coursor 232 if ($(".custom-cursor").length) { 233 var cursor = document.querySelector(".custom-cursor__cursor"); 234 var cursorinner = document.querySelector(".custom-cursor__cursor-two"); 235 var a = document.querySelectorAll("a"); 236 237 document.addEventListener("mousemove", function (e) { 238 var x = e.clientX; 239 var y = e.clientY; 240 cursor.style.transform = `translate3d(calc(${e.clientX}px - 50%), calc(${e.clientY}px - 50%), 0)`; 241 }); 242 243 document.addEventListener("mousemove", function (e) { 244 var x = e.clientX; 245 var y = e.clientY; 246 cursorinner.style.left = x + "px"; 247 cursorinner.style.top = y + "px"; 248 }); 249 250 document.addEventListener("mousedown", function () { 251 cursor.classList.add("click"); 252 cursorinner.classList.add("custom-cursor__innerhover"); 253 }); 254 255 document.addEventListener("mouseup", function () { 256 cursor.classList.remove("click"); 257 cursorinner.classList.remove("custom-cursor__innerhover"); 258 }); 259 260 a.forEach((item) => { 261 item.addEventListener("mouseover", () => { 262 cursor.classList.add("custom-cursor__hover"); 263 }); 264 item.addEventListener("mouseleave", () => { 265 cursor.classList.remove("custom-cursor__hover"); 266 }); 267 }); 268 } 269})(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.