div.loader
- for (var i = 0; i < 22; ++i) {
div.line
- }
View Compiled
$animation-length: 4s;
$size: 80vh;
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html, body {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
background: rgb(50,50,50);
}
.loader {
position: relative;
display: block;
width: $size;
height: $size;
}
.line {
height: $size/45;
background: #ccc;
margin-bottom: $size/41;
animation: $animation-length load ease-in-out infinite;
@for $i from 1 through 21 {
&:nth-of-type(#{$i+1}) {
animation-delay: -#{$i/10}s;
}
}
}
@keyframes load {
0% {
width: 25%;
margin-left: 75%;
}
25% {
width: 1%;
margin-left: 50%;
}
50% {
width: 25%;
margin-left: 0;
}
75% {
width: 1%;
margin-left: 50%;
}
100% {
width: 25%;
margin-left: 75%;
}
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.