---
name: plate-effects
description: Tilted tile-plate hero backgrounds on a 2D canvas. A plate of hexagon, long hexagon, octagon-and-square, cube, triangle, square, slanted or capsule tiles seen through a camera leaning back, lit by soft coloured lamps, with an optional halftone dot floor. When the pointer moves over it the near field stays flat and the far field stands up as one block with dark side walls, stepped along tile edges. The page's real H1 can be printed onto the tiles so the seams cut it and lifted tiles carry their piece of a word. Fifteen named presets with rest and hover posters, a live gallery, one-line mounting, and the power and accessibility rules each keeps. Use when a hero, landing page, sign-in screen or video opener wants "a tile plate", "tilted tiles", "hex plate", "tiles that rise under the mouse", "the headline printed on the tiles" or names a preset such as graphite-violet or bone-ink.
metadata:
  license: AGPL-3.0-or-later
  copyright: "2026 DevTribe Labs"
  homepage: https://github.com/DevDadTribe/toolbox
---

# Plate effects: tilted tile plates

A hero filled edge to edge with large tiles, seen from a camera leaning back a little so the
near tiles look bigger than the far ones. Thin seams, a hint of bevel, soft lamps in the upper
corners, a dotted floor fading up from the bottom. Move the pointer over it and the far side
of a stair-stepped tile boundary rises toward you as one block; the side near the pointer stays
flat. The heading can be painted onto the tiles, so when they lift the seams cut the words and
each lifted tile carries its piece.

It is decoration. The page is complete without it, the real heading stays in the DOM for
search and screen readers, and it switches itself off for anyone who asked for less motion or
for forced colours.

**Pick one by eye first.** Serve this folder and open the live gallery:

```bash
python3 -m http.server 8741        # run inside this skill's folder
```

Then open `http://127.0.0.1:8741/gallery/live.html`, pick a preset, move the mouse over the
hero. Every preset has a rest and a hover poster in `posters/`. The full table is in
[references/catalogue.md](references/catalogue.md).

## The presets (say the name)

| Preset | What it is |
|---|---|
| `graphite-violet` | Dark graphite hexes, violet lamp top left, cyan top right, dot floor, prints the heading. The flagship |
| `slate-amber` | Near-black warm slate hexes, one amber lamp, warm dots |
| `bone-ink` | Light: bone ground, thin ink seams, a soft warm lamp, dark dots, dark heading |
| `navy-aqua` | Deep navy hexes, aqua and blue lamps, a little more tilt |
| `forest-brass` | Deep green hexes, brass and moss lamps, cream dots |
| `octagon-tile-floor` | Octagons with small darker squares, cool white lamps, no floor |
| `cube-field` | Rhombille cubes that read as stacked blocks at rest, violet and teal lamps |
| `triangle-facets` | Triangle lattice, coral and blue lamps, no floor, the gentlest lift |
| `long-hex-runway` | Wide stretched hexes and a steep tilt that runs away like a runway |
| `square-grid-steep` | Square grid with a hard tilt (bottom tiles about twice the top), teal and lime lamps |
| `flat-plate` | The flagship plate seen straight on, no tilt |
| `quiet-signin` | Big hexes, low tilt, faint seams, half the lift, one dim blue lamp, nothing printed |
| `plum-slant` | Slanted panels on plum, rose and gold lamps, pink dots |
| `frost-square` | Light: pale blue-grey squares, one sky lamp, slate seams and dots |
| `cobalt-capsules` | Spaced blue metal bars on black; here the pointer lifts the bars near it |

## Mount it

The host is the hero section. The canvas goes in as its first child, behind the content, and
never takes pointer events. Pass the heading as `print` to paint it onto the tiles.

```html
<section class="hero" id="hero">
  <h1 id="headline">Design that <span class="grad">moves like a plate</span> under your hand.</h1>
</section>
<script src="dist/plate-effects.iife.js"></script>
<script>
  const plate = Plate.mount(document.getElementById('hero'), 'graphite-violet', {
    print: document.getElementById('headline'),
  });
  // later: plate.destroy();
</script>
```

ES module and React:

```tsx
import { mount } from './plate-effects.js';

useEffect(() => {
  const plate = mount(heroRef.current!, 'bone-ink', { print: headingRef.current });
  return () => plate.destroy();
}, []);
```

`mount(host, preset, options)` takes a preset name or a preset object (copy one from
`PRESETS` and change any field). Options: `print` (the element to paint), `clock: 'manual'`
(draw only on `step()` and `pointer()`, for tests, posters and video capture), `dpr`, and
`reducedMotion` (force it on or off). The instance has `pointer(x, y)`, `leave()`,
`step(ms)`, `render()`, `ready` (resolves after fonts load and the heading is printed) and
`destroy()`.

**Posters and video.** Use `clock: 'manual'`, wait for `ready`, call `pointer(250, 450)` then
`step(1200)`, and capture. A background tab gets no animation frames, which is why the manual
clock exists. The gallery takes `?poster&p=<preset>&at=250,450` to do the same.

## How the heading is printed

1. Wait for `document.fonts.ready` and a short settle, so the layout is final.
2. Read each element's computed font, letter spacing, text transform and colour (or its
   `background-clip: text` gradient) before changing anything.
3. Measure every word's box with a DOM Range and paint the word at that exact spot into a
   layer the size of the hero. A gradient span that wraps is laid out the way CSS does it: as
   if its line pieces sat side by side.
4. Make the DOM copy transparent (colour, text fill, text shadow, and the clipped gradient
   background). The text stays selectable and in the accessibility tree.
5. At rest the layer is drawn once on top of the plate, so the heading looks exactly like a
   normal heading. While tiles lift, each lifted tile carries its piece through an affine map of
   its own corners, clipped a little inside its edges so the seams cut the letters.
6. `destroy()` restores every inline style it touched.

## Rules every plate keeps

- **2D canvas only.** No WebGL, no libraries, no network, no `filter: blur()`.
- **Nothing drawn at rest.** One frame at mount and after a resize; frames run only while a
  lift is moving and stop when every tile has settled.
- **Reduced motion: one still frame.** The pointer changes nothing and the heading is left
  alone (not printed).
- **Forced colours: nothing.** The canvas is hidden and the heading left alone; it comes back
  if forced colours switch off.
- **Device pixel ratio capped at 2.**
- **No sideways scroll at 375 px.** The canvas is `position: absolute; inset: 0` inside the
  host, which gets `isolation: isolate` (and `position: relative` if it was static).
- **Heading contrast at rest.** Each preset's suggested heading colours (`ink`, `accent`) were
  checked against its tile colour: the ink clears 4.5:1 and every accent clears 3:1, which is
  WCAG AA for large text. If you change colours, check them again.
- **Never steal pointer events.** The canvas has `pointer-events: none`; listeners sit on the
  host and are passive.

## Files

- `src/math.ts` pure maths: camera, tilings, field, easing, polygon helpers, gradient reader.
  Tested by `tests/math.test.mjs` (`node scripts/build.mjs` then `node --test tests/`).
- `src/plate.ts` the renderer and `mount()`. `src/print.ts` the heading printer.
  `src/presets.ts` the fifteen presets.
- `scripts/build.mjs` builds `dist/plate-effects.js` (ESM), `dist/plate-effects.iife.js`
  (global `Plate`), `dist/plate-math.js` (for the tests) and `gallery/live.html`. Set
  `ESBUILD=/path/to/esbuild` or have `esbuild` on your PATH.
- `posters/` 30 JPEGs, rest and hover for every preset.

## Where it came from

Written by DevTribe Labs from a description of how a tilted tile plate looks and moves. No
other product's code is in this kit.
