JSFiddle - React, Tailwind, and code Playground
by Minko Gechev
HTML
<div class="card">
<div class="label">
I ❤ U
</div>
<div class="heart">
<div class="top-1"></div>
<div class="top-2"></div>
<div class="bottom"></div>
</div>
</div>
CSS
.card {
margin: 100px;
position: relative;
}
.label {
position: absolute;
top: 40px;
left: 35px;
z-index: 100;
color: white;
font-size: 50px;
text-shadow: 0px 0px 15px #CC6900;
}
.heart {
z-index: 300;
width: 105px;
position: absolute;
-webkit-transition: -webkit-transform, 1s;
-webkit-transform-origin: top left;
animation: beat 1s;
-webkit-animation: beat 1s;
}
@keyframes beat {
from {
-webkit-transform: scale(1, 1);
}
to {
-webkit-transform: scale(2, 2);
}
}
.heart:hover {
-webkit-transform: rotate(65deg);
}
.bottom {
border-top: 68px solid red;
border-left: 87px solid transparent;
border-right: 87px solid transparent;
width: 0px;
position: absolute;
top: 79px;
left: 8px;
}
.top-1 {
width: 105px;
height: 92.5px;
background-color: red;
border-top-left-radius: 52.5px;
border-top-right-radius: 52.5px;
border-bottom-left-radius: 40px;
position: absolute;
left: -1px;
}
.top-2 {
width: 105px;
height: 92.5px;
background-color: red;
border-top-left-radius: 52.5px;
border-top-right-radius: 52.5px;
border-bottom-right-radius: 40px;
position: absolute;
left: 85.5px;
}