Loading...
Loading...
Compare original and translation side by side
| Category | Duration | Use For |
|---|---|---|
| Instant | 100-150ms | Hovers, toggles, micro-states |
| Fast | 150-250ms | Feedback, small transitions |
| Standard | 250-400ms | Modals, reveals, state changes |
| Slow | 400-600ms | Page transitions, sequences |
| Deliberate | 600-1000ms | Dramatic reveals, celebrations |
| 类别 | 时长范围 | 适用场景 |
|---|---|---|
| 即时 | 100-150ms | 悬停效果、开关切换、微状态变化 |
| 快速 | 150-250ms | 操作反馈、小型过渡动效 |
| 标准 | 250-400ms | 模态框、内容展开、状态变更 |
| 缓慢 | 400-600ms | 页面切换、序列动效 |
| 刻意型 | 600-1000ms | 戏剧性展示、庆祝类动效 |
:root {
/* Standard easings */
--ease-out: cubic-bezier(0, 0, 0.2, 1); /* Entrances */
--ease-in: cubic-bezier(0.4, 0, 1, 1); /* Exits */
--ease-in-out: cubic-bezier(0.4, 0, 0.2, 1); /* State changes */
/* Spring easings */
--ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1); /* Overshoot */
--ease-bounce: cubic-bezier(0.68, -0.55, 0.27, 1.55); /* Playful */
}:root {
/* Standard easings */
--ease-out: cubic-bezier(0, 0, 0.2, 1); /* 入场动效 */
--ease-in: cubic-bezier(0.4, 0, 1, 1); /* 退场动效 */
--ease-in-out: cubic-bezier(0.4, 0, 0.2, 1); /* 状态切换 */
/* Spring easings */
--ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1); /* 过冲效果 */
--ease-bounce: cubic-bezier(0.68, -0.55, 0.27, 1.55); /* 弹跳效果 */
}/* Standard entrance */
.animate-in {
animation: fade-in 250ms var(--ease-out) forwards;
}
/* Standard exit */
.animate-out {
animation: fade-out 200ms var(--ease-in) forwards;
}
/* State transition */
.animate-state {
transition: all 200ms var(--ease-in-out);
}
@keyframes fade-in {
from { opacity: 0; transform: translateY(10px); }
to { opacity: 1; transform: translateY(0); }
}
@keyframes fade-out {
from { opacity: 1; transform: translateY(0); }
to { opacity: 0; transform: translateY(-10px); }
}/* 标准入场动效 */
.animate-in {
animation: fade-in 250ms var(--ease-out) forwards;
}
/* 标准退场动效 */
.animate-out {
animation: fade-out 200ms var(--ease-in) forwards;
}
/* 状态切换动效 */
.animate-state {
transition: all 200ms var(--ease-in-out);
}
@keyframes fade-in {
from { opacity: 0; transform: translateY(10px); }
to { opacity: 1; transform: translateY(0); }
}
@keyframes fade-out {
from { opacity: 1; transform: translateY(0); }
to { opacity: 0; transform: translateY(-10px); }
}prefers-reduced-motiontransformopacityprefers-reduced-motiontransformopacity@media (prefers-reduced-motion: reduce) {
*, *::before, *::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
}@media (prefers-reduced-motion: reduce) {
*, *::before, *::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
}250ms cubic-bezier(0.4, 0, 0.2, 1)250ms cubic-bezier(0.4, 0, 0.2, 1)