Skip to the page
TACTILE UI

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
  1. Use it
  2. Options
  3. Methods
  4. States
  5. How it works
  6. Built with
01

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

Options

OptionTypeDefaultWhat it does
sitetext'Coilhouse'The small wordmark, linking home.
codetext'Error 404 · Pattern not found'Label
titletext'This page lost its pattern.'Headline
wittext'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
pathtext'/lab/notes/induction-coils'Empty shows the real address the visitor asked for.
hometext'Take me home'Button
homeHreftext'/'Button link
alttext'Search the lab notes'Second link
altHreftext'/search'Second link, address
foundtext'Found it. The page is still missing, but the iron remembers where it was.'When the pattern is found
palettenight · brass'night'Night: steel filings on black, a vermilion mark. Brass: brass filings on warm black.
teslanumber, 0.2 to 21.32What the readout shows once the pattern is found.
lightnumber, 0 to 345300Light from (degrees)
03

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.sheet
handle.root
handle.destroy()
Stops it and cleans up after it.
04

States

  1. 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.
  2. 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.
  3. Find it for meA text button runs the same climb in about a second and a half and taps the middle of the sheet.
  4. 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.
  5. PaletteNight: steel filings on black with a vermilion mark. Brass: brass filings on warm black.
  6. 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.
  7. Reduced motionFound on the first paint; nothing moves, no timer, no button. Every word is present.
  8. Off screenThe timer and the sheet pause.
05

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.

06

Built with

More blocks on the same object:

Docs
Finish
Volume