Skip to content
animorio
IT
Back to the library

Brush-stroke transition

Transitions, SVGGSAP, CSS onlyMediumCompressed weight: Demo 9.8 KBGSAP 28 KBFreeDownload the zip

The gate of a made-up comic saga, Emberfell: two thin gold lines fill up with the percentage running along them, then a “Discover” button draws itself. On the click, diagonal dry-brush strokes cover the screen from left to right, the title shows white only where the ink is, and the strokes leave the same way, uncovering the page of the first book as it settles into place. Minimal style, warm paper, warm black and one gold.

Rebuilt from scratch studying thorgal.com by Caracal, REEPLE Studio: the idea is theirs; code, copy and images are ours. Read how it’s made

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>
<!--
  "Brush-stroke transition" 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 brush-stroke transition with the title inside the ink</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/fraunces@5.3.0/full.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mulish@5.3.0/index.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <!-- a made-up comic saga in five books, Emberfell, from a made-up publisher, Quire Press. A waiting screen fills two
       thin gold lines, then a Discover button draws itself; on the click, dry brush strokes sweep across the screen from
       left to right, the title shows white only inside the ink, and the strokes leave the same way, uncovering the page
       of the first book as it settles into place -->
  <main class="palco" data-palco>

    <!-- the waiting screen -->
    <section class="cancello" data-cancello aria-label="Emberfell">
      <div class="filo filo--su" aria-hidden="true">
        <span class="filo__linea" data-filo></span>
        <span class="filo__cifra" data-cifra>0</span>
      </div>
      <div class="filo filo--giu" aria-hidden="true">
        <span class="filo__linea" data-filo></span>
        <span class="filo__cifra" data-cifra>0</span>
      </div>

      <div class="marchio" data-marchio>
        <p class="marchio__sopra" data-sopra>Quire Press</p>
        <h1 class="marchio__nome" data-nome>Emberfell</h1>
        <p class="marchio__sotto" data-sotto>A saga in five books</p>
      </div>

      <button class="scopri" type="button" data-scopri data-autoclic>
        <svg class="scopri__orn scopri__orn--sx" viewBox="0 0 30 14" aria-hidden="true" data-orn>
          <path pathLength="1" d="M29 7H9M9 7l-4-4.2L1 7l4 4.2L9 7M15 4.2v5.6" />
        </svg>
        <span class="scopri__corpo" data-corpo>
          <span class="scopri__etichetta">Discover</span>
        </span>
        <svg class="scopri__orn scopri__orn--dx" viewBox="0 0 30 14" aria-hidden="true" data-orn>
          <path pathLength="1" d="M1 7h20M21 7l4-4.2L29 7l-4 4.2L21 7M15 4.2v5.6" />
        </svg>
      </button>
    </section>

    <!-- the page under the ink -->
    <section class="pagina" data-pagina aria-label="Book one" aria-hidden="true">
      <div class="pagina__dentro" data-dentro>
        <header class="pagina__testa">
          <span class="pagina__marchio">Emberfell</span>
          <span class="pagina__nota">Quire Press</span>
        </header>
        <div class="pagina__centro">
          <p class="libro" data-libro>Book one</p>
          <h2 class="titolo" data-titolo><span class="titolo__dentro" data-titolo-dentro>The Ash Road</span></h2>
          <span class="regola" data-regola aria-hidden="true"></span>
          <p class="riga" data-riga><span class="riga__dentro" data-riga-dentro>Where the last fire went out, a road begins.</span></p>
        </div>
        <footer class="pagina__piede">
          <span>Five books, one road</span>
          <span>Read the first</span>
        </footer>
      </div>
    </section>

    <!-- the ink: dry brush strokes drawn into a mask; the ink and the white title both live inside it -->
    <svg class="pennello" data-pennello aria-hidden="true">
      <defs>
        <filter id="secco" x="-10%" y="-10%" width="120%" height="120%">
          <feTurbulence type="fractalNoise" baseFrequency="0.035 0.09" numOctaves="3" seed="7" result="rumore" />
          <feDisplacementMap in="SourceGraphic" in2="rumore" scale="12" xChannelSelector="R" yChannelSelector="G" data-ruvido />
        </filter>
        <mask id="inchiostro" maskUnits="userSpaceOnUse" data-maschera>
          <rect class="pennello__vuoto" data-vuoto />
          <g filter="url(#secco)" data-tratti></g>
        </mask>
      </defs>
      <g mask="url(#inchiostro)">
        <rect class="pennello__nero" data-nero />
        <g data-logo-posto>
          <g class="pennello__logo" data-logo>
            <text class="pennello__sopra" data-logo-sopra>QUIRE PRESS</text>
            <text class="pennello__nome" data-logo-nome>EMBERFELL</text>
            <text class="pennello__sopra" data-logo-sotto>A SAGA IN FIVE BOOKS</text>
            <line class="pennello__regola" data-logo-regola />
          </g>
        </g>
      </g>
    </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.

36 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 “Brush-stroke transition” 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

It opens on warm paper with a very fine grain. In the middle the name of the saga, “EMBERFELL”, in a full serif in dark gold, with “Quire Press” above and “A saga in five books” below in spaced capitals: the name rises twenty pixels and appears, the letters of the line above drop in one after the other, those below rise, and a pale light runs once over the title. Meanwhile two thin gold lines, one from the top and one from the bottom, grow towards the title in jerks, like files arriving, and the percentage follows them at the tip, from 0 to 100, in at least two seconds. Then the lines draw back and the button draws itself: the left ornament, the black box with “Discover” opening from top to bottom, and the right ornament, one after the other. On hover the ornaments move four pixels apart and the label widens; on the click (or by itself after a while) the button presses down, comes back on a spring and closes upwards. Then eleven diagonal dry-brush strokes, each made of twelve hairs that start a little early or a little late, cross the screen from left to right with a few spatters ahead of the edge: in just over two seconds it is all black, and inside the ink is the title in white, visible only where the brush has already been; it tightens by a breath and draws a gold rule under itself. Then the strokes leave in the same direction, their tails lifting from the bottom, and underneath is the page of the first book: it rises a few points and settles, while “Book one” opens, “The Ash Road” rises out of its window and turns lighter, the gold rule grows from the middle and the sentence rises. After three seconds the page fades and the round starts again.

How it works

The percentage at the tip of the line

An object with p from 0 to 1 moves in jerks, six GSAP tweens with power2.out adding up to MIN_LOAD seconds: like the site, which fills its lines with scaleY(p) and a 300 ms ease-out transition. On every update both lines take scaleY(p), the top one with its origin at the top and the bottom one at the bottom, and the numbers move by p times the line’s height, so they always sit at the tip.

The button that draws itself

The ornaments are two SVG paths with pathLength 1 and dasharray 1 2: the stroke-dashoffset goes from 1 to 0 for the left one and from -1 to 0 for the right one, so both draw towards the label. The black box opens with clip-path from inset(0 0 100% 0) to inset(0), all in 0.4 s with power2.out, staggered by 0, 0.1 and 0.2 s, like the site’s button. On the way out it closes upwards with inset(100% 0 0 0).

The strokes as bundles of hairs

Each stroke is a bundle of twelve parallel paths inside an SVG mask, all with a slight curve and the same pathLength 1: the hairs draw with stroke-dashoffset from 1 to 0, each a little early or late and a little faster or slower, so the advancing edge is frayed. An feTurbulence with an feDisplacementMap on the strokes roughens the edges like a dry brush. The strokes start from left to right along a power1.inOut curve.

The title that lives only in the ink

The black rectangle and the white title sit under the same mask: where there is no brush neither shows, so the title exists only inside the ink, as on the site, where the shader shows it only where the brush video is dark. The title is measured with getBBox: 140 pixels tall, never more than 75 per cent of the width, measured again on resize.

Uncovering in the same direction

To uncover, the hairs’ stroke-dashoffset goes from 0 to -1: the tail of the stroke lets go from the start and climbs, and the strokes leave in the same order from left to right. In the same time, 1.73 s with power2.out, the page underneath starts a little lower and smaller and settles, like the site’s camera coming down from y +5 and z +2.

Values to change

NameFileDefaultWhat it changes
COVERscript.js2.12Seconds the brush takes to cover the screen.
UNVEILscript.js1.73Seconds the brush takes to uncover it.
STROKESscript.js11How many strokes cross the screen.
HAIRSscript.js12How many hairs each stroke has: the more, the more frayed the edge.
LEANscript.js0.5How much the strokes lean, as a share of the screen height.
ROUGHscript.js12Pixels of dry-brush roughness on the edges; 0 for clean strokes.
LOGO_HEIGHTscript.js140Height of the title inside the ink, in pixels.
LOGO_WIDTHscript.js0.75The largest share of the screen width the title may take.
MIN_LOADscript.js2Seconds the loading lasts at least.
DROPscript.js4How far below its place the page starts, in vh.
WAITscript.js2.4Seconds the button waits before it presses itself.
HOLDscript.js3Seconds on the page before the round starts again.

Try them in the Playground

When to use it

For the entrance or the page change of an editorial site with a hand-made gesture: a comic saga, a publisher, an illustration or calligraphy show, a book festival, a gallery, a restaurant with a brush-written menu. The brush covers, the name reads inside the ink, and it uncovers the new page.

On phones

The same strokes and the same timings: the strokes are measured on the screen’s width and height and rebuilt on resize, the title in the ink stays at most 140 pixels and 75 per cent of the width, and in the phone’s short preview the loading lines, the title and the button are also sized in vh, so everything fits.

With reduced motion

No strokes and no movement, as the site does, skipping the cover and the uncover with this setting: the title fades in, the lines are already full and fade away, the button appears already drawn, and on the click the gate fades into the page, already in place.

Pitfalls

  • A stroke with pathLength 1 and dasharray 1 1 uncovers badly with a negative dashoffset: with dasharray 1 2 the gap is twice as long, and from 0 to -1 the tail lets go cleanly without the start of the next dash showing up.
  • The white title goes under the same mask as the black: on top without the mask it would show on the paper too, where the brush has not been yet.
  • The title in the ink is measured with getBBox only once the font has loaded (document.fonts.ready): measured earlier it takes the width of the fallback font.
  • The dry-brush filter moves the edges by ROUGH pixels: the strokes must run past the screen by at least that much, or a sliver of paper is left in a corner.

Libraries

GSAP 3.15.0, Fraunces (font variabile) 5.3.0, Mulish (font variabile) 5.3.0.

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

Testing

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