Skip to content
animorio
IT
Back to the library

Live seismograph

SVG, HoverGSAP, CSS onlyAdvancedCompressed weight: Demo 5.7 KBGSAP 28 KBFreeDownload the zip

The earthquake card of a monitoring app: the seismograph’s green trace runs live under a still pen. Tap it and a tremor arrives: a small first wave, then the large one dying away slowly; the magnitude climbs at the top right, the card shakes with the stronger ones, the five strength marks light up and the last event is written below.

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>
<!--
  "Live seismograph" 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>Live seismograph</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 earthquake card of a monitoring app: the trace runs live under a still pen;
         tap it and a tremor arrives, the magnitude rolls up and the last event is written below -->
    <section class="sm" data-sm aria-label="Seismic monitor">
      <header class="sm__top">
        <span class="sm__title"><b>Seismic monitor</b><span class="sm__status"><span data-outstatus>Harbour station, listening</span></span></span>
        <span class="sm__mag" aria-hidden="true"><small>M</small><strong data-outmag>0.0</strong></span>
      </header>
      <div class="sm__plot" data-plot role="button" tabindex="0" aria-label="Simulate a tremor">
        <svg viewBox="0 0 296 110" preserveAspectRatio="none" aria-hidden="true">
          <g class="sm__grid"><path d="M0 27.500H296M0 82.500H296M74 0V110M148 0V110M222 0V110"></path><path class="sm__zero" d="M0 55H296"></path></g>
          <polyline class="sm__glow" data-glow points="0,55 296,55"></polyline>
          <polyline class="sm__trace" data-trace points="0,55 296,55"></polyline>
          <path class="sm__pen" data-pen d="M296 55l-9-5v10Z"></path>
        </svg>
        <span class="sm__hint" data-hint>Tap the trace to shake it</span>
      </div>
      <footer class="sm__foot">
        <span class="sm__last"><small>Last event</small><span class="sm__event"><span data-outevent>M 2.1, micro, 6 km deep</span></span></span>
        <span class="sm__scale" aria-hidden="true"><i data-seg class="on"></i><i data-seg></i><i data-seg></i><i data-seg></i><i data-seg></i></span>
      </footer>
    </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.

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 “Live seismograph” 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 “Seismic monitor” with the station listening and, on the right, the magnitude, large, at zero. In the middle the seismograph’s paper, with a barely visible grid: a green line with a glow runs to the left and fades into the dark, while on the right a small white tip, the pen, goes up and down with the latest value. At rest the line barely trembles. Tap the paper and the label rolls to “Shaking now”, a small tight first wave arrives, half a second later the large one, which widens and then dies away slowly as it runs off; the magnitude climbs to its value and turns green, the strength marks light up one after the other with a small kick and, if the tremor is strong, the whole card jolts sideways and settles. When the ground calms down the label becomes “Settled, just now” and the last event rolls in below: magnitude, name and depth. Every tap brings a different tremor.

How it works

The moving paper

The trace is an SVG polyline of about 150 points. On every frame, in GSAP’s ticker, the paper moves on by SPEED pixels a second: every two pixels the oldest point leaves and a new one comes in on the right, and the points shift by the remainder, so the scrolling is continuous.

The tremor

Every value is a little noise plus the tremors still going on. A tremor is made of two waves: the first short and low, the second a slowing sine multiplied by an exponential that puts it out; amplitude and length depend on the magnitude.

The numbers around it

The magnitude is a number animated by GSAP and written with one decimal. The marks light up by the magnitude’s band; the card jolts on a very elastic spring, the more the taller the wave.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#5ee6a8The colour of the trace and of the magnitude during the tremor.
SPEEDscript.js60How many pixels a second the paper moves under the pen.
GAINscript.js1How tall the waves are: 0.5 low, 1.5 tall.

Try them in the Playground

When to use it

In the dashboard of a monitoring network, an alert app or an observatory; on a science outreach or museum site. The same running trace serves any live signal: a machine’s vibrations, noise, a heartbeat, a server’s load.

On phones

The card is at most 324 pixels wide and about 250 tall; the seismograph’s paper narrows with it, since the svg does not keep its proportions and the stroke stays thin. The whole paper is tappable, 124 pixels tall.

With reduced motion

The paper does not move and the card does not shake: the trace is still, and on every tap it is redrawn with the tremor already past, while magnitude, marks and last event change at once. The demo’s pointer does not start.

Pitfalls

  • The paper is a div with role button, tabindex and the Enter and Space keys: an svg alone cannot be reached from the keyboard. The magnitude also lands in an aria-live region.
  • The svg has preserveAspectRatio none to fill the paper: stroke and grid need vector-effect non-scaling-stroke, otherwise they stretch with the width.
  • At thirty points a second a wave above ten hertz would look jagged: the two waves’ frequencies stay below seven.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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