PageSourceSearch

https://www.obeckrenek.cz/skins/obeckrenek.cz_lego2/js/swiperInit.js?v=v6.5.0a

js obeckrenek.cz collected 2026-10-02 20:13:21 UTC 8,299 bytes, 202 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: 4,
136      //   spaceBetween: 20,
137      // },
138      // 1440: {
139      //   slidesPerView: 5,
140      //   spaceBetween: 60,
141      // },
142    },
143  });
144
145  // Pozastavování swiperu
146  let isSwiperRunning = false;
147  let isSwiperPausedByButton = false;
148  let isSwiperResumedByButton = false;
149  let isSwiperPausedByMouseenter = false;
150  let isSwiperPausedByReducedMotion = false;
151
152  // Pokud animace běží, zobrazí se tlačítko pro pozastavení 
153  if (legoSwiper5.autoplay.running) {
154      isSwiperRunning = true;
155      jQuery('.swiper-button-pause5').removeClass('d-none').addClass('icon-pause').attr('title', currentTranslation.pause).attr('aria-label', currentTranslation.pause);
156
157    // Zastavení animace pokud má uživatel nastavený reduce motion
158    if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
159      legoSwiper5.autoplay.stop();
160      isSwiperPausedByReducedMotion = true;
161      jQuery('.swiper-button-pause5').removeClass('icon-pause').addClass('icon-play').attr('title', currentTranslation.play).attr('aria-label', currentTranslation.play);
162    }  
163  }; 
164  
165  // Zastavení animace při najetí myši
166  jQuery(".js-swiper-container5").mouseenter(function() {
167    if (legoSwiper5.autoplay.running && !isSwiperPausedByReducedMotion && !isSwiperResumedByButton) { 
168      legoSwiper5.autoplay.stop();
169      isSwiperPausedByMouseenter = true;
170      jQuery('.swiper-button-pause5').addClass('swiper-paused');
171    }
172  }); 
173  jQuery(".js-swiper-container5").mouseleave(function() {
174    if (!legoSwiper5.autoplay.running && !isSwiperPausedByButton && !isSwiperPausedByReducedMotion && !isSwiperResumedByButton) {
175      legoSwiper5.autoplay.start();
176      isSwiperPausedByMouseenter = false;
177      jQuery('.swiper-button-pause5').removeClass('swiper-paused')
178    } else if (isSwiperResumedByButton) {
179      isSwiperResumedByButton = false;
180    }
181  });
182  
183  // Pozastavení animace po stisknutí tlačítka
184  jQuery('.swiper-button-pause5').on('click keydown', function (e) {
185      if (e.type === 'click' || e.key === 'Enter') {
186          if (legoSwiper5.autoplay.running || isSwiperPausedByMouseenter) {
187              legoSwiper5.autoplay.stop();
188              isSwiperPausedByButton = true;
189              isSwiperPausedByMouseenter = false;
190              jQuery(this).removeClass('icon-pause').addClass('icon-play').attr('title', currentTranslation.play).attr('aria-label', currentTranslation.play);
191              jQuery('.swiper-button-pause5').removeClass('swiper-paused');
192          } else if (!isSwiperPausedByMouseenter) {
193              legoSwiper5.autoplay.start();
194              isSwiperPausedByButton = false;
195              isSwiperResumedByButton = true;
196              jQuery(this).removeClass('icon-play').addClass('icon-pause').attr('title', currentTranslation.pause).attr('aria-label', currentTranslation.pause);
197              jQuery('.swiper-button-pause5').removeClass('swiper-paused')
198          }
199      }
200  });
201}); 
202

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.