-
-
Save standino/3691ac882e2ef3751632c8ebe7cfe8d5 to your computer and use it in GitHub Desktop.
Animation along a circular path - Solution 2
This file contains hidden or 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
| /** | |
| * Animation along a circular path - Solution 2 | |
| */ | |
| @keyframes spin { | |
| from { | |
| transform: rotate(0turn) | |
| translateY(-150px) translateY(50%) | |
| rotate(1turn) | |
| } | |
| to { | |
| transform: rotate(1turn) | |
| translateY(-150px) translateY(50%) | |
| rotate(0turn); | |
| } | |
| } | |
| .avatar { | |
| animation: spin 3s infinite linear; | |
| } | |
| /* Anything below this is just styling */ | |
| .avatar { | |
| display: block; | |
| width: 50px; | |
| margin: calc(50% - 25px) auto 0; | |
| border-radius: 50%; | |
| overflow: hidden; | |
| } | |
| .path { | |
| width: 300px; height: 300px; | |
| padding: 20px; | |
| margin: 100px auto; | |
| border-radius: 50%; | |
| background: #fb3; | |
| } |
This file contains hidden or 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="path"> | |
| <img src="http://lea.verou.me/book/adamcatlace.jpg" class="avatar" /> | |
| </div> |
This file contains hidden or 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
| // alert('Hello world!'); |
This file contains hidden or 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-vertical","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment