Skip to content
animorio
IT
Back to the library

Markdown note

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

Scroll inside the preview

The editor section of a made-up writing app, Plainleaf, in the clean style of the interface pieces: the stage stays still and, as you scroll, a selection band comes down the note line by line. The markdown marks of each line light up in the accent colour and fold away, and the line takes its real style: the title grows and gets heavier, the bold and the italic settle, the quote mark becomes a thin rule, the task boxes are drawn and ticked, the link takes its colour and its line. The switch at the top slides from Markdown to Preview. Scrolling back brings the plain text back.

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>
<!--
  "Markdown note" 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>Plainleaf, write in plain text</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 editor section of a made-up writing app, Plainleaf. A sticky stage with a note written in markdown: scrolling,
       a soft selection band comes down the note, the markdown marks of each line light up and fold away, and the line
       takes its real style: the title grows, bold and italic settle, the quote mark becomes a rule, the task boxes are
       drawn, the link takes its colour. The switch in the header slides from Markdown to Preview. Scrolling back
       brings the plain text back -->
  <section class="corsa" data-corsa>
    <div class="palco">
      <p class="occhiello">
        <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M3 13l1-3.4 6.6-6.6a1.4 1.4 0 0 1 2 2L6 11.6z"/><path d="M9.6 4l2 2"/></svg>
        Plainleaf editor
      </p>
      <h2 class="titolo">Write in plain text.<br><span class="titolo__spento" data-spento>Read it as a page.</span></h2>

      <figure class="carta">
        <div class="carta__testa">
          <svg class="carta__icona" viewBox="0 0 16 16" aria-hidden="true"><path d="M4 1.8h5.2L12.6 5.2v8.4a.8.8 0 0 1-.8.8H4a.8.8 0 0 1-.8-.8V2.6a.8.8 0 0 1 .8-.8z"/><path d="M9 2v3.4h3.4"/></svg>
          <span class="carta__nome">launch-notes.md</span>
          <span class="segmenti" data-segmenti aria-hidden="true">
            <span class="segmenti__pomo" data-pomo></span>
            <span class="segmenti__voce" data-voce="0">Markdown</span>
            <span class="segmenti__voce" data-voce="1">Preview</span>
          </span>
        </div>

        <div class="foglio">
          <div class="banda" data-banda aria-hidden="true"></div>
          <div class="cursore" data-cursore aria-hidden="true"></div>
          <ol class="righe">
            <li class="riga riga--h1" data-riga><span class="n">1</span><span class="t"><span class="m">#&nbsp;</span><span class="h1" data-h1>Launch notes</span></span></li>
            <li class="riga" data-riga><span class="n">2</span><span class="t">Ship <span class="m">**</span><b class="g" data-g>v2.4</b><span class="m">**</span> on <span class="m">_</span><span class="c" data-c>Friday</span><span class="m">_</span>.</span></li>
            <li class="riga riga--q" data-riga><span class="n">3</span><span class="t"><span class="barra" data-barra aria-hidden="true"></span><span class="m">&gt;&nbsp;</span><span class="cit" data-cit>Keep the changelog short.</span></span></li>
            <li class="riga" data-riga><span class="n">4</span><span class="t"><span class="m">-&nbsp;[x]&nbsp;</span><span class="box box--si" data-box><svg viewBox="0 0 14 14" aria-hidden="true"><rect x="1" y="1" width="12" height="12" rx="3.4"/><path class="spunta" data-spunta d="M4.1 7.3l2 2 3.9-4.4"/></svg></span><span class="fatto" data-fatto>Release notes</span></span></li>
            <li class="riga" data-riga><span class="n">5</span><span class="t"><span class="m">-&nbsp;[&nbsp;]&nbsp;</span><span class="box" data-box><svg viewBox="0 0 14 14" aria-hidden="true"><rect x="1" y="1" width="12" height="12" rx="3.4"/></svg></span>Pricing page</span></li>
            <li class="riga" data-riga><span class="n">6</span><span class="t">Read the <span class="m">[</span><span class="lk" data-lk>full spec</span><span class="m">](plainleaf.app/spec)</span>.</span></li>
          </ol>
        </div>

        <p class="carta__piede">
          <span class="stato" data-stato><svg class="stato__spunta" viewBox="0 0 12 12" aria-hidden="true"><path data-stato-spunta d="M2.6 6.3l2.1 2.1 4.6-4.9"/></svg><span data-stato-testo>Markdown</span></span>
          <span class="parole">18 words · saved</span>
        </p>
      </figure>
      <p class="chiusa" data-chiusa>Same file. <b>Two ways to read it.</b></p>
    </div>
  </section>
  <footer class="piede">Plainleaf 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.

55 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 “Markdown note” 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 ground sits the editor section of Plainleaf, a made-up writing app: at the top a white pill with a drawn pen and the words Plainleaf editor, then the two-line title, Write in plain text. in black and Read it as a page. in light grey, and below the card of the note launch-notes.md, with line numbers and a two-way switch, Markdown and Preview. The six lines are written in markdown: the marks (hash, asterisks, underscores, greater-than, dashes with square brackets, link brackets) are in a grey monospaced type. As you scroll, a pale selection band with a left edge comes down from one line to the next; on the line the marks turn the accent colour and fold away one after the other until they are gone, and the line takes its style: the title grows and gets heavy, v2.4 turns bold and Friday leans, the greater-than becomes a thin blue rule and the sentence shifts and greys, the two boxes open with a small bounce and the first gets ticked, the link turns blue and its line stretches out underneath. Each finished line lifts by a pixel and settles, and its number gets lighter. At the end the switch knob slides onto Preview on a spring, the status at the bottom ticks and says Preview · formatted, the second line of the title turns blue and the closing line comes in word by word. Scrolling back, the note turns back into plain text.

How it works

One timeline, tied to the scroll

The whole section is a paused GSAP timeline, with one stretch per line, and ScrollTrigger plays it back and forth with scrub while the stage stays still with position: sticky. Scrolling back, the timeline rewinds by itself and the note turns back into plain text.

The marks that fold away

Every markdown mark is its own element, inline-block with hidden overflow: GSAP takes its width from the real measure down to zero, and the text beside it closes up by itself. The starting measure is a function, so with invalidateOnRefresh it is taken again when the window changes.

The real style, with a variable font

The bold does not change typeface: the weight of the variable Mona Sans goes from 400 to 720. The title grows with a scale from its left edge, the italic is a ten-degree lean, the quote is a rule growing from the top and the link line is a gradient widening under the word.

The band and the settle

The selection band reads the position and height of the line through functions, and slides from one line to the next. When a line is done it lifts by a pixel and comes back down, and its number gets lighter: a small sign that the line is finished.

Values to change

NameFileDefaultWhat it changes
RIDEscript.js1How much scroll the whole note takes: 2 is twice as long.
SCRUBscript.js0.6How far the note lags behind the scroll, in seconds.
TITLE_SCALEscript.js1.42How much bigger the title gets once it is formatted.
BOLDscript.js720The weight the bold word reaches.
SLANTscript.js10How many degrees the italic word leans.
SETTLEscript.js1How many pixels each line lifts before it settles.
BANDscript.js1How visible the selection band coming down the note is (0 none).

Try them in the Playground

When to use it

For the editor section of a landing page: a notes, writing or documentation app, a site generator, a CMS. Whoever scrolls sees in a few seconds what writing in markdown and reading a page means, instead of reading it in a list of features.

On phones

The same animation with adapted measures: title, card and lines are sized on the height too and all fit in the stage; the lines are short on purpose, so even with the markdown marks they never spill sideways.

With reduced motion

No motion: the note is already formatted, with the switch on Preview, the status ticked and the closing line, and it appears with a fade.

Pitfalls

  • GSAP does not read CSS variables inside colours it animates: the :root colours are read once with getComputedStyle and passed already resolved.
  • The widths of the marks are in pixels: with a function as the starting value and invalidateOnRefresh they are measured again when the window changes, even halfway through the scroll.
  • The title grows with a scale and not with the font size: that way the line keeps its height and the card does not jump.
  • Never once: true on the timeline with ScrollTrigger: opening the page already scrolled down would freeze the other ScrollTriggers.

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.7 KB; the libraries: GSAP + ScrollTrigger 45 KB, Lenis 5.3 KB.

Testing

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