Skip to the content

Button 06

Cells of colour light the button from the side the pointer came in by, a ragged front of early cells ahead, the label turning to the ink colour exactly where the front has passed, and go dark toward the side the pointer left by.

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

    The look of the preview is the button-set-* classes of the paste: the button at rest, its row and the words around it. The Embed only places the moving layers and holds the two colours of the effect. On a button of your own, keep your class and add the attribute.
  3. Add custom JS

  4. Use it on your own elements

    Custom attribute
    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-button-motion="pixel" Cells of colour light the button from the side the pointer came in by, and go dark toward the side it left by.
    This file plays pixel. Another animation of the set needs that button's own code on the page: without it, the button stays as the page styled it and the browser console says so. An empty or unknown value plays fill when fill's code is on the page, pixel otherwise, and says so in the console.
    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-button-motion-color #ffab1a The colour of the cells. Options: any CSS colour.
    data-button-motion-ink auto The colour of the label once the cells are under it. auto, the default, picks #15100c or #f4ece0, whichever has the higher contrast on color, so a pale colour gets the dark label and a dark or saturated one the light label; the default ink #15100c gets #f4ece0. Options: auto, or any CSS colour, kept as it is, so one that reads on color.
    data-button-motion-duration 0.6 Length of the front crossing the button, in seconds; the cells go out over 1.4 times it.
    data-button-motion-press 0.96 The scale of the button while it is pressed.
    data-button-motion-grain 6 The size of one cell, in pixels, the one length of the component that is not fluid.

What it does

Button 06 (Pixel) is a button hover animation for Webflow and vanilla JavaScript, built on GSAP 3. Also called pixel button hover effect, pixel fill button or button hover pixel animation.

Cells of colour light the button from the side the pointer came in by, a ragged front of early cells ahead, the label turning to the ink colour exactly where the front has passed, and go dark toward the side the pointer left by. Played with GSAP on the button the page already has: the engine sets no font, size, border or background, only the two colours of the effect, and puts the label back exactly on destroy. Keyboard focus, touch and reduced motion are handled. Button 06 of the Button set: another button of the set pasted on the same page shares its base. Pattern type pixel dissolve button, 8-bit hover, cta hover.

Updated

Questions

Select the button, open the Settings panel and add the custom attribute data-button-motion="pixel" on the button or link itself. The button keeps its own class: the engine sets no font, size, border or background, only the two colours of the effect.

Yes, GSAP 3 with no plugin, loaded from a CDN. The tag that ships with it loads version 3.12.5. Without GSAP the button stays as the page styled it, nothing moves, and the console says so after ten seconds.

Set data-button-motion-grain on the button, the size of one cell in pixels. The default is 6. Lower gives fine cells that read as noise, higher gives coarse 8-bit blocks, and above about a third of the button height only a few blocks are left.

Set data-button-motion-color to any CSS colour for the cells. The label colour, ink, is auto by default: it picks #15100c or #f4ece0, whichever has the higher contrast on that colour. Set data-button-motion-ink to force a label colour of your own.

Yes. Keyboard focus plays the enter from the centre and the leave when focus goes, and a finger gets the animation for the length of the tap. Under prefers-reduced-motion: reduce the button jumps to its hover state and back with no travel, and the press is skipped.