Emilkowal Animations

作者 pproencacf93c57cac89无许可证215 个星标收录于 2026年10月8日更新于 2026年10月8日仓库7周前更新

Emil Kowalski's animation best practices for web interfaces. Use when writing, reviewing, or implementing animations in React, CSS, or Framer Motion. Triggers on tasks involving transitions, easing, gestures, toasts, drawers, or motion.

AI 生成的概览

网页动画最佳实践参考指南,涵盖缓动、时长、变换、手势、无障碍与 Tailwind v4。

功能
该技能提供一套面向网页界面的 58 条动画规则,按优先级分为八个类别,包括缓动选择、时长与持续时间、属性选择、变换技巧、交互模式、策略性动画、无障碍与细节打磨,以及 Tailwind v4 工具类。每条规则存放在独立的参考文件中,文档还提供速查列表、关键数值表和按元素类型划分的时长建议。它产出的是指导与建议,而不是代码或文件。
适用场景
在 React、CSS 或 Framer Motion 界面中添加、审查或实现动画时使用。它适用于选择缓动曲线与时长、构建手势交互、提示条或抽屉组件、优化动画性能,以及处理减少动态效果的无障碍需求。在需要用 Tailwind CSS v4 工具类表达这些原则时同样适用。
运行要求
无需脚本或运行时依赖;这是一个仅含说明的技能,由 Markdown 参考文件组成。使用它不需要凭据或网络访问。

Emil Kowalski Animation Best Practices

Comprehensive animation guide for web interfaces based on Emil Kowalski's teachings, open-source libraries (Sonner, Vaul), and his animations.dev course. Contains 58 rules across 8 categories, prioritized by impact.

When to Apply

Reference these guidelines when:

  • Adding animations to React components
  • Choosing easing curves or timing values
  • Implementing gesture-based interactions (swipe, drag)
  • Building toast notifications or drawer components
  • Optimizing animation performance
  • Ensuring animation accessibility
  • Expressing any of the above with Tailwind CSS v4 utilities (see the tw- category)

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Easing SelectionCRITICALease-
2Timing & DurationCRITICALtiming-
3Property SelectionHIGHprops-
4Transform TechniquesHIGHtransform-
5Interaction PatternsMEDIUM-HIGHinteract-
6Strategic AnimationMEDIUMstrategy-
7Accessibility & PolishMEDIUMpolish-
8Tailwind v4 UtilitiesMEDIUMtw-

Quick Reference

1. Easing Selection (CRITICAL)

  • ease-out-default [blocked] - Use ease-out as your default easing
  • ease-custom-curves [blocked] - Use custom cubic-bezier over built-in CSS
  • ease-in-out-onscreen [blocked] - Use ease-in-out for on-screen movement
  • ease-spring-natural [blocked] - Use spring animations for natural motion
  • ease-spring-config [blocked] - Configure springs with duration and bounce
  • ease-ios-drawer [blocked] - Use iOS-style easing for drawer components
  • ease-context-matters [blocked] - Match easing to animation context

2. Timing & Duration (CRITICAL)

  • timing-300ms-max [blocked] - Keep UI animations under 300ms
  • timing-faster-better [blocked] - Faster animations improve perceived performance
  • timing-asymmetric [blocked] - Use asymmetric timing for press and release
  • timing-tooltip-delay [blocked] - Delay initial tooltips, instant subsequent ones
  • timing-drawer-500ms [blocked] - Use 500ms duration for drawer animations

3. Property Selection (HIGH)

  • props-transform-opacity [blocked] - Animate only transform and opacity
  • props-hardware-accelerated [blocked] - Use hardware-accelerated animations when main thread is busy
  • props-will-change [blocked] - Use will-change to prevent 1px shift
  • props-avoid-css-variables [blocked] - Avoid CSS variables for drag animations
  • props-clip-path-performant [blocked] - Use clip-path for layout-free reveals

4. Transform Techniques (HIGH)

  • transform-scale-097 [blocked] - Scale buttons to 0.97 on press
  • transform-never-scale-zero [blocked] - Never animate from scale(0)
  • transform-percentage-translate [blocked] - Use percentage values for translateY
  • transform-origin-aware [blocked] - Make animations origin-aware
  • transform-scale-children [blocked] - Scale transforms affect children
  • transform-3d-preserve [blocked] - Use preserve-3d for 3D transform effects
  • transform-starting-style [blocked] - Animate enter states with @starting-style

5. Interaction Patterns (MEDIUM-HIGH)

  • interact-interruptible [blocked] - Make animations interruptible
  • interact-momentum-dismiss [blocked] - Use momentum-based dismissal
  • interact-damping [blocked] - Damp drag at boundaries
  • interact-scroll-drag-conflict [blocked] - Resolve scroll and drag conflicts
  • interact-snap-points [blocked] - Implement velocity-aware snap points
  • interact-friction-upward [blocked] - Allow upward drag with friction
  • interact-pointer-capture [blocked] - Use pointer capture for drag operations
  • interact-multitouch [blocked] - Ignore extra touch points during drag
  • interact-touch-hover [blocked] - Gate hover animations behind a pointer media query

6. Strategic Animation (MEDIUM)

  • strategy-keyboard-no-animate [blocked] - Never animate keyboard-initiated actions
  • strategy-frequency-matters [blocked] - Consider interaction frequency before animating
  • strategy-purpose-required [blocked] - Every animation must have a purpose
  • strategy-feedback-immediate [blocked] - Provide immediate feedback on all actions
  • strategy-marketing-exception [blocked] - Marketing sites are the exception
  • strategy-cohesion [blocked] - Match motion to the component's personality
  • strategy-review-fresh-eyes [blocked] - Review animations in slow motion and the next day

7. Accessibility & Polish (MEDIUM)

  • polish-reduced-motion [blocked] - Respect prefers-reduced-motion
  • polish-opacity-fallback [blocked] - Use opacity as reduced motion fallback
  • polish-framer-hook [blocked] - Use useReducedMotion hook in Framer Motion
  • polish-dont-remove-all [blocked] - Keep gentle animation for reduced motion
  • polish-blur-bridge [blocked] - Use blur to bridge animation states
  • polish-clip-path-tabs [blocked] - Use clip-path for tab transitions
  • polish-toast-stacking [blocked] - Implement toast stacking with scale and offset
  • polish-scroll-reveal [blocked] - Trigger scroll animations at appropriate threshold
  • polish-hover-gap-fill [blocked] - Fill gaps between hoverable elements
  • polish-stagger-children [blocked] - Stagger child animations for orchestration

8. Tailwind v4 Utilities (MEDIUM)

Express the principles above with proper Tailwind CSS v4 utilities. Applies only to Tailwind v4 projects; the raw-CSS and Framer Motion rules above remain the source of truth.

  • tw-ease-duration-defaults [blocked] - Set ease-out and a sub-300ms duration explicitly
  • tw-custom-easing-theme [blocked] - Register custom easing curves as @theme tokens
  • tw-press-scale [blocked] - Use active:scale-[0.97] for button press feedback
  • tw-asymmetric-timing [blocked] - Split press and release timing with active:duration
  • tw-starting-enter [blocked] - Animate enter states with the starting: variant
  • tw-reduced-motion [blocked] - Gate movement behind motion-safe / motion-reduce
  • tw-origin-aware [blocked] - Set transform-origin with origin-* utilities
  • tw-will-change [blocked] - Scope will-change-transform to the active gesture

Key Values Reference

ValueUsage
cubic-bezier(0.23, 1, 0.32, 1)Strong ease-out for UI interactions
cubic-bezier(0.77, 0, 0.175, 1)Strong ease-in-out for on-screen movement
cubic-bezier(0.32, 0.72, 0, 1)iOS-style drawer/sheet animation
scale(0.97)Button press feedback
scale(0.95)Minimum enter scale (never scale(0))
200ms ease-outStandard UI transition
300msMaximum duration for UI animations
500msDrawer animation duration
0.11 px/msVelocity threshold for momentum dismiss
100pxScroll-reveal viewport threshold
14pxToast stack offset

Duration by Element

Pick duration by how often the element is seen and how much it moves. Keep UI animations under 300ms.

ElementDuration
Button press feedback100–160ms
Tooltips, small popovers125–200ms
Dropdowns, selects150–250ms
Modals, drawers200–500ms
Marketing / explanatoryCan be longer

Reference Files

FileDescription
references/_sections.md [blocked]Category definitions and ordering
assets/templates/_template.md [blocked]Template for new rules
metadata.json [blocked]Version and reference information

来源与署名

来源:pproenca/dot-skills位于skills/.experimental/emilkowal-animations提交cf93c57

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架