animation动画效果
// css
@keyframes dong {
0% {
transform: translate(0px, 0px);
}
50% {
transform: translate(100px, 0px);
}
100% {
transform: translate(0px, 0px);
}
}
.move-line {
width: 100px;
height: 13px;
position: relative;
border-bottom: 1px solid rgba(#08d1ea, 0.2);
}
.move-point {
display: inline-block;
width: 20px;
height: 5px;
border-radius: 50%;
background-color: #fff;
border: 1px solid #08d1ea;
animation: dong 7s ease-in-out infinite;
}
//html
<div class="move-line">
<span class="move-point"></span>
</div>
效果:
一个白底的小椭圆在一根长为100px的细线上来回移动