PageSourceSearch

https://www.polnykesov.eu/skins/polnykesov.eu_lego3/js/swiperInit.js?v=v6.5.0

js polnykesov.eu collected 2026-10-03 01:49:01 UTC 11,289 bytes, 327 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("swiper-button--d-none");
5    jQuery(".swiper-button-prev1").removeClass("swiper-button--d-none");
6    let legoSwiper1 = new Swiper(
7      ".js-swiper-container1",
8      Object.assign(
9        {
10          autoplay: {
11            delay: 6000,
12            disableOnInteraction: false,
13          },
14          // autoplay: false,
15          effect: "fade", // slide, fade, cube, coverflow, flip
16          navigation: {
17            nextEl: ".swiper-button-next1",
18            prevEl: ".swiper-button-prev1",
19          },
20          a11y: {
21            enabled: true,
22            prevSlideMessage: currentTranslation.prev,
23            nextSlideMessage: currentTranslation.next,
24            firstSlideMessage: currentTranslation.first,
25            lastSlideMessage: currentTranslation.last,
26          },
27          simulateTouch: false,
28          pagination: {
29            el: ".swiper-pagination",
30            dynamicBullets: false,
31            clickable: true,
32          },
33          keyboard: {
34            enabled: true,
35            onlyInViewport: true,
36          },
37          preloadImages: false,
38          scrollbar: {
39            el: ".swiper-scrollbar",
40            hide: true,
41          },
42          slidesPerView: 1,
43          speed: 1500,
44        },
45        swiperOptions1
46      )
47    );
48
49    // Pozastavování swiperu
50    let isSwiperRunning = false;
51    let isSwiperPausedByButton = false;
52    let isSwiperResumedByButton = false;
53    let isSwiperPausedByMouseenter = false;
54    let isSwiperPausedByReducedMotion = false;
55
56    // Pokud animace běží, zobrazí se tlačítko pro pozastavení
57    if (legoSwiper1.autoplay.running) {
58      isSwiperRunning = true;
59      jQuery(".swiper-button-pause1")
60        .removeClass("swiper-button--d-none")
61        .addClass("icon-pause")
62        .attr("title", currentTranslation.pause)
63        .attr("aria-label", currentTranslation.pause);
64
65      // Zastavení animace pokud má uživatel nastavený reduce motion
66      if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
67        legoSwiper1.autoplay.stop();
68        isSwiperPausedByReducedMotion = true;
69        jQuery(".swiper-button-pause1")
70          .removeClass("icon-pause")
71          .addClass("icon-play")
72          .attr("title", currentTranslation.play)
73          .attr("aria-label", currentTranslation.play);
74      }
75    } else {
76      jQuery(".swiper-button-pause1")
77        .removeClass("swiper-button--d-none")
78        .addClass("icon-play")
79        .attr("title", currentTranslation.play)
80        .attr("aria-label", currentTranslation.play);
81    }
82
83    // Zastavení animace při najetí myši
84    jQuery(".js-swiper-container1").mouseenter(function () {
85      if (
86        legoSwiper1.autoplay.running &&
87        !isSwiperPausedByReducedMotion &&
88        !isSwiperResumedByButton
89      ) {
90        legoSwiper1.autoplay.stop();
91        isSwiperPausedByMouseenter = true;
92        jQuery(".swiper-button-pause1").addClass("swiper-paused");
93      }
94    });
95    jQuery(".js-swiper-container1").mouseleave(function () {
96      if (
97        !legoSwiper1.autoplay.running &&
98        !isSwiperPausedByButton &&
99        !isSwiperPausedByReducedMotion &&
100        !isSwiperResumedByButton
101      ) {
102        legoSwiper1.autoplay.start();
103        isSwiperPausedByMouseenter = false;
104        jQuery(".swiper-button-pause1").removeClass("swiper-paused");
105      } else if (isSwiperResumedByButton) {
106        isSwiperResumedByButton = false;
107      }
108    });
109
110    // Pozastavení animace po stisknutí tlačítka
111    jQuery(".swiper-button-pause1").on("click keydown", function (e) {
112      if (!legoSwiper1.isLocked) {
113        if (e.type === "click" || e.key === "Enter") {
114          if (legoSwiper1.autoplay.running || isSwiperPausedByMouseenter) {
115            legoSwiper1.autoplay.stop();
116            isSwiperPausedByButton = true;
117            isSwiperPausedByMouseenter = false;
118            jQuery(this)
119              .removeClass("icon-pause")
120              .addClass("icon-play")
121              .attr("title", currentTranslation.play)
122              .attr("aria-label", currentTranslation.play);
123            jQuery(".swiper-button-pause1").removeClass("swiper-paused");
124          } else if (!isSwiperPausedByMouseenter) {
125            legoSwiper1.autoplay.start();
126            isSwiperPausedByButton = false;
127            isSwiperResumedByButton = true;
128            jQuery(this)
129              .removeClass("icon-play")
130              .addClass("icon-pause")
131              .attr("title", currentTranslation.pause)
132              .attr("aria-label", currentTranslation.pause);
133            jQuery(".swiper-button-pause1").removeClass("swiper-paused");
134          }
135        }
136      }
137    });
138
139    // Zablokování tlačítka pro spuštění / pozastavení animace
140    function disablePlayButton1() {
141      if (legoSwiper1.isLocked) {
142        jQuery(".swiper-button-pause1")
143          .attr("aria-disabled", "true")
144          .attr("disabled", "true")
145          .attr("tabindex", "-1")
146          .addClass("swiper-button-disabled swiper-button-lock");
147      } else {
148        jQuery(".swiper-button-pause1")
149          .removeAttr("aria-disabled")
150          .removeAttr("disabled")
151          .attr("tabindex", "0")
152          .removeClass("swiper-button-disabled swiper-button-lock");
153      }
154    }
155
156    // Úprava play/pause buttonu při resize
157    legoSwiper1.on("resize", function () {
158      disablePlayButton1();
159    });
160
161    disablePlayButton1();
162  }
163});
164
165// Swiper 1-2
166jQuery(document).ready(function () {
167  if (jQuery(".js-swiper-container1-2 .swiper-slide").length > 1) {
168    jQuery(".swiper-button-next1-2").removeClass("swiper-button--d-none");
169    jQuery(".swiper-button-prev1-2").removeClass("swiper-button--d-none");
170    let legoSwiper1 = new Swiper(
171      ".js-swiper-container1-2",
172      Object.assign(
173        {
174          autoplay: {
175            delay: 6000,
176            disableOnInteraction: false,
177          },
178          // autoplay: false,
179          effect: "fade", // slide, fade, cube, coverflow, flip
180          navigation: {
181            nextEl: ".swiper-button-next1-2",
182            prevEl: ".swiper-button-prev1-2",
183          },
184          a11y: {
185            enabled: true,
186            prevSlideMessage: currentTranslation.prev,
187            nextSlideMessage: currentTranslation.next,
188            firstSlideMessage: currentTranslation.first,
189            lastSlideMessage: currentTranslation.last,
190          },
191          simulateTouch: false,
192          pagination: {
193            el: ".swiper-pagination",
194            dynamicBullets: false,
195            clickable: true,
196          },
197          keyboard: {
198            enabled: true,
199            onlyInViewport: true,
200          },
201          preloadImages: false,
202          scrollbar: {
203            el: ".swiper-scrollbar",
204            hide: true,
205          },
206          slidesPerView: 1,
207          speed: 1500,
208        },
209        swiperOptions1
210      )
211    );
212
213    // Pozastavování swiperu
214    let isSwiperRunning = false;
215    let isSwiperPausedByButton = false;
216    let isSwiperResumedByButton = false;
217    let isSwiperPausedByMouseenter = false;
218    let isSwiperPausedByReducedMotion = false;
219
220    // Pokud animace běží, zobrazí se tlačítko pro pozastavení
221    if (legoSwiper1.autoplay.running) {
222      isSwiperRunning = true;
223      jQuery(".swiper-button-pause1-2")
224        .removeClass("swiper-button--d-none")
225        .addClass("icon-pause")
226        .attr("title", currentTranslation.pause)
227        .attr("aria-label", currentTranslation.pause);
228
229      // Zastavení animace pokud má uživatel nastavený reduce motion
230      if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
231        legoSwiper1.autoplay.stop();
232        isSwiperPausedByReducedMotion = true;
233        jQuery(".swiper-button-pause1-2")
234          .removeClass("icon-pause")
235          .addClass("icon-play")
236          .attr("title", currentTranslation.play)
237          .attr("aria-label", currentTranslation.play);
238      }
239    } else {
240      jQuery(".swiper-button-pause1-2")
241        .removeClass("swiper-button--d-none")
242        .addClass("icon-play")
243        .attr("title", currentTranslation.play)
244        .attr("aria-label", currentTranslation.play);
245    }
246
247    // Zastavení animace při najetí myši
248    jQuery(".js-swiper-container1-2").mouseenter(function () {
249      if (
250        legoSwiper1.autoplay.running &&
251        !isSwiperPausedByReducedMotion &&
252        !isSwiperResumedByButton
253      ) {
254        legoSwiper1.autoplay.stop();
255        isSwiperPausedByMouseenter = true;
256        jQuery(".swiper-button-pause1-2").addClass("swiper-paused");
257      }
258    });
259    jQuery(".js-swiper-container1-2").mouseleave(function () {
260      if (
261        !legoSwiper1.autoplay.running &&
262        !isSwiperPausedByButton &&
263        !isSwiperPausedByReducedMotion &&
264        !isSwiperResumedByButton
265      ) {
266        legoSwiper1.autoplay.start();
267        isSwiperPausedByMouseenter = false;
268        jQuery(".swiper-button-pause1-2").removeClass("swiper-paused");
269      } else if (isSwiperResumedByButton) {
270        isSwiperResumedByButton = false;
271      }
272    });
273
274    // Pozastavení animace po stisknutí tlačítka
275    jQuery(".swiper-button-pause1-2").on("click keydown", function (e) {
276      if (!legoSwiper1.isLocked) {
277        if (e.type === "click" || e.key === "Enter") {
278          if (legoSwiper1.autoplay.running || isSwiperPausedByMouseenter) {
279            legoSwiper1.autoplay.stop();
280            isSwiperPausedByButton = true;
281            isSwiperPausedByMouseenter = false;
282            jQuery(this)
283              .removeClass("icon-pause")
284              .addClass("icon-play")
285              .attr("title", currentTranslation.play)
286              .attr("aria-label", currentTranslation.play);
287            jQuery(".swiper-button-pause1-2").removeClass("swiper-paused");
288          } else if (!isSwiperPausedByMouseenter) {
289            legoSwiper1.autoplay.start();
290            isSwiperPausedByButton = false;
291            isSwiperResumedByButton = true;
292            jQuery(this)
293              .removeClass("icon-play")
294              .addClass("icon-pause")
295              .attr("title", currentTranslation.pause)
296              .attr("aria-label", currentTranslation.pause);
297            jQuery(".swiper-button-pause1").removeClass("swiper-paused");
298          }
299        }
300      }
301    });
302
303    // Zablokování tlačítka pro spuštění / pozastavení animace
304    function disablePlayButton1() {
305      if (legoSwiper1.isLocked) {
306        jQuery(".swiper-button-pause1-2")
307          .attr("aria-disabled", "true")
308          .attr("disabled", "true")
309          .attr("tabindex", "-1")
310          .addClass("swiper-button-disabled swiper-button-lock");
311      } else {
312        jQuery(".swiper-button-pause1-2")
313          .removeAttr("aria-disabled")
314          .removeAttr("disabled")
315          .attr("tabindex", "0")
316          .removeClass("swiper-button-disabled swiper-button-lock");
317      }
318    }
319
320    // Úprava play/pause buttonu při resize
321    legoSwiper1.on("resize", function () {
322      disablePlayButton1();
323    });
324
325    disablePlayButton1();
326  }
327});

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.