Skip to content
animorio
IT
All components

Museum menu

Menus, Transitions, Images, HoverGSAP, CSS onlyMediumCompressed weight: Demo 12 KBGSAP 28 KBFreeDownload the zip

The navigation menu of the Orrin Museum of Art, a made-up museum, on white: closed it is a plaster coloured bar with the name and a Menu button; on a tap the bar rises, widens and becomes a gallery wall. On the left the entries Exhibitions, Collection, Visit and Shop rise out of their masks; on the right a real public domain painting hangs from the picture rail on two wires, under a brass picture light that flickers on. Moving onto an entry, four brass corners frame it on a spring, the word widens on the wdth axis and the frame takes the new work: it grows or narrows to the painting's proportions, sways on its wires like a real frame and settles, the new painting comes in behind a soft curtain with a band of warm light, and the wall label under it rolls to the artist, title and year.

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>
<!--
  "Museum menu" 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 museum menu with the hanging artwork that changes in its frame</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/newsreader@5.3.0/opsz-italic.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <main class="stage">
    <!-- the navigation of the Orrin Museum of Art, a made-up museum. Closed, it is a plaster bar with the name and a
         Menu button; open, the bar rises and grows into a gallery wall. On the left the entries, framed by four thin
         brass corners that follow the one under the pointer; on the right a real public domain painting hangs from
         the picture rail on two wires, under a brass picture light. Every entry hangs a different work: the frame
         grows or narrows to its proportions on a spring and sways on its wires, the new painting slides in behind a
         soft curtain, and the wall label beside it rolls to the new artist, title and year -->
    <div class="orrin" data-orrin>
      <div class="wall" data-wall>
        <span class="wall__grain" aria-hidden="true"></span>

        <div class="wall__body" data-body aria-hidden="true">
          <nav class="nav" id="orrin-menu" aria-label="Orrin Museum of Art">
            <ul class="nav__list" data-list>
              <li class="entry" data-entry="0">
                <a class="entry__link" href="#" data-link>
                  <span class="entry__mask"><span class="entry__in" data-in><span class="entry__word">Exhibitions</span></span></span>
                  <span class="entry__note" data-note>The Quiet Room, until March</span>
                </a>
              </li>
              <li class="entry" data-entry="1">
                <a class="entry__link" href="#" data-link>
                  <span class="entry__mask"><span class="entry__in" data-in><span class="entry__word">Collection</span></span></span>
                  <span class="entry__note" data-note>Six centuries of painting</span>
                </a>
              </li>
              <li class="entry" data-entry="2">
                <a class="entry__link" href="#" data-link>
                  <span class="entry__mask"><span class="entry__in" data-in><span class="entry__word">Visit</span></span></span>
                  <span class="entry__note" data-note>Open daily, ten to six</span>
                </a>
              </li>
              <li class="entry" data-entry="3">
                <a class="entry__link" href="#" data-link>
                  <span class="entry__mask"><span class="entry__in" data-in><span class="entry__word">Shop</span></span></span>
                  <span class="entry__note" data-note>Prints of the collection</span>
                </a>
              </li>
            </ul>
            <!-- four brass corners that frame the entry under the pointer -->
            <span class="marker" data-marker aria-hidden="true"><i></i><i></i><i></i><i></i></span>
            <p class="nav__foot" data-foot>Free on Thursdays after five <span class="nav__sep">·</span> Members first</p>
          </nav>

          <section class="hang" data-hang aria-label="Featured work">
            <span class="hang__rail" data-rail aria-hidden="true"></span>
            <span class="hang__pool" data-pool aria-hidden="true"></span>
            <svg class="hang__wires" data-wires aria-hidden="true">
              <path class="hang__wire" data-wire d="M0 0"/>
              <rect class="hang__hook" data-hook x="-3" y="-2" width="6" height="7" rx="1.5"/>
            </svg>
            <div class="frame" data-frame>
              <span class="frame__shadow" aria-hidden="true"></span>
              <div class="frame__mold">
                <div class="frame__mat">
                  <div class="frame__art" data-art>
                    <img data-img src="lattaia.webp" width="912" height="1024" alt="The Milkmaid by Johannes Vermeer: a maid pours milk by a window">
                    <img data-img src="autoritratto.webp" width="754" height="1024" alt="A portrait in a straw hat by Vincent van Gogh, on a blue green ground">
                    <img data-img src="covoni.webp" width="1024" height="710" alt="Grainstacks in white frost at sunrise by Claude Monet">
                    <img data-img src="onda.webp" width="1024" height="708" alt="The great wave off Kanagawa, a woodblock print by Katsushika Hokusai">
                    <span class="frame__sheen" data-sheen aria-hidden="true"></span>
                  </div>
                </div>
              </div>
              <!-- the brass picture light on the top of the frame and the warm light it pours -->
              <span class="lamp" data-lamp aria-hidden="true"><span class="lamp__arm"></span><span class="lamp__hood"></span></span>
              <span class="frame__glow" data-glow aria-hidden="true"></span>
            </div>

            <div class="label" data-label>
              <span class="label__line"><span class="label__roll" data-l1>Johannes Vermeer</span></span>
              <span class="label__line label__line--title"><span class="label__roll" data-l2><em>The Milkmaid</em>, c. 1660</span></span>
              <span class="label__line label__line--small"><span class="label__roll" data-l3>Oil on canvas · East Wing</span></span>
            </div>
          </section>
        </div>

        <header class="bar" data-bar>
          <span class="brand"><span class="brand__name">Orrin</span><span class="brand__sub">Museum of Art</span></span>
          <button class="toggle" type="button" aria-expanded="false" aria-controls="orrin-menu" data-toggle>
            <span class="toggle__face" data-face>
              <span class="toggle__words" aria-hidden="true"><span class="toggle__roll" data-roll><span>Menu</span><span>Close</span></span></span>
              <svg class="toggle__icon" viewBox="0 0 20 20" aria-hidden="true">
                <path data-la d="M4 7.5h12"/>
                <path data-lb d="M4 12.5h12"/>
              </svg>
            </span>
            <span class="sr" data-toggle-label>Open the menu</span>
          </button>
        </header>
      </div>
    </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.

40 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 “Museum menu” 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 white page there is a long round plaster coloured bar with a light edge and a soft shadow: on the left the name ‘Orrin’ in a serif italic and ‘Museum of Art’ small, on the right a dark pill button with the word Menu and two drawn lines. Hovering, the button swells with a bounce and the word widens; pressing, it shrinks. On a tap the bar rises to the top and widens to the sides of the frame, then its bottom edge drops and the bar becomes a gallery wall with the grain of plaster; Menu rolls to Close and the two lines cross into an X. On the left the four big entries, Exhibitions, Collection, Visit and Shop, rise one after the other with a small line under each, and at the bottom a line about the hours. On the right the picture rail draws itself, then a dark frame with a pale mat and Vermeer's ‘The Milkmaid’ inside drops from above, hanging from two wires and a hook; the frame swings a little and stops, the brass lamp over it flickers on and pours a warm light over the painting and the wall, and under it the wall label appears with artist, title, year, medium and room. Moving onto an entry, four brass corners close around it on a spring, the word widens and takes weight, the others fade; the frame grows or narrows to the proportions of the new work (Van Gogh's portrait in a straw hat, Monet's grainstacks in the frost, Hokusai's great wave), swings on its wires towards the side it grows, sinks a pixel on the hook and settles; the new painting comes in from the left behind a curtain with a feathered edge, a band of warm light riding with it and a light zoom that settles, and the label rolls to its new lines and moves under the frame. Moving the pointer over the painting makes the frame sway. Close does it all backwards. Left alone, an inner pilot opens the menu, walks over every entry and closes it again.

How it works

The bar that becomes the wall

The wall is one element whose left, top, width, height and border-radius the script rewrites every frame: two values from 0 to 1, rise (it goes up and widens, power3.inOut) and grow (the bottom edge drops, back.out passing the mark by a few pixels). The menu body inside the wall always has the size of the whole frame and is moved the other way with translate, so the entries and the painting never reflow while the wall grows, and the wall keeps its shadow (a clip-path would have cut it).

The painting hung like a pendulum

The frame's width and height chase their target, worked out from the painting's proportions and the free space, on a spring (stiffness 150, damping 0.62 of critical); the angle is a lightly damped pendulum around the hook, pushed by a kick when the work changes and by the speed at which the frame widens; another spring sinks the frame by a pixel on the hook. All in one GSAP ticker, three steps per frame with the step capped at 1/30 s; the transform-origin is the hook, above the frame.

Wires, light and label that follow

The two wires are an SVG path from the back of the frame to the hook, turned by hand with the sine and cosine of the same angle; the pool of light on the wall is a radial gradient in soft-light placed under the turned lamp. The label is measured at every change, centred under the new frame and slides there with expo.out; its three lines leave upwards and come back from below out of their masks.

The soft curtain

Every painting has a gradient mask-image with a 22% feathered edge that depends on a CSS variable --a: GSAP takes it from -2% to 122% and the new painting appears from the left over the old one, with a band of light in soft-light running at the same speed and a zoom from 1.07 that settles. When the curtain is done, the paintings under it are switched off and their mask goes back.

The brass corners and the word that widens

The active word changes the font-stretch and font-weight of Mona Sans with a CSS transition that overshoots; four brass corners made of 1.5 px borders chase the live rectangle of the word on a spring, read again every frame, so they follow the word as it widens.

Values to change

NameFileDefaultWhat it changes
OPEN_TIMEscript.js1.2The seconds the bar takes to become the wall.
STAGGERscript.js0.08The seconds between one entry and the next as they rise.
SWAYscript.js1How much the frame swings on its wires when the work changes (0 = still).
STIFFNESSscript.js150How stiff the spring that resizes the frame is.
WIPEscript.js0.95The seconds of the soft curtain that brings the new painting.
LIGHTscript.js1How strong the picture light is on the painting and the wall.
WEIGHTscript.js640The weight the entry under the pointer takes, on the wght axis.
HOLDscript.js1.9The seconds the pilot stays on each entry.
LOOPscript.jstrueThe pilot opens and closes the menu again and again.

Try them in the Playground

When to use it

For the site of a museum, an art gallery, a foundation, an auction house or a framing studio: the menu, on phone and desktop, that already shows the works, one per section, with a real wall label under it.

On phones

The same animation with adapted sizes: below 600 pixels wide the hanging painting sits at the top and takes the room left, the entries go under it two per row without the small lines, and a finger taps an entry to change the work.

With reduced motion

Nothing moves: the wall fades in already open, the entries, the painting, the light and the label fade in, the frame changes size with no spring and no swing, the new painting fades in and the active entry only takes weight, width and colour.

Pitfalls

  • A clip-path on the wall to grow it from the bar also cut its shadow: the wall really changes its size and the body inside is moved the other way, so it never reflows.
  • The label centred only once was off when the new lines were longer: it is measured again at every change, after the text is written, and slides into place under the frame.
  • With the frame turned by CSS the SVG wires stayed straight: their points are turned by hand with the same angle around the hook.
  • The brass corners measured only at the start stayed narrow while the word widened on the wdth axis: they chase the live rectangle of the word every frame.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0, Newsreader (font variabile) 5.3.0.

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

Testing

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