04.2Block 04.2 · Backgrounds
Dark Hero
A dark editorial hero over black ferrofluid. The pool follows the cursor from anywhere on the section and rises into spikes under it before the headline has been read.
- Version
- 0.1.0
- Size
- 104.2 KB gzipped
- Access
- With a Pass
- Needs
- dark-hero.mjs + dark-hero.css · Ferrofluid
- Tests
- 10 tests · 11 states
On this page
Use it
Open a studio's or product's site with its claim made physical: the headline says attention, and the material behind it answers the visitor's hand wherever it is on the section, no instruction needed, nothing running when nobody is there.
Copy the dark-hero folder and the ferrofluid 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="ferrofluid/ferrofluid.css">
<link rel="stylesheet" href="dark-hero/dark-hero.css">
<div id="dark-hero"></div>
<script type="module">
import Ferrofluid from './ferrofluid/ferrofluid.mjs';
import { mount } from './dark-hero/dark-hero.mjs';
const darkHero = mount(document.getElementById('dark-hero'), {
studio: 'Kessel & Vane',
eyebrow: 'Interaction studio · Rotterdam',
headline: 'Work that pulls you in',
}, { Ferrofluid });
// darkHero.update({ … }); change any option in place
// darkHero.destroy(); and take it away again
</script>Options
| Option | Type | Default | What it does |
|---|---|---|---|
| studio | text | 'Kessel & Vane' | The wordmark in the nav. |
| eyebrow | text | 'Interaction studio · Rotterdam' | Eyebrow |
| headline | text | 'Work that pulls you in' | Its full stop is set in the mark colour. |
| lede | text | 'We design products and brand sites with physics under the surface: materials that answer the hand, so people stay a little longer.' | Paragraph |
| cta | text | 'See selected work' | Button |
| href | text | '#work' | Button link |
| second | text | 'Start a project' | Second link |
| secondHref | text | '#contact' | Second link target |
| nav | text | 'Work, Studio, Notes, Contact' | Comma-separated, up to five. |
| status | text | 'Booking from March' | Status beside the nav |
| cases | text | 'Nocturne: banking app; Harbour Line: ticketing; Oda Type: foundry site' | “Name: kind; Name: kind”, up to three. |
| meta | text | '12 people · since 2014' | Corner note |
| hint | text | 'Move your cursor: the fluid follows' | Shown only where there is a cursor to move. |
| palette | charcoal · midnight · oxblood | 'charcoal' | Charcoal with a vermilion stop, midnight with blue, oxblood with coral. |
| pull | number, 0.7 to 1.6 | 1.15 | How hard the cursor pulls: past about 0.5 the pool erupts under it. |
| density | number, 10 to 22 | 16 | Spike density |
| sharpness | number, 0.3 to 1 | 0.85 | Spike sharpness |
| light | number, 0 to 345 | 315 | 0 is from above, clockwise. |
Methods
mount(element, options, { Ferrofluid })- Builds the block inside the element and returns its handle. Hand it the Ferrofluid it is built with.
handle.update(next = {})- Change options in place.
handle.fluidhandle.roothandle.destroy()- Stops it and cleans up after it.
States
- ArrivingEyebrow, headline, paragraph, actions and selected work rise 18px and fade in over 1s, staggered; the pool fades in on its first frame and makes one opening pass.
- At restA smooth black pool on a charcoal ground with studio reflections; asleep; a hint invites the cursor where there is one.
- PullingThe cursor anywhere on the section is a magnet in the pool's own coordinates: the pool gathers toward it, leans, and rises into spikes under it; the hint fades.
- ReleasedThe cursor leaves the section: the spikes melt back with a wobble, the surface trembles and stills, and the pool sleeps.
- TouchA press held on the section pulls; a vertical swipe scrolls and cancels it; the hint is not shown.
- Hover and focusLinks brighten, the pill lifts 1px, the second link's underline turns ink and its arrow slides; every link shows a 2px focus ring.
- PaletteCharcoal with a vermilion full stop, midnight with blue, oxblood with coral: one accent, used on the full stop and the status dot only.
- TabletAt container widths 640–999px the pool spans behind the eyebrow and headline, full-bleed; paragraph and actions share a row; cases three across.
- PhoneUnder 640px the pool sits in the flow, tucked under the headline's last line, then the paragraph, actions and the cases as a list.
- Reduced motionNo arrival; the pool shows the spiked still, drawn once, and never follows; the hint is hidden; every word is present.
- Off screen or hiddenThe object pauses itself; the block runs no loop or timer of its own.
How it works
Made of: Section wide magnet, Pointer through copy layer, Object behind headline, Touch hold to pull, Container query recomposition, Single accent.
Original composition; Kessel & Vane, its cases and all copy are invented. The only imagery is the Ferrofluid. Faces: Young Serif and Instrument Sans (SIL OFL 1.1) as WOFF2, licences beside them.
Built with
More blocks on the same object: