# discrete-text-sequence

discrete-text-sequence — a rule for GSAP scenes where the terminal line swaps whole states instead of typing evenly: typos, backspaces, pasted chunks and holds.

- rule · `type=rule` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline · ★ 78316 repo stars
- Author: calesthio
- License: AGPL-3.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/calesthio/OpenMontage/tree/HEAD/.agents/skills/hyperframes-animation/rules/discrete-text-sequence.md
- Updated: 2026-10-24
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/rules/discrete-text-sequence

## What it does

Instead of revealing characters one at a time, this scene swaps whole strings. States sit in a `SEQUENCE` array of `{ text, t }` entries measured in seconds; each update walks the array backwards and paints the newest entry whose time has elapsed. Typos, deletions, pasted chunks and holds all fall out of that. Nothing tweens between states — the line jumps.

The file carries terminal markup with a `$` prompt, a `.text` node and a cursor, plus CSS and a GSAP timeline built with `paused: true`. A tween running from 0 to `TOTAL_DURATION` with `ease: "none"` advances a counter, and its `onUpdate` writes `textContent`. Cursor blinking is computed with `Math.sin`, so it stays tied to the timeline. Variants at the bottom: plain per-character typing, a hold that reads as thinking, a scale pulse, and colour shifts per phase.

Timestamps must rise, and `TOTAL_DURATION` has to cover `T_DONE` with roughly a second to spare, or the final check mark never registers. Give `.text-wrap` a width at least as wide as the longest state at your `TERMINAL_FONT_SIZE`; a smaller `TEXT_WRAP_MIN_WIDTH` makes the right edge shudder on every swap. Monospace only. GSAP loads from a CDN script.

## Requirements
- Works with: Linear

## Install

### Claude Code (native platform)

**Manually: put the files in place**
- File: `.claude/rules/discrete-text-sequence.md` — The paths frontmatter field limits the files

### Codex

**AGENTS.md**
- Codex reads AGENTS.md: paste the rule text there

### Cursor

**Manually: put the files in place**
- File: `.cursor/rules/discrete-text-sequence.mdc` — Frontmatter: description, globs, alwaysApply

### GitHub Copilot

**Manually: put the files in place**
- File: `.github/instructions/discrete-text-sequence.instructions.md` — The applyTo field sets which files it applies to

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/rules/discrete-text-sequence.md`

### Cline

**Manually: put the files in place**
- File: `.clinerules/discrete-text-sequence.md`

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/calesthio/OpenMontage/tree/HEAD/.agents/skills/hyperframes-animation/rules/discrete-text-sequence.md

## When to use it
- build a terminal scene where a typo gets corrected on screen
- paste a chunk of text in one jump
- insert a thinking pause mid-sentence
- blink the cursor in sync with the render timeline
- highlight the finished line with a colour change and pulse

## Example prompts
- Make a terminal scene that types in jumps from a `SEQUENCE` array and ends with a check mark.
- Add a hold at `THINK_HOLD_DUR` before the phrase continues.
- Set a monospace font and size `TEXT_WRAP_MIN_WIDTH` to the longest state so the right edge stops moving.

## Similar
- [animation-systems](https://affpapa.org/en/nevibecode/skills/animation-systems.md) — skill · 2400 installs
- [animate-text](https://affpapa.org/en/nevibecode/skills/animate-text.md) — skill · 2800 installs
- [gradient-text-sweep](https://affpapa.org/en/nevibecode/rules/gradient-text-sweep.md) — rule · ★ 328 repo stars
- [frost-sequence-camera-orbit](https://affpapa.org/en/nevibecode/skills/frost-sequence-camera-orbit.md) — skill · 13300 installs
- [motion](https://affpapa.org/en/nevibecode/skills/motiondivision-motion.md) — skill · 1400 installs
- [svg-animation](https://affpapa.org/en/nevibecode/skills/svg-animation.md) — skill · 4400 installs

From the same set: [calesthio/openmontage](https://affpapa.org/en/nevibecode/by/calesthio/openmontage.md) — 101 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
