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



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.
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):
<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 / property | Default | Effect |
|---|---|---|
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
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.