Created
July 17, 2014 22:27
-
-
Save dunn/fc1f8ac2b59c5b510bb8 to your computer and use it in GitHub Desktop.
how to do spinning animations with css
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
.ghost::before { | |
content: "👻"; | |
padding-right: 5em; | |
font-style: normal; | |
/* position: fixed or absolute is absolutely essential and nobody told me */ | |
position: absolute; | |
-webkit-animation: ghost 4s linear infinite; | |
-moz-animation: ghost 4s linear infinite; | |
-o-animation: ghost 4s linear infinite; | |
animation: ghost 4s linear infinite; | |
} | |
.one::before { | |
-webkit-animation-delay: -1s; | |
-moz-animation-delay: -1s; | |
-o-animation-delay: -1s; | |
animation-delay: -1s; | |
} | |
.two::before { | |
-webkit-animation-delay: -2s; | |
-moz-animation-delay: -2s; | |
-o-animation-delay: -2s; | |
animation-delay: -2s; | |
} | |
.three::before { | |
-webkit-animation-delay: -3s; | |
-moz-animation-delay: -3s; | |
-o-animation-delay: -3s; | |
animation-delay: -3s; | |
} | |
@-moz-keyframes ghost { | |
from { | |
-moz-transform: rotate(0deg); | |
transform: rotate(0deg); | |
} | |
to { | |
-moz-transform: rotate(360deg); | |
transform: rotate(360deg); | |
} | |
} | |
@-webkit-keyframes ghost { | |
from { | |
-webkit-transform: rotate(0deg); | |
transform: rotate(0deg); | |
} | |
to { | |
-webkit-transform: rotate(360deg); | |
transform: rotate(360deg); | |
} | |
} | |
@keyframes ghost { | |
from { | |
-moz-transform: rotate(0deg); | |
-ms-transform: rotate(0deg); | |
-o-transform: rotate(0deg); | |
-webkit-transform: rotate(0deg); | |
transform: rotate(0deg); | |
} | |
to { | |
-moz-transform: rotate(360deg); | |
-ms-transform: rotate(360deg); | |
-o-transform: rotate(360deg); | |
-webkit-transform: rotate(360deg); | |
transform: rotate(360deg); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment