In this tutorial, you will learn how to create a spiral text animation using pure CSS. Watch the video below for a detailed tutorial.
<body>
<ul>
<li>Lorem ipsum dolor sit amet.</li>
<li>Ab perspiciatis laborum eos</li>
<li>nostrum neque et voluptates error</li>
<li>sit voluptate labore.</li>
<li>Et galisum magni non praesentium</li>
<li>accusantium est deserunt esse.</li>
<li>Eum laborum corporis et</li>
<li>earum cumque est nulla ratione?</li>
<li>Ut ipsa saepe aut distinctio</li>
<li>veniam nam veritatis minima</li>
<li>aut minima repellendus vel</li>
<li>porro necessitatibus.</li>
<li>Qui dolores itaque qui</li>
<li>autem deserunt 33 temporibus</li>
<li>similique id dolore atque non</li>
</ul>
</body>
body {
margin: 0;
background-color: #2e3537;
color: white;
font-family: 'Arial', sans-serif;
}
ul {
list-style: none;
height: 100vh;
max-height: 800px;
min-height: 400px;
overflow: hidden;
text-align: center;
perspective: 900px;
}
li {
position: absolute;
top: 0;
width: 100%;
font-size: 23px;
font-weight: bold;
transform: translateY(100vh);
animation: animate 5s linear infinite;
}
@keyframes animate {
0% {
transform: rotateY(90deg) translateY(105vh) rotate(0deg);
}
50% {
transform: rotateY(0deg) translateY(50vh) rotate(0deg);
}
100% {
transform: rotateY(-90deg) translateY(-5vh) rotate(0deg);
}
}
li:nth-child(1) {
animation-delay: 0.3s;
right: 1rem;
}
li:nth-last-child(1) {
right: 1rem;
}
li:nth-child(2) {
animation-delay: 0.6s;
right: 2rem;
}
li:nth-last-child(2) {
right: 2rem;
}
li:nth-child(3) {
animation-delay: 1s;
right: 3rem;
}
li:nth-last-child(3) {
right: 3rem;
}
li:nth-child(4) {
animation-delay: 1.3s;
right: 4rem;
}
li:nth-last-child(4) {
right: 4rem;
}
li:nth-child(5) {
animation-delay: 1.6s;
right: 5rem;
}
li:nth-last-child(5) {
right: 5rem;
}
li:nth-child(6) {
animation-delay: 2s;
right: 6rem;
}
li:nth-last-child(6) {
right: 6rem;
}
li:nth-child(7) {
animation-delay: 2.3s;
right: 7rem;
}
li:nth-last-child(7) {
right: 7rem;
}
li:nth-child(8) {
animation-delay: 2.6s;
right: 8rem;
}
li:nth-last-child(8) {
right: 8rem;
}
li:nth-child(9) {
animation-delay: 3s;
}
li:nth-child(10) {
animation-delay: 3.3s;
}
li:nth-child(11) {
animation-delay: 3.6s;
}
li:nth-child(12) {
animation-delay: 4s;
}
li:nth-child(13) {
animation-delay: 4.3s;
}
li:nth-child(14) {
animation-delay: 4.6s;
}
li:nth-child(15) {
animation-delay: 5s;
}