
The inchworm menu
Menus, Hover, Transitions
People searched for “file preview” and found little that fit: here is the file list of a shared folder in a made-up workspace, Fieldnote, alone on white, with a PDF, a spreadsheet, a presentation, a photo and an audio file. Resting on a row springs open the preview card, anchored to the row by its tip: the PDF page with its lines settling and the page count rolling, the spreadsheet grid filling up, three slides flipping over, the real lake photo, the waveform drawing itself. Moving from row to row the card never closes: it slides, changing height and content on the way. Below, who edited it, Open and Share. On a phone it opens under the row.
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>
<!--
"File preview card" 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>File preview card</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 files of a shared folder in a made-up workspace, Fieldnote: resting on a row opens the preview card anchored
to it, and moving to another row slides the same card there while it changes shape and content -->
<div class="group" data-group>
<section class="files" data-files aria-labelledby="fp-title">
<header class="files__head">
<span class="folder" aria-hidden="true"><svg viewBox="0 0 20 20"><path d="M2.6 5.6c0-.9.7-1.6 1.6-1.6h3.3l1.7 1.8h6.6c.9 0 1.6.7 1.6 1.6v7.1c0 .9-.7 1.6-1.6 1.6H4.2c-.9 0-1.6-.7-1.6-1.6z"></path><path class="folder__lip" d="M2.6 8.2h14.8"></path></svg></span>
<span class="crumb"><span class="crumb__ws" data-ws>Fieldnote</span><svg class="crumb__sep" viewBox="0 0 8 12" aria-hidden="true"><path d="M2.4 2.2L5.8 6l-3.4 3.8"></path></svg><h2 class="crumb__dir" id="fp-title" data-folder>Spring launch</h2></span>
<span class="files__count">5 files</span>
</header>
<div class="files__body" data-body>
<span class="hl" data-hl aria-hidden="true"></span>
<ul class="rows" role="list">
<li><button class="row" type="button" data-row="pdf" aria-haspopup="dialog" aria-expanded="false">
<span class="ico ico--pdf" aria-hidden="true"><svg viewBox="0 0 24 28"><path class="ico__sheet" d="M4.5 1.5h10.2l5.8 5.8v17.2c0 1.1-.9 2-2 2h-14c-1.1 0-2-.9-2-2v-21c0-1.1.9-2 2-2z"></path><path class="ico__fold" d="M14.7 1.5v4.3c0 .8.7 1.5 1.5 1.5h4.3"></path><path class="ico__mark" d="M7.5 13.5h9M7.5 17h9M7.5 20.5h5.5"></path></svg><span class="ico__tag">PDF</span></span>
<span class="row__name"><span class="row__title">Brand guidelines.pdf</span><span class="row__sub">4.2 MB · Nov 18</span></span>
<span class="row__size">4.2 MB</span>
<span class="row__date">Nov 18</span>
</button></li>
<li><button class="row" type="button" data-row="sheet" aria-haspopup="dialog" aria-expanded="false">
<span class="ico ico--sheet" aria-hidden="true"><svg viewBox="0 0 24 28"><path class="ico__sheet" d="M4.5 1.5h10.2l5.8 5.8v17.2c0 1.1-.9 2-2 2h-14c-1.1 0-2-.9-2-2v-21c0-1.1.9-2 2-2z"></path><path class="ico__fold" d="M14.7 1.5v4.3c0 .8.7 1.5 1.5 1.5h4.3"></path><path class="ico__mark" d="M6.8 12.5h10.4v9H6.8zM6.8 15.5h10.4M6.8 18.5h10.4M10.6 12.5v9"></path></svg><span class="ico__tag">XLS</span></span>
<span class="row__name"><span class="row__title">Revenue forecast.xlsx</span><span class="row__sub">186 KB · Nov 20</span></span>
<span class="row__size">186 KB</span>
<span class="row__date">Nov 20</span>
</button></li>
<li><button class="row" type="button" data-row="slides" aria-haspopup="dialog" aria-expanded="false">
<span class="ico ico--slides" aria-hidden="true"><svg viewBox="0 0 24 28"><path class="ico__sheet" d="M4.5 1.5h10.2l5.8 5.8v17.2c0 1.1-.9 2-2 2h-14c-1.1 0-2-.9-2-2v-21c0-1.1.9-2 2-2z"></path><path class="ico__fold" d="M14.7 1.5v4.3c0 .8.7 1.5 1.5 1.5h4.3"></path><path class="ico__mark" d="M6.8 12.8h10.4v6.6H6.8zM12 19.4v2.6M9.6 22h4.8"></path></svg><span class="ico__tag">PPT</span></span>
<span class="row__name"><span class="row__title">Launch deck.pptx</span><span class="row__sub">12.8 MB · Nov 21</span></span>
<span class="row__size">12.8 MB</span>
<span class="row__date">Nov 21</span>
</button></li>
<li><button class="row" type="button" data-row="image" aria-haspopup="dialog" aria-expanded="false">
<span class="ico ico--image" aria-hidden="true"><svg viewBox="0 0 24 28"><path class="ico__sheet" d="M4.5 1.5h10.2l5.8 5.8v17.2c0 1.1-.9 2-2 2h-14c-1.1 0-2-.9-2-2v-21c0-1.1.9-2 2-2z"></path><path class="ico__fold" d="M14.7 1.5v4.3c0 .8.7 1.5 1.5 1.5h4.3"></path><path class="ico__mark" d="M6.6 21.4l3.6-4.4 2.6 3 1.8-2.1 2.8 3.5M15.2 13.4a1.3 1.3 0 1 1-.01 0"></path></svg><span class="ico__tag">JPG</span></span>
<span class="row__name"><span class="row__title">Lakeside cover.jpg</span><span class="row__sub">2.6 MB · Nov 21</span></span>
<span class="row__size">2.6 MB</span>
<span class="row__date">Nov 21</span>
</button></li>
<li><button class="row" type="button" data-row="audio" aria-haspopup="dialog" aria-expanded="false">
<span class="ico ico--audio" aria-hidden="true"><svg viewBox="0 0 24 28"><path class="ico__sheet" d="M4.5 1.5h10.2l5.8 5.8v17.2c0 1.1-.9 2-2 2h-14c-1.1 0-2-.9-2-2v-21c0-1.1.9-2 2-2z"></path><path class="ico__fold" d="M14.7 1.5v4.3c0 .8.7 1.5 1.5 1.5h4.3"></path><path class="ico__mark" d="M7 17v1.6M9.4 15v5.6M11.8 13v9.6M14.2 15.4v4.8M16.6 16.4v2.8"></path></svg><span class="ico__tag">M4A</span></span>
<span class="row__name"><span class="row__title">Founder interview.m4a</span><span class="row__sub">5.1 MB · Nov 22</span></span>
<span class="row__size">5.1 MB</span>
<span class="row__date">Nov 22</span>
</button></li>
</ul>
</div>
</section>
<!-- the one preview card: it moves from row to row and changes its body -->
<aside class="card" data-card role="dialog" aria-label="File preview" aria-hidden="true">
<span class="card__caret" data-caret aria-hidden="true"></span>
<div class="card__in">
<header class="card__head">
<span class="swap" data-head-name><span>Brand guidelines.pdf</span></span>
<span class="swap swap--meta" data-head-meta><span>PDF document</span></span>
</header>
<div class="view" data-view>
<!-- pdf: a small page whose lines settle, the page count rolls -->
<div class="pane pane--pdf" data-pane="pdf">
<div class="pages" aria-hidden="true">
<span class="page page--back"></span>
<span class="page page--mid"></span>
<span class="page page--front" data-page>
<span class="pl pl--kicker"></span>
<span class="pl pl--title"></span>
<span class="pl pl--title2"></span>
<span class="pl pl--swatches"><i></i><i></i><i></i><i></i></span>
<span class="pl pl--txt"></span>
<span class="pl pl--txt pl--s"></span>
<span class="pl pl--txt"></span>
<span class="pl pl--txt pl--xs"></span>
</span>
</div>
<div class="pdfinfo">
<span class="bignum roll" data-pages aria-label="24 pages"></span>
<span class="pdfinfo__lbl">pages</span>
<span class="pdfinfo__note">A4 · v3</span>
</div>
</div>
<!-- sheet: a small grid that fills, the selection lands on the total -->
<div class="pane pane--sheet" data-pane="sheet">
<div class="grid" data-grid aria-hidden="true"></div>
<span class="sel" data-sel aria-hidden="true"></span>
</div>
<!-- slides: three slides that flip over -->
<div class="pane pane--slides" data-pane="slides">
<div class="deck" aria-hidden="true">
<span class="slide slide--a" data-slide><span class="sa__t"></span><span class="sa__t sa__t--2"></span><span class="sa__ring"></span></span>
<span class="slide slide--b" data-slide><span class="sb__t"></span><span class="sb__bars"><i></i><i></i><i></i><i></i><i></i></span></span>
<span class="slide slide--c" data-slide><span class="sc__big"></span><span class="sc__l"></span><span class="sc__l sc__l--2"></span><span class="sc__l sc__l--3"></span></span>
</div>
</div>
<!-- image: one real photo -->
<div class="pane pane--image" data-pane="image">
<figure class="photo" data-photo>
<img src="lake.webp" alt="A wooden dock running into a calm lake below forested hills" width="800" height="534" decoding="async">
<figcaption class="photo__dims">2400 × 1600</figcaption>
</figure>
</div>
<!-- audio: a waveform that draws itself in thin lines -->
<div class="pane pane--audio" data-pane="audio">
<span class="play" aria-hidden="true"><svg viewBox="0 0 20 20"><path d="M7.6 5.6l7 4.4-7 4.4z"></path></svg></span>
<svg class="wave" data-wave viewBox="0 0 200 56" preserveAspectRatio="none" aria-hidden="true"></svg>
<span class="atime roll" data-atime></span>
</div>
</div>
<footer class="card__foot">
<div class="who">
<span class="avatar" data-avatar aria-hidden="true"><span data-ini>MI</span></span>
<span class="who__text">
<span class="swap" data-who><span>Edited by Mara Ilves</span></span>
<span class="swap swap--when" data-when><span>2 hours ago</span></span>
</span>
</div>
<div class="acts">
<button class="act act--open" type="button" data-open-btn><span class="act__bg" aria-hidden="true"></span><span class="act__lbl">Open</span></button>
<button class="act act--share" type="button" data-share><span class="act__bg" aria-hidden="true"></span><span class="act__lbl" data-share-lbl>Share</span><svg class="act__tick" viewBox="0 0 14 14" aria-hidden="true"><path d="M3.2 7.3l2.4 2.4 5.2-5.4" pathLength="1" data-tick></path></svg></button>
</div>
</footer>
</div>
</aside>
</div>
<svg class="ghost" data-ghost viewBox="0 0 22 22" aria-hidden="true"><path d="M4.5 2.8l12.6 9.4-5.6.9 3.3 6.1-2.3 1.2-3.2-6.1-4.1 3.9z"></path></svg>
<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>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.
60 values to change
Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI
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 “File preview card” from Animorio and fit it into my siteThere is a single card, absolutely positioned inside the group. For each row the row’s position, the height of the preview pane and so the card’s final height are worked out from offsetTop; GSAP moves the card’s left/top, the preview window’s height and the tip together, so the card slides and changes shape instead of closing and reopening.
The five panes sit on top of each other in the preview window, each with its own height in clamp and vh: the old one rises four pixels and fades in 0.16 seconds, the new one comes up from below a moment later, and the texts (name, kind, author) roll with two spans in the same grid cell.
Each kind has its own small timeline, killed when the row changes: the PDF lines settling with back.out and the page counter in digit columns, the cell bars in scaleX staggered by row plus column, the slides rotating to the back of the deck, the photo opening with clip-path inset, the waveform lines in scaleY and the playhead colouring them.
Above 720 pixels the card opens to the right of the list, with the tip on its left side kept level with the row; below that it opens inside the panel, under the row: the rows after it move down by the card’s height and the panel grows with an animated padding-bottom.
The autopilot is a timeline that carries an SVG pointer from row to row, aiming at where the row will be once its card is open (removing GSAP’s offset), then steps into the card and presses Share. As soon as the real mouse moves or the screen is touched it stops, and it starts again by itself after eight quiet seconds.
| Name | File | Default | What it changes |
|---|---|---|---|
WORKSPACE | script.js | Fieldnote | The workspace name, at the top of the list. |
FOLDER | script.js | Spring launch | The folder name. |
PDF_PAGES | script.js | 24 | How many pages the PDF has: the number rolls when the card shows it. |
AUDIO_SECONDS | script.js | 42 | How long the audio lasts, in seconds. |
HOVER_DELAY | script.js | 0.09 | How long you rest on a row before the card opens. |
CLOSE_DELAY | script.js | 0.35 | How long the card waits before closing once the pointer leaves. |
MORPH_TIME | script.js | 0.6 | How long the card takes to slide from row to row and change shape. |
SPRING | script.js | 1.4 | How far the card overshoots when it opens and when it arrives. |
DWELL | script.js | 2.4 | How long the drawn pointer rests on each row. |
LOOP_PAUSE | script.js | 1.4 | The pause with the card closed before the loop starts again. |
In the file list of a cloud drive or workspace, in a project’s attachments in a team app, in a client’s materials folder in a portal, in the documents of a dashboard or on a site’s downloads page: anywhere people need to see what is inside a file without opening it.
Below 720 pixels the card does not open to the side but inside the panel, under the row, and the rows after it move down; in narrow rows size and date go under the name, the card drops its header (the name is already in the row) and puts author and buttons on one line. Row and preview heights also follow the height with clamp and vh, so with the card open everything fits the 341 by 410 box. Tapping a row opens or closes the card, tapping outside closes it.
No springs, slides or entrances: the card is already open on the photo, on hover it changes row with a fade and the content already in place (pages counted, grid filled, waveform drawn) and the self-running loop does not start.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 14 KB; the libraries: GSAP 28 KB.
Tested on 22 November 2026
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.
You asked for
We made it for you: it’s in the library, with the preview, the Playground and the code to copy.
An animation you can’t find, or a site to take apart in the journal: tell us which. We pick the next ones from here.
With your account’s email and password.
or with your email
You’re signed in as .
With your account, you can download the zip of every animation and every pack, for free.