motion-one — скилл для Claude Code: 12 принципов анимации на Motion
Скилл показывает, как собрать 12 принципов анимации Диснея на библиотеке Motion One — от squash and stretch до stagger и scroll.
npx skills add dylantarre/animation-principles --skill motion-one -a claude-codeЧто делает motion-one
Внутри — готовые сниппеты на JavaScript для каждого принципа: squash and stretch через scaleX и scaleY, anticipation и follow through на timeline(), дуги через offsetDistance, преувеличение через spring() с перелётом. Всё построено на функциях Motion One: animate(), timeline(), stagger(), spring(), scroll(), inView(). Библиотека оборачивает Web Animations API, поэтому анимации уходят на аппаратное ускорение.
Скилл пригодится, когда интерфейсу нужны живые переходы, а не резкие сдвиги блоков. Отдельные разделы закрывают stagger для списков, параллакс при скролле и появление секций через inView(). Примеры даны как код, который можно переносить в проект почти без правок.
Учтите: в сниппетах импорт идёт из пакета motion, так что его нужно поставить в проект. Для объёмных трансформаций вроде rotateX и rotateY перспектива задаётся в CSS — без неё поворот выглядит плоским.
Какие задачи решает
- сделать прыжок персонажа с оттяжкой перед движением
- запустить волну появления элементов списка с задержкой
- привязать параллакс фона к прокрутке страницы
- оживить карточку при наведении курсора
- добавить пружинную отдачу вместо линейного easing
Примеры запросов агенту
- покажи, как сделать squash and stretch для мяча на Motion One
- собери timeline с follow through для волос и плаща персонажа
- сделай stagger-появление карточек при попадании секции в вид
Как установить motion-one
1Через Skills CLI (Vercel)
npx skills add dylantarre/animation-principles --skill motion-one -a claude-code2Вручную: положить файлы
~/.claude/skills/motion-one/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/motion-one/
1Через Skills CLI (Vercel)
npx skills add dylantarre/animation-principles --skill motion-one -a codex2Вручную: положить файлы
.agents/skills/motion-one/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add dylantarre/animation-principles --skill motion-one -a cursor2Вручную: положить файлы
.cursor/skills/motion-one/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install dylantarre/animation-principles motion-one2Вручную: положить файлы
.github/skills/motion-one/SKILL.md1Через Skills CLI (Vercel)
npx skills add dylantarre/animation-principles --skill motion-one -a gemini-cli2Командой платформы
gemini skills install https://github.com/dylantarre/animation-principles --path skills/09-by-tool-framework/motion-oneВручную: положить файлы
.devin/skills/motion-one/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add dylantarre/animation-principles --skill motion-one -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о motion-one
Как установить motion-one в Claude?
Выполните npx skills add dylantarre/animation-principles --skill motion-one -a claude-code. После этого файл скилла окажется по пути ~/.claude/skills/motion-one/SKILL.md.
Что делает motion-one?
Описывает 12 принципов анимации Диснея на примерах кода для Motion One. Агент берёт оттуда готовые вызовы animate(), timeline() и spring().
Какие ещё платформы поддерживаются?
Кроме Claude есть установка для Codex, Cursor, GitHub Copilot, Gemini CLI и OpenCode. Для GitHub Copilot команда другая: gh skill install dylantarre/animation-principles motion-one.
Исходный текст
SKILL.md · MIT
---
name: motion-one
description: Use when implementing Disney's 12 animation principles with Motion One (modern, lightweight animation library)
---
# Motion One Animation Principles
Implement all 12 Disney animation principles using Motion One's performant Web Animations API wrapper.
## 1. Squash and Stretch
```javascript
import { animate } from "motion";
animate(".ball",
{ scaleX: [1, 1.2, 1], scaleY: [1, 0.8, 1] },
{ duration: 0.3, easing: "ease-in-out" }
);
```
## 2. Anticipation
```javascript
import { timeline } from "motion";
timeline([
[".character", { y: 10, scaleY: 0.9 }, { duration: 0.2 }],
[".character", { y: -200 }, { duration: 0.4, easing: "ease-out" }]
]);
```
## 3. Staging
```javascript
animate(".background", { filter: "blur(3px)", opacity: 0.6 });
animate(".hero", { scale: 1.1 });
```
## 4. Straight Ahead / Pose to Pose
```javascript
animate(".element", {
x: [0, 100, 200, 300],
y: [0, -50, 0, -30]
}, { duration: 1 });
```
## 5. Follow Through and Overlapping Action
```javascript
timeline([
[".body", { x: 200 }, { duration: 0.5 }],
[".hair", { x: 200 }, { duration: 0.5, at: "-0.45" }],
[".cape", { x: 200 }, { duration: 0.6, at: "-0.5" }]
]);
```
## 6. Slow In and Slow Out
```javascript
animate(".element", { x: 300 }, {
duration: 0.6,
easing: [0.42, 0, 0.58, 1] // cubic-bezier ease-in-out
});
// Or: "ease-in", "ease-out", "ease-in-out"
// Or spring: { easing: spring({ stiffness: 100, damping: 15 }) }
```
## 7. Arc
```javascript
animate(".ball", {
x: [0, 100, 200],
y: [0, -100, 0]
}, { duration: 1, easing: "ease-in-out" });
// Or with offset path
animate(".element", {
offsetDistance: ["0%", "100%"]
}, { duration: 1 });
// CSS: offset-path: path('M0,100 Q100,0 200,100');
```
## 8. Secondary Action
```javascript
const button = document.querySelector(".button");
button.addEventListener("mouseenter", () => {
animate(button, { scale: 1.05 }, { duration: 0.2 });
animate(".icon", { rotate: 15 }, { duration: 0.15 });
});
```
## 9. Timing
```javascript
import { spring } from "motion";
// Fast snap
animate(".fast", { x: 100 }, { duration: 0.15 });
// Spring physics
animate(".spring", { x: 100 }, {
easing: spring({ stiffness: 300, damping: 20 })
});
// Slow dramatic
animate(".slow", { x: 100 }, { duration: 0.8, easing: "ease-out" });
```
## 10. Exaggeration
```javascript
import { spring } from "motion";
animate(".element", { scale: 1.5, rotate: 720 }, {
easing: spring({ stiffness: 200, damping: 10 }) // overshoot
});
```
## 11. Solid Drawing
```javascript
animate(".box", {
rotateX: 45,
rotateY: 30
}, { duration: 0.5 });
// Set perspective in CSS: perspective: 1000px;
```
## 12. Appeal
```javascript
animate(".card", {
scale: 1.02,
boxShadow: "0 20px 40px rgba(0,0,0,0.2)"
}, { duration: 0.3, easing: "ease-out" });
```
## Stagger Animation
```javascript
import { stagger } from "motion";
animate(".item",
{ opacity: [0, 1], y: [20, 0] },
{ delay: stagger(0.1) }
);
```
## Scroll Animations
```javascript
import { scroll, animate } from "motion";
scroll(
animate(".parallax", { y: [0, 100] }),
{ target: document.querySelector(".container") }
);
```
## In-View Animations
```javascript
import { inView } from "motion";
inView(".section", ({ target }) => {
animate(target, { opacity: 1, y: 0 }, { duration: 0.5 });
});
```
## Key Motion One Features
- `animate()` - Single animation
- `timeline()` - Sequence with `at` positioning
- `stagger()` - Offset delays
- `spring()` - Physics-based easing
- `scroll()` - Scroll-linked animations
- `inView()` - Intersection observer wrapper
- Uses Web Animations API (hardware accelerated)
- Tiny bundle size (~3kb)
© dylantarre · MIT · dylantarre/animation-principles