Skip to content

Instantly share code, notes, and snippets.

@imbhargav5
Created July 20, 2020 19:48
Show Gist options
  • Save imbhargav5/e768b5815df899e39ab21957d608f050 to your computer and use it in GitHub Desktop.
Save imbhargav5/e768b5815df899e39ab21957d608f050 to your computer and use it in GitHub Desktop.
Wiggle animation for a Button
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