PageSourceSearch

https://www.cervenykostelec.cz/skins/cervenykostelec.cz_lego2/js/swiperInit.js?v=v6.5.0b

js cervenykostelec.cz collected 2026-10-02 18:32:14 UTC 8,199 bytes, 198 lines download raw bytes

1// Swiper 1
2jQuery(document).ready(function () {
3    if (jQuery('.js-swiper-container1 .swiper-slide').length > 1) {
4        jQuery('.swiper-button-next1').removeClass('d-none');
5        jQuery('.swiper-button-prev1').removeClass('d-none');
6        let legoSwiper1 = new Swiper('.js-swiper-container1',
7            Object.assign({
8                autoplay: {
9                  delay: 6000,
10                  disableOnInteraction: false
11                },
12                effect: 'fade', // slide, fade, cube, coverflow, flip
13                loop: true,
14                navigation: {
15                    nextEl: '.swiper-button-next1',
16                    prevEl: '.swiper-button-prev1',
17                },
18                a11y: {
19                    prevSlideMessage: currentTranslation.prev,
20                    nextSlideMessage: currentTranslation.next,
21                },
22                simulateTouch: false,
23                pagination: {
24                    el: '.swiper-pagination',
25                    dynamicBullets: true,
26                },
27                preloadImages: false,
28                scrollbar: {
29                    el: '.swiper-scrollbar',
30                    hide: true,
31                },
32                slidesPerView: 1,
33                speed: 1500,
34                },
35                swiperOptions1
36            )
37        )
38
39        // Pozastavování swiperu
40        let isSwiperRunning = false;
41        let isSwiperPausedByButton = false;
42        let isSwiperResumedByButton = false;
43        let isSwiperPausedByMouseenter = false;
44        let isSwiperPausedByReducedMotion = false;
45
46        // Pokud animace běží, zobrazí se tlačítko pro pozastavení
47        if (legoSwiper1.autoplay.running) {
48            isSwiperRunning = true;
49            jQuery('.swiper-button-pause1').removeClass('d-none').addClass('icon-pause').attr('title', currentTranslation.pause).attr('aria-label', currentTranslation.pause);
50
51          // Zastavení animace pokud má uživatel nastavený reduce motion
52          if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
53            legoSwiper1.autoplay.stop();
54            isSwiperPausedByReducedMotion = true;
55            jQuery('.swiper-button-pause1').removeClass('icon-pause').addClass('icon-play').attr('title', currentTranslation.play).attr('aria-label', currentTranslation.play);
56          }  
57        }; 
58        
59        // Zastavení animace při najetí myši
60        jQuery(".js-swiper-container1").mouseenter(function() {
61          if (legoSwiper1.autoplay.running && !isSwiperPausedByReducedMotion && !isSwiperResumedByButton) { 
62            legoSwiper1.autoplay.stop();
63            isSwiperPausedByMouseenter = true;
64            jQuery('.swiper-button-pause1').addClass('swiper-paused');
65          }
66        }); 
67        jQuery(".js-swiper-container1").mouseleave(function() {
68          if (!legoSwiper1.autoplay.running && !isSwiperPausedByButton && !isSwiperPausedByReducedMotion && !isSwiperResumedByButton) {
69            legoSwiper1.autoplay.start();
70            isSwiperPausedByMouseenter = false;
71            jQuery('.swiper-button-pause1').removeClass('swiper-paused')
72          } else if (isSwiperResumedByButton) {
73            isSwiperResumedByButton = false;
74          }
75        });
76        
77        // Pozastavení animace po stisknutí tlačítka
78        jQuery('.swiper-button-pause1').on('click keydown', function (e) {
79            if (e.type === 'click' || e.key === 'Enter') {
80                if (legoSwiper1.autoplay.running || isSwiperPausedByMouseenter) {
81                    legoSwiper1.autoplay.stop();
82                    isSwiperPausedByButton = true;
83                    isSwiperPausedByMouseenter = false;
84                    jQuery(this).removeClass('icon-pause').addClass('icon-play').attr('title', currentTranslation.play).attr('aria-label', currentTranslation.play);
85                    jQuery('.swiper-button-pause1').removeClass('swiper-paused');
86                } else if (!isSwiperPausedByMouseenter) {
87                    legoSwiper1.autoplay.start();
88                    isSwiperPausedByButton = false;
89                    isSwiperResumedByButton = true;
90                    jQuery(this).removeClass('icon-play').addClass('icon-pause').attr('title', currentTranslation.pause).attr('aria-label', currentTranslation.pause);
91                    jQuery('.swiper-button-pause1').removeClass('swiper-paused')
92                }
93            }
94        });
95    }
96});
97
98// Swiper 5
99
100jQuery(document).ready(function() {
101  let legoSwiper5 = new Swiper(".js-swiper-container5", {
102    autoplay: {
103      delay: 6000,
104      disableOnInteraction: false
105    },
106    loop: true,
107    loopFillGroupWithBlank: true,
108    navigation: {
109      nextEl: ".swiper-button-next5",
110      prevEl: ".swiper-button-prev5",
111    },
112    a11y: {
113      prevSlideMessage: currentTranslation.prev,
114      nextSlideMessage: currentTranslation.next,
115    },
116    simulateTouch: false,
117    paginationClickable: true,
118    slidesPerGroup: 1,
119    speed: 1500,
120    breakpointsInverse: true,
121    breakpoints: {
122      320: {
123        slidesPerView: 1,
124        spaceBetween: 0,
125      },
126      620: {
127        slidesPerView: 2,
128        spaceBetween: 10,
129      },
130      992: {
131        slidesPerView: 3,
132        spaceBetween: 10,
133      },
134      1200: {
135        slidesPerView: 3,
136        spaceBetween: 30,
137      }
138    },
139  });
140
141  // Pozastavování swiperu
142  let isSwiperRunning = false;
143  let isSwiperPausedByButton = false;
144  let isSwiperResumedByButton = false;
145  let isSwiperPausedByMouseenter = false;
146  let isSwiperPausedByReducedMotion = false;
147
148  // Pokud animace běží, zobrazí se tlačítko pro pozastavení 
149  if (legoSwiper5.autoplay.running) {
150      isSwiperRunning = true;
151      jQuery('.swiper-button-pause5').removeClass('d-none').addClass('icon-pause').attr('title', currentTranslation.pause).attr('aria-label', currentTranslation.pause);
152
153    // Zastavení animace pokud má uživatel nastavený reduce motion
154    if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
155      legoSwiper5.autoplay.stop();
156      isSwiperPausedByReducedMotion = true;
157      jQuery('.swiper-button-pause5').removeClass('icon-pause').addClass('icon-play').attr('title', currentTranslation.play).attr('aria-label', currentTranslation.play);
158    }  
159  }; 
160  
161  // Zastavení animace při najetí myši
162  jQuery(".js-swiper-container5").mouseenter(function() {
163    if (legoSwiper5.autoplay.running && !isSwiperPausedByReducedMotion && !isSwiperResumedByButton) { 
164      legoSwiper5.autoplay.stop();
165      isSwiperPausedByMouseenter = true;
166      jQuery('.swiper-button-pause5').addClass('swiper-paused');
167    }
168  }); 
169  jQuery(".js-swiper-container5").mouseleave(function() {
170    if (!legoSwiper5.autoplay.running && !isSwiperPausedByButton && !isSwiperPausedByReducedMotion && !isSwiperResumedByButton) {
171      legoSwiper5.autoplay.start();
172      isSwiperPausedByMouseenter = false;
173      jQuery('.swiper-button-pause5').removeClass('swiper-paused')
174    } else if (isSwiperResumedByButton) {
175      isSwiperResumedByButton = false;
176    }
177  });
178  
179  // Pozastavení animace po stisknutí tlačítka
180  jQuery('.swiper-button-pause5').on('click keydown', function (e) {
181      if (e.type === 'click' || e.key === 'Enter') {
182          if (legoSwiper5.autoplay.running || isSwiperPausedByMouseenter) {
183              legoSwiper5.autoplay.stop();
184              isSwiperPausedByButton = true;
185              isSwiperPausedByMouseenter = false;
186              jQuery(this).removeClass('icon-pause').addClass('icon-play').attr('title', currentTranslation.play).attr('aria-label', currentTranslation.play);
187              jQuery('.swiper-button-pause5').removeClass('swiper-paused');
188          } else if (!isSwiperPausedByMouseenter) {
189              legoSwiper5.autoplay.start();
190              isSwiperPausedByButton = false;
191              isSwiperResumedByButton = true;
192              jQuery(this).removeClass('icon-play').addClass('icon-pause').attr('title', currentTranslation.pause).attr('aria-label', currentTranslation.pause);
193              jQuery('.swiper-button-pause5').removeClass('swiper-paused')
194          }
195      }
196  });
197}); 
198

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.