Skip to content

Instantly share code, notes, and snippets.

@theStrangeAdventurer
Created March 5, 2019 08:12
Show Gist options
  • Save theStrangeAdventurer/6c12a595e0030234c366c12069f2a1dc to your computer and use it in GitHub Desktop.
Save theStrangeAdventurer/6c12a595e0030234c366c12069f2a1dc to your computer and use it in GitHub Desktop.
Shake infinite animation
.element {
-webkit-animation: shake;
animation: shake;
-webkit-animation-iteration-count: infinite;
animation-iteration-count: infinite;
-webkit-animation-duration: 4s;
animation-duration: 4s;
-webkit-animation-timing-function: cubic-bezier(0.36, 0.07, 0.19, 0.97);
animation-timing-function: cubic-bezier(0.36, 0.07, 0.19, 0.97);
-webkit-animation-delay: 4s;
animation-delay: 4s;
}
@-webkit-keyframes shake {
2%, 18% {
-webkit-transform: translate3d(-1px, 0, 0);
transform: translate3d(-1px, 0, 0);
}
4%, 16% {
-webkit-transform: translate3d(2px, 0, 0);
transform: translate3d(2px, 0, 0);
}
6%, 10%, 14% {
-webkit-transform: translate3d(-4px, 0, 0);
transform: translate3d(-4px, 0, 0);
}
8%, 12% {
-webkit-transform: translate3d(4px, 0, 0);
transform: translate3d(4px, 0, 0);
}
20%, 100% {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
}
@keyframes shake {
2%, 18% {
-webkit-transform: translate3d(-1px, 0, 0);
transform: translate3d(-1px, 0, 0);
}
4%, 16% {
-webkit-transform: translate3d(2px, 0, 0);
transform: translate3d(2px, 0, 0);
}
6%, 10%, 14% {
-webkit-transform: translate3d(-4px, 0, 0);
transform: translate3d(-4px, 0, 0);
}
8%, 12% {
-webkit-transform: translate3d(4px, 0, 0);
transform: translate3d(4px, 0, 0);
}
20%, 100% {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment