代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
button{
border: 0;
width: 100px;
height: 40px;
border-radius: 25px;
}
button:hover{
cursor: pointer;
animation: shake 0.5s cubic-bezier(0.075, 0.82, 0.165, 1) both;
transform: translate3d(0,0,0);
}
@keyframes shake{
10%,90%{
transform: translate3d(-1px,0,0);
}
20%,80%{
transform: translate3d(3px,0,0);
}
40%,60%{
transform: translate3d(-2px,0,0);
}
30%,70%,50%{
transform: translate3d(4px,0,0);
}
}
</style>
</head>
<body>
<button>
</button>
</body>
</html>
效果展示