PageSourceSearch

https://coastal.co.tz/wp-content/themes/jetly/assets/js/jetly-theme.js?ver=1790293998

js coastal.co.tz collected 2026-09-24 23:54:28 UTC 9,039 bytes, 285 lines download raw bytes

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