gsap-effects — Claude Code rule: GSAP animation patterns for HyperFrames
gsap-effects — a rule with drop-in GSAP patterns for HyperFrames: typewriter text and an audio visualizer driven by the timeline. Useful when the agent renders videos frame by frame with deterministic output.
AGPL-3.0 ★ 78,316 updated 2026-10-24
.claude/rules/gsap-effects.mdWhat gsap-effects does
The rule covers two self-contained effects. Typewriter reveals text character by character, with options for a blinking cursor, backspacing, word rotation, and multi-line handoff. Audio visualizer takes pre-extracted audio data and pushes Canvas or DOM rendering through timeline calls.
Both effects obey a seek-driven contract: every animation is deterministic and the timeline is registered on window.__timelines. No randomness is allowed. The visualizer section warns against Web Audio API at render time because there is no playback when the timeline seeks. Instead, run the bundled Python extractor ahead of time — it needs ffmpeg and numpy. Load the resulting JSON synchronously; an async fetch() would leave the timeline unbuilt when HyperFrames reads it right after page load.
The typewriter part gets into details that break easily. Backspace needs manual substring removal because TextPlugin deletes from the front. A cursor must blink when idle and go solid while typing. Next to static text, use margin-left on a wrapper span rather than flex gap, which would push the cursor away.
What it helps with
- Reveal text character by character with a blinking cursor
- Drive an audio visualizer from the timeline without Web Audio API
- Extract RMS and frequency bands from mp3 or mp4 files
- Build a deterministic timeline that survives seeking
- Hand a cursor off between typewriter lines
Example prompts for the agent
- Add a typewriter effect with a blinking cursor to this HyperFrames scene
- Set up word rotation with typing, holding, backspacing, and the next word
- Extract audio data from video.mp4 and hook a Canvas visualizer into the timeline
How to install gsap-effects
Manually: put the files in place
.claude/rules/gsap-effects.mdThe paths frontmatter field limits the files
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.cursor/rules/gsap-effects.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.github/instructions/gsap-effects.instructions.mdThe applyTo field sets which files it applies to
Manually: put the files in place
.devin/rules/gsap-effects.mdManually: put the files in place
.clinerules/gsap-effects.mdStep by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use
Questions about gsap-effects
How do I install gsap-effects in Claude Code?
Put the rule into .claude/rules/gsap-effects.md in your project. The agent picks it up on the next run.
What does gsap-effects do?
It supplies ready-made GSAP animation patterns that fit the HyperFrames seek-driven contract. The main trap is breaking determinism: async data loading or random values in animations stop the timeline from seeking correctly.
What does the audio visualizer need?
Python with numpy and ffmpeg in your PATH. The script extract-audio-data.py turns an audio or video file into JSON that the page then loads synchronously.