<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Aleksandrov Security</title>
  <style>
    body {
      margin: 0;
      padding: 0;
      font-family: "Courier New", monospace;
      background: #0f0f0f;
      color: #00ff00;
      overflow: hidden;
    }
    canvas {
      position: absolute;
      top: 0;
      left: 0;
    }
    .terminal {
      position: fixed;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 80%;
      height: 60%;
      background: rgba(15, 15, 15, 0.9);
      border: 2px solid #00ff00;
      border-radius: 10px;
      overflow-y: auto;
      padding: 15px;
      box-shadow: 0 0 15px #00ff00;
      animation: pulse-border 1s infinite alternate;
    }
    .terminal h1 {
      font-size: 24px;
      text-align: center;
      margin: 0 0 10px 0;
      text-shadow: 0 0 5px #00ff00;
    }
    .terminal pre {
      font-size: 16px;
      white-space: pre-wrap;
      color: #ff3333;
    }
    .terminal .contact {
      margin-top: 15px;
      text-align: center;
      font-size: 16px;
      color: #00ff00;
      text-shadow: 0 0 5px #00ff00;
    }
    .terminal .contact a {
      color: #00ff00;
      text-decoration: underline;
    }
    .terminal .contact.warning {
      font-size: 18px;
      color: red;
      text-shadow: 0 0 5px red;
    }
    .threat {
      position: absolute;
      font-size: 16px;
      animation: attack 5s linear infinite;
      background: rgba(255, 0, 0, 0.8);
      padding: 5px 10px;
      border-radius: 5px;
      box-shadow: 0 0 10px rgba(255, 0, 0, 0.8);
      cursor: pointer;
    }
    .threat:hover {
      background: rgba(0, 255, 0, 0.8);
      box-shadow: 0 0 10px rgba(0, 255, 0, 0.8);
      color: black;
    }
    @keyframes attack {
      0% {
        transform: translateY(-100%);
      }
      100% {
        transform: translateY(100vh);
      }
    }
    @keyframes pulse-border {
      0% {
        border-color: #00ff00;
        box-shadow: 0 0 15px #00ff00;
      }
      50% {
        border-color: red;
        box-shadow: 0 0 15px red;
      }
      100% {
        border-color: #00ff00;
        box-shadow: 0 0 15px #00ff00;
      }
    }
  </style>
</head>
<body>
  <canvas id="background"></canvas>
  <div class="terminal">
    <h1 id="login-time">⚔️ Last login: </h1>
    <pre id="code"></pre>
    <div class="contact">
      If you wish to contact me, feel free to send an email to <a href="mailto:anything@aleksandrov.app">anything@aleksandrov.app</a>.
    </div>
  </div>

  <script>
    // Function to get current date and time
    function getCurrentDateTime() {
      const now = new Date();
      const options = {
        weekday: 'short', year: 'numeric', month: 'short', day: 'numeric',
        hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: false
      };
      return now.toLocaleDateString('en-US', options) + " on ttys000";
    }

    // Update login time in the terminal
    document.getElementById('login-time').innerHTML = `⚔️ Last login: ${getCurrentDateTime()}`;

    const canvas = document.getElementById("background");
    const ctx = canvas.getContext("2d");
    const w = canvas.width = window.innerWidth;
    const h = canvas.height = window.innerHeight;

    const threats = [
      '&lt;script&gt;alert("XSS Attack")&lt;/script&gt;',
      'const payload = "&lt;img src=x onerror=alert(\'XSS\')&gt;";',
      '&lt;iframe src="http://malicious.com"&gt;&lt;/iframe&gt;',
      'fetch("http://malicious.com", { method: "POST" });',
      '&lt;svg onload=alert("Hack!")&gt;&lt;/svg&gt;',
      '&lt;script&gt;document.cookie="sessionId=steal";&lt;/script&gt;',
      'while(true){console.log("Injected...");}',
      '&lt;a href="javascript:alert(\'Stolen!\')"&gt;Click Me&lt;/a&gt;'
    ];

    // Function to display threats
    let currentThreatIndex = 0;
    const codeDisplay = document.getElementById('code'); 

    function displayCode() {
      codeDisplay.innerHTML = threats[currentThreatIndex];
      currentThreatIndex = (currentThreatIndex + 1) % threats.length;
    }

    // Rotate threats every 3 seconds
    setInterval(displayCode, 3000);

    // Create falling threats
    function spawnThreat() {
      const threat = document.createElement("div");
      threat.classList.add("threat");
      threat.textContent = threats[Math.floor(Math.random() * threats.length)];
      threat.style.left = Math.random() * 90 + "%";
      document.body.appendChild(threat);

      threat.addEventListener("animationend", () => {
        document.body.removeChild(threat);
      });

      threat.addEventListener("mouseenter", () => {
        threat.textContent = "Threat Neutralized!";
        threat.style.background = "rgba(0, 255, 0, 0.8)";
        threat.style.boxShadow = "0 0 10px rgba(0, 255, 0, 0.8)";
        threat.style.color = "black";
      });


    }

    setInterval(spawnThreat, 1000);

    // Cool glitch animation
    function drawBackground() {
      ctx.fillStyle = "rgba(0, 0, 0, 0.05)";
      ctx.fillRect(0, 0, w, h);
      for (let i = 0; i < 100; i++) {
        ctx.fillStyle = "#00ff00";
        ctx.fillRect(Math.random() * w, Math.random() * h, 2, 2);
      }
    }

    setInterval(drawBackground, 30);
  </script>
</body>
</html>
