UNPKG

stylescape

Version:

Stylescape is a visual identity framework developed by Scape Agency.

22 lines 737 B
export default class SliderManager { constructor(sliderSelector) { this.currentIndex = 0; this.slides = document.querySelectorAll(`${sliderSelector} .slide`); this.showSlide(this.currentIndex); } showSlide(index) { this.slides.forEach((slide, i) => { slide.style.display = i === index ? "block" : "none"; }); } nextSlide() { this.currentIndex = (this.currentIndex + 1) % this.slides.length; this.showSlide(this.currentIndex); } prevSlide() { this.currentIndex = (this.currentIndex - 1 + this.slides.length) % this.slides.length; this.showSlide(this.currentIndex); } } //# sourceMappingURL=SliderManager.js.map