PageSourceSearch

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

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

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.