Rainbow 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>Rainbow Cursor</title> <style> body { margin: 0; padding: 0; overflow: hidden; background-color: #111; cursor: none; } .cursor { position: absolute; width: 12px; height: 12px; background: linear-gradient(45deg, #ff0000, #ff9900, #00ff00, #0000ff, #ff00ff); border-radius: 50%; pointer-events: none; animation: rainbow 2s infinite alternate; } @keyframes rainbow { 0% { background-position: 0% 50%; } 100% { background-position: 100% 50%; } } </style> </head> <body> <div class="cursor" id="cursor"></div> <script> document.addEventListener('mousemove', (e) => { const cursor = document.getElementById('cursor'); cursor.style.left = `${e.pageX}px`; cursor.style.top = `${e.pageY}px`; }); </script> </body> </html>