الگو:اسلایدر: تفاوت میان نسخه‌ها

صفحه‌ای تازه حاوی «<html> <div class="fgwiki-gallery" id="fgwiki-gallery-1" dir="rtl" aria-label="گالری تصاویر" > <div class="fgwiki-gallery__viewport"> <div class="fgwiki-gallery__track"> <!-- تصویر ۱ --> <figure class="fgwiki-gallery__slide"> <img src="https://dl.faraghaib.ir/m/106/3.jpg" alt="توضیح تصویر شماره ۱" loading="eager" > <figcapt...» ایجاد کرد
 
بدون خلاصۀ ویرایش
 
(۴ نسخهٔ میانیِ ایجادشده توسط همین کاربر نشان داده نشد)
خط ۴: خط ۴:
   id="fgwiki-gallery-1"
   id="fgwiki-gallery-1"
   dir="rtl"
   dir="rtl"
   aria-label="گالری تصاویر"
   aria-label="گالری لوازم جانبی و فروش موبایل"
>
>
   <div class="fgwiki-gallery__viewport">
   <div class="fgwiki-gallery__viewport">
     <div class="fgwiki-gallery__track">
     <div class="fgwiki-gallery__track">


      <!-- تصویر ۱ -->
       <figure class="fgwiki-gallery__slide">
       <figure class="fgwiki-gallery__slide">
         <img
         <img
           src="https://dl.faraghaib.ir/m/106/3.jpg"
           src="https://dl.faraghaib.ir/m/106/3.jpg"
           alt="توضیح تصویر شماره ۱"
           alt="خرید نقد و اقساط موبایل با قیمت مناسب"
           loading="eager"
           loading="eager"
         >
         >
         <figcaption class="fgwiki-gallery__caption">
         <figcaption class="fgwiki-gallery__caption">
           فروش نقد و اقساط موبایل
           خرید نقد و اقساط موبایل با تحویل سریع و شرایط ویژه
         </figcaption>
         </figcaption>
       </figure>
       </figure>


      <!-- تصویر ۲ -->
       <figure class="fgwiki-gallery__slide">
       <figure class="fgwiki-gallery__slide">
         <img
         <img
           src="https://dl.faraghaib.ir/m/106/5.jpg"
           src="https://dl.faraghaib.ir/m/106/5.jpg"
           alt="توضیح تصویر شماره ۲"
           alt="فروش جدیدترین گوشی های پرچمدار با گارانتی"
           loading="lazy"
           loading="lazy"
         >
         >
         <figcaption class="fgwiki-gallery__caption">
         <figcaption class="fgwiki-gallery__caption">
           انواع گوشی های پرچم دار
           جدیدترین گوشی های پرچمدار با گارانتی معتبر و قیمت رقابتی
         </figcaption>
         </figcaption>
       </figure>
       </figure>


      <!-- تصویر ۳ -->
       <figure class="fgwiki-gallery__slide">
       <figure class="fgwiki-gallery__slide">
         <img
         <img
           src="https://dl.faraghaib.ir/m/106/7.jpg"
           src="https://dl.faraghaib.ir/m/106/7.jpg"
           alt="توضیح تصویر شماره ۳"
           alt="خرید انواع هندزفری سیمی و بلوتوثی با کیفیت"
           loading="lazy"
           loading="lazy"
         >
         >
         <figcaption class="fgwiki-gallery__caption">
         <figcaption class="fgwiki-gallery__caption">
           انواع هندز فری
           خرید انواع هندزفری سیمی و بلوتوثی با صدای شفاف و کیفیت بالا
         </figcaption>
         </figcaption>
       </figure>
       </figure>


      <!-- تصویر ۴ -->
       <figure class="fgwiki-gallery__slide">
       <figure class="fgwiki-gallery__slide">
         <img
         <img
           src="https://dl.faraghaib.ir/m/106/8.jpg"
           src="https://dl.faraghaib.ir/m/106/8.jpg"
           alt="توضیح تصویر شماره ۴"
           alt="شارژر و کابل اصلی فست شارژ برای موبایل"
           loading="lazy"
           loading="lazy"
         >
         >
         <figcaption class="fgwiki-gallery__caption">
         <figcaption class="fgwiki-gallery__caption">
           شارژر و کابل
           شارژر و کابل اصلی فست شارژ با دوام بالا و عملکرد مطمئن
         </figcaption>
         </figcaption>
       </figure>
       </figure>


      <!-- تصویر ۵ -->
       <figure class="fgwiki-gallery__slide">
       <figure class="fgwiki-gallery__slide">
         <img
         <img
           src="https://dl.faraghaib.ir/m/106/9.jpg"
           src="https://dl.faraghaib.ir/m/106/9.jpg"
           alt="توضیح تصویر شماره ۵"
           alt="هولدر موبایل باکیفیت برای خودرو و میز کار"
           loading="lazy"
           loading="lazy"
         >
         >
         <figcaption class="fgwiki-gallery__caption">
         <figcaption class="fgwiki-gallery__caption">
           هولدری های باکیفیت
           هولدر موبایل باکیفیت برای خودرو و میز کار با نگهداری مطمئن
         </figcaption>
         </figcaption>
       </figure>
       </figure>


      <!-- تصویر ۶ -->
       <figure class="fgwiki-gallery__slide">
       <figure class="fgwiki-gallery__slide">
         <img
         <img
           src="IMAGE_URL_6"
           src="https://dl.faraghaib.ir/m/106/6.jpg"
           alt="توضیح تصویر شماره ۶"
           alt="گلس باکیفیت و مقاوم برای محافظت از صفحه موبایل"
           loading="lazy"
           loading="lazy"
         >
         >
         <figcaption class="fgwiki-gallery__caption">
         <figcaption class="fgwiki-gallery__caption">
           کپشن یا توضیحات مربوط به تصویر شماره ۶
           گلس باکیفیت و مقاوم برای محافظت بهتر از صفحه نمایش موبایل
         </figcaption>
         </figcaption>
       </figure>
       </figure>
خط ۸۴: خط ۷۸:
   </div>
   </div>


  <!-- دکمه حرکت به راست -->
   <button
   <button
     class="fgwiki-gallery__button fgwiki-gallery__button--right"
     class="fgwiki-gallery__button fgwiki-gallery__button--right"
     type="button"
     type="button"
     aria-label="تصویر قبلی"
     aria-label="نمایش اسلاید بعدی"
   >
   >
     &#10095;
     &#10095;
   </button>
   </button>


  <!-- دکمه حرکت به چپ -->
   <button
   <button
     class="fgwiki-gallery__button fgwiki-gallery__button--left"
     class="fgwiki-gallery__button fgwiki-gallery__button--left"
     type="button"
     type="button"
     aria-label="تصویر بعدی"
     aria-label="نمایش اسلاید قبلی"
   >
   >
     &#10094;
     &#10094;
   </button>
   </button>


  <!-- نشانگرها -->
   <div class="fgwiki-gallery__dots" aria-label="ناوبری گالری"></div>
   <div
    class="fgwiki-gallery__dots"
    aria-label="ناوبری گالری"
  ></div>
</div>
</div>


<style>
<style>
  /* ==============================
    تنظیمات اصلی اسلایدر
  ============================== */
   .fgwiki-gallery,
   .fgwiki-gallery,
   .fgwiki-gallery * {
   .fgwiki-gallery * {
خط ۱۲۱: خط ۱۰۵:
   .fgwiki-gallery {
   .fgwiki-gallery {
     --fg-items: 3;
     --fg-items: 3;
     --fg-gap: 16px;
     --fg-gap: 18px;
     --fg-radius: 14px;
     --fg-radius: 18px;
     --fg-image-height: 220px;
     --fg-image-height: 300px;
    --fg-side-blur: 2px;
    --fg-side-opacity: 0.55;
    --fg-accent: #1473e6;
    --fg-card-bg: #ffffff;
    --fg-image-bg: #f5f7fa;
     --fg-caption-bg: #ffffff;
     --fg-caption-bg: #ffffff;
     --fg-caption-color: #222222;
     --fg-caption-color: #1f2937;
    --fg-accent: #1473e6;


     position: relative;
     position: relative;
     width: min(100%, 1200px);
     width: min(100%, 1240px);
     margin: 24px auto;
     margin: 28px auto;
     padding: 0 48px 36px;
     padding: 0 56px 42px;
     direction: rtl;
     direction: rtl;
     font-family: iransans, Arial, sans-serif;
     font-family: iransans, Arial, sans-serif;
خط ۱۴۹: خط ۱۳۷:
     width: 100%;
     width: 100%;
     transform: translate3d(0, 0, 0);
     transform: translate3d(0, 0, 0);
     transition: transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
     transition: transform 650ms cubic-bezier(0.22, 1, 0.36, 1);
     will-change: transform;
     will-change: transform;
   }
   }
  /* ==============================
    کارت هر تصویر
  ============================== */


   .fgwiki-gallery__slide {
   .fgwiki-gallery__slide {
    position: relative;
     flex: 0 0 calc(
     flex: 0 0 calc(
       (100% - (var(--fg-items) - 1) * var(--fg-gap)) / var(--fg-items)
       (100% - (var(--fg-items) - 1) * var(--fg-gap)) / var(--fg-items)
خط ۱۶۵: خط ۱۴۸:
     margin: 0;
     margin: 0;
     overflow: hidden;
     overflow: hidden;
     background: #ffffff;
     background: var(--fg-card-bg);
     border: 1px solid rgba(0, 0, 0, 0.08);
     border: 1px solid rgba(0, 0, 0, 0.08);
     border-radius: var(--fg-radius);
     border-radius: var(--fg-radius);
     box-shadow: 0 6px 22px rgba(0, 0, 0, 0.09);
     box-shadow: 0 10px 28px rgba(0, 0, 0, 0.10);
    transition:
      transform 450ms ease,
      filter 450ms ease,
      opacity 450ms ease,
      box-shadow 450ms ease;
   }
   }


خط ۱۷۵: خط ۱۶۳:
     width: 100%;
     width: 100%;
     height: var(--fg-image-height);
     height: var(--fg-image-height);
     margin: 0;
     padding: 10px;
     object-fit: cover;
    background: var(--fg-image-bg);
     object-fit: contain;
     object-position: center;
     object-position: center;
     border: 0;
     border: 0;
    transition: transform 400ms ease;
   }
   }
  .fgwiki-gallery__slide:hover img {
    transform: scale(1.04);
  }
  /* ==============================
    کپشن تصاویر
  ============================== */


   .fgwiki-gallery__caption {
   .fgwiki-gallery__caption {
    position: relative;
     min-height: 72px;
    z-index: 2;
     padding: 14px 16px 16px;
     min-height: 56px;
     padding: 14px 16px;
    overflow: hidden;
     color: var(--fg-caption-color);
     color: var(--fg-caption-color);
     background: var(--fg-caption-bg);
     background: var(--fg-caption-bg);
     font-size: 14px;
     font-size: 14px;
     font-weight: 600;
     font-weight: 700;
     line-height: 1.8;
     line-height: 1.9;
     text-align: right;
     text-align: right;
   }
   }


   /* ==============================
   .fgwiki-gallery__slide:not(.is-center) {
    دکمه‌های جهت
    filter: blur(var(--fg-side-blur));
   ============================== */
    opacity: var(--fg-side-opacity);
    transform: scale(0.94);
  }
 
  .fgwiki-gallery__slide.is-center {
    filter: none;
    opacity: 1;
    transform: scale(1.03);
    box-shadow: 0 16px 36px rgba(20, 115, 230, 0.18);
    border-color: rgba(20, 115, 230, 0.18);
   }


   .fgwiki-gallery__button {
   .fgwiki-gallery__button {
     position: absolute;
     position: absolute;
     top: calc(50% - 18px);
     top: calc(50% - 24px);
     z-index: 10;
     z-index: 15;
     display: flex;
     display: flex;
     align-items: center;
     align-items: center;
     justify-content: center;
     justify-content: center;
     width: 42px;
     width: 44px;
     height: 42px;
     height: 44px;
     padding: 0;
     padding: 0;
     color: #ffffff;
     color: #ffffff;
     background: rgba(20, 20, 20, 0.76);
     background: rgba(17, 24, 39, 0.78);
     border: 0;
     border: 0;
     border-radius: 50%;
     border-radius: 50%;
     box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
     box-shadow: 0 6px 18px rgba(0, 0, 0, 0.24);
     font-family: Arial, sans-serif;
     font-family: Arial, sans-serif;
     font-size: 24px;
     font-size: 24px;
خط ۲۳۹: خط ۲۲۶:


   .fgwiki-gallery__button:focus-visible {
   .fgwiki-gallery__button:focus-visible {
     outline: 3px solid rgba(20, 115, 230, 0.35);
     outline: 3px solid rgba(20, 115, 230, 0.30);
     outline-offset: 3px;
     outline-offset: 3px;
   }
   }
خط ۲۵۰: خط ۲۳۷:
     left: 0;
     left: 0;
   }
   }
  /* ==============================
    نقطه‌های پایین اسلایدر
  ============================== */


   .fgwiki-gallery__dots {
   .fgwiki-gallery__dots {
خط ۲۶۷: خط ۲۵۰:


   .fgwiki-gallery__dot {
   .fgwiki-gallery__dot {
     width: 8px;
     width: 9px;
     height: 8px;
     height: 9px;
     padding: 0;
     padding: 0;
     background: #c8c8c8;
     background: #c7ced8;
     border: 0;
     border: 0;
     border-radius: 50%;
     border-radius: 50%;
خط ۲۷۶: خط ۲۵۹:
     transition:
     transition:
       width 250ms ease,
       width 250ms ease,
       background-color 250ms ease;
       background-color 250ms ease,
      opacity 250ms ease;
   }
   }


خط ۲۸۲: خط ۲۶۶:
     width: 24px;
     width: 24px;
     background: var(--fg-accent);
     background: var(--fg-accent);
     border-radius: 10px;
     border-radius: 999px;
   }
   }


خط ۲۸۹: خط ۲۷۳:
     outline-offset: 2px;
     outline-offset: 2px;
   }
   }
  /* ==============================
    نمایش دو تصویر در تبلت
  ============================== */


   @media (max-width: 900px) {
   @media (max-width: 900px) {
     .fgwiki-gallery {
     .fgwiki-gallery {
       --fg-items: 2;
       --fg-items: 2;
       --fg-image-height: 200px;
       --fg-image-height: 280px;
      --fg-side-blur: 1.5px;
      padding-right: 46px;
      padding-left: 46px;
    }


       padding-right: 42px;
    .fgwiki-gallery__caption {
       padding-left: 42px;
       min-height: 68px;
       font-size: 13px;
     }
     }


     .fgwiki-gallery__button {
     .fgwiki-gallery__button {
       width: 38px;
       width: 40px;
       height: 38px;
       height: 40px;
       font-size: 21px;
       font-size: 21px;
     }
     }
   }
   }
  /* ==============================
    نمایش یک تصویر در موبایل
  ============================== */


   @media (max-width: 600px) {
   @media (max-width: 600px) {
خط ۳۱۸: خط ۲۹۹:
       --fg-items: 1;
       --fg-items: 1;
       --fg-gap: 12px;
       --fg-gap: 12px;
       --fg-image-height: 210px;
       --fg-image-height: 260px;
 
      --fg-side-blur: 0;
      --fg-side-opacity: 1;
       width: 100%;
       width: 100%;
       padding-right: 36px;
       padding-right: 36px;
       padding-left: 36px;
       padding-left: 36px;
    }
    .fgwiki-gallery__slide,
    .fgwiki-gallery__slide.is-center,
    .fgwiki-gallery__slide:not(.is-center) {
      filter: none;
      opacity: 1;
      transform: none;
     }
     }


     .fgwiki-gallery__caption {
     .fgwiki-gallery__caption {
       min-height: 52px;
       min-height: 62px;
       padding: 12px 14px;
       padding: 12px 14px;
       font-size: 13px;
       font-size: 13px;
      line-height: 1.8;
     }
     }


خط ۳۳۴: خط ۳۲۵:
       width: 34px;
       width: 34px;
       height: 34px;
       height: 34px;
       font-size: 19px;
       font-size: 18px;
     }
     }
   }
   }


  /* غیرفعال‌شدن انیمیشن برای کاربران حساس به حرکت */
   @media (prefers-reduced-motion: reduce) {
   @media (prefers-reduced-motion: reduce) {
     .fgwiki-gallery__track,
     .fgwiki-gallery__track,
     .fgwiki-gallery__slide img,
     .fgwiki-gallery__slide,
     .fgwiki-gallery__button,
     .fgwiki-gallery__button,
     .fgwiki-gallery__dot {
     .fgwiki-gallery__dot {
خط ۳۵۵: خط ۳۴۵:
     document.querySelectorAll(".fgwiki-gallery").forEach(function (slider) {
     document.querySelectorAll(".fgwiki-gallery").forEach(function (slider) {
       const track = slider.querySelector(".fgwiki-gallery__track");
       const track = slider.querySelector(".fgwiki-gallery__track");
       const slides = Array.from(
       const originalSlides = Array.from(
         slider.querySelectorAll(".fgwiki-gallery__slide")
         slider.querySelectorAll(".fgwiki-gallery__slide")
       );
       );
       const rightButton = slider.querySelector(
       const rightButton = slider.querySelector(".fgwiki-gallery__button--right");
        ".fgwiki-gallery__button--right"
       const leftButton = slider.querySelector(".fgwiki-gallery__button--left");
      );
       const dotsContainer = slider.querySelector(".fgwiki-gallery__dots");
       const leftButton = slider.querySelector(
        ".fgwiki-gallery__button--left"
      );
       const dotsContainer = slider.querySelector(
        ".fgwiki-gallery__dots"
      );


       if (!track || slides.length === 0) {
       if (!track || originalSlides.length === 0) {
         return;
         return;
       }
       }
خط ۳۷۶: خط ۳۶۰:
       let touchStartX = 0;
       let touchStartX = 0;
       let touchEndX = 0;
       let touchEndX = 0;
 
       let isAnimating = false;
       /* زمان حرکت خودکار برحسب میلی‌ثانیه */
       const autoPlayDelay = 3500;
       const autoPlayDelay = 3500;


خط ۳۸۸: خط ۳۷۱:
       }
       }


       function getMaximumIndex() {
       function cleanupClones() {
         return Math.max(0, slides.length - getVisibleItems());
         Array.from(track.querySelectorAll(".is-clone")).forEach(function (node) {
          node.remove();
        });
       }
       }


       function getSlideStep() {
       function buildInfiniteTrack() {
         if (slides.length < 2) {
         cleanupClones();
          return slides[0].getBoundingClientRect().width;
        }


         const firstSlide = slides[0].getBoundingClientRect();
         const visibleItems = getVisibleItems();
         const secondSlide = slides[1].getBoundingClientRect();
         const slides = Array.from(track.children).filter(function (slide) {
          return !slide.classList.contains("is-clone");
        });


         return Math.abs(secondSlide.left - firstSlide.left);
         const prependClones = slides.slice(-visibleItems).map(function (slide) {
      }
          const clone = slide.cloneNode(true);
          clone.classList.add("is-clone");
          clone.setAttribute("aria-hidden", "true");
          return clone;
        });


      function normalizeIndex(index) {
        const appendClones = slides.slice(0, visibleItems).map(function (slide) {
        const maximumIndex = getMaximumIndex();
          const clone = slide.cloneNode(true);
          clone.classList.add("is-clone");
          clone.setAttribute("aria-hidden", "true");
          return clone;
        });


         if (index > maximumIndex) {
         prependClones.forEach(function (clone) {
           return 0;
           track.insertBefore(clone, track.firstChild);
         }
         });


         if (index < 0) {
         appendClones.forEach(function (clone) {
           return maximumIndex;
           track.appendChild(clone);
         }
         });


         return index;
         currentIndex = visibleItems;
        updateSlider(false);
       }
       }


       function createDots() {
       function getAllSlides() {
         const maximumIndex = getMaximumIndex();
         return Array.from(track.querySelectorAll(".fgwiki-gallery__slide"));
      }


         dotsContainer.innerHTML = "";
      function getRealSlidesCount() {
         return originalSlides.length;
      }


        for (let index = 0; index <= maximumIndex; index += 1) {
      function getSlideStep() {
          const dot = document.createElement("button");
        const slides = getAllSlides();


          dot.type = "button";
        if (slides.length < 2) {
          dot.className = "fgwiki-gallery__dot";
           return slides[0] ? slides[0].getBoundingClientRect().width : 0;
           dot.setAttribute(
        }
            "aria-label",
            "نمایش گروه تصاویر شماره " + (index + 1)
          );


          dot.addEventListener("click", function () {
        const firstSlide = slides[0].getBoundingClientRect();
            goToSlide(index);
        const secondSlide = slides[1].getBoundingClientRect();
            restartAutoPlay();
          });


          dotsContainer.appendChild(dot);
        return Math.abs(secondSlide.left - firstSlide.left);
        }
       }
       }


       function updateDots() {
       function updateDots() {
         const dots = dotsContainer.querySelectorAll(
        const visibleItems = getVisibleItems();
          ".fgwiki-gallery__dot"
        const realSlidesCount = getRealSlidesCount();
        );
        const maxDotIndex = Math.max(0, realSlidesCount - visibleItems);
        const realIndex = ((currentIndex - visibleItems) % realSlidesCount + realSlidesCount) % realSlidesCount;
        const activeDotIndex = Math.min(realIndex, maxDotIndex);
 
         const dots = dotsContainer.querySelectorAll(".fgwiki-gallery__dot");


         dots.forEach(function (dot, index) {
         dots.forEach(function (dot, index) {
           const isActive = index === currentIndex;
           const isActive = index === activeDotIndex;
          dot.classList.toggle("is-active", isActive);
          dot.setAttribute("aria-current", isActive ? "true" : "false");
        });
      }
 
      function updateCenterState() {
        const visibleItems = getVisibleItems();
        const centerOffset = Math.floor(visibleItems / 2);
        const centerIndex = currentIndex + centerOffset;
        const slides = getAllSlides();


          dot.classList.toggle("is-active", isActive);
        slides.forEach(function (slide, index) {
           dot.setAttribute(
           slide.classList.toggle("is-center", index === centerIndex);
            "aria-current",
            isActive ? "true" : "false"
          );
         });
         });
       }
       }


       function updateSlider(animate) {
       function updateSlider(animate) {
         const maximumIndex = getMaximumIndex();
         const step = getSlideStep();
 
         const offset = currentIndex * step;
         if (currentIndex > maximumIndex) {
          currentIndex = maximumIndex;
        }


         if (!animate) {
         if (!animate) {
خط ۴۷۰: خط ۴۶۹:
         }
         }


        const offset = currentIndex * getSlideStep();
         track.style.transform = "translate3d(" + offset + "px, 0, 0)";
 
        /*
        * مقدار مثبت باعث حرکت مجموعه تصاویر
        * به سمت راست در ساختار RTL می‌شود.
        */
         track.style.transform =
          "translate3d(" + offset + "px, 0, 0)";


         updateDots();
         updateDots();
        updateCenterState();


         if (!animate) {
         if (!animate) {
خط ۴۸۸: خط ۴۸۱:
           });
           });
         }
         }
      }
      function jumpIfNeeded() {
        const visibleItems = getVisibleItems();
        const realSlidesCount = getRealSlidesCount();
        if (currentIndex >= realSlidesCount + visibleItems) {
          currentIndex = visibleItems;
          updateSlider(false);
        } else if (currentIndex < visibleItems) {
          currentIndex = realSlidesCount + visibleItems - 1;
          updateSlider(false);
        }
        updateCenterState();
        updateDots();
       }
       }


       function goToSlide(index) {
       function goToSlide(index) {
         currentIndex = normalizeIndex(index);
        if (isAnimating) {
          return;
        }
 
        isAnimating = true;
         currentIndex = index;
         updateSlider(true);
         updateSlider(true);
        window.setTimeout(function () {
          jumpIfNeeded();
          isAnimating = false;
        }, 680);
       }
       }


      /* حرکت تصاویر به سمت راست */
       function moveRight() {
       function moveRight() {
         goToSlide(currentIndex + 1);
         goToSlide(currentIndex + 1);
       }
       }


      /* حرکت تصاویر به سمت چپ */
       function moveLeft() {
       function moveLeft() {
         goToSlide(currentIndex - 1);
         goToSlide(currentIndex - 1);
      }
      function createDots() {
        const visibleItems = getVisibleItems();
        const dotsCount = Math.max(1, getRealSlidesCount() - visibleItems + 1);
        dotsContainer.innerHTML = "";
        for (let index = 0; index < dotsCount; index += 1) {
          const dot = document.createElement("button");
          dot.type = "button";
          dot.className = "fgwiki-gallery__dot";
          dot.setAttribute("aria-label", "نمایش اسلاید شماره " + (index + 1));
          dot.addEventListener("click", function () {
            currentIndex = getVisibleItems() + index;
            updateSlider(true);
            restartAutoPlay();
          });
          dotsContainer.appendChild(dot);
        }
        updateDots();
       }
       }


خط ۵۰۸: خط ۵۵۰:
         stopAutoPlay();
         stopAutoPlay();


         if (
         if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
          window.matchMedia("(prefers-reduced-motion: reduce)").matches
        ) {
           return;
           return;
         }
         }
خط ۵۸۸: خط ۶۲۸:


       window.addEventListener("resize", function () {
       window.addEventListener("resize", function () {
        buildInfiniteTrack();
         createDots();
         createDots();
        updateSlider(false);
       });
       });


خط ۶۰۴: خط ۶۴۴:
           },
           },
           {
           {
             threshold: 0.15
             threshold: 0.2
           }
           }
         );
         );
خط ۶۱۳: خط ۶۵۳:
       }
       }


      buildInfiniteTrack();
       createDots();
       createDots();
      updateSlider(false);
     });
     });
   })();
   })();
</script>
</script>
</html>
</html>