PageSourceSearch

https://www.giardino-marling.com/media/templates/site/giardino/js/spring-slider.js?b23f8e

js giardino-marling.com collected 2026-10-04 20:16:45 UTC 2,624 bytes, 90 lines download raw bytes

1// eslint-disable-next-line
2
3function createSpringSlider(el, extendParams = {}) {
4  // main swiper el
5  const swiperEl = el.querySelector('.mod-list');
6
7  let previousProgress = 0;
8  let isTouched = false;
9
10  const resetDelay = (swiper) => {
11    swiper.slides.forEach((slideEl) => {
12      slideEl.style.transitionDelay = '0ms';
13    });
14  };
15
16  // init main swiper
17  const swiper = new Swiper(swiperEl, {
18    effect: 'creative',
19    speed: 720,
20    followFinger: false,
21    ...extendParams,
22    
23    creativeEffect: {
24      limitProgress: 100,
25      prev: {
26        translate: ['-100%', 0, 0],
27      },
28      next: {
29        translate: ['100%', 0, 0],
30      },
31    },
32    on: {
33      ...(extendParams.on || {}),
34      touchStart(...args) {
35        isTouched = true;
36        if (extendParams.on && extendParams.on.touchStart) {
37          extendParams.on.touchStart(...args);
38        }
39      },
40      touchEnd(...args) {
41        isTouched = false;
42        if (extendParams.on && extendParams.on.touchStart) {
43          extendParams.on.touchEnd(...args);
44        }
45      },
46      // eslint-disable-next-line
47      progress(swiper, progress) {
48        if (isTouched) return;
49        if (extendParams.on && extendParams.on.progress) {
50          extendParams.on.progress(swiper, progress);
51        }
52        const direction = swiper.progress > previousProgress ? 'next' : 'prev';
53        previousProgress = swiper.progress;
54        const delay = swiper.params.speed / 16;
55        const visibleIndexes = swiper.visibleSlidesIndexes;
56        const firstIndex = visibleIndexes[0];
57        const lastIndex = visibleIndexes[visibleIndexes.length - 1];
58        const setDelay = (slideEl, slideIndex) => {
59          if (direction === 'next' && slideIndex >= firstIndex) {
60            slideEl.style.transitionDelay = `${
61              (slideIndex - firstIndex + 1) * delay
62            }ms`;
63          } else if (direction === 'prev' && slideIndex <= lastIndex + 1) {
64            slideEl.style.transitionDelay = `${
65              (lastIndex - slideIndex + 1) * delay
66            }ms`;
67          } else {
68            slideEl.style.transitionDelay = `${0}ms`;
69          }
70        };
71        swiper.slides.forEach((slideEl, slideIndex) => {
72          if (swiper.animating) {
73            slideEl.style.transitionDelay = '0ms';
74            requestAnimationFrame(() => {
75              setDelay(slideEl, slideIndex);
76            });
77          } else {
78            setDelay(slideEl, slideIndex);
79          }
80        });
81      },
82    },
83  });
84
85  swiper.on('transitionEnd resize touchStart', () => {
86    resetDelay(swiper);
87  });
88
89  return swiper;
90}

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.