Skip to content
animorio
IT
Back to the library

Ride trip summary

SVG, HoverGSAP, CSS onlyMediumCompressed weight: Demo 6.1 KBGSAP 28 KBFreeDownload the zip

The end-of-trip screen of a ride app: a small map with the yellow route drawing itself from end to end while the fare counts, then the five stars for the driver and the tip. Hover the stars and they light one after the other with a bounce while the rating word rolls; choose a tip and a white marker slides under the amount and the total rises.

The code

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>
<!--
  "Ride trip summary" 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>Ride trip summary</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 end-of-trip summary of a ride app: the route draws itself across a small map, the fare counts up,
         the stars for the driver fill on a spring and the tip adds itself to the total -->
    <section class="tr" data-tr aria-label="Trip summary">
      <div class="tr__map" aria-hidden="true">
        <svg viewBox="0 0 296 104" preserveAspectRatio="xMidYMid slice">
          <g class="tr__streets"><path d="M-10 30h320M-10 74h320M52 -10v130M118 -10v130M204 -10v130M262 -10v130"></path><path d="M-10 96 150 -10M150 120 310 20"></path></g>
          <path class="tr__route" data-route pathLength="1" d="M30 82h76a12 12 0 0 0 12-12V42a12 12 0 0 1 12-12h62a12 12 0 0 1 12 12v20a12 12 0 0 0 12 12h46"></path>
          <circle class="tr__from" cx="30" cy="82" r="5"></circle>
          <rect class="tr__to" data-to x="255" y="67" width="14" height="14" rx="4"></rect>
          <circle class="tr__car" data-car r="5.500"></circle>
        </svg>
      </div>
      <div class="tr__facts">
        <div><p class="tr__small">Station Rd to Harbour St</p><p class="tr__meta">12 min, 4.8 km</p></div>
        <p class="tr__fare"><span>Total</span><b data-fare></b></p>
      </div>
      <div class="tr__rate">
        <p class="tr__ask"><span>How was <b>Dana</b>?</span><span class="tr__word"><i data-word></i></span></p>
        <div class="tr__stars" data-stars role="radiogroup" aria-label="Rate your driver"></div>
      </div>
      <div class="tr__tips" data-tips role="radiogroup" aria-label="Add a tip">
        <span class="tr__marker" data-marker aria-hidden="true"></span>
      </div>
      <span class="tr__say" data-say aria-live="polite"></span>
    </section>

    <svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.200 19.200 11l-6.300 1.600-3.300 5.900Z"></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>

Playground

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.

16 values to change

Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI

Or ask your AI assistant for it

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 “Ride trip summary” from Animorio and fit it into my site
Platform licenseFree on your sites and your clients’ sites. Want it inside a website builder, a template platform or a client dashboard? There’s a license for agencies and platforms.

What it does

On a near-black ground with a yellow glow at the top, a dark card. At the top a low map: faint grey streets, a hollow white ring on the left and a small white square on the right. On opening a yellow line leaves the ring and draws itself along the streets, a yellow dot at its head, as far as the square, which gives a small jump; meanwhile, on the right, “Total” counts up to $14.20. Below: “Station Rd to Harbour St”, “12 min, 4.8 km”. Then a panel, “How was Dana?”, with five empty stars: hover them and they fill with yellow one after the other, growing from the centre with a bounce, and on the right the word rolls from “Good” to “Great” to “Excellent”; a tap sets the rating. At the bottom four choices, “No tip”, $1, $2, $3, with a white marker under the first: tap $2 and the marker slides under it on a spring and the total rises to $16.20 with a small jump.

How it works

The route and the dot

A number from 0 to 1 does two things: it is the path’s stroke-dashoffset (pathLength 1) and, through getPointAtLength, the position of the yellow dot at the head of the line.

The stars

Each star has a hollow outline and a full copy that starts from scale zero round its centre (svgOrigin): lighting up to n means animating only the ones that change, staggered.

The rating word

The word leaves upwards and the new one comes in from below (or the other way if the rating drops), inside a container that clips it.

The tip

A single white marker takes the x and width of the choice; the total is a number animated towards fare plus tip, rewritten with two decimals.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#ffc53dThe colour of the route, the full stars and the rating word.
FAREscript.js14.2The fare, before the tip.
DRAW_TIMEscript.js1.6How many seconds the route takes to draw on opening.
SPRINGscript.js1How much the stars bounce as they fill: 0.3 = a little, 2 = a lot.
LOOPscript.jstrueLeft alone, the demo’s pointer gives the rating and chooses the tip.

Try them in the Playground

When to use it

At the end of a ride in a ride app, of a home delivery, of a rental: wherever a service closes with the route taken, the price, a rating and a tip.

On phones

It is made for the phone: the card is 316 pixels wide at most, the map gets shorter on low screens, the stars are 40 pixels wide and the tips 32 tall; with a finger one tap lights and sets the rating together.

With reduced motion

The route is already drawn and the fare already written; the stars light without growing, the word and the total change at once and the tip marker jumps onto the choice. The demo does not move by itself.

Pitfalls

  • Streets, driver, fare and tips are made up and the map is a drawing: in a real app the route comes from the maps service and the price from the server.
  • Stars and tips are two radiogroups: arrows change the choice and move focus, and each star has a label with its number and word.
  • The rating is not in the colour alone: the word is beside it, and an aria-live region repeats it together with the total after the tip.
  • The star’s full copy grows with svgOrigin at the centre of the drawing: transformOrigin on an SVG element is measured on its box and would make it grow from a corner.
  • The money in the demo is floating-point: in a real app it is counted in whole cents.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 6.1 KB; the libraries: GSAP 28 KB.

Testing

Tested on 22 November 2026

  • Desktop: Done
  • Phone: Done
  • Reduced motion: Done
  • Safari on iPhone: To do

License

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.

All animations