SHOWCASE HUB

GLASSMORPHIC EXPANDING TAB BAR UI #16

Recreation of Farhad Ahmed Dribbble Concept #2 • Frosted Liquid Glass & Expanding Dynamic Pill

CLICK ANY TAB TO SEE GLASS PILL EXPAND & GLIDE WITH FROSTED REFRACTION
FROSTED GLASS PILL & SPRING PHYSICS ENGINE
// Glass Capsule Dynamic Tracking Formula
function updatePillPosition(activeTabEl) {
  const barRect = navBar.getBoundingClientRect();
  const tabRect = activeTabEl.getBoundingClientRect();
  
  // Calculate relative left offset and width
  const targetLeft = tabRect.left - barRect.left;
  const targetWidth = tabRect.width;
  
  indicatorPill.style.left = `${targetLeft}px`;
  indicatorPill.style.width = `${targetWidth}px`;
}
// Expanding Label & Spring Transition
.glass-indicator-pill {
  transition: all 0.38s cubic-bezier(0.2, 0.9, 0.3, 1.25);
}
.tab-label-text {
  transition: max-width 0.38s cubic-bezier(0.2, 0.9, 0.3, 1.25),
              opacity 0.28s ease;
}
100% VANILLA JS • ACCELERATED GPU COMPOSITING