Skip to main content
rule CX Codex

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

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/rules/camera-cursor-tracking.md
Open on GitHub

What 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-tracking rule to a scene that reveals a search query over time.
  • Build tracking-scene so tracking starts when the cursor crosses CURSOR_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.md

The paths frontmatter field limits the files

Step 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.

Similar IDE rules

All IDE rules for Frontend and UI →

From the same set101

The whole set →
press-release-spring press-release-spring calculates tactile button animation with linear scaling on tap, GSAP spring bounce on release, and glowing visual cues. Useful when polishing UI interactions. CX Codex +1 ★ 78,316repo stars card-morph-anchor The card-morph-anchor rule describes a container that changes shape as one scene gives way to another. Use it when the morph itself should carry the transition. CX Codex +1 ★ 78,316repo stars svg-icon-enrichment svg-icon-enrichment — a rule that teaches Claude Code and Codex to animate the inner parts of SVG icons: clock hands, scissor blades, pulsing dots, flowing dashes. For micro-animation without swapping the icons themselves. CX Codex +1 ★ 78,316repo stars physics-press-reaction physics-press-reaction synchronizes cursor and element compression in GSAP using shared spring scaling. Controls approach trajectory, simultaneous press down, and bouncy release. CX Codex +1 ★ 78,316repo stars seedance-2-5 Skill for generating 4–30 second video clips with ByteDance Seedance 2.5 via fal.ai, Volcengine Ark, Runway, or ComfyUI. CX Codex +1 ★ 78,316repo stars orbit-3d-entry orbit-3d-entry sets up a GSAP animation where items flip in from 3D coordinates and transition into a continuous elliptical orbit around a center point. CX Codex +1 ★ 78,316repo stars motion-graphics motion-graphics is a Claude Code skill that creates short motion-led graphics, from animated headlines and charts to logo stings. For pieces without narration or live-action footage. CX Codex +1 ★ 78,316repo stars sine-wave-loop sine-wave-loop — a GSAP rule that gives a settled scene element light jitter, or one bounded breathing loop, driven by Math.sin once its entry animation ends. CX Codex +1 ★ 78,316repo stars

Project sponsors

Companies that keep this analytics open