Universal Patterns

dylantarre/animation-principles/skills/05-by-animation-type/universal-patterns

作者 dylantarre83597134ba8f無授權條款99 個星標收錄於 2026年10月8日更新於 2026年10月8日儲存庫9 個月前更新

Use when creating any animation type - provides foundational timing, easing, and principle application that applies to all motion in interfaces.

僅含說明Design & Creative
AI 產生的概覽

為介面動效提供基礎時長、緩動以及迪士尼十二動畫原則。

功能
提供動畫時長分級、CSS 緩動變數、基礎進場/出場/狀態轉換類別,以及選擇動效參數的決策樹。也列出通用規則,例如回應時間、時長上限、適合 GPU 的屬性,以及減少動態效果的無障礙預設設定。產出的是指引與 CSS 片段,而非執行程式碼。
適用情境
在為介面加入或檢視動效,並需要一致的時長、緩動與原則套用預設值時使用。適用於各類動畫,從滑鼠移入、切換到頁面轉場與揭示效果。
執行需求
除智慧代理外無需其他條件;僅為說明性內容,不含指令碼或外部工具。

Universal Animation Patterns

Apply Disney's 12 principles as baseline defaults for any animation.

Core Timing Scale

CategoryDurationUse For
Instant100-150msHovers, toggles, micro-states
Fast150-250msFeedback, small transitions
Standard250-400msModals, reveals, state changes
Slow400-600msPage transitions, sequences
Deliberate600-1000msDramatic reveals, celebrations

Universal Easing Library

css
:root {  /* Standard easings */  --ease-out: cubic-bezier(0, 0, 0.2, 1);        /* Entrances */  --ease-in: cubic-bezier(0.4, 0, 1, 1);         /* Exits */  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);   /* State changes */
  /* Spring easings */  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);  /* Overshoot */  --ease-bounce: cubic-bezier(0.68, -0.55, 0.27, 1.55); /* Playful */}

The 12 Principles Quick Reference

  1. Squash & Stretch: Scale 0.95-1.05 range for organic feel
  2. Anticipation: 2-3px reverse movement or 50ms pause before action
  3. Staging: Animate toward user attention, clear visual hierarchy
  4. Straight Ahead vs Pose-to-Pose: Define keyframes, plan states
  5. Follow Through: Overshoot by 2-5%, settle back
  6. Slow In/Slow Out: Always ease, never linear (except spinners)
  7. Arcs: Combine X+Y movement, natural paths
  8. Secondary Action: Layer 2-3 properties max (opacity + transform + shadow)
  9. Timing: Match duration to distance/importance
  10. Exaggeration: Subtle for UI (under 10% deviation)
  11. Solid Drawing: Maintain visual consistency during motion
  12. Appeal: Motion should feel helpful, not performative

Base Animation Classes

css
/* Standard entrance */.animate-in {  animation: fade-in 250ms var(--ease-out) forwards;}
/* Standard exit */.animate-out {  animation: fade-out 200ms var(--ease-in) forwards;}
/* State transition */.animate-state {  transition: all 200ms var(--ease-in-out);}
@keyframes fade-in {  from { opacity: 0; transform: translateY(10px); }  to { opacity: 1; transform: translateY(0); }}
@keyframes fade-out {  from { opacity: 1; transform: translateY(0); }  to { opacity: 0; transform: translateY(-10px); }}

Universal Rules

  1. 100ms Response Time: User actions must trigger visible change within 100ms
  2. Under 400ms for UI: Functional animations shouldn't exceed 400ms
  3. Reduce Motion: Always provide prefers-reduced-motion alternative
  4. GPU Properties: Use only transform and opacity for smooth 60fps
  5. Exit < Enter: Exits 20-30% faster than entrances

Accessibility Default

css
@media (prefers-reduced-motion: reduce) {  *, *::before, *::after {    animation-duration: 0.01ms !important;    animation-iteration-count: 1 !important;    transition-duration: 0.01ms !important;  }}

Decision Tree

  1. Is element entering? → Use ease-out, 200-300ms
  2. Is element exiting? → Use ease-in, 150-250ms
  3. Is element changing state? → Use ease-in-out, 150-250ms
  4. Is it continuous? → Use linear (rotation) or ease-in-out (pulse)
  5. Is it responding to gesture? → Use ease-out with overshoot, under 200ms

When uncertain, start with: 250ms cubic-bezier(0.4, 0, 0.2, 1)

來源與署名

來源:dylantarre/animation-principles位於skills/05-by-animation-type/universal-patterns提交8359713

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架