Color Changing Cursor - VexaX
Run Code
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>Color Changing Cursor</title> <style> body { margin: 0; overflow: hidden; background: #000; } .color-dot { position: absolute; width: 10px; height: 10px; background: red; border-radius: 50%; pointer-events: none; animation: colorChange 1s linear infinite; } @keyframes colorChange { 0% { background: red; } 25% { background: blue; } 50% { background: green; } 75% { background: yellow; } 100% { background: red; } } </style> </head> <body> <script> document.addEventListener('mousemove', function(e) { const dot = document.createElement('div'); dot.className = 'color-dot'; dot.style.left = `${e.pageX}px`; dot.style.top = `${e.pageY}px`; document.body.appendChild(dot); setTimeout(() => dot.remove(), 1000); }); </script> </body> </html>