Di bawah ini adalah kode html count down yang pernah dipakai di website ciihuy.com
<div style="background-color: black; padding: 1em; color: red;">
<div style="display: table; width: 100%;">
<div style="display: table-cell; vertical-align: middle;">
<img src="https://ciihuy.com/wp-content/uploads/2025/03/countdown13.jpg" style="width: 128px;">
</div>
<div style="display: table-cell; vertical-align: middle; text-align: right;">
<div id="countdown" style="font-size: 1.5em;"></div>
</div>
</div>
</div>
<script>
function updateCountdown() {
const targetDate = new Date("May 13, 2025 13:25:00").getTime();
const now = new Date().getTime();
const timeLeft = targetDate - now;
if (timeLeft <= 0) {
document.getElementById("countdown").innerHTML =
'<a href="https://www.youtube.com/watch?v=1trQXWQeBH0" target="_blank" style="' +
'display: inline-block;' +
'padding: 12px 24px;' +
'background-color: #FF0000;' +
'color: white;' +
'text-decoration: none;' +
'font-weight: bold;' +
'font-size: 18px;' +
'border-radius: 5px;' +
'box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);' +
'transition: all 0.3s ease;' +
'text-align: center;' +
'">' +
'Tonton Trailer' +
'</a>';
return;
}
const days = Math.floor(timeLeft / (1000 * 60 * 60 * 24));
const hours = Math.floor((timeLeft % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
const minutes = Math.floor((timeLeft % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((timeLeft % (1000 * 60)) / 1000);
document.getElementById("countdown").innerHTML =
`${days} hari ${hours} jam ${minutes} menit ${seconds} detik`;
}
updateCountdown();
setInterval(updateCountdown, 1000);
</script>