<div class="timer-background">
<div class="countdown-wrapper">
<div class="countdown-item">
<span id="days">00</span>
<span>Days</span>
</div>
<div class="countdown-item">
<span id="hours">00</span>
<span>Hours</span>
</div>
<div class="countdown-item">
<span id="minutes">00</span>
<span>Minutes</span>
</div>
<div class="countdown-item">
<span id="seconds">00</span>
<span>Seconds</span>
</div>
</div>
</div>
<script>
function updateCountdown() {
const target = new Date('2025-08-09T23:59:59-06:00').getTime(); // CST fixed
function update() {
const now = new Date().getTime();
const diff = target - now;
if (diff < 0) return; // Stop if countdown ended
document.getElementById('days').textContent = Math.floor(diff / (1000 * 60 * 60 * 24));
document.getElementById('hours').textContent = Math.floor((diff % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
document.getElementById('minutes').textContent = Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60));
document.getElementById('seconds').textContent = Math.floor((diff % (1000 * 60)) / 1000);
}
update();
setInterval(update, 1000);
}
updateCountdown();
</script>
Then style use the CSS code so Add the Custom CSS code.
/* Hide on mobile */
@media (max-width: 767px) {
.timer-background {
display:none !important;
}
}
/* Main Timer Background */
.timer-background {
min-height: 65px;
display: flex;
align-items: center;
justify-content: center;
}
/* Individual Item */
.countdown-item {
display: flex;
flex-direction: column;
align-items: center;
min-width: 80px;
}
/* Numbers */
.countdown-item span:first-child {
font-size: 2.5rem;
font-weight: bold;
color: #fff;
text-shadow: 3px 5px 3px #666;
}
/* Labels */
.countdown-item span:last-child {
font-size: 0.875rem;
color: #fff;
text-transform: uppercase;
margin-top: 5px;
}
/* Wrapper */
.countdown-wrapper {
display: flex;
justify-content: center;
gap: 20px;
font-family: 'Spirex',sans-serif;
margin-left: 50rem;
background-color: green;
padding:20px!important
}