multi-phase-camera — Claude Code rule: phased cinematic camera zoom
multi-phase-camera — a rule for animated web scenes: the camera moves through 2-3 zoom phases (pull-back, focus, push) with continuous micro-drift on top. For when a single linear zoom feels mechanical.
AGPL-3.0 ★ 78,316 updated 2026-10-24
.claude/rules/multi-phase-camera.mdWhat multi-phase-camera does
The rule lays out a camera wrapper around the whole scene: one div whose transform: scale() translate(x, y) is driven by a GSAP timeline. Instead of one linear move, the zoom is split into phases that fire at scripted times. The result is a rhythm of anticipation, reveal, settle.
Inside you get the scene HTML, CSS for .scene and .camera, and a ready GSAP timeline. Scale advances stepwise through a phase object, and a sine-based drift adds small translate offsets on X and Y. The drift is invisible frame to frame but keeps the shot alive between phases. The timeline is paused and registered in window.__timelines so frame seeks stay deterministic.
Values are chosen by hand: three phase scales, timings, drift amplitude. One constraint matters — if PHASE_1_SCALE sits below 1, .scene must have overflow: hidden, or content edges leak outside the frame. You need GSAP 3.14.2 from a CDN and a sense of how the camera phases line up with content reveal beats.
What it helps with
- Split camera zoom into 2-3 phases instead of one linear move
- Add continuous micro-drift so the camera never feels static
- Tune timings and easing for each phase
- Sequence content reveals inside the camera frame
- Get a deterministic timeline for frame-by-frame seeking
Example prompts for the agent
- Build a scene using the multi-phase-camera rule: pull-back, focus, push
- Add camera drift with DRIFT_AMP_X 4 and DRIFT_CYCLES 2
- Set the phases so HERO_AT fires after the transition to PHASE_2_SCALE
How to install multi-phase-camera
Manually: put the files in place
.claude/rules/multi-phase-camera.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/multi-phase-camera.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.github/instructions/multi-phase-camera.instructions.mdThe applyTo field sets which files it applies to
Manually: put the files in place
.devin/rules/multi-phase-camera.mdManually: put the files in place
.clinerules/multi-phase-camera.mdStep by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use
Questions about multi-phase-camera
How do I install multi-phase-camera in Claude Code?
Copy the rule file to .claude/rules/multi-phase-camera.md. The agent will pick it up when working on camera-driven scenes.
What does multi-phase-camera do?
It defines a camera wrapper with phased zoom: pull-back, focus, push. A sine-based micro-drift on X and Y runs on top so the frame does not sit still between phases.
What does the rule need to work?
GSAP 3.14.2 from a CDN. Phase scales and timings are set manually — the rule gives ranges and constraints, for example PHASE_3_AT cannot start before phase two ends.