08.2Block 08.2 · 404 & errors
Field 404
A 404 on a sheet of lost steel filings. As the visitor moves, a field-strength readout climbs and the iron slowly finds 404. The copy owns the joke; two plain links lead out.
- Version
- 0.1.0
- Size
- 76.8 KB gzipped
- Access
- With a Pass
- Needs
- field-404.mjs + field-404.css · Filings
- Tests
- 13 tests · 8 states
On this page
Use it
Turn a dead end into a small experiment: the missing page is admitted plainly, the way home is one click away, and the visitor who lingers is rewarded with a field that comes up under their hand and a number written in iron.
Copy the field-404 folder and the filings folder from its package next to your page, link the stylesheets and mount it on an element. Every option has a default; the lab’s Code tab writes the same example at any settings, and for React, Vue, Svelte or a custom element (Using a framework).
<link rel="stylesheet" href="filings/filings.css">
<link rel="stylesheet" href="field-404/field-404.css">
<div id="field-404"></div>
<script type="module">
import Filings from './filings/filings.mjs';
import { mount } from './field-404/field-404.mjs';
const field404 = mount(document.getElementById('field-404'), {
site: 'Coilhouse',
code: 'Error 404 · Pattern not found',
title: 'This page lost its pattern.',
}, { Filings });
// field404.update({ … }); change any option in place
// field404.destroy(); and take it away again
</script>Options
| Option | Type | Default | What it does |
|---|---|---|---|
| site | text | 'Coilhouse' | The small wordmark, linking home. |
| code | text | 'Error 404 · Pattern not found' | Label |
| title | text | 'This page lost its pattern.' | Headline |
| wit | text | 'Everything that was here is still here, just scattered, like the link that sent you. Run your cursor over the sheet and the iron will find the pattern. The page, we’re afraid, won’t.' | The explanation |
| path | text | '/lab/notes/induction-coils' | Empty shows the real address the visitor asked for. |
| home | text | 'Take me home' | Button |
| homeHref | text | '/' | Button link |
| alt | text | 'Search the lab notes' | Second link |
| altHref | text | '/search' | Second link, address |
| found | text | 'Found it. The page is still missing, but the iron remembers where it was.' | When the pattern is found |
| palette | night · brass | 'night' | Night: steel filings on black, a vermilion mark. Brass: brass filings on warm black. |
| tesla | number, 0.2 to 2 | 1.32 | What the readout shows once the pattern is found. |
| light | number, 0 to 345 | 300 | Light from (degrees) |
Methods
mount(element, options, { Filings })- Builds the block inside the element and returns its handle. Hand it the Filings it is built with.
handle.update(next = {})- Change options in place.
handle.level- The pattern's progress, 0…1.
handle.sheethandle.roothandle.destroy()- Stops it and cleans up after it.
States
- LostOn arrival the iron is an even scatter, the magnet is off, the readout reads 0.00 T and asks the visitor to move across the sheet.
- FindingThe level rises with the pointer's travel (two section widths find it) and, from two seconds on screen, slowly on its own; it only ever rises, in twenty-fifths; the iron swings and drifts toward the number; the pointer is a magnet too.
- Find it for meA text button runs the same climb in about a second and a half and taps the middle of the sheet.
- Found404 stands in iron; the readout shows the full field, the note says the found line, the status dot turns pale, the button and the timer go, the sheet sleeps.
- PaletteNight: steel filings on black with a vermilion mark. Brass: brass filings on warm black.
- Tablet and phoneUnder 900px the sheet becomes a band of its own under the masthead with the number centred in it, the readout becomes its caption, and the copy and the ways out follow on solid ground; under 560px the masthead stacks and the home button goes full width.
- Reduced motionFound on the first paint; nothing moves, no timer, no button. Every word is present.
- Off screenThe timer and the sheet pause.
How it works
Made of: Pattern found by movement, Field strength readout, Polite threshold announcements, Scrim framing, Layout aware word placement, Container query recomposition.
Original composition, deliberately unlike Pin 404 (a light page and a framed board): here the sheet is the whole dark ground and the number is found, not pressed. Coilhouse and its copy are invented. Faces: Young Serif and Red Hat Mono (SIL OFL 1.1) as WOFF2, licences beside them.
Built with
More blocks on the same object: