Last active
June 20, 2020 19:42
-
-
Save nemtsov/3a14bfcd8459386eca51c063887a2fc2 to your computer and use it in GitHub Desktop.
Anchor pulsing with CSS box-shadow
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
.pulse { | |
padding: 2px 5px; | |
display: inline-flex; | |
justify-content: center; | |
align-items: center; | |
border-radius: 8px; | |
cursor: pointer; | |
animation: pulse 3s infinite; | |
color: hsl(340, 86%, 43%); | |
} | |
.pulse:hover { | |
animation: none; | |
} | |
@keyframes pulse { | |
0% { | |
box-shadow: 0 0 0 0 hsla(340, 86%, 53%, 0.8); | |
background: hsla(340, 86%, 53%, 0.8); | |
color: hsl(340, 86%, 99%); | |
} | |
70% { | |
box-shadow: 0 0 0 7px hsla(340, 86%, 83%, 0); | |
background: hsla(340, 86%, 83%, 0); | |
} | |
100% { | |
box-shadow: 0 0 0 0 hsla(340, 86%, 99%, 0); | |
background: hsla(340, 86%, 99%, 0); | |
} | |
} |
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
<a href="#" class="pulse">look here</a> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment