PageSourceSearch

https://terra.marketing/assets/js/main.js

js terra.marketing collected 2026-09-30 04:56:15 UTC 21,127 bytes, 727 lines download raw bytes

1/*-----------------------------------------------------------------------------------
2    ===========================================
3    Terra Compiled Components by Better Brands.
4    ===========================================
5    JS INDEX
6    ===================
7    #. Main Menu
8    #. Testimonials Slider One
9    #. Testimonials Slider Two
10    #. Testimonials Slider Three
11    #. Testimonials Slider Four
12    #. Testimonials Slider Five
13    #. Testimonials Slider Six
14    #. Counter Up
15    #. Service Slider One
16    #. Brand Slider One
17    #. Brand Slider Two
18    #. Testimonial Slider (On Sidebar)
19    #. Progress bar
20    #. Active Nice Select
21    #. Hero Slider
22    #. Screenshot Slider
23    #. Sticky Header
24    #. Preloader
25    #. Video Popup
26    #. Team Slider
27    #. Scroll To Top
28    #. Portfolio Filter
29-----------------------------------------------------------------------------------*/
30
31(function ($) {
32    'use strict';
33
34    // ===== Main Menu
35    function mainMenu() {
36        const navbarToggler = $('.navbar-toggler'),
37            navMenu = $('.nav-menu'),
38            mobilePanel = $('.mobile-slide-panel'),
39            mobilePanelMenu = $('.mobile-menu'),
40            mobileOverly = $('.panel-overlay'),
41            navClose = $('.panel-close');
42
43        // Show Mobile Slide Panel
44        navbarToggler.on('click', function (e) {
45            e.preventDefault();
46            mobilePanel.toggleClass('panel-on');
47        });
48
49        // Close Mobile Slide Panel
50        navClose.add(mobileOverly).on('click', function (e) {
51            e.preventDefault();
52            mobilePanel.removeClass('panel-on');
53        });
54
55        // Adds toggle button to li items that have children
56        navMenu.find('li a').each(function () {
57            if ($(this).next().length > 0) {
58                $(this).append('<span class="dd-trigger"><i class="fas fa-angle-down"></i></span>');
59            }
60        });
61
62        mobilePanelMenu.find('li a').each(function () {
63            if ($(this).next().length > 0) {
64                $(this).append('<span class="dd-trigger"><i class="fas fa-angle-down"></i></span>');
65            }
66        });
67
68        // Expands the dropdown menu on each click
69        mobilePanelMenu.find('.dd-trigger').on('click', function (e) {
70            e.preventDefault();
71            $(this).parent().parent('li').children('ul.sub-menu').stop(true, true).slideToggle(350);
72            $(this).toggleClass('sub-menu-opened');
73        });
74
75
76        const offCanvasBtn = $('.off-canvas-btn'),
77            offCanvasClose = $('.canvas-close'),
78            canvasOverly = $('.canvas-overlay'),
79            offCanvasPanel = $('.off-canvas-wrapper');
80
81        // Show Off canvas Panel
82        offCanvasBtn.on('click', function (e) {
83            e.preventDefault();
84            offCanvasPanel.addClass('canvas-on');
85        });
86
87        // Hide Off canvas Panel
88        offCanvasClose.add(canvasOverly).on('click', function (e) {
89            e.preventDefault();
90            offCanvasPanel.removeClass('canvas-on');
91        });
92    }
93
94    // ===== Testimonials Slider One
95    function testimonialActiveOne() {
96        const slider = $('#testimonialActiveOne');
97
98        slider.slick({
99            infinite: true,
100            dots: true,
101            arrows: false,
102            speed: 500,
103            slidesToShow: 3,
104            slidesToScroll: 1,
105            autoplay: false,
106            autoplaySpeed: 5000,
107            responsive: [
108                {
109                    breakpoint: 992,
110                    settings: {
111                        slidesToShow: 2,
112                    }
113                },
114                {
115                    breakpoint: 768,
116                    settings: {
117                        slidesToShow: 1,
118                    }
119                }
120            ]
121        });
122    }
123
124    // =====Testimonials Slider Two
125    function testimonialActiveTwo() {
126        const slider = $('#testimonialActiveTwo');
127
128        slider.slick({
129            infinite: true,
130            dots: true,
131            arrows: false,
132            speed: 500,
133            slidesToShow: 2,
134            slidesToScroll: 1,
135            autoplay: false,
136            autoplaySpeed: 5000,
137            responsive: [
138                {
139                    breakpoint: 768,
140                    settings: {
141                        slidesToShow: 1,
142                    }
143                }
144            ]
145        });
146    }
147
148    // ===== Testimonials Slider Three
149    function testimonialActiveThree() {
150        const slider = $('#testimonialActiveThree');
151
152        slider.slick({
153            infinite: true,
154            dots: false,
155            arrows: true,
156            speed: 500,
157            slidesToShow: 1,
158            slidesToScroll: 1,
159            autoplay: false,
160            autoplaySpeed: 5000,
161            prevArrow: '<button class="slick-arrow prev-arrow"><i class="fas fa-arrow-left"></i></button>',
162            nextArrow: '<button class="slick-arrow next-arrow"><i class="fas fa-arrow-right"></i></button>',
163            responsive: [
164                {
165                    breakpoint: 430,
166                    settings: {
167                        arrows: false,
168                    }
169                }
170            ]
171        });
172    }
173
174    // ===== Testimonials Slider Four
175    function testimonialActiveFour() {
176        const slider = $('#testimonialActiveFour');
177
178        slider.slick({
179            infinite: true,
180            dots: true,
181            arrows: false,
182            speed: 500,
183            slidesToShow: 2,
184            slidesToScroll: 1,
185            autoplay: false,
186            autoplaySpeed: 5000,
187            responsive: [
188                {
189                    breakpoint: 992,
190                    settings: {
191                        slidesToShow: 1,
192                    }
193                }
194            ]
195        });
196    }
197
198    // ===== Testimonials Slider Five
199    function testimonialActiveFive() {
200        const slider = $('#testimonialActiveFive');
201
202        slider.slick({
203            infinite: true,
204            dots: true,
205            arrows: false,
206            speed: 500,
207            slidesToShow: 1,
208            slidesToScroll: 1,
209            autoplay: false,
210            autoplaySpeed: 5000,
211        });
212    }
213
214    // ===== Testimonials Slider Six
215    function testimonialActiveSix() {
216        const slider = $('#testimonialActiveSix');
217
218        slider.slick({
219            infinite: true,
220            dots: true,
221            arrows: false,
222            speed: 500,
223            slidesToShow: 4,
224            slidesToScroll: 1,
225            autoplay: false,
226            autoplaySpeed: 5000,
227            responsive: [
228                {
229                    breakpoint: 1200,
230                    settings: {
231                        slidesToShow: 3,
232                    }
233                },
234                {
235                    breakpoint: 992,
236                    settings: {
237                        slidesToShow: 2,
238                    }
239                },
240                {
241                    breakpoint: 768,
242                    settings: {
243                        slidesToShow: 1,
244                    }
245                }
246            ]
247        });
248    }
249
250    // ===== Testimonials Slider Seven
251    function testimonialActiveSeven() {
252        const slider = $('.testimonial-boxes-v3');
253
254        slider.slick({
255            infinite: true,
256            dots: true,
257            arrows: false,
258            speed: 500,
259            slidesToShow: 1,
260            slidesToScroll: 1,
261            autoplay: false,
262            autoplaySpeed: 5000,
263        });
264    }
265
266    // ===== Testimonials Slider Eight
267    function testimonialActiveEight() {
268        const slider = $('.customer-review-wrap');
269        slider.slick({
270            infinite: true,
271            dots: true,
272            arrows: false,
273            speed: 500,
274            slidesToShow: 1,
275            slidesToScroll: 1,
276            autoplay: false,
277            autoplaySpeed: 5000,
278        });
279    }
280
281    // ===== Counter Up
282    function counterUp() {
283        $('.counter-item').on('inview', function (event, isInView) {
284            if (isInView) {
285                $(this).find('.counter').each(function () {
286                    $(this).prop('Counter', 0).animate({
287                        Counter: $(this).text()
288                    }, {
289                        duration: 3000,
290                        easing: 'swing',
291                        step: function (now) {
292                            $(this).text(Math.ceil(now));
293                        }
294                    });
295                });
296                $(this).unbind('inview');
297            }
298        });
299    }
300
301    // ===== Service Slider One
302    function serviceSliderActive() {
303        const slider = $('#serviceSliderActive');
304
305        slider.slick({
306            infinite: true,
307            dots: false,
308            arrows: false,
309            speed: 500,
310            slidesToShow: 6,
311            slidesToScroll: 1,
312            autoplay: false,
313            autoplaySpeed: 5000,
314            responsive: [
315                {
316                    breakpoint: 1800,
317                    settings: {
318                        slidesToShow: 5,
319                    }
320                },
321                {
322                    breakpoint: 1600,
323                    settings: {
324                        slidesToShow: 4,
325                    }
326                },
327                {
328                    breakpoint: 1200,
329                    settings: {
330                        slidesToShow: 3,
331                    }
332                },
333                {
334                    breakpoint: 992,
335                    settings: {
336                        slidesToShow: 2,
337                    }
338                },
339                {
340                    breakpoint: 576,
341                    settings: {
342                        slidesToShow: 1,
343                    }
344                }
345            ]
346        });
347    }
348
349    // ===== Brand Slider One
350    function brandSlider() {
351        const slider = $('.brand-slider-one-active');
352
353        slider.slick({
354            infinite: true,
355            dots: false,
356            arrows: false,
357            speed: 500,
358            slidesToShow: 5,
359            slidesToScroll: 1,
360            autoplay: false,
361            autoplaySpeed: 5000,
362            responsive: [
363                {
364                    breakpoint: 1200,
365                    settings: {
366                        slidesToShow: 4,
367                    }
368                },
369                {
370                    breakpoint: 992,
371                    settings: {
372                        slidesToShow: 3,
373                    }
374                },
375                {
376                    breakpoint: 500,
377                    settings: {
378                        slidesToShow: 2,
379                    }
380                },
381            ]
382        });
383    }
384
385    // ===== Brand Slider Two
386    function brandSliderTwo() {
387        const slider = $('.brand-slider-two-active');
388
389        slider.slick({
390            infinite: true,
391            dots: false,
392            arrows: false,
393            speed: 500,
394            slidesToShow: 6,
395            slidesToScroll: 1,
396            autoplay: false,
397            autoplaySpeed: 5000,
398            responsive: [
399                {
400                    breakpoint: 1200,
401                    settings: {
402                        slidesToShow: 5,
403                    }
404                },
405                {
406                    breakpoint: 992,
407                    settings: {
408                        slidesToShow: 4,
409                    }
410                },
411                {
412                    breakpoint: 768,
413                    settings: {
414                        slidesToShow: 3,
415                    }
416                },
417                {
418                    breakpoint: 576,
419                    settings: {
420                        slidesToShow: 2,
421                    }
422                },
423            ]
424        });
425    }
426
427    // ===== Testimonial Slider (On Sidebar)
428    function testimonialWidgetSlider() {
429        const slider = $('.testimonial-widget-active');
430
431        slider.slick({
432            infinite: true,
433            dots: true,
434            arrows: false,
435            speed: 500,
436            slidesToShow: 1,
437            slidesToScroll: 1,
438            autoplay: false,
439            autoplaySpeed: 5000,
440        });
441    }
442
443    // ===== Progress bar
444    function progressBar() {
445        $('.progress-bars').on('inview', function (event, isInView) {
446            if (isInView) {
447                $(this).find('.single-progress').each(function () {
448                    const percentage = $(this).data('percentage'),
449                        lineInner = $(this).find('.line-inner'),
450                        widthCss = percentage + '%';
451
452                    lineInner.width(widthCss);
453                });
454                $(this).unbind('inview');
455            }
456        });
457    }
458
459    // ===== Active Nice Select
460    function activeNiceSelect() {
461        $('select').niceSelect();
462    }
463
464    // ===== Hero Slider
465    function heroSlider() {
466        const slider = $('.hero-slider');
467
468        slider.slick({
469            infinite: true,
470            slidesToShow: 1,
471            slidesToScroll: 1,
472            autoplay: false,
473            autoplaySpeed: 5000,
474            speed: 500,
475            arrows: true,
476            fade: false,
477            dots: true,
478            swipe: true,
479            prevArrow: '<button class="slick-arrow prev-arrow"><i  class="fas fa-angle-left"></i></button>',
480            nextArrow: '<button class="slick-arrow next-arrow"><i  class="fas fa-angle-right"></i></button>',
481            responsive: [
482                {
483                    breakpoint: 576,
484                    settings: {
485                        dots: false,
486                    }
487                },
488                {
489                    breakpoint: 425,
490                    settings: {
491                        dots: false,
492                        arrows: false,
493                    }
494                }
495            ]
496        });
497    }
498
499    // ==== Screenshot Slider
500    function screenshotSlider() {
501        $('.screenshot-slider').slick({
502            dots: false,
503            arrows: true,
504            infinite: true,
505            autoplay: false,
506            speed: 600,
507            slidesToShow: 4,
508            slidesToScroll: 1,
509            prevArrow: '<button class="slick-arrow prev-arrow"><i class="far fa-angle-left"></i></button>',
510            nextArrow: '<button class="slick-arrow next-arrow"><i class="far fa-angle-right"></i></button>',
511            appendArrows: $('.screenshot-arrows'),
512            responsive: [
513                {
514                    breakpoint: 992,
515                    settings: {
516                        slidesToShow: 3,
517                    }
518                },
519                {
520                    breakpoint: 768,
521                    settings: {
522                        slidesToShow: 2,
523                    }
524                },
525            ]
526        });
527    }
528
529    // ==== Sticky Header
530    function stickyHeader() {
531        const scroll_top = $(window).scrollTop(),
532            siteHeader = $('.template-header');
533
534        if (siteHeader.hasClass('sticky-header')) {
535            if (scroll_top < 110) {
536                siteHeader.removeClass('sticky-on');
537            } else {
538                siteHeader.addClass('sticky-on');
539            }
540        }
541    }
542
543    // ==== Preloader
544    function preloader() {
545        $('#preloader').delay(500).fadeOut(500);
546    }
547
548    // ==== Video Popup
549    function videoPopup() {
550        $('.popup-video').each(function () {
551            $(this).magnificPopup({
552                type: 'iframe',
553            });
554        });
555    }
556
557    // ===== Team Slider
558    function teamSliderOne() {
559        const slider = $('#teamSliderOne');
560
561        slider.slick({
562            infinite: true,
563            dots: false,
564            arrows: false,
565            speed: 500,
566            slidesToShow: 5,
567            slidesToScroll: 1,
568            autoplay: false,
569            autoplaySpeed: 5000,
570            responsive: [
571                {
572                    breakpoint: 1400,
573                    settings: {
574                        slidesToShow: 4,
575                    }
576                },
577                {
578                    breakpoint: 1200,
579                    settings: {
580                        slidesToShow: 3,
581                    }
582                },
583                {
584                    breakpoint: 992,
585                    settings: {
586                        slidesToShow: 2,
587                    }
588                },
589                {
590                    breakpoint: 620,
591                    settings: {
592                        slidesToShow: 1,
593                    }
594                }
595            ]
596        });
597    }
598
599    // ===== Scroll To Top
600    function scrollToTop() {
601        var $scrollUp = $('#scroll-top'),
602            $lastScrollTop = 0,
603            $window = $(window);
604
605        $window.on('scroll', function () {
606            var st = $(this).scrollTop();
607            if (st > $lastScrollTop) {
608                $scrollUp.removeClass('show');
609            } else {
610                if ($window.scrollTop() > 200) {
611                    $scrollUp.addClass('show');
612                } else {
613                    $scrollUp.removeClass('show');
614                }
615            }
616            $lastScrollTop = st;
617        });
618
619        $scrollUp.on('click', function (evt) {
620            $('html, body').animate({ scrollTop: 0 }, 600);
621            evt.preventDefault();
622        });
623    }
624
625    // ===== Portfolio FIlter
626    function portfolioFilter() {
627        const items = $('.portfolio-filter-items').isotope();
628
629        // Items on button click
630        $('.portfolio-filter').on('click', 'li', function (e) {
631            const filterValue = $(this).attr('data-filter');
632            items.isotope({
633                filter: filterValue
634            });
635        });
636
637        // Menu active class
638        $('.portfolio-filter li').on('click', function (event) {
639            $('.portfolio-filter .active').removeClass('active');
640            $(this).addClass('active');
641
642            event.preventDefault();
643        });
644    }
645
646    // ===== Portfolio FIlter Two
647    function portfolioFilter() {
648        const items = $('.portfolio-items-two').isotope();
649
650        // Items on button click
651        $('.portfolio-filter-two').on('click', 'li', function (e) {
652            const filterValue = $(this).attr('data-filter');
653            items.isotope({
654                filter: filterValue
655            });
656        });
657
658        // Menu active class
659        $('.portfolio-filter-two li').on('click', function (event) {
660            $('.portfolio-filter-two .active').removeClass('active');
661            $(this).addClass('active');
662
663            event.preventDefault();
664        });
665    }
666    
667    
668    // 22. Price range Fliter jQuery UI
669    if ($('.price-slider-range').length) {
670        $( ".price-slider-range" ).slider({
671          range: "min",
672          value: 5960,
673          min: 5,
674          max: 8000,
675          slide: function( event, ui ) {
676            $( "#price" ).val( "$" + ui.value );
677          }
678        });
679        $( "#price" ).val( "$" + $( ".price-slider-range" ).slider( "value" ) );
680    }
681
682    /*---------------------
683    === Document Ready  ===
684    ----------------------*/
685    $(document).ready(function () {
686        mainMenu();
687        testimonialActiveOne();
688        testimonialActiveTwo();
689        testimonialActiveThree();
690        testimonialActiveFour();
691        testimonialActiveFive();
692        testimonialActiveSix();
693        testimonialActiveSeven();
694        testimonialActiveEight();
695        counterUp();
696        serviceSliderActive();
697        brandSlider();
698        testimonialWidgetSlider();
699        progressBar();
700        activeNiceSelect();
701        heroSlider();
702        brandSliderTwo();
703        screenshotSlider();
704        videoPopup();
705        teamSliderOne();
706        scrollToTop();
707        portfolioFilter();
708    });
709
710    /*---------------------
711    === Window Scroll  ===
712    ----------------------*/
713    $(window).on('scroll', function () {
714        stickyHeader();
715    });
716
717    /*------------------
718    === Window Load  ===
719    --------------------*/
720    $(window).on('load', function () {
721        preloader();
722
723        // wow Init
724        new WOW().init();
725    });
726
727})(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.