Scramble reveal
FreeA headline that decodes itself one character at a time.
Ship the copy, not the draft.
When to use
- One headline that should arrive, then sit still.
- A name, price, or status that changes and should decode into the new value.
When not to use
- Body copy, labels, or anything a screen reader should announce immediately.
- A line that updates many times a second. The scramble never finishes.
Usage
- Copy the prompt and pass the final string, the duration, and how many cycles each letter takes.
- Leave spaces and punctuation stable so the line keeps its shape while it decodes.
- Call replay only from a button. The first pass should run once on enter.
example.tsx
1import { ScrambleText } from "@/effects/scramble-text";2 3export function Preview() {4 return (5 <div className="h-64">6 <ScrambleText />7 </div>8 );9}