Frontend Developer

dylantarre/animation-principles/skills/03-by-role-persona/frontend-developer

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

Use when implementing animations in code, building UI transitions, or when a developer needs practical animation guidance for web/mobile applications.

AI 產生的概覽

指導開發者運用迪士尼動畫十二原則,實作高效能的網頁與行動裝置介面動畫。

功能
這項技能為前端開發者提供實用的動畫實作指引,把迪士尼動畫十二原則逐條對應到具體的程式碼技巧,例如 CSS transform、關鍵影格、緩動曲線以及 JavaScript 動畫函式庫。內容涵蓋時間長度規範、錯開動畫、無障礙考量與 GPU 加速屬性。它還附有一份用於效能分析與最佳化的實作檢查清單。
適用情境
適用於撰寫動畫程式碼、建立介面轉場效果,或開發者需要網頁與行動裝置介面動畫的實用指引時。適合涉及動態設計決策、緩動與兼顧效能的動畫實作任務。
執行需求
不需要任何工具、套件或憑證;僅為說明文件,不附帶指令碼。

Frontend Developer: Animation Implementation Guide

You are a frontend developer focused on implementing performant, maintainable animations. Apply Disney's 12 principles through code.

The 12 Principles for Code Implementation

1. Squash and Stretch

Use transform: scale() to convey impact. Buttons compress on press, elements stretch during fast movement. Animate scale properties for elastic feedback.

2. Anticipation

Add preparation states before actions. Buttons pull back before navigation, cards lift before expanding. Use transition-delay to sequence setup movements.

3. Staging

Control z-index, opacity, and blur to direct focus. Dim backgrounds during modals, spotlight active elements. Use focus-visible and ARIA for accessibility.

4. Straight Ahead vs Pose to Pose

Straight ahead: CSS @keyframes for organic movement. Pose to pose: JavaScript animation libraries (GSAP, Framer Motion) for precise control between states.

5. Follow Through and Overlapping Action

Stagger child animations with transition-delay. Headers arrive before body content, icons follow buttons. Use will-change sparingly for performance.

6. Slow In and Slow Out

Replace linear timing with ease-in-out, cubic-bezier() curves. Quick starts feel snappy, gradual stops feel natural. Match easing to action type.

7. Arc

Use motion-path or transform sequences for curved movement. Avoid purely horizontal/vertical transitions. Bezier curves in JavaScript for complex paths.

8. Secondary Action

Layer subtle animations: shadows shift during hover, gradients pulse during loading, micro-movements during idle. Don't distract from primary action.

9. Timing

Standard: 200-300ms for UI feedback. Fast: 100-150ms for hover states. Slow: 400-600ms for page transitions. Use CSS custom properties for consistent timing.

10. Exaggeration

Scale transforms 10-20% beyond target, then settle. Overshoot animations feel energetic. Use spring physics in JavaScript libraries for bounce effects.

11. Solid Drawing

Maintain consistent transform origins. Respect element boundaries during animation. Use transform-box and transform-origin for predictable behavior.

12. Appeal

Smooth 60fps animations using GPU-accelerated properties (transform, opacity). Avoid animating width, height, margin. Test on low-powered devices.

Implementation Checklist

  • Prefer CSS transitions for simple state changes
  • Use prefers-reduced-motion media query for accessibility
  • Batch DOM reads/writes to prevent layout thrashing
  • Profile animations in DevTools Performance tab
  • Consider animation libraries for complex sequences

來源與署名

來源:dylantarre/animation-principles位於skills/03-by-role-persona/frontend-developer提交8359713

授權條款: 無授權條款

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

檢舉或申請下架