animate.css 是一個(gè)來(lái)自國(guó)外的 CSS3 動(dòng)畫(huà)庫(kù),它預(yù)設(shè)了抖動(dòng)(shake)、閃爍(flash)、彈跳(bounce)、翻轉(zhuǎn)(flip)、旋轉(zhuǎn)(rotateIn/rotateOut)、淡入淡出(fadeIn/fadeOut)等多達(dá) 60 多種動(dòng)畫(huà)效果,幾乎包含了所有常見(jiàn)的動(dòng)畫(huà)效果。
雖然借助 animate.css 能夠很方便、快速的制作 CSS3 動(dòng)畫(huà)效果,但還是建議看看 animate.css 的代碼,也許你能從中學(xué)到一些東西。
@-webkit-keyframes pulse { 0% {
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
}
50% {
-webkit-transform: scale3d(1.05, 1.05, 1.05);
transform: scale3d(1.05, 1.05, 1.05);
}
100% {
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
}
}
@keyframes pulse {
0% {
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
}
50% {
-webkit-transform: scale3d(1.05, 1.05, 1.05);
transform: scale3d(1.05, 1.05, 1.05);
}
100% {
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
}
}
.pulse { -webkit-animation-name: pulse; animation-name: pulse; }