重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
state-changes by dylantarre/animation-principles
npx skills add https://github.com/dylantarre/animation-principles --skill state-changes当元素在不离开的情况下进行变换时,应用迪士尼的 12 条动画原则。
挤压与拉伸:元素在展开前先压缩。切换开关在滑动前会先挤压 5%。
预备动作:在变化前先蓄力。在展开前进行轻微的反向移动(2-3px)。
演出布局:将变换集中在用户关注点上。不要让状态变化分散对交互点的注意力。
逐帧动画与姿势对应:定义精确的状态。按钮有静止、悬停、激活、禁用状态——每个都经过精心设计。
跟随与重叠动作:各部分以不同的速率变换。图标旋转后,标签再淡入。
慢入慢出:对双向变化使用缓入缓出:cubic-bezier(0.4, 0, 0.2, 1)。
弧线运动:旋转元素遵循自然弧线。V 形图标围绕其中心点旋转,而非线性移动。
次要动作:将主要变化与辅助动作配对。切换滑动 + 颜色变化 + 图标交换。
时间节奏:
夸张:在状态变化时略微过冲。切换开关会超过 2px,然后回弹到位。
扎实的描绘:在变换过程中保持元素的完整性。避免破坏视觉一致性的扭曲。
吸引力:状态变化应让人感觉满意。用户是带着意图点击的——要奖励这种意图。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 状态变化 |
|---|
| 持续时间 |
|---|
| 缓动效果 |
|---|
| 备注 |
|---|
| 复选框 | 150ms | ease-out | 勾选绘制 |
| 切换开关 | 200ms | ease-in-out | 略微过冲 |
| 单选按钮 | 150ms | ease-out | 从中心缩放进入 |
| 手风琴 | 250ms | ease-in-out | 高度 + 旋转 |
| 标签页切换 | 200ms | ease-in-out | 指示器滑动 |
| 按钮激活 | 100ms | ease-out | 缩放到 0.97 |
| 卡片展开 | 300ms | ease-in-out | 所有属性一起变化 |
.toggle {
transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
}
.toggle-knob {
transition: transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1); /* Overshoot */
}
.toggle.active .toggle-knob {
transform: translateX(20px);
}
.accordion-content {
display: grid;
grid-template-rows: 0fr;
transition: grid-template-rows 250ms ease-in-out;
}
.accordion.open .accordion-content {
grid-template-rows: 1fr;
}
状态变化是可逆的。到状态 B 的动画应该是到状态 A 动画的逆过程。请测试两个方向。
每周安装次数
52
代码仓库
GitHub 星标数
23
首次出现
2026 年 1 月 24 日
安全审计
安装于
codex45
gemini-cli42
opencode42
cursor41
github-copilot39
claude-code37
Apply Disney's 12 principles when elements transform without leaving.
Squash & Stretch: Elements compress before expanding. A toggle switch squashes 5% before sliding.
Anticipation : Wind up before the change. Slight reverse movement (2-3px) before expanding.
Staging : Keep transformations centered on user focus. Don't let state changes distract from the interaction point.
Straight Ahead vs Pose-to-Pose : Define exact states. Button has rest, hover, active, disabled - each precisely designed.
Follow Through & Overlapping: Parts transform at different rates. Icon rotates before label fades in.
Slow In/Slow Out : Use ease-in-out for bidirectional changes: cubic-bezier(0.4, 0, 0.2, 1).
Arcs : Rotating elements follow natural arcs. Chevrons rotate on their center point, not linearly.
Secondary Action : Pair the primary change with supporting motion. Toggle sliding + color shift + icon swap.
Timing :
Exaggeration : Overshoot slightly on state changes. Toggle goes 2px past, then settles.
Solid Drawing : Maintain element integrity during transformation. No distortion that breaks visual consistency.
Appeal : State changes should feel satisfying. Users clicked with intent - reward that intent.
| State Change | Duration | Easing | Notes |
|---|---|---|---|
| Checkbox | 150ms | ease-out | Tick draws in |
| Toggle Switch | 200ms | ease-in-out | Overshoot slightly |
| Radio Button | 150ms | ease-out | Scale in from center |
| Accordion | 250ms | ease-in-out | Height + rotation |
| Tab Switch | 200ms | ease-in-out | Indicator slides |
| Button Active | 100ms | ease-out | Scale to 0.97 |
| Card Expand | 300ms | ease-in-out | All properties together |
.toggle {
transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
}
.toggle-knob {
transition: transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1); /* Overshoot */
}
.toggle.active .toggle-knob {
transform: translateX(20px);
}
.accordion-content {
display: grid;
grid-template-rows: 0fr;
transition: grid-template-rows 250ms ease-in-out;
}
.accordion.open .accordion-content {
grid-template-rows: 1fr;
}
State changes are reversible. The animation to state B should be the inverse of animation to state A. Test both directions.
Weekly Installs
52
Repository
GitHub Stars
23
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
codex45
gemini-cli42
opencode42
cursor41
github-copilot39
claude-code37
React视图过渡API使用指南:实现原生浏览器动画与状态管理
9,100 周安装
PubChem 数据库 Python 使用指南:化学结构搜索、性质检索与生物活性数据分析
212 周安装
知识提取技能:自动从对话和调试中提取结构化知识,提升团队效率
209 周安装
API模糊测试漏洞赏金指南:REST、SOAP、GraphQL安全测试与IDOR绕过技术
213 周安装
uni-app原生插件开发指南:Android/iOS插件集成与扩展教程
45 周安装
Symfony API Platform过滤器使用指南 - 合约设计、序列化与安全最佳实践
210 周安装
Skill Creator - Claude AI技能开发指南与最佳实践 | 模块化AI工作流扩展
211 周安装