JSFiddle - React, Tailwind, and code Playground
HTML
<div id="heart-container">
<div id="heart"></div>
</div>
<a href="http://jsfiddle.net/c9yub844/9/" target="_blank">New version with multiple keyframes</a>
CSS
#heart {
position: relative;
width: 100px;
height: 90px;
}
#heart:before,
#heart:after {
position: absolute;
-webkit-animation: heart 1s linear infinite;
content: "";
left: 50px;
top: 0;
width: 50px;
height: 80px;
background: red;
-moz-border-radius: 50px 50px 0 0;
border-radius: 50px 50px 0 0;
-webkit-transform: rotate(-45deg);
transform: rotate(-45deg);
-webkit-transform-origin: 0 100%;
transform-origin: 0 100%;
}
#heart:after {
left: 0;
-webkit-transform: rotate(45deg);
transform: rotate(45deg);
-webkit-transform-origin: 100% 100%;
}
#heart-container {
width: 100px;
height: 90px;
animation: pulsate 0.5s infinite;
-webkit-animation: pulsate 0.5s infinite;
}
@keyframes pulsate {
0% {
transform: scale(1);
}
50% {
transform: scale(1.5);
}
100% {
transform: scale(1);
}
}
@-webkit-keyframes pulsate {
0% {
-webkit-transform: scale(1);
}
50% {
-webkit-transform: scale(1.5);
}
100% {
-webkit-transform: scale(1);
}
}