Last active
August 29, 2015 14:16
-
-
Save goldhand/33d0721c9b80a91995d4 to your computer and use it in GitHub Desktop.
Shakes an element on hover
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 spaceboots { | |
0% { -webkit-transform: translate(2px, 1px) rotate(0deg); } | |
10% { -webkit-transform: translate(-1px, -2px) rotate(-1deg); } | |
20% { -webkit-transform: translate(-3px, 0px) rotate(1deg); } | |
30% { -webkit-transform: translate(0px, 2px) rotate(0deg); } | |
40% { -webkit-transform: translate(1px, -1px) rotate(1deg); } | |
50% { -webkit-transform: translate(-1px, 2px) rotate(-1deg); } | |
60% { -webkit-transform: translate(-3px, 1px) rotate(0deg); } | |
70% { -webkit-transform: translate(2px, 1px) rotate(-1deg); } | |
80% { -webkit-transform: translate(-1px, -1px) rotate(1deg); } | |
90% { -webkit-transform: translate(2px, 2px) rotate(0deg); } | |
100% { -webkit-transform: translate(1px, -2px) rotate(-1deg); } | |
} | |
.shaky-elem:hover { | |
-webkit-animation-name: 'spaceboots'; | |
-webkit-animation-duration: 0.8s; | |
-webkit-transform-origin: 50% 50%; | |
-webkit-animation-iteration-count: infinite; | |
-webkit-animation-timing-function: linear; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment