Closure Sale (up to 80% off) Ends Today
- Time Left:
// JavaScript voor de afteltimer
(function() {
function updateCountdown() {
var now = new Date();
var nextMidnight = new Date(now);
nextMidnight.setHours(24, 0, 0, 0); // Volgende middernacht
var timeLeft = nextMidnight - now; // Tijd tot middernacht in milliseconden
var hours = Math.floor(timeLeft / (1000 * 60 * 60));
var minutes = Math.floor((timeLeft % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((timeLeft % (1000 * 60)) / 1000);
// Vul de timer in met uren, minuten en seconden
document.getElementById("countdown-timer").innerText =
hours.toString().padStart(2, "0") + ":" +
minutes.toString().padStart(2, "0") + ":" +
seconds.toString().padStart(2, "0");
}
// Update de countdown elke seconde
setInterval(updateCountdown, 1000);
// Initialiseer de timer direct
updateCountdown();
})();