vibran

Shrinking glass navbar, sticky header on scroll

Portuguese name: Barra que encolhe e vira vidro

A sticky header that starts wide and transparent, then shrinks into a floating frosted-glass pill over the content as you scroll. It can optionally hide on the way down and return on the way up.

Preview of Shrinking glass navbar, sticky header on scroll running live
Copy the promptAdjust colors and speed

When to use it

The header of any business site, landing page or shop with colored backgrounds or images, which is where the glass shows. Place the header directly in body or in a tall container, since it uses position: sticky (no overflow: hidden on parents; use overflow: clip). Use data-esconder="sim" on long reading pages. Set --barra-largura-compacta to fit your links and --barra-fundo to the brand color. Below 640px the links hide; wire your own menu button there.

How to add it to your site

  1. Copy the prompt in the gallery. It comes with the effect's name and the full code. The prompt text is written in Portuguese, and AI builders handle that fine.
  2. Paste it into your AI: Lovable, Claude, Cursor, Bolt or v0.
  3. Done: the AI adds the effect to your project, just like you saw it here.

Use it in HTML

The effect is plain JavaScript, no library. Just put the data-efeito attribute on the element:

<header data-efeito="barra-encolhe-vidro"><a href="/">Marca</a><nav><a href="#servicos">Serviços</a><a href="#contato">Contato</a></nav><a href="#orcamento">Orçamento</a></header>

More navigation effects

All 20 navigation effects →