Created
April 30, 2020 04:03
-
-
Save jwenjian/b73fbccd3d454f6ffeae355f459dd64d to your computer and use it in GitHub Desktop.
heartbeat on image with 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
<div> | |
<img class="heartbeat" src="https://via.placeholder.com/150"/> | |
</div> | |
/*heartbeat*/ | |
.heartbeat | |
{ | |
border-radius: 50%; | |
box-shadow: 0px 5px 10px red; | |
-webkit-animation: heartbeat 8s; | |
animation: heartbeat 8s; | |
-webkit-animation-timing-function: ease-out; | |
animation-timing-function: ease-out; | |
-webkit-animation-iteration-count: infinite; | |
animation-iteration-count: infinite; | |
} | |
@keyframes heartbeat | |
{ | |
0%, 20%, 40%, 60%, 80%, 100% | |
{ | |
box-shadow: 0px 5px 15px red; | |
transform: scale(1); | |
} | |
10%, 30%, 50%, 70%, 90% | |
{ | |
box-shadow: 0px 5px 0px red; | |
transform: scale(1.15); | |
} | |
} | |
@-webkit-keyframes heartbeat | |
{ | |
0%, 20%, 40%, 60%, 80%, 100% | |
{ | |
-webkit-transform: scale(1); | |
} | |
10%, 30%, 50%, 70%, 90% | |
{ | |
-webkit-transform: scale(1.15); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment