Skip to content

Instantly share code, notes, and snippets.

@jsmeltzer
Created August 9, 2020 15:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jsmeltzer/391ae7f851a33bf884dbdaa295427513 to your computer and use it in GitHub Desktop.
Save jsmeltzer/391ae7f851a33bf884dbdaa295427513 to your computer and use it in GitHub Desktop.
Shockwave hover animation
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