Glowing Cursor Effect - 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>Glowing Cursor Effect</title> <style> body { margin: 0; padding: 0; overflow: hidden; font-family: 'Arial', sans-serif; background-color: #222; color: #ffffff; } .cursor { position: absolute; top: 0; left: 0; width: 20px; height: 20px; background-color: #39ff14; border-radius: 50%; pointer-events: none; box-shadow: 0 0 10px #39ff14, 0 0 20px #39ff14, 0 0 30px #39ff14, 0 0 40px #39ff14; animation: glow 1s infinite alternate; will-change: transform; } @keyframes glow { 0% { box-shadow: 0 0 10px #39ff14, 0 0 20px #39ff14, 0 0 30px #39ff14, 0 0 40px #39ff14; } 100% { box-shadow: 0 0 20px #39ff14, 0 0 40px #39ff14, 0 0 60px #39ff14, 0 0 80px #39ff14; } } </style> </head> <body> <div class="cursor" id="cursor"></div> <script> const cursor = document.getElementById('cursor'); let mouseX = 0; let mouseY = 0; document.addEventListener('mousemove', e => { mouseX = e.clientX; mouseY = e.clientY; cursor.style.transform = `translate(${mouseX - cursor.offsetWidth / 2}px, ${mouseY - cursor.offsetHeight / 2}px)`; }); </script> </body> </html>