TransitionsPremium

Pixelate Dissolve

A grid of 8 × 4 blocks appears in a random order, covers the old page, the new one settles underneath, then the blocks leave one by one: the 8-bit console "tiles" transition, 1.55 s, a different order on every pass — CSS grid + 2 KB of JavaScript.

CSSGridRetro

Updated

This effect is part of Effect.Labs — 846 vanilla effects, some free, some premium. Transitions has 52 effects, including 9 free. Explore the category →

3 usage examples

Next level — a retro browser platformer — Pixelate Dissolve example 1

① Next level — a retro browser platformer

WhenThe "Level 1-3 clear" screen gives way to the map of world 2.
WhyTiles appearing out of order are the 8-bit console transition; they immerse the player in the game's era.
Settings512 × 264 px screen framed by a 4 px white line, monospace font; original black blocks; map drawn in flat CSS shapes; square "Continue" button, no rounding.
Blurring faces before publication — a local newspaper's photo tool — Pixelate Dissolve example 2

② Blurring faces before publication — a local newspaper's photo tool

WhenThe copy editor applies anonymization: the raw photo of people leaving a hearing gives way to the same photo, faces masked.
WhyBreaking into blocks announces what is happening — pixelation — and reminds that the published image is no longer the original.
Settings340 × 238 px photo, newsroom rule on the right; newsroom-gray blocks (#495057); page B faces covered with a mosaic of 12 px squares.
Cadastral map to aerial view — a town's map portal — Pixelate Dissolve example 3

③ Cadastral map to aerial view — a town's map portal

WhenA resident looks up their parcel: the cadastral map of parcel AB 214 gives way to the aerial photo of the same parcel.
WhyThe tiles recall map tiles loading: switching from one layer to the other feels natural on a map tool.
Settings350 × 280 px map in SVG, parcel outlined in red on both layers; slate blocks (#475569); parcel record on the left.

How it works

Over the pages of the .transition-preview screen (z-index: 10), the .pixelate-container is a CSS grid of 8 columns by 4 rows (repeat(8, 1fr) / repeat(4, 1fr)), empty in the HTML and transparent to clicks: the script fills it on every pass.

On every click, the script empties the grid and creates 32 .pixel-blocks in it (#0a0a0f, at opacity 0 and scale(0) at rest), each with an animation-delay drawn at random between 0 and 0.3 s: the order of appearance changes on every pass. With .animating, each block plays @keyframes pixelBlock over 1.2 s ease-in-out: opacity and scale from 0 to 1 at 30%, held until 70%, then back to 0. A block therefore covers its cell from 0.36 s to 0.84 s after its own start; with starts spread over 0.3 s, all blocks cover at once from 0.66 s to 0.84 s. The script toggles .is-b on .transition-preview at 0.75 s, in the middle of that window (measured in Chromium 151 and Firefox 153: all 32 blocks at opacity 1 at swap time), and removes .animating at 1.55 s, when the last block is done (0 blocks still visible then: nothing vanishes abruptly). Each block has margin: -0.5px: the grid cells have fractional sizes, and without this one-pixel overlap a slit between two blocks reveals the swap (measured in Firefox 153 at 1.5 scale: 1,132 page pixels visible without the overlap, 0 with it).

Once the blocks are gone, B stays in place until the next click, which draws a new order and brings A back (also checked in WebKit 26.5). Each .pxd-stage has its own grid: two pixelated screens on one page never mix their blocks. A variant in the category colors the blocks with the destination theme's colors.

Accessibility

  • Reduced motion: under prefers-reduced-motion: reduce, the script creates no tile; A gives way to B through a 150 ms fade (measured: empty grid, B shown in under 250 ms).
  • Flicker: 32 blocks appearing out of order make a pattern that flickers for 0.7 s. Once per click, and the button ignores clicks during the animation: it cannot be chained in bursts.
  • Keyboard and screen readers: the same button as Fade Through (fx-0685), which stays focused during the dissolve; the blocks are empty divs and the hidden page is not read.

Browser compatibility

CSS (grid, @keyframes on opacity and transform, inset) + 2 KB of JavaScript (block creation, matchMedia), no dependency. Measured in Chromium 151, Firefox 153 and WebKit 26.5: full grid at swap time, page B held, back to A on the next click with a new order, focus kept, direct swap under reduced motion. inset sets the minimum versions: Chrome 87, Firefox 66, Safari 14.1.

Chrome 87+✓ Full
Firefox 66+✓ Full
Safari 14.1+✓ Full
Edge 87+✓ Full
Mobile iOS 14.5+✓ Full (on tap)
Android Chrome 87+✓ Full (on tap)

Without JavaScript, the grid stays empty, page A on screen and the button inactive: provide a regular link to the next page. Without inset (Safari before 14.1), write top: 0; right: 0; bottom: 0; left: 0 on .transition-content and .pixelate-container.

The code

HTML structure to paste into your page (the CSS + JS come with your purchase):

index.html — structure
<div class="pxd-stage">
  <div class="transition-preview">
    <div class="transition-content old-content">Page A</div>
    <div class="transition-content new-content">Page B</div>
    <div class="pixelate-container"></div> <!-- 32 .pixel-block created on click -->
  </div>
  <button type="button" class="trigger-btn">Trigger Transition</button>
</div>

One-time payment, no subscription — the code is yours forever

Customize

Options passed to the API or data-* attributes:

Option / propertyDefaultEffect
Grid size (CSS — grid-template-columns, grid-template-rows; JS — i < 32) 8 × 4 = 32 blocks 12 × 6 (72 blocks) gives finer tiles, 4 × 2 a tile effect. The loop count must equal columns × rows, or some cells stay empty and reveal the swap.
Block color (CSS — .pixel-block { background }) #0a0a0f Page B's background color makes B look as if it "builds up"; a map color (slate, gray) evokes tiles loading.
Start spread (JS — Math.random() * 0.3) 0 to 0.3 s 0.4 s makes the disorder more visible, but cuts the window where all blocks cover down to 0.08 s: then set SWAP_AT to 800 and END_AT to 1650. Beyond 0.48 s, the fastest blocks leave before the last ones arrive.
Duration (CSS — animation: … 1.2s; JS — SWAP_AT, END_AT) 1.2 s per block; swap at 750 ms, end at 1,550 ms Keep SWAP_AT between 30% of the duration + the maximum spread and 70% of the duration, and END_AT equal to duration + spread + a 50 ms margin.
Content (HTML — .old-content, .new-content) "Page A" and "Page B" on two gradients Any HTML. For a sequence of game screens, fill the hidden layer before the click.

FAQ

Both cover the screen in several staggered pieces. Blinds Effect unrolls six horizontal slats in a fixed order, top to bottom, 50 ms apart: the steady motion of a blind. Pixelate Dissolve shows 32 tiles in a random order, different on every pass: the disorder of a game screen or a loading map. The blind for a calm change readable from afar; the tiles for a retro world or an image being transformed.
Because the order must change on every pass: the script recreates the 32 blocks with new delays at click time. Creating fresh elements also guarantees their animation starts from the beginning, with no trick to restart a CSS animation that already played. The HTML stays short: an empty container.
Yes: replace the random draw with a delay computed from the position. For a wave from the top left corner, block.style.animationDelay = ((i % 8) + Math.floor(i / 8)) * 0.03 + 's': 0 to 0.3 s, the same spread, so the same SWAP_AT and END_AT.