Skip to content
animorio
IT
All components

Connection lost notice

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

A chat app’s notice when the connection drops, on white, in the style of real product interface pieces: a dark pill rises from the bottom on a spring, the wifi goes out arc by arc and a thin ring counts the seconds to the next try. Retry tries, fails the first time with a shake, the second time the arcs light up again, the notice turns light with «Back online» and a check and slides away, while the inbox lights up and the waiting message goes out.

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>
<!--
  "Connection lost 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 connection-lost notice that comes back online</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 inbox of a team chat app: the connection drops, a dark notice rises from the bottom with the wifi
         going out arc by arc and a countdown to the next try; Retry tries, fails once with a shake, then the arcs
         fill, the notice turns light with «Back online» and slides away, and the inbox lights up again -->
    <section class="screen" data-screen aria-label="Inbox">
      <header class="top">
        <span class="brand"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M4 6.5A2.5 2.5 0 0 1 6.5 4h11A2.5 2.5 0 0 1 20 6.5v7a2.5 2.5 0 0 1-2.5 2.5H11l-4.5 3.5V16h0A2.5 2.5 0 0 1 4 13.5z"/></svg><span data-app>Halcyra</span></span>
        <span class="top__title">Inbox</span>
      </header>
      <ul class="list" data-list>
        <li class="row" data-row>
          <span class="av" style="--av:#e8e1f7">NO</span>
          <span class="row__txt"><span class="row__name">Noor Okafor</span><span class="row__msg">The deck is in the shared folder</span></span>
          <span class="row__time">9:41</span>
        </li>
        <li class="row" data-row>
          <span class="av" style="--av:#dff0e6">TB</span>
          <span class="row__txt"><span class="row__name">Tomas Berg</span><span class="row__msg">Can we move the review to 3?</span></span>
          <span class="row__time">9:28</span>
        </li>
        <li class="row" data-row>
          <span class="av" style="--av:#f7e6da">LM</span>
          <span class="row__txt"><span class="row__name">Lena Moreau</span><span class="row__msg">Sent you the new icons</span></span>
          <span class="row__time">9:02</span>
        </li>
        <li class="row" data-row>
          <span class="av" style="--av:#dde9f7">DK</span>
          <span class="row__txt"><span class="row__name">Design crit</span><span class="row__msg">Ava: looks great, ship it</span></span>
          <span class="row__time">8:47</span>
        </li>
      </ul>
      <div class="draft" data-draft>
        <span class="draft__txt">Running ten minutes late</span>
        <span class="draft__state" data-draft-state>Waiting to send</span>
      </div>

      <div class="toast" role="status" aria-live="polite" data-toast>
        <span class="wifi" aria-hidden="true">
          <svg class="ring" viewBox="0 0 40 40"><circle class="ring__track" cx="20" cy="20" r="17"/><circle class="ring__run" cx="20" cy="20" r="17" data-ring/></svg>
          <svg class="arcs" viewBox="0 0 24 24">
            <path class="arc" data-arc d="M3.2 9.4a12.6 12.6 0 0 1 17.6 0"/>
            <path class="arc" data-arc d="M6.3 12.6a8.2 8.2 0 0 1 11.4 0"/>
            <path class="arc" data-arc d="M9.4 15.8a3.8 3.8 0 0 1 5.2 0"/>
            <path class="arc arc--base" data-arc d="M11.1 19h1.8"/>
            <path class="cross" data-cross d="M5 5l14 14"/>
          </svg>
          <svg class="tick" viewBox="0 0 24 24"><path data-tick d="M6 12.5l4 4 8-9"/></svg>
        </span>
        <span class="toast__txt">
          <span class="toast__title"><span class="swap" data-title><span>You’re offline</span></span></span>
          <span class="toast__sub" data-sub><span class="swap"><span>Retrying in <span class="digit" data-digit><span>5</span></span>s</span></span></span>
        </span>
        <button class="retry" type="button" data-retry>Retry</button>
      </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>

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.

43 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 “Connection lost 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 a very light grey background sits the white window of Halcyra, an invented chat app: at the top the mark with the blue speech bubble and Inbox, below four conversations with initials on soft circles, the name, the last line and the time, and at the bottom a message we wrote, «Running ten minutes late», with «Waiting to send». Soon the connection drops: the inbox dims and loses its colour, and a dark pill rises from the bottom on a spring. On the left the drawn wifi goes out arc by arc, from the biggest to the smallest, and a thin red line crosses it; around it a white ring empties while «Retrying in 5s» counts down, its digit rolling. On the right the white Retry button. Pressed (or at zero) the notice says «Connecting…», the red line pulls back and the arcs light up from the bottom: on the first try they stop halfway, fall back, the pill gives a shake, the red line returns and the title becomes «Still offline» with a new 3-second count. On the second try all the arcs fill, the pill turns white, the arcs turn blue and give way to a check drawing itself, the title rolls to «Back online» and below «1 message sent»; the inbox lights up again, the waiting message gives a small hop and says «Sent 9:43», then the notice slides away. A drawn pointer presses Retry by itself and the loop starts again; it also really works, with mouse, touch and keyboard.

How it works

The pill that rises

The notice is absolute at the bottom of the window: it starts at yPercent 160 and rises to 0 with back.out(1.5), while widening from 0.92 to 1, so it looks pushed up by a spring. It leaves with back.in.

The wifi arc by arc

The wifi is four paths: three arcs and the base. Offline, the three arcs go to 0.18 opacity one after the other from the outermost, and a red line draws itself over them with strokeDashoffset. On a try they light up the other way round, from the base outwards.

The count and the ring

A circle with a strokeDasharray as long as its circumference empties linearly over the seconds of the count; every second the digit rolls: the old one rises and fades, the new one comes from below with back.out. At zero the try starts by itself.

The first try that fails

On the first try of each loop only two arcs light up, then one falls back; the pill shakes with x keyframes (-7, 6, -4, 2, 0), the red line returns and a three-second count starts. The second try lights everything.

Back online

The pill goes from near black to white and the text from white to near black in one colour tween; the arcs take the accent colour and fade, and a check draws itself in their place. The inbox returns to full opacity and saturation, and the waiting message changes state.

Values to change

NameFileDefaultWhat it changes
APPscript.jsHalcyraThe name of the invented chat app, written at the top.
ACCENTscript.js#2f6bffThe colour of the check, the arcs coming back and the mark.
COUNTDOWNscript.js5The seconds before the notice tries again by itself.
RISEscript.js0.7The seconds the notice takes to rise from the bottom on its spring.
DIMscript.js0.5How much the inbox dims while offline (1 = not at all).
HOLDscript.js1.6The seconds «Back online» stays before sliding away.

Try them in the Playground

When to use it

For a chat, mail or collaboration app, a live dashboard, a phone app that has to say gently that the network dropped and when it came back, without blocking the screen.

On phones

The window takes the width of the box and a height measured in vh, the inbox rows tighten with the height, and the notice stays as wide as the window minus the margins; Retry stays big enough for a finger. A tap does what a click does.

With reduced motion

No springs, shakes or rolls: the notice fades in and out, digits and titles change in place, the arcs and the check change without drawing themselves. The drawn pointer stays hidden.

Pitfalls

  • Rolling lines keep the new words absolutely positioned until the old ones are gone, then go back to normal: otherwise there are two lines for a moment and the text jumps.
  • The try reads the count digit inside the newest line: the old one stays in the DOM for the three tenths of its exit, so the first update comes after a second, when it is gone.
  • The colour of the pill and the text changes with a GSAP tween and not a class: the CSS transition and the shake tweens trod on each other.

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 27 October 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