# reactive-displacement

reactive-displacement — a transition rule where the incoming card's spring also drives the outgoing card, so the swap reads as a hit.

- 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/reactive-displacement.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/reactive-displacement

## What it does

The rule covers a scene change where one card's arrival knocks the previous card off the stage. A single driver tween runs from 0 to 1 with a `back.out` spring; the incoming card travels in from beyond the edge while the outgoing one slides the other way and fades.

\`VICTIM_FRACTION` sets how much of that driver the exit takes. Between 0.4 and 0.5 the old card is gone before the new one lands, and that gap is what sells the impact; past roughly 0.6 both moves look parallel and the collision idea stops working. Entry length `DRIVER_DUR` sits at 0.6–1.4 s, bounce coefficient `BOUNCE_FACTOR` at 1.2–2.0.

The timeline needs GSAP 3.14.2 loaded from CDN. Markup and styles ship with the rule: two cards, `victim` and `intruder`, with text injected through placeholders such as `{victimHeadline}`. Unlike `scale-swap-transition`, which overlaps two elements with no cause behind it, the exit here is derived from the entry.

## Install

### Claude Code (native platform)

**Manually: put the files in place**
- File: `.claude/rules/reactive-displacement.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/reactive-displacement.mdc` — Frontmatter: description, globs, alwaysApply

### GitHub Copilot

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

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/rules/reactive-displacement.md`

### Cline

**Manually: put the files in place**
- File: `.clinerules/reactive-displacement.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/reactive-displacement.md

## When to use it
- build a card swap that lands like a hit
- derive the outgoing card's exit from the incoming spring
- tune overshoot with a `back.out` coefficient
- place the transition after the previous beat resolves
- drive two motions from one tween in GSAP

## Example prompts
- Build the card swap with the reactive-displacement rule: the new card flies in from the right and knocks the old one to the left.
- Set `VICTIM_FRACTION` near 0.5 so the exit finishes before the incoming card settles.
- Wire the `collide-scene` timeline with one `back.out` spring and placeholders like `{intruderHeadline}`.

## Similar
- [motion-and-storytelling](https://affpapa.org/en/nevibecode/skills/motion-and-storytelling.md) — skill · 1100 installs
- [animate-text](https://affpapa.org/en/nevibecode/skills/animate-text.md) — skill · 2800 installs
- [fixing-motion-performance](https://affpapa.org/en/nevibecode/skills/fixing-motion-performance.md) — skill · 29400 installs
- [emilkowalski-motion](https://affpapa.org/en/nevibecode/skills/emilkowalski-motion.md) — skill · 2500 installs
- [logo-animation](https://affpapa.org/en/nevibecode/skills/logo-animation.md) — skill · 5800 installs
- [animation-designer](https://affpapa.org/en/nevibecode/skills/animation-designer.md) — skill · 1900 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
