过渡和动画
动画
使元素产生动画的CSS动画功能类。
语法
Class | Properties | 平台兼容性说明 |
---|---|---|
animate-none | animate: none | H5、小程序、app-vue |
animate-spin | animation: spin 1s linear infinite | H5、小程序、app-vue |
animate-ping | animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite | H5、小程序、app-vue |
animate-pulse | animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite | H5、小程序、app-vue |
animate-bounce | animation: bounce 1s infinite | H5、小程序、app-vue |
animate-flicker | animation: flicker 1s infinite | H5、小程序、app-vue |
animate-heartbeat | animation: heartbeat 1s infinite | H5、小程序、app-vue |
animate-shake | animation: shake 0.6s | H5、小程序、app-vue |
动画时间曲线
Class | Properties | 平台兼容性说明 |
---|---|---|
animate-tf-linear | animation-timing-function: linear | H5、小程序、app-vue |
animate-tf-ease | animation-timing-function: ease | H5、小程序、app-vue |
animate-tf-ease-in | animation-timing-function: ease-in | H5、小程序、app-vue |
animate-tf-ease-out | animation-timing-function: ease-out | H5、小程序、app-vue |
animate-tf-ease-in-out | animation-timing-function: ease-in-out | H5、小程序、app-vue |
循环动画
Class | Properties | 平台兼容性说明 |
---|---|---|
animate-ic-loop | animation-iteration-count: infinite | H5、小程序、app-vue |
@keyframes spin
css
@keyframes spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
@keyframes ping
css
@keyframes ping {
75%,
100% {
transform: scale(2);
opacity: 0;
}
}
@keyframes pulse
css
@keyframes pulse {
0%,
100% {
opacity: 1;
}
50% {
opacity: .5;
}
}
@keyframes bounce
css
@keyframes bounce {
0%,
100% {
transform: translateY(-25%);
animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
}
50% {
transform: translateY(0);
animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
}
}
@keyframes flicker
css
@keyframes flicker {
from {
opacity: 0;
}
50% {
opacity: 1;
}
100% {
opacity: 0;
}
}
@keyframes heartbeat
css
@keyframes heartbeat {
0% {
transform: scale(1);
}
50% {
transform: scale(1.1);
}
}
@keyframes shake
css
@keyframes shake {
0%,
90%,
100% {
transform: translateX(0);
}
10% {
transform: translateX(-8px);
}
20% {
transform: translateX(7px);
}
30% {
transform: translateX(-6px);
}
40% {
transform: translateX(5px);
}
50% {
transform: translateX(-4px);
}
60% {
transform: translateX(3px);
}
70% {
transform: translateX(-2px);
}
80% {
transform: translateX(1px);
}
}