SHOWCASE HUB

ANIMATED FLUID TAB BAR UI #15

Original Concept by Farhad Ahmed (Dribbble) • Liquid SVG Notch & Spring Physics

CLICK ANY TAB TO WATCH LIQUID NOTCH MORPH WITH REAL SPRING PHYSICS
FLUID NOTCH SVG & SPRING MATH ENGINE
// Mathematical Cubic Bezier SVG Path Generator
function generateNotchPath(cx, w = 440, h = 84, r = 24) {
  const notchR = 48;      // Half-width of the liquid cutout
  const notchDepth = 34;  // Dip depth below y=0
  
  return [
    `M ${r} 0`,
    `L ${cx - notchR} 0`,
    `C ${cx - notchR + 18} 0, ${cx - 26} ${notchDepth}, ${cx} ${notchDepth}`,
    `C ${cx + 26} ${notchDepth}, ${cx + notchR - 18} 0, ${cx + notchR} 0`,
    `L ${w - r} 0`,
    `A ${r} ${r} 0 0 1 ${w} ${r}`,
    `L ${w} ${h - r}`,
    `A ${r} ${r} 0 0 1 ${w - r} ${h}`,
    `L ${r} ${h}`,
    `A ${r} ${r} 0 0 1 0 ${h - r}`,
    `L 0 ${r}`,
    `A ${r} ${r} 0 0 1 ${r} 0`,
    `Z`
  ].join(' ');
}
// Real-time Spring Physics Interpolator
// Hooke's Law Spring with Velocity Damping
const force = -stiffness * (currentX - targetX);
const dampingForce = -damping * velocity;
velocity += (force + dampingForce) * dt;
currentX += velocity * dt;
100% VANILLA JS • ZERO EXTERNAL PHYSICS LIBS