document.addEventListener("DOMContentLoaded", () => {

    const slides = document.querySelectorAll(".project-page-preview-image");

    if (slides.length <= 1)
        return;

    let current = 0;

    setInterval(() => {

        slides[current].classList.remove("active");

        current++;

        if (current >= slides.length) {
            current = 0;
        }

        slides[current].classList.add("active");

    }, 4000);

});