PageSourceSearch

https://sylviamilo.com/wp-content/themes/soprano-theme/public/scripts/controllers/sliders.js?ver=7.1.2

js sylviamilo.com collected 2026-10-07 21:24:44 UTC 4,925 bytes, 186 lines download raw bytes

1/*! ===================================
2 *  Author: Roman Nazarkin, Egor Dankov
3 *  -----------------------------------
4 *  PuzzleThemes
5 *  =================================== */
6
7
8/***********************************************
9 * Custom sliders
10 ***********************************************/
11(function ($) {
12    'use strict';
13
14    $('.sp-custom-slick').slick();
15
16})(jQuery);
17
18
19/***********************************************
20 * Testimonials Slider
21 ***********************************************/
22(function ($) {
23    'use strict';
24
25    $('.sp-slick-testimonials').slick({
26        dots          : true,
27        infinite      : true,
28        speed         : 750,
29        slidesToShow  : 1,
30        adaptiveHeight: true,
31        autoplay      : true,
32        arrows        : false,
33        autoplaySpeed : 6500
34    });
35
36})(jQuery);
37
38
39/***********************************************
40 * Related Posts Slider
41 ***********************************************/
42(function ($) {
43    'use strict';
44
45    $('.sp-slick-related').each(function () {
46        var $this = $(this);
47
48        // do not run slider if there is less than 2 posts
49        if ($this.find('.item').length <= 2) {
50            return;
51        }
52
53        // init slider
54        $this.slick({
55            dots          : true,
56            infinite      : true,
57            speed         : 750,
58            slidesToShow  : 2,
59            slidesToScroll: 2,
60            adaptiveHeight: true,
61            autoplay      : true,
62            arrows        : false,
63            autoplaySpeed : 6500,
64
65            responsive: [
66                {
67                    breakpoint: 992,
68                    settings: {
69                        slidesToShow  : 1,
70                        slidesToScroll: 1
71                    }
72                }
73            ]
74        });
75    });
76
77})(jQuery);
78
79
80/***********************************************
81 * Single Post Gallery
82 ***********************************************/
83(function ($) {
84    'use strict';
85
86    $('.sp-slick-post-gallery').slick({
87        dots          : false,
88        infinite      : true,
89        speed         : 750,
90        slidesToShow  : 1,
91        adaptiveHeight: true,
92        autoplay      : true,
93        autoplaySpeed : 5000,
94        nextArrow     : '<div class="slick-next circle"><i class="icon-angle-right"></i></div>',
95        prevArrow     : '<div class="slick-prev circle"><i class="icon-angle-left"></i></div>',
96    });
97
98})(jQuery);
99
100
101/***************************************************
102 * Add slick-animated class when transition is over
103 ***************************************************/
104(function ($) {
105    'use strict';
106
107    var $sliders = $('.slick-initialized');
108
109    $sliders.on('initialAnimate reInit afterChange', function (e, slick, currentSlide) {
110        currentSlide = currentSlide || 0;
111        slick = slick || $(this).slick('getSlick');
112
113        $(slick.$slides).removeClass('slick-animated');
114        $(slick.$slides[currentSlide]).addClass('slick-animated');
115    });
116
117    $sliders.trigger('initialAnimate');
118
119})(jQuery);
120
121
122/***************************************************
123 * Stop sliders that is not currently in viewport
124 ***************************************************/
125(function ($) {
126    'use strict';
127
128    var $sliders = $('.slick-initialized');
129
130    PZTJS.scrollRAF($.throttle(250, function () {
131        $sliders.each(function () {
132            var $this = $(this),
133                $slick = $this.slick('getSlick');
134
135            // don't touch sliders without autoplay
136            if ($slick.options.autoplay !== true) {
137                return;
138            }
139
140            // stop slider
141            if (!PZTJS.isElementInViewport(this) && !$slick.paused) {
142                $this.slick('pause');
143                console.log($this, 'paused');
144            }
145
146            // unpause slider
147            if (PZTJS.isElementInViewport(this) && $slick.paused) {
148                $this.slick('play');
149                console.log($this, 'un-paused');
150            }
151        });
152    }));
153
154})(jQuery);
155
156
157/***************************************************
158 * Integrate WOW.js with slick
159 ***************************************************/
160(function($) {
161    'use strict';
162
163    $('.slick-initialized').on('beforeChange', function(e, slick, currentSlide, nextSlide) {
164        $(slick.$slides[nextSlide]).find('.wow, .re-animate').each(function () {
165            var el = $(this),
166                newone = el.clone(true).removeClass('animated');
167
168            el.before(newone);
169            el.remove();
170        });
171    });
172
173})(jQuery);
174
175
176/***************************************************
177 * Recalculate slider layout after each image loaded
178 ***************************************************/
179(function($) {
180    'use strict';
181
182    $('.slick-initialized img').on('load', function() {
183        $(this).closest('.slick-initialized').slick('setPosition');
184    });
185
186})(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.