Created
August 9, 2020 15:58
-
-
Save jsmeltzer/391ae7f851a33bf884dbdaa295427513 to your computer and use it in GitHub Desktop.
Shockwave hover animation
This file contains 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
button { | |
position: relative; | |
outline: 1px solid transparent; | |
border-radius: 50%; | |
border: 1px solid #bdc3c7; | |
width: 80px; | |
height: 80px; | |
background: none; | |
user-select: none; | |
} | |
button:after { | |
content: ""; | |
position: absolute; | |
top: 0; | |
left: 0; | |
display: block; | |
border-radius: 50%; | |
width: 79px; | |
height: 79px; | |
} | |
button:hover { | |
cursor: pointer; | |
border: 1px solid #27ae60; | |
transition: border-color 0.3s ease-in; | |
} | |
button:hover:after { | |
animation: shockwave 1s ease-in infinite; | |
} | |
@keyframes shockwave { | |
0% { | |
transform: scale(1); | |
box-shadow: 0 0 2px #27ae60; | |
opacity: 1; | |
} | |
100% { | |
transform: scale(1); | |
opacity: 0; | |
box-shadow: 0 0 50px #145b32, inset 0 0 10px #27ae60; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment