Expanding Stars Background - MeggiTools
Run
Toggle Theme
Share Link
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Expanding Stars Background</title> <style> body, html { margin: 0; padding: 0; overflow: hidden; height: 100%; background: #000; } .star { position: absolute; width: 10px; height: 10px; background: #ffff00; border-radius: 50%; animation: expand 3s infinite; } @keyframes expand { 0%, 100% { transform: scale(1); } 50% { transform: scale(3); } } </style> </head> <body> <script> for (let i = 0; i < 50; i++) { const star = document.createElement('div'); star.className = 'star'; star.style.left = `${Math.random() * 100}%`; star.style.top = `${Math.random() * 100}%`; star.style.animationDuration = `${Math.random() * 3 + 2}s`; document.body.appendChild(star); } </script> </body> </html>