Contador Regressivo
body {
font-family: Arial, sans-serif;
text-align: center;
margin-top: 100px;
}
.promo-container {
background-color: #f2f2f2;
padding: 20px;
border-radius: 10px;
display: inline-block;
}
Valor Promocional Semana do Cliente de 11 à 17/09
(Restam 0 dias 0 horas : 0 minutos : 0 segundos)
// Função para atualizar o contador
function updateCounter() {
const endDate = new Date(new Date().getFullYear(), 8, 17, 23, 59, 59); // 8 representa setembro (começa de 0 = janeiro)
const now = new Date();
const diff = endDate - now;
if (diff <= 0) {
document.getElementById("days").textContent = "0";
document.getElementById("hours").textContent = "0";
document.getElementById("minutes").textContent = "0";
document.getElementById("seconds").textContent = "0";
return;
}
const days = Math.floor(diff / (1000 * 60 * 60 * 24));
const hours = Math.floor((diff % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
const minutes = Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((diff % (1000 * 60)) / 1000);
document.getElementById("days").textContent = days;
document.getElementById("hours").textContent = hours;
document.getElementById("minutes").textContent = minutes;
document.getElementById("seconds").textContent = seconds;
}
// Atualizar o contador a cada segundo
setInterval(updateCounter, 1000);