PageSourceSearch

https://violet-crane-218268.hostingersite.com/wp-content/themes/as…/assets/js/assimox-theme.js?ver=1791003410

js violet-crane-218268.hostingersite.com collected 2026-10-03 04:57:30 UTC 12,704 bytes, 397 lines download raw bytes

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  // window scroll event
206  function stickyMenuUpScroll($targetMenu, $toggleClass) {
207    var lastScrollTop = 0;
208    window.addEventListener(
209      "scroll",
210      function () {
211        var st = window.pageYOffset || document.documentElement.scrollTop;
212        if (st > 500) {
213          if (st > lastScrollTop) {
214            // downscroll code
215            $targetMenu.removeClass($toggleClass);
216            // console.log("down");
217          } else {
218            // upscroll code
219            $targetMenu.addClass($toggleClass);
220            // console.log("up");
221          }
222        } else {
223          $targetMenu.removeClass($toggleClass);
224        }
225        lastScrollTop = st;
226      },
227      false
228    );
229  }
230  stickyMenuUpScroll($(".sticky-header--normal"), "active");
231
232  /*-- Handle Scrollbar --*/
233  function handleScrollbar() {
234    const bodyHeight = $("body").height();
235    const scrollPos = $(window).innerHeight() + $(window).scrollTop();
236    let percentage = (scrollPos / bodyHeight) * 100;
237    if (percentage > 100) {
238      percentage = 100;
239    }
240    $(".scroll-to-top .scroll-to-top__inner").css("width", percentage + "%");
241  }
242
243  function OnePageMenuScroll() {
244    var windscroll = $(window).scrollTop();
245    if (windscroll >= 117) {
246      var menuAnchor = $(".one-page-scroll-menu .scrollToLink").children("a");
247      menuAnchor.each(function () {
248        var sections = $(this).attr("href");
249        $(sections).each(function () {
250          if ($(this).offset().top <= windscroll + 100) {
251            var Sectionid = $(sections).attr("id");
252            $(".one-page-scroll-menu").find("li").removeClass("current");
253            $(".one-page-scroll-menu")
254              .find("li")
255              .removeClass("current-menu-ancestor");
256            $(".one-page-scroll-menu")
257              .find("li")
258              .removeClass("current_page_item");
259            $(".one-page-scroll-menu")
260              .find("li")
261              .removeClass("current-menu-parent");
262            $(".one-page-scroll-menu")
263              .find("a[href*=\\#" + Sectionid + "]")
264              .parent()
265              .addClass("current");
266          }
267        });
268      });
269    } else {
270      $(".one-page-scroll-menu li.current").removeClass("current");
271      $(".one-page-scroll-menu li:first").addClass("current");
272    }
273  }
274
275  // window scroll event
276
277  $(window).on("scroll", function () {
278    OnePageMenuScroll();
279    handleScrollbar();
280    if ($(".sticky-header--one-page").length) {
281      var headerScrollPos = 130;
282      var stricky = $(".sticky-header--one-page");
283      if ($(window).scrollTop() > headerScrollPos) {
284        stricky.addClass("active");
285      } else if ($(this).scrollTop() <= headerScrollPos) {
286        stricky.removeClass("active");
287      }
288    }
289
290    var scrollToTopBtn = ".scroll-to-top";
291    if (scrollToTopBtn.length) {
292      if ($(window).scrollTop() > 500) {
293        $(scrollToTopBtn).addClass("show");
294      } else {
295        $(scrollToTopBtn).removeClass("show");
296      }
297    }
298  });
299
300  $(document).on("click", ".shop-one__cart.assimox_ajax ", function (e) {
301    $(".assimox-overlay").fadeIn(300);
302  });
303
304  $(document.body).on(
305    "added_to_cart",
306    function (event, fragments, cart_hash, $button) {
307      $(".assimox-overlay").fadeOut(300);
308    }
309  );
310
311  // custom coursor
312  if ($(".custom-cursor").length) {
313    var cursor = document.querySelector(".custom-cursor__cursor");
314    var cursorinner = document.querySelector(".custom-cursor__cursor-two");
315    var a = document.querySelectorAll("a");
316
317    document.addEventListener("mousemove", function (e) {
318      var x = e.clientX;
319      var y = e.clientY;
320      cursor.style.transform = `translate3d(calc(${e.clientX}px - 50%), calc(${e.clientY}px - 50%), 0)`;
321    });
322
323    document.addEventListener("mousemove", function (e) {
324      var x = e.clientX;
325      var y = e.clientY;
326      cursorinner.style.left = x + "px";
327      cursorinner.style.top = y + "px";
328    });
329
330    document.addEventListener("mousedown", function () {
331      cursor.classList.add("click");
332      cursorinner.classList.add("custom-cursor__innerhover");
333    });
334
335    document.addEventListener("mouseup", function () {
336      cursor.classList.remove("click");
337      cursorinner.classList.remove("custom-cursor__innerhover");
338    });
339
340    a.forEach((item) => {
341      item.addEventListener("mouseover", () => {
342        cursor.classList.add("custom-cursor__hover");
343      });
344      item.addEventListener("mouseleave", () => {
345        cursor.classList.remove("custom-cursor__hover");
346      });
347    });
348  }
349
350  //Show Popup menu
351  $(document).on("click", ".megamenu-clickable--toggler > a", function (e) {
352    $("body").toggleClass("megamenu-popup-active");
353    $(this).parent().find("ul").toggleClass("megamenu-clickable--active");
354    e.preventDefault();
355  });
356  $(document).on("click", ".megamenu-clickable--close", function (e) {
357    $("body").removeClass("megamenu-popup-active");
358    $(".megamenu-clickable--active").removeClass("megamenu-clickable--active");
359    e.preventDefault();
360  });
361
362  /*-- Back-to-top --*/
363  let scrollTop = $(".scroll-top path");
364  if (scrollTop.length) {
365    var e = document.querySelector(".scroll-top path"),
366      t = e.getTotalLength();
367    (e.style.transition = e.style.WebkitTransition = "none"),
368      (e.style.strokeDasharray = t + " " + t),
369      (e.style.strokeDashoffset = t),
370      e.getBoundingClientRect(),
371      (e.style.transition = e.style.WebkitTransition =
372        "stroke-dashoffset 10ms linear");
373    var o = function () {
374      var o = $(window).scrollTop(),
375        r = $(document).height() - $(window).height(),
376        i = t - (o * t) / r;
377      e.style.strokeDashoffset = i;
378    };
379    o(), $(window).scroll(o);
380    var back = $(".scroll-top"),
381      body = $("body, html");
382    $(window).on("scroll", function () {
383      if ($(window).scrollTop() > $(window).height()) {
384        back.addClass("scroll-top--active");
385      } else {
386        back.removeClass("scroll-top--active");
387      }
388    });
389  }
390
391  /*-- Dynamic year --*/
392  let dynamicyearElm = $(".dynamic-year");
393  if (dynamicyearElm.length) {
394    let currentYear = new Date().getFullYear();
395    dynamicyearElm.html(currentYear);
396  }
397})(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.