Cards Containers

dylantarre/animation-principles/skills/07-by-ui-element/cards-containers

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

Use when animating cards, panels, tiles, or container elements to create depth and interactivity

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

運用迪士尼 12 項動畫原則,為卡片、面板與容器元素提供動畫設計指引與 CSS 範例。

功能
此技能為卡片、面板、磚塊與容器元素的動畫提供設計指引,以營造層次感與互動感。它將迪士尼 12 項動畫原則對應到卡片互動上,提供懸停、選取、展開與重排狀態的具體時間長度、緩動曲線與 CSS 程式碼片段。產出是一組動畫建議與範例 CSS,而非可直接執行的工具。
適用情境
適用於為儀表板、圖庫或可拖曳磚塊版面等卡片式介面設計或實作動效時。當你需要針對懸停、展開或重排動畫的具體時間、緩動與圖層指引時,適合使用。
執行需求
不需要指令碼或套件,僅為說明性內容。套用這些指引需要支援 CSS 轉場與變形的前端環境。

Card & Container Animation Principles

Apply Disney's 12 principles to cards and containers for engaging, dimensional interfaces.

Principles Applied to Cards

1. Squash & Stretch

Cards can subtly compress on drag-start and stretch when released. Keep it minimal: 2-3% scale change maximum.

2. Anticipation

Before expanding a card to detail view, briefly scale down (0.98) for 50ms, then expand. Prepares user for the transformation.

3. Staging

The card being interacted with should lift above others via z-index and shadow. Dim or blur background cards to focus attention.

4. Straight Ahead & Pose to Pose

Define clear states: resting, hovered, selected, expanded. Pose-to-pose transitions between these defined keyframes.

5. Follow Through & Overlapping Action

Card content (text, images, icons) should lag slightly behind card movement. Stagger by 20-40ms for natural feel.

6. Ease In & Ease Out

Card lifts use ease-out, card settles use ease-in-out. Never linear. cubic-bezier(0.25, 0.1, 0.25, 1) for smooth lifts.

7. Arcs

When cards reorder (drag-and-drop), they should follow curved paths, not straight lines. Add slight rotation during movement.

8. Secondary Action

While card lifts (primary), shadow expands and blurs (secondary). Image inside can subtle zoom. Border can glow.

9. Timing

  • Hover lift: 200-250ms
  • Selection: 150ms
  • Expand to detail: 300-400ms
  • Reorder/shuffle: 250-350ms
  • Stagger between cards: 50-75ms

10. Exaggeration

Hover shadows can extend 2-3x normal depth. Selected cards can lift 8-12px. Keep proportional to card size.

11. Solid Drawing

Maintain consistent border-radius ratios when scaling. Shadows should always come from same light source. Preserve aspect ratios.

12. Appeal

Rounded corners feel approachable, subtle shadows add premium feel. Smooth transitions build trust. Cards should feel like physical objects.

CSS Implementation

css
.card {  transition: transform 250ms ease-out,              box-shadow 250ms ease-out;}
.card:hover {  transform: translateY(-8px) scale(1.02);  box-shadow: 0 12px 40px rgba(0,0,0,0.15);}
.card-content {  transition: transform 280ms ease-out; /* slight lag */}

Key Properties

  • transform: translateY, scale, rotate
  • box-shadow: depth and lift
  • z-index: layering
  • filter: blur for background
  • opacity: focus states

來源與署名

來源:dylantarre/animation-principles位於skills/07-by-ui-element/cards-containers提交8359713

授權條款: 無授權條款

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

檢舉或申請下架