Cursor Effects Animation — Reference
Neon Cursor
The Neon Cursor is a CSS animation component that three layers — dot, ring, and glow halo — each spring-animate toward the cursor at different speeds for a depth effect. Fully color-customizable. It ships as self-contained HTML and CSS with no external dependencies, making it drop-in ready for any modern web project regardless of framework or build system.
When to use the Neon Cursor
- Portfolio sites, creative agencies, and immersive hero sections
- Active state indicators, premium plan highlights, and status badges
- Component libraries and design systems that need consistent motion patterns
- Progressive enhancement — works in all modern browsers, degrades gracefully
Performance characteristics
- GPU-accelerated — uses CSS transform and opacity so compositing happens off the main thread
- Zero JavaScript dependency in most configurations — no framework, no bundler required
- Approximately 60 fps on any device that supports CSS animations (Chrome 43+, Firefox 16+, Safari 9+)
- Self-contained in a single HTML file — no npm install, no build step, paste and ship
How it compares
Unlike equivalent JavaScript implementations, the Neon Cursor does not require any runtime library — there is nothing to install, bundle, or load asynchronously.
Compared to animated GIFs or video embeds, this CSS component is resolution-independent, theme-able via CSS custom properties, and weighs a fraction of the equivalent media file.
Source code
CSS
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #0a0a0a; cursor: none; }
.hint { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); font-family: sans-serif; font-size: 16px; color: #ffffff; opacity: 0.45; pointer-events: none; user-select: none; letter-spacing: 0.04em; }
.c-dot {
position: fixed; pointer-events: none; border-radius: 50%;
width: 10px; height: 10px;
background: #ec6517;
box-shadow: 0 0 6px 2px #ec6517;
transform: translate(-50%,-50%);
z-index: 9999;
}
.c-ring {
position: fixed; pointer-events: none; border-radius: 50%;
width: 40px; height: 40px;
border: 2px solid #ec6517;
box-shadow: 0 0 8px 1px #ec6517, inset 0 0 8px 1px #ec6517;
transform: translate(-50%,-50%);
z-index: 9998;
}
.c-glow {
position: fixed; pointer-events: none; border-radius: 50%;
width: 80px; height: 80px;
background: #ec6517;
opacity: 0.18;
transform: translate(-50%,-50%);
z-index: 9997;
}HTML
<p class="hint">Move your cursor here</p>
<div class="c-glow" id="glow"></div>
<div class="c-ring" id="ring"></div>
<div class="c-dot" id="dot"></div>Full source
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #0a0a0a; cursor: none; }
.hint { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); font-family: sans-serif; font-size: 16px; color: #ffffff; opacity: 0.45; pointer-events: none; user-select: none; letter-spacing: 0.04em; }
.c-dot {
position: fixed; pointer-events: none; border-radius: 50%;
width: 10px; height: 10px;
background: #ec6517;
box-shadow: 0 0 6px 2px #ec6517;
transform: translate(-50%,-50%);
z-index: 9999;
}
.c-ring {
position: fixed; pointer-events: none; border-radius: 50%;
width: 40px; height: 40px;
border: 2px solid #ec6517;
box-shadow: 0 0 8px 1px #ec6517, inset 0 0 8px 1px #ec6517;
transform: translate(-50%,-50%);
z-index: 9998;
}
.c-glow {
position: fixed; pointer-events: none; border-radius: 50%;
width: 80px; height: 80px;
background: #ec6517;
opacity: 0.18;
transform: translate(-50%,-50%);
z-index: 9997;
}
</style>
</head>
<body>
<p class="hint">Move your cursor here</p>
<div class="c-glow" id="glow"></div>
<div class="c-ring" id="ring"></div>
<div class="c-dot" id="dot"></div>
<script>
var dot = document.getElementById('dot');
var ring = document.getElementById('ring');
var glow = document.getElementById('glow');
var mouse = {x: -200, y: -200};
var rp = {x: -200, y: -200, vx: 0, vy: 0};
var gp = {x: -200, y: -200, vx: 0, vy: 0};
var last = null;
function spring(p, t, tension, friction, mass, dt) {
p.vx += (tension * (t.x - p.x) - friction * p.vx) / mass * dt;
p.vy += (tension * (t.y - p.y) - friction * p.vy) / mass * dt;
p.x += p.vx * dt; p.y += p.vy * dt;
}
function tick(ts) {
if (!last) last = ts;
var dt = Math.min((ts - last) / 1000, 0.05);
last = ts;
dot.style.left = mouse.x + 'px'; dot.style.top = mouse.y + 'px';
spring(rp, mouse, 400, 28, 0.8, dt);
ring.style.left = rp.x + 'px'; ring.style.top = rp.y + 'px';
spring(gp, mouse, 150, 35, 1.2, dt);
glow.style.left = gp.x + 'px'; glow.style.top = gp.y + 'px';
requestAnimationFrame(tick);
}
document.addEventListener('mousemove', function(e) { mouse.x = e.clientX; mouse.y = e.clientY; });
requestAnimationFrame(tick);
</script>
</body>
</html>Frequently asked questions
How do I add the Neon Cursor to my project?
Copy the full source code from the code block on this page. Paste the <style> block into your stylesheet (or a <style> tag in your HTML head) and the HTML markup into your template. No npm install or build step is required — the animation is self-contained. To customize colors, speed, or size, use Grepped's workspace at grepped.dev/animations/cursors/neon-cursor.
Is the Neon Cursor free to use?
Yes. All Grepped preset animations are free to use in personal and commercial projects. You may copy, modify, and redistribute the code without attribution. The only limitation is that you may not resell the presets themselves as part of a competing animation library.
Does the Neon Cursor work on mobile browsers?
Yes. The Neon Cursor uses standard CSS animations and transforms that are supported in all modern mobile browsers — Chrome for Android, Safari on iOS 9+, Samsung Internet, and Firefox for Android. Where JavaScript is used for interactivity (e.g. cursor effects), it falls back gracefully on touch devices.
Can I customize the Neon Cursor's colors, speed, or size?
Yes. Open the live customization workspace at grepped.dev/animations/cursors/neon-cursor to adjust the animation with real-time sliders, color pickers, and toggles — no code required. For deeper changes, the source code uses CSS custom properties (variables) so you can edit them directly in your stylesheet.
Want to customize this animation or generate a new one from a text prompt?
Open in Workspace — it's free