home > slideshow : enable
All checks were successful
Deploy / Deploy to Production (push) Successful in 3s

This commit is contained in:
isUnknown 2026-05-26 10:56:17 +02:00
parent dc0c48acc3
commit 13040a9df3
8 changed files with 163 additions and 48 deletions

View file

@ -0,0 +1,18 @@
const slideshow = document.getElementById('home-slideshow');
if (slideshow) {
const items = [...slideshow.querySelectorAll('picture, video')];
const prev = slideshow.querySelector('.prev');
const next = slideshow.querySelector('.next');
let current = 0;
function goTo(index) {
items[current].classList.remove('active');
current = (index + items.length) % items.length;
items[current].classList.add('active');
}
items[0]?.classList.add('active');
prev?.addEventListener('click', () => goTo(current - 1));
next?.addEventListener('click', () => goTo(current + 1));
}