const countdownDisplay = document.getElementById("countdown-display");
const birthdayDisplay = document.getElementById("birthday-display")
function renderCountdown(element, targetDate) {
const now = new Date();
const remainingTime = targetDate - now;
const days = Math.floor(remainingTime / (1000 * 60 * 60 * 24));
const hours = Math.floor(remainingTime / (1000 * 60 * 60) % 24);
const minutes = Math.floor(remainingTime / (1000 * 60) % 60);
const seconds = Math.floor(remainingTime / 1000 % 60);
element.textContent = `${days}d ${hours}h ${minutes}m ${seconds}s`;
}
renderCountdown(countdownDisplay, new Date('2023-12-25'));
renderCountdown(birthdayDisplay, new Date('2023-12-12'));
setInterval(() => {
renderCountdown(countdownDisplay, new Date('2023-12-25'));
renderCountdown(birthdayDisplay, new Date('2023-12-12'));
}, 1000);