帮助你在 React/Next.js 中实现高级动效、手势交互与动画编排。
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "motion-advanced" 技能: 1. 下载 https://raw.githubusercontent.com/affaan-m/ECC/main/skills/motion-advanced/SKILL.md 2. 保存为 ~/.claude/skills/motion-advanced/SKILL.md 3. 装好后重载技能,告诉我可以用了
基于 motion-advanced,为 React 实现一个可拖拽排序的卡片列表,支持鼠标和触屏操作,带拖拽占位动画、回弹效果和无障碍键盘交互。请给出组件代码、状态管理方案和样式建议。
一套可直接集成的拖拽排序列表示例,包含动画逻辑、交互处理和实现说明。
使用 motion-advanced 为 Next.js 首页 Hero 区域设计文字入场动画:标题逐字出现,副标题淡入上移,按钮延迟出现,并兼顾性能与 reduced motion。请输出完整组件代码和参数解释。
一个首页 Hero 动画组件方案,含逐字动画、时间编排和无障碍优化说明。
请用 motion-advanced 实现一个 SVG 图标描边动画,在页面滚动到可视区域时开始绘制,绘制完成后填充颜色,并封装成可复用组件。请展示 useAnimate 或合适 API 的用法选择依据。
一个可复用的 SVG 路径绘制动画组件,附带触发逻辑与 API 选型说明。
Complex, interactive, and physics-based animation patterns.
Requires motion-foundations to be set up first.
Use these when motion-patterns is not enough.
useScrollReveal, magnetic button, cursor follower)useAnimateThis skill produces:
Reorder.Group listsuseScrollReveal, , , useHoverScaleuseNavigationDirectionuseInViewOnceuseAnimate with interrupt-safe async/awaituseSpring, springs.*) always feels more natural than duration-based for direct manipulation.useMotionValue + useTransform computes derived values without triggering re-renders.useAnimate sequences are imperative and interrupt-safe — calling animate() mid-flight cancels the previous animation automatically.useMotionValue, useSpring) are SSR-safe and do not cause hydration errors.drag prop works on both but feel and threshold differ.document.visibilityState === "hidden". Background tabs must not consume GPU/CPU.offset + velocity checks.useAnimate scope ref must be attached to a mounted DOM element. Calling animate() before mount throws silently.useMotionValue(0) inside a component body is correct; new MotionValue(0) in a render is not.motion-foundations. No inline numbers.window.addEventListener needs a matching removeEventListener in the useEffect return.| Scenario | API |
|---|---|
| Drag with physics on release | drag + dragTransition: springs.release |
| Ordered drag-to-reorder list | Reorder.Group + Reorder.Item |
| Dismiss on drag offset | drag="y" + onDragEnd offset check |
| Swipe left/right | drag="x" + onDragEnd offset check |
| Long press | useLongPress hook |
| Value smoothed over time | useSpring |
| Value derived from another | useTransform |
| Multi-step sequence | useAnimate with async/await |
| One-shot imperative animation | animate() from motion |
| Text entering word by word | Stagger on inline-block spans |
| SVG drawing on | pathLength 0 → 1 |
| SVG morph | d attribute tween (equal commands) |
| Circular progress | strokeDashoffset tween |
useSpring vs a spring transitionuseSpring | transition: springs.* | |
|---|---|---|
| Use for | Cursor follower, pointer-tracked values | Discrete state changes |
| Updates | Continuous, on every frame | Triggered by state change |
| Interrupt | Smooth — physics picks up from velocity | Restarts from current value |
…
为 React/Next.js 动效系统建立规范基座,统一令牌、弹簧预设、性能与无障碍规则。