When to Use
- Use when: adding transitions, hover states, or interactive feedback
- Use when: animations feel mechanical, too slow, or jarring
- Use when: implementing skeleton loading choreography
- Do NOT use for: Three.js / GSAP / Lottie — those are animation library decisions
- Do NOT use for: page-level routing transitions — use
aesthetic-anchor motion tokens there
Duration Scale
| Name |
Range |
Use |
| Instant |
0ms |
Hover color, cursor change — never animate |
| Micro |
100–150ms |
Button press, checkbox toggle, ripple |
| Small |
150–250ms |
Tooltip appear, dropdown open, fade |
| Medium |
250–400ms |
Panel slide, card expand |
| Large |
400–600ms |
Modal + backdrop, page transition |
| Celebration |
600–1000ms |
Onboarding, success milestone — use sparingly |
Rules:
- Under 100ms → no animation needed, instant change
- User-initiated actions: 150–300ms
- System-initiated changes: 200–500ms
- Mobile: 30% shorter than desktop equivalents
- Never exceed 1000ms in a regular workflow
Easing Curves
:root {
/* Entering screen — fast start, decelerate to rest */
--ease-out: cubic-bezier(0.0, 0.0, 0.2, 1.0);
/* Leaving screen — accelerate then exit */
--ease-in: cubic-bezier(0.4, 0.0, 1.0, 1.0);
/* On-screen state change — smooth bidirectional */
--ease-inout: cubic-bezier(0.4, 0.0, 0.2, 1.0);
}
Never use linear for UI motion — it feels mechanical.
Exceptions only: infinite loaders, color interpolation.
Spring physics (JS): stiffness: 170 / damping: 26 / mass: 1 — for playful bounce.
Micro-Interaction Patterns
Button
/* Press */
button:active { transform: scale(0.97); transition: transform 80ms var(--ease-in); }
/* Release */
button { transition: transform 200ms var(--ease-out); }
/* Loading state: swap label for inline spinner — no layout shift */
/* Success: color → green + checkmark, 300ms */
/* Disabled: opacity 0.5, remove all hover states */
Form field
Focus: border-color transition 150ms --ease-inout
Success: green border + checkmark fade-in 200ms
Error: red border + horizontal shake (±3px, 3 cycles, 300ms) + error text slide-down
Toast / Notification
Enter: slide from edge + fade-in, 300ms --ease-out
Persist: success = 3–5s, error = persistent (user must dismiss)
Exit: fade + vertical slide, 200ms --ease-in
Stack: 50ms stagger between simultaneous toasts
Modal
Backdrop: opacity 0 → 0.5, 200ms
Dialog: scale 0.95 → 1.0 + fade-in, 250ms --ease-out
Dismiss: reverse with --ease-in
Emotional Motion Vocabulary
| Mood |
Curve |
Duration |
| Confident |
ease-out |
200–250ms |
| Playful |
spring / slight overshoot |
300–400ms |
| Urgent |
ease-in, sharp |
100–150ms |
| Calm |
ease-in-out, gentle |
300–500ms |
| Celebratory |
particles / radial burst |
600–1000ms, once only |
Reduced Motion (Accessibility Required)
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
scroll-behavior: auto !important;
}
}
Replace, don't remove:
- Slide → instant appear or opacity fade
- Bounce/spin → static indicator
- Parallax → fixed background
- Keep: progress bars and functional loaders (simplify only)
Anti-Fake-Pass Rules
Before claiming motion is done, you MUST show:
Reference: gates/anti-fake-pass-gate.md
1---
2name: motion-design
3description: >
4 Design motion and animation for UI — duration timing, easing curves,
5 micro-interaction patterns (button, form, toast, modal), and reduced-motion
6 accessibility. Use when asked to "add animation", "make it feel alive",
7 "micro-interactions", "transition", or "something feels janky/mechanical".
8 Do NOT use for 3D or canvas animation — this covers UI-layer motion only.
9origin: adapted:ux-ui-mastery
10license: MIT © phazurlabs
11version: 1.0.0
12compatibility: "Any CSS/JS frontend. Outputs CSS variables + cubic-bezier values."
13metadata:
14 source: https://skillmd.com/skills/yanacuti1121/motion-design
15---
16
17<!-- Adapted from phazurlabs/ux-ui-mastery (MIT) — Interaction & Motion Design skill.
18 Duration table, easing curves, micro-interaction patterns, reduced-motion section.
19 YAMTAM structure, Anti-Fake-Pass section, and CSS output format are original. -->
20
21## When to Use
22
23- Use when: adding transitions, hover states, or interactive feedback
24- Use when: animations feel mechanical, too slow, or jarring
25- Use when: implementing skeleton loading choreography
26- Do NOT use for: Three.js / GSAP / Lottie — those are animation library decisions
27- Do NOT use for: page-level routing transitions — use `aesthetic-anchor` motion tokens there
28
29---
30
31## Duration Scale
32
33| Name | Range | Use |
34|---|---|---|
35| Instant | 0ms | Hover color, cursor change — never animate |
36| Micro | 100–150ms | Button press, checkbox toggle, ripple |
37| Small | 150–250ms | Tooltip appear, dropdown open, fade |
38| Medium | 250–400ms | Panel slide, card expand |
39| Large | 400–600ms | Modal + backdrop, page transition |
40| Celebration | 600–1000ms | Onboarding, success milestone — use sparingly |
41
42**Rules:**
43- Under 100ms → no animation needed, instant change
44- User-initiated actions: 150–300ms
45- System-initiated changes: 200–500ms
46- Mobile: 30% shorter than desktop equivalents
47- Never exceed 1000ms in a regular workflow
48
49---
50
51## Easing Curves
52
53```css
54:root {
55 /* Entering screen — fast start, decelerate to rest */
56 --ease-out: cubic-bezier(0.0, 0.0, 0.2, 1.0);
57
58 /* Leaving screen — accelerate then exit */
59 --ease-in: cubic-bezier(0.4, 0.0, 1.0, 1.0);
60
61 /* On-screen state change — smooth bidirectional */
62 --ease-inout: cubic-bezier(0.4, 0.0, 0.2, 1.0);
63}
64```
65
66**Never use `linear` for UI motion** — it feels mechanical.
67Exceptions only: infinite loaders, color interpolation.
68
69Spring physics (JS): `stiffness: 170 / damping: 26 / mass: 1` — for playful bounce.
70
71---
72
73## Micro-Interaction Patterns
74
75### Button
76```css
77/* Press */
78button:active { transform: scale(0.97); transition: transform 80ms var(--ease-in); }
79/* Release */
80button { transition: transform 200ms var(--ease-out); }
81/* Loading state: swap label for inline spinner — no layout shift */
82/* Success: color → green + checkmark, 300ms */
83/* Disabled: opacity 0.5, remove all hover states */
84```
85
86### Form field
87```
88Focus: border-color transition 150ms --ease-inout
89Success: green border + checkmark fade-in 200ms
90Error: red border + horizontal shake (±3px, 3 cycles, 300ms) + error text slide-down
91```
92
93### Toast / Notification
94```
95Enter: slide from edge + fade-in, 300ms --ease-out
96Persist: success = 3–5s, error = persistent (user must dismiss)
97Exit: fade + vertical slide, 200ms --ease-in
98Stack: 50ms stagger between simultaneous toasts
99```
100
101### Modal
102```
103Backdrop: opacity 0 → 0.5, 200ms
104Dialog: scale 0.95 → 1.0 + fade-in, 250ms --ease-out
105Dismiss: reverse with --ease-in
106```
107
108---
109
110## Emotional Motion Vocabulary
111
112| Mood | Curve | Duration |
113|---|---|---|
114| Confident | ease-out | 200–250ms |
115| Playful | spring / slight overshoot | 300–400ms |
116| Urgent | ease-in, sharp | 100–150ms |
117| Calm | ease-in-out, gentle | 300–500ms |
118| Celebratory | particles / radial burst | 600–1000ms, once only |
119
120---
121
122## Reduced Motion (Accessibility Required)
123
124```css
125@media (prefers-reduced-motion: reduce) {
126 *, *::before, *::after {
127 animation-duration: 0.01ms !important;
128 animation-iteration-count: 1 !important;
129 transition-duration: 0.01ms !important;
130 scroll-behavior: auto !important;
131 }
132}
133```
134
135**Replace, don't remove:**
136- Slide → instant appear or opacity fade
137- Bounce/spin → static indicator
138- Parallax → fixed background
139- Keep: progress bars and functional loaders (simplify only)
140
141---
142
143## Anti-Fake-Pass Rules
144
145Before claiming motion is done, you MUST show:
146- [ ] Duration specified for every animated element (ms value, not "fast"/"slow")
147- [ ] Easing curve used — no `linear` without justification
148- [ ] `prefers-reduced-motion` override present in CSS
149- [ ] No animation exceeds 1000ms in a regular workflow path
150
151Reference: `gates/anti-fake-pass-gate.md`