PageSourceSearch

https://pritchi.ru/assets/js/main.js

js pritchi.ru collected 2026-10-02 04:59:12 UTC 11,084 bytes, 387 lines download raw bytes

1(function($) {
2    'use strict';
3
4    // Page loading
5	/*
6    $(window).on('load', function() {
7        $('#preloader-active').delay(450).fadeOut('slow');
8        $('body').delay(450).css({
9            'overflow': 'visible'
10        });
11    });
12	*/
13
14    // Scroll progress
15    var scrollProgress = function() {
16        var docHeight = $(document).height(),
17            windowHeight = $(window).height(),
18            scrollPercent;
19        $(window).on('scroll', function() {
20            scrollPercent = $(window).scrollTop() / (docHeight - windowHeight) * 100;
21            $('.scroll-progress').width(scrollPercent + '%');
22        });
23    };
24
25    // Off canvas sidebar
26    var OffCanvas = function() {
27        $('.off-canvas-toggle').on('click', function() {
28            $('body').toggleClass("canvas-opened");
29        });
30
31        $('.dark-mark').on('click', function() {
32            $('body').removeClass("canvas-opened");
33        });
34        $('.off-canvas-close').on('click', function() {
35            $('body').removeClass("canvas-opened");
36        });
37    };
38
39    // Search form
40    var openSearchForm = function() {
41        $('.search-close').hide();
42        $('button.search-icon').on('click', function() {
43            $(this).hide();
44            $('body').toggleClass("open-search-form");
45            $('.search-close').show();
46            $("html, body").animate({ scrollTop: 0 }, "slow");
47        });
48        $('.search-close').on('click', function() {
49            $(this).hide();
50            $('body').removeClass("open-search-form");
51            $('button.search-icon').show();
52        });
53    };
54
55    // Mobile menu
56    var mobileMenu = function() {
57        var menu = $('ul#navigation');
58        if (menu.length) {
59            menu.slicknav({
60                prependTo: ".mobile_menu",
61                closedSymbol: '+',
62                openedSymbol: '-'
63            });
64        };
65    };
66
67    // Slick slider
68    var customSlickSlider = function() {
69        // Featured slider 1
70        $('.featured-slider-1-items').slick({
71            dots: false,
72            infinite: true,
73            speed: 1000,
74            arrows: false,
75            slidesToShow: 1,
76            autoplay: true,
77            loop: true,
78            adaptiveHeight: true,
79            fade: true,
80            cssEase: 'linear',           
81        });
82        // post-carausel-1-items
83        $('.post-carausel-1-items').slick({
84            dots: false,
85            infinite: true,
86            speed: 1000,
87            arrows: true,
88            slidesToShow: 6,
89            slidesToScroll: 1,
90            autoplay: true,
91            loop: true,
92            adaptiveHeight: true,
93            cssEase: 'linear',
94            prevArrow: '<button type="button" class="slick-prev"><i class="flaticon-left"></i></button>',
95            nextArrow: '<button type="button" class="slick-next"><i class="flaticon-right"></i></button>',
96            appendArrows: '.post-carausel-1-arrow',
97            centerPadding: 50,
98            responsive: [{
99                    breakpoint: 1024,
100                    settings: {
101                        slidesToShow: 6,
102                        slidesToScroll: 6,
103                        infinite: true,
104                        dots: false,
105                    }
106                },
107                {
108                    breakpoint: 991,
109                    settings: {
110                        slidesToShow: 3,
111                        slidesToScroll: 3
112                    }
113                },
114                {
115                    breakpoint: 480,
116                    settings: {
117                        slidesToShow: 2,
118                        slidesToScroll: 2
119                    }
120                }
121            ]
122        });
123
124        // post-carausel-2
125        $('.post-carausel-2').slick({
126            dots: true,
127            infinite: false,
128            speed: 1000,
129            arrows: false,
130            slidesToShow: 4,
131            slidesToScroll: 1,
132            autoplay: false,
133            loop: false,
134            adaptiveHeight: true,
135            cssEase: 'linear',
136            centerPadding: 50,
137            responsive: [{
138                    breakpoint: 1024,
139                    settings: {
140                        slidesToShow: 3,
141                        slidesToScroll: 3,
142                        dots: false,
143                    }
144                },
145                {
146                    breakpoint: 991,
147                    settings: {
148                        slidesToShow: 2,
149                        slidesToScroll: 2
150                    }
151                },
152                {
153                    breakpoint: 480,
154                    settings: {
155                        slidesToShow: 1,
156                        slidesToScroll: 1
157                    }
158                }
159            ]
160        });
161
162        // post-carausel-3
163        $('.post-carausel-3').slick({
164            dots: true,
165            infinite: true,
166            speed: 1000,
167            arrows: false,
168            slidesToShow: 4,
169            slidesToScroll: 1,
170            autoplay: true,
171            loop: true,
172            adaptiveHeight: true,
173            cssEase: 'linear',
174            centerPadding: 50,
175            responsive: [{
176                    breakpoint: 1024,
177                    settings: {
178                        slidesToShow: 4,
179                        slidesToScroll: 4,
180                        infinite: true,
181                        dots: false,
182                    }
183                },
184                {
185                    breakpoint: 991,
186                    settings: {
187                        slidesToShow: 2,
188                        slidesToScroll: 1
189                    }
190                },
191                {
192                    breakpoint: 480,
193                    settings: {
194                        slidesToShow: 1,
195                        slidesToScroll: 1
196                    }
197                }
198            ]
199        });
200
201        $('.featured-slider-2-items').slick({
202            fade: true,
203            asNavFor: '.featured-slider-2-nav',
204            arrows: true,
205            prevArrow: '<button type="button" class="slick-prev"><i class="flaticon-left"></i></button>',
206            nextArrow: '<button type="button" class="slick-next"><i class="flaticon-right"></i></button>',
207            appendArrows: '.arrow-cover',
208        });
209
210        $('.featured-slider-2-nav').slick({
211            slidesToShow: 4,
212            slidesToScroll: 1,
213            asNavFor: '.featured-slider-2-items',
214            dots: false,
215            arrows: false,
216            centerMode: true,
217            focusOnSelect: true,
218            centerPadding: 0,
219            responsive: [{
220                    breakpoint: 1024,
221                    settings: {
222                        slidesToShow: 3,
223                    }
224                },
225                {
226                    breakpoint: 991,
227                    settings: {
228                        slidesToShow: 2,
229                    }
230                },
231                {
232                    breakpoint: 480,
233                    settings: {
234                        slidesToShow: 1,
235                    }
236                }
237            ]
238        });
239    };
240
241    // Nice Select
242    var niceSelectBox = function() {
243        //var nice_Select = $('select');
244        var nice_Select = $('[data-nice-select]');
245        if (nice_Select.length) {
246            nice_Select.niceSelect();
247        }
248    };
249
250    //Header sticky
251    var headerSticky = function() {
252        $(window).on('scroll', function() {
253            var scroll = $(window).scrollTop();
254            if (scroll < 245) {
255                $(".header-sticky ").removeClass("sticky-bar");
256            } else {
257                $(".header-sticky").addClass("sticky-bar");
258            }
259        });
260    };
261
262    // Scroll up to top
263    var scrollToTop = function() {
264        $.scrollUp({
265            scrollName: 'scrollUp', // Element ID
266            topDistance: '300', // Distance from top before showing element (px)
267            topSpeed: 300, // Speed back to top (ms)
268            animation: 'fade', // Fade, slide, none
269            animationInSpeed: 200, // Animation in speed (ms)
270            animationOutSpeed: 200, // Animation out speed (ms)
271            scrollText: '<i class="ti-arrow-up"></i>', // Text for element
272            activeOverlay: false, // Set CSS color to display scrollUp active point, e.g '#00FFFF'
273        });
274    };
275
276    //VSticker
277    var VSticker = function() {
278		if ($('#datetime').length) {
279			$('#datetime').vTicker({
280				speed: 1000,
281				pause: 3000,
282				animation: 'fade',
283				mousePause: false,
284				showItems: 1
285			});
286		};
287    };
288
289    //sidebar sticky
290    var stickySidebar = function() {
291        $('.sticky-sidebar').theiaStickySidebar();
292    };
293
294    //Custom scrollbar
295    var customScrollbar = function() {
296        var $ = document.querySelector.bind(document);
297        var ps = new PerfectScrollbar('.custom-scrollbar');
298    };
299
300    //Mega menu
301    var megaMenu = function() {
302        $('.sub-mega-menu .nav-pills > a').on('mouseover', function(event) {
303            $(this).tab('show');
304        });
305    };
306
307    //Counter
308    var numberCounter = function() {
309        $('.counter-number').counterUp({
310            delay: 10,
311            time: 2000
312        });
313    };
314
315    //magnific Popup
316    var magPopup = function() {
317        $('.play-video').magnificPopup({
318            disableOn: 700,
319            type: 'iframe',
320            mainClass: 'mfp-fade',
321            removalDelay: 160,
322            preloader: false,
323            fixedContentPos: false
324        });
325    };
326
327    // toolTip
328    var toolTip = function() {
329        $('[data-toggle="tooltip"]').tooltip();
330    };
331
332    // WOW
333    var wowJs = function() {
334        new WOW().init();
335    };
336	
337	// Spoiler
338	var spoilers = function() {
339		$('[data-content-spoiler]').each(function() {
340			var $spoiler = $(this);
341			var $body    = $spoiler.find('[data-content-spoiler-body]');
342			var $inner   = $spoiler.find('[data-content-spoiler-inner]');
343			var $btn     = $spoiler.find('[data-content-spoiler-btn]');
344			var height   = $spoiler.data('height');
345
346			$body.css('height', height);
347
348			$btn.on('click', function(e) {
349				e.preventDefault();
350				$spoiler.toggleClass('expanded');
351				if ($spoiler.hasClass('expanded')) {
352					$body.css('height', $inner.height());
353				} else {
354					$body.css('height', height);
355				}
356			});
357		});
358	};
359    //Load functions
360    $(document).ready(function() {
361	    // Page loading
362        //$('#preloader-active').fadeOut('slow');		//Íóæíî äëÿ âêëþ÷åíèÿ çàñòàâêè ïåðåä çàãðóçêîé
363        $('body').css({
364            'overflow': 'visible'
365        });
366
367        toolTip();
368        OffCanvas();
369        customScrollbar();
370        numberCounter();
371        megaMenu();
372        magPopup();
373        scrollToTop();
374        headerSticky();
375        stickySidebar();
376        customSlickSlider();
377        mobileMenu();
378        scrollProgress();
379        niceSelectBox();
380        openSearchForm();
381        wowJs();
382		spoilers();
383        VSticker();
384		//alertClose();
385    });
386
387})(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.