index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="main">
<div class="container">
<div class="box">
<div class="bar"></div>
<div class="bar"></div>
<div class="bar"></div>
<div class="bar"></div>
<div class="bar"></div>
<div class="bar"></div>
<div class="bar"></div>
<div class="bar"></div>
<div class="bar"></div>
<div class="bar"></div>
</div>
</div>
</div>
</body>
</html>
style.css
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
html,body{
width: 100%;
height: 100%;
position: relative;
}
#main{
position: absolute;
top: 50%;
left: 50%;
/* display: flex; */
justify-content: center;
transform: translate(-50%,-50%);
}
.box{
width: 150px;
height: 150px;
position: absolute;
top: 50%;
left: 50%;
display: flex;
transform: translate(-50%,-50%);
/* background-color: azure; */
align-items: center;
justify-content: space-between;
}
.box .bar{
width: 10px;
border-radius: 10px;
justify-content: space-between;
background: white;
animation: moves 1.5s ease-in-out infinite;
}
@keyframes moves{
0%,100%{
height: 2px;
}
50%{
height: 70px;
}
}
.box .bar:nth-child(1){
background: #e7ce2ad3;
animation-delay: 1s;
}
.box .bar:nth-child(2){
background: #b0e01dda;
animation-delay: 0.8s;
}
.box .bar:nth-child(3){
background: #17dbd1de;
animation-delay: 0.6s;
}
.box .bar:nth-child(4){
background: #1b7dd3ce;
animation-delay: 0.4s;
}
.box .bar:nth-child(5){
background: #6711d0;
animation-delay: 0.2s;
}
.box .bar:nth-child(6){
background: #b65252;
animation-delay: 0.2s;
}
.box .bar:nth-child(7){
background: #654848;
animation-delay: 0.4s;
}
.box .bar:nth-child(8){
background: #b65252;
animation-delay: 0.6s;
}
.box .bar:nth-child(9){
background: #958181;
animation-delay: 0.8s;
}
.box .bar:nth-child(10){
background: #b65252;
animation-delay: 1s;
}
output: -
Post a Comment