提供适用于 React/Next.js 的高质量动画模式,快速实现常见交互动效。
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "motion-patterns" 技能: 1. 下载 https://raw.githubusercontent.com/affaan-m/ECC/main/skills/motion-patterns/SKILL.md 2. 保存为 ~/.claude/skills/motion-patterns/SKILL.md 3. 装好后重载技能,告诉我可以用了
请为我的 Next.js 应用设计一套页面切换动画方案,包含进入、退出、共享布局过渡,并给出可复用的 React 组件示例。
输出一套可直接集成到 Next.js 项目的页面切换动画模式与代码示例。
请给我一套适用于 React 的按钮悬停、点击反馈和弹窗打开关闭动画模式,要求参数统一、易于复用。
输出统一风格的按钮与弹窗动画实现方案,包括动效说明和组件代码。
请为我的 React 仪表盘提供列表错峰进入、Toast 通知出现消失、滚动触发动画的最佳实践和示例代码。
输出适合仪表盘场景的错峰、通知和滚动动画模式及其实现细节。
Copy-paste patterns for the most common UI animation needs.
Every pattern here is built on motion-foundations tokens and springs.
Do not define new duration or easing values here — import them.
This skill produces:
AnimatePresence-wrapped conditional renders with correct exit behavioruseScroll + useTransformlayout, layoutId) for expanding and crossfading elementsmotion-foundations. No raw numbers.AnimatePresence with a key.layout is used only for small, isolated shifts. Large subtrees get explicit transforms.AnimatePresence with a key on the direct child. Without a key, exit animations never fire.exit when defining initial + animate. An animation without an exit is incomplete.mode="wait" on page transitions. Enter must not start until exit completes.layout on subtrees with more than ~5 children or deeply nested DOM. Use explicit x/y transforms instead.0.05s and 0.10s. Below feels mechanical; above feels sluggish.role="dialog", aria-modal="true".viewport={{ once: true }}. Repeating on scroll-out is distracting, not informative.motion-foundations. No inline numbers.| Situation | Pattern |
|---|---|
| Element appears / disappears | AnimatePresence |
| List of items loading in sequence | Stagger variants |
| Navigating between routes | Page transition wrapper |
| Element changes size in place | layout prop |
| Same element moves across page contexts | layoutId |
| Element enters when scrolled into view | whileInView |
| Value tied to scroll position | useScroll + useTransform |
mode="wait" vs mode="sync"| Mode | Use when |
|---|---|
wait | Page transitions, content swaps (one at a time) |
sync | Stacked notifications, list items (overlap is fine) |
popLayout | Items removed from a reflow list |
Three things must always be true:
AnimatePresence wraps the conditionalkeyexit propMiss any one of these and the exit animation silently fails.
layout — animates the element's own size/position change in placelayoutId — links two separate elements, crossfading between them across rendersUse layout="position" on text inside an expanding container to prevent text reflow from animating.
"use client"
import { motion } from "motion/react"
import { springs, motionTokens } from "@/lib/motion-tokens"
<motion.button
whileHover={{ scale: motionTokens.scale.pop }}
whileTap={{ scale: motionTokens.scale.press }}
…
帮助开发者为代码代理配置性能优化、安全防护与研究优先工作流。
提供数据库迁移、回滚与零停机发布的最佳实践指导,适用于多种 ORM 与 SQL 数据库。
通过双评审智能体对结果进行对抗式校验,提升输出发布前的可靠性
帮助你掌握地道 Rust 模式、所有权与并发实践,编写安全高性能应用。
基于 C++ Core Guidelines 编写、审查并重构更安全现代的 C++ 代码。
为 Claude Code 会话提供系统化校验流程,帮助检查结果正确性与质量。
帮助你为 React/Next.js 产品实现可复用的界面动效与过渡方案。
帮助你在 React/Next.js 中实现高级动效、手势交互与动画编排。
为 React/Next.js 动效系统建立规范基座,统一令牌、弹簧预设、性能与无障碍规则。
帮助你梳理 React 与 Next.js 前端模式、状态管理及性能优化最佳实践
帮助用户设计并生成高质量、可生产的前端界面与网页组件代码
提供 React 与 Next.js 前端开发模式,优化状态管理、性能与界面实践。