No.538 · Text Animations
Second Draft
A sentence written by someone who cares which word comes last. It types with human timing, selects “fast” backwards and deletes it, tries “calm” and strikes it through in pen, then writes “yours” in italics with a flourish beneath.
The prompt
Written for the variant you picked above: Paper
Build a typed headline that revises itself: "We build software that feels fast" → (select "fast" backwards, delete) → "calm" → (strike "calm" through in pen, keep it) → "yours." in italic accent with a flourish underline. Model: the line is a list of segments {text, kind: plain | struck | final} plus a count of characters selected at the end. A cancellable async script (setTimeout promises checked against a stop flag) drives it once the block is 40% in view: type the lead at a human pace (55–110ms per character, +40–100ms after a space, +220ms after punctuation, spaces quicker), type "fast", wait 900ms, grow a system-style selection backwards one letter every 70ms, wait 380ms, delete; a "Draft n of 3" chip advances with each revision. Type "calm", wait 1s, mark it struck: it dims to 42% and a hand-drawn SVG line (non-scaling stroke) is revealed across it left to right with clip-path in 440ms. Then type " yours" 1.7× slower as the final italic accent segment, then ".", and draw a swash under "yours" (900ms). Caret: a thin bar after the last character that is solid while typing and blinks (steps, 1.05s) while it pauses, blinking four times after the end. Newsreader, clamp(2.1rem, 6vw, 4.6rem), min-height so the block never jumps. Replay restarts the script (disabled until it finishes). The animated line is aria-hidden; a visually hidden copy reads "We build software that feels yours." Reduced motion shows the finished line with marks already drawn. Themes: paper (rust pen) and night (amber). Selected variant — Paper (paper): Palette for this theme (Paper): --accent #c2361b; --caret #1d1a16; --ink #1d1a16; --muted rgb(29 26 22 / 0.5); --pen #c2361b; --sel #b9d4fb. Treat these as the root colour tokens, one value per role, and name them to suit your code. Select it with the theme option set to "paper". Keep every dimension, spacing value, state and motion from the brief unchanged, and keep text at 4.5:1 contrast or better on these surfaces. This selection takes precedence over references to other themes or options in the general brief. Implement this selected appearance; do not add a variant picker or alternative appearances unless requested. Implementation requirements: Use React and TypeScript. Keep the component self-contained, with uniquely scoped CSS and no animation libraries. Include required imports, styles and font setup in the result. Interaction: Plays when scrolled into view; Replay writes it again. Motion: Human-paced typing (55–110ms/char with pauses), 70ms/char backwards selection, 440ms pen strike, 900ms flourish. Accessibility: Screen readers get only the finished sentence; the typing is aria-hidden. It plays once (no loop) and reduced motion shows the final state. Responsive behavior: The line wraps normally, so typing only ever pushes words forward, and it reserves its height, so revisions never shift the layout below. Touch: Not pointer-driven; identical on touch. Preserve keyboard access, visible focus and reduced-motion behavior. Keep fictional demo data and simulated service calls in a separate usage example; expose callbacks for real actions and recover from rejected requests. Keep usage-example links inside the demo: use local buttons or prevent navigation. Demonstration links must not navigate to Vitrine routes or open other pages; preserve real URL support in the reusable component itself. Verify the result at narrow and wide viewport sizes, with keyboard input and reduced motion enabled.
Notes
- Interaction
- Plays when scrolled into view; Replay writes it again.
- Motion
- Human-paced typing (55–110ms/char with pauses), 70ms/char backwards selection, 440ms pen strike, 900ms flourish.
- Accessibility
- Screen readers get only the finished sentence; the typing is aria-hidden. It plays once (no loop) and reduced motion shows the final state.
- Responsive
- The line wraps normally, so typing only ever pushes words forward, and it reserves its height, so revisions never shift the layout below.
- On touch
- Not pointer-driven; identical on touch.