Skip to main content
rule CX Codex

depth-of-field-blur — Claude Code rule: what it does, how to install

depth-of-field-blur is a Claude Code rule for selective focus in GSAP scenes: one layer stays crisp while the others blur and dim. It brings attention to the main element in a frame.

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/depth-of-field-blur.md
Open on GitHub

What depth-of-field-blur does

This rule covers one move for GSAP scenes: keep a single focal layer crisp while the layers around it go soft. Blur lives in a --dof CSS variable read by filter: blur(var(--dof)); a timeline drives that value from 0 to a target radius and dims opacity at the same time. The focal layer stays at zero.

Three mechanics share the primitive: a single focal pull, a rack focus between two planes, and a cluster blur running alongside a camera push-in. Each layer derives its radius from data-depth, so every seek renders the same frame.

GSAP 3.14.2 loads from a CDN tag: without that script there is no timeline to build. Swapping the tween for a CSS transition breaks frame-accurate rendering, because the renderer can no longer land on an arbitrary frame.

What it helps with

  • pull attention to one element by softening everything else
  • rack focus from a foreground plane to a background one
  • blur a cluster of cards while the camera pushes toward the hero
  • build an animation that renders identically on any frame
  • dim secondary labels without removing them from the frame

Example prompts for the agent

  • Add a focal pull to dof-scene: blur the context layers, keep the focal one sharp.
  • Rack focus from #planeA to #planeB on the same timeline.
  • Blur the cluster around the core while the camera pushes in on #world.

How to install depth-of-field-blur

Manually: put the files in place

.claude/rules/depth-of-field-blur.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 depth-of-field-blur

How do I install depth-of-field-blur in Claude Code?

Copy the rule file into your project at .claude/rules/depth-of-field-blur.md. Claude Code then reads it as a rule.

What does depth-of-field-blur do?

It sets up selective focus: the focal layer stays sharp, nearby layers take blur through --dof plus a slight dim. Three variants ship with it: focal pull, rack focus, and cluster blur during a push-in.

What has to be in place for it to work?

GSAP 3.14.2 loaded on the page, and data-depth on the layers you blur since the radius scales from it. Blur has to be tweened, not handed to a CSS transition.

Similar IDE rules

All IDE rules for Design →

From the same set101

The whole set →
spring-pop-entrance The spring-pop-entrance rule describes a smooth scale-in for one element or a staggered group. Use it for interface elements that should arrive on screen without bouncing. CX Codex +1 ★ 78,316repo stars depth-scatter-assemble depth-scatter-assemble — a rule for scenes where glyphs, cards or logo pieces arrive out of a turning 3D cloud and land in a flat layout. The reverse also works. CX Codex +1 ★ 78,316repo stars ambient-glow-bloom ambient-glow-bloom defines code patterns for soft backdrop glow and light sweeps on key elements. Guides code assistants to write seek-safe GSAP timelines without infinite loops. CX Codex +1 ★ 78,316repo stars music-to-video music-to-video turns a music track into a beat-synced HyperFrames video. Use it for lyric-style clips, slideshows, or kinetic promo visuals with optional media. CX Codex +1 ★ 78,316repo stars client-tools client-tools configures webhook and client-side actions for conversational voice agents, connecting them to external APIs and browser scripts. CX Codex ★ 78,316repo stars hyperframes This skill routes video and motion requests through HyperFrames, which renders compositions from HTML. Use it for editing, animation, captions, and finished video. CX Codex +1 ★ 78,316repo stars seedance-2-0 Wires ByteDance Seedance 2.0 into OpenMontage so the agent can produce clips with built-in sound, several cuts and directed camera moves. CX Codex +1 ★ 78,316repo stars motion-blur-streak motion-blur-streak emulates directional motion blur on sudden fly-ins or camera pushes. Smear fades right at the settle, so the item snaps into place completely sharp. CX Codex +1 ★ 78,316repo stars

Project sponsors

Companies that keep this analytics open