1.用两个图片拼接,实现前后衔接。
2.通过动画,不断的向左平移,实现动画效果。
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<style>
.box {
position: absolute;
height: 200px;
width: 200px;
overflow: hidden;
border-radius: 50%;
background-color: lightblue;
}
.box-img {
position: absolute;
left: 0px;
top: 100px;
height: 150px;
width: 400px;
animation: move_wave 2s linear infinite;
}
.box-img2 {
position: absolute;
left: 400px;
top: 100px;
height: 150px;
width: 400px;
animation: move_wave 2s linear infinite;
}
@keyframes move_wave {
0% {
transform: translateX(0)
}
100% {
transform: translateX(-100%)
}
}
</style>
</head>
<body>
<div class="box">
<img class="box-img" src="./b3.png" />
<img class="box-img2" src="./b3.png" />
</div>
</body>
</html>
b3.png