JSFiddle - React, Tailwind, and code Playground
HTML
<div class="glass">
<div class="beer">
<img src="http://i.imgur.com/idIq4qb.png" />
<div class="filler" id="filler"></div>
</div>
</div>
CSS
body {
margin:0;
background-color:#d1dfea;
height:400px;
}
.glass {
min-height:24em;
display:flex;
align-items: center;
justify-content: center;
}
.beer {
position:relative;
}
.filler {
position:absolute;
border-top:2px solid #F9F1DC;
z-index:-1;
bottom:5px;
width:100%;
height:20%;
background-color:orange;
transition: all .5s ease-out;
}
JavaScript
var filler = document.getElementById('filler');
var border = 2, height = 20;
var animate = setInterval(function() {
if (border < 15) {
border += 0.20;
filler.style.borderTopWidth = border + 'px';
}
if (height < 68) {
height += 0.80;
filler.style.height = height + '%';
}
if (border>=15 && height>=68)
clearInterval(animate);
}, 50);