Gooey Split
A drop of gum stretches to the new tab, lets go and whips in.
The prompt
Build me an animated bottom tab bar as one dependency-free component for my app. My stack is: [React / React Native / SwiftUI / Vue / plain web component]. Rules: - Four tabs. An `active` index (0 to 3), a way to select a tab from code, and a change callback. - Draw the animation as a pure function of progress p (0 to 1) for the current tap, every frame. No CSS transitions. - Three acts: Press (the tapped icon reacts in the first 15 percent), Travel (the idea below), Settle (an overshoot or wobble that rings out). About 1 to 1.3 seconds in total, a little longer for a longer trip. - Use a real icon set (Phosphor: regular weight for inactive tabs, fill for the active one). Icons about 44 percent of the bar's height. - Each tab has its own accent colour. Change colour with a hard switch or a wipe, never by blending two saturated colours. - Soft layered shadows, a hairline highlight on the top edge, everything crisp at 3x. The bar: Gooey Split. A glossy white pill bar. A glossy drop of gum (radial gradient, one specular highlight) sits behind the active icon, which is white and filled inside it. On a tap the head of the drop shoots to the new tab while its tail stays behind, joined by a thinning strand. Draw the drop as one vector path (two circles and a strand built from cubic curves), not with a blur filter. The tail lets go at about 45 percent and whips in, then the drop wobbles like jelly and takes the new tab's colour. The white filled icons show only where the gum covers them: clip them with the drop's outline.
How to use the code
<script type="module" src="gooey.js"></script>
<tb-gooey style="display:block; width:390px; height:130px"></tb-gooey>
<script type="module">
const bar = document.querySelector("tb-gooey");
bar.addEventListener("change", (e) => console.log("tab", e.detail.active));
// bar.select(2); bar.setAttribute("active", "1");
</script>