JSFiddle - React, Tailwind, and code Playground
by Marc Malignan
HTML
<div id=container>
<div id=liquid></div>
</div>
CSS
@-webkit-keyframes liquid {
0% { height: 0%; }
100% { height: 100%; }
}
@-webkit-keyframes lens {
0% { width:0; height:0; margin:0 auto 0; -webkit-animation-timing-function:'cubic-bezier(0,.2,.8,1)'; }
50% { width:144px; height:144px; margin:-72px auto 0; -webkit-animation-timing-function:'cubic-bezier(1,0,0,1)'; }
100% { width:0; height:0; margin:0 auto 0; }
}
body {
background: #eee;
}
#container {
position: absolute;
top:50%; left:50%;
width:200px; height:200px;
margin: -100px 0 0 -100px;
border-radius: 50%;
background: white;
overflow: hidden;
}
#liquid {
position: absolute;
width: 100%;
bottom: 0;
background: green;
-webkit-animation: liquid 5s cubic-bezier(.7,0,.3,1) infinite alternate;
}
#liquid:before {
content: '';
display: block;
background: lightgreen;
border-radius: 100% 0;
-webkit-transform: scaleY(0.3) rotate(45deg);
-webkit-animation: lens 5s linear infinite alternate;
}