Pausar
let interval; const pauseButton = document.getElementById('pause-button'); pauseButton.addEventListener('click', () => { if (pauseButton.textContent === 'Pausar') { pauseButton.textContent = 'Reanudar'; clearInterval(interval); } else { pauseButton.textContent = 'Pausar'; interval = setInterval(updateTimer, 1000); } }); class Particle { constructor() { this.x = Math.random() * canvas.width; this.y = Math.random() * canvas.height; this.size = Math.random() * 2; this.speed = Math.random() * 0.5 + 0.1; this.alpha = Math.random(); } update() { this.y -= this.speed; if (this.y < 0) this.y = canvas.height; } draw() { ctx.fillStyle = `rgba(150, 150, 150, ${this.alpha})`; ctx.fillRect(this.x, this.y, this.size, this.size * 5); } } let particles = []; function updateTimer() { ctx.clearRect(0, 0, canvas.width, canvas.height); particles.forEach(particle =>