PageSourceSearch

https://justaddwater.in/wp-content/themes/tronix/assets/js/theme.js?ver=1.1.9

js justaddwater.in collected 2026-10-01 10:39:01 UTC 11,444 bytes, 350 lines download raw bytes

1(function ($) {
2    "use strict";
3    /*---------- 03. Mobile Menu Active ----------*/
4    $.fn.asmobilemenu = function (options) {
5        var opt = $.extend(
6            {
7                menuToggleBtn: ".tronix-menu-toggle",
8                bodyToggleClass: "tronix-body-visible",
9                subMenuClass: "tronix-submenu",
10                subMenuParent: "tronix-item-has-children",
11                subMenuParentToggle: "tronix-active",
12                meanExpandClass: "tronix-mean-expand",
13                appendElement: '<span class="tronix-mean-expand"></span>',
14                subMenuToggleClass: "tronix-open",
15                toggleSpeed: 400,
16            },
17            options
18        );
19
20        return this.each(function () {
21            var menu = $(this); // Select menu
22
23            // Menu Show & Hide
24            function menuToggle() {
25                menu.toggleClass(opt.bodyToggleClass);
26
27                // collapse submenu on menu hide or show
28                var subMenu = "." + opt.subMenuClass;
29                $(subMenu).each(function () {
30                    if ($(this).hasClass(opt.subMenuToggleClass)) {
31                        $(this).removeClass(opt.subMenuToggleClass);
32                        $(this).css("display", "none");
33                        $(this).parent().removeClass(opt.subMenuParentToggle);
34                    }
35                });
36            }
37
38            // Class Set Up for every submenu
39            menu.find("li").each(function () {
40                var submenu = $(this).find("ul");
41                submenu.addClass(opt.subMenuClass);
42                submenu.css("display", "none");
43                submenu.parent().addClass(opt.subMenuParent);
44                submenu.prev("a").append(opt.appendElement);
45                submenu.next("a").append(opt.appendElement);
46            });
47
48            // Toggle Submenu
49            function toggleDropDown($element) {
50                if ($($element).next("ul").length > 0) {
51                    $($element).parent().toggleClass(opt.subMenuParentToggle);
52                    $($element).next("ul").slideToggle(opt.toggleSpeed);
53                    $($element).next("ul").toggleClass(opt.subMenuToggleClass);
54                } else if ($($element).prev("ul").length > 0) {
55                    $($element).parent().toggleClass(opt.subMenuParentToggle);
56                    $($element).prev("ul").slideToggle(opt.toggleSpeed);
57                    $($element).prev("ul").toggleClass(opt.subMenuToggleClass);
58                }
59            }
60
61            // Submenu toggle Button
62            var expandToggler = "." + opt.meanExpandClass;
63            $(expandToggler).each(function () {
64                $(this).on("click", function (e) {
65                    e.preventDefault();
66                    toggleDropDown($(this).parent());
67                });
68            });
69
70            // Menu Show & Hide On Toggle Btn click
71            $(opt.menuToggleBtn).each(function () {
72                $(this).on("click", function () {
73                    menuToggle();
74                });
75            });
76
77            // Hide Menu On out side click
78            menu.on("click", function (e) {
79                e.stopPropagation();
80                menuToggle();
81            });
82
83            // Stop Hide full menu on menu click
84            menu.find("div").on("click", function (e) {
85                e.stopPropagation();
86            });
87        });
88    };
89
90    $(".tronix-menu-wrapper").asmobilemenu();
91
92    /*----------- 16. Smooth Scroll ----------*/
93    SmoothScroll({
94        animationTime: 500,
95        stepSize: 150,
96        accelerationDelta: 50,
97        accelerationMax: 3,
98        keyboardSupport: !1,
99        arrowScroll: 100,
100        pulseAlgorithm: !0,
101        pulseScale: 6,
102        pulseNormalize: 1,
103        touchpadSupport: !1,
104        fixedBackground: !0,
105        excluded: ''
106    });
107
108    /*---------- 04. Sticky fix ----------*/
109    $(window).scroll(function () {
110        var topPos = $(this).scrollTop();
111        if (topPos > 500) {
112            $('#sticky-menu').addClass('sticky');
113        } else {
114            $('#sticky-menu').removeClass('sticky')
115        }
116    })
117
118    // Header Search
119    if ($(".search-open").length) {
120        $(".search-open").on("click", function (e) {
121            e.preventDefault();
122            $(".header-search-popup").toggleClass("active");
123            $("body").toggleClass("locked");
124        });
125    }
126    // Video Post PopUp
127    if ($('.video-popup').length) {
128        $('.video-popup').magnificPopup({
129            disableOn: 700,
130            type: 'iframe',
131            mainClass: 'mfp-fade',
132            removalDelay: 160,
133            preloader: false,
134            fixedContentPos: false
135        });
136    }
137    // Post gallery 
138    if ($('.post-gallerys').length) {
139        $('.post-gallerys').slick({
140            dots: false,
141            infinite: true,
142            speed: 700,
143            cssEase: 'linear',
144            autoplay: true,
145            autoplaySpeed: 2000,
146        });
147    }
148    // Limit Post Navication Title 
149    if ($('.post-nav-container p').length) {
150        $('.post-nav-container p').text($('.post-nav-container p').text().substring(0, 40));
151    }
152
153    $(window).on("load", function () {
154        if ($(".preloader-area").length) {
155            $(".preloader-area").fadeOut();
156        }
157    });
158
159    if ($('.woo-spimg').length) {
160        $('.woo-spimg').magnificPopup({
161            delegate: 'a',
162            type: 'image',
163            mainClass: 'mfp-zoom-out', // this class is for CSS animation below
164            gallery: { enabled: true },
165            zoom: {
166                enabled: true,
167                duration: 300,
168                easing: 'ease-in-out',
169                opener: function (openerElement) {
170                    return openerElement.is('img') ? openerElement : openerElement.find('img');
171                }
172            }
173        });
174    }
175    if ($('.woo-product-big-img').length) {
176        $('.woo-product-big-img').slick({
177            slidesToShow: 1,
178            slidesToScroll: 1,
179            arrows: false,
180            fade: true,
181            asNavFor: '.woo-product-small-img'
182        });
183    }
184    if ($('.woo-product-small-img').length) {
185        $('.woo-product-small-img').slick({
186            slidesToShow: 4,
187            slidesToScroll: 1,
188            asNavFor: '.woo-product-big-img',
189            dots: true,
190            arrows: false,
191            focusOnSelect: true,
192            centerMode: true,
193            centerPadding: '60px',
194        });
195    }
196    if ($('#tronix-shop-view-mode li').length) {
197        $('#tronix-shop-view-mode li').on('click', function () {
198            $('body').removeClass('tronix-product-grid-view').removeClass('tronix-product-list-view');
199
200            if ($(this).hasClass('tronix-shop-list')) {
201                $('body').addClass('tronix-product-list-view');
202                Cookies.set('tronix-shop-view', 'list');
203            } else {
204                $('body').addClass('tronix-product-grid-view');
205                Cookies.remove('tronix-shop-view');
206            }
207            return false;
208        });
209    }
210    if ($('#related-portfolio').length) {
211        $("#related-portfolio").slick({
212            slidesToShow: 4,
213            slidesToScroll: 5,
214            dots: false,
215            arrows: true,
216            prevArrow: $(".tp-related-portfolio-prev"),
217            nextArrow: $(".tp-related-portfolio-next"),
218            infinite: true,
219            autoplay: true,
220            autoplaySpeed: 4000,
221            speed: 4000,
222            responsive: [{
223                breakpoint: 1441,
224                settings: {
225                    slidesToShow: 4,
226                    slidesToScroll: 2,
227                }
228            },
229
230            {
231                breakpoint: 1200,
232                settings: {
233                    slidesToShow: 3,
234                    slidesToScroll: 2,
235                }
236            },
237
238            {
239                breakpoint: 1024,
240                settings: {
241                    slidesToShow: 2,
242                    slidesToScroll: 2,
243                }
244            },
245
246            {
247                breakpoint: 575,
248                settings: {
249                    slidesToShow: 1,
250                    slidesToScroll: 1
251                }
252            }
253            ]
254        });
255    }
256    // Bottom to top 
257    $(window).on('scroll', function () {
258        if ($(this).scrollTop() > 300) {
259            $('#back-top').fadeIn();
260        } else {
261            $('#back-top').fadeOut();
262        }
263    });
264
265    $('#back-top').on('click', function () {
266        $("html, body").animate({
267            scrollTop: 0
268        }, 1000);
269        return false;
270    });
271
272    // WooCommerce product Popup
273    var $rtl = $('body').hasClass("rtl") ? true : false;
274    if ($('.woo-spimg').length) {
275        $('.woo-spimg').magnificPopup({
276            delegate: 'a',
277            type: 'image',
278            mainClass: 'mfp-zoom-out', // this class is for CSS animation below
279            gallery: { enabled: true },
280            zoom: {
281                enabled: true,
282                duration: 300,
283                easing: 'ease-in-out',
284                opener: function (openerElement) {
285                    return openerElement.is('img') ? openerElement : openerElement.find('img');
286                }
287            }
288        });
289    }
290    // WooCommerce Big Image
291    if ($('.woo-product-big-img').length) {
292        $('.woo-product-big-img').slick({
293            slidesToShow: 1,
294            slidesToScroll: 1,
295            arrows: false,
296            fade: true,
297            asNavFor: '.woo-product-small-img',
298            rtl: $rtl,
299        });
300    }
301
302    // WooCommerce Small Image
303    if ($('.woo-product-small-img').length) {
304        $('.woo-product-small-img').slick({
305            slidesToShow: 4,
306            slidesToScroll: 1,
307            asNavFor: '.woo-product-big-img',
308            dots: true,
309            arrows: false,
310            focusOnSelect: true,
311            centerMode: true,
312            centerPadding: '60px',
313            rtl: $rtl,
314        });
315    }
316    // Grid View and List View
317    if ($('#tronix-shop-view-mode li').length) {
318        $('#tronix-shop-view-mode li').on('click', function () {
319            $('body').removeClass('tronix-product-grid-view').removeClass('tronix-product-list-view');
320
321            if ($(this).hasClass('tronix-shop-list')) {
322                $('body').addClass('tronix-product-list-view');
323                Cookies.set('tronix-shop-view', 'list');
324            } else {
325                $('body').addClass('tronix-product-grid-view');
326                Cookies.remove('tronix-shop-view');
327            }
328            return false;
329        });
330    }
331    if ($(".tronix-canva-open").length) {
332        $(".tronix-canva-open").on("click", function (e) {
333            e.preventDefault();
334            $(".canva-tronix-wrapper").toggleClass("active");
335            $("body").toggleClass("locked");
336        });
337    }
338    document.addEventListener('DOMContentLoaded', () => {
339        document.querySelectorAll('a').forEach((link) => {
340            const hasText = link.textContent.trim() !== '';
341            const hasAriaLabel = link.hasAttribute('aria-label');
342
343            if (!hasText && !hasAriaLabel) {
344                const href = link.getAttribute('href') || '#';
345                link.setAttribute('aria-label', `Link to ${href}`);
346            }
347        });
348    });
349
350}(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.