<div class=”sale-countdown”>
<div class=”count-title”>ƯU ĐÃI SẮP KẾT THÚC</div>
<div class=”count-row”>
<div><strong id=”days”>00</strong><span>Ngày</span></div>
<div><strong id=”hours”>00</strong><span>Giờ</span></div>
<div><strong id=”minutes”>01</strong><span>Phút</span></div>
<div><strong id=”seconds”>00</strong><span>Giây</span></div>
</div>
</div>
<script>
let timeLeft = 60;
function updateTimer() {
const minutes = Math.floor(timeLeft / 60);
const seconds = timeLeft % 60;
document.getElementById(“minutes”).textContent =
String(minutes).padStart(2, “0”);
document.getElementById(“seconds”).textContent =
String(seconds).padStart(2, “0”);
if (timeLeft > 0) {
timeLeft–;
}
}
updateTimer();
setInterval(updateTimer, 1000);
</script>
.sale-countdown {
text-align: center;
margin: 10px 0 14px;
}
.count-title {
font-size: 14px;
font-weight: 700;
margin-bottom: 7px;
}
.count-row {
display: flex;
justify-content: center;
gap: 8px;
}
.count-row div {
display: flex;
flex-direction: column;
align-items: center;
}
.count-row strong {
display: flex;
width: 44px;
height: 42px;
align-items: center;
justify-content: center;
background: #fff;
border: 1px solid #777;
border-radius: 8px;
font-size: 23px;
color: #ffbf00;
}
.count-row span {
font-size: 12px;
margin-top: 3px;
}
