I have 2 code snippets down below.
In the first, I have beautiful stripes, they resizing themselves with the window size and are always centered (I try some animation but I don't get it like the animation from snippet 2)
But I need an animation, this animation are showed in the second snippet, the stripes should come from below and go up and I would like to keep that in the final result.
So I need a fusion with the first and second snippet.
First:
html,
body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
#position: fixed;
}
.mask {
height: 100%;
overflow: hidden;
position: relative;
}
.container {
height: 100%;
margin: 0 -100vh;
#position: absolute;
}
.stripe {
float: left;
height: 100%;
width: 2%;
margin: 0 1%;
bottom: 0%;
max-height: 0%;
#position: absolute;
background-color: black;
transform: skew(-20deg);
#transform-origin: bottom bottom;
#transform-origin: left bottom;
animation: ani 1s linear 1 forwards;
}
.stripe:nth-child(1) {
animation-delay: 0.0s;
}
.stripe:nth-child(2) {
animation-delay: 0.2s;
}
.stripe:nth-child(3) {
animation-delay: 0.4s;
}
.stripe:nth-child(4) {
animation-delay: 0.6s;
}
.stripe:nth-child(5) {
animation-delay: 0.8s;
}
.stripe:nth-child(6) {
animation-delay: 1s;
}
.stripe:nth-child(7) {
animation-delay: 1.2s;
}
.stripe:nth-child(8) {
animation-delay: 1.4s;
}
.stripe:nth-child(9) {
animation-delay: 1.6s;
}
.stripe:nth-child(10) {
animation-delay: 1.8s;
}
.stripe:nth-child(11) {
animation-delay: 2s;
}
.stripe:nth-child(12) {
animation-delay: 2.2s;
}
.stripe:nth-child(13) {
animation-delay: 2.4s;
}
.stripe:nth-child(14) {
animation-delay: 2.6s;
}
.stripe:nth-child(15) {
animation-delay: 2.8s;
}
.stripe:nth-child(16) {
animation-delay: 3s;
}
.stripe:nth-child(17) {
animation-delay: 3.2s;
}
.stripe:nth-child(18) {
animation-delay: 3.4s;
}
.stripe:nth-child(19) {
animation-delay: 3.6s;
}
.stripe:nth-child(20) {
animation-delay: 3.8s;
}
.stripe:nth-child(21) {
animation-delay: 4s;
}
.stripe:nth-child(22) {
animation-delay: 4.2s;
}
.stripe:nth-child(23) {
animation-delay: 4.4s;
}
.stripe:nth-child(24) {
animation-delay: 4.6s;
}
.stripe:nth-child(25) {
animation-delay: 4.8s;
}
@keyframes ani {
0% {
max-height: 0%;
}
100% {
max-height: 100%;
}
}
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div class="mask">
<div class="container">
<div class="stripe"></div>
<div class="stripe"></div>
<div class="stripe"></div>
<div class="stripe"></div>
<div class="stripe"></div>
<div class="stripe"></div>
<div class="stripe"></div>
<div class="stripe"></div>
<div class="stripe"></div>
<div class="stripe"></div>
<div class="stripe"></div>
<div class="stripe"></div>
<div class="stripe"></div>
<div class="stripe"></div>
<div class="stripe"></div>
<div class="stripe"></div>
<div class="stripe"></div>
<div class="stripe"></div>
<div class="stripe"></div>
<div class="stripe"></div>
<div class="stripe"></div>
<div class="stripe"></div>
<div class="stripe"></div>
<div class="stripe"></div>
<div class="stripe"></div>
</div>
</div>
</body>
</html>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…