
The elastic button
Buttons, Hover, Text
The mini player at the bottom of a music app, on white, in the style of product interface pieces: tapped, it opens into the full player. The cover grows out of the thumbnail, title and artist travel to their places and grow, the thin line becomes the progress bar and the buttons drop into their row, while the library behind steps back. Dragged down, the player folds back following the finger; on pause the cover shrinks, next slides the new cover in and rolls the title.
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>
<!--
"Expanding mini player" 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 mini player that opens into the full player</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 mini player at the bottom of a music app: tapped, it opens into the full player (the cover grows out of the
thumbnail, title, progress and buttons travel to their places); dragged down, it folds back into the bar.
Everything is one morph value from 0 (mini) to 1 (full), so a finger can scrub it halfway -->
<section class="screen" data-card aria-label="Larkway music app">
<div class="lib" data-lib>
<header class="lib__head">
<p class="lib__app">
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M4 15.5c2.6-6.8 6.2-9.8 10.8-9 2.5.4 4.3 2.1 5.2 4.6"></path><path d="M4 15.5c3.4-2.6 6.8-3.4 10.2-2.5"></path><path d="M14.8 6.5l1.2 5"></path></svg>
Larkway
</p>
<h1 class="lib__title">Library</h1>
<div class="lib__tabs" aria-hidden="true"><span class="is-on">Songs</span><span>Albums</span><span>Artists</span></div>
</header>
<p class="lib__label">Recently played</p>
<ul class="rows" data-rows></ul>
<p class="lib__label">Made for you</p>
<div class="tiles" aria-hidden="true">
<span class="tile"><span class="tile__art art-1"></span><b>Daily Mix</b></span>
<span class="tile"><span class="tile__art art-2"></span><b>Slow Mornings</b></span>
<span class="tile"><span class="tile__art art-3"></span><b>Deep Focus</b></span>
</div>
</div>
<div class="player" data-player role="button" tabindex="0" aria-label="Open player" aria-expanded="false">
<span class="player__grip" data-o></span>
<header class="player__top" data-o data-top>
<button class="icon" type="button" data-close aria-label="Close player" tabindex="-1">
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M6 9.5l6 6 6-6"></path></svg>
</button>
<div class="player__from"><span>Playing from</span><b>Late hours</b></div>
<button class="icon" type="button" aria-label="Queue" tabindex="-1">
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M4 7h11M4 12h11M4 17h7"></path><path d="M17.5 14.5v5.5"></path><path d="M17.5 14.5l3-1"></path></svg>
</button>
</header>
<div class="cover" data-cover><div class="cover__shade" data-shade></div></div>
<div class="meta" data-meta>
<p class="meta__title"><span data-title></span></p>
<p class="meta__artist"><span data-artist></span></p>
</div>
<button class="icon add" type="button" data-o data-add aria-label="Add to library" tabindex="-1">
<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="8.6"></circle><path class="add__plus" d="M12 8.2v7.6M8.2 12h7.6"></path><path class="add__check" d="M8.4 12.3l2.5 2.5 4.9-5"></path></svg>
</button>
<div class="bar" data-bar><span class="bar__fill" data-fill></span><span class="bar__knob" data-knob></span></div>
<p class="times" data-o data-times><span data-now>0:48</span><span data-left>-2:36</span></p>
<button class="ctrl ctrl--prev" type="button" data-prev aria-label="Previous" tabindex="-1">
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M18.5 6.2v11.6L10 12z"></path><path d="M10.5 6.2v11.6L2 12z" transform="translate(1.6 0)"></path></svg>
</button>
<button class="ctrl ctrl--play" type="button" data-play aria-label="Pause">
<svg viewBox="0 0 24 24" aria-hidden="true">
<g data-pause><rect x="6.6" y="5.4" width="3.7" height="13.2" rx="1.2"></rect><rect x="13.7" y="5.4" width="3.7" height="13.2" rx="1.2"></rect></g>
<path data-tri d="M8 5.6v12.8c0 .8.9 1.3 1.6.8l9.4-6.4c.6-.4.6-1.2 0-1.6L9.6 4.8C8.9 4.3 8 4.8 8 5.6z"></path>
</svg>
</button>
<button class="ctrl ctrl--next" type="button" data-next aria-label="Next">
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M5.5 6.2v11.6L14 12z"></path><path d="M13.5 6.2v11.6L22 12z" transform="translate(-1.6 0)"></path></svg>
</button>
</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>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.
29 values to change
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 “Expanding mini player” from Animorio and fit it into my siteThe player has no two layouts to swap: it has a value p going from 0, the mini player, to 1, the full player. For every piece the script works out the two boxes, the small and the large, and on every frame it writes position and size mixed by p; so opening is a tween of p and dragging is the finger changing it.
The large box comes from the screen: margins, title, bar and controls have their height, and the cover takes the room left, never wider than the screen minus the margins. So in a low screen the cover shrinks instead of pushing the controls out; on resize both boxes are worked out again.
The grip, the arrow, the times, the plus and the previous button have their own opacity starting at p equal to 0.55, with a small ten-pixel rise: they appear when the player is almost full, and while dragging they are the first to go.
Pause shrinks the cover to 0.84 only as much as the player is open, because the scale is multiplied by p. Next puts the new cover on top of the old one and brings it in with expo.out, while the texts roll inside a mask. A GSAP ticker runs the song’s time and stretches the bar.
Dragging changes p in proportion to the pixels, with resistance past the edges; on release it looks at how far and how fast it was pulled, and the player goes to 0 or 1 on a back.out spring. Pointer capture only starts after six pixels, so a tap on a button stays a click on that button.
| Name | File | Default | What it changes |
|---|---|---|---|
APP | script.js | Larkway | The name of the music app. |
ACCENT | script.js | #f2542d | The accent colour: the playing song in the list, the mini player’s line and the mark. |
OPEN_TIME | script.js | 0.7 | The seconds the mini player takes to open into the full player. |
CLOSE_TIME | script.js | 0.55 | The seconds the full player takes to fold back into the bar. |
BOUNCE | script.js | 0.8 | How far the spring overshoots and comes back on opening and closing (0 = none). |
PAUSED_SIZE | script.js | 0.84 | How much the cover shrinks on pause (1 = stays the same). |
PAUSE | script.js | 1 | The seconds the autopilot waits between one gesture and the next. |
For a music or podcast app, a radio or audiobook player, any bar at the bottom that has to open into a full page and fold back with a finger.
The screen is sized on both width and height, with min() across pixels, vw and vh, so it fits whole even in a low box; in the full player the cover shrinks to leave room for the controls. A finger drags like the mouse and a tap does what a click does.
No travelling pieces: the player goes from small to full and back with a fade, the new cover fades in, the texts change without rolling, the small bars stay still and the drawn pointer stays hidden.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 10 KB; the libraries: GSAP 28 KB.
Tested on 27 October 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.
Support Animorio
Animorio stays free thanks to the people who support it. If you like, buy us a coffee: it helps us make the next animations.
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.