PageSourceSearch

https://www.hotelslitteraires.fr/res/js/template/slider/gallery-images/ui.js?q=1790690343616

js hotelslitteraires.fr collected 2026-10-02 04:44:46 UTC 1,953 bytes, 68 lines download raw bytes

1let gallery = [];
2
3var initSliderGalleryImages = async function() {
4  if (typeof Swiper !== 'function') {
5    await lazy.loadScript('/res/js/swiper/swiper-bundle.min.js');
6    lazy.loadScript('/res/js/swiper/swiper-bundle.css');
7  }
8
9  if (typeof baguetteBox !== 'function') {
10    await lazy.loadScript('/res/js/baguetteBox/baguetteBox.min.js');
11    lazy.loadScript('/res/js/baguetteBox/baguetteBox.min.css');
12  }
13
14  sliderGallery();
15
16  gallery = baguetteBox.run('.baguetteBox', {
17    animation: 'slideIn',
18    noScrollbars: true,
19    buttons: 'auto',
20  });
21};
22
23const sliderGallery = () => {
24  const imgElements = Array.from(document.querySelectorAll('.images-parent'));
25  
26 document.querySelectorAll('.slider-gallery-images').forEach(item => {
27  const parentSlider = item.closest('.slider');
28  const slideCount = item.querySelectorAll('.swiper-slide').length; // ➊
29
30  const swiper = new Swiper(item, {
31    speed: 400,
32    spaceBetween: 20,
33    centeredSlides: false,
34    loop: true,
35    slidesPerView: 'auto',
36    loopedSlides: slideCount,
37    loopAdditionalSlides: 3,
38    loopedSlidesLimit: false,
39    watchSlidesProgress: true,
40
41    navigation: {
42      nextEl: parentSlider.querySelector('.button-next'),
43      prevEl: parentSlider.querySelector('.button-prev'),
44    },
45  });
46});
47
48
49  document.querySelectorAll('.show-gallery-btn').forEach(btn => {
50    btn.addEventListener('click', (e) => {
51      e.preventDefault();
52      const sliderParent = btn.closest('.images-parent');
53      const pIndex = imgElements.indexOf(sliderParent);
54      if (pIndex < 0) return;
55
56      const slides = Array.from(sliderParent.querySelectorAll('.swiper-slide'));
57      const activeSlideIndex = slides.findIndex(slide =>
58        slide.classList.contains('swiper-slide-active')
59      );
60
61      if (activeSlideIndex >= 0) {
62        baguetteBox.show(activeSlideIndex, gallery[pIndex]);
63      } else {
64        baguetteBox.show(0, gallery[pIndex]);
65      }
66    });
67  });
68};

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.