<div class="wheel">
<div class="line"><p>Around the world</p></div>
<div class="line"><p>Around the world</p></div>
<div class="line"><p>Around the world</p></div>
<div class="line"><p>Around the world</p></div>
<div class="line"><p>Around the world</p></div>
<div class="line"><p>Around the world</p></div>
<div class="line"><p>Around the world</p></div>
<div class="line"><p>Around the world</p></div>
<div class="line"><p>Around the world</p></div>
<div class="line"><p>Around the world</p></div>
<div class="line"><p>Around the world</p></div>
<div class="line"><p>Around the world</p></div>
<div class="line"><p>Around the world</p></div>
<div class="line"><p>Around the world</p></div>
<div class="line"><p>Around the world</p></div>
<div class="line"><p>Around the world</p></div>
<div class="line"><p>Around the world</p></div>
<div class="line"><p>Around the world</p></div>
<div class="line"><p>Around the world</p></div>
<div class="line"><p>Around the world</p></div>
<div class="line"><p>Around the world</p></div>
</div>
html, body {
padding: 0;
margin: 0;
overflow: hidden;
}
body {
display: flex;
height: 100vh;
align-items: center;
}
.wheel {
width: 100%;
height: calc(30rem * 0.8);
}
.line p {
line-height: 0.8;
padding: 0;
margin: 0;
font-family: monospace;
text-transform: uppercase;
font-size: 3rem;
font-weight: bold;
letter-spacing: 0.75rem;
white-space: nowrap;
text-align: center;
}
@keyframes rotate {
0% {
opacity: 1;
transform: rotateX(90deg);
}
50% {
transform: rotateX(0);
}
100% {
opacity: 1;
transform: rotateX(-90deg);
}
}
@keyframes scaleToCenter {
0% {
transform: scale(0.9);
}
50% {
transform: scale(1.0);
}
100% {
transform: scale(0.9);
}
}
@keyframes moveDown {
0% {
top: 0;
}
100% {
top: 30rem;
}
}
.wheel {
position: relative;
}
.line {
width: 100%;
animation:
3s infinite forwards ease-in-out scaleToCenter,
3s infinite forwards ease-in-out moveDown
;
position: absolute;
}
.line p {
opacity: 0;
backface-visibility: hidden;
animation: 3s infinite forwards linear rotate;
}
.line:nth-child(2), .line:nth-child(2) p { animation-delay: 0.15s }
.line:nth-child(3), .line:nth-child(3) p { animation-delay: 0.3s }
.line:nth-child(4), .line:nth-child(4) p { animation-delay: 0.45s }
.line:nth-child(5), .line:nth-child(5) p { animation-delay: 0.6s }
.line:nth-child(6), .line:nth-child(6) p { animation-delay: 0.75s }
.line:nth-child(7), .line:nth-child(7) p { animation-delay: 0.9s }
.line:nth-child(8), .line:nth-child(8) p { animation-delay: 1.05s }
.line:nth-child(9), .line:nth-child(9) p { animation-delay: 1.2s }
.line:nth-child(10), .line:nth-child(10) p { animation-delay: 1.35s }
.line:nth-child(11), .line:nth-child(11) p { animation-delay: 1.5s }
.line:nth-child(12), .line:nth-child(12) p { animation-delay: 1.65s }
.line:nth-child(13), .line:nth-child(13) p { animation-delay: 1.8s }
.line:nth-child(14), .line:nth-child(14) p { animation-delay: 1.95s }
.line:nth-child(15), .line:nth-child(15) p { animation-delay: 2.1s }
.line:nth-child(16), .line:nth-child(16) p { animation-delay: 2.25s }
.line:nth-child(17), .line:nth-child(17) p { animation-delay: 2.4s }
.line:nth-child(18), .line:nth-child(18) p { animation-delay: 2.55s }
.line:nth-child(19), .line:nth-child(19) p { animation-delay: 2.7s }
.line:nth-child(20), .line:nth-child(20) p { animation-delay: 2.85s }
.line:nth-child(21), .line:nth-child(21) p { animation-delay: 3.0s }
.line {
perspective: 150rem;
perspective-origin: center;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.