Skip to content

No.299 · Text Animations

Loose Letters

A shop sign whose letter tiles hang from a rail on little strings. Brush past and they swing as damped pendulums, nudging their neighbours; a fast swipe spins one right round its pin. Click and they come off their hooks, fall, bounce and tumble — then climb back up and settle.

The prompt

The design brief behind this component — reuse it to regenerate, remix, or explain it.

Build a hanging shop sign ("OPEN LATE") of letter tiles: each tile (0.86em × 1.06em, rounded, a subtle inset edge and two-step shadow, Newsreader 500) hangs 0.3em below a rail on a 1px string with a pin dot; transform-origin is the pin, so rotating a tile swings it on its string. Hanging physics (one rAF loop that sleeps when everything is still): each tile is a damped pendulum, ω' = −38·sin θ − 2.4·ω + 6·(neighbour angles − θ), integrated in two substeps; angles wrap past ±π so a hard push spins a tile all the way round. Pointer moves within an ellipse around a tile add its horizontal pointer speed (px/s ÷ 120) to ω, scaled by how low on the tile the pointer is (more lever) and by proximity. Click (or the Drop button): every tile leaves its hook with its current swing turned into velocity plus random scatter, falls under 2400px/s² gravity, bounces off the floor (restitution 0.32, friction 0.82), topples toward the nearest flat orientation, and is kept inside the walls; strings fade out. When everything is still for 1.3s (or on a second click), tiles climb back to their pins on staggered eased arcs (1.1s), unwinding whole turns the short way, then rehang with a small alternating swing. A Shake button gives keyboard users the push. Themes: paper (cream tiles, ink letters) and night (dark tiles, glowing amber). Reduced motion: a still sign with no controls. The h2 carries the text; tiles are aria-hidden.

Notes

Interaction
Brush across the letters to swing them; click to drop them; click again to hang them back up. Shake and Drop buttons do the same from the keyboard.
Motion
Pendulum spring (ω² 38, damping 2.4, coupling 6); fall at 2400px/s², restitution 0.32; climb 1.1s staggered.
Accessibility
The heading carries the words; the tiles are aria-hidden. Shake and Drop are real buttons. Reduced motion shows a still sign.
Responsive
Words wrap onto separate rows on narrow screens; pins are re-measured on resize.
On touch
Dragging a finger across the letters swings them; tap drops them.

Featured

301 components