A Pen by Amit Sheen on CodePen.
Created
May 1, 2023 14:13
-
-
Save joe-bro-1/b9aa9453cabbce3ec5f43b31af003bb6 to your computer and use it in GitHub Desktop.
Rotating text
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="rotate"> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://assets.codepen.io/1948355/twitterButton-2.1.0.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import url('https://fonts.googleapis.com/css2?family=Lobster&display=swap'); | |
*, *::before, *::after { | |
padding: 0; | |
margin: 0 auto; | |
box-sizing: border-box; | |
} | |
body { | |
font-family: 'Lobster', cursive; | |
background-color: #000; | |
color: #fff; | |
min-height: 100vh; | |
display: grid; | |
place-items: center; | |
} | |
$duration: 4s; | |
.rotate { | |
position: relative; | |
color: aquamarine; | |
font-size: 118px; | |
filter: blur(2px) contrast(4); | |
& > div { | |
position: absolute; | |
width: var(--size); height: var(--size); | |
background-color: #000; | |
transform: translate(-50%, -50%); | |
border-radius: 50%; | |
overflow: hidden; | |
animation: twist $duration var(--delay) infinite ease-in-out; | |
&::after { | |
content: 'Rotate'; | |
position: absolute; | |
left: 50%; top: 50%; | |
transform: translate(-50%, -50%); | |
} | |
@keyframes twist { | |
0% { transform: translate(-50%, -50%) rotateZ(0deg); } | |
50%, 100% { transform: translate(-50%, -50%) rotateZ(360deg); } | |
} | |
$count: 42; | |
@for $i from 0 to $count { | |
&:nth-child(#{$i + 1}) { | |
--size: #{($count - $i) * 7px}; | |
--delay: #{($duration * 0.5) / $count * ($count - $i)}; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment