Skip to the content

Pixel wake

A wake of squares behind the cursor. The section is a fixed grid of squares with no gap between them, and the pointer turns over every square within its reach: a turned square takes a pale tint of the ink, and the moment it turns, open or shut, it carries a short flash of colour, which is what gives the trail its front.

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. Tune it

    Custom attributes
    Select the section 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-wake Marks the section the wake runs over. It takes no value: leave the value field empty. The canvas is laid over that section and sized from it, so the section needs a height of its own. Without it on any element of the page, the embed marks the section it was pasted into.
    data-pixel-wake-state Written by the engine on the section: live while squares are on screen, idle at rest, still under reduced motion. Never written by hand. [ Optional ]
    Settings
    Every setting is a custom attribute too, added the same way and on the same section. An attribute always wins over the defaults written in the code.
    AttributeDefaultWhat it is
    data-pixel-wake-color #ffab1a Colour of the squares, their tint and their flash, the amber #ffab1a by default. Options: any plain CSS colour; taken out of this block, --pixel-wake-color on the section takes over.
    data-pixel-wake-opacity 1 Opacity of the whole trail, 0 to 1, applied over tint and flash.
    data-pixel-wake-cell 15 Side of one square, kept in px so the grain is the same on every screen.
    data-pixel-wake-size clamp(34px, 3.2vw, 54px) Radius of the brush, any CSS unit, before the grain breaks its rim.
    data-pixel-wake-life 0.5 How long a square stays open once the brush has left it, in seconds, each square stretching or shortening it by its own spread.
    data-pixel-wake-tint 0.09 Share of colour in an open square, 0 to 1.
    data-pixel-wake-flash 0.5 Share of colour in the flash a square carries as it turns, open or shut, 0 to 1.
    data-pixel-wake-burst 2.2 Reach of the ripple a tap leaves on touch, in times size.

What it does

Pixel wake is a cursor animation for Webflow and vanilla JavaScript, with no library. Also called pixel grid hover effect, grid trail cursor effect or interactive pixel grid background.

A wake of squares behind the cursor. The section is a fixed grid of squares with no gap between them, and the pointer turns over every square within its reach: a turned square takes a pale tint of the ink, and the moment it turns, open or shut, it carries a short flash of colour, which is what gives the trail its front. Each square then closes on its own clock, its time stretched or shortened by a spread fixed per square and pushed back while the brush is still over it, so the patch behind the pointer comes apart square by square instead of fading in one block. The rim of the brush is broken by a grain fixed per square, and the brush is stamped along the whole segment, so a flick never leaves a dotted line. Nothing but squares, no picture to load: one canvas over the section, no library. On touch, a finger drag traces the same wake while the page still scrolls, and a tap opens a ripple of squares that closes the same way. The squares of the pixel swap, turned into a trail.

Updated

Questions

Yes. Once pasted, the effect runs on any section that carries the custom attribute data-pixel-wake, and it reads no class and no child, so everything inside the section is yours. Each setting is one more attribute on that section, for instance data-pixel-wake-life="0.8".

None. It is one canvas over the section with no library and no picture to load: a fixed grid of squares, each one closing on its own timer.

Raise data-pixel-wake-life, the time in seconds a square stays open once the brush has left it. The default is 0.5. Lower, the wake closes right behind the pointer, and higher, it lingers across the page.

In front. The canvas sits at z-index: 3 inside the section and never takes a click. Content that must stay above the squares takes position: relative and a z-index over 3.

Give it a light color and usually a stronger tint, the share of colour in an open square, which is 0.09 by default. Write the colour as a hex or an rgb(): it goes to a canvas, which cannot parse color-mix() and paints black instead.