Created
July 20, 2020 19:48
-
-
Save imbhargav5/e768b5815df899e39ab21957d608f050 to your computer and use it in GitHub Desktop.
Wiggle animation for a Button
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
import styled, {keyframes} from "styled-components" | |
const wiggle = keyframes` | |
0%,100%{ | |
transform: scale(1.1) rotateZ(0deg) ; | |
} | |
16%,48%{ | |
transform: scale(1.1) rotateZ(-3deg); | |
} | |
32%,64%{ | |
transform: scale(1.1) rotateZ(3deg); | |
} | |
` | |
export const Button = styled.button` | |
outline: none; | |
border: 1px solid #333; | |
padding: 0.4rem 1rem; | |
background: #f2f2f2; | |
cursor: pointer; | |
:hover{ | |
animation: ${wiggle} 1s infinite; | |
} | |
`; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment