<div class="container">
<div class="line animation animation--1"></div>
<div class="line animation animation--2"></div>
<div class="line animation animation--3"></div>
<div class="line animation animation--4"></div>
<div class="line animation animation--5"></div>
<div class="line animation animation--6"></div>
</div>
:root {
--width: 2048px;
--height: calc(var(--width) * 9 / 16);
--slides: 6;
}
body, html {
width: 100%;
min-height: 100vh;
background: black;
overflow: hidden;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
position: relative;
}
.image {
width: 100%;
position: absolute;
top: 0;
clip: rect(110px, 160px, 170px, 60px);
clip-path: inset(10px 20px 30px 40px);
}
.container {
width: 100%;
height: var(--height);
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
overflow: hidden;
transform: rotate(-45deg);
}
.line {
position: relative;
width: var(--width);
height: calc(var(--height) / var(--slides));
&:before {
user-select: none;
content: '';
display: block;
height:100%;
width:100%;
position: absolute;
background-size: cover, contain;
background-image: url(https://conv.cryengine.com/aKidoQnkQ161F7hMO_j0zKt5p5yWfDdY_wNGPm2Iwqw/el:1/aHR0cHM6Ly93d3cuY3J5ZW5naW5lLmNvbS9idWlsZC/9pbWFnZXMvaGVyby1iZy1ob21lLmpwZw.jpg);
}
&:nth-child(1):before {
background-position: 0% 0%;
}
&:nth-child(2):before {
background-position: 0% calc(100% / (var(--slides) - 1));
}
&:nth-child(3):before {
background-position: 0% calc(100% / (var(--slides) - 1) * 2);
}
&:nth-child(4):before {
background-position: 0% calc(100% / (var(--slides) - 1) * 3);
}
&:nth-child(5):before {
background-position: 0% calc(100% / (var(--slides) - 1) * 4);
}
&:nth-child(6):before {
background-position: 0% calc(100% / (var(--slides) - 1) * 5);
}
display: block;
color: white;
font-weight: bold;
}
.animation {
transform: translateX(-100%);
opacity: 0;
will-change: transform;
animation: flyIn forwards;
&--1 {
animation-duration: 1s;
animation-delay: 0s;
}
&--2 {
animation-duration: 1s;
animation-delay: 0.3s;
}
&--3 {
animation-duration: 1s;
animation-delay: 0.5s;
}
&--4 {
animation-duration: 0.7s;
animation-delay: 0.5s;
}
&--5 {
animation-duration: 1s;
animation-delay: 0.3s;
}
&--6 {
animation-duration: 1.2s;
animation-delay: 0.3s;
}
}
@keyframes flyIn {
0% {
transform: translateX(-100%);
opacity: 0;
}
100% {
transform: translateX(0);
opacity: 1;
}
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.