MOVE INSIDE
INTERACTION_012CSS + JS
Custom Cursor
Dot plus trailing ring with contextual labels.
Mouse / MediumView
Type bends slightly toward the pointer as it passes. Flat, evenly spaced type before the trigger; skewing and offsetting characters by their distance from the pointer once pointer proximity to each character.
/* Cursor Text Distortion — Type bends slightly toward the pointer as it passes. */
.cursor-text-distortion {
--dur: 280ms;
--ease: cubic-bezier(0.22, 1, 0.36, 1);
--stagger: 60ms;
will-change: transform, opacity;
}
.cursor-text-distortion > * {
opacity: 0;
transform: translateY(14px);
animation: cursor-text-distortion-in var(--dur) var(--ease) forwards;
animation-delay: calc(var(--i, 0) * var(--stagger));
}
/* flat, evenly spaced type -> skewing and offsetting characters by their distance from the pointer */
@keyframes cursor-text-distortion-in {
to {
opacity: 1;
transform: none;
filter: none;
}
}
@media (prefers-reduced-motion: reduce) {
.cursor-text-distortion > * {
opacity: 1;
transform: none;
animation: none;
}
}import { useEffect, useRef } from "react";
/** Cursor Text Distortion — trigger: pointer proximity to each character */
export function CursorTextDistortion({ 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="cursor-text-distortion" data-state="out">
{children}
</div>
);
}Dot plus trailing ring with contextual labels.
A contextual word rides with the cursor over interactive areas.
A wide soft light follows the pointer across a dark section.
A small preview image follows the pointer over a list of links.