exit-animations

GitHub

指导前端元素退出屏幕的动画实现,涵盖Disney动画原则、时长建议及CSS/JS实现模式,适用于模态框关闭、通知消失等场景。

skills/05-by-animation-type/exit-animations/SKILL.md dylantarre/animation-principles

Trigger Scenarios

需要实现元素离开视图的动画 处理模态框关闭或通知移除 优化页面过渡或列表项删除效果

Install

npx skills add dylantarre/animation-principles --skill exit-animations -g -y
More Options

Non-standard path

npx skills add https://github.com/dylantarre/animation-principles/tree/main/skills/05-by-animation-type/exit-animations -g -y

Use without installing

npx skills use dylantarre/animation-principles@exit-animations

指定 Agent (Claude Code)

npx skills add dylantarre/animation-principles --skill exit-animations -a claude-code -g -y

安装 repo 全部 skill

npx skills add dylantarre/animation-principles --all -g -y

预览 repo 内 skill

npx skills add dylantarre/animation-principles --list

SKILL.md

Frontmatter
{
    "name": "exit-animations",
    "description": "Use when elements need to leave the screen - closing modals, dismissing notifications, removing items, page transitions out, or any \"leaving view\" animation."
}

Exit Animations

Apply Disney's 12 principles when removing elements from view.

Principle Application

Squash & Stretch: Scale down to 95-98% on exit. Element compresses slightly as it departs.

Anticipation: Brief pause or micro-movement before departure. A 50ms hesitation acknowledges the exit.

Staging: Exit toward logical destinations. Deleted items fall down, dismissed modals shrink to origin, sidebars return to their edge.

Straight Ahead vs Pose-to-Pose: Pose-to-pose with clear visible→invisible states. Plan the exit trajectory.

Follow Through & Overlapping: Content exits before container. Text fades 50ms before the card collapses.

Slow In/Slow Out: Use ease-in for exits. Gentle start, accelerating departure: cubic-bezier(0.4, 0, 1, 1).

Arcs: Exit on curves, not straight lines. Dismissed notifications arc upward-and-out.

Secondary Action: Combine opacity fade with directional movement. Pure fades feel like errors.

Timing:

  • Exits should be 20-30% faster than entrances
  • Quick exits: 100-150ms (tooltips, dropdowns)
  • Standard exits: 150-200ms (modals, toasts)
  • Graceful exits: 200-300ms (page transitions)

Exaggeration: Scale to 0.9 for dramatic departure, 0.97 for subtle dismissal.

Solid Drawing: Maintain spatial logic. Elements should exit the way they came or toward where they "belong."

Appeal: Exits confirm user intent. Make dismissals feel decisive, not abrupt.

Timing Recommendations

Element Type Duration Easing Notes
Tooltip 100ms ease-in Faster than entrance
Dropdown 150ms ease-in Collapse upward
Toast 150ms ease-in Slide to origin
Modal 200ms ease-in Content first, overlay last
Deleted Item 200ms ease-in Collapse height after fade
Page 250ms ease-in Current page exits, then new enters

Implementation Pattern

.exiting {
  animation: exit 200ms cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes exit {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
  }
}

Collapse Pattern

For removed list items:

  1. Fade out content (150ms)
  2. Collapse height (150ms, starts at 100ms)
  3. Remove from DOM after animation completes

Total perceived time: 250ms. Always use will-change: opacity, transform for smooth exits.

Version History

  • 8359713 Current 2026-12-03 14:20

Same Skill Collection

skills/01-by-domain/3d-spatial/SKILL.md
skills/01-by-domain/accessible-motion/SKILL.md
skills/01-by-domain/brand-marketing/SKILL.md
skills/01-by-domain/data-visualization/SKILL.md
skills/01-by-domain/game-development/SKILL.md
skills/01-by-domain/micro-interactions/SKILL.md
skills/01-by-domain/mobile-touch/SKILL.md
skills/01-by-domain/page-transitions/SKILL.md
skills/01-by-domain/presentations/SKILL.md
skills/01-by-domain/universal-fallback/SKILL.md
skills/01-by-domain/video-motion-graphics/SKILL.md
skills/01-by-domain/web-motion-design/SKILL.md
skills/02-by-thinking-style/anticipation-payoff/SKILL.md
skills/02-by-thinking-style/attention-direction/SKILL.md
skills/02-by-thinking-style/character-appeal/SKILL.md
skills/02-by-thinking-style/emotional-narrative/SKILL.md
skills/02-by-thinking-style/exaggerated-clarity/SKILL.md
skills/02-by-thinking-style/naturalistic-motion/SKILL.md
skills/02-by-thinking-style/physics-intuition/SKILL.md
skills/02-by-thinking-style/problem-diagnosis/SKILL.md
skills/02-by-thinking-style/rhythm-pacing/SKILL.md
skills/02-by-thinking-style/spatial-thinking/SKILL.md
skills/02-by-thinking-style/timing-mastery/SKILL.md
skills/02-by-thinking-style/universal-mindset/SKILL.md
skills/03-by-role-persona/accessibility-advocate/SKILL.md
skills/03-by-role-persona/animator-traditional/SKILL.md
skills/03-by-role-persona/brand-strategist/SKILL.md
skills/03-by-role-persona/creative-director/SKILL.md
skills/03-by-role-persona/educator-teacher/SKILL.md
skills/03-by-role-persona/filmmaker/SKILL.md
skills/03-by-role-persona/frontend-developer/SKILL.md
skills/03-by-role-persona/game-designer/SKILL.md
skills/03-by-role-persona/motion-designer/SKILL.md
skills/03-by-role-persona/product-manager/SKILL.md
skills/03-by-role-persona/universal-practitioner/SKILL.md
skills/03-by-role-persona/ux-researcher/SKILL.md
skills/04-by-skill-level/absolute-beginner/SKILL.md
skills/04-by-skill-level/advanced/SKILL.md
skills/04-by-skill-level/deep-dive/SKILL.md
skills/04-by-skill-level/expert/SKILL.md
skills/04-by-skill-level/intermediate/SKILL.md
skills/04-by-skill-level/master/SKILL.md
skills/04-by-skill-level/novice/SKILL.md
skills/04-by-skill-level/quick-start/SKILL.md
skills/04-by-skill-level/refresher/SKILL.md
skills/04-by-skill-level/teaching-others/SKILL.md
skills/04-by-skill-level/troubleshooting/SKILL.md
skills/04-by-skill-level/universal-reference/SKILL.md
skills/05-by-animation-type/attention-grabbers/SKILL.md
skills/05-by-animation-type/continuous-loops/SKILL.md

Metadata

Files
0
Version
8359713
Hash
9aac8954
Indexed
2026-12-03 14:20

홈 - 위키
Copyright © 2011-2026 iteam. Current version is 2.156.0. UTC+08:00, 2026-12-03 17:25
浙ICP备14020137号-1