Last active
September 20, 2023 08:11
-
-
Save LeaVerou/1760283 to your computer and use it in GitHub Desktop.
Move in a circle without wrapper elements
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
/** | |
* Move in a circle without wrapper elements | |
* Idea by Aryeh Gregor, simplified by Lea Verou | |
*/ | |
@keyframes rot { | |
from { | |
transform: rotate(0deg) | |
translate(-150px) | |
rotate(0deg); | |
} | |
to { | |
transform: rotate(360deg) | |
translate(-150px) | |
rotate(-360deg); | |
} | |
} | |
.smile { | |
width: 40px; | |
height: 40px; | |
position: absolute; | |
top: 200px; | |
left: 50%; | |
margin: -20px; | |
font-size: 100px; | |
animation: rot 3s infinite linear; | |
} |
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="smile">☺</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
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"} |
Author
LeaVerou
commented
Feb 7, 2012
via email
Yeah I'm gonna do a blog post about the technique soon.
##
Sent from my iPhone. Please excuse weird typos and/or terseness.
…On 8 Φεβ 2012, at 0:06, Roman Komarov ***@***.*** wrote:
Wow, you could do a lot of things using the same transformation function in a single transform and chaining! It's really a nice thing to investigate more.
---
Reply to this email directly or view it on GitHub:
https://gist.github.com/1760283
Had to try it out :)
http://jsfiddle.net/flrnz/XyGuw/
Good job !
This inspired me some experiments :
http://dabblet.com/gist/3451803
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment