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.

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
- 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.
- Paste it into your AI: Lovable, Claude, Cursor, Bolt or v0.
- 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
- Folder tabstrapezoid tabs
- Expandable icon tabs, expanding tab barAbas de ícone que expandem
- Sliding tabs, directional tab transition, stretching tab underlineAbas deslizantes
- Sliding pill tabssegmented control
- Gooey tabs, liquid tab indicator, liquid navbarAbas líquidas
- Curved bottom tab bar, jumping bubble tab bar, mobile bottom navigationBarra de app com bolha
- Bottom tab bar in 11 stylesBarra inferior de app em 11 estilos
- Animated hamburger menu icon, menu toggle morphBotão de menu que se transforma