PageSourceSearch

https://www.srbec.cz/skins/srbec.cz_lego3/js/swiperInit.js?v=v6.5.0b

js srbec.cz collected 2026-10-03 01:17:12 UTC 10,701 bytes, 329 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 5
166jQuery(document).ready(function() {
167  let legoSwiper5 = new Swiper(".js-swiper-container5", {
168    autoplay: {
169      delay: 6000,
170      disableOnInteraction: false,
171    },
172    navigation: {
173      nextEl: ".swiper-button-next5",
174      prevEl: ".swiper-button-prev5",
175    },
176    a11y: {
177      enabled: true,
178      prevSlideMessage: currentTranslation.prev,
179      nextSlideMessage: currentTranslation.next,
180      firstSlideMessage: currentTranslation.first,
181      lastSlideMessage: currentTranslation.last,
182    },
183    keyboard: {
184      enabled: true,
185      onlyInViewport: true,
186    },
187    simulateTouch: false,
188    paginationClickable: true,
189    slidesPerGroup: 1,
190    speed: 1500,
191    breakpointsInverse: true,
192    breakpoints: {
193      320: {
194        slidesPerView: 1,
195        spaceBetween: 0,
196      },
197      620: {
198        slidesPerView: 2,
199        spaceBetween: 10,
200      },
201      992: {
202        slidesPerView: 3,
203        spaceBetween: 10,
204      },
205      1200: {
206        slidesPerView: 4,
207        spaceBetween: 20,
208      },
209      1440: {
210        slidesPerView: 5,
211        spaceBetween: 60,
212      },
213    },
214  });
215
216  // Pozastavování swiperu
217  let isSwiperRunning = false;
218  let isSwiperPausedByButton = false;
219  let isSwiperResumedByButton = false;
220  let isSwiperPausedByMouseenter = false;
221  let isSwiperPausedByReducedMotion = false;
222
223  // Pokud animace běží, zobrazí se tlačítko pro pozastavení
224  if (legoSwiper5.autoplay.running) {
225    isSwiperRunning = true;
226    jQuery(".swiper-button-pause5")
227      .removeClass("swiper-button--d-none")
228      .addClass("icon-pause")
229      .attr("title", currentTranslation.pause)
230      .attr("aria-label", currentTranslation.pause);
231
232    // Zastavení animace pokud má uživatel nastavený reduce motion
233    if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
234      legoSwiper5.autoplay.stop();
235      isSwiperPausedByReducedMotion = true;
236      jQuery(".swiper-button-pause5")
237        .removeClass("icon-pause")
238        .addClass("icon-play")
239        .attr("title", currentTranslation.play)
240        .attr("aria-label", currentTranslation.play);
241    }
242  } else {
243    jQuery(".swiper-button-pause5")
244      .removeClass("swiper-button--d-none")
245      .addClass("icon-play")
246      .attr("title", currentTranslation.play)
247      .attr("aria-label", currentTranslation.play);
248  }
249
250  // Úprava play/pause buttonu při resize
251  legoSwiper5.on("resize", function () {
252    disablePlayButton5();
253  });
254
255  disablePlayButton5();
256
257  // Zablokování tlačítka pro spuštění / pozastavení animace
258  function disablePlayButton5() {
259    if (legoSwiper5.isLocked) {
260      jQuery(".swiper-button-pause5")
261        .attr("aria-disabled", "true")
262        .attr("disabled", "true")
263        .attr("tabindex", "-1")
264        .addClass("swiper-button-disabled swiper-button-lock");
265    } else {
266      jQuery(".swiper-button-pause5")
267        .removeAttr("aria-disabled")
268        .removeAttr("disabled")
269        .attr("tabindex", "0")
270        .removeClass("swiper-button-disabled swiper-button-lock");
271    }
272  }
273
274  // Zastavení animace při najetí myši
275  jQuery(".js-swiper-container5").mouseenter(function() {
276    if (
277      legoSwiper5.autoplay.running &&
278      !isSwiperPausedByReducedMotion &&
279      !isSwiperResumedByButton
280    ) {
281      legoSwiper5.autoplay.stop();
282      isSwiperPausedByMouseenter = true;
283      jQuery(".swiper-button-pause5").addClass("swiper-paused");
284    }
285  });
286  jQuery(".js-swiper-container5").mouseleave(function() {
287    if (
288      !legoSwiper5.autoplay.running &&
289      !isSwiperPausedByButton &&
290      !isSwiperPausedByReducedMotion &&
291      !isSwiperResumedByButton
292    ) {
293      legoSwiper5.autoplay.start();
294      isSwiperPausedByMouseenter = false;
295      jQuery(".swiper-button-pause5").removeClass("swiper-paused");
296    } else if (isSwiperResumedByButton) {
297      isSwiperResumedByButton = false;
298    }
299  });
300
301  // Pozastavení animace po stisknutí tlačítka
302  jQuery(".swiper-button-pause5").on("click keydown", function(e) {
303    if (!legoSwiper5.isLocked) {
304      if (e.type === "click" || e.key === "Enter") {
305        if (legoSwiper5.autoplay.running || isSwiperPausedByMouseenter) {
306          legoSwiper5.autoplay.stop();
307          isSwiperPausedByButton = true;
308          isSwiperPausedByMouseenter = false;
309          jQuery(this)
310            .removeClass("icon-pause")
311            .addClass("icon-play")
312            .attr("title", currentTranslation.play)
313            .attr("aria-label", currentTranslation.play);
314          jQuery(".swiper-button-pause5").removeClass("swiper-paused");
315        } else if (!isSwiperPausedByMouseenter) {
316          legoSwiper5.autoplay.start();
317          isSwiperPausedByButton = false;
318          isSwiperResumedByButton = true;
319          jQuery(this)
320            .removeClass("icon-play")
321            .addClass("icon-pause")
322            .attr("title", currentTranslation.pause)
323            .attr("aria-label", currentTranslation.pause);
324          jQuery(".swiper-button-pause5").removeClass("swiper-paused");
325        }
326      }
327    }
328  });
329});

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.