Text Animations
Anaglyph
Stereoscopic channel-split type. The real headline stays put, selectable, one announcement to a screen reader, while two aria-hidden copies in opposing ink colors slide against each other under the pointer, and the blend mode resolves their overlap back toward white, so the depth lives entirely in the fringes, exactly as it does on a printed anaglyph. The channels chase the cursor through an exponential lerp written straight to transform, and once the pointer goes quiet a slow bounded-phase sway takes the target over so the split keeps breathing on an idle pane.
Install
# Anaglyph needs no npm packagesThen copy 2 files into your project:
- components/registry/anaglyph/anaglyph.tsx
- hooks/use-animation-loop.ts
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| maxShift | number | 14 | Peak channel separation at the pane edge. |
| response | number | 1 | How much pointer travel converts into separation. |
| lag | number | 0.18 | Chase time constant — the channels arrive after the cursor. |
| sway | number | 0.5 | Idle drift amplitude once the pointer has gone quiet. |
| layers | "two" | "three" | "three" | Two channels split on one axis; three adds a perpendicular half-shift ghost. |
| blend | "screen" | "lighten" | "difference" | "screen" | How the channels composite where they overlap. |
| channelA | string (hex) | "#c4b5fd" | First offset layer. |
| channelB | string (hex) | "#67e8f9" | Opposing offset layer. |
What It Demonstrates
- Hover effect
- Visual change when the cursor moves over an element.
- Translate
- Move an element along the X or Y axis.
- Interpolation / Tween
- Generating all the in-between frames between a start and end value, so motion is continuous.
- Idle animation
- Subtle motion that plays while an element is just sitting there, waiting to be interacted with.
Related Components
Variable Proximity
Text whose letters shift font weight as the cursor gets closer.
Molten
Type that melts. Letters sag under their own weight, string out, and fuse into one surface where they touch, because the glyphs are a coverage field cut by a threshold rather than shapes being moved: two stems raise the coverage between them past the cut and one outline closes over both. The word underneath is a real text node the whole time, so it stays selectable, searchable, and read correctly aloud while it runs.
Neon
A neon sign, with everything that is wrong with a neon sign. Tubes strike one at a time rather than together, each settling at its own moment inside the ignition. The steady state carries a mains hum, and every so often one tube gives up for a third of a second and comes back. The glow is baked once per letter into a sprite, so a frame is a handful of draws no matter how wide the word, and the word itself never stops being a real, selectable text node underneath.
Rime
Hoarfrost taking a word. This is Molten's opposite number, the same idea of type as a coverage field run cold. Crystal tips seeded on the glyph edges creep across the letters, fork at a fixed lattice angle, and die where they run out of glyph or hit ice already there, so the cost tracks the growing edge rather than the area. The text underneath is never redrawn. It stays a real span at its real colour the whole time, which makes the thaw nothing more than fading the ice off type that was always there.
Scramble Text
Ciphered glyphs boiling out of noise and resolving into words. A decode cascade that settles character by character, a hover that re-scrambles on demand, or a continuous low glitch that keeps the type restless, each freshly-resolved letter flashing accent before it cools to ink.
Long Shadow
Text that casts a long shadow sweeping like a sundial through the hours.