Title
A title that appears pixel by pixel, in about a second and a half.
- Drawn with
- Canvas 2D
- Chain
- tone → ordered → reveal → palette
- Code
- @forgeron/shaders: builtInPresets()["role-title"]
/01 → What it is
- A raster scan: rows start top to bottom, each swept left to right; near the slanted front, pixels shift and step ember, dark ember, dim, muted, then ink.
- The preset is the cell-local form (a `tone` mask through `reveal`); the mount, `mountReveal`, adds the wave and stays.
- The text is in the page from the start; under reduced motion it simply stays.
/02 → Where Forgeron uses it
| Site | Where | Settings |
|---|---|---|
| font.forgeron.sh | Specimen hero, the title “Forgeron Sans” | mountReveal · 1.5 s |
/03 → Versions
- /01 Short title
pixel 10 - /02 Wordmark
pixel 5 - /03 Slow
pixel 5 · 3000 ms
/04 → Use it
import { PixelReveal } from "@forgeron/ui";
<h1>
<PixelReveal text="Forgeron" pixel={8} />
</h1>import { mountReveal, textRows } from "@forgeron/ui";
mountReveal(canvas, [textRows("Forgeron"), textRows("Sans")], {
pixel: 8,
onDone: () => canvas.remove(),
});{
"$schema": "https://shaders.forgeron.sh/schema/preset.v1.json",
"version": 1,
"name": "role-title",
"source": {
"type": "tone"
},
"passes": [
{
"type": "ordered",
"matrix": 8,
"centered": true,
"origin": "top",
"steps": [
[
0,
1
]
]
},
{
"type": "reveal",
"duration": 1.5,
"hold": 1.5,
"loop": false,
"front": [
3,
2
],
"band": 0.06,
"dither": 0.12,
"matrix": 8
},
{
"type": "palette",
"tones": [
{
"var": "--bg",
"fallback": "#0d0d0d"
},
{
"var": "--line",
"fallback": "#2b2b2b"
},
{
"var": "--ink-dim",
"fallback": "#575757"
},
{
"var": "--ink-muted",
"fallback": "#8c8c8c"
},
{
"var": "--ink",
"fallback": "#dcdcdc"
}
],
"transparent": [
0
]
}
]
}API → Options
| Option | Type | Default | Description |
|---|---|---|---|
text | string | — | One line, in the pixel face's capitals. |
pixel | number | 8 | CSS pixels per font pixel. |
duration | number | 1500 | Milliseconds; 1.3 to 1.8 s for a hero title. |
still | boolean | — | One frame at t = 0. Without it, the reader's prefers-reduced-motion decides. |
replay | number | — | Changing it plays the reveal again. |