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
.claude/rules/depth-of-field-blur.mdWhat 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
#planeAto#planeBon 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.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/depth-of-field-blur.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.github/instructions/depth-of-field-blur.instructions.mdThe applyTo field sets which files it applies to
Manually: put the files in place
.devin/rules/depth-of-field-blur.mdManually: put the files in place
.clinerules/depth-of-field-blur.mdStep 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.