Infinite Loop
Home
Snippets
Infinite Loop
HTML
CSS
JS
<div class="container"> <div class="wrapper"> <div class="swirl"> <span>L</span> <span>E</span> <span>A</span> <span>R</span> <span>N</span> <span>I</span> <span>N</span> <span>G</span> <span> </span> <span>A</span> <span>X</span> <span>I</span> <span>S</span> <span> </span> <span>T</span> <span>U</span> <span>T</span> <span>O</span> <span>R</span> <span>I</span> <span>A</span> <span>L</span> <span>S</span> </div> </div> <div class="wrapper"> <div class="swirl"> <span>L</span> <span>E</span> <span>A</span> <span>R</span> <span>N</span> <span>I</span> <span>N</span> <span>G</span> <span> </span> <span>A</span> <span>X</span> <span>I</span> <span>S</span> <span> </span> <span>T</span> <span>U</span> <span>T</span> <span>O</span> <span>R</span> <span>I</span> <span>A</span> <span>L</span> <span>S</span> </div> </div> </div>
body { margin: 0; background: #000; overflow: hidden; display: grid; height: 100vh; place-items: center; container-type: size; } .container { position: relative; display: flex; font-size: min(.9cqh, .45cqw); --h: 100em; height: var(--h); width: calc(2*var(--h) - 5.5em); } .wrapper { position: absolute; height: 100%; width: unset; aspect-ratio: 1; display: grid; &:nth-child(2 of .wrapper) { right: 0; bottom: unset; } } .swirl { position: absolute; inset: 0; --dur: 10s; display: grid; align-items: center; justify-items: unset; animation: spin var(--dur) linear infinite; :nth-child(2 of .wrapper) & { animation-direction: reverse; } } span { position: absolute; width: 50%; height: unset; color: #fff; font-family: monospace; font-weight: bold; font-size: calc(var(--h)/10); rotate: calc(360deg/28*var(--nth)*var(--dir)); animation: fade var(--dur) linear infinite; animation-delay: calc(-1*var(--dur)/28 * var(--nth)); --glow: hsl(calc(360deg/28*var(--nth)) 100% 50%); text-shadow: 0 0 1em var(--glow), 0 0 .5em var(--glow), 0 0 .25em var(--glow); &:nth-child(1) { --nth: 1;} &:nth-child(2) { --nth: 2;} &:nth-child(3) { --nth: 3;} &:nth-child(4) { --nth: 4;} &:nth-child(5) { --nth: 5;} &:nth-child(6) { --nth: 6;} &:nth-child(7) { --nth: 7;} &:nth-child(8) { --nth: 8;} &:nth-child(9) { --nth: 9;} &:nth-child(10) { --nth: 10;} &:nth-child(11) { --nth: 11;} &:nth-child(12) { --nth: 12;} &:nth-child(13) { --nth: 13;} &:nth-child(14) { --nth: 14;} &:nth-child(15) { --nth: 15;} &:nth-child(16) { --nth: 16;} &:nth-child(17) { --nth: 17;} &:nth-child(18) { --nth: 18;} &:nth-child(19) { --nth: 19;} &:nth-child(20) { --nth: 20;} &:nth-child(21) { --nth: 21;} &:nth-child(22) { --nth: 22;} &:nth-child(23) { --nth: 23;} &:nth-child(24) { --nth: 24;} :nth-child(1 of .wrapper) & { left: 50%; text-align: end; transform-origin: 0% 50%; --dir: 1; animation-direction: reverse; } :nth-child(2 of .wrapper) & { right: 50%; text-align: start; transform-origin: 100% 50%; --dir: -1; } } @keyframes spin { 100% { rotate: 360deg; } } @keyframes fade { 0%, 10% { opacity: 0; } 55%, 100% { opacity: 1; } } @media (orientation: portrait) { .container { font-size: min(.9cqw,.45cqh); width: var(--h); height: calc(2*var(--h) - 11.5em); } .wrapper { width: 100%; height: unset; right: unset; bottom: 0; } .swirl { justify-items: center; align-items: unset; } span { height: 50%; width: unset; display: grid; :nth-child(1 of .wrapper) & { bottom: 50%; left: unset; text-align: end; transform-origin: 50% 100%; --dir: 1; animation-direction: reverse; } :nth-child(2 of .wrapper) & { top: 50%; right: unset; text-align: start; transform-origin: 50% 0%; --dir: -1; align-items: end; } } }
//javascript
Ad #1
Ad #2
Scroll to Top