Last active
December 30, 2015 12:59
-
-
Save mzsanford/7832515 to your computer and use it in GitHub Desktop.
CSS Animation to make a collection of elements tumble off screen
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
@-webkit-keyframes fallOutCW { | |
0% { | |
-webkit-transform: translateY(0); | |
} | |
50% { | |
-webkit-transform: translateY(1000px) rotate(90deg); | |
} | |
100% { | |
-webkit-transform: translateY(2000px); | |
} | |
} | |
@-webkit-keyframes fallOutCCW { | |
0% { | |
-webkit-transform: translateY(0); | |
} | |
50% { | |
-webkit-transform: translateY(1000px) rotate(-90deg); | |
} | |
100% { | |
-webkit-transform: translateY(2000px); | |
} | |
} | |
.fallOut { | |
&:nth-of-type(even) { | |
-webkit-animation-name: fallOutCCW; | |
} | |
&:nth-of-type(odd) { | |
-webkit-animation-name: fallOutCW; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently webkit only. Multi-browser support coming once I tweak the fall out a bit more