fixing-motion-performance by ibelick/ui-skills
npx skills add https://github.com/ibelick/ui-skills --skill fixing-motion-performance修复动画性能问题。
/fixing-motion-performance 在此对话中将以下约束应用于任何 UI 动画工作。
/fixing-motion-performance <文件> 根据以下所有规则审查文件并报告:
除非明确要求,否则不要迁移动画库。在现有技术栈内应用这些规则。
在以下情况下参考这些指南:
| 优先级 |
|---|
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 类别 |
|---|
| 影响 |
|---|
| 1 | 绝对禁止模式 | 关键 |
| 2 | 选择动画机制 | 关键 |
| 3 | 测量 | 高 |
| 4 | 滚动 | 高 |
| 5 | 绘制 | 中高 |
| 6 | 图层 | 中 |
| 7 | 模糊和滤镜 | 中 |
| 8 | 视图过渡 | 低 |
| 9 | 工具边界 | 关键 |
/* 布局抖动:使用变换动画代替宽度动画 */
/* 修复前 */ .panel { transition: width 0.3s; }
/* 修复后 */ .panel { transition: transform 0.3s; }
/* 滚动关联:使用滚动时间轴代替 JavaScript */
/* 修复前 */ window.addEventListener('scroll', () => el.style.opacity = scrollY / 500)
/* 修复后 */ .reveal { animation: fade-in linear; animation-timeline: view(); }
// 测量:在写入之前批量读取(FLIP 技术)
// 修复前 — 布局抖动
el.style.left = el.getBoundingClientRect().left + 10 + 'px';
// 修复后 — 测量一次,通过变换进行动画
const first = el.getBoundingClientRect();
el.classList.add('moved');
const last = el.getBoundingClientRect();
el.style.transform = `translateX(${first.left - last.left}px)`;
requestAnimationFrame(() => { el.style.transition = 'transform 0.3s'; el.style.transform = ''; });
每周安装量
6.2K
代码仓库
GitHub 星标数
1.1K
首次出现
2026年1月22日
安全审计
安装于
claude-code4.5K
opencode3.4K
codex3.4K
gemini-cli3.3K
github-copilot3.1K
cursor3.0K
Fix animation performance issues.
/fixing-motion-performance Apply these constraints to any UI animation work in this conversation.
/fixing-motion-performance <file> Review the file against all rules below and report:
Do not migrate animation libraries unless explicitly requested. Apply rules within the existing stack.
Reference these guidelines when:
| priority | category | impact |
|---|---|---|
| 1 | never patterns | critical |
| 2 | choose the mechanism | critical |
| 3 | measurement | high |
| 4 | scroll | high |
| 5 | paint | medium-high |
| 6 | layers | medium |
| 7 | blur and filters | medium |
| 8 | view transitions | low |
| 9 | tool boundaries | critical |
/* layout thrashing: animate transform instead of width */
/* before */ .panel { transition: width 0.3s; }
/* after */ .panel { transition: transform 0.3s; }
/* scroll-linked: use scroll-timeline instead of JS */
/* before */ window.addEventListener('scroll', () => el.style.opacity = scrollY / 500)
/* after */ .reveal { animation: fade-in linear; animation-timeline: view(); }
// measurement: batch reads before writes (FLIP)
// before — layout thrash
el.style.left = el.getBoundingClientRect().left + 10 + 'px';
// after — measure once, animate via transform
const first = el.getBoundingClientRect();
el.classList.add('moved');
const last = el.getBoundingClientRect();
el.style.transform = `translateX(${first.left - last.left}px)`;
requestAnimationFrame(() => { el.style.transition = 'transform 0.3s'; el.style.transform = ''; });
Weekly Installs
6.2K
Repository
GitHub Stars
1.1K
First Seen
Jan 22, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
claude-code4.5K
opencode3.4K
codex3.4K
gemini-cli3.3K
github-copilot3.1K
cursor3.0K
97,600 周安装