效果参考
直接见代码:
<div class="box">
box body
<div class="img"></div>
</div>
@keyframes leftIn {
0% {
right: -100px;
}
100% {
right: 0;
}
}
@keyframes handShake {
0% {
transform: rotate(0deg);
}
14.3% {
transform: rotate(-9deg);
}
25.7% {
transform: rotate(-1deg);
}
34.3% {
transform: rotate(-10deg);
}
42.9% {
transform: rotate(0deg);
}
100% {
transform: rotate(0deg);
}
}
.box {
width: 300px;
height: 300px;
border: 1px solid red;
margin: 0 auto;
margin-top: 50px;
position: relative;
}
.img {
position: absolute;
right: -20px;
bottom: 100px;
width: 0;
height: 0;
height: auto;
border-top: 50px solid transparent;
border-bottom: 50px solid transparent;
border-left: 100px solid red;
transform-origin: 100px 50px;
animation-name: leftIn, handShake;
animation-duration: .8s, 1.6s;
animation-timing-function: ease-in-out, ease-in-out;
animation-delay: 1s, 2s;
animation-iteration-count: 1, 8;
animation-fill-mode: both, both;
}