返回顶部
A

Animations动画制作

Create performant web animations with proper accessibility and timing.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
1,572
下载量
免费
免费
2
收藏
概述
安装方式
版本历史

Animations

GPU-Accelerated Properties

Only these properties animate on the compositor thread (60fps):

PropertyUse
INLINECODE0Move, rotate, scale (translateX, rotate, scale)
INLINECODE1
Fade in/out |

Everything else triggers layout or paint. Avoid animating:

  • - width, height, margin, padding (layout thrashing)
  • INLINECODE6, left, right, bottom (use transform instead)
  • INLINECODE10, font-size (expensive reflows)

CODEBLOCK0

Reduced Motion

~5% of users experience vestibular disorders (dizziness, nausea from motion).

CODEBLOCK1

Keep subtle fades and color changes even with reduced motion. Remove parallax, bouncing, infinite loops.

Timing Functions

EasingUse case
INLINECODE12Elements entering view (appears responsive)
INLINECODE13
Elements exiting view (accelerates away) | | ease-in-out | Elements moving within view | | linear | Only for spinners, progress bars, color cycling |

CODEBLOCK2

Duration Guidelines

TypeDuration
Micro-interactions (hover, focus)100-200ms
Transitions (modals, dropdowns)
200-300ms | | Page transitions | 300-500ms | | Complex choreography | 500-1000ms max |

Anything over 500ms feels sluggish. Shorter is usually better.

CSS Transitions vs Animations

Transitions: A to B state changes
CODEBLOCK3

Animations: Multi-step, auto-play, looping
CODEBLOCK4

Use transitions for hover/focus states. Use animations for on-load effects and sequences.

will-change

Only use as optimization when you have specific performance problems:

CODEBLOCK5

Transition Property Specificity

CODEBLOCK6

INLINECODE16 can cause unexpected animations on color, background, border changes.

React/Framework Traps

Exit animations require AnimatePresence:
CODEBLOCK7

Stable keys for list animations:
CODEBLOCK8

AutoAnimate parent must be unconditional:
CODEBLOCK9

Library Selection

LibrarySizeBest for
CSS only0kbHover states, simple transitions
AutoAnimate
3kb | Lists, accordions, toasts (90% of UI animations) | | Motion | 22kb | Gestures, physics, scroll animations, complex choreography | | GSAP | 60kb | Timelines, creative animation, scroll-triggered sequences |

Start with CSS. Add AutoAnimate for list animations. Only add Motion/GSAP for complex needs.

Common Mistakes

  • - Animating width/height instead of scale—causes layout thrashing
  • Infinite animations without pause control—no way to stop
  • Same easing for enter and exit—use ease-out for enter, ease-in for exit
  • Ignoring prefers-reduced-motion—causes physical discomfort
  • Duration over 500ms—feels sluggish
  • INLINECODE20 catching unintended properties
  • Missing AnimatePresence for exit animations in React

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 animations-1776419941 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 animations-1776419941 技能

通过命令行安装

skillhub install animations-1776419941

下载

⬇ 下载 Animations v1.0.0(免费)

文件大小: 2.81 KB | 发布时间: 2026-4-17 20:14

v1.0.0 最新 2026-4-17 20:14
Initial release

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部