
The elastic button
Buttons, Hover, Text
The «Download offline map» button in the map card of an invented hotel, Casa Vela, on black: above the button the map of the neighbourhood waits blurred and split into tiles. Pressed, the pill darkens and an amber light fills it from the left with a bright edge, the label turns from light to dark where the light reaches it, the folded map icon fills panel by panel and the megabytes count up; meanwhile the sharp tiles settle one after another on a spring, in a wave from the hotel pin. At the end a glint crosses the map, the pin hops, «Available offline» comes in with its check and the button says «Saved for offline».
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>
<!--
"Offline map button" 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 Download offline map button with the tiles that settle</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 offline map card of a hotel app: pressed, the button fills with light and the map of the neighbourhood
downloads tile by tile, each tile settling on a spring outward from the hotel pin; then the map catches a glint,
the pin hops and the button says it is saved -->
<section class="om" data-card aria-label="Casa Vela offline map">
<header class="om__head">
<span class="om__mark" aria-hidden="true">
<svg viewBox="0 0 24 24"><path d="M12 3.6c-3.4 0-6 2.6-6 5.9 0 4.4 6 10.9 6 10.9s6-6.5 6-10.9c0-3.3-2.6-5.9-6-5.9Z"></path><path d="M9.4 9.6c.9-1.3 4.3-1.3 5.2 0"></path></svg>
</span>
<div class="om__title">
<p class="om__name">Harbour Quarter</p>
<p class="om__sub">Around Casa Vela hotel</p>
</div>
<p class="om__chip" data-chip><span data-chip-text>48 MB</span></p>
</header>
<div class="map" data-map>
<svg class="map__low" viewBox="0 0 480 280" preserveAspectRatio="none" aria-hidden="true"><use href="#mapart"></use></svg>
<div class="map__grid" data-grid aria-hidden="true"></div>
<div class="map__tiles" data-tiles aria-hidden="true"></div>
<span class="map__glint" data-glint aria-hidden="true"></span>
<span class="map__pin" data-pin aria-hidden="true">
<i class="pin__shadow" data-pin-shadow></i>
<svg class="pin__body" data-pin-body viewBox="0 0 28 34"><path d="M14 1.5C7.4 1.5 2.5 6.4 2.5 12.7 2.5 21 14 32.5 14 32.5S25.5 21 25.5 12.7C25.5 6.4 20.6 1.5 14 1.5Z"></path><path class="pin__bed" d="M8.6 15.6v-4.2M8.6 13.8h10.8v1.8M11.2 11.6h5.6c1.4 0 2.6 1 2.6 2.2"></path></svg>
</span>
<p class="map__badge" data-badge>
<svg viewBox="0 0 16 16" aria-hidden="true"><path data-badge-check d="M3.6 8.4l2.8 2.8 6-6.2"></path></svg>
<span>Available offline</span>
</p>
</div>
<button class="dl" type="button" data-btn data-autoclic>
<span class="dl__light" aria-hidden="true"></span>
<span class="dl__face" data-face>
<span class="dl__icon" aria-hidden="true">
<svg viewBox="0 0 24 24">
<path class="ic__panel" data-panel d="M3.6 6.6 8.4 4.8v13.4l-4.8 1.8Z"></path>
<path class="ic__panel" data-panel d="M8.4 4.8l7.2 2.2v13.4l-7.2-2.2Z"></path>
<path class="ic__panel" data-panel d="M15.6 7l4.8-1.8v13.4l-4.8 1.8Z"></path>
<path class="ic__map" d="M3.6 6.6 8.4 4.8l7.2 2.2 4.8-1.8v13.4l-4.8 1.8-7.2-2.2L3.6 20Z"></path>
<g class="ic__arrow" data-arrow><path d="M12 1.6v7.2"></path><path d="M9.2 6.2 12 9l2.8-2.8"></path></g>
<path class="ic__check" data-check d="M6.4 12.6l3.6 3.4 7.6-7.8"></path>
</svg>
</span>
<span class="dl__label" data-label>Download offline map</span>
<span class="dl__meta" data-meta>48 MB</span>
</span>
<span class="dl__fill" data-fill aria-hidden="true"><span class="dl__edge"></span></span>
</button>
<p class="sr" aria-live="polite" data-live></p>
</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>
<svg class="defs" aria-hidden="true" width="0" height="0"><defs><symbol id="mapart" viewBox="0 0 480 280" data-art></symbol></defs></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.
24 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 “Offline map button” from Animorio and fit it into my siteThe map is drawn once into a 480 by 280 SVG symbol: blocks as rounded rectangles on a slightly turned grid, skipped where they fall into the sea, the river, the roads or the parks (distance to a segment and point in polygon), then the river, roads, shore and names. Each tile is a small svg with a viewBox framing its part and a use pointing at the symbol: no pixels to recompute on resize, and the tiles meet without seams because each one spills a pixel onto its neighbour.
Under the tiles the same symbol is drawn whole with blur, saturate and brightness filters, a little larger than the map so the blur does not uncover the edges; over it a grid of thin inset shadows marks the seams of the tiles still to download and fades when the map is nearly complete.
The button has its face twice: light underneath, dark ink on top inside the amber fill, which is cut by a clip-path inset from the right. One tween on an object (p from 0 to 1) drives the cut, the bright edge, the percentage, the megabytes and the opacity of the icon's three panels: everything moves as one thing.
The tiles are queued by distance from the pin, with a little disorder (SCATTER). So that the last one lands as the light ends even on a power1.inOut curve, the time of each one is found by inverting the curve with a binary search; each one comes in with back.out (BOUNCE) from 3 pixels above at scale 0.86, and its amber edge fades in 0.6 seconds.
At the end the pill gives with scaleY and an elastic.out, the label changes with the wdth axis tightening from 114 to 100, the check draws with strokeDashoffset, a glint in screen blend crosses the map, and the pin rises, drops and squashes from its bottom origin on an elastic while its shadow shrinks and grows back.
| Name | File | Default | What it changes |
|---|---|---|---|
MAP_SIZE | script.js | 48 | The megabytes of the map, written on the button and counted during the download. |
DOWNLOAD_TIME | script.js | 3.4 | The seconds of the download: the light fills the button and all the tiles arrive. |
COLS | script.js | 8 | How many columns of tiles the map has. |
ROWS | script.js | 5 | How many rows of tiles the map has. |
BOUNCE | script.js | 2.2 | How far each tile passes the mark as it settles: 1 barely, 4 more. |
SCATTER | script.js | 0.35 | How disordered the tiles' order is: 0 a perfect wave from the pin, 1 almost random. |
PAUSE | script.js | 2.2 | The seconds the autopilot waits on the saved map before starting again. |
For the app or site of a hotel, a holiday home, a resort or a travel guide: the neighbourhood map to keep on the phone without a connection, before leaving or on arrival. It also suits a hiking app, a city app or an outdoor event, and works as a model for any download that has something to show while it arrives.
The same animation with adapted sizes: the card is 92% of the screen wide and also shrinks with the height, the map keeps its proportions, the button stays 60 pixels tall, easy for a finger, and under 360 pixels the label tightens a little with the wdth axis. A tap does what a click does; the hover light follows the finger while it rests on the pill.
Nothing moves: the tiles fade in one after another with no scale or spring, the percentage and the megabytes rise, the pill turns amber with a fade instead of filling from the left, the check appears already drawn, no glint and no hop of the pin, the drawn pointer stays hidden.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 11 KB; the libraries: GSAP 28 KB.
Tested on 6 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.
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.