# depth-of-field-blur

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.

- rule · `type=rule` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline · ★ 78316 repo stars
- Author: calesthio
- License: AGPL-3.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/calesthio/OpenMontage/tree/HEAD/.agents/skills/hyperframes-animation/rules/depth-of-field-blur.md
- Updated: 2026-10-24
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/rules/depth-of-field-blur

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

## Install

### Claude Code (native platform)

**Manually: put the files in place**
- File: `.claude/rules/depth-of-field-blur.md` — The paths frontmatter field limits the files

### Codex

**AGENTS.md**
- Codex reads AGENTS.md: paste the rule text there

### Cursor

**Manually: put the files in place**
- File: `.cursor/rules/depth-of-field-blur.mdc` — Frontmatter: description, globs, alwaysApply

### GitHub Copilot

**Manually: put the files in place**
- File: `.github/instructions/depth-of-field-blur.instructions.md` — The applyTo field sets which files it applies to

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/rules/depth-of-field-blur.md`

### Cline

**Manually: put the files in place**
- File: `.clinerules/depth-of-field-blur.md`

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/calesthio/OpenMontage/tree/HEAD/.agents/skills/hyperframes-animation/rules/depth-of-field-blur.md

## When to use it
- 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
- 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`.

## Similar
- [progressive-blur](https://affpapa.org/en/nevibecode/skills/progressive-blur.md) — skill · 2100 installs
- [progressive-blur-header-swiftui](https://affpapa.org/en/nevibecode/skills/progressive-blur-header-swiftui.md) — skill · 500 installs
- [svg-animation](https://affpapa.org/en/nevibecode/skills/svg-animation.md) — skill · 4400 installs
- [accessible-animation](https://affpapa.org/en/nevibecode/skills/accessible-animation.md) — skill · 4400 installs
- [modern-web-design](https://affpapa.org/en/nevibecode/skills/modern-web-design.md) — skill · 3200 installs
- [animate-text](https://affpapa.org/en/nevibecode/skills/animate-text.md) — skill · 2800 installs

From the same set: [calesthio/openmontage](https://affpapa.org/en/nevibecode/by/calesthio/openmontage.md) — 101 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
