Untitled

 avatar
unknown
plain_text
a year ago
2.4 kB
19
Indexable
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Plan B</title>
  <style>
    body {
      margin: 0;
      height: 100vh;
      display: flex;
      justify-content: center;
      align-items: center;
      background-color: #000;
      color: #fff;
      font-family: 'Courier New', Courier, monospace;
      flex-direction: column;
    }
    .logo {
      font-size: 3rem;
      font-weight: bold;
      color: #ff2b2b;
      margin-bottom: 1rem;
    }
    .subtitle {
      font-size: 1.2rem;
      margin-bottom: 2rem;
      color: #ccc;
    }
    .countdown {
      font-size: 2rem;
      letter-spacing: 2px;
      color: #fff;
    }
    .blink {
      animation: blink 1.5s infinite;
      color: #ff2b2b;
      margin-top: 2rem;
      font-size: 1.5rem;
    }
    @keyframes blink {
      0% { opacity: 1; }
      50% { opacity: 0; }
      100% { opacity: 1; }
    }
  </style>
</head>
<body>
  <div class="logo">PLAN B</div>
  <div class="subtitle">Initiating Plan B…</div>
  <div id="countdown" class="countdown">Loading…</div>
  <div class="blink">A &lt; B</div>

  <script>
    // Set a fixed end date (12 days from the first load date)
    const savedTarget = localStorage.getItem("planbTargetDate");
    let targetDate;

    if (savedTarget) {
      targetDate = new Date(savedTarget);
    } else {
      targetDate = new Date();
      targetDate.setDate(targetDate.getDate() + 12);
      localStorage.setItem("planbTargetDate", targetDate);
    }

    const countdownEl = document.getElementById("countdown");

    function updateCountdown() {
      const now = new Date().getTime();
      const distance = targetDate - now;

      if (distance < 0) {
        countdownEl.innerHTML = "00d 00h 00m 00s";
        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);

      countdownEl.innerHTML = `${days}d ${hours}h ${minutes}m ${seconds}s`;
    }

    updateCountdown();
    const interval = setInterval(updateCountdown, 1000);
  </script>
</body>
</html>
Editor is loading...
Leave a Comment