08.1Block 08.1 · Heroes
Iron Hero
A magnetics company’s opening, set like a physics monograph. On the mounted plate below, the name is written in iron filings that swing after the pointer and settle back into the word.
- Version
- 0.1.0
- Size
- 201.5 KB gzipped
- Access
- With a Pass
- Needs
- iron-hero.mjs + iron-hero.css · Filings
- Tests
- 11 tests · 10 states
On this page
Use it
Open a science, engineering or hardware company's site with its name as a physical demonstration rather than a logo: the word is made by iron in a real field, the visitor plays with it before reading a word, and the headline, the pitch and the way in stay quiet and editorial around it.
Copy the iron-hero 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="iron-hero/iron-hero.css">
<div id="iron-hero"></div>
<script type="module">
import Filings from './filings/filings.mjs';
import { mount } from './iron-hero/iron-hero.mjs';
const ironHero = mount(document.getElementById('iron-hero'), {
brand: 'Lode',
word: 'LODE',
eyebrow: 'Precision magnetics · Glasgow · since 1998',
}, { Filings });
// ironHero.update({ … }); change any option in place
// ironHero.destroy(); and take it away again
</script>Options
| Option | Type | Default | What it does |
|---|---|---|---|
| brand | text | 'Lode' | The wordmark in the masthead. |
| word | text | 'LODE' | Written in filings on the plate. Four to seven letters read best. |
| eyebrow | text | 'Precision magnetics · Glasgow · since 1998' | Eyebrow |
| headline | text | 'Magnetic fields,' | Headline |
| accent | text | 'shaped to the micron.' | Headline, italic turn |
| lede | text | 'We design and wind custom magnet assemblies (MRI shims, particle-sensor arrays, reaction wheels for small satellites) and map every one on our own Hall-probe bench before it leaves the workshop.' | Paragraph |
| cta | text | 'Request a field map' | Button |
| href | text | '#contact' | Button link |
| more | text | 'Read the monograph' | Second link |
| moreHref | text | '#research' | Second link, address |
| nav | text | 'Instruments, Research, Field notes, Company' | Comma-separated, up to five. |
| contact | text | 'Talk to an engineer' | Nav button |
| caption | text | 'The word {word} in iron filings over a sintered neodymium slab. Shown live.' | {word} becomes the word in iron. |
| specs | text | 'Remanence: 1.32 T; Coercivity: ≥ 955 kA/m; Mapped to: ±0.05 %; Probe: Hall, 0.1 mT' | Term: value, separated by semicolons; up to six. |
| palette | monograph · nocturne | 'monograph' | Monograph: bone paper, dark iron. Nocturne: black paper, steel iron. |
| form | filled · outline | 'filled' | Filled: the iron fills each stroke. Outline: it draws the edges. |
| density | number, 80 to 220 | 130 | Iron (filings per 100 px square) |
| light | number, 0 to 345 | 315 | 0 is from above, clockwise. |
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.sheethandle.roothandle.destroy()- Stops it and cleans up after it.
States
- ArrivingThe copy settles in; when the plate is a quarter visible a magnet sweeps under the sheet in 2.6 s and leaves the name written in iron.
- At restThe name stands in filled strokes of iron with a bare moat round it; the sheet is asleep and costs nothing.
- Pointer over the plateA bar magnet under the sheet swings the iron in its reach; pressed (or a touch held) it drags tufts; lifted, the name takes its iron back.
- Tap the sheetA text button under the plate loosens the paper and the name re-forms.
- PaletteMonograph: bone paper, dark iron, red and blue pole marks. Nocturne: black paper, steel iron.
- TabletUnder 1000px the headline takes the full width with the lede under it and the plate goes taller; under 900px the nav drops to its own row.
- PhoneUnder 640px the masthead wraps, the copy stacks, the button goes full width, the plate goes to 16/10.5 so the name stays large in fine iron, the figures go to two columns.
- ResizeThe sheet keeps its iron: carried with the word to the new size, never stretched, re-formed in view.
- Reduced motionThe name is formed on the first paint and nothing moves; no copy entrance; the tap button is hidden. Every word is present.
- Off screenThe sheet's loop pauses; the block runs nothing of its own.
How it works
Made of: Name written in iron, Monograph plate framing, Pointer bar magnet, Container query recomposition, Arrival choreography, Palette from filings finish.
Original composition; Lode, its business and its copy are invented. The only imagery is Filings drawing the word in iron; the rulers, corner marks and the bar-magnet mark are CSS. Faces: IBM Plex Serif and IBM Plex Mono (SIL OFL 1.1) as WOFF2, licence beside them.
Built with
More blocks on the same object: