You could also use CSS crop on some divs instead of an image, that will make your code something like this:
A container, two hearth shaped divs and a button for triggering the fill
<!-- A wrapper for the hearths -->
<div class="container">
<!-- A shape that serves as the placeholder -->
<div class="hearth base"></div>
<!-- The shape that is going to be filled -->
<div class="hearth color"></div>
</div>
<button onclick="fillHearth()" >Fill Hearth</button>
The styles
.container {
margin: 70px;
display:flex;
flex-wrap: wrap;
gap: 10px 120px;
position: relative;
}
.hearth {
position: absolute;
width: 24px;
height: 24px;
clip-path: path("M12 4.248c-3.148-5.402-12-3.825-12 2.944 0 4.661 5.571 9.427 12 15.808 6.43-6.381 12-11.147 12-15.808 0-6.792-8.875-8.306-12-2.944z");
transform: scale(5);
}
.base {
background: #cecece;
}
.color {
background: transparent;
}
The script that fills the hearth in an interval of half a second
function fillHearth(argument) {
let current = 0;
console.log('Filling hearth');
const interval = setInterval(() => {
console.log('Current: ', current);
document.querySelector('div.color').style.background =
`linear-gradient(to top, #FF5252 ${current}%, transparent 0)`;
current += 10;
if (current > 100) clearInterval(interval);
}, 500);
}
The crop shape was taken from here