Home / Widgets / geri sayım sayacı
Duplicate Snippet

Embed Snippet on Your Site

geri sayım sayacı

Code Preview
html
<div id="countdown" style="font-family: Arial, sans-serif; text-align:center; padding:20px;">
  <h2>6 Haziran 2026'ya Kalan Süre</h2>
  <div id="timer" style="font-size:32px; font-weight:bold;"></div>
</div>
<script>
  const targetDate = new Date("2026-06-06T00:00:00+03:00").getTime();
  function updateCountdown() {
    const now = new Date().getTime();
    const distance = targetDate - now;
    if (distance <= 0) {
      document.getElementById("timer").innerHTML = "Süre doldu!";
      clearInterval(interval);
      return;
    }
    const days = Math.floor(distance / (1000 * 60 * 60 * 24));
    const hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
    const minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
    const seconds = Math.floor((distance % (1000 * 60)) / 1000);
    document.getElementById("timer").innerHTML =
      ${days} Gün ${hours} Saat ${minutes} Dakika ${seconds} Saniye;
  }
  updateCountdown();
  const interval = setInterval(updateCountdown, 1000);
</script>

Comments

Add a Comment