ui-animation by mblode/agent-skills
npx skills add https://github.com/mblode/agent-skills --skill ui-animation| 文件 | 阅读时机 |
|---|---|
| references/decision-framework.md | 默认:动画决策、缓动和时长 |
| references/spring-animations.md | 使用弹簧物理、framer-motion useSpring、配置弹簧参数 |
| references/component-patterns.md | 构建带有动画的按钮、弹出框、工具提示、抽屉、模态框、通知 |
| references/clip-path-techniques.md | 使用 clip-path 实现揭示效果、标签页、长按删除、对比滑块 |
| references/gesture-drag.md | 实现拖拽、滑动关闭、动量、指针捕获 |
| references/performance-deep-dive.md |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 调试卡顿、CSS 与 JS 对比、WAAPI、CSS 变量陷阱、Framer Motion 注意事项 |
| references/review-format.md | 审查动画代码 — 之前/之后/原因表格和问题清单 |
@starting-style;回退方案是 data-mounted。filter: blur(2px) 可以隐藏粗糙的交叉淡入淡出效果。transform 和 opacity。color、background-color 和 opacity。width、height、top、left);切勿使用 transition: all。filter 动画;如果不可避免,保持模糊度 <= 20px。transform-box: fill-box; transform-origin: center 的 <g> 包装器上应用变换。[data-theme-switching] * { transition: none !important })。| 元素 | 时长 | 缓动 |
|---|---|---|
| 按钮按下反馈 | 100–160ms | cubic-bezier(0.22, 1, 0.36, 1) |
| 工具提示、小型弹出框 | 125–200ms | ease-out 或进入曲线 |
| 下拉菜单、选择器 | 150–250ms | cubic-bezier(0.22, 1, 0.36, 1) |
| 模态框、抽屉 | 200–350ms | cubic-bezier(0.22, 1, 0.36, 1) |
| 屏幕上的移动/滑动 | 200–300ms | cubic-bezier(0.25, 1, 0.5, 1) |
| 简单悬停(颜色/不透明度) | 200ms | ease |
| 说明性/营销性动画 | 最长 1000ms | 弹簧或自定义 |
命名曲线
cubic-bezier(0.22, 1, 0.36, 1) — 进入和基于变换的悬停cubic-bezier(0.25, 1, 0.5, 1) — 幻灯片、抽屉、面板cubic-bezier(0.32, 0.72, 0, 1)UI 中避免使用 ease-in。优先使用来自 easing.dev 的自定义曲线。
transform-origin;对于模态框,保持 center。scale(0.85–0.9) 开始。切勿使用 scale(0)。@media (hover: hover) and (pointer: fine) 之后,以避免在触摸设备上误触发。transform 和 opacity — 这些属性会跳过布局和绘制。IntersectionObserver 在屏幕外暂停循环动画。transform/opacity 切换 will-change — 之后移除。x/y 值是处理基于轴的移动和拖拽的常规选择。当需要为组合变换或互操作性提供一个变换所有者时,使用完整的 transform 字符串。transition: all — 触发布局重计算并动画化不需要的属性。width、height、top、left)。ease-in — 感觉迟钝。scale(0) 开始动画 — 现实世界中没有任何东西是从无到有出现的。使用 scale(0.85–0.95)。will-change — 仅在重度运动期间切换它。x/y 属性和手写的 transform 字符串。复制并跟踪此清单:
Animation progress:
- [ ] Step 1: Decide whether the interaction should animate
- [ ] Step 2: Choose purpose, easing, and duration
- [ ] Step 3: Pick the implementation style
- [ ] Step 4: Load the relevant component or technique reference
- [ ] Step 5: Validate timing, interruption, and device behavior
width、height、top、left)。will-change 仅在动画期间切换,而非永久设置。每周安装量
2.3K
代码仓库
GitHub 星标
19
首次出现
2026年1月30日
安全审计
安装于
opencode2.0K
gemini-cli2.0K
codex2.0K
github-copilot2.0K
kimi-cli2.0K
amp1.9K
| File | Read when |
|---|---|
| references/decision-framework.md | Default: animation decisions, easing, and duration |
| references/spring-animations.md | Using spring physics, framer-motion useSpring, configuring spring params |
| references/component-patterns.md | Building buttons, popovers, tooltips, drawers, modals, toasts with animation |
| references/clip-path-techniques.md | Using clip-path for reveals, tabs, hold-to-delete, comparison sliders |
| references/gesture-drag.md | Implementing drag, swipe-to-dismiss, momentum, pointer capture |
| references/performance-deep-dive.md | Debugging jank, CSS vs JS, WAAPI, CSS variables trap, Framer Motion caveats |
| references/review-format.md | Reviewing animation code — Before/After/Why table and issue checklist |
@starting-style for DOM entry animations; fall back to data-mounted.filter: blur(2px) can hide rough crossfades.transform and opacity only.color, background-color, and opacity are acceptable.width, height, top, left); never use transition: all.filter animation for core interactions; keep blur <= 20px if unavoidable.| Element | Duration | Easing |
|---|---|---|
| Button press feedback | 100–160ms | cubic-bezier(0.22, 1, 0.36, 1) |
| Tooltips, small popovers | 125–200ms | ease-out or enter curve |
| Dropdowns, selects | 150–250ms | cubic-bezier(0.22, 1, 0.36, 1) |
| Modals, drawers | 200–350ms | cubic-bezier(0.22, 1, 0.36, 1) |
| Move/slide on screen | 200–300ms | cubic-bezier(0.25, 1, 0.5, 1) |
Named curves
cubic-bezier(0.22, 1, 0.36, 1) — entrances and transform-based hovercubic-bezier(0.25, 1, 0.5, 1) — slides, drawers, panelscubic-bezier(0.32, 0.72, 0, 1)Avoid ease-in for UI. Prefer custom curves from easing.dev.
transform-origin at the trigger point for popovers; keep center for modals.scale(0.85–0.9). Never scale(0).@media (hover: hover) and (pointer: fine) to avoid false positives on touch.transform and opacity — these skip layout and paint.IntersectionObserver.will-change only during heavy motion and only for transform/opacity — remove after.x/y values are the normal choice for axis-based movement and drag. Use full transform strings when you need one transform owner for combined transforms or interop.transition: all — triggers layout recalc and animates unintended properties.width, height, top, left) for interactive feedback.ease-in for UI entrances — feels sluggish.scale(0) — nothing in the real world appears from nothing. Use scale(0.85–0.95).will-change — toggle it only during heavy motion.Copy and track this checklist:
Animation progress:
- [ ] Step 1: Decide whether the interaction should animate
- [ ] Step 2: Choose purpose, easing, and duration
- [ ] Step 3: Pick the implementation style
- [ ] Step 4: Load the relevant component or technique reference
- [ ] Step 5: Validate timing, interruption, and device behavior
width, height, top, left).will-change is toggled only during animation, not permanently set.Weekly Installs
2.3K
Repository
GitHub Stars
19
First Seen
Jan 30, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode2.0K
gemini-cli2.0K
codex2.0K
github-copilot2.0K
kimi-cli2.0K
amp1.9K
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
102,200 周安装
<g> wrapper with transform-box: fill-box; transform-origin: center.[data-theme-switching] * { transition: none !important }).| Simple hover (colour/opacity) | 200ms | ease |
| Illustrative/marketing | Up to 1000ms | Spring or custom |
x/y props with a handwritten transform string on the same element.