0
我正在尝试使手机振动效果。这是我目前有:https://codepen.io/anon/pen/jwWwzxCSS关键帧手机振动
我只是想弄清楚如何添加一个休息,就像振动一秒钟,然后暂停一秒钟,然后重复。施加
<div class="phone"><img src="https://i.imgpile.com/nucPMx.png"></div>
.phone {
-webkit-animation: vibrate 0.32s cubic-bezier(.36, .07, .19, .97) infinite;
animation: vibrate 0.32s cubic-bezier(.36, .07, .19, .97) infinite;
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
-webkit-perspective: 300px;
perspective: 300px;
}
@keyframes vibrate {
0.50%, 90% {
-webkit-transform: translate3d(-0.5px, 0, 0);
transform: translate3d(-0.5px, 0, 0);
}
0.50%, 80% {
-webkit-transform: translate3d(0.5px, 0, 0);
transform: translate3d(0.5px, 0, 0);
}
30%, 50%, 70% {
-webkit-transform: translate3d(-0.5px, 0, 0);
transform: translate3d(-0.5px, 0, 0);
}
0.50%, 60% {
-webkit-transform: translate3d(0.5px, 0, 0);
transform: translate3d(0.5px, 0, 0);
}
}
我改变了你的榜样,因此暂停了一段时间,在每一个动画循环的末尾:HTTPS ://codepen.io/anon/pen/yXeXwG –