


    // Вкажіть дату завершення відліку
    const countdownDate = new Date("2025-01-01T00:00:00").getTime();

    // Оновлення кожну секунду
    const countdownFunction = setInterval(function () {
        const now = new Date().getTime();
        const distance = countdownDate - now;

        // Розрахунок часу
        const days = Math.floor(distance / (1000 * 60 * 60 * 24));
        const hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
        const minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
        const seconds = Math.floor((distance % (1000 * 60)) / 1000);

        // Виведення
        document.getElementById("countdown").innerHTML = 
            days + "d " + hours + "h " + minutes + "m " + seconds + "s ";

        // Якщо час вийшов
        if (distance < 0) {
            clearInterval(countdownFunction);
            document.getElementById("countdown").innerHTML = "Time is up!";
        }
    }, 1000);

