Communitygithub.com

介面動畫系統

設計並實作一套功能性動畫的系統化框架,定義時長、緩動曲線與編排,以提升可用性、回饋與空間心智模型。

介面動畫系統 是什麼?

此技能提供一套完整的「介面動畫系統」方法論,協助開發者與設計師建立超越純裝飾的「功能性動畫」。它專注於定義標準化的時長尺度(如快速100–150ms、標準200–300ms、慢速350–500ms)與語義化的緩動曲線(如進入/淡入、離開/淡出、強調效果),並透過編排規則(如錯開動畫、方向連續性)來引導使用者的注意力、強化空間心智模型。此技能支援所有現代瀏覽器與裝置,並特別考量無障礙需求,需實作 `prefers-reduced-motion` 降級方案。工作流程涵蓋從品牌個性分析、觸發類型分類,到產生可複用的動畫變數規範(Duration Token、Easing Palette),並提供常見失敗模式的檢查清單(如過慢的節奏、線性緩動、混亂的方向邏輯),確保動畫既提升體驗又不影響效能。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/coastdigitalgroup/coastai-skills/tree/HEAD/website-design/interface-motion-system

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

介面動畫系統 是做什麼的?

目的

介面動畫系統提供一套設計「功能性動畫」的方法論——那些在使用者介面中具有特定目的的動作。它超越純裝飾性的動畫,建立一套包含時長、緩動曲線與編排的系統,幫助使用者理解空間關係、提供操作回饋,並在情境轉換時降低認知負擔。

使用案例

  • 為 UI 元件庫定義標準的轉場時長與曲線。
  • 設計複雜的佈局變化(例如將卡片擴展為全螢幕)。
  • 為使用者動作建立回饋動畫(例如成功勾選記號、載入旋轉器)。
  • 編排 UI 層(模態框、抽屜、提示訊息)的進入與離開。
  • 利用動畫將注意力引導至特定元素或變化。

何時不該使用

  • 純靜態品牌美學: 視覺風格刻意避免動作以傳達特定調性(例如極簡、粗獷或「紙質」設計)。
  • 純裝飾「炫技」: 沒有增加任何功能價值且干擾使用者主要任務的動畫(例如背景元素無互動地移動)。
  • 高延遲環境: 當渲染動畫的效能成本超過 UX 效益時,導致「卡頓」或延遲。

輸入

  1. 品牌個性: 動畫是「敏捷/高效」(快速、線性)還是「自然/流暢」(彈性、柔和、有機)?
  2. 互動情境: 移動的是什麼?(原子元素、容器或整個頁面)
  3. 觸發類型: 動畫是由系統(載入)、使用者(點擊/懸停)還是環境(捲動)觸發?
  4. 平台能力: 目標瀏覽器或裝置的技術限制。

輸出

  1. 時長尺度: 一組標準化的時間記號(例如 motion-fast、motion-standard、motion-slow)。
  2. 緩動調色盤: 為不同動畫意圖定義的貝茲曲線集(例如 ease-in、ease-out、emphasized)。
  3. 編排規則: 元素如何進入、離開以及彼此相對移動的標準。
  4. 動畫記號規格書: 提供給開發者的動畫變數文件。

工作流程

1. 建立時長尺度

根據變化的大小建立合理的時間進程:

  • 快 (100–150ms): 微互動與原子狀態(懸停、切換、啟用)。
  • 標準 (200–300ms): 中等大小的轉場(下拉選單、工具提示、小型展開)。
  • 慢 (350–500ms): 大型佈局變化或沉浸式轉場(模態框、頁面級變化)。

2. 定義緩動曲線

為不同的貝茲曲線賦予語義:

  • 標準 (Ease-in-out): 用於元素在視口內從一點移動到另一點。
  • 進入 (Ease-out): 用於元素出現或進入視口(開始快,結束慢,感覺靈敏)。
  • 離開 (Ease-in): 用於元素消失或離開視口(開始慢,結束快,感覺有目的性)。
  • 強調 (複雜): 用於需要高品質感受的主要轉場的自訂曲線(例如 cubic-bezier(0.4, 0, 0.2, 1))。

3. 為空間心智模型設計

利用動畫來說明元素從何而來以及將往何處:

  • 方向連續性: 如果抽屜從右側滑入,就必須從右側離開。
  • 父-子關係: 子元素(例如選單)理想情況下應從其父元素(按鈕)出發。

4. 編排序列(錯開效果)

當多個元素同時出現時,避免「彈入」效果:

  • 錯開效果: 在每個元素之間加入微小的延遲 (20–50ms) 來引導視線按特定順序移動。
  • 方向性錯開: 按照閱讀方向(從上到下或從左到右)錯開項目。

5. 規劃無障礙(減少動畫)

動畫必須具有包容性:

  • 「起飛前」檢查: 始終為在作業系統層級啟用「減少動畫」的使用者定義降級方案。
  • 替代視覺效果: 當 prefers-reduced-motion 啟用時,用透明度淡入或完全無動畫來取代動畫。

決策規則

  • 「功能優先」規則: 如果你無法解釋某個動畫告訴使用者什麼,就移除它。
  • 響應式時長: 在小螢幕(手機)上時長應更短,因為元素移動的物理距離較小。
  • 動作回應速度優先於流暢度: 互動回饋(例如按鈕點擊)應感覺瞬間完成 (<100ms),即使後續的轉場較長也沒關係。
  • 無無限循環: 避免不停循環的動畫(旋轉器、脈衝),除非它們代表一個活動中的、封鎖背景的狀態。

限制

  • 無障礙: 必須遵守 prefers-reduced-motion。動畫不得引發癲癇(避免快速閃爍或大規模高頻模式)。
  • 效能: 堅持只使用「合成器專用」屬性(transform 和 opacity)以確保 60fps 效能。避免對 width、height 或 margin 進行動畫。
  • 一致性: 在整個網站中,對同一元件類型使用相同的時長和緩動。

常見失敗模式

  • 「暈車」陷阱: 使用大規模、大範圍的動作(例如整個頁面滑動),導致前庭不適。
  • 介面遲緩: 設定過長的時長(例如選單用了1秒),讓使用者等待,讓網站感覺故障。
  • 線性動畫: 使用「線性」緩動,與現實世界中的加速/減速相比,感覺機械且不自然。
  • 方向混淆: 模態框從中心「展開」但從底部「滑出」,破壞了使用者的空間模型。
  • 「抖動」效果: 錯開元素時延遲過長,使頁面感覺載入緩慢。

驗證標準

  • 每個轉場都有定義的時長和緩動記號。
  • 時長與轉場的大小成比例(變化小則快,變化大則慢)。
  • 動畫支援清晰的空間心智模型(符合邏輯的進入/離開)。
  • 使用錯開效果來揭示多元素,以引導視線。
  • 無障礙:已針對 prefers-reduced-motion 提出明確的簡化策略。
  • 效能:頻繁動畫僅使用 transform 和 opacity。
  • 回饋動畫(例如按鈕點擊)在 <100ms 內開始。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for progressive disclosure using accordions, ensuring structural integrity, visual affordances, and accessibility across different content densities and devices.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for long-form content, managing readability, vertical rhythm, and information density to ensure a superior reading experience.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for informational elements that communicate state (Badges) and categorization (Tags) with clarity and accessibility.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for non-overlay notifications, managing global announcements and contextual inline alerts to communicate system states without interrupting the user's flow.

coastdigitalgroup/coastai-skills

Design and implement a systematic, asymmetrical bento-grid layout framework to organize diverse content types cohesively while maintaining strict visual hierarchy, logical focus order, and responsive flexibility.

coastdigitalgroup/coastai-skills

Design a responsive, mobile-first bottom navigation bar and persistent action dock system for mobile websites and web applications, establishing spatial anchors, tab bar anatomy, badge indicators, thumb-zone ergonomics, safe area inset handling, active/inactive state contrast, and desktop responsive adaptation rules.

coastdigitalgroup/coastai-skills

Design a mobile-first bottom sheet overlay system with configurable detents, drag affordances, safe area padding, responsive desktop modal/popover adaptation, and WCAG AA accessibility compliance.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for secondary navigation trails that provide orientation, context, and one-click access to parent levels in deep information architectures.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for buttons and interactive triggers, managing visual hierarchy, variant logic, and action grouping to ensure clear intent and accessible interaction.

coastdigitalgroup/coastai-skills

Design a systematic framework for date and time selection, managing calendar grids, range pickers, and scheduling interfaces to ensure precision and accessibility.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for modular content containers that maintain hierarchy, structural integrity, and action alignment across variable content and responsive viewports.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for horizontal discovery components, managing navigation affordances, scroll behavior, and accessibility to ensure effective content density without compromising usability.

coastdigitalgroup/coastai-skills

Design a systematic, highly accessible, and developer-friendly UI layout framework for code blocks, snippet showcases, multi-file code tabs, line-highlighting, diff views, and syntax token contrast in technical documentation and developer platforms.

coastdigitalgroup/coastai-skills

Design a systematic framework for global command menus (Cmd+K panels) that combines keyboard-driven navigation, command execution, and shortcut discovery into an accessible, responsive overlay.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for threaded conversations, managing nesting depths, action hierarchies, and community signaling to foster engagement and readability.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for side-by-side comparison interfaces, managing high attribute density and responsive complexity to support informed decision-making.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for user privacy, managing consent banners, preference centers, and persistent privacy controls to balance legal compliance with user trust.

coastdigitalgroup/coastai-skills

Design and implement a systematic, highly accessible, and responsive visual layout framework for conversational chat widgets, live chat boxes, and chatbot panels that ensures clear message scannability, native focus flow, and seamless mobile keyboard adaptation.

coastdigitalgroup/coastai-skills

Design a systematic, accessible, and high-conversion framework for custom select dropdowns and comboboxes, defining anatomy, states, search-filtering, and responsive mobile-adaptive patterns.

coastdigitalgroup/coastai-skills

Design and implement a systematic color palette that ensures WCAG 2.2 accessibility compliance. Trigger this skill when asked to define brand colors, create UI themes, or establish a visual system for a website.

相關技能