()
| 240 | let currentIndex = 0; |
| 241 | |
| 242 | const update = () => { |
| 243 | track.style.transform = `translate3d(-${currentIndex * 100}%, 0, 0)`; |
| 244 | dots.forEach((dot, index) => { |
| 245 | const isActive = index === currentIndex; |
| 246 | dot.classList.toggle("is-active", isActive); |
| 247 | dot.setAttribute("aria-selected", String(isActive)); |
| 248 | }); |
| 249 | }; |
| 250 | |
| 251 | const goTo = (index) => { |
| 252 | currentIndex = (index + slides.length) % slides.length; |