Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
1.1 kB
2
Indexable
Never
<style>
#carousel-e6bee4dc {
  position: relative;
}

.sc-feryYK.cVoPex {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition: opacity 1s ease;
}
</style>

<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function() {
  // Get references to the carousel and slides
  const carousel = document.querySelector("#carousel-e6bee4dc");
  const slides = document.querySelectorAll(".sc-feryYK.cVoPex");

  let currentSlideIndex = 0;

  function showSlide(index) {
    slides.forEach((slide, i) => {
      if (i === index) {
        slide.style.zIndex = 1;
        slide.style.opacity = 1;
      } else {
        slide.style.zIndex = 0;
        slide.style.opacity = 0;
      }
    });
  }

  function nextSlide() {
    // Increment current slide index
    currentSlideIndex = (currentSlideIndex + 1) % slides.length;
    
    // Show the next slide
    showSlide(currentSlideIndex);
  }

  // Display the first slide initially
  showSlide(currentSlideIndex);

  // Rotate to the next slide every 3 seconds (adjust the interval as needed)
  setInterval(nextSlide, 3000);
});
</script>