Here is the code snippet from your codepen:
HTML
<g id="liquid">
<path id="Fill-13" fill="#956" d="M3.7 88.532h26.535v-2.738H3.7z"/>
<path id="Fill-14" fill="#956" d="M3.7 88.532h13.267v-2.738H3.7z"/>
</g> ^^^^^
I noticed that changing the value of 2.738 to 1 allows for better manipulation of the js numbers.
<path id="Fill-14" fill="#956" d="M3.7 88.532h13.267v-1H3.7z"/>
Javascript
tlBubbles.staggerTo(
bubbles,
0.8,
{ y: -20, ease: Power2.easeOut, scale: 0.5, autoAlpha: 0 },
0.4
);
The position of the bubbles changes when you adjust the y
value.
tlLiquid
.set(liquid, { transformOrigin: "50% 100%" })
.to(liquid, 4, { scaleY: 10, ease: Elastic.easeInOut.config(1, 0.4) });
By setting the HTML code to 1 for every 10 in the scaleY
, you can create a "fluid level meter."