PageSourceSearch

https://www.theseaforth.com/js/script.js

js theseaforth.com collected 2026-10-08 08:32:12 UTC 5,803 bytes, 215 lines download raw bytes

1(function($) {
2
3    "use strict";
4
5    function mobileMenu() {
6        //Mobile Navigation
7        $('.hamburger').click(function() {
8            if (!($(this).hasClass('is-active'))) {
9                $(this).addClass('is-active');
10                $('.slide-out-nav, body').addClass('nav-open');
11            } else {
12                $(this).removeClass('is-active');
13                $('.slide-out-nav, body').removeClass('nav-open');
14            }
15        });
16        // Variables
17        var kebabToggler = $('.kebab-toggler');
18        var socialMenu = $('.social-menu');
19        var bodyMobile = $('body');
20        kebabToggler.on('click', function() {
21            socialMenu.toggleClass('menu-on');
22            kebabToggler.toggleClass('active');
23            bodyMobile.toggleClass('nav-open');
24        });
25    };
26    mobileMenu();
27
28    /* Sticky Navbar */
29    $(window).scroll(function () {
30        if ($(this).scrollTop() > 45) {
31            $('.navbar').addClass('active-scrolled');
32        } else {
33            $('.navbar').removeClass('active-scrolled');
34        }
35    });
36
37    var searchPopup = function () {
38      // open search box
39      $('.navbar').on('click', '.search-button', function (e) {
40        $('.search-popup').toggleClass('is-visible');
41      });
42  
43      $('.navbar').on('click', '.btn-close-search', function (e) {
44        $('.search-popup').toggleClass('is-visible');
45      });
46  
47      $(".search-popup-trigger").on("click", function (b) {
48        b.preventDefault();
49        $(".search-popup").addClass("is-visible"),
50          setTimeout(function () {
51            $(".search-popup").find("#search-popup").focus()
52          }, 350)
53      }),
54        $(".search-popup").on("click", function (b) {
55          ($(b.target).is(".search-popup-close") || $(b.target).is(".search-popup-close svg") || $(b.target).is(".search-popup-close path") || $(b.target).is(".search-popup")) && (b.preventDefault(),
56            $(this).removeClass("is-visible"))
57        }),
58        $(document).keyup(function (b) {
59          "27" === b.which && $(".search-popup").removeClass("is-visible")
60        })
61    }
62
63
64
65
66
67
68    // init Chocolat light box
69    var initChocolat = function() {
70      Chocolat(document.querySelectorAll('.image-link'), {
71        imageSize: 'contain',
72        loop: true,
73      })
74    }
75
76    var initExitPopup = function() {
77      // setTimeout(function(){
78      //     $('#leadModal').modal('show');
79      // }, 5000);
80      
81      // Handle form submission
82      $('#leadForm').submit(function(e){
83          e.preventDefault();
84          // Here you would typically send the data to your server
85          alert('Thank you! Your assessment request has been received. We\'ll contact you shortly.');
86          $('#leadModal').modal('hide');
87      });
88      
89      // Alternatively, show modal when user tries to leave
90      $(window).on('mouseout', function(e) {
91          if (e.clientY < 0) {
92              $('#leadModal').modal('show');
93          }
94      });
95    }
96
97    $(document).ready(function() {
98      searchPopup();
99      initChocolat();
100      initExitPopup();
101      
102      AOS.init({
103        duration: 1200,
104        once: true
105      })
106  
107      $(".youtube").colorbox({
108        iframe: true,
109        innerWidth: 960,
110        innerHeight: 585
111      });
112
113      var swiper = new Swiper(".main-banner", {
114        slidesPerView: 4,
115        spaceBetween: 10,
116        autoplay: {
117          delay: 5000,
118        },
119        pagination: {
120          el: "#mobile-products .swiper-pagination",
121          clickable: true,
122        },
123        breakpoints: {
124          0: {
125            slidesPerView: 3,
126            spaceBetween: 20,
127          },
128          980: {
129            slidesPerView: 4,
130            spaceBetween: 20,
131          },
132          1200: {
133            slidesPerView: 4,
134            spaceBetween: 20,
135          }
136        },
137      });
138
139      var swiper = new Swiper(".testimonial-swiper", {
140        slidesPerView: 3,
141        spaceBetween: 20,
142        pagination: {
143          el: ".swiper-pagination",
144          clickable: true,
145        },
146        breakpoints: {
147          0: {
148            slidesPerView: 1,
149            spaceBetween: 20,
150          },
151          1200: {
152            slidesPerView: 3,
153            spaceBetween: 20,
154          }
155        },
156      });
157
158    }); // End of a document ready
159
160    /* MagnificPopup Active Code (for lightbox popups) */
161    if ($.fn.magnificPopup) {
162        $('.gallery-img').magnificPopup({
163            gallery: {
164                enabled: true
165            },
166            type: 'image'
167        });
168
169        /* YouTube, Vimeo, GMaps popup */
170        $('.popup-youtube, .popup-vimeo, .popup-gmaps').magnificPopup({
171          disableOn: 700,
172          type: 'iframe',
173          mainClass: 'mfp-fade',
174          removalDelay: 160,
175          preloader: false,
176          fixedContentPos: false,
177          iframe: {
178              patterns: {
179                youtube: {
180                  index: 'youtube.com/',
181                  id: 'v=', 
182                  src: '//www.youtube.com/embed/%id%?autoplay=1&rel=0'
183                },
184              }
185            }
186        });
187    }
188
189if (typeof Swiper !== "undefined") {
190
191  var staySwiper = new Swiper(".staySwiper", {
192    navigation: {
193      nextEl: ".swiper-button-next",
194      prevEl: ".swiper-button-prev",
195    },
196  });
197
198  var teamSwiper = new Swiper(".teamSwiper", {
199    slidesPerView: 1,
200    spaceBetween: 20,
201    loop: true,
202
203    breakpoints: {
204      600: { slidesPerView: 2 },
205      900: { slidesPerView: 3 },
206      1200: { slidesPerView: 4 }
207    }
208  });
209
210}
211
212
213})(jQuery);
214
215

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.