Morphing Shapes - 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>Morphing Shapes</title> <style> body, html { margin: 0; padding: 0; overflow: hidden; height: 100%; background: #333; display: flex; justify-content: center; align-items: center; } .shape { position: absolute; width: 50px; height: 50px; background: #2196f3; animation: morph 5s infinite ease-in-out; } @keyframes morph { 0%, 100% { clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%); } 50% { clip-path: circle(50%); } } </style> </head> <body> <script> for (let i = 0; i < 20; i++) { const shape = document.createElement('div'); shape.className = 'shape'; shape.style.left = `${Math.random() * 100}vw`; shape.style.top = `${Math.random() * 100}vh`; shape.style.animationDuration = `${Math.random() * 3 + 2}s`; document.body.appendChild(shape); } </script> </body> </html>