Skip to main content
rule CX Codex

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

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

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

Similar IDE rules

All IDE rules for Frontend and UI →

From the same set101

The whole set →
animation-groups The animation-groups rule organizes ManimGL animations for parallel, sequential, or staggered playback. Use it when several scene elements need coordinated timing. CX Codex +1 ★ 78,316repo stars transform-animations transform-animations — a rule that teaches Claude Code and Codex how to transform objects in ManimGL — from basic shape morphing to complex function-based transformations. Use it when writing Python animations of mathematical objects. CX Codex +1 ★ 78,316repo stars embedding embedding instructs your coding agent to debug ManimGL scenes interactively via IPython, letting you test object positions and animations without restarting the render. CX Codex +1 ★ 78,316repo stars vertical-spring-ticker vertical-spring-ticker is a rule for Claude Code and Codex that defines a slot-machine vertical ticker with additive GSAP spring physics. Each spring advances the stack one discrete step instead of a smooth scroll. CX Codex +1 ★ 78,316repo stars camera Reference rule for ManimGL CameraFrame controls. Helps write 2D pans, zoom sequences, and 3D view changes without syntax errors. CX Codex +1 ★ 78,316repo stars scale-swap-transition The scale-swap-transition rule describes a morph-like swap between two DOM elements using a shrinking exit and a springy entrance. Use it for UI state changes. CX Codex +1 ★ 78,316repo stars context-sensitive-cursor context-sensitive-cursor — a rule for typewriter scenes where the caret takes its colour and height from whichever segment of the line is being typed. CX Codex +1 ★ 78,316repo stars cursor-click-ripple cursor-click-ripple supplies GSAP timeline specifications for a moving cursor, button press recoil, and expanding ripple waves. CX Codex +1 ★ 78,316repo stars

Project sponsors

Companies that keep this analytics open