
The elastic button
Buttons, Hover, Text
The Share location button of a made-up app for meeting up with friends, on black: on hover the location arrow leans toward the pointer; pressed, the arrow turns north and becomes the centre of a radar, two thin waves leave the pill, three friends pop out one after the other with their distance rolling and the pill says Sharing for 1 hour with a time ring wearing down. Pressed again, the friends go back into the pill and the radar retracts.
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>
<!--
"Share location 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 Share location button with the radar that finds your friends</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">
<!-- the Share location button of Orbet, a made-up app for meeting up with friends: pressed, the arrow turns
north and becomes the centre of a radar, a thin wave leaves the pill, three friends spring out around it
with their rolling distance and the pill counts the hour down; pressed again, everything comes back in -->
<div class="wrap" data-wrap>
<span class="wave" data-wave aria-hidden="true"></span>
<span class="wave" data-wave aria-hidden="true"></span>
<span class="range" data-range aria-hidden="true"></span>
<div class="friends" data-friends aria-hidden="true"></div>
<div class="pill" data-pill>
<span class="pill__glow" data-glow aria-hidden="true"></span>
<div class="pill__clip">
<span class="pill__grain" aria-hidden="true"></span>
<span class="pill__sheen" data-sheen aria-hidden="true"></span>
</div>
<button class="share" type="button" data-share aria-pressed="false">
<span class="dial" data-dial aria-hidden="true">
<svg class="dial__ring" viewBox="0 0 44 44">
<circle class="dial__track" cx="22" cy="22" r="20.5"></circle>
<circle class="dial__time" data-time cx="22" cy="22" r="20.5"></circle>
</svg>
<span class="dial__disc" data-disc></span>
<svg class="arrow" data-arrow viewBox="0 0 24 24">
<path class="arrow__body" data-arrowbody d="M12 3.6 18.6 19.4 12 16.1 5.4 19.4Z"></path>
<path class="arrow__slash" data-slash d="M5.2 5.2 18.8 18.8"></path>
</svg>
</span>
<span class="words" data-words>
<span class="word" data-word="idle">Share location</span>
<span class="word" data-word="on">Sharing for 1 hour</span>
<span class="word" data-word="off">Sharing stopped</span>
</span>
</button>
<span class="pill__edge" aria-hidden="true"></span>
</div>
<p class="sr" data-live aria-live="polite"></p>
</div>
<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.
22 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 “Share location button” from Animorio and fit it into my siteThe pill holds the disc with the arrow and three labels stacked in a window 22 pixels tall: Share location, Sharing for 1 hour and Sharing stopped. The old one leaves upwards, the new one comes from below with back.out, and GSAP takes the pill’s width to the size of the real word, with elastic.out when it switches on.
On every pointermove the angle between the arrow’s centre and the pointer comes from atan2; the arrow leans by half the difference from its resting direction, 26 degrees at most, through a back.out quickTo that gives it a small spring. At rest the direction is 45 degrees, while sharing it is north.
The waves and the range ring are one pixel outlines with a pill radius: GSAP changes their width and height, not their scale, so the line stays thin while it grows to the edge of the field. One or two leave on click; on stop the ring and a wave come back toward the pill in power3.in.
Each friend starts small from the arrow’s disc and flies to its place (a fraction of the field’s width and height, measured again on resize) with back.out, while the disc straightens on an elastic. Each digit of the distance is a column of 0-9 repeated twice that scrolls forward to the right digit, so it always rolls the same way.
An SVG circle whose stroke-dasharray equals its circumference: on click it draws in 0.7 seconds, then a linear tween wears it down over RING_SECONDS. On stop it retracts quickly and a slash draws across the arrow with the same trick.
| Name | File | Default | What it changes |
|---|---|---|---|
LABEL | script.js | Share location | The label of the button at rest. |
SHARING | script.js | Sharing for 1 hour | The label while the location is shared. |
STOPPED | script.js | Sharing stopped | The label for a moment after stopping. |
FRIENDS | script.js | Lea 300, Sam 850, Noor 120 | The three friends that appear, name and distance in metres, separated by commas. |
ACCENT | script.js | #6aa8ff | The colour of the arrow, the radar and the time ring. |
WAVES | script.js | 2 | How many waves leave the pill on click, one or two. |
SPRING | script.js | 0.8 | How long the spring that brings in each friend lasts, in seconds. |
STAGGER | script.js | 0.24 | How many seconds between one friend and the next. |
RING_SECONDS | script.js | 40 | How many seconds the time ring takes to wear down in the demo (in a real app, an hour). |
HOLD | script.js | 4.4 | How many seconds the autopilot leaves the sharing on. |
On the screen of an app for meeting up with friends, in an events or festival app to find your group, in a trip chat, on a restaurant pickup or delivery page where you share your location for an hour: wherever you want to show at once who is nearby.
The radar field narrows to the screen width and the window height, the friends sit at fixed fractions of the field and the discs shrink to 32 pixels under 360; a finger presses like the mouse. Without hover the arrow stays at its resting tilt and the edge light stays in the middle.
No springs, growing waves, flights or rolling digits: labels and width change in a moment, the range ring fades in, the friends appear already in place with the right distance and fade out on stop.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 9.4 KB; the libraries: GSAP 28 KB.
Tested on 13 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.