<!DOCTYPE html>
<html lang="es">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Animación Profesional</title>
  <style>
    body {
        display: flex;
        justify-content: center;
        align-items: center;
        text-align: center;
        margin: 0;
        padding: 0;
        overflow: hidden;
        font-family: 'Arial', sans-serif;
        background-color: black;
        color: #00ff00;
        height: 100vh;
    }

    .title {
        position: relative;
        z-index: 100;
        font-size: 3rem;
        color: #fff;
        text-align: center;
        animation: textGlow 1.5s ease-in-out infinite alternate, textSlide 1s ease-out 1s forwards;
        font-weight: bold;
        letter-spacing: 2px;
    }

    .title span {
      display: inline-block;
      opacity: 0;
      transform: translateY(30px);
      animation: fadeInUp 0.5s ease-in-out forwards;
    }

    .title span:nth-child(odd) {
      animation-delay: 0.2s;
    }

    .mask {
      margin-top: 20px;
      width: 150px;
      animation: swing 3s ease-in-out infinite, fadeIn 2s ease-in-out forwards;
      z-index: 10;
    }

    .crowd {
      display: none;
      position: absolute;
      top: 50%;
      left: 50%;
      width: 100%;
      height: 100%;
      transform: translate(-50%, -50%);
      z-index: 1;
      animation: fadeInCrowd 2s ease-in-out forwards 3s;
    }

    .crowd img {
      position: absolute;
      width: 80px;
      opacity: 0;
      animation: crowdAppear 1.5s ease-in-out forwards;
    }

    @keyframes textGlow {
      0% {
        text-shadow: 0 0 5px #f1fea5, 0 0 10px #f1fea5, 0 0 15px #f1fea5, 0 0 20px #f1fea5;
      }
      100% {
        text-shadow: 0 0 5px #00ff00, 0 0 10px #00ff00, 0 0 15px #00ff00, 0 0 20px #00ff00;
      }
    }

    @keyframes textSlide {
      0% {
        transform: translateX(-100%);
      }
      100% {
        transform: translateX(0);
      }
    }

    @keyframes fadeInUp {
      0% {
        opacity: 0;
        transform: translateY(30px);
      }
      100% {
        opacity: 1;
        transform: translateY(0);
      }
    }

    @keyframes fadeIn {
      0% {
        opacity: 0;
        transform: scale(0.8);
      }
      100% {
        opacity: 1;
        transform: scale(1);
      }
    }

    @keyframes swing {
      0%, 100% {
        transform: rotate(0deg) scale(1);
      }
      25% {
        transform: rotate(5deg) scale(1.05);
      }
      50% {
        transform: rotate(-5deg) scale(1.05);
      }
      75% {
        transform: rotate(3deg) scale(1);
      }
    }

    @keyframes fadeInCrowd {
      0% {
        opacity: 0;
      }
      100% {
        opacity: 1;
        display: block;
      }
    }

    @keyframes crowdAppear {
      0% {
        opacity: 0;
        transform: scale(0.5) rotate(10deg);
      }
      100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
      }
    }

    canvas {
      display: block;
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      z-index: -1;
    }
  </style>
</head>
<body>
  <div class="title">
    <span>¡</span><span>FUNCIONÓ</span><span>!</span> 
    <span>A</span> <span>SPAMMEAR</span> <span>DURO</span>…
  </div>
  <img class="mask" src="https://static.vecteezy.com/system/resources/previews/035/241/200/non_2x/ai-generated-anonymous-mask-isolated-on-transparent-background-free-png.png" alt="Máscara de Anonymous">
  <div class="crowd" id="crowd"></div>

  <!-- Canvas para el fondo dinámico -->
  <canvas id="matrix"></canvas>

  <script>
    // Función para generar la multitud de máscaras
    function createCrowd() {
      const crowdContainer = document.getElementById('crowd');
      crowdContainer.style.display = 'block';
      const crowdSize = 50; // Número de máscaras

      for (let i = 0; i < crowdSize; i++) {
        const img = document.createElement('img');
        img.src = 'https://static.vecteezy.com/system/resources/previews/035/241/200/non_2x/ai-generated-anonymous-mask-isolated-on-transparent-background-free-png.png';
        img.style.top = `${Math.random() * 100}%`;
        img.style.left = `${Math.random() * 100}%`;
        img.style.animationDelay = `${Math.random() * 2}s`;
        crowdContainer.appendChild(img);
      }
    }

    // Generar la multitud después de la animación inicial
    setTimeout(createCrowd, 3000);

    // Canvas para el efecto de números cayendo
    const canvas = document.getElementById('matrix');
    const ctx = canvas.getContext('2d');

    canvas.width = window.innerWidth;
    canvas.height = window.innerHeight;

    const fontSize = 16;
    const columns = canvas.width / fontSize; // Número de columnas de números
    const drops = Array(Math.floor(columns)).fill(1); // Posiciones iniciales de las "lluvias"

    const draw = () => {
      ctx.fillStyle = 'rgba(0, 0, 0, 0.05)'; // Efecto de desvanecimiento
      ctx.fillRect(0, 0, canvas.width, canvas.height);
      
      ctx.fillStyle = '#00ff00'; // Color de los números
      ctx.font = `${fontSize}px monospace`;

      drops.forEach((y, i) => {
        const text = String.fromCharCode(0x30A0 + Math.random() * 96); // Caracteres aleatorios estilo japonés
        const x = i * fontSize;

        ctx.fillText(text, x, y * fontSize);

        if (y * fontSize > canvas.height && Math.random() > 0.975) {
          drops[i] = 0; // Reiniciar columna al azar
        }

        drops[i]++;
      });
    };

    setInterval(draw, 50); // Llamar a draw cada 50ms

    // Ajustar el canvas dinámicamente si el tamaño de la ventana cambia
    window.addEventListener('resize', () => {
      canvas.width = window.innerWidth;
      canvas.height = window.innerHeight;
      drops.length = Math.floor(canvas.width / fontSize);
      drops.fill(1);
    });
  </script>
</body>
</html>
