Skip to content

Instantly share code, notes, and snippets.

@MattiSG
Created February 13, 2013 14:13
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 MattiSG/4944889 to your computer and use it in GitHub Desktop.
Save MattiSG/4944889 to your computer and use it in GitHub Desktop.
[animate.css](http://daneden.me/animate/) extension: `popAndBounce`. This one is intended to be repeated.
@-webkit-keyframes popAndBounce {
0%, 40% {
-webkit-transform: scale(1);
}
5% {
-webkit-transform: scale(0.9);
opacity: 0.7;
}
10%, 15%, 28%, 35% {
-webkit-transform: scale(1.2) translateX(0);
opacity: 1;
}
20%, 24% {
-webkit-transform: scale(1.2) translateX(-20px);
}
22%, 26% {
-webkit-transform: scale(1.2) translateX(20px);
}
}
@-moz-keyframes popAndBounce {
0%, 40% {
-moz-transform: scale(1);
}
5% {
-moz-transform: scale(0.9);
opacity: 0.7;
}
10%, 15%, 28%, 35% {
-moz-transform: scale(1.2) translateX(0);
opacity: 1;
}
20%, 24% {
-moz-transform: scale(1.2) translateX(-20px);
}
22%, 26% {
-moz-transform: scale(1.2) translateX(20px);
}
}
@-o-keyframes popAndBounce {
0%, 40% {
-o-transform: scale(1);
}
5% {
-o-transform: scale(0.9);
opacity: 0.7;
}
10%, 15%, 28%, 35% {
-o-transform: scale(1.2) translateX(0);
opacity: 1;
}
20%, 24% {
-o-transform: scale(1.2) translateX(-20px);
}
22%, 26% {
-o-transform: scale(1.2) translateX(20px);
}
}
@keyframes popAndBounce {
0%, 40% {
transform: scale(1);
}
5% {
transform: scale(0.9);
opacity: 0.7;
}
10%, 15%, 28%, 35% {
transform: scale(1.2) translateX(0);
opacity: 1;
}
20%, 24% {
transform: scale(1.2) translateX(-20px);
}
22%, 26% {
transform: scale(1.2) translateX(20px);
}
}
.popAndBounce {
-webkit-animation-name: popAndBounce;
-moz-animation-name: popAndBounce;
-o-animation-name: popAndBounce;
animation-name: popAndBounce;
}
.rejected {
@include vendor(animation-name, popAndBounce);
@include vendor(animation-iteration-count, infinite);
@include vendor(animation-duration, 5s);
z-index: 2;
}
@mixin vendor($property, $value){
-webkit-#{$property} :$value;
-moz-#{$property} :$value;
-ms-#{$property} :$value;
-o-#{$property} :$value;
#{$property} :$value;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment