Comet Tail
A copy-paste cursors component in pure HTML, CSS & vanilla JS. Zero dependencies, framework-agnostic, MIT-licensed.
CursorsHTMLJavaScriptCSSany framework
Move your cursor
Copy into your project
HTML
<div class="nuda-cur2-comet-tail">
<span class="nuda-cur2-comet-tail__glow"></span>
<span class="nuda-cur2-comet-tail__head"></span>
<span class="nuda-cur2-comet-tail__label">Move your cursor</span>
</div>JavaScript
/* Comet Tail — head and glow ease toward the pointer at different
speeds, giving the head a soft trailing tail. */
(function () {
document.querySelectorAll('.nuda-cur2-comet-tail').forEach(function (area) {
area.addEventListener('mousemove', function (e) {
var rect = area.getBoundingClientRect();
area.style.setProperty('--x', (e.clientX - rect.left) + 'px');
area.style.setProperty('--y', (e.clientY - rect.top) + 'px');
});
});
})();CSS
.nuda-cur2-comet-tail {
--x: 110px;
--y: 60px;
position: relative;
width: 100%;
max-width: 220px;
height: 120px;
margin: 0 auto;
border-radius: 12px;
background: #0a0a0a;
border: 1px solid rgba(255,255,255,.08);
overflow: hidden;
}
.nuda-cur2-comet-tail__glow {
position: absolute;
top: 0;
left: 0;
width: 36px;
height: 36px;
border-radius: 50%;
background: radial-gradient(circle,rgba(228,255,84,.35),transparent 70%);
filter: blur(4px);
transform: translate(var(--x),var(--y)) translate(-50%,-50%);
transition: transform .9s cubic-bezier(.16,1,.3,1);
pointer-events: none;
}
.nuda-cur2-comet-tail__head {
position: absolute;
top: 0;
left: 0;
width: 10px;
height: 10px;
border-radius: 50%;
background: #e4ff54;
box-shadow: 0 0 10px 2px rgba(228,255,84,.7);
transform: translate(var(--x),var(--y)) translate(-50%,-50%);
transition: transform .35s cubic-bezier(.16,1,.3,1);
pointer-events: none;
}
.nuda-cur2-comet-tail__label {
position: absolute;
bottom: 8px;
left: 0;
right: 0;
text-align: center;
color: #777;
font-size: 11px;
pointer-events: none;
}
@media (prefers-reduced-motion:reduce) {
.nuda-cur2-comet-tail__glow,.nuda-cur2-comet-tail__head {
transition: none;
}
}
How to use Comet Tail
Paste the HTML where you need it and the CSS into a global stylesheet (or a <style> tag). Every class is prefixed nuda- so it never collides with Tailwind or your own styles. Tweak the CSS custom properties to match your design system.
Works in React, Vue, Svelte, Astro, Next.js, Nuxt, Laravel Blade, Django, Rails — or a single .html file. No npm install, no build step.