Skip to content
animorio
IT
Back to the library

Encrypting document

Scroll, TextGSAP, CSS onlyMediumCompressed weight: Demo 6.4 KBGSAP + ScrollTrigger 45 KBLenis 5.3 KBFreeDownload the zip

Scroll inside the preview

The security section of a made-up notes app, Vaultnote, in the clean style of product interface pieces: the stage stays still and, as you scroll, a band of light comes down the document and every line it touches turns, letter by letter, into cipher text. The status goes from Plain text to Encrypted, the padlock closes with a spring and the closing line comes in; scrolling back decrypts the document.

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>
<!--
  "Encrypting document" 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>Vaultnote, readable only to you</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/jetbrains-mono@5.3.0/index.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <!-- the security section of a made-up notes app, Vaultnote. A sticky stage with a document card: scrolling, a thin
       light comes down the page and every line it touches turns, letter by letter, from plain text into cipher text.
       The status in the header goes from Plain text to Encrypting to Encrypted, the padlock closes when the last line
       is done and the closing line comes in with its key. Scrolling back decrypts it -->
  <section class="corsa" data-corsa>
    <div class="palco" data-palco>
      <p class="occhiello">
        <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M8 1.6 13.4 3.7v4.1c0 3.2-2.3 5.6-5.4 6.6-3.1-1-5.4-3.4-5.4-6.6V3.7z"/></svg>
        Vaultnote security
      </p>
      <h2 class="titolo">Readable to you.<br><span class="titolo__spento">Noise to everyone else.</span></h2>

      <figure class="carta" data-carta>
        <div class="carta__testa">
          <span class="lucchetto" data-lucchetto aria-hidden="true">
            <svg viewBox="0 0 20 20">
              <path class="lucchetto__arco" data-arco d="M6.2 9V6.6a3.8 3.8 0 0 1 7.6 0V9"/>
              <rect class="lucchetto__corpo" x="4" y="9" width="12" height="8.4" rx="2.4"/>
              <circle class="lucchetto__foro" cx="10" cy="13.1" r="1.25"/>
            </svg>
          </span>
          <span class="carta__nome">Board memo, Q4.note</span>
          <span class="stato" data-stato aria-live="polite"><span class="stato__testo" data-stato-testo>Plain text</span></span>
        </div>
        <div class="foglio" data-foglio>
          <div class="righe" data-righe aria-hidden="true"></div>
          <div class="scansione" data-scansione aria-hidden="true"></div>
        </div>
        <p class="carta__piede" data-piede>
          <svg viewBox="0 0 16 16" aria-hidden="true"><circle cx="5.4" cy="8" r="3.1"/><path d="M8.5 8h6M12.3 8v2.4M14.1 8v1.7"/></svg>
          <span data-piede-testo>Key stays on this device</span>
        </p>
      </figure>
      <p class="chiusa" data-chiusa>Only your devices hold the key. <b>Not even us.</b></p>
    </div>
  </section>
  <footer class="piede">Names and figures are illustrative. Vaultnote is a made-up product.</footer>

  <script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/gsap.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/ScrollTrigger.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/lenis@1.3.26/dist/lenis.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.

23 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 “Encrypting document” 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 warm white background sits the security section of Vaultnote, a made-up notes app: at the top a white pill with a drawn shield and the words Vaultnote security, then the headline on two lines, Readable to you. in black and Noise to everyone else. in light grey, and below a white card with the document: in its header an open padlock, the note’s name, Board memo, Q4.note, and a grey status pill, Plain text; inside six lines of a memo (the bold title, then revenue, hiring, a new office, a pricing change, the do-not-forward line); at the bottom a row with a drawn key, Key stays on this device. The stage stays still as you scroll: a soft green band of light with a thin thread comes down the document, and the line it sits on turns from left to right: on the front four characters keep changing, green and monospaced, and behind them the cipher text stays, blue grey, always the same. Meanwhile the status becomes Encrypting, the old label leaving upwards before the new one comes in. When the last line is encrypted the band goes away, the status becomes Encrypted, AES-256 in green, the padlock’s shackle comes down and closes with a spring, the padlock gives a small hop and turns green, the card dips by a pixel and comes back, the second line of the headline takes the blue grey of the cipher text and the card’s footer says Locked with your key on 3 devices. Then the closing line comes in word by word: Only your devices hold the key. Not even us. Scrolling back, everything goes back: the lines decrypt from the last one and the padlock opens again.

How it works

One line, many characters

Each line of the document is built once as a row of spans, one per character. For each one the script keeps the plain letter and its cipher letter, picked by a seeded random generator, so the cipher text is the same at every visit.

The front

The scroll drives a value from 0 to 1. Each line gets its own value from it, moving a front from left to right: characters behind the front are encrypted, those ahead are plain, and the four on the front change letter eighteen times a second. The lines start one after another, overlapping, so the document encrypts like a wave.

Only what changes

Drawing runs on every frame of the GSAP ticker, because the front has to flicker even when the scroll stops, but it only touches characters whose state changed: with two hundred spans the page stays light.

The labels

The status and the card’s footer change through a small helper that sends the old label upwards and only then brings in the new one, with a spring: never two labels in the same place at once. The padlock closes when the last line is encrypted and opens again going back.

Values to change

NameFileDefaultWhat it changes
RIDEscript.js1How much scroll the whole page takes: 2 is twice as long.
SCRUBscript.js0.6How far the page lags behind the scroll, in seconds.
SCRAMBLEscript.js4How many characters flicker on the front of each line before they settle.
FLICKERscript.js18How many times a second the flickering characters change.
SCANscript.js1How visible the band of light coming down the page is (0 none).

Try them in the Playground

When to use it

For the security or privacy section of a landing page: a notes app, a document vault, a password manager, a chat app or a bank. Whoever scrolls sees the text become unreadable and understands what encrypted means, instead of reading AES-256 in a list.

On phones

The same animation with adapted sizes: headline, card and lines are sized on height too and all fit in the stage; the lines are short on purpose and the cipher text, in a smaller monospaced face, stays as wide as the plain one.

With reduced motion

No motion: the document is already fully encrypted, with the padlock closed, the Encrypted status and the closing line, and it appears with a fade.

Pitfalls

  • Drawing runs on every frame so the front flickers even when the scroll stops: that is why it only touches spans whose state changes, otherwise two hundred writes a frame weigh on a phone.
  • Monospaced cipher text is wider: at 84 per cent of the size it stays almost as wide as the plain text and the lines never leave the card.
  • The status labels never cross-fade: a small helper waits for the old one to leave before bringing in the new one, and if the status changed again in the meantime it jumps straight to the latest.

Libraries

GSAP 3.15.0, ScrollTrigger 3.15.0, Lenis 1.3.26, Mona Sans (font variabile) 5.3.0, JetBrains Mono (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 6.4 KB; the libraries: GSAP + ScrollTrigger 45 KB, Lenis 5.3 KB.

Testing

Tested on 29 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 animations