Skip to the content

Glyph reveal

A picture that arrives as type. When it comes into view it is first set in a grid of mono glyphs whose weight follows the brightness of the picture: the dark parts in heavy glyphs, the light parts in light ones or in none.

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

    Nothing hides the picture before the script runs: without JavaScript it is simply there. The glyphs are set in the family named by --glyph-reveal-font, Geist Mono here; give the property another mono family the page loads to change it.
  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-glyph-reveal Marks a picture that arrives as glyphs. It takes no value: leave the value field empty. It goes on the Image itself; on a box instead, the script takes the first image inside it. The script lays a canvas over the picture, and the image stays in the page.
    data-glyph-reveal-state Written by the engine on the picture: waiting while it is covered and out of view, glyphs while the glyph picture prints or stands, sweeping while the front crosses, done at rest, static under reduced motion. Never written by hand. [ Optional ]
    data-glyph-reveal-layer Written by the engine on the canvas it lays over the picture, which the stylesheet finds by this attribute. 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-glyph-reveal-color #15100c Colour of the glyphs, and of the inverted band at the front. Options: any plain CSS colour. Lighter than background, the picture is set the other way round, light parts in heavy glyphs, so it never reads as a negative.
    data-glyph-reveal-background #f4ece0 Ground of the glyph stage, what covers the picture until a cell turns. Options: any plain CSS colour, usually the colour of the page behind the picture, so the glyphs seem printed on the page itself.
    data-glyph-reveal-glyphs .:-=+*#%@ The characters the picture is set in, in any order: the script draws each one and sorts them by the ink they lay down. The space is always there, as the cell with no ink. Options: any string of characters, for instance 01, /-+ or .oO0. Few glyphs give a hard, posterised picture; many give finer shades.
    data-glyph-reveal-cell 12 Side of one glyph cell, kept in px so the grain is the same on every screen.
    data-glyph-reveal-hold 0.9 Time from the first glyph to the moment the front leaves, in seconds; the glyphs take 0.45 s of it to print themselves in.
    data-glyph-reveal-duration 1.4 Time the front takes to cross the picture, in seconds, eased at both ends.
    data-glyph-reveal-shuffle 0.5 How restless the standing glyphs are, 0 to 1: how often a glyph steps one notch up or down its ramp and back.
    data-glyph-reveal-direction right Way the front travels. Options: right, left, down, up, or center, which opens from the middle outwards.
    data-glyph-reveal-trigger scroll What plays the reveal. Options: scroll plays it once as the picture comes into view. hover leaves the picture as glyphs, crosses it while the pointer is on it and goes back when it leaves; on a touch screen it plays as scroll.
    data-glyph-reveal-replay 0 Whether the reveal plays again each time the picture comes back into view, 0 or 1. Read on scroll only.

What it does

Glyph reveal is a scroll animation for Webflow and vanilla JavaScript, with no library. Also called ASCII image reveal, ASCII image effect or ASCII art image hover effect.

A picture that arrives as type. When it comes into view it is first set in a grid of mono glyphs whose weight follows the brightness of the picture: the dark parts in heavy glyphs, the light parts in light ones or in none. The glyphs print themselves in, stand and stir for a moment, then a front crosses the picture on an eased curve, a ragged band of inverted cells at its edge, and every cell it passes turns into the real picture. The glyph sibling of the pixel reveal: where that one writes text in block by block, this one proofs a picture in characters before showing it. The picture itself is never copied: one canvas is laid over the <img>, and a cell that has turned is a hole in it, so the image stays in the page, for search engines and for assistive technology, the whole time. The set of glyphs can be written in any order and in any typeface, the script weighs each one itself. By a setting, the pointer plays it instead of the scroll: the picture then rests as glyphs, the front crosses it while the pointer is on it and goes back when it leaves. Under reduced motion the picture is simply there. Pattern type ASCII image reveal, character mosaic.

Updated

Questions

Select the Image, open the Settings panel and add the custom attribute data-glyph-reveal with an empty value. Settings are more attributes on that same picture, for instance data-glyph-reveal-direction="down". The glyphs are set in the typeface named by the custom property --glyph-reveal-font, Geist Mono in the stylesheet.

No. It is one 2D canvas laid over the <img>, with no library and no build step. The picture is never copied onto that canvas: a cell that has turned is a hole through which the real image shows, so alt, srcset and the link around the picture keep working.

Yes, write data-glyph-reveal-trigger="hover". The picture then rests as glyphs, the front crosses it while the pointer is on it and goes back when it leaves. On a touch screen it plays as scroll, the default, so a picture is never left as glyphs with nothing to turn it.

data-glyph-reveal-glyphs takes any string of characters in any order, .:-=+*#%@ by default, and the script sorts them by the ink they lay down. data-glyph-reveal-cell is the side of one glyph cell in px, 12 by default: lower gives a finer picture with more cells to draw, higher gives chunky characters that only read from afar.

The picture is served from another origin without CORS headers, so the browser refuses to let its pixels be read. The engine then sets a random field of glyphs, and the front still turns it into the picture. Serve the picture from the page's own origin or add Access-Control-Allow-Origin on the host; the Webflow CDN sends that header.