Skip to content

Instantly share code, notes, and snippets.

@mzsanford
Last active December 30, 2015 12:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mzsanford/7832515 to your computer and use it in GitHub Desktop.
Save mzsanford/7832515 to your computer and use it in GitHub Desktop.
CSS Animation to make a collection of elements tumble off screen
@-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;
}
}
@mzsanford
Copy link
Author

Currently webkit only. Multi-browser support coming once I tweak the fall out a bit more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment