Skip to content
animorio
IT
All components

Guestbook

Lists, HoverGSAP, CSS onlyEasyCompressed weight: Demo 5.7 KBGSAP 28 KBFreeDownload the zip

The guestbook of a personal site: a field to leave a couple of lines and the “Sign” button. On signing, the new note opens at the top of the list on a spring and pushes the others down, the oldest leaves at the bottom, the count of notes rolls and the button goes from the pen to a tick. The field counts the characters left and, if it is empty, shakes instead of signing.

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>
<!--
  "Guestbook" 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>Guestbook</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 guestbook of a personal site: a visitor leaves a couple of lines, the new note enters at the top
         pushing the others down and the count of the notes rolls -->
    <section class="gb" data-gb aria-labelledby="gb-title">
      <header class="gb__head">
        <h1 id="gb-title">Guestbook</h1>
        <p class="gb__count" aria-live="polite"><span data-count>128 notes</span></p>
      </header>

      <form class="gb__form" data-form novalidate>
        <label class="gb__field" data-field>
          <span class="gb__sr">Your note</span>
          <input type="text" data-input maxlength="80" placeholder="Say hello, leave a line" autocomplete="off" enterkeyhint="send">
          <i class="gb__left" data-left aria-hidden="true">80</i>
        </label>
        <button class="gb__sign" type="submit" data-sign>
          <svg viewBox="0 0 16 16" aria-hidden="true"><path class="pen" d="M3 13l1-3.500 6.800-6.800 2.500 2.500L6.500 12Z"></path><path class="ck" pathLength="1" d="m3.500 8.300 3 3 6-6.600"></path></svg>
          <span class="gb__signtext"><span data-signlabel>Sign</span></span>
        </button>
      </form>

      <ul class="gb__list" data-list>
        <li class="gb__note"><i class="gb__face" style="--h: 262">M</i><span class="gb__body"><b>Mira <em>2 h ago</em></b><span>Came for the fonts, stayed for the footer.</span></span></li>
        <li class="gb__note"><i class="gb__face" style="--h: 24">T</i><span class="gb__body"><b>Tomas <em>yesterday</em></b><span>That hover on the menu made my day.</span></span></li>
        <li class="gb__note"><i class="gb__face" style="--h: 152">A</i><span class="gb__body"><b>Aiko <em>3 days ago</em></b><span>Hello from Osaka. Lovely corner of the web.</span></span></li>
      </ul>
    </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.

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 “Guestbook” 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, a card: “Guestbook” and on the right “128 notes”. Below, a pale grey field with the hint “Say hello, leave a line” and a black button with a pen, “Sign”. Then three notes: a coloured tile with the initial, the name, how long ago and a line of text; the last one fades towards the bottom. While typing, the field takes a black edge and the characters left appear on the right, turning orange under ten. On signing, room opens at the top of the list on a spring and the new note arrives, “You, just now”, with the black tile: tile and text come down one after the other, the other notes shift down and the bottom one leaves. The count rolls to “129 notes”, the field empties, the button turns orange, the pen withdraws and a tick draws next to “Signed”; after a moment “Sign” is back. With the field empty, the edge turns orange and the field shakes.

How it works

A note made of text

The new note is built with elements and text nodes, never with the HTML of what was typed: whatever is written stays text.

Entering at the top

The note is put first in the list and its height goes from zero to its size on a spring: the others move down by themselves, with nothing to measure.

The list has three places

The list is three rows tall with a fade at the bottom: the fourth note is out of sight, and beyond the fourth the old notes are removed.

The field

On every letter the characters left and the field’s state are updated; the form is a real form, so Enter signs.

The pen and the tick

In the same svg: a class on the card makes the pen withdraw and draws the tick, a path with pathLength 1; after 1.8 seconds the class goes away.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#e2522bThe colour of the successful signature and of the field’s warnings.
NOTESscript.js128How many notes are already in the book.
DROPscript.js0.75How long the new note takes to enter at the top of the list.
TYPEscript.js22How many letters per second the demo types when it runs by itself.
SPRINGscript.js1How much the entering note bounces: 0.3 = a little, 2 = a lot.
LOOPscript.jstrueLeft alone, the demo’s pointer writes two notes and signs them.

Try them in the Playground

When to use it

On a blog or a personal site, in the portfolio of someone who draws or writes, on a wedding page or a small venue’s: where visitors can leave a hello that stays in view.

On phones

The same card, as wide as the screen minus the margins: field and button stay on the same row, 44 pixels tall; long note texts are cut with an ellipsis and the phone keyboard shows “Send”.

With reduced motion

No springs and no rolling words: the new note fades in at the top, the count changes in one step, the tick appears and the empty field only takes the orange edge, without shaking. The demo does not move by itself.

Pitfalls

  • Names and notes are made up and nothing is saved: on a real site the note goes to a service that keeps it, and it is worth passing it through a check before showing it to everyone.
  • Never innerHTML with what a visitor types: the note is built with textContent.
  • The book does not ask for a name: the note is signed “You”; if a name is needed, it is a second field.
  • The empty field is not told by colour alone: the field shakes and takes the cursor back.
  • The tile with the initial is a rounded square, with the letter inside: not a status light.
  • In the demo, after two signatures, the book goes back to how it was: only so it can be watched again.

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