Skip to the content

Pixel sweep reveal

Headings and paragraphs write themselves in, one block of pixels at a time, as they reach the viewport.

Become a member to unlock the full effect today.

Join now

Already a member? Sign in

Documentation

  1. Copy to Webflow

    Add Geist 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

  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-pixel-reveal="right" the front travels from left to right, and this is what an empty value does
    data-pixel-reveal="left" it travels the other way
    data-pixel-reveal="down" it travels from the top down
    data-pixel-reveal="up" it travels from the bottom up
    data-pixel-reveal="read" it follows the lines the way they are read, one after the other
    data-pixel-reveal-group On a box, sweeps every heading, paragraph, list item, quote and text block inside it, which is one attribute instead of one per element. Its value is the direction of the whole group, and an element marked on its own keeps its own settings. [ Optional ]
    The value is optional: left empty, the block sweeps right. The direction is a setting of the table below as well, and the value written here wins over it.
    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-accent auto Tint of the leading edge of the sweep. Options: any CSS colour, or auto to take --pixel-reveal-accent, then the page's --accent.
    data-cell auto Side of one square block the text is written in, in px, or auto to take it from the font size.
    data-cell-ratio 0.4 How big an auto block is next to the text it covers, as a share of the font size.
    data-cell-min 8 The finest grain small text is allowed, floor of an auto block in px.
    data-cell-max 26 The coarsest grain a display heading is allowed, ceiling of an auto block in px.
    data-sweep 0.62 How much the order of the blocks follows the direction rather than chance, 0 to 1.
    data-duration 0.9 How long one block of text takes to write itself in full, in seconds.
    data-front 0.14 How long a cell stays lit by the accent before cooling to the text colour, in seconds.
    data-front-intensity 1 Strength of that coloured light, 0 to 1.
    data-flat 1 How solid the lit squares are, 0 to 1.
    data-stagger 0.11 Delay between two blocks that came into view together, in seconds.
    data-trigger 0.86 How far into the screen a block has to come before it starts, as a fraction of the viewport height.
    data-direction right Which way the front travels across a block. Options: right, left, down, up, or read, which follows the lines as they are read.

What it does

Pixel sweep reveal is a text animation for Webflow and vanilla JavaScript, with no library. Also called pixel text reveal animation, pixel reveal effect or pixelated text reveal on scroll.

Headings and paragraphs write themselves in, one block of pixels at a time, as they reach the viewport. The sweep runs across the block in a chosen direction, mixed with enough randomness that it never looks like a wipe, and its leading edge burns in the accent tint before cooling down to the text colour. It works on anything that holds text: a display heading, a lede, a paragraph, a mono label, a big number. The text is never replaced by an image: the block paints its own glyphs through a canvas the size of its cell grid, one canvas pixel per cell, clipped to the letters by background-clip: text. So the words stay real words, they reflow, they can be selected and searched, a screen reader reads them, and once the sweep is over the element goes back to being drawn natively by the browser. Blocks that arrive together fire one after the other rather than all at once. Pattern type scroll text reveal, digital decoding flavour.

Updated

Questions

After pasting, select a heading or a paragraph and add the custom attribute data-pixel-reveal in the Settings panel. To cover a whole section in one action, put data-pixel-reveal-group on it instead: it picks up every heading, paragraph, list item, quote and text block inside.

No. The engine has no dependency. It watches the blocks with an IntersectionObserver and paints the glyphs through a canvas clipped to the letters by background-clip: text.

The direction is the value of the marking attribute, for instance data-pixel-reveal="down". The options are right (the default), left, down, up and read, which follows the lines as they are read. The speed is data-duration, 0.9 seconds by default, and a lower value makes the text snap in.

Yes. The text is never replaced by an image: the words stay real words that reflow, can be selected and searched, and are read by a screen reader the whole time. Once the sweep is over, the element goes back to being drawn natively by the browser.

The revealed block has a background of its own, and background-clip: text clips that background to the glyphs too. Move the background to a parent element.