Skip to content
animorio
IT
Back to the library

Portrait accordion

Hover, ImagesGSAP, CSS onlyMediumCompressed weight: Demo 8.4 KBGSAP 28 KBFreeDownload the zip

The “The people” section of Halden & Roe, a made-up architecture studio, on warm paper: six narrow strips with real black-and-white portraits and upright initials. As the pointer passes, the strip widens like an accordion on a spring while its neighbours narrow, rises by a few pixels, the photo slowly takes its colour and the name, the role and a detail rise at the bottom. On a phone, a three-by-two grid that opens with a tap.

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>
<!--
  "Portrait accordion" 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 people of the studio, portraits that widen as you pass</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>
  <!-- "The people" section of Halden & Roe, a made-up architecture studio. Six narrow strips hold six real portraits
       in black and white. The strip under the pointer widens on a spring while its neighbours make room, the photo
       slowly takes its colour and the name, the role and a small detail rise from the bottom. Narrow strips only show
       the initials, standing upright. -->
  <main class="palco" data-palco>
    <header class="testa">
      <p class="marchio">
        <svg class="marchio__segno" viewBox="0 0 24 24" aria-hidden="true"><path d="M4 20V8l8-4 8 4v12" /><path d="M4 20h16" /><path d="M10 20v-6h4v6" /></svg>
        Halden &amp; Roe
      </p>
      <h1 class="titolo">The people <em>behind the drawings.</em></h1>
      <p class="sotto">Six of us, two desks: Oslo and Lisbon.</p>
    </header>

    <section class="fila" data-fila aria-label="The people">
      <div class="mezza" data-mezza>
        <article class="persona" data-persona tabindex="0" aria-label="Ingrid Halden, founding partner, since 2009">
          <div class="persona__foto"><img src="ritratto-ingrid.webp" alt="" width="560" height="640" decoding="async" data-img></div>
          <i class="persona__velo" aria-hidden="true"></i>
          <span class="persona__iniziali" aria-hidden="true" data-iniziali>IH</span>
          <svg class="persona__freccia" data-freccia viewBox="0 0 16 16" aria-hidden="true"><path d="M4.5 11.5 11.5 4.5M6 4.5h5.5V10" /></svg>
          <div class="persona__scheda" aria-hidden="true">
            <i class="persona__filo" data-filo></i>
            <span class="riga"><span class="nome" data-riga>Ingrid Halden</span></span>
            <span class="riga"><span class="ruolo" data-riga>Founding partner</span></span>
            <span class="riga"><span class="dettaglio" data-riga>Since 2009</span></span>
          </div>
        </article>
        <article class="persona" data-persona tabindex="0" aria-label="Tomás Roe, founding partner, Lisbon desk">
          <div class="persona__foto"><img src="ritratto-tomas.webp" alt="" width="560" height="640" decoding="async" data-img></div>
          <i class="persona__velo" aria-hidden="true"></i>
          <span class="persona__iniziali" aria-hidden="true" data-iniziali>TR</span>
          <svg class="persona__freccia" data-freccia viewBox="0 0 16 16" aria-hidden="true"><path d="M4.5 11.5 11.5 4.5M6 4.5h5.5V10" /></svg>
          <div class="persona__scheda" aria-hidden="true">
            <i class="persona__filo" data-filo></i>
            <span class="riga"><span class="nome" data-riga>Tomás Roe</span></span>
            <span class="riga"><span class="ruolo" data-riga>Founding partner</span></span>
            <span class="riga"><span class="dettaglio" data-riga>Lisbon desk</span></span>
          </div>
        </article>
        <article class="persona" data-persona tabindex="0" aria-label="Maren Okafor, lead architect, since 2014">
          <div class="persona__foto"><img src="ritratto-maren.webp" alt="" width="560" height="640" decoding="async" data-img></div>
          <i class="persona__velo" aria-hidden="true"></i>
          <span class="persona__iniziali" aria-hidden="true" data-iniziali>MO</span>
          <svg class="persona__freccia" data-freccia viewBox="0 0 16 16" aria-hidden="true"><path d="M4.5 11.5 11.5 4.5M6 4.5h5.5V10" /></svg>
          <div class="persona__scheda" aria-hidden="true">
            <i class="persona__filo" data-filo></i>
            <span class="riga"><span class="nome" data-riga>Maren Okafor</span></span>
            <span class="riga"><span class="ruolo" data-riga>Lead architect</span></span>
            <span class="riga"><span class="dettaglio" data-riga>Since 2014</span></span>
          </div>
        </article>
      </div>
      <div class="mezza" data-mezza>
        <article class="persona" data-persona tabindex="0" aria-label="Jonas Vik, model maker, Oslo workshop">
          <div class="persona__foto"><img src="ritratto-jonas.webp" alt="" width="560" height="640" decoding="async" data-img></div>
          <i class="persona__velo" aria-hidden="true"></i>
          <span class="persona__iniziali" aria-hidden="true" data-iniziali>JV</span>
          <svg class="persona__freccia" data-freccia viewBox="0 0 16 16" aria-hidden="true"><path d="M4.5 11.5 11.5 4.5M6 4.5h5.5V10" /></svg>
          <div class="persona__scheda" aria-hidden="true">
            <i class="persona__filo" data-filo></i>
            <span class="riga"><span class="nome" data-riga>Jonas Vik</span></span>
            <span class="riga"><span class="ruolo" data-riga>Model maker</span></span>
            <span class="riga"><span class="dettaglio" data-riga>Oslo workshop</span></span>
          </div>
        </article>
        <article class="persona" data-persona tabindex="0" aria-label="Leonor Abreu, landscape architect, since 2019">
          <div class="persona__foto"><img src="ritratto-leonor.webp" alt="" width="560" height="640" decoding="async" data-img></div>
          <i class="persona__velo" aria-hidden="true"></i>
          <span class="persona__iniziali" aria-hidden="true" data-iniziali>LA</span>
          <svg class="persona__freccia" data-freccia viewBox="0 0 16 16" aria-hidden="true"><path d="M4.5 11.5 11.5 4.5M6 4.5h5.5V10" /></svg>
          <div class="persona__scheda" aria-hidden="true">
            <i class="persona__filo" data-filo></i>
            <span class="riga"><span class="nome" data-riga>Leonor Abreu</span></span>
            <span class="riga"><span class="ruolo" data-riga>Landscape</span></span>
            <span class="riga"><span class="dettaglio" data-riga>Since 2019</span></span>
          </div>
        </article>
        <article class="persona" data-persona tabindex="0" aria-label="Sami Lindqvist, structures, Lisbon desk">
          <div class="persona__foto"><img src="ritratto-sami.webp" alt="" width="560" height="640" decoding="async" data-img></div>
          <i class="persona__velo" aria-hidden="true"></i>
          <span class="persona__iniziali" aria-hidden="true" data-iniziali>SL</span>
          <svg class="persona__freccia" data-freccia viewBox="0 0 16 16" aria-hidden="true"><path d="M4.5 11.5 11.5 4.5M6 4.5h5.5V10" /></svg>
          <div class="persona__scheda" aria-hidden="true">
            <i class="persona__filo" data-filo></i>
            <span class="riga"><span class="nome" data-riga>Sami Lindqvist</span></span>
            <span class="riga"><span class="ruolo" data-riga>Structures</span></span>
            <span class="riga"><span class="dettaglio" data-riga>Lisbon desk</span></span>
          </div>
        </article>
      </div>
    </section>

    <footer class="piede">
      <span>Est. 2009</span>
      <span class="piede__riga" aria-hidden="true"></span>
      <span>Join the studio</span>
    </footer>

    <svg class="pilota" data-pilota viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.2 19.2 12l-6.3 1.5-3.4 5.8z" /></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.

46 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 “Portrait accordion” 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

At the top, the Halden & Roe mark (a little house drawn in thin lines), the heading “The people behind the drawings.” and on the right “Six of us, two desks: Oslo and Lisbon.”. Below, six narrow vertical strips with a 1px edge, round corners, a thread of light on the top edge and a soft shadow: each holds a real black-and-white portrait with a breath of film grain, and at the bottom the initials written upright (IH, TR, MO, JV, LA, SL). When the pointer passes over a strip, it widens like an accordion on a spring that goes just past and settles, its two neighbours narrow a little more than the others, and the strip rises by four pixels while its shadow grows. The photo does not zoom: it is already as wide as the open strip, and opening shows more of it; meanwhile it settles from a slight zoom and slowly takes its colour, over more than a second. The initials rise and vanish, a terracotta thread draws itself and the name, the role and a detail (“Since 2014”, “Lisbon desk”, “Oslo workshop”) rise one line after another; at the top right a small arrow in a glass circle turns into place. Let go, the strip narrows again, loses its colour and the lines leave upwards. Pressed, the strip gives a little and comes back on a spring. The six (made-up) people are Ingrid Halden and Tomás Roe, the two founding partners, Maren Okafor, Jonas Vik, Leonor Abreu and Sami Lindqvist; the photos are real, from the same shoot in a bright office. Until a real pointer shows up, a drawn one passes over four strips on its own.

How it works

Six springs, not six tweens

Each strip has a number, its flex-grow, and a target: OPEN for the one under the pointer, NEIGHBOUR for its two neighbours, 1 for the rest. On every frame of the GSAP ticker a spring (STIFFNESS and DAMPING) pulls the number towards the target, in two half steps to stay stable: if the pointer runs from strip to strip the springs turn midway without a jolt, and flexbox does the sum.

The photo that uncovers

Each strip's img is as wide as an open strip (--largo, measured on the row and recalculated on resize), centred with xPercent -50 and object-fit cover. So a widening strip uncovers the photo instead of enlarging it, and the narrow ones show the face in the middle.

The colour coming back slowly

The photo's filter is written with a variable: grayscale(calc(1 - var(--c))), with a touch of contrast and light changing along. GSAP takes --c from 0 to 1 in COLOUR_TIME seconds; another variable, --a, darkens the veil at the bottom and lengthens the strip's shadow.

The lines that rise

Name, role and detail each sit in an overflow hidden window and rise from yPercent 112 to 0 with expo.out, staggered, after the terracotta thread draws itself with scaleX. On the way out they go to -112 and, only if the strip is still closed, go back below. The card has the fixed width of an open strip, so the text never wraps while the strip grows.

The drawn pointer

A looping timeline moves an SVG pointer towards the centre of four strips: the target is read again on every frame, because the strip widens while the pointer arrives. The first real pointermove, or a tap, stops the pilot.

Values to change

NameFileDefaultWhat it changes
OPENscript.js4.2How many times wider than the others the strip under the pointer gets.
NEIGHBOURscript.js0.82How wide the strips next to it stay (1 = like the others).
STIFFNESSscript.js210How stiff the spring of the strips is.
DAMPINGscript.js17How quickly the spring settles (lower = more bounce).
COLOUR_TIMEscript.js1.3How many seconds a portrait takes to get its colour.
LIFTscript.js4How many pixels the open strip rises.
ROW_OPENscript.js1.45On a phone, how much taller the row of the open portrait gets.
GRAINscript.js0.18How much film grain lies on the photos.

Try them in the Playground

When to use it

For the “About us” or “Team” section of an architecture or design studio, an agency, a collective portfolio or a landing page that wants to show its people without a grid of identical cards. Swap the photos in the six img tags of the HTML (the webp files in the folder), names and roles in the lines, the colours in :root.

On phones

The same animations at adapted sizes: the strips sit in a three-by-two grid measured in vh and open with a tap (a second tap closes them); the row of the open portrait also grows taller, and the initials sit in the bottom corner so they do not cover the face.

With reduced motion

No movement: the strip widens at once, with no spring, no lift and no zoom; the colour, the lines, the thread and the arrow fade in.

Pitfalls

  • With one tween per strip, when the pointer runs from one to the next the tweens stop and restart from rest: with one spring per strip the speed carries on and the motion turns smoothly.
  • If the img were as wide as the strip, widening would enlarge the photo with object-fit cover: the img has the width of an open strip and the strip uncovers it.
  • GSAP does not read percentages from CSS: the lines' starting state (yPercent 112) and the img centring (xPercent -50) are written by the script, not the stylesheet.
  • The drawn pointer heads for a strip that is widening meanwhile: the target is recalculated on every frame, or it would land off centre.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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