Particle Explosion Cursor - 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>Particle Explosion Cursor</title> <style> body { margin: 0; overflow: hidden; background: #000; } .particle { position: absolute; width: 5px; height: 5px; background: rgba(255, 69, 0, 0.8); border-radius: 50%; pointer-events: none; animation: explode 1s linear infinite; } @keyframes explode { from { transform: scale(1); opacity: 1; } to { transform: translate(calc(var(--dx) * 50px), calc(var(--dy) * 50px)) scale(0.5); opacity: 0; } } </style> </head> <body> <script> document.addEventListener('mousemove', function(e) { for (let i = 0; i < 20; i++) { const particle = document.createElement('div'); particle.className = 'particle'; particle.style.setProperty('--dx', (Math.random() - 0.5) * 2); particle.style.setProperty('--dy', (Math.random() - 0.5) * 2); particle.style.left = `${e.pageX}px`; particle.style.top = `${e.pageY}px`; document.body.appendChild(particle); setTimeout(() => particle.remove(), 1000); } }); </script> </body> </html>