MOVE INSIDE
INTERACTION_012CSS + JS
Custom Cursor
Dot plus trailing ring with contextual labels.
Mouse / MediumView
Fine particles spawn at the pointer and drift away. An empty canvas before the trigger; spawning up to 3 particles per frame with velocity, gravity and fade once pointer movement.
/* Particle Trail — Fine particles spawn at the pointer and drift away. */
.particle-trail {
--dur: 900ms;
--ease: cubic-bezier(0.22, 1, 0.36, 1);
--stagger: 60ms;
will-change: transform, opacity;
}
.particle-trail > * {
opacity: 0;
transform: translateY(14px);
animation: particle-trail-in var(--dur) var(--ease) forwards;
animation-delay: calc(var(--i, 0) * var(--stagger));
}
/* an empty canvas -> spawning up to 3 particles per frame with velocity, gravity and fade */
@keyframes particle-trail-in {
to {
opacity: 1;
transform: none;
filter: none;
}
}
@media (prefers-reduced-motion: reduce) {
.particle-trail > * {
opacity: 1;
transform: none;
animation: none;
}
}import { useEffect, useRef } from "react";
/** Particle Trail — trigger: pointer movement */
export function ParticleTrail({ children }: { children: React.ReactNode }) {
const ref = useRef<HTMLDivElement>(null);
useEffect(() => {
const el = ref.current;
if (!el) return;
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
el.dataset["state"] = "in";
return;
}
const io = new IntersectionObserver(
([entry]) => {
if (entry?.isIntersecting) {
el.dataset["state"] = "in";
io.unobserve(el);
}
},
{ threshold: 0.2 },
);
io.observe(el);
return () => io.disconnect();
}, []);
return (
<div ref={ref} className="particle-trail" data-state="out">
{children}
</div>
);
}Dot plus trailing ring with contextual labels.
A short trail of fading dots follows the pointer.
Type bends slightly toward the pointer as it passes.
Large ambient light that trails the pointer across a section.