Bubble Float - 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>Bubble Float</title> <style> body, html { margin: 0; padding: 0; overflow: hidden; height: 100%; background: #000; } .bubble { position: absolute; background: rgba(255, 255, 255, 0.5); border-radius: 50%; animation: float 8s infinite; } @keyframes float { 0% { transform: translateY(0); } 50% { transform: translateY(-200%); } 100% { transform: translateY(0); } } </style> </head> <body> <script> for (let i = 0; i < 50; i++) { const bubble = document.createElement('div'); bubble.className = 'bubble'; bubble.style.width = `${Math.random() * 50 + 10}px`; bubble.style.height = bubble.style.width; bubble.style.left = `${Math.random() * 100}%`; bubble.style.animationDuration = `${Math.random() * 5 + 3}s`; bubble.style.animationDelay = `${Math.random() * 5}s`; document.body.appendChild(bubble); } </script> </body> </html>