PageSourceSearch

https://spotless.ie/wp-content/themes/cleanu/assets/js/main.js?ver=7.1.2

js spotless.ie collected 2026-10-02 15:40:28 UTC 16,048 bytes, 467 lines download raw bytes

1/* ===================================================================
2    
3    Author          : Valid Theme
4    Template Name   : Cleanu - Cleaning Services Theme
5    Version         : 1.0
6    
7* ================================================================= */
8(function($) {
9    "use strict";
10
11    $(document).ready(function() {
12
13
14        /* ==================================================
15            # Wow Init
16         ===============================================*/
17        var wow = new WOW({
18            boxClass: 'wow', // animated element css class (default is wow)
19            animateClass: 'animated', // animation css class (default is animated)
20            offset: 0, // distance to the element when triggering the animation (default is 0)
21            mobile: true, // trigger animations on mobile devices (default is true)
22            live: true // act on asynchronously loaded content (default is true)
23        });
24        wow.init();
25
26
27        /* ==================================================
28            # Tooltip Init
29        ===============================================*/
30        $('[data-toggle="tooltip"]').tooltip();
31
32
33        /* ==================================================
34            # Smooth Scroll
35         ===============================================*/
36        $("body").scrollspy({
37            target: ".navbar-collapse",
38            offset: 200
39        });
40        $('a.smooth-menu').on('click', function(event) {
41            var $anchor = $(this);
42            var headerH = '75';
43            $('html, body').stop().animate({
44                scrollTop: $($anchor.attr('href')).offset().top - headerH + "px"
45            }, 1500, 'easeInOutExpo');
46            event.preventDefault();
47        });
48
49
50        /* ==================================================
51            # Sticky Menu
52         ===============================================*/
53        $(window).scroll(function() {
54            var Width = $(document).width();
55
56            if ($("body").scrollTop() > 400 || $("html").scrollTop() > 400) {
57                if (Width > 1023) {
58                    $(".navbar.navbar-common").addClass("sticked");
59                }
60            } else {
61                $(".navbar.navbar-common").removeClass("sticked");
62            }
63        });
64
65
66        /* ==================================================
67            # Banner Animation
68        ===============================================*/
69        function doAnimations(elems) {
70            //Cache the animationend event in a variable
71            var animEndEv = 'webkitAnimationEnd animationend';
72            elems.each(function() {
73                var $this = $(this),
74                    $animationType = $this.data('animation');
75                $this.addClass($animationType).one(animEndEv, function() {
76                    $this.removeClass($animationType);
77                });
78            });
79        }
80
81        //Variables on page load
82        var $immortalCarousel = $('.animate_text'),
83            $firstAnimatingElems = $immortalCarousel.find('.item:first').find("[data-animation ^= 'animated']");
84        //Initialize carousel
85        $immortalCarousel.carousel();
86        //Animate captions in first slide on page load
87        doAnimations($firstAnimatingElems);
88        //Other slides to be animated on carousel slide event
89        $immortalCarousel.on('slide.bs.carousel', function(e) {
90            var $animatingElems = $(e.relatedTarget).find("[data-animation ^= 'animated']");
91            doAnimations($animatingElems);
92        });
93
94
95        
96
97        /* ==================================================
98            # imagesLoaded active
99        ===============================================*/
100        $('#portfolio-grid,.blog-masonry').imagesLoaded(function() {
101
102            /* Filter menu */
103            $('.mix-item-menu').on('click', 'button', function() {
104                var filterValue = $(this).attr('data-filter');
105                $grid.isotope({
106                    filter: filterValue
107                });
108            });
109
110            /* filter menu active class  */
111            $('.mix-item-menu button').on('click', function(event) {
112                $(this).siblings('.active').removeClass('active');
113                $(this).addClass('active');
114                event.preventDefault();
115            });
116
117            /* Filter active */
118            var $grid = $('#portfolio-grid').isotope({
119                itemSelector: '.pf-item',
120                percentPosition: true,
121                masonry: {
122                    columnWidth: '.pf-item',
123                }
124            });
125
126            /* Filter active */
127            $('.blog-masonry').isotope({
128                itemSelector: '.blog-item',
129                percentPosition: true,
130                masonry: {
131                    columnWidth: '.blog-item',
132                }
133            });
134
135        });
136
137
138        /* ==================================================
139            # Fun Factor Init
140        ===============================================*/
141        $('.timer').countTo();
142        $('.fun-fact').appear(function() {
143            $('.timer').countTo();
144        }, {
145            accY: -100
146        });
147
148
149        /* ==================================================
150            Nice Select Init
151         ===============================================*/
152        $('.appinment-forms select').niceSelect();
153        $('.estimate-form select').niceSelect();
154        $('.appoinment-form select').niceSelect()
155        
156        /* ==================================================
157            # Hover Active Init
158        ===============================================*/
159        $('.style-three-item').on('mouseenter', function () {
160            $(this).addClass('active').parent().siblings().find('.style-three-item').removeClass('active');
161        });
162
163        /* ==================================================
164            # Twenty Twenty Plugin Init
165        ===============================================*/
166        $(".twentytwenty-container").twentytwenty({default_offset_pct: 0.7}); 
167
168        /* ==================================================
169            # Magnific popup init
170         ===============================================*/
171        $(".popup-link").magnificPopup({
172            type: 'image',
173            // other options
174        });
175
176        $(".popup-gallery").magnificPopup({
177            type: 'image',
178            gallery: {
179                enabled: true
180            },
181            // other options
182        });
183
184        $(".popup-youtube, .popup-vimeo, .popup-gmaps").magnificPopup({
185            type: "iframe",
186            mainClass: "mfp-fade",
187            removalDelay: 160,
188            preloader: false,
189            fixedContentPos: false
190        });
191
192        $('.magnific-mix-gallery').each(function() {
193            var $container = $(this);
194            var $imageLinks = $container.find('.item');
195
196            var items = [];
197            $imageLinks.each(function() {
198                var $item = $(this);
199                var type = 'image';
200                if ($item.hasClass('magnific-iframe')) {
201                    type = 'iframe';
202                }
203                var magItem = {
204                    src: $item.attr('href'),
205                    type: type
206                };
207                magItem.title = $item.data('title');
208                items.push(magItem);
209            });
210
211            $imageLinks.magnificPopup({
212                mainClass: 'mfp-fade',
213                items: items,
214                gallery: {
215                    enabled: true,
216                    tPrev: $(this).data('prev-text'),
217                    tNext: $(this).data('next-text')
218                },
219                type: 'image',
220                callbacks: {
221                    beforeOpen: function() {
222                        var index = $imageLinks.index(this.st.el);
223                        if (-1 !== index) {
224                            this.goTo(index);
225                        }
226                    }
227                }
228            });
229        });
230
231
232        /* ==================================================
233            # Services Type Carousel
234         ===============================================*/
235        $('.services-type-carousel').owlCarousel({
236            loop: false,
237            nav: false,
238            margin: 30,
239            dots: true,
240            autoplay: true,
241            items: 1,
242            navText: [
243                "<i class='arrow_left'></i>",
244                "<i class='arrow_right'></i>"
245            ]
246        });
247
248
249        /* ==================================================
250            # Feature Service Carousel
251         ===============================================*/
252        $('.feature-service-carousel').owlCarousel({
253            loop: true,
254            nav: false,
255            margin: 30,
256            dots: true,
257            autoplay: true,
258            items: 1,
259            navText: [
260                "<i class='arrow_left'></i>",
261                "<i class='arrow_right'></i>"
262            ]
263        });
264
265
266        /* ==================================================
267            # Project Carousel
268         ===============================================*/
269        $('.project-carousel').owlCarousel({
270            loop: false,
271            margin: 30,
272            nav: true,
273            navText: [
274                "<i class='arrow_left'></i>",
275                "<i class='arrow_right'></i>"
276            ],
277            dots: false,
278            autoplay: true,
279            responsive: {
280                0: {
281                    items: 1
282                },
283                768: {
284                    items: 2
285                },
286                1200: {
287                    items: 2,
288                    loop: true,
289                    center: true
290                }
291            }
292        });
293
294        /* ==================================================
295            # Services Carousel
296         ===============================================*/
297        $('.services-4-col-carousel').owlCarousel({
298            loop: true,
299            margin: 0,
300            nav: true,
301            navText: [
302                "<i class='arrow_left'></i>",
303                "<i class='arrow_right'></i>"
304            ],
305            dots: false,
306            autoplay: true,
307            responsive: {
308                0: {
309                    items: 1
310                },
311                768: {
312                    items: 2,
313                    margin: 30,
314                },
315                1000: {
316                    items: 3,
317                    stagePadding: 0,
318                },
319                1367: {
320                    items: 3,
321                    stagePadding: 100,
322                    center: true,
323                },
324            }
325        });
326
327        /* ==================================================
328            # Testimonials Carousel
329         ===============================================*/
330        $('.testimonial-carousel').owlCarousel({
331            loop: false,
332            nav: false,
333            margin: 30,
334            dots: true,
335            autoplay: true,
336            items: 1,
337            navText: [
338                "<i class='arrow_left'></i>",
339                "<i class='arrow_right'></i>"
340            ]
341        });
342
343         /* ==================================================
344            # Services Carousel
345         ===============================================*/
346         $('.services-style-four-carousel').owlCarousel({
347            loop: true,
348            margin: 30,
349            nav: false,
350            navText: [
351                "<i class='arrow_left'></i>",
352                "<i class='arrow_right'></i>"
353            ],
354            dots: false,
355            autoplay: true,
356            responsive: {
357                0: {
358                    items: 1
359                },
360                768: {
361                    items: 2
362                },
363                992: {
364                    items: 3,
365                }
366            }
367        });
368
369        /* ==================================================
370            # Testimonial Carousel
371         ===============================================*/
372         $('.testimonial-style-two-carousel').owlCarousel({
373            loop: true,
374            margin: 30,
375            nav: true,
376            navText: [
377                "<i class='arrow_left'></i>",
378                "<i class='arrow_right'></i>"
379            ],
380            dots: false,
381            autoplay: true,
382            responsive: {
383                0: {
384                    items: 1
385                },
386                768: {
387                    items: 2
388                }
389            }
390        });
391
392
393        /* ==================================================
394            Contact Form Validations
395        ================================================== */
396        $('.contact-form').each(function() {
397            var formInstance = $(this);
398            formInstance.submit(function() {
399
400                var action = $(this).attr('action');
401
402                $("#message").slideUp(750, function() {
403                    $('#message').hide();
404
405                    $('#submit')
406                        .after('<img src="assets/img/ajax-loader.gif" class="loader" />')
407                        .attr('disabled', 'disabled');
408
409                    $.post(action, {
410                            name: $('#name').val(),
411                            email: $('#email').val(),
412                            phone: $('#phone').val(),
413                            comments: $('#comments').val()
414                        },
415                        function(data) {
416                            document.getElementById('message').innerHTML = data;
417                            $('#message').slideDown('slow');
418                            $('.contact-form img.loader').fadeOut('slow', function() {
419                                $(this).remove()
420                            });
421                            $('#submit').removeAttr('disabled');
422                        }
423                    );
424                });
425                return false;
426            });
427        });
428
429    }); // end document ready function
430
431
432    /* ==================================================
433        Preloader Init
434     ===============================================*/
435    $(window).on('load', function() {
436        // Animate loader off screen
437        $(".se-pre-con").fadeOut("slow");;
438    });
439
440    /* ==================================================
441            # Logo Fixer
442    ===============================================*/
443    function validthemesLogo() {
444        $('.logo').each(function() {
445            var $img = jQuery(this);
446            var imgID = $img.attr('id');
447            var imgClass = $img.attr('class');
448            var imgURL = $img.attr('src');
449            jQuery.get(imgURL, function(data) {
450                var $svg = jQuery(data).find('svg');
451                if(typeof imgID !== 'undefined') {
452                    $svg = $svg.attr('id', imgID);
453                }
454                if(typeof imgClass !== 'undefined') {
455                    $svg = $svg.attr('class', imgClass + ' replaced-svg');
456                }
457                $svg = $svg.removeAttr('xmlns:a');
458                if(!$svg.attr('viewBox') && $svg.attr('height') && $svg.attr('width')) {
459                    $svg.attr('viewBox', '0 0 ' + $svg.attr('height') + ' ' + $svg.attr('width'));
460                }
461                $img.replaceWith($svg);
462            }, 'xml');
463        });
464        validthemesLogo();
465    }
466    
467})(jQuery); // End 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.