Skip to content

Instantly share code, notes, and snippets.

@607011
Created March 24, 2016 13:34
Show Gist options
  • Save 607011/a06a22204be7667f6f78 to your computer and use it in GitHub Desktop.
Save 607011/a06a22204be7667f6f78 to your computer and use it in GitHub Desktop.
Styles for "hammering" element
@keyframes hammer {
from,20%,53%,80%,to {
-webkit-animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0)
}
40%,43% {
-webkit-animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
-webkit-transform: translate3d(0, -30px, 0);
transform: translate3d(0, -30px, 0)
}
70% {
-webkit-animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
-webkit-transform: translate3d(0, -15px, 0);
transform: translate3d(0, -15px, 0)
}
90% {
-webkit-transform:translate3d(0, -4px, 0);
transform:translate3d(0, -4px, 0);
}
}
.hammer{
-webkit-animation-name: hammer;
animation-name: hammer;
-webkit-transform-origin: center bottom;
transform-origin: center bottom;
}
.infinite {
-webkit-animation-iteration-count: infinite;
animation-iteration-count: infinite;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment