Skip to content
animorio
IT
All components

Glass search over photo

Search, HoverGSAP, CSS onlyMediumCompressed weight: Demo 8.7 KBGSAP 28 KBFreeDownload the zip

The search bar of Wayfern, an invented travel app, made of frosted glass over a real landscape photo, in the style of light and material on real interface pieces: touched, it widens and the photo behind blurs and darkens, as you type the suggestions rise in glass cards stacked with a slight offset, and picking one opens the photo of the place in a circle from its thumbnail.

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>
<!--
  "Glass search over photo" 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 glass search over a photo that blurs</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>
    <!-- the search of a travel app, made of frosted glass over a landscape: touched it widens, the photo behind
         blurs and darkens, the suggestions rise in glass cards, and the pick opens the photo of the place -->
    <section class="card" data-card aria-label="Wayfern search">
      <div class="photo" data-photo>
        <!-- the four places: real CC0 photos stacked, the chosen one on top -->
        <img class="scene" data-scene="dolomites" src="dolomites.webp" alt="" width="1024" height="683" decoding="async">
        <img class="scene" data-scene="lofoten" src="lofoten.webp" alt="" width="1024" height="571" decoding="async">
        <img class="scene" data-scene="atacama" src="atacama.webp" alt="" width="1024" height="683" decoding="async">
        <img class="scene" data-scene="coast" src="coast.webp" alt="" width="683" height="1024" decoding="async">

        <div class="photo__veil" data-veil></div>
        <svg class="photo__grain" aria-hidden="true"><filter id="grain"><feTurbulence type="fractalNoise" baseFrequency=".9" numOctaves="2" stitchTiles="stitch"></feTurbulence><feColorMatrix values="0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .55 0"></feColorMatrix></filter><rect width="100%" height="100%" filter="url(#grain)"></rect></svg>
      </div>

      <header class="top">
        <p class="top__brand"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M4 18 10 6l4 8 2-3 4 7Z"></path></svg>Wayfern</p>
        <p class="top__meta">Explore</p>
      </header>

      <div class="search-wrap">
        <div class="search" data-search>
          <span class="search__edge" data-edge aria-hidden="true"></span>
          <span class="search__shine" data-shine aria-hidden="true"></span>
          <svg class="search__lens" viewBox="0 0 24 24" aria-hidden="true"><circle cx="10.5" cy="10.5" r="6"></circle><path d="m15 15 4.5 4.5"></path></svg>
          <input class="search__input" data-input type="text" autocomplete="off" spellcheck="false" placeholder="Search a place" aria-label="Search a place" aria-controls="sugg">
          <button class="search__clear" data-clear type="button" aria-label="Clear the search"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="m8 8 8 8M16 8l-8 8"></path></svg></button>
        </div>
      </div>

      <ul class="sugg" id="sugg" data-sugg role="listbox" aria-label="Suggested places"></ul>

      <div class="hero" data-hero>
        <p class="hero__kicker" data-kicker>Where to next?</p>
        <h1 class="hero__title" data-title aria-live="polite">Dolomites</h1>
        <p class="hero__sub" data-sub>Italy · 12 stays from €96</p>
      </div>
    </section>
    <svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.2 19.2 11l-6.3 1.6-3.3 5.9Z"></path></svg>
  </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.

19 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 “Glass search over photo” 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 a near black background sits the card of Wayfern, an invented travel app: filled with a real landscape photo, the spires of the Dolomites in the first light, with the mark and the frosted glass search bar at the top and the name of the place in large type at the bottom. The bar’s edge catches the light: a bright thread runs around it on the side of the pointer. Touched, the bar widens on a spring, a blade of light sweeps across it, the photo behind blurs, darkens and comes slightly closer, and the place name drops away; below, three glass cards with the most searched places rise one after another, stacked with a slight sideways offset. As you type, the cards rebuild: the ones that do not fit leave, the new ones rise, the found letters light up in a warm tone. Picking a place (click, finger or Enter) presses the card, the others fly into the bar, and the real photo of the place, the harbour of a fishing village in Lofoten, the Atacama dunes, the road running along the California coast, opens in a circle from the chosen thumbnail (each thumbnail is the same photo, small) while the photo comes back into focus and the new name rises letter by letter. A drawn pointer does it all by itself, then starts again.

How it works

Real glass

The bar and the cards have a semi-transparent white background with backdrop-filter blur and saturate: they really blur the photo behind them. A light inner shadow at the top gives the glass its thickness.

The edge that catches the light

The edge is a conic-gradient cut by a mask into a one-pixel ring; the angle the light starts from is a CSS variable following the angle between the bar’s centre and the pointer, with quickTo so it gets there softly.

The photo that blurs

On opening the photo gets a blur and brightness filter and a scale of 1.06, so the blurred edges stay outside the card; on closing it comes back sharp with the same curve.

The stacked cards

Each card is absolutely positioned: its y comes from the index, and each next card is shifted sideways by a few pixels and is slightly smaller. When the list changes, the remaining cards slide to their new place and the new ones rise with back.out.

The photo that opens in a circle

The new photo goes above the others with a clip-path circle starting from the centre of the chosen thumbnail and reaching the radius that covers the whole card; when done, the clip-path is removed and the other photos are hidden.

The real photos

The four photos are stacked img elements with object-fit cover and an object-position each, so the subject stays inside the tall, narrow card; the suggestion thumbnail uses the same file as a background-image, already cached. Blur, scale and clip-path work on the container and on the img elements just as they did on the drawings.

Values to change

NameFileDefaultWhat it changes
BLURscript.js9How much the photo behind the open search blurs, in pixels.
DIMscript.js0.72How bright the photo behind the open search stays (1 = not darker at all).
STAGGERscript.js6The sideways offset between one suggestion card and the next, in pixels.
REVEALscript.js1.1The seconds the photo of the chosen place takes to open from the suggestion.
TYPE_SPEEDscript.js0.12The seconds between letters when the autopilot types.
PAUSEscript.js1.6The seconds the autopilot stays on a chosen place.

Try them in the Playground

When to use it

For the search of a travel, booking or experiences app, over a large photo: wherever search is the first thing people do and the image should stay the star.

On phones

The card takes the full width minus the margins and at most the window height; below 380 pixels the bar and the cards widen towards the edges, and when the window is short the bar and the cards get lower and the line above the name disappears. A tap opens the search and picks like a click.

With reduced motion

No springs, slides or circles: the bar widens without bounce, the cards fade in one after another without offset, the new photo fades in and the name changes without rising; the drawn pointer is hidden.

Pitfalls

  • Blur on the photo leaves transparent, soft edges: the photo must be scaled up slightly while it blurs, and the card needs overflow hidden.
  • The cards are picked with a click while the field has focus: pointerdown on the card needs preventDefault, otherwise the field loses focus, the search closes and the click lands on a card that is gone.
  • A landscape photo in a portrait card shows only its middle: without a hand-picked object-position the Dolomites peak ends up behind the bar and in Lofoten only the red wall of a house is left.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 7 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 components