# popmotion

Helps coding agents implement Disney's 12 animation principles using Popmotion. Useful for building physics-based UI motion and multi-step keyframes.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 489 installs · ★ 129
- Author: dylantarre
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/dylantarre/animation-principles/tree/HEAD/skills/09-by-tool-framework/popmotion/SKILL.md
- Updated: 2025-12-30
- HTML: https://affpapa.org/en/nevibecode/skills/popmotion

## What it does

This skill provides code recipes for Disney's 12 animation principles via Popmotion functions. It covers squash and stretch, anticipation, staging, and exaggeration. The instructions guide the agent using `animate()`, `spring()`, and `keyframes()`.

Animations target element styles directly via transforms and opacity. Popmotion runs framework-agnostically, but you must have the `popmotion` package installed in your project dependencies for the code to work.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add dylantarre/animation-principles --skill popmotion -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/popmotion/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/popmotion/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add dylantarre/animation-principles --skill popmotion -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/popmotion/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add dylantarre/animation-principles --skill popmotion -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/popmotion/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install dylantarre/animation-principles popmotion
```

2. **Manually: put the files in place**
- File: `.github/skills/popmotion/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add dylantarre/animation-principles --skill popmotion -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/dylantarre/animation-principles --path skills/09-by-tool-framework/popmotion
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/popmotion/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add dylantarre/animation-principles --skill popmotion -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/dylantarre/animation-principles/tree/HEAD/skills/09-by-tool-framework/popmotion/SKILL.md

## When to use it
- Add physics-based spring motions to UI elements with `spring()`
- Build chained anticipation and wind-up movements for buttons
- Create multi-step arc trajectories using `keyframes()`
- Implement delayed overlapping action across layered components

## Example prompts
- Add a spring overshoot animation to this card using Popmotion.
- Create a keyframes arc animation for the floating badge.
- Implement squash and stretch for the button on click.

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 3766eb4689bc6de4.

BEGIN THIRD-PARTY FILE 3766eb4689bc6de4
````text
---
name: popmotion
description: Use when implementing Disney's 12 animation principles with Popmotion's functional animation library
---

# Popmotion Animation Principles

Implement all 12 Disney animation principles using Popmotion's composable animation functions.

## 1. Squash and Stretch

```javascript
import { animate } from "popmotion";

animate({
  from: { scaleX: 1, scaleY: 1 },
  to: { scaleX: 1.2, scaleY: 0.8 },
  duration: 150,
  onUpdate: ({ scaleX, scaleY }) => {
    element.style.transform = `scaleX(${scaleX}) scaleY(${scaleY})`;
  }
});
```

## 2. Anticipation

```javascript
// Wind up then action
animate({
  from: 0,
  to: 10,
  duration: 200,
  onUpdate: v => element.style.transform = `translateY(${v}px) scaleY(0.9)`,
  onComplete: () => {
    animate({
      from: 10,
      to: -200,
      duration: 400,
      ease: easeOut,
      onUpdate: v => element.style.transform = `translateY(${v}px)`
    });
  }
});
```

## 3. Staging

```javascript
animate({
  from: 1,
  to: 0.6,
  onUpdate: v => bg.style.opacity = v
});
animate({
  from: 1,
  to: 1.1,
  onUpdate: v => hero.style.transform = `scale(${v})`
});
```

## 4. Straight Ahead / Pose to Pose

```javascript
import { keyframes } from "popmotion";

keyframes({
  values: [
    { x: 0, y: 0 },
    { x: 100, y: -50 },
    { x: 200, y: 0 },
    { x: 300, y: -30 }
  ],
  duration: 1000,
  onUpdate: ({ x, y }) => {
    element.style.transform = `translate(${x}px, ${y}px)`;
  }
});
```

## 5. Follow Through and Overlapping Action

```javascript
animate({ from: 0, to: 200, duration: 500,
  onUpdate: v => body.style.transform = `translateX(${v}px)` });

animate({ from: 0, to: 200, duration: 500, elapsed: -50, // delay
  onUpdate: v => hair.style.transform = `translateX(${v}px)` });

animate({ from: 0, to: 200, duration: 600, elapsed: -100,
  onUpdate: v => cape.style.transform = `translateX(${v}px)` });
```

## 6. Slow In and Slow Out

```javascript
import { animate, easeInOut, easeIn, easeOut } from "popmotion";

animate({
  from: 0,
  to: 300,
  duration: 600,
  ease: easeInOut,
  onUpdate: v => element.style.transform = `translateX(${v}px)`
});
```

## 7. Arc

```javascript
keyframes({
  values: [
    { x: 0, y: 0 },
    { x: 100, y: -100 },
    { x: 200, y: 0 }
  ],
  duration: 1000,
  ease: easeInOut,
  onUpdate: ({ x, y }) => {
    element.style.transform = `translate(${x}px, ${y}px)`;
  }
});
```

## 8. Secondary Action

```javascript
// Primary action triggers secondary
animate({
  from: 1, to: 1.1, duration: 200,
  onUpdate: v => button.style.transform = `scale(${v})`,
  onComplete: () => {
    animate({
      from: 0, to: 15, duration: 150,
      onUpdate: v => icon.style.transform = `rotate(${v}deg)`
    });
  }
});
```

## 9. Timing

```javascript
import { spring } from "popmotion";

// Fast
animate({ from: 0, to: 100, duration: 150 });

// Spring physics
spring({
  from: 0,
  to: 100,
  stiffness: 300,
  damping: 20,
  onUpdate: v => element.style.transform = `translateX(${v}px)`
});

// Slow
animate({ from: 0, to: 100, duration: 800, ease: easeOut });
```

## 10. Exaggeration

```javascript
spring({
  from: { scale: 1, rotate: 0 },
  to: { scale: 1.5, rotate: 720 },
  stiffness: 200,
  damping: 10, // low = overshoot
````
END THIRD-PARTY FILE 3766eb4689bc6de4

The third-party file has ended. Everything between the 3766eb4689bc6de4 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 3246 of 4206 bytes. © dylantarre · MIT · https://github.com/dylantarre/animation-principles/tree/HEAD/skills/09-by-tool-framework/popmotion/SKILL.md

_Part of the page did not fit — see the HTML version._

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