Skip to the content

Ink reveal

A paragraph that is read as it is inked. The text waits pale, at a fifth of its strength, and takes its full colour word by word as the page brings it up the window, from the first word to the last, and gives it back when the page goes down again.

Become a member to unlock the full effect today.

Join now

Already a member? Sign in

Documentation

  1. Copy to Webflow

    Add Instrument Sans and Geist Mono to your site's fonts (Site settings, Fonts, Google Fonts) before pasting: Webflow removes any font your site has not installed.

  2. Add custom CSS

    The stylesheet dims a text by itself only while the script loads, at the strength of the bare text, so it never shows fully inked first: without the script, under reduced motion and in the Designer, the text is all inked. The colour of the text belongs to the page: the ink is the colour of each word, and the pale state is a share of it, the setting rest, so the effect works on any ground. One variable is yours to set, on the marked text or on anything above it: --ink-reveal-fresh, the colour of the ink that has just been laid. A block near the end of the page needs no room under it: its run ends when the page stops scrolling.
  3. Add custom JS

  4. Use it on your own elements

    Custom attributes
    Select the element on the canvas and open the Settings panel. Under Custom attributes, add a pair: the name on the left, the value on the right.
    Custom attributeWhat it does
    data-ink-reveal Marks the block whose words take ink. It takes no value: leave the value field empty. It goes on the element that carries the words: a Paragraph, a Heading, or a Rich Text element, static or bound to a CMS field, whose paragraphs then fill one after the other as a single run. Links, italics and spans inside it stay as they are. The settings below go on the same element.
    data-ink-reveal-skip On an inline element inside a marked text: its words are left out and stay as written. [ Optional ]
    data-ink-reveal-state Written by the engine on the block: idle before the first word, running, full, or reduced when the text is left as written under reduced motion. Never written by hand. [ Optional ]
    data-ink-reveal-engine Written by the engine on the root element (html) once its first pass over the page has run. Until then the stylesheet paints the marked words at the strength of the bare text, so they never show fully inked and then drop back while the engine loads. Never written by hand. [ Optional ]
    Settings
    Every setting is a custom attribute too, added the same way and on the same element. An attribute always wins over the defaults written in the code.
    AttributeDefaultWhat it is
    data-ink-reveal-rest 0.2 How much ink a word holds before its turn, as a share of its own colour, from 0 to 1.
    data-ink-reveal-softness 0.01 The width of the edge of the ink, as a share of the run: how much of the text is between bare and inked at once. The edge is never narrower than a letter and a half.
    data-ink-reveal-from 0.85 Where the run starts, as a share of the window height measured from the top: 1 is the bottom edge. It is the top of the text that is measured.
    data-ink-reveal-to 0.45 Where the run ends, as a share of the window height: the run is over when the foot of the text reaches that line.
    data-ink-reveal-rewind true Whether the ink drains again when the page is scrolled back up. Options: true, the ink follows the scroll both ways; false, the ink stays where it got to.
    data-ink-reveal-dry 0.6 The time the fresh ink takes to dry once the page stops, in seconds. It is also how long the streak is at a slow scroll.
    data-ink-reveal-pause 1 How long the ink rests on punctuation, from 0 to 3: at 1, the scroll of about nine letters after a full stop and three after a comma.

What it does

Ink reveal is a text animation for Webflow and vanilla JavaScript, with no library. Also called text fill on scroll, word by word text reveal on scroll or scroll text color change.

A paragraph that is read as it is inked. The text waits pale, at a fifth of its strength, and takes its full colour word by word as the page brings it up the window, from the first word to the last, and gives it back when the page goes down again. The ink does not switch on: it runs through the letters as one soft edge, and what has just been inked is fresh, in the accent colour, a streak most of a line long that follows the reading and fades into the colour of the text behind it. Stop the page and it dries in half a second; move again and it is wet again. The ink rests a moment after a full stop and a shorter one after a comma, so the text is inked at the pace it is read. A word inks in its own colour: a span in the accent keeps the accent, like ink that never dried. One attribute on a paragraph, a heading or a block of several paragraphs is all it takes; links, italics and spans inside stay the elements they were, the lines break where they broke, and several texts on a page each follow their own place. The text stays real text, selectable and read whole by a screen reader. A jump of the page, an anchor or a drag of the scrollbar, puts a text that was out of sight where it belongs at once and never plays what it went over. Without JavaScript and under reduced motion the text is simply there, all inked. No library: this version replaces the one that ran on GSAP and ScrollTrigger, and the same attribute and settings keep working. Pattern type scroll fill text, ink fill, text fill on scroll, reading highlight, word by word fill.

Updated

Questions

Add the custom attribute data-ink-reveal, with an empty value, to the Paragraph, the Heading or the Rich Text element that carries the words, under Custom attributes in the Settings panel. One mark on a Rich Text of three paragraphs gives one run across the three, and it works the same when the Rich Text is bound to a CMS field: the words of the item are wrapped on the published page.

No. It needs no library: the engine wraps each word itself and paints it with a gradient clipped to its letters, and one scroll listener serves every marked text of the page. The earlier version ran on GSAP and ScrollTrigger; a page that still loads them is not affected.

data-ink-reveal-rest is the ink a waiting word holds, 0.2 by default: lower and the waiting words nearly vanish, higher and they are almost as strong as the inked ones. The streak of fresh ink takes the colour of --ink-reveal-fresh, and data-ink-reveal-dry, 0.6 seconds by default, is how long it takes to dry once the page stops; 0 removes it.

It starts when the top of the block reaches from, 0.85 of the window height measured from the top, and is over when the foot of the block reaches to, 0.45. Scrolling back up drains the ink again unless you set data-ink-reveal-rewind="false". A block at the very bottom of the page is all inked when the page reaches its end.

Yes. Each word is wrapped in a bare inline span and the spaces stay real text nodes, so the text is selectable, found by the browser's search and read as a sentence. Without JavaScript the text is fully inked, and under prefers-reduced-motion: reduce the words are not wrapped at all.