PageSourceSearch

https://nichesoft.ai/wp-content/themes/orritech/assets/js/theme.js?ver=1.0.0

js nichesoft.ai collected 2026-10-05 14:57:42 UTC 60,320 bytes, 1,591 lines download raw bytes

1;(function ($) {
2
3    "use strict";
4    
5    var pxl_scroll_top;
6    var pxl_window_height;
7    var pxl_window_width;
8    var pxl_scroll_status = '';
9    var pxl_last_scroll_top = 0;
10    $(window).on('load', function () {
11        $(".pxl-loader").addClass("is-loaded");
12        $('.pxl-element-slider').css('opacity', '1');
13        $('.pxl-element-slider').css('transition-delay', '300ms');
14        $('.pxl-gallery-scroll').parents('body').addClass('body-overflow').addClass('body-visible-sm');
15        pxl_window_width = $(window).width();
16        pxl_window_height = $(window).height();
17        orritech_header_sticky();
18        orritech_header_mobile();
19        orritech_scroll_to_top();
20        orritech_footer_fixed();
21        orritech_shop_quantity();
22        orritech_submenu_responsive();
23        orritech_functions();
24        orritech_grid_effects();
25        orritech_column_stretch();
26        orritech_webgl_effects();
27    });
28
29    $(window).on('scroll', function () {
30        pxl_scroll_top = $(window).scrollTop();
31        pxl_window_height = $(window).height();
32        pxl_window_width = $(window).width();
33        if (pxl_scroll_top < pxl_last_scroll_top) {
34            pxl_scroll_status = 'up';
35        } else {
36            pxl_scroll_status = 'down';
37        }
38        pxl_last_scroll_top = pxl_scroll_top;
39        orritech_header_sticky();
40        orritech_scroll_to_top();
41        orritech_footer_fixed();
42    });
43
44    $(window).on('resize', function () {
45        pxl_window_height = $(window).height();
46        pxl_window_width = $(window).width();
47        orritech_submenu_responsive();
48        orritech_header_mobile();
49        orritech_column_stretch();
50        orritech_grid_effects();
51    });
52
53    $(document).ready(function () {
54        $('.pxl-menu-number #menu-main-menu .pxl-menu-primary > li.menu-item').each(function(index) {
55            var menuNumber = index + 1;  
56            var formattedNumber = menuNumber < 10 ? '0' + menuNumber : menuNumber;      
57            $(this).find('> a > span').append('<span class="menu-item-number">' + formattedNumber + '</span>');
58        });        
59
60        $('.pxl-logo-nav').parents('#pxl-header-elementor').addClass('pxl-header-rmboxshadow');
61
62        /* Start Menu Mobile */
63        $('.pxl-header-menu li.menu-item-has-children').append('<span class="pxl-menu-toggle"></span>');
64        $('.pxl-menu-toggle').on('click', function () {
65            if( $(this).hasClass('active')){
66                $(this).closest('ul').find('.pxl-menu-toggle.active').toggleClass('active');
67                $(this).closest('ul').find('.sub-menu.active').toggleClass('active').slideToggle();    
68            }else{
69                $(this).closest('ul').find('.pxl-menu-toggle.active').toggleClass('active');
70                $(this).closest('ul').find('.sub-menu.active').toggleClass('active').slideToggle();
71                $(this).toggleClass('active');
72                $(this).parent().find('> .sub-menu').toggleClass('active');
73                $(this).parent().find('> .sub-menu').slideToggle();
74            }      
75        });
76    
77        $("#pxl-nav-mobile").on('click', function () {
78            $(this).toggleClass('active');
79            $('body').toggleClass('body-overflow');
80            $('.pxl-header-menu').toggleClass('active');
81        });
82        
83        $(".pxl-menu-close, .pxl-header-menu-backdrop, #pxl-header-mobile .pxl-menu-primary a.is-one-page").on('click', function () {
84            $(this).parents('.pxl-header-main').find('.pxl-header-menu').removeClass('active');
85            $('#pxl-nav-mobile').removeClass('active');
86            $('body').toggleClass('body-overflow');
87        });
88        /* End Menu Mobile */
89
90        /* Elementor Header */
91        $('.pxl-type-header-clip > .elementor-container').append('<div class="pxl-header-shape"><span></span></div>');
92
93        /* Scroll To Top */
94        $('.pxl-scroll-top').on(function () {
95            $('html, body').animate({scrollTop: 0}, 800);
96            return false;
97        });
98
99        /* Animate Time Delay */
100        $('.pxl-grid-masonry').each(function () {
101            var eltime = 40;
102            var elt_inner = $(this).children().length;
103            var _elt = elt_inner - 1;
104            $(this).find('> .pxl-grid-item > .wow').each(function (index, obj) {
105                $(this).css('animation-delay', eltime + 'ms');
106                if (_elt === index) {
107                    eltime = 40;
108                    _elt = _elt + elt_inner;
109                } else {
110                    eltime = eltime + 40;
111                }
112            });
113        });
114
115        $('.pxl-item--text').each(function () {
116            var pxl_time = 0;
117            var pxl_item_inner = $(this).children().length;
118            var _elt = pxl_item_inner - 1;
119            $(this).find('> .pxl-text--slide > .wow').each(function (index, obj) {
120                $(this).css('transition-delay', pxl_time + 'ms');
121                if (_elt === index) {
122                    pxl_time = 0;
123                    _elt = _elt + pxl_item_inner;
124                } else {
125                    pxl_time = pxl_time + 80;
126                }
127            });
128        });
129
130        /* Lightbox Popup */
131        $('.btn-video, .pxl-video-popup, .pxl--link-popup').magnificPopup({
132            type: 'iframe',
133            mainClass: 'mfp-fade',
134            removalDelay: 160,
135            preloader: false,
136            fixedContentPos: false
137        });
138
139        $('.images-light-box').each(function () {
140            $(this).magnificPopup({
141                delegate: 'a.light-box',
142                type: 'image',
143                gallery: {
144                    enabled: true
145                },
146                mainClass: 'mfp-fade',
147            });
148        });
149
150        /* Parallax */
151        if($('#pxl-page-title-default').hasClass('pxl--parallax')) {
152            $(this).stellar();
153        }
154
155        /* Animate Time */
156        $('.btn-nina').each(function () {
157            var eltime = 0.045;
158            var elt_inner = $(this).children().length;
159            var _elt = elt_inner - 1;
160            $(this).find('> .pxl--btn-text > span').each(function (index, obj) {
161                $(this).css('transition-delay', eltime + 's');
162                eltime = eltime + 0.045;
163            });
164        });
165
166        /* Search Popup */
167        $(".pxl-search-popup-button").on('click', function () {
168            $('body').addClass('body-overflow');
169            $('#pxl-search-popup').addClass('active');
170            setTimeout(function(){
171                $('#pxl-search-popup .search-field').focus();
172            },1000);
173        });
174        $("#pxl-search-popup .pxl-item--overlay, #pxl-search-popup .pxl-item--close").on('click', function () {
175            $('body').removeClass('body-overflow');
176            $('#pxl-search-popup').removeClass('active');
177        });
178
179        /* Hidden Panel */
180        $('.pxl-anchor-button').each(function () {
181            var t_target = $(this).attr('data-target');
182            var t_delay = $(this).attr('data-delay-hover');
183            $(t_target).find('.pxl-popup--conent').css('transition-delay', t_delay + 'ms');
184            $(t_target).find('.pxl-popup--overlay').css('transition-delay', t_delay + 'ms');
185        });
186
187        $(".pxl-hidden-panel-popup .pxl-popup--overlay, .pxl-hidden-panel-popup .pxl-close-popup").on('click', function () {
188            $('body').removeClass('body-overflow');
189            $('.pxl-hidden-panel-popup').removeClass('active');
190            $('.pxl-popup--conent .wow').addClass('aniOut').removeClass('animated');
191            $('.pxl-popup--conent .fadeInPopup').addClass('aniOut');
192        });
193
194        $(".pxl-popup--close").on('click', function () {
195            $('body').removeClass('body-overflow');
196            $(this).parent().removeClass('active');
197        });
198
199        /* Cart Sidebar Popup */
200        $(".pxl-cart-sidebar-button").on('click', function () {
201            $('body').addClass('body-overflow');
202            $('#pxl-cart-sidebar').addClass('active');
203        });
204        $("#pxl-cart-sidebar .pxl-item--overlay, #pxl-cart-sidebar .pxl-item--close").on('click', function () {
205            $('body').removeClass('body-overflow');
206            $('#pxl-cart-sidebar').removeClass('active');
207        });
208
209        /* Popup */
210        $(".pxl-popup-button").on('click', function () {
211            $('body').addClass('body-overflow');
212            $('#pxl-popup-elementor').addClass('active');
213            $('#pxl-popup-elementor').removeClass('deactivation');
214        });
215        $("#pxl-popup-elementor .pxl-item--overlay, #pxl-popup-elementor .pxl-item--close, .pxl-menu-primary a.is-one-page").on('click', function () {
216            $('body').removeClass('body-overflow');
217            $('#pxl-popup-elementor').removeClass('active');
218            $('#pxl-popup-elementor').addClass('deactivation');
219        });
220
221        /* Hover Active Item */
222        $('.pxl--widget-hover').each(function () {
223            $(this).hover(function () {
224                $(this).parents('.elementor-row').find('.pxl--widget-hover').removeClass('pxl--item-active');
225                $(this).parents('.elementor-container').find('.pxl--widget-hover').removeClass('pxl--item-active');
226                $(this).addClass('pxl--item-active');
227            });
228        });
229
230        /* Hover Button */
231        $('.btn-plus-text').hover(function () {
232            $(this).find('span').toggle(300);
233        });
234
235        /* Nav Logo */
236        $(".pxl-nav-button").on('click', function () {
237            $('.pxl-nav-button').toggleClass('active');
238            $('.pxl-nav-button').parent().find('.pxl-nav-wrap').toggle(400);
239        });
240
241        /* Button Mask */
242        $('.pxl-btn-effect4').append('<span class="pxl-btn-mask"></span>');
243
244        /* Start Icon Bounce */
245        var boxEls = $('.el-bounce, .pxl-image-effect1');
246        $.each(boxEls, function(boxIndex, boxEl) {
247            loopToggleClass(boxEl, 'bounce-active');
248        });
249
250        function loopToggleClass(el, toggleClass) {
251            el = $(el);
252            let counter = 0;
253            if (el.hasClass(toggleClass)) {
254                waitFor(function () {
255                    counter++;
256                    return counter == 2;
257                }, function () {
258                    counter = 0;
259                    el.removeClass(toggleClass);
260                    loopToggleClass(el, toggleClass);
261                }, 'Deactivate', 1000);
262            } else {
263                waitFor(function () {
264                    counter++;
265                    return counter == 3;
266                }, function () {
267                    counter = 0;
268                    el.addClass(toggleClass);
269                    loopToggleClass(el, toggleClass);
270                }, 'Activate', 1000);
271            }
272        }
273
274        function waitFor(condition, callback, message, time) {
275            if (message == null || message == '' || typeof message == 'undefined') {
276                message = 'Timeout';
277            }
278            if (time == null || time == '' || typeof time == 'undefined') {
279                time = 100;
280            }
281            var cond = condition();
282            if (cond) {
283                callback();
284            } else {
285                setTimeout(function() {
286                    waitFor(condition, callback, message, time);
287                }, time);
288            }
289        }
290        /* End Icon Bounce */
291
292        /* Image Effect */
293        if($('.pxl-image-tilt').length){
294            $('.pxl-image-tilt').parents('.elementor-top-section').addClass('pxl-image-tilt-active');
295            $('.pxl-image-tilt').each(function () {
296                var pxl_maxtilt = $(this).data('maxtilt'),
297                    pxl_speedtilt = $(this).data('speedtilt'),
298                    pxl_perspectivetilt = $(this).data('perspectivetilt');
299                VanillaTilt.init(this, {
300                    max: pxl_maxtilt,
301                    speed: pxl_speedtilt,
302                    perspective: pxl_perspectivetilt
303                });
304            });
305        }
306
307        /* Pricing Hover */
308        $('.pxl-pricing1').each(function () {
309            $(this).hover(function () {
310                $(this).parents('.elementor-element').find('.pxl-pricing1').removeClass('is-popular');
311                $(this).addClass('is-popular');
312            });
313        });
314
315        /* Select Theme Style */
316        $('.wpcf7-select').each(function(){
317            var $this = $(this), numberOfOptions = $(this).children('option').length;
318          
319            $this.addClass('pxl-select-hidden'); 
320            $this.wrap('<div class="pxl-select"></div>');
321            $this.after('<div class="pxl-select-higthlight"></div>');
322
323            var $styledSelect = $this.next('div.pxl-select-higthlight');
324            $styledSelect.text($this.children('option').eq(0).text());
325          
326            var $list = $('<ul />', {
327                'class': 'pxl-select-options'
328            }).insertAfter($styledSelect);
329          
330            for (var i = 0; i < numberOfOptions; i++) {
331                $('<li />', {
332                    text: $this.children('option').eq(i).text(),
333                    rel: $this.children('option').eq(i).val()
334                }).appendTo($list);
335            }
336          
337            var $listItems = $list.children('li');
338          
339            $styledSelect.on('click', function(e) {
340                e.stopPropagation();
341                $('div.pxl-select-higthlight.active').not(this).each(function(){
342                    $(this).removeClass('active').next('ul.pxl-select-options').addClass('pxl-select-lists-hide');
343                });
344                $(this).toggleClass('active');
345            });
346          
347            $listItems.on('click', function(e) {
348                e.stopPropagation();
349                $styledSelect.text($(this).text()).removeClass('active');
350                $this.val($(this).attr('rel'));
351            });
352          
353            $(document).on('click', function() {
354                $styledSelect.removeClass('active');
355            });
356
357        });
358        /* Nice Select */
359        $('.woocommerce-ordering .orderby, #pxl-sidebar-area select, .variations_form.cart .variations select').each(function () {
360            $(this).niceSelect();
361        });
362
363        /* Item Hover - Description */
364        $( ".pxl-content-effect .pxl-item--inner" ).hover(
365          function() {
366            $( this ).find('.pxl-item--effect').slideToggle(400);
367          }, function() {
368            $( this ).find('.pxl-item--effect').slideToggle(400);
369          }
370        );
371
372        /* Typewriter */
373        if($('.pxl-title--typewriter').length) {
374            function typewriterOut(elements, callback)
375            {
376                if (elements.length){
377                    elements.eq(0).addClass('is-active');
378                    elements.eq(0).delay( 3000 );
379                    elements.eq(0).removeClass('is-active');
380                    typewriterOut(elements.slice(1), callback);
381                }
382                else {
383                    callback();
384                }
385            }
386
387            function typewriterIn(elements, callback)
388            {
389                if (elements.length){
390                    elements.eq(0).addClass('is-active');
391                    elements.eq(0).delay( 3000 ).slideDown(3000, function(){
392                        elements.eq(0).removeClass('is-active');
393                        typewriterIn(elements.slice(1), callback);
394                    });
395                }
396                else {
397                    callback();
398                }
399            }
400
401            function typewriterInfinite(){
402                typewriterOut($('.pxl-title--typewriter .pxl-item--text'), function(){ 
403                    typewriterIn($('.pxl-title--typewriter .pxl-item--text'), function(){
404                        typewriterInfinite();
405                    });
406                });
407            }
408            $(function(){
409                typewriterInfinite();
410            });
411        }
412        /* End Typewriter */
413
414        /* Section Particles */      
415        setTimeout(function() {
416            $(".pxl-row-particles").each(function() {
417                particlesJS($(this).attr('id'), {
418                  "particles": {
419                    "number": {
420                        "value": $(this).data('number'),
421                    },
422                    "color": {
423                        "value": $(this).data('color')
424                    },
425                    "shape": {
426                        "type": "circle",
427                    },
428                    "size": {
429                        "value": $(this).data('size'),
430                        "random": $(this).data('size-random'),
431                    },
432                    "line_linked": {
433                        "enable": false,
434                    },
435                    "move": {
436                        "enable": true,
437                        "speed": 2,
438                        "direction": $(this).data('move-direction'),
439                        "random": true,
440                        "out_mode": "out",
441                    }
442                  },
443                  "retina_detect": true
444                });
445            });
446        }, 400);
447
448        /* Get checked input - Mailchimpp */
449        $('.mc4wp-form input:checkbox').change(function(){
450            if($(this).is(":checked")) {
451                $('.mc4wp-form').addClass("pxl-input-checked");
452            } else {
453                $('.mc4wp-form').removeClass("pxl-input-checked");
454            }
455        });
456
457        /* Alert */
458        $(".pxl-alert .pxl-alert--close").on('click', function () {
459            $(this).parent().fadeOut();
460        });
461
462        /* Widget remove arrow */
463        $('.widget .pxl-count').parent().addClass('pxl-rm-arrow');
464
465        /* Scroll to content */
466        $('.pxl-link-to-section .btn').on('click', function(e) {
467            var id_scroll = $(this).attr('href');
468            var offsetScroll = $('.pxl-header-elementor-sticky').outerHeight();
469            e.preventDefault();
470            $("html, body").animate({ scrollTop: $(id_scroll).offset().top - offsetScroll }, 600);
471        });
472
473        /* Header Remove Index */
474        $('.pxl-header--rmindex').parents('#pxl-header-elementor').addClass('pxl-header--rmindex-action');
475
476    });
477    
478    jQuery(document).ajaxComplete(function(event, xhr, settings){
479        orritech_shop_quantity();
480    });
481
482    jQuery( document ).on( 'updated_wc_div', function() {
483        orritech_shop_quantity();
484    } );
485
486    function orritech_functions() {
487        // Detect mobile device
488        var isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Nokia|Opera Mini/i.test(navigator.userAgent) ? true : false;
489
490        // Add class "is-mobile" to </body>
491        if(isMobile) {
492            $("body").addClass("is-mobile");
493        } else {
494            $("body").removeClass("is-mobile");
495        }
496
497        /* Svg Length */
498        var getSvgLength = $('.pxl-draw-svg svg path');
499        getSvgLength.each(function() {
500            var pathLength = this.getTotalLength();
501            $(this).attr('stroke-dasharray', pathLength);
502            return pathLength;
503        });
504
505        $('.pxl-draw-svg svg path').each(function() {
506            var stroke = $(this).attr('stroke-dasharray');
507            $(this).css({
508                "stroke-dasharray": stroke,
509                "stroke-dashoffset": stroke
510            });
511
512            var randomId = 'path_' + Math.floor(Math.random() * 1000000);
513            $(this).attr('id', randomId);
514
515            var elementId = $(this).attr('id');
516            var animationName = 'drawAnimation_' + elementId;
517            var keyframes = '@keyframes ' + animationName + ' { ' +
518            'from { stroke-dashoffset: ' + stroke + '; } ' +
519            'to { stroke-dashoffset: 0; } ' +
520            '}';
521
522            var styleElement = $('<style>').text(keyframes);
523            $('head').append(styleElement);
524            $(this).css({
525                'animation-name': animationName,
526                'animation-duration': '2s',
527                'animation-timing-function': 'ease',
528                'animation-fill-mode': 'forwards',
529                'animation-iteration-count': 'infinite'
530            });
531        });
532
533        /*ranger slider */
534        $('.wpcf7-form').each(function () {
535            var rangeSlider = $(this).find('.ct-range-slider');
536            var rangeResult = $(this).find('.ct-range-result');
537            var rangeMaxValue = rangeSlider.attr('data-maxvalue');
538            var rangeCurrency = rangeSlider.attr('data-currency');
539        
540            rangeSlider.slider({
541                range: "min",
542                value: rangeResult.val(), 
543                min: 1,
544                max: rangeMaxValue,
545                slide: function(event, ui) {
546                    rangeResult.val(rangeCurrency + ui.value); 
547                }
548            });
549        
550
551            rangeResult.on('input', function() {
552                var value = parseInt($(this).val().replace(rangeCurrency, ''), 10) || 0; 
553                if (value < 1) {
554                    value = 1; 
555                } else if (value > rangeMaxValue) {
556                    value = rangeMaxValue; 
557                }
558                rangeSlider.slider("value", value); 
559                rangeResult.val(rangeCurrency + value); 
560            });
561        });
562        //numberInput//
563        $(document).ready(function(){
564            $('#numberInput').on('input', function() {
565                let value = $(this).val();
566                if (isNaN(value)) {
567                    $(this).val(value.slice(0, -1));
568                }
569            });
570        });
571        //
572        
573        /* Custom Effect Scroll */
574        $('.pxl-section-overlay-scroll').each(function () {
575            $(this).find('.elementor-background-overlay').addClass('element-scroll');
576        });
577
578        $('.pxl-section-scroll').each(function () {
579            gsap.registerPlugin(ScrollTrigger);
580            const scrollEx = () => {
581                document.body.style.overflow = 'auto';
582                var prevSection = $(this).prev('section');
583                gsap.utils.toArray($(this).find('.element-scroll')).forEach((section, index) => {
584                    const w = section;
585                    var x = w.scrollWidth * -1;
586                    var xEnd = 0;
587                    if($(section).closest('.pxl-section-scroll').hasClass('revesal')){
588                        x = '100%';
589                        xEnd = (w.scrollWidth + 50 - section.offsetWidth) * -1;
590                    }
591                    gsap.fromTo(w, { x }, {
592                        x: xEnd,
593                        scrollTrigger: {
594                            trigger: prevSection,
595                            start: 'top 10%',
596                            end: 'bottom 50%',
597                            scrub: 0.5
598                        }
599                    });
600                });
601            }
602            scrollEx();
603        });
604
605    }
606
607    function orritech_grid_effects() {
608        $('.pixel_stretch').each(function () {
609            var gridItems = $(this).find(".pxl-grid-item");
610            gridItems.each(function () {
611                var itemFeatured = $(this).find(".item--featured");
612                var imgWidth = $(this).find(".item--featured img").width();
613                itemFeatured.css('--pg-img-width', imgWidth + 'px');
614            });
615        });
616    }
617     
618    /* Header Sticky */
619    function orritech_header_sticky() {
620        if($('#pxl-header-elementor').hasClass('is-sticky')) {
621            if (pxl_scroll_top > 100) {
622                $('.pxl-header-elementor-sticky.pxl-sticky-stb').addClass('pxl-header-fixed');
623                $('#pxl-header-mobile').addClass('pxl-header-mobile-fixed');
624            } else {
625                $('.pxl-header-elementor-sticky.pxl-sticky-stb').removeClass('pxl-header-fixed');
626                $('#pxl-header-mobile').removeClass('pxl-header-mobile-fixed');
627            }
628
629            if (pxl_scroll_status == 'up' && pxl_scroll_top > 100) {
630                $('.pxl-header-elementor-sticky.pxl-sticky-stt').addClass('pxl-header-fixed');
631            } else {
632                $('.pxl-header-elementor-sticky.pxl-sticky-stt').removeClass('pxl-header-fixed');
633            }
634        }
635
636        $('.pxl-header-elementor-sticky').parents('body').addClass('pxl-header-sticky');
637    }
638
639    /* Header Mobile */
640    function orritech_header_mobile() {
641        var h_header_mobile = $('#pxl-header-elementor').outerHeight();
642        if(pxl_window_width < 1199) {
643            $('#pxl-header-elementor').css('min-height', h_header_mobile + 'px');
644        }
645    }
646
647    /* Scroll To Top */
648    function orritech_scroll_to_top() {
649        if (pxl_scroll_top < pxl_window_height) {
650            $('.pxl-scroll-top').addClass('pxl-off').removeClass('pxl-on');
651        }
652        if (pxl_scroll_top > pxl_window_height) {
653            $('.pxl-scroll-top').addClass('pxl-on').removeClass('pxl-off');
654        }
655    }
656
657    /* Footer Fixed */
658    function orritech_footer_fixed() {
659        setTimeout(function(){
660            var h_footer = $('.pxl-footer-fixed #pxl-footer-elementor').outerHeight() - 1;
661            $('.pxl-footer-fixed #pxl-main').css('margin-bottom', h_footer + 'px');
662        }, 600);
663    }
664
665    /* WooComerce Quantity */
666    function orritech_shop_quantity() {
667        "use strict";
668        $('#pxl-wapper .quantity').append('<span class="quantity-icon quantity-down pxl-icon--minus"></span><span class="quantity-icon quantity-up pxl-icon--plus"></span>');
669        $('.quantity-up').on('click', function () {
670            $(this).parents('.quantity').find('input[type="number"]').get(0).stepUp();
671            $(this).parents('.woocommerce-cart-form').find('.actions .button').removeAttr('disabled');
672        });
673        $('.quantity-down').on('click', function () {
674            $(this).parents('.quantity').find('input[type="number"]').get(0).stepDown();
675            $(this).parents('.woocommerce-cart-form').find('.actions .button').removeAttr('disabled');
676        });
677        $('.quantity-icon').on('click', function () {
678            var quantity_number = $(this).parents('.quantity').find('input[type="number"]').val();
679            var add_to_cart_button = $(this).parents( ".product, .woocommerce-product-inner" ).find(".add_to_cart_button");
680            add_to_cart_button.attr('data-quantity', quantity_number);
681            add_to_cart_button.attr("href", "?add-to-cart=" + add_to_cart_button.attr("data-product_id") + "&quantity=" + quantity_number);
682        });
683        $('.woocommerce-cart-form .actions .button').removeAttr('disabled');
684    }
685
686    /* Menu Responsive Dropdown */
687    function orritech_submenu_responsive() {
688        var $orritech_menu = $('.pxl-header-elementor-main');
689        $orritech_menu.find('.pxl-menu-primary li').each(function () {
690            var $orritech_submenu = $(this).find('> ul.sub-menu');
691            if ($orritech_submenu.length == 1) {
692                if ( ($orritech_submenu.offset().left + $orritech_submenu.width() + 200 ) > $(window).width()) {
693                    $orritech_submenu.addClass('pxl-sub-reverse');
694                }
695            }
696        });
697    }
698
699    /* Menu Column Stretch Left/Right */
700    function orritech_column_stretch() {
701        var $column_stretch = $('.pxl-column--bg');
702        $column_stretch.each(function () {
703            if ($column_stretch.length == 1) {
704                var $col_offset = $column_stretch.offset().left;
705                var $width_el = $column_stretch.outerWidth();;
706                var $number_stretch = pxl_window_width - $col_offset - $width_el;
707                var $t = $width_el + $number_stretch + 15;
708
709                $column_stretch.css('width', $t + 'px');
710            }
711        });
712    }
713
714    /* Custom WebGL Effects */
715    function orritech_webgl_effects() {
716        // Effect Wave
717        const WebWave_vs = `
718        precision mediump float;
719
720        attribute vec3 aVertexPosition;
721        attribute vec2 aTextureCoord;
722
723        uniform mat4 uMVMatrix;
724        uniform mat4 uPMatrix;
725
726        varying vec3 vVertexPosition;
727        varying vec2 vTextureCoord;
728
729        uniform float uTime;
730
731        void main() {
732            vec3 vertexPosition = aVertexPosition;
733
734            float waveCoords = ((uTime / 45.0) * 3.5) - 1.75;
735
736            float distanceToWave = distance(vec2(vertexPosition.x, 0.0), vec2(waveCoords, 0.0
736));
737
738            vertexPosition.z -= (cos(clamp(distanceToWave, 0.0, 0.75) * 3.141592) - cos(0.75 * 3.141592) + (2.0 * sin(3.141592 * uTime / 90.0))) * 0.025;
739
740            gl_Position = uPMatrix * uMVMatrix * vec4(vertexPosition, 1.0);
741
742            vTextureCoord = aTextureCoord;
743            vVertexPosition = vertexPosition;
744        }
745        `;
746
747        const WebWave_fs = `precision mediump float;
748
749        uniform float uTime;
750
751        varying vec3 vVertexPosition;
752        varying vec2 vTextureCoord;
753
754        uniform sampler2D uExample;
755
756
757        void main() {
758
759            vec2 textureCoords = vec2(vTextureCoord.x, vTextureCoord.y);
760            vec4 finalColor = texture2D(uExample, textureCoords);
761
762            gl_FragColor = finalColor;
763        }`;
764
765        class ImgCurtain {
766            constructor(set) {
767                this.canvas = set.canvas;
768                this.webGLCurtain = new Curtains({
769                    container: this.canvas,
770                    watchScroll: false,
771                    pixelRatio: Math.min(1.5, window.devicePixelRatio)
772                })
773                this.planeElement = set.planeElement;
774                this.mouse = {
775                    x: 0,
776                    y: 0
777                };
778                this.params = {
779                    vertexShader: WebWave_vs,
780                    fragmentShader: WebWave_fs,
781                    widthSegments: 40,
782                    heightSegments: 40,
783                    uniforms: {
784                        time: {
785                            name: "uTime",
786                            type: "1f",
787                            value: 0
788                        },
789                        resolution: {
790                            name: "uReso",
791                            type: "2f",
792                            value: [innerWidth, innerHeight]
793                        }
794                    }
795                };
796                this.initPlane();
797            }
798
799            initPlane() {
800                this.plane = this.webGLCurtain.addPlane(this.planeElement, this.params);
801
802                if (this.plane) {
803                    this.plane.onReady(() => {
804                        this.update();
805                        this.initEvent();
806                    });
807                }
808            }
809
810            update() {
811                this.plane.onRender(() => {
812                    this.plane.uniforms.time.value += 0.01;
813                    this.plane.uniforms.resolution.value = [innerWidth, innerHeight];
814                });
815            }
816
817            initEvent() {
818                let isHovered = false;
819
820                this.planeElement.addEventListener("mouseenter", e => {
821                    isHovered = true;
822                });
823
824                this.planeElement.addEventListener("mouseout", e => {
825                    isHovered = false;
826                });
827
828                this.plane.onRender(() => {
829                    if (isHovered) {
830                        this.plane.uniforms.time.value += (45 - this.plane.uniforms.time.value) * 0.0375;
831                    } else {
832                        this.plane.uniforms.time.value += (0 - this.plane.uniforms.time.value) * 0.0375;
833                    }
834                });
835            }
836        }
837        
838        if (navigator.userAgent.indexOf('Safari') == -1 || navigator.userAgent.indexOf('Chrome') > -1) {
839            $('.pxl-blog-grid-layout1 .pxl-grid-item').each(function() {
840                const $this = $(this),
841                canvas = $this.find('.canvas')[0],
842                planeElement = $this.find('.pxl-item--featured')[0],
843                initialized = $this.data('initialized');
844
845                if (!initialized && canvas && planeElement) {
846                    new ImgCurtain({
847                        canvas: canvas,
848                        planeElement: planeElement
849                    });
850                    $this.data('initialized', true);
851                }
852            });
853        }
854
855
856        if (/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {
857            $('.pxl-blog-grid-layout1 img').css('opacity', '1');
858        }
859
860    }
861
862    $( document ).ajaxComplete(function() {
863        orritech_functions();
864        setTimeout(function () {
865            orritech_grid_effects();
866        }, 500);
867    });
868
869
870    
871    function addSecondLiClass(className, secondLiClass) {
872        // Lấy tất cả các phần tử có lớp (class) tương ứng
873        var lis = document.querySelectorAll('.' + className);
874    
875        // Kiểm tra nếu danh sách có ít nhất 2 phần tử
876        if (lis.length > 1) {
877            // Thêm lớp (class) vào phần tử thứ hai trong danh sách
878            lis[1].classList.add(secondLiClass);
879        }
880    }
881    
882    // Gọi hàm để thêm lớp vào phần tử thứ hai trong danh sách
883    addSecondLiClass('pxl-page-list--li', 'pxl-page-list--li-second');
884    
885
886
887
888function activateHoverEffect(className) {
889
890    var elements = document.querySelectorAll('.' + className);
891
892
893    elements.forEach(function(element) {
894 
895        element.classList.add('hovered');
896
897
898        element.addEventListener('mouseenter', function() {
899            element.classList.add('hovered');
900        });
901
902        element.addEventListener('mouseleave', function() {
903            element.classList.remove('hovered');
904        });
905    });
906}
907
908
909activateHoverEffect('pxl-page-list--li-second');
910
911$(document).ready(function () {                 
912        $('.pxl-menu-number .pxl-menu-primary').each(function() {
913            var menu = $(this);    
914            menu.find('> li.menu-item').each(function(index) {
915                var menuNumber = index + 1;  
916                var formattedNumber = menuNumber < 10 ? '0' + menuNumber : menuNumber;      
917                $(this).find('> a > span').append('<span class="menu-item-number">' + formattedNumber + '</span>');
918            });
919        });
920
921        // Define the updatePrice function
922        function updatePrice() {
923            var value = $('#balance-slider').val();
924            $('#price-display').text('$' + value);
925        }
926
927        $('.pxl-hover-parallax').on('mousemove', function(e) {
928            const bounds = this.getBoundingClientRect();
929            const centerX = bounds.left + bounds.width / 2;
930            const centerY = bounds.top + bounds.height;
931            const deltaX = Math.floor((centerX - e.clientX)) * 0.222;
932            const deltaY = Math.floor((centerY - e.clientY)) * 0.333;
933            $(this).find('.pxl-item-parallax, .pxl-post--button').css({
934                transform: 'translate3d('+ deltaX * 0.32 +'px, '+ deltaY * 0.32 +'px, 0px)'
935            });
936        });
937
938        // Attach change event handler to the range slider
939        $('#balance-slider').on('input', function() {
940            updatePrice(); 
941        });
942
943        $('.pxl-circle-svg svg').each(function() {
944            var linearGradient = $(this).find('.linear-dot1');
945            if (linearGradient.length > 0) {
946                var linearGradientId = linearGradient.attr('id');
947            }
948            var linearGradient1 = $(this).find('.linear-dot2');
949            if (linearGradient1.length > 0) {
950              var linearGradientId1 = linearGradient1.attr('id');
951          }
952          breeza_circle_svg(this,linearGradientId,linearGradientId1);
953      });
954
955
956        $('.pxl-case-carousel1 .pxl-swiper-slide').on('click', function() {
957            $('.pxl-case-carousel1 .pxl-swiper-slide').removeClass('swiper-slide-active');
958            $(this).addClass('swiper-slide-active');
959        });
960
961        $('.pxl-logo-nav').parents('#pxl-header-elementor').addClass('pxl-header-rmboxshadow');      
962
963        /* Start Menu Mobile */
964        $('.pxl-header-menu li.menu-item-has-children').append('<span class="pxl-menu-toggle"></span>');
965        $('.pxl-menu-toggle').on('click', function () {
966            if( $(this).hasClass('active')){
967                $(this).closest('ul').find('.pxl-menu-toggle.active').toggleClass('active');
968                $(this).closest('ul').find('.sub-menu.active').toggleClass('active').slideToggle();    
969            }else{
970                $(this).closest('ul').find('.pxl-menu-toggle.active').toggleClass('active');
971                $(this).closest('ul').find('.sub-menu.active').toggleClass('active').slideToggle();
972                $(this).toggleClass('active');
973                $(this).parent().find('> .sub-menu').toggleClass('active');
974                $(this).parent().find('> .sub-menu').slideToggle();
975            }      
976        });
977
978
979
980        $('#pxl-main input[type="submit"]').before(function() {
981            return $('<button class="pxl-wobble" data-text="Send" data-animation="pxl-xspin" value="Submit">Make Comment</button>');
982        }); 
983
984        $('#de-loader ').prepend($('<div class="lds-roller"><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div>'));
985
986
987        setTimeout(() => {
988            var wobbleElements = document.querySelectorAll('.pxl-wobble');
989            wobbleElements.forEach(function(el){               
990                el.addEventListener('mouseover', function(){
991
992                    if(!el.classList.contains('animating') && !el.classList.contains('mouseover')){
993
994                        el.classList.add('animating','mouseover');
995
996                        var letters = el.innerText.split('');
997
998                        setTimeout(function(){ el.classList.remove('animating'); }, (letters.length + 1) * 50);
999
1000                        var animationName = el.dataset.animation;
1001                        if(!animationName){ animationName = "pxl-jump"; }
1002
1003                        el.innerText = '';
1004
1005                        letters.forEach(function(letter){
1006                            if(letter == " "){
1007                                letter = "&nbsp;";
1008                            }
1009                            el.innerHTML += '<span class="letter">'+letter+'</span>';
1010                        });
1011
1012                        var letterElements = el.querySelectorAll('.letter');
1013                        letterElements.forEach(function(letter, i){
1014                            setTimeout(function(){
1015                                letter.classList.add(animationName);
1016                            }, 50 * i);
1017                        });
1018
1019                    }
1020
1021                });
1022
1023                el.addEventListener('mouseout', function(){
1024                    el.classList.remove('mouseover');
1025                });
1026            });
1027        }, 100);
1028
1029        var post_view = $('.single .pxl---post .post-views');
1030        var post_meta = $('.single .pxl---post .pxl-item--meta');
1031        if(post_view) {
1032            post_meta.append(post_view);
1033        }
1034
1035        $(".pxl-menu-close, .pxl-header-menu-backdrop, #pxl-header-mobile .pxl-menu-primary a.is-one-page").on('click', function () {
1036            $(this).parents('.pxl-header-main').find('.pxl-header-menu').removeClass('active');
1037            $('#pxl-nav-mobile').removeClass('active');
1038            $('body').toggleClass('body-overflow');
1039        });
1040        /* End Menu Mobile */
1041
1042        $(".pxl-item--holder .pxl-item--meta .pxl--social").on('click', function () {
1043            // $(this).parents('.pxl-item--holder').removeClass('active');            
1044            $(this).parents('.pxl-item--holder').toggleClass('active');
1045        });
1046
1047        /* Arrow Custom */
1048        $('.pxl-tabs').parents('.pxl-tab--title').addClass('pxl--hide-arrow');
1049        var section_tab = $('.pxl-navigation-tab').parents('.elementor-section').addClass('pxl--hide-arrow');
1050        setTimeout(function() {
1051            var target = section_tab.find('.pxl-tabs .pxl-tabs--title');
1052            var target_clone = target.clone()
1053            var target_tab = target.parents('.elementor-section.pxl--hide-arrow').find('.pxl-navigation-tab');
1054            target_tab.append(target_clone);
1055            target_tab.find('.pxl-tab--title').on('click', function () {    
1056                $(this).parents('.elementor-section.pxl--hide-arrow').find('.pxl-navigation-tab .pxl-tab--title').toggleClass('active');
1057                $(this).parents('.elementor-section.pxl--hide-arrow').find('.pxl-tabs .pxl-tab--title').toggleClass('active');
1058                $(this).parents('.elementor-section.pxl--hide-arrow').find('.pxl-tabs .pxl-tab--title.active').trigger('click');
1059            });
1060        }, 300);
1061
1062        /* Elementor Header */
1063        $('.pxl-type-header-clip > .elementor-container').append('<div class="pxl-header-shape"><span></span></div>');
1064
1065        /* Scroll To Top */
1066        $(document).on('click', '.pxl-scroll-top', function() {
1067            $('html, body').animate({scrollTop: 0}, 800);
1068            return false;
1069        });
1070
1071        /* Animate Time Delay */
1072        $('.pxl-grid-masonry').each(function () {
1073            var eltime = 40;
1074            var elt_inner = $(this).children().length;
1075            var _elt = elt_inner - 1;
1076            $(this).find('> .pxl-grid-item > .wow').each(function (index, obj) {
1077                $(this).css('animation-delay', eltime + 'ms');
1078                if (_elt === index) {
1079                    eltime = 40;
1080                    _elt = _elt + elt_inner;
1081                } else {
1082                    eltime = eltime + 40;
1083                }
1084            });
1085        });
1086
1087        $('.pxl-item--text').each(function () {
1088            var pxl_time = 0;
1089            var pxl_item_inner = $(this).children().length;
1090            var _elt = pxl_item_inner - 1;
1091            $(this).find('> .pxl-text--slide > .wow').each(function (index, obj) {
1092                $(this).css('transition-delay', pxl_time + 'ms');
1093                if (_elt === index) {
1094                    pxl_time = 0;
1095                    _elt = _elt + pxl_item_inner;
1096                } else {
1097                    pxl_time = pxl_time + 80;
1098                }
1099            });
1100        });
1101
1102        /* Lightbox Popup */
1103        $('.btn-video, .pxl-video-popup, .pxl--link-popup').magnificPopup({
1104            type: 'iframe',
1105            mainClass: 'mfp-fade',
1106            removalDelay: 160,
1107            preloader: false,
1108            fixedContentPos: false
1109        });
1110        
1111        $(".pxl-button.pxl-atc-popup").on('click', function () {
1112            let pagePopup = $('.pxl-wapper').find('.pxl-page-popup');
1113            if (pagePopup.length){
1114                pagePopup.addClass('active');
1115                $('body').addClass('body-overflow');
1116            }
1117        });
1118        $(".pxl-popup--close").on('click', function () {
1119            $('body').removeClass('body-overflow');
1120            $(this).parent().removeClass('active');
1121        });
1122        
1123        $('.images-light-box').each(function () {
1124            $(this).magnificPopup({
1125                delegate: 'a.light-box',
1126                type: 'image',
1127                gallery: {
1128                    enabled: true
1129                },
1130                mainClass: 'mfp-fade',
1131            });
1132        });
1133
1134        // /* Comment Reply */
1135        // $('.comment-reply a').append( '<i class="caseicon-angle-arrow-right"></i>' );
1136
1137        /* Parallax */
1138        if($('#pxl-page-title-default').hasClass('pxl--parallax')) {
1139            $(this).stellar();
1140        }
1141        setTimeout(function() {
1142            if($('.pxl-parallax--image').hasClass('pxl--parallax')) {            
1143                $(this).stellar();            
1144            }
1145        }, 300);
1146
1147        /* Animate Time */
1148        $('.btn-nina').each(function () {
1149            var eltime = 0.045;
1150            var elt_inner = $(this).children().length;
1151            var _elt = elt_inner - 1;
1152            $(this).find('> .pxl--btn-text > span').each(function (index, obj) {
1153                $(this).css('transition-delay', eltime + 's');
1154                eltime = eltime + 0.045;
1155            });
1156        });
1157
1158       
1159
1160        /* Hidden Panel */
1161        $(".pxl-hidden-panel-button").on('click', function () {
1162            $('body').addClass('body-overflow');
1163            $('#pxl-hidden-panel-popup').addClass('active');
1164        });
1165        $("#pxl-hidden-panel-popup .pxl-item--overlay, #pxl-hidden-panel-popup .pxl-item--close").on('click', function () {
1166            $('body').removeClass('body-overflow');
1167            $('#pxl-hidden-panel-popup').removeClass('active');
1168        });
1169
1170        /* Cart Sidebar Popup */
1171        $(".pxl-cart-sidebar-button").on('click', function () {
1172            $('body').addClass('body-overflow');
1173            $('#pxl-cart-sidebar').addClass('active');
1174        });
1175        $("#pxl-cart-sidebar .pxl-item--overlay, #pxl-cart-sidebar .pxl-item--close").on('click', function () {
1176            $('body').removeClass('body-overflow');
1177            $('#pxl-cart-sidebar').removeClass('active');
1178        });
1179
1180        /* Popup */
1181        $(".pxl-popup-button").on('click', function () {
1182            $('body').addClass('body-overflow');
1183            $('#pxl-popup-elementor').addClass('active');
1184            $('#pxl-popup-elementor').removeClass('deactivation');
1185        });
1186        $("#pxl-popup-elementor .pxl-item--overlay, #pxl-popup-elementor .pxl-item--close, .pxl-menu-primary a.is-one-page").on('click', function () {
1187            $('body').removeClass('body-overflow');
1188            $('#pxl-popup-elementor').removeClass('active');
1189            $('#pxl-popup-elementor').addClass('deactivation');
1190        });
1191
1192        /* Nav Logo */
1193        $(".pxl-nav-button").on('click', function () {
1194            $('.pxl-nav-button').toggleClass('active');
1195            $('.pxl-nav-button').parent().find('.pxl-nav-wrap').toggle(400);
1196        });
1197
1198        /* Button Mask */
1199        $('.pxl-btn-effect4').append('<span class="pxl-btn-mask"></span>');
1200
1201        /* Start Icon Bounce */
1202        var boxEls = $('.el-bounce, .pxl-image-effect1');
1203        $.each(boxEls, function(boxIndex, boxEl) {
1204            loopToggleClass(boxEl, 'bounce-active');
1205        });
1206
1207        function loopToggleClass(el, toggleClass) {
1208            el = $(el);
1209            let counter = 0;
1210            if (el.hasClass(toggleClass)) {
1211                waitFor(function () {
1212                    counter++;
1213                    return counter == 2;
1214                }, function () {
1215                    counter = 0;
1216                    el.removeClass(toggleClass);
1217                    loopToggleClass(el, toggleClass);
1218                }, 'Deactivate', 1000);
1219            } else {
1220                waitFor(function () {
1221                    counter++;
1222                    return counter == 3;
1223                }, function () {
1224                    counter = 0;
1225                    el.addClass(toggleClass);
1226                    loopToggleClass(el, toggleClass);
1227                }, 'Activate', 1000);
1228            }
1229        }
1230
1231        function waitFor(condition, callback, message, time) {
1232            if (message == null || message == '' || typeof message == 'undefined') {
1233                message = 'Timeout';
1234            }
1235            if (time == null || time == '' || typeof time == 'undefined') {
1236                time = 100;
1237            }
1238            var cond = condition();
1239            if (cond) {
1240                callback();
1241            } else {
1242                setTimeout(function() {
1243                    waitFor(condition, callback, message, time);
1244                }, time);
1245            }
1246        }
1247        /* End Icon Bounce */
1248
1249        /* Image Effect */
1250        if($('.pxl-image-tilt').length){
1251            $('.pxl-image-tilt').parents('.elementor-top-section').addClass('pxl-image-tilt-active');
1252            $('.pxl-image-tilt').each(function () {
1253                var pxl_maxtilt = $(this).data('maxtilt'),
1254                pxl_speedtilt = $(this).data('speedtilt'),
1255                pxl_perspectivetilt = $(this).data('perspectivetilt');
1256                VanillaTilt.init(this, {
1257                    max: pxl_maxtilt,
1258                    speed: pxl_speedtilt,
1259                    perspective: pxl_perspectivetilt
1260                });
1261            });
1262        }
1263
1264        /* Select Theme Style */
1265        $('.wpcf7-select').each(function(){
1266            var $this = $(this), numberOfOptions = $(this).children('option').length;
1267
1268            $this.addClass('pxl-select-hidden'); 
1269            $this.wrap('<div class="pxl-select"></div>');
1270            $this.after('<div class="pxl-select-higthlight"></div>');
1271
1272            var $styledSelect = $this.next('div.pxl-select-higthlight');
1273            $styledSelect.text($this.children('option').eq(0).text());
1274
1275            var $list = $('<ul />', {
1276                'class': 'pxl-select-options'
1277            }).insertAfter($styledSelect);
1278
1279            for (var i = 0; i < numberOfOptions; i++) {
1280                $('<li />', {
1281                    text: $this.children('option').eq(i).text(),
1282                    rel: $this.children('option').eq(i).val()
1283                }).appendTo($list);
1284            }
1285
1286            var $listItems = $list.children('li');
1287
1288            $styledSelect.on('click', function(e) {
1289                e.stopPropagation();
1290                $('div.pxl-select-higthlight.active').not(this).each(function() {
1291                    $(this).removeClass('active').next('ul.pxl-select-options').addClass('pxl-select-lists-hide');
1292                });
1293                $(this).toggleClass('active');
1294            });
1295
1296            $listItems.on('click', function(e) {
1297                e.stopPropagation();
1298                $styledSelect.text($(this).text()).removeClass('active');
1299                $this.val($(this).attr('rel'));
1300            });
1301
1302            $(document).on('click', function() {
1303                $styledSelect.removeClass('active');
1304            });
1305
1306        });
1307
1308        /* Nice Select */
1309        $('.woocommerce-ordering .orderby, #pxl-sidebar-area select, .pxl-bmi-bmr select').each(function () {
1310            $(this).niceSelect();
1311        });
1312
1313        /* Typewriter */
1314        if($('.pxl-title--typewriter').length) {
1315            function typewriterOut(elements, callback)
1316            {
1317                if (elements.length){
1318                    elements.eq(0).addClass('is-active');
1319                    elements.eq(0).delay( 3000 );
1320                    elements.eq(0).removeClass('is-active');
1321                    typewriterOut(elements.slice(1), callback);
1322                }
1323                else {
1324                    callback();
1325                }
1326            }
1327
1328            function typewriterIn(elements, callback)
1329            {
1330                if (elements.length){
1331                    elements.eq(0).addClass('is-active');
1332                    elements.eq(0).delay( 3000 ).slideDown(3000, function(){
1333                        elements.eq(0).removeClass('is-active');
1334                        typewriterIn(elements.slice(1), callback);
1335                    });
1336                }
1337                else {
1338                    callback();
1339                }
1340            }
1341
1342            function typewriterInfinite(){
1343                typewriterOut($('.pxl-title--typewriter .pxl-item--text'), function(){ 
1344                    typewriterIn($('.pxl-title--typewriter .pxl-item--text'), function(){
1345                        typewriterInfinite();
1346                    });
1347                });
1348            }
1349            $(function(){
1350                typewriterInfinite();
1351            });
1352        }
1353        /* End Typewriter */
1354        $(document).on('click','.pxl-anchor-button',function(e){
1355            e.preventDefault();
1356            e.stopPropagation();
1357            var target = $(this).attr('data-target');
1358            $(target).toggleClass('active');
1359            $('body').addClass('body-overflow');
1360            $('.pxl-popup--conent .wow').addClass('animated').removeClass('aniOut');
1361            $('.pxl-popup--conent .fadeInPopup').removeClass('aniOut');
1362            if($(target).find('.pxl-search-form').length > 0){
1363                setTimeout(function(){
1364                    $(target).find('.pxl-search-form .pxl-search-field').focus();
1365                },1000);
1366            }
1367        });
1368        // 
1369        $(".pxl-particle-background-yes").each(function() {
1370            var randomId = "id-" + Math.random().toString(16).slice(2);
1371            $(this).append('<div id="' + randomId + '" class="pxl-particles-bg"></div>');
1372        });
1373        $(".pxl-particles-bg").each(function() {
1374            particlesJS($(this).attr('id'), {
1375                "particles": {
1376                    "number": {
1377                        "value": 130,
1378                        "density": {
1379                            "enable": true,
1380                            "value_area":1000
1381                        }
1382                    },
1383                    "color": {
1384                        "value": ["#fff"]
1385                    },
1386
1387                    "shape": {
1388                        "type": "circle",
1389                        "stroke": {
1390                            "width": 0,
1391                            "color": "#fff"
1392                        },
1393                        "polygon": {
1394                            "nb_sides": 5
1395                        },
1396                        "image": {
1397                            "src": "img/github.svg",
1398                            "width": 100,
1399                            "height": 100
1400                        }
1401                    },
1402                    "opacity": {
1403                        "value": 0.6,
1404                        "random": false,
1405                        "anim": {
1406                            "enable": false,
1407                            "speed": 1,
1408                            "opacity_min": 0.1,
1409                            "sync": false
1410                        }
1411                    },
1412                    "size": {
1413                        "value": 2,
1414                        "random": true,
1415                        "anim": {
1416                            "enable": false,
1417                            "speed": 40,
1418                            "size_min": 0.1,
1419                            "sync": false
1420                        }
1421                    },
1422                    "line_linked": {
1423                        "enable": true,
1424                        "distance": 120,
1425                        "color": "#ffffff",
1426                        "opacity": 0.4,
1427                        "width": 1
1428                    },
1429                },
1430                "interactivity": {
1431                    "detect_on": "canvas",
1432                    "events": {
1433                        "onhover": {
1434                            "enable": true,
1435                            "mode": "grab"
1436                        },
1437                        "onclick": {
1438                            "enable": false
1439                        },
1440                        "resize": true
1441                    },
1442                    "modes": {
1443                        "grab": {
1444                            "distance": 140,
1445                            "line_linked": {
1446                                "opacity": 1
1447                            }
1448                        },
1449                        "bubble": {
1450                            "distance": 400,
1451                            "size": 40,
1452                            "duration": 2,
1453                            "opacity": 8,
1454                            "speed": 3
1455                        },
1456                        "repulse": {
1457                            "distance": 200,
1458                            "duration": 0.4
1459                        },
1460                        "push": {
1461                            "particles_nb": 4
1462                        },
1463                        "remove": {
1464                            "particles_nb": 2
1465                        }
1466                    }
1467                },
1468                "retina_detect": true
1469            });
1470        });
1471        // 
1472
1473            /* Get Mouse Move Direction */
1474        function getDirection(ev, obj) {
1475            var w = $(obj).width(),
1476            h = $(obj).height(),
1477            x = (ev.pageX - $(obj).offset().left - (w / 2)) * (w > h ? (h / w) : 1),
1478            y = (ev.pageY - $(obj).offset().top - (h / 2)) * (h > w ? (w / h) : 1),
1479            d = Math.round( Math.atan2(y, x) / 1.57079633 + 5 ) % 4;
1480            return d;
1481        }
1482        function addClass( ev, obj, state ) {
1483            var direction = getDirection( ev, obj ),
1484            class_suffix = null;
1485            $(obj).removeAttr('class');
1486            switch ( direction ) {
1487            case 0 : class_suffix = '--top';    break;
1488            case 1 : class_suffix = '--right';  break;
1489            case 2 : class_suffix = '--bottom'; break;
1490            case 3 : class_suffix = '--left';   break;
1491            }
1492            $(obj).addClass( state + class_suffix );
1493        }
1494        $.fn.ctDeriction = function () {
1495            this.each(function () {
1496                $(this).on('mouseenter',function(ev){
1497                    addClass( ev, this, 'pxl-in' );
1498                });
1499                $(this).on('mouseleave',function(ev){
1500                    addClass( ev, this, 'pxl-out' );
1501                });
1502            });
1503        }
1504        $('.pxl-effect--3d .pxl-effect--direction').ctDeriction();
1505
1506        /* Section Particles */      
1507        setTimeout(function() {
1508            $(".pxl-row-particles").each(function() {
1509                particlesJS($(this).attr('id'), {
1510                  "particles": {
1511                    "number": {
1512                        "value": $(this).data('number'),
1513                    },
1514                    "color": {
1515                        "value": $(this).data('color')
1516                    },
1517                    "shape": {
1518                        "type": "circle",
1519                    },
1520                    "size": {
1521                        "value": $(this).data('size'),
1522                        "random": $(this).data('size-random'),
1523                    },
1524                    "line_linked": {
1525                        "enable": false,
1526                    },
1527                    "move": {
1528                        "enable": true,
1529                        "speed": 2,
1530                        "direction": $(this).data('move-direction'),
1531                        "random": true,
1532                        "out_mode": "out",
1533                    }
1534                },
1535                "retina_detect": true
1536            });
1537            });
1538        }, 400);
1539
1540        /* Get checked input - Mailchimpp */
1541        $('.mc4wp-form input:checkbox').change(function(){
1542            if($(this).is(":checked")) {
1543                $('.mc4wp-form').addClass("pxl-input-checked");
1544            } else {
1545                $('.mc4wp-form').removeClass("pxl-input-checked");
1546            }
1547        });
1548
1549        /* Alert */
1550        $(".pxl-alert .pxl-alert--close").on('click', function () {
1551            $(this).parent().fadeOut();
1552        });
1553
1554
1555
1556        $('.pxl-box-list1 .pxl--item').each(function(index) {
1557            $(this).find('.pxl-number').text(index + 1);
1558        });
1559        $(window).on('scroll', function() {
1560            $('.pxl-box-list1 .pxl-number').each(function() {
1561                var element = $(this);
1562                var position = element.offset().top;
1563                var windowHeight = $(window).height();
1564                var scrollTop = $(window).scrollTop();
1565                if (position < (scrollTop + windowHeight) && position + element.height() > scrollTop) {
1566                    element.addClass('border-animation');
1567                }
1568            });
1569        });
1570    });
1571    
1572    $(document).ready(function() {
1573        $('.pxl-process').each(function() {
1574            var items = $(this).find('.pxl--item');
1575            var currentIndex = 0;
1576            var totalItems = items.length;
1577
1578            function showNextItem() {
1579                items.removeClass('active');
1580                $(items[currentIndex]).addClass('active');
1581                currentIndex = (currentIndex + 1) % totalItems;
1582            }
1583            setInterval(showNextItem, 2000);
1584            showNextItem();
1585        });
1586    });
1587
1588})(jQuery);
1589
1590
1591

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.