html:
<div class="loading2">
<div class="rect-up"></div>
<div class="rect-up"></div>
<div class="rect-up"></div>
<div class="rect-up"></div>
<div class="rect-up"></div>
</div>
less:
.loading2 {
width: 150px;
height: 150px;
margin: 30px;
display: flex;
flex-direction: row;
align-items: center;
}
.loading2 .rect-up {
height: 20px;
width: 6px;
background: white;
margin-left: 2px;
margin-right: 2px;
animation: changeLoadingAni 700ms infinite;
}
.rect-up:nth-child(1) {
animation-delay: 140ms;
}
.rect-up:nth-child(2) {
animation-delay: 280ms;
}
.rect-up:nth-child(3) {
animation-delay: 420ms;
}
.rect-up:nth-child(4) {
animation-delay: 560ms;
}
.rect-up:nth-child(5) {
animation-delay: 700ms;
}
@keyframes changeLoadingAni {
0% {
transform: scaleY(1);
animation-timing-function: ease-in;
}
25% {
transform: scaleY(1.5);
animation-timing-function: ease-out;
}
50% {
transform: scaleY(2);
animation-timing-function: ease-in;
}
75% {
transform: scaleY(1.5);
animation-timing-function: ease-out;
}
}