PageSourceSearch

https://noaksark.org/wp-content/themes/noaksark/js/testimonial-slides.js?ver=1

js noaksark.org collected 2026-09-26 10:24:56 UTC 2,941 bytes, 94 lines download raw bytes

1document.addEventListener("DOMContentLoaded", function () {
2    const viewportWidth = window.innerWidth;
3
4    const swiper = new Swiper('#testimonial-slider', {
5        grabCursor: true,
6        slidesPerView: 1,
7        loop: false,
8        autoplay: viewportWidth >= 800 ? {
9            delay: 5000,
10            disableOnInteraction: false,
11        } : false,  
12        spaceBetween: 30, 
13        centeredSlides: false,
14        freeMode: false,
15        centerInsufficientSlides: true,
16        pagination: {
17            el: '.swiper-pagination',
18            clickable: false,
19        },
20        breakpoints: {
21            800: {
22                slidesPerView: 'auto',
23                centeredSlides: false,
24                pagination: {
25                    enabled: false, 
26                },
27            },
28            1200: {
29                slidesPerView: 'auto',
30                centeredSlides: false,
31                freeMode: true,
32                freeModeSticky: true,
33                loop: true,
34            },
35        },
36    });
37
38    window.addEventListener('resize', function () {
39        const newViewportWidth = window.innerWidth;
40
41        if (newViewportWidth >= 800) {
42            if (!swiper.autoplay.running) {
43                swiper.autoplay.start();
44            }
45        } else {
46            if (swiper.autoplay.running) {
47                swiper.autoplay.stop();
48            }
49        }
50    });
51
52    const blockSlider = document.querySelector('.testimonial-block-slider');
53    if (blockSlider) {
54        const blockSwiper = new Swiper(blockSlider, {
55            grabCursor: true,
56            slidesPerView: 1,
57            loop: false,
58            autoplay: false,
59            spaceBetween: 30,
60            centeredSlides: false,
61            freeMode: false,
62            centerInsufficientSlides: true,
63            speed: 1500,
64            pagination: {
65                el: '.pagination-block', // <-- use unique pagination
66                clickable: false,
67            },
68            breakpoints: {
69                800: { slidesPerView: 'auto', centeredSlides: false, pagination: { enabled: false } },
70                1200: { slidesPerView: 'auto', centeredSlides: false, freeMode: true, freeModeSticky: true, loop: true },
71            },
72        });
73
74        if (window.innerWidth >= 800) {
75            setTimeout(() => {
76                blockSwiper.params.autoplay = {
77                    delay: 8000, // 8s per slide
78                    disableOnInteraction: false
79                };
80                blockSwiper.autoplay.start();
81            }, 50);
82        }
83
84        window.addEventListener('resize', function () {
85            const newWidth = window.innerWidth;
86            if (newWidth >= 800) {
87                if (!blockSwiper.autoplay.running) blockSwiper.autoplay.start();
88            } else {
89                if (blockSwiper.autoplay.running) blockSwiper.autoplay.stop();
90            }
91        });
92    }
93
94});

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.