Skip to content
animorio
IT
Back to the library

Liquid bridge nav bar

Hover, SVGGSAP, CSS onlyAdvancedCompressed weight: Demo 11 KBGSAP 28 KBFreeDownload the zip

The main menu of Verdant Atelier, street furniture in wood and steel: six pills of dark lacquer on a grainy ivory, held together by liquid bridges computed in SVG. Under the pointer an item moves away on a spring, the bridges stretch, thin out and snap, leaving a tear of liquid hanging from the pill that bounces and is soaked back up; inside the liquid a yellow light follows the pointer. On the press the pill squeezes, then turns yellow and stays apart. Premium style, ivory, black lacquer and one yellow-green.

Rebuilt from scratch studying floema.com by Bürocratik: the idea is theirs; code, copy and images are ours. Read how it’s made

The code

A folder that runs on its own: index.html, style.css, script.js and the libraries from a CDN. The React and Vue tabs hold the same demo as a ready component, which switches its animations off when it leaves the page.

<!doctype html>
<!--
  "Liquid bridge nav bar" from Animorio · https://animorio.com
  License: free on your own sites and your clients’ sites, paid work included.
  Not for resale, redistribution, templates or code collections · https://animorio.com/en/license/
-->
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>The droplet nav bar with liquid bridges</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <main class="stage" data-stage>
    <div class="scene" data-scene>
      <p class="brand">
        <svg class="brand__mark" viewBox="0 0 20 20" aria-hidden="true">
          <path d="M4 16.5C4 9 9 3.8 16.5 3.5 16.2 11 11 16 4 16.5Z"/>
          <path d="M4 16.5L11.5 9"/>
        </svg>
        <span>Verdant Atelier</span>
      </p>

      <!-- the main nav: six pills of dark lacquer held together by liquid bridges. The bridges are drawn in SVG every
           frame (two circles per pair and a metaball between them); the light inside them follows the pointer -->
      <nav class="nav" data-nav aria-label="Main">
        <svg class="nav__liquid" data-svg aria-hidden="true">
          <defs>
            <filter id="lacquer" data-filter filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
              <feGaussianBlur in="SourceAlpha" stdDeviation="7" result="far"/>
              <feOffset in="far" dy="10" result="farO"/>
              <feFlood flood-color="#3a2f22" flood-opacity="0.16"/>
              <feComposite in2="farO" operator="in" result="shadowFar"/>
              <feGaussianBlur in="SourceAlpha" stdDeviation="1.2" result="near"/>
              <feOffset in="near" dy="1.5" result="nearO"/>
              <feFlood flood-color="#1b1512" flood-opacity="0.3"/>
              <feComposite in2="nearO" operator="in" result="shadowNear"/>
              <feGaussianBlur in="SourceAlpha" stdDeviation="3.2" result="soft"/>
              <feOffset in="soft" dy="4" result="softO"/>
              <feComposite in="SourceAlpha" in2="softO" operator="out" result="band"/>
              <feFlood flood-color="#ffffff" flood-opacity="0.09"/>
              <feComposite in2="band" operator="in" result="sheen"/>
              <feOffset in="SourceAlpha" dy="1" result="rimO"/>
              <feComposite in="SourceAlpha" in2="rimO" operator="out" result="rimBand"/>
              <feFlood flood-color="#fffbe8" flood-opacity="0.42"/>
              <feComposite in2="rimBand" operator="in" result="rim"/>
              <feMerge>
                <feMergeNode in="shadowFar"/>
                <feMergeNode in="shadowNear"/>
                <feMergeNode in="SourceGraphic"/>
                <feMergeNode in="sheen"/>
                <feMergeNode in="rim"/>
              </feMerge>
            </filter>
            <radialGradient id="glowFill">
              <stop offset="20%" stop-color="#e9e778" data-glow-stop/>
              <stop offset="100%" stop-color="#e9e778" stop-opacity="0"/>
            </radialGradient>
            <linearGradient id="shine" x1="0" y1="0" x2="0" y2="1">
              <stop offset="0" stop-color="#ffffff" stop-opacity="0.13"/>
              <stop offset="0.55" stop-color="#ffffff" stop-opacity="0.03"/>
              <stop offset="1" stop-color="#ffffff" stop-opacity="0"/>
            </linearGradient>
            <clipPath id="liquidClip">
              <path data-clip-bridges/>
              <path data-clip-pills/>
              <path data-clip-drops/>
            </clipPath>
          </defs>
          <g filter="url(#lacquer)" data-body>
            <path class="nav__bridges" data-bridges/>
            <path class="nav__drops" data-drops/>
            <g data-pills></g>
          </g>
          <g data-shines></g>
          <g clip-path="url(#liquidClip)">
            <ellipse class="nav__glow" data-glow cx="0" cy="0" rx="0" ry="0" fill="url(#glowFill)"/>
          </g>
        </svg>

        <button class="nav__item" type="button" data-item data-caption="Dune Bench, Cork Seat and 12 more">Benches</button>
        <button class="nav__item" type="button" data-item data-caption="Pine Shelter and 6 more">Shelters</button>
        <button class="nav__item" type="button" data-item data-caption="Trail Marker and 9 more">Signage</button>
        <button class="nav__item" type="button" data-item data-caption="Comporta, Serra da Estrela, Arrábida">Projects</button>
        <button class="nav__item" type="button" data-item data-caption="Wood and steel for parks, trails and beaches">About</button>
        <button class="nav__item nav__item--cart" type="button" data-item data-cart aria-label="Cart, 2 pieces"
                data-caption="pieces in your cart">
          <svg class="nav__bag" viewBox="0 0 16 16" aria-hidden="true">
            <path d="M3.2 5.6h9.6l-.7 7.6a1 1 0 0 1-1 .9H4.9a1 1 0 0 1-1-.9L3.2 5.6Z"/>
            <path d="M5.8 7.2V4.6a2.2 2.2 0 0 1 4.4 0v2.6"/>
          </svg>
          <span class="nav__count" data-count><span data-digit>2</span></span>
        </button>
      </nav>

      <p class="caption" aria-hidden="true"><span class="caption__line" data-cap>Dune Bench, Cork Seat and 12 more</span></p>
    </div>

    <!-- the pointer that walks the bar on its own; the viewer's own pointer or finger takes over -->
    <div class="cursor" data-cursor aria-hidden="true">
      <svg viewBox="0 0 22 24"><path d="M3 2.2l15.2 10.4-6.6 1.3 3.9 7.2-2.9 1.5-3.9-7.3-4.8 4.6L3 2.2Z"/></svg>
    </div>
    <p class="sr" aria-live="polite" data-live></p>
  </main>

  <script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/gsap.min.js"></script>
  <script src="script.js"></script>
</body>
</html>

Playground

Change values, colours and text with the controls and watch the animation respond live. Or write in the code yourself. Then download the folder with your changes.

28 values to change

Or ask your AI assistant for it

With the Animorio connector, Claude Code, ChatGPT, Cursor or VS Code take it from here, guide included, and fit it into your project. Paste this request:

Take “Liquid bridge nav bar” from Animorio and fit it into my site
Platform licenseFree on your sites and your clients’ sites. Want it inside a website builder, a template platform or a client dashboard? There’s a license for agencies and platforms.

What it does

On an ivory page with a fine grain and a lighter middle sits the Verdant Atelier menu, with the brand and its drawn leaf above: Benches, Shelters, Signage, Projects, About and the cart with its count. The items are pills of near-black lacquer, with a thread of light along the top edge, a soft sheen under it and a wide shadow on the paper; between one and the next the liquid makes a bridge, a soft neck like mercury. Benches, the chosen item, is yellow and stands apart. A drawn pointer comes in from below and passes over the items: the one under it moves 28 pixels away on each side on a spring that overshoots and comes back, the necks stretch, thin out and snap; where they broke a tear is left hanging from the end of the pill, tied by a neck of liquid; it springs back and is soaked up in six tenths of a second. Inside the lacquer a yellow light in difference chases the pointer, oval while it moves and round when it stops; the item's label widens a little and the line under the bar changes, rising, to what is behind it (Pine Shelter and 6 more, Trail Marker and 9 more, Comporta, Serra da Estrela, Arrábida). On Projects the pointer presses and holds: the pill squeezes and widens until the thin necks reach out to its neighbours again, the light grows, then it springs back, turns yellow and stays apart, while Benches comes back into the row and melts into the others again. It presses the cart too, and the number rolls from 2 to 3; then it goes back to Benches, chooses it again and leaves, and the round starts again. With a mouse or a finger you take the drawn pointer's place. On a narrow screen the bar turns into a column and the bridges run vertically.

How it works

The SVG pills behind the buttons

The real buttons carry only the words and the clicks, on a transparent background; behind them an SVG as big as the bar draws one pill per item, a rectangle with corners at 0.34 times the height, as on the site. The sizes are read once with offsetLeft and offsetWidth, and every frame adds the offsets: drawing and words move together without reading the layout again.

The bridge as a metaball

For each pair of neighbours two circles half a pill high sit at the ends that face each other. Between them four points on the circles are found with angles from acos on the distance, and two Bézier curves with handles at 90 degrees: the neck is thick when the pills touch, thins with the distance, and past DETACH pixels it is gone. In the column the circles sit in the middle of each pill and the bridge runs vertically.

Moving away on a spring

Every item has a value from 0 to 1: on hover it goes to 1 in 0.5 s on the site's curve cubic-bezier(.175,.885,.32,1.275), which overshoots and comes back, and to 0 in 0.3 s on cubic-bezier(.19,1,.22,1); both curves are solved by hand, without a plugin. The value times PUSH gives the margin of each side (the first and last item on one side only) and the row centres itself again by taking off half of the extra space.

The hanging tear

When a bridge was there in the last frame and is not now, a tear is born hanging from the end of the pill that moved: a circle just past the edge and a circle inside the pill, joined by the same metaball as the bridges, so it is never a lone dot. The tear springs back towards the pill with elastic.out in 0.55 s, sags two pixels and rises, and shrinks away in 0.6 s.

The light inside the liquid

An ellipse with a radial gradient of yellow #e9e778 at 28 per cent, in mix-blend-mode difference, sits in a group cut by a clipPath with the same pill, bridge and drop shapes, so it only shows inside the lacquer. It chases the pointer with a lerp of 0.12 per frame; moving it is 60 by 30, still for half a second it goes round at 30, outside the bar it goes to 0, always in 1 s with expo.out. On the press it grows to 84 by 40.

The lacquer with a thread of light

One SVG filter on the liquid group makes the whole material: two shadows (a wide soft one and a close dark one), a sheen under the top edge (the alpha blurred and moved down, taken out of the shape) and the one-pixel thread of light (the alpha moved by one pixel, taken out of the shape). Since it works on the joined shape, the thread of light also runs over the bridges and the drops.

Values to change

NameFileDefaultWhat it changes
GAPscript.js6Pixels between the pills at rest.
PUSHscript.js28How many pixels a pill moves away from each neighbour under the pointer.
DETACHscript.js30Past this gap, in pixels, the liquid bridge snaps.
HOVER_TIMEscript.js0.5Seconds to move away, on the spring that overshoots.
BACK_TIMEscript.js0.3Seconds to come back.
FOLLOWscript.js0.12How quickly the light follows the pointer, per frame (1 = at once).
GLOWscript.js0.28The strength of the light inside the liquid.
DROPscript.js1The size of the drop left by a snapped bridge; 0 for none.
SPEEDscript.js12 = the walk on its own twice as fast, 0.5 = half.
LOOPscript.jstrueWalk the bar again and again.

Try them in the Playground

When to use it

For the header of a product site that wants a gesture of its own without weight: a furniture or design brand, a shop with a few sections and the cart, a portfolio, a product launch page. The items stay real, readable buttons; the liquid only gives character.

On phones

The same bridges, springs and drop. When the row does not fit the width the bar turns into a column, with the pills also sized in vh (clamp from 24 to 36 pixels) and the room to move away already kept above and below, so it all fits the phone's preview. With a finger: tap an item to choose it, and drag the finger along the bar to push the items apart while the light follows.

With reduced motion

No movement and no drops: the pills stay joined in place, the one under the pointer lightens with a fade, the light appears still in the middle of the item, the chosen item turns yellow with a fade (with no bridges to it) and the line under the bar cross-fades. There is no drawn pointer: the items light up one at a time on their own.

Pitfalls

  • The bridge only snaps when the gap passes DETACH: with a PUSH smaller than DETACH minus GAP the bridges stretch but never break, which is what happens with the site's 20-pixel margin; here PUSH is 28 so the bridge really snaps.
  • The light must be cut with the same shapes as the liquid, bridges and drops included (three paths in one clipPath): cut with the pills alone it would switch off when it passes over a bridge.
  • A fromTo tween in a timeline counts as already started and its onStart never comes: the drawn pointer's starting point has to be taken with a call just before the tween, or the pointer jumps to the corner.
  • Copying the line under the bar with cloneNode also copies the inline style GSAP left on it: remove it (removeAttribute style), or the new line inherits the old one's offset and ends up outside its window.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 11 KB; the libraries: GSAP 28 KB.

Testing

Tested on 2 November 2026

  • Desktop: Done
  • Phone: Done
  • Reduced motion: Done
  • Safari on iPhone: To do

License

Use it in your own projects and in your clients’ projects. Do not resell it or redistribute it as is. GSAP stays under its own Standard license. Full license.

All animations