Skip to content
animorio
IT
Back to the library

Jet lag plan

Hover, SVGGSAP, CSS onlyAdvancedCompressed weight: Demo 8.6 KBGSAP 28 KBFreeDownload the zip

The jet lag plan of a travel app, from Lisbon to Tokyo: a strip with two clocks, home above and destination below, and between them the sleep band with the light to avoid before it and to seek after it. Going through the days the whole band slides on a spring towards the new time zone, the times roll and the body clock bar fills; moving over the strip a cursor reads the time in both cities.

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>
<!--
  "Jet lag plan" 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>Jet lag plan</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 jet lag plan of a travel app: two clocks, home and destination, and the sleep band
         sliding day after day towards the new time zone, with the light to seek and to avoid -->
    <section class="jl" data-jl aria-label="Jet lag plan, Lisbon to Tokyo">
      <header class="jl__top">
        <span class="jl__mark" aria-hidden="true"><svg viewBox="0 0 20 20"><path d="M3 12.500 17 4.500l-4.500 12-2.300-5.200Z"></path><path d="m10.200 11.300 6.800-6.800"></path></svg></span>
        <span class="jl__id"><b>Lisbon to Tokyo</b><span data-outsub>9 hours ahead, 5-day plan</span></span>
      </header>
      <div class="jl__days" role="group" aria-label="Day of the plan" data-days>
        <span class="jl__thumb" data-thumb aria-hidden="true"></span>
        <button type="button" data-day="0" aria-pressed="true">Wed</button>
        <button type="button" data-day="1" aria-pressed="false">Thu</button>
        <button type="button" data-day="2" aria-pressed="false" aria-label="Friday, flight day"><svg viewBox="0 0 14 14" aria-hidden="true"><path d="M2 8.800 12 3l-3.200 8.600-1.600-3.700Z"></path></svg>Fri</button>
        <button type="button" data-day="3" aria-pressed="false">Sat</button>
        <button type="button" data-day="4" aria-pressed="false">Sun</button>
      </div>
      <div class="jl__strip" data-strip tabindex="0" role="img" aria-label="The day on two clocks. Use the left and right arrows to read the hours.">
        <svg data-svg aria-hidden="true">
          <defs><pattern id="jl-hatch" width="5" height="5" patternUnits="userSpaceOnUse" patternTransform="rotate(45)"><line x1="0" y1="0" x2="0" y2="5"></line></pattern></defs>
        </svg>
        <span class="jl__zone jl__zone--home" data-zonehome>Lisbon</span>
        <span class="jl__zone jl__zone--away" data-zoneaway>Tokyo</span>
        <span class="jl__tag jl__tag--home" data-taghome>12:00</span>
        <span class="jl__tag jl__tag--away" data-tagaway>21:00</span>
      </div>
      <ul class="jl__rows">
        <li data-row="avoid"><svg viewBox="0 0 14 14" aria-hidden="true"><circle cx="7" cy="7" r="2.600"></circle><path d="M7 1.200v1.300M7 11.500v1.300M1.200 7h1.300M11.500 7h1.300M2.900 2.900l.9.9M10.200 10.200l.9.9M11.100 2.900l-.9.900M3.800 10.200l-.9.900"></path><path class="jl__slash" d="M2 12 12 2"></path></svg><b>Avoid light</b><span class="jl__time"><span data-outavoid>20:00 to 23:00 Lisbon</span></span></li>
        <li data-row="sleep"><svg viewBox="0 0 14 14" aria-hidden="true"><path d="M8.300 1.800a5.400 5.400 0 1 0 3.900 8.300A4.600 4.600 0 0 1 8.300 1.800Z"></path></svg><b>Sleep</b><span class="jl__time"><span data-outsleep>23:00 to 07:00 Lisbon</span></span></li>
        <li data-row="seek"><svg viewBox="0 0 14 14" aria-hidden="true"><circle cx="7" cy="7" r="2.600"></circle><path d="M7 1.200v1.300M7 11.500v1.300M1.200 7h1.300M11.500 7h1.300M2.900 2.900l.9.9M10.200 10.200l.9.9M11.100 2.900l-.9.900M3.800 10.200l-.9.900"></path></svg><b>Seek light</b><span class="jl__time"><span data-outseek>07:00 to 10:00 Lisbon</span></span></li>
      </ul>
      <div class="jl__meter">
        <span class="jl__meterhead"><b>Body clock</b><span class="jl__shift"><span data-outshift>On Lisbon time</span></span></span>
        <span class="jl__track"><i data-fill></i></span>
      </div>
    </section>
    <span class="live" aria-live="polite" data-live></span>

    <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.

30 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 “Jet lag plan” 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 black, a dark card: at the top the mark with the paper plane, “Lisbon to Tokyo” and “9 hours ahead, 5-day plan”; below, the selector of the five days, Wednesday to Sunday, with the Friday of the flight marked by a small plane; then the strip of the day: Lisbon’s hours above, Tokyo’s below, and three joined bands in between: the light to avoid, hatched, sleep, light with the moon, and the light to seek, amber with the sun. Below, the three rows with their times and the body clock bar. On opening the plan arrives from later in the night and settles on its hours. On a new day the pill slides under the chosen day, the three bands travel left together on a spring, the times in the rows roll and the bar fills: “3 of 9 h shifted”. From Saturday, in Tokyo, the clock above dims and the one below lights up, and the times are written in Tokyo time. Moving over the strip brings in a dashed cursor that snaps from half hour to half hour, with two tags: the time in Lisbon above and in Tokyo below; the band under the cursor stays lit, the others dim and its row is highlighted. It also reads from the keyboard, with the left and right arrows.

How it works

One number for the whole plan

A day’s whole plan comes from a single number: bedtime. The light to avoid sits before it, sleep lasts its hours and the light to seek comes after. On a new day GSAP moves that number on a spring and the three bands follow it together.

Two clocks on one strip

The strip is one day on the home clock, from noon to noon. The destination hours are the same positions plus the time difference; a second number, from zero to one, says which of the two clocks is lit.

The cursor

The hour is worked out from the pointer’s position, rounded to the half hour. The band containing it is looked up: it gets an attribute, and the same attribute goes to its row below.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#ffb547The colour of the light to seek, the bar and the mark.
SHIFTscript.js9How many hours ahead the destination is.
SLEEPscript.js8How many hours of sleep a night.
LIGHTscript.js3How many hours the light to seek after waking and to avoid before bed lasts.
SPRINGscript.js1How much the bands and the day selector bounce.

Try them in the Playground

When to use it

In the app of an airline or a travel agency, after booking a long-haul flight; on the page of a hotel welcoming guests from far away; in a sleep or wellness app. The same strip carries night shifts or the clock change.

On phones

The card is at most 344 pixels wide and narrows with the screen: the strip gets shorter and the bands with it. It is about 330 pixels tall. With a finger the cursor moves by dragging sideways on the strip, and the page still scrolls vertically; the days are 26 pixel tall keys in a row as wide as the card.

With reduced motion

The plan is on its hours at once. On a new day the bands are in their new place immediately, the times change without rolling and the bar takes its length at once; the cursor appears on the hour without a spring. The demo’s pointer does not start.

Pitfalls

  • The three bands are not told apart by colour alone: each has its own icon and pattern (hatched, light, solid), and the rows below say them in words with their times.
  • The icons inside the SVG are moved by writing the transform attribute from a number, not with GSAP transforms: on an SVG element the pivot would be measured on its own box.
  • The viewBox is taken from the pixel size of the strip: when the window changes width it is measured and redrawn.
  • The plan is invented and simplified (a sixth of the difference a day before the flight, the rest after): a real plan depends on the person, the flight time and the direction, and it is not medical advice.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 27 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