Skip to content
animorio
IT
All components

Offline notes notice

Notifications, HoverGSAP, CSS onlyMediumCompressed weight: Demo 8.1 KBGSAP 28 KBFreeDownload the zip

A notes app’s notice when the connection drops and comes back, on white, in the style of real product interface pieces: a dark pill comes down from the top with a crossed-out cloud and «You’re offline», every word you write flies as a small mark into the counter of pending changes, and when the network returns the bar over the cloud melts, the changes fly up into the cloud one by one, the counter falls to zero and the pill turns into «Synced» with a check and goes back up.

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>
<!--
  "Offline notes notice" 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 offline notes notice with the changes that fly into the cloud</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 notice of a notes app: while you write, the connection drops and a dark pill comes down from the
         top with a crossed-out cloud; every word you write offline is a change kept on the device and the counter
         climbs. When the network returns the bar over the cloud melts, the changes fly up into it one by one, the
         counter falls to zero and the pill turns into «Synced» with a check, then goes back up with a small settle -->
    <div class="deck" data-deck>
      <div class="slot">
        <button class="pill" type="button" data-pill aria-label="Offline notice: press to try to reconnect">
          <span class="pill__sheen" aria-hidden="true"><span class="pill__sweep" data-sweep></span></span>
          <span class="cloud" data-cloud aria-hidden="true">
            <svg viewBox="0 0 24 24">
              <path class="cloud__shape" data-shape d="M7.4 18.6h9.4a4.1 4.1 0 0 0 .55-8.16 5.6 5.6 0 0 0-10.7 1.18A3.5 3.5 0 0 0 7.4 18.6z"/>
              <g class="cloud__cut" data-cut>
                <line x1="4.4" y1="4.4" x2="19.6" y2="19.6"/>
              </g>
              <g class="cloud__bar" data-bar>
                <line x1="4.4" y1="4.4" x2="7.44" y2="7.44"/>
                <line x1="7.44" y1="7.44" x2="10.48" y2="10.48"/>
                <line x1="10.48" y1="10.48" x2="13.52" y2="13.52"/>
                <line x1="13.52" y1="13.52" x2="16.56" y2="16.56"/>
                <line x1="16.56" y1="16.56" x2="19.6" y2="19.6"/>
              </g>
              <path class="cloud__up" data-up d="M12 16v-5.2M9.9 12.8 12 10.7l2.1 2.1"/>
              <path class="cloud__tick" data-tick d="M9.2 13.9l2 2 3.9-4.2"/>
            </svg>
          </span>
          <span class="pill__words" data-words>
            <span class="pill__title" data-title><span>You’re offline</span></span>
            <span class="pill__sub" data-sub><span>Changes saved on this device</span></span>
          </span>
          <span class="badge" data-badge>
            <span class="badge__in">
              <span class="badge__num" data-num><span>0</span></span>
              <span class="badge__label">pending</span>
            </span>
          </span>
        </button>
      </div>

      <article class="note" data-note aria-label="Note">
        <header class="note__head">
          <span class="note__name">Sunday market</span>
          <span class="note__when" data-when>Edited just now</span>
        </header>
        <p class="note__body"><span data-text></span><span class="note__caret" data-caret aria-hidden="true"></span></p>
        <span class="note__rule" aria-hidden="true"></span>
        <footer class="note__foot">
          <span>Marginal</span>
          <span data-words-count>0 words</span>
        </footer>
      </article>
    </div>
    <div class="flight" data-flight aria-hidden="true"></div>
    <p class="sr" aria-live="polite" data-live></p>
  </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.

25 values to change

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 “Offline notes notice” 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 white sits a small note from Marginal, an invented notes app: at the top «Sunday market» and «Edited just now», below the text writing itself with a blue caret, at the bottom the word count. After the first words the connection drops: a dark pill comes down from the top on a spring, squashes a touch as it lands and settles. On the left, in a circle, a grey cloud with a bar across it, drawn in pieces from the top; next to it «You’re offline» and «Changes saved on this device»; on the right the counter «0 pending». From now on every finished word leaves the caret as a small mark, makes an arc and drops into the counter, which rolls up by one and gives a little hop; the note says «Saved on this device». Soon after the last word the network returns: the pieces of the bar sag, stretch and drip away from the middle outwards, the cloud turns blue and a small up arrow draws itself inside; the title rolls to «Back online» and below «Syncing 8 changes». The changes leave the counter one at a time, blue marks flying in an arc into the cloud, each one a small pulse, and the counter goes down to zero. At zero the counter folds away, the pill narrows, the arrow gives way to a check drawing itself and the title becomes «Synced» with «8 changes in the cloud». Then the pill dips a pixel and goes back up, the note empties and the loop starts again. Pressing the pill while offline brings the network back at once; it works with mouse, touch and keyboard.

How it works

The pill that comes down

The pill sits in a fixed slot over the note, so the note never jumps. It starts at yPercent -160 and comes down to 0 with back.out(1.5); halfway a scaleY of 0.965 for nine hundredths and an elastic make it settle as if it touched.

Words that become changes

The direction is a timeline of calls, one per letter, with a slightly uneven rhythm and a pause on commas. When a letter ends a word a mark is born in the .flight layer: it follows a quadratic Bézier curve from the caret to the counter, recomputed every frame on the target’s real position, rotated along the tangent.

The rolling counter

The new digit comes from below, absolutely positioned, while the old one rises and fades, then goes back to normal; the box gives an elastic hop of 1.1 going up and 0.94 going down. At zero its measured width goes to zero and the pill narrows with it.

The bar that melts

The cloud’s bar is five pieces of line, over a wide cut in the pill’s colour that separates it from the cloud. When the network returns the pieces drop a few pixels, stretch in scaleY and narrow in scaleX while they fade, staggered from the middle: they look like they drip.

The pill’s words

Title and line below roll like the digit; the words column tweens to the width of the new lines, measured while they are still absolutely positioned, so the pill changes size without a jolt.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#3f7cffThe colour of the cloud coming back, the marks going up and the check.
TYPE_SPEEDscript.js15The letters per second written in the note.
OFFLINE_FORscript.js1.3The seconds offline after the last word, before the network returns.
FLYscript.js0.6The flight time of each change, in seconds.
GAPscript.js0.2The seconds between one change and the next as they go up into the cloud.
HOLDscript.js1.6The seconds «Synced» stays before going back up.
LOOPscript.jstrueStart the loop again from the top.

Try them in the Playground

When to use it

For a notes or writing app, a document editor or any app that saves on the device and syncs later: it says gently that the network dropped, that nothing is lost, and shows the changes leaving when it returns.

On phones

Pill and note take the width of the box, heights are in vh with clamp and the words column can shrink; the marks fly in the layer over the page and the page never scrolls sideways. A tap on the pill does what a click does.

With reduced motion

No springs, flights or rolls: the pill fades in and out, the counter and the words change in place, the bar fades, the arrow and the check appear without drawing themselves.

Pitfalls

  • The pill sits in a slot as tall as itself even when it is away: hung over the note without its slot, the note jumped at every arrival.
  • The flying mark recomputes its target every frame: the counter is inside the pill that is still settling, and with a fixed target the mark landed a couple of pixels off.
  • The counter goes up when the mark lands, not when the word ends, but the number of changes to sync is counted at once: pressing the pill mid-word keeps the marks still in flight in the count.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 11 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 components