No.296 · Text Animations
Extrude
Poster letters with real depth: every letter is a stack of thin slices darkening toward the back, so turning the word shows solid sides. It sways on its own, turns to face the pointer on a spring, and pops its letters forward one by one when clicked.
The prompt
Written for the variant you picked above: Tomato
Build a 3D extruded word ("MUSCAT", Hanken Grotesk 900, clamp(4rem, 17vw, 12.5rem), uppercase, tight tracking) inside a button. Geometry: each letter is an inline-block with transform-style: preserve-3d containing 28 absolutely positioned copies (slices) at translateZ(−t × 0.34em) for t = 0…1, coloured color-mix(in oklab, sideNear, sideFar t%), plus a front face at translateZ(0.5px) filled with a 170° gradient (highlight → face) via background-clip:text. The word sits in a sway wrapper (CSS: rotateY −16° ↔ 16°, rotateX 8° ↔ 2°, 7s alternate) and an inner turn wrapper whose rotation follows the pointer on a spring (k 120, ζ 0.62, up to ±30° Y and ±22° X) in a rAF loop that stops when settled; the sway pauses while the pointer is over it. perspective 900px on the button (the parent of the 3D tree). A blurred elliptical floor shadow slides opposite the turn. Click or Enter: each letter animates (WAAPI) translateZ(0.5em) translateY(−0.08em) and back with a small overshoot, 720ms, 70ms apart. A visually hidden h2 carries the word; the 3D spans are aria-hidden; the button is labelled. Reduced motion: a fixed three-quarter angle, no sway, spring or pop. Selected variant — Tomato: palette="tomato": face #ff5a36 with highlight #ff8a5c, sides #d93a1c → #6e1606, on a cream page (#f3ead8).
Notes
- Interaction
- Move the pointer to turn the word; click or press Enter to pop the letters.
- Motion
- Pointer spring (k 120, ζ 0.62); 7s CSS sway; pop 720ms with 70ms stagger.
- Accessibility
- A visually hidden heading carries the word and the 3D layers are aria-hidden; the pop is a real button with a label and a focus ring. Reduced motion holds a fixed angle.
- Responsive
- Font size is fluid (17vw), so the word always fits one line.
- On touch
- Tap pops the letters; dragging turns it.