
The elastic button
Buttons, Hover, Text
The «Request ride» button of a city ride app, on white, in the style of real product interface pieces: pressed, it looks for a driver, one of the cars on the small line-drawn map accepts, the route draws itself to the pickup and the car drives it while the minutes count down, as the button widens into the black driver card with the plate and Cancel; on arrival a check and «Your driver is here».
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>
<!--
"Request ride 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 Request ride button with the car arriving on the map</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 ride card of a city ride app: pressed, the button looks for a driver, a car is picked on the map, the route
draws itself, the car drives to the pickup while the minutes count down and the button becomes the driver card -->
<section class="rd" data-card aria-label="Curbly ride">
<header class="rd__head">
<svg class="rd__mark" viewBox="0 0 24 24" aria-hidden="true"><path d="M5 15.5V11l2.2-4.4h9.6L19 11v4.5"></path><path d="M4.5 15.5h15"></path><path d="M7.6 18.4v-2.9M16.4 18.4v-2.9"></path></svg>
<p class="rd__brand">Curbly <span>/ Ride</span></p>
<p class="rd__state" data-state>3 cars nearby</p>
</header>
<div class="map" data-map>
<svg class="map__svg" viewBox="0 0 320 150" preserveAspectRatio="xMidYMid slice" aria-hidden="true">
<rect width="320" height="150" class="m-ground"></rect>
<path class="m-water" d="M-10 58 C 30 50 60 66 96 56 S 150 40 176 46 L 176 20 C 150 14 120 30 92 30 S 30 22 -10 30 Z"></path>
<rect class="m-park" x="208" y="88" width="64" height="30" rx="6"></rect>
<g class="m-blocks">
<rect x="0" y="86" width="34" height="32" rx="4"></rect>
<rect x="46" y="86" width="68" height="32" rx="4"></rect>
<rect x="126" y="86" width="68" height="32" rx="4"></rect>
<rect x="46" y="132" width="68" height="30" rx="4"></rect>
<rect x="206" y="36" width="68" height="36" rx="4"></rect>
<rect x="286" y="36" width="40" height="36" rx="4"></rect>
<rect x="286" y="86" width="40" height="32" rx="4"></rect>
<rect x="206" y="132" width="68" height="30" rx="4"></rect>
</g>
<g class="m-roads">
<path d="M-10 78H330"></path>
<path d="M-10 124H330"></path>
<path d="M200 30H330"></path>
<path d="M40 70V160"></path>
<path d="M120 70V160"></path>
<path d="M200 -10V160"></path>
<path d="M280 -10V160"></path>
</g>
<g class="m-cross" aria-hidden="true">
<path d="M132 119.5v9M135 119.5v9M138 119.5v9M141 119.5v9"></path>
</g>
<g class="m-trees">
<circle cx="218" cy="98" r="3.2"></circle><circle cx="228" cy="110" r="2.6"></circle><circle cx="258" cy="96" r="3"></circle><circle cx="264" cy="110" r="2.4"></circle>
</g>
<g class="m-lines">
<path d="M-10 78H330M-10 124H330M200 30H330M200 -10V160M280 -10V160"></path>
</g>
<text class="m-name" x="62" y="74">Harlow St</text>
<text class="m-name" x="214" y="120">Mercer Ave</text>
<text class="m-name m-name--park" x="223" y="106">Linden Park</text>
<path class="route__glow" data-r-glow d="M280 22V72Q280 78 274 78H126Q120 78 120 84V118Q120 124 126 124H146"></path>
<path class="route" data-route d="M280 22V72Q280 78 274 78H126Q120 78 120 84V118Q120 124 126 124H146"></path>
<g class="pin" data-pin transform="translate(164 117)">
<ellipse class="pin__shadow" cx="0" cy="0" rx="5" ry="1.8"></ellipse>
<g data-pin-body>
<path class="pin__body" d="M0 0C-1.2-3.6-6.2-7.6-6.2-12A6.2 6.2 0 0 1 6.2-12C6.2-7.6 1.2-3.6 0 0Z"></path>
<circle class="pin__hole" cx="0" cy="-12" r="2.3"></circle>
</g>
</g>
<g transform="translate(164 92)">
<g class="tag" data-tag>
<rect x="-20" y="-8" width="40" height="13" rx="6.5"></rect>
<text x="0" y="1.4">Pickup</text>
</g>
</g>
<g class="car car--other" data-other transform="translate(200 46) rotate(-90)"><use href="#car"></use></g>
<g class="car car--other" data-other transform="translate(62 78) rotate(0)"><use href="#car"></use></g>
<g class="car car--other" data-other transform="translate(304 124) rotate(180)"><use href="#car"></use></g>
<g class="car car--mine" data-car transform="translate(280 22) rotate(90)">
<g data-car-body><use href="#car"></use></g>
</g>
<defs>
<g id="car">
<ellipse cx="0.6" cy="1.2" rx="9.4" ry="5" class="car__shadow"></ellipse>
<rect x="-8.5" y="-4.4" width="17" height="8.8" rx="3.2" class="car__body"></rect>
<rect x="1.4" y="-3.3" width="3.6" height="6.6" rx="1.3" class="car__glass"></rect>
<rect x="-6.6" y="-3.1" width="2.6" height="6.2" rx="1.1" class="car__glass car__glass--back"></rect>
<rect x="-3.4" y="-3.4" width="4.4" height="6.8" rx="1" class="car__roof"></rect>
<rect x="7.1" y="-3.6" width="1" height="1.8" rx="0.5" class="car__light"></rect>
<rect x="7.1" y="1.8" width="1" height="1.8" rx="0.5" class="car__light"></rect>
</g>
</defs>
</svg>
</div>
<div class="trip" data-trip>
<p><span class="trip__k">From</span><span class="trip__v">14 Harlow St</span></p>
<p><span class="trip__k">To</span><span class="trip__v">Station Square</span></p>
</div>
<div class="zone" data-zone>
<div class="opt" data-opt>
<svg class="opt__ico" viewBox="0 0 24 24" aria-hidden="true"><path d="M5 15.5V11l2.2-4.4h9.6L19 11v4.5"></path><path d="M4.5 15.5h15"></path><path d="M7.6 18.4v-2.9M16.4 18.4v-2.9"></path></svg>
<p class="opt__name">Standard<span>4 seats, 3 min away</span></p>
<p class="opt__price" data-price></p>
</div>
<div class="shape" data-shape></div>
<button class="req" type="button" data-btn>
<span class="req__icon" aria-hidden="true">
<svg class="req__car" data-ico-car viewBox="0 0 24 24"><path d="M5 15.5V11l2.2-4.4h9.6L19 11v4.5"></path><path d="M4.5 15.5h15"></path><path d="M7.6 18.4v-2.9M16.4 18.4v-2.9"></path></svg>
<svg class="req__ring" data-ico-ring viewBox="0 0 24 24"><circle class="ring__bg" cx="12" cy="12" r="7.6"></circle><circle class="ring__fg" cx="12" cy="12" r="7.6"></circle></svg>
</span>
<span class="req__label" data-label>Request ride</span>
</button>
<div class="drv" data-drv aria-live="polite">
<div class="drv__top">
<span class="drv__face" aria-hidden="true">DK</span>
<p class="drv__who">Dana K.<span><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 3.6l2.5 5.3 5.8.7-4.3 4 1.1 5.7L12 16.5l-5.1 2.8 1.1-5.7-4.3-4 5.8-.7Z"></path></svg>4.92</span></p>
<div class="eta" data-eta-box>
<p class="eta__num"><span class="eta__roll" data-eta></span><span class="eta__unit" data-eta-unit>min</span></p>
<svg class="eta__check" data-eta-check viewBox="0 0 24 24" aria-hidden="true"><path data-check-path d="M5.5 12.6 10 17 18.6 7.6"></path></svg>
</div>
</div>
<div class="drv__bottom">
<p class="drv__car"><span data-msg>Grey hatchback</span><span class="plate">KR 482 TN</span></p>
<button class="drv__btn" type="button" data-cancel>Cancel</button>
</div>
</div>
</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.
40 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 “Request ride button” from Animorio and fit it into my siteBlocks, streets, river, park, cars and pin live in one SVG with a 320 by 150 viewBox and preserveAspectRatio slice: the map fits any card size by cropping its edges, and everything that moves uses the map’s coordinates.
The route is a path with rounded corners. An object l goes from 0 to the length of the path: on every update getPointAtLength gives the point and, with a point one pixel further on, the angle, and the car gets a translate and a rotate. Thanks to the rounded corners the rotation is smooth.
The path has a dash as long as the remaining stretch and a negative stroke-dashoffset equal to the distance already covered: so it shows only from the car to the pickup, and the same trick with a 0 to 1 factor grows it out of the car at the start.
Button, option and driver card share one zone, as tall as the card: the black background is a separate element that GSAP takes from the pill’s height to the zone’s and from a radius of 22 to 16, while the option slides away and the card’s pieces come in one after another. The rest of the card never moves.
The minutes are recomputed at every step of the car; when they change, the old number leaves upwards and the new one rises from below with a small bounce, inside a box with overflow hidden.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #2563eb | The colour of the route on the map and of the label on the way. |
ETA | script.js | 4 | The minutes away when the driver accepts: they count down as the car gets closer. |
DRIVE_TIME | script.js | 5.2 | The seconds the car takes to reach the pickup. |
FIND_TIME | script.js | 1.6 | The seconds the app spends finding a driver. |
PRICE | script.js | 14.20 | The price of the ride, in dollars. |
PAUSE | script.js | 2.2 | The seconds the autopilot waits between one gesture and the next. |
For a ride or taxi app, a hotel or airport shuttle service, a home delivery, a car or scooter rental, any request that sends someone towards the person who made it.
The card takes the full width minus the margins and the map is sized on the height too (a quarter of the screen, between 92 and 158 pixels), cropping its edges; below 470 pixels of height the start and destination hide, so the card fits the box even when open. A 44-pixel button and a 30-pixel Cancel, easy for a finger.
No driving cars or springs: the search takes a moment, the driver card fades in, the car is already at the pickup with the route done and the check already drawn; the drawn pointer stays hidden.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 9.2 KB; the libraries: GSAP 28 KB.
Tested on 28 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.