camera-cursor-tracking — Claude Code rule
The camera-cursor-tracking rule keeps a growing text element in view with a two-stage virtual camera. Use it for search fields, animated URLs, and similar scenes.
AGPL-3.0 ★ 78,316 updated 2026-10-24
.claude/rules/camera-cursor-tracking.mdWhat camera-cursor-tracking does
The rule separates the full element from the visible viewport. During the first phase, the world stays at its starting offset while text is revealed. Once the focal point passes the chosen screen position, the world moves left so the cursor, highlight, or latest glyph remains anchored in view.
The implementation guidance covers HTML, CSS, and a paused GSAP timeline. Text reveal uses a max-width tween, camera motion uses a translated .world, and cursor blinking uses a finite GSAP yoyo sequence rather than a CSS keyframe. VIEWPORT_PAD_LEFT must match the .viewport padding, or the camera position calculation will drift.
What it helps with
- keep expanding text inside the viewport
- switch from a static camera to focal-point tracking
- pin a cursor or highlight to a screen position
- drive deterministic cursor blinking from GSAP
Example prompts for the agent
- Apply the
camera-cursor-trackingrule to a scene that reveals a search query over time. - Build
tracking-sceneso tracking starts when the cursor crossesCURSOR_TARGET_FRACTION. - Review the GSAP timeline and replace CSS cursor blinking with the finite timeline tween.
How to install camera-cursor-tracking
Manually: put the files in place
.claude/rules/camera-cursor-tracking.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/camera-cursor-tracking.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.github/instructions/camera-cursor-tracking.instructions.mdThe applyTo field sets which files it applies to
Manually: put the files in place
.devin/rules/camera-cursor-tracking.mdManually: put the files in place
.clinerules/camera-cursor-tracking.mdStep by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use
Questions about camera-cursor-tracking
How do I install camera-cursor-tracking in Claude Code?
Create the rule file at .claude/rules/camera-cursor-tracking.md.
What does camera-cursor-tracking do?
It defines a two-stage virtual camera: the scene begins at a fixed offset, then the world shifts to keep a moving focal point in the viewport.
Which platforms support camera-cursor-tracking?
The rule is listed for Claude Code and Codex.