html布局
<div class="dot-main">
<div class="dot-line"></div>
<div class="dot-line"></div>
<div class="dot-line"></div>
<div class="dot-line"></div>
<div class="dot-line"></div>
<div class="dot-line"></div>
<div class="dot-line"></div>
<div class="dot-line"></div>
<div class="dot-line"></div>
</div>
css animation 代码
.dot-main{
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
z-index: 2;
}
.coin-box{
position: absolute;
right: 5px;
top: 50%;
margin-top: -55px;
font-size: 0;
z-index: 8;
animation: coinAni 1.2s linear infinite alternate
}
.coin-box img{
width: 130px;
}
.dot-line{
position: absolute;
background: url(../images/upline.png) no-repeat;
background-size: contain;
width: 2px;
height: 38px;
top: 130px;
}
.dot-line:nth-child(1){
left: 25px;
animation: updot 3s 0s linear infinite
}
.dot-line:nth-child(2){
left: 50px;
animation: updot 5s 1s linear infinite
}
.dot-line:nth-child(3){
left: 90px;
animation: updot 4s 2s linear infinite
}
.dot-line:nth-child(4){
left: 125px;
animation: updot 5s 2.8s linear infinite
}
.dot-line:nth-child(5){
left: 155px;
animation: updot 4s 3.8s linear infinite
}
.dot-line:nth-child(6){
left: 195px;
animation: updot 5s 2.3s linear infinite
}
.dot-line:nth-child(7){
left: 225px;
animation: updot 5s 4.8s linear infinite
}
.dot-line:nth-child(8){
left: 245px;
animation: updot 4.5s 5.8s linear infinite
}
.dot-line:nth-child(9){
left: 265px;
animation: updot 5s 1s linear infinite
}
@keyframes updot {
0%{
top: 130px;
}
100%{
top: -80px;
}
}
@keyframes coinAni {
0%{
transform: translateY(-5px);
}
100%{
transform: translateY(5px);
}
}