Rebeca's Clothes Logo
Descubre las últimas tendencias

Descubre las últimas tendencias

Spring Collection

Explore our new arrivals for the spring season

Summer Collection

Explore our new arrivals for the summer season

Winter Collection

Explore our new arrivals for the winter season

New Arrivals

Segunda Mano

document.addEventListener('DOMContentLoaded', () => { const carousel = document.querySelector('.overflow-x-scroll'); const dotsContainer = document.querySelector('.justify-center.mt-4'); const dots = dotsContainer.querySelectorAll('span'); const items = carousel.querySelectorAll('.flex-shrink-0'); const updateDots = () => { const scrollLeft = carousel.scrollLeft; const itemWidth = items[0].offsetWidth + 16; // Ancho del item + espacio (space-x-4 = 16px) const activeIndex = Math.round(scrollLeft / itemWidth); dots.forEach((dot, index) => { if (index === activeIndex) { dot.classList.add('bg-gray-400'); dot.classList.remove('bg-gray-200'); } else { dot.classList.add('bg-gray-200'); dot.classList.remove('bg-gray-400'); } }); }; // carousel.addEventListener('scroll', updateDots); // updateDots(); // Inicializar los puntos al cargar la página // }); //