05.2Block 05.2 · Heroes
Camera Launch
A launch hero for a fast prime, where the lens is the Iris. Turn its aperture ring and the photograph beside it follows: round bokeh wide open, nine-sided points stopped down.
- Version
- 0.1.0
- Size
- 82.6 KB gzipped
- Access
- With a Pass
- Needs
- camera-launch.mjs + camera-launch.css · Iris
- Tests
- 9 tests · 11 states
On this page
Use it
A finished product-launch hero for a lens, a camera or any optical product: the spec that sells it (a fast aperture, round bokeh) becomes the thing the visitor plays with, and the page around it (nav, name, price, preorder, a specification strip) is designed to the same standard.
Copy the camera-launch folder and the iris 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="iris/iris.css">
<link rel="stylesheet" href="camera-launch/camera-launch.css">
<div id="camera-launch"></div>
<script type="module">
import Iris from './iris/iris.mjs';
import { mount } from './camera-launch/camera-launch.mjs';
const cameraLaunch = mount(document.getElementById('camera-launch'), {
brand: 'Holm Optical',
product: 'Serein 50',
tagline: 'Nine curved blades, round at every stop that matters.',
}, { Iris });
// cameraLaunch.update({ … }); change any option in place
// cameraLaunch.destroy(); and take it away again
</script>Options
| Option | Type | Default | What it does |
|---|---|---|---|
| brand | text | 'Holm Optical' | Maker |
| product | text | 'Serein 50' | Set large; "f/1.4" follows it. |
| tagline | text | 'Nine curved blades, round at every stop that matters.' | Tagline |
| lede | text | 'A fast standard lens ground and assembled in one workshop. Turn its aperture ring: the sample beside it is shot at whatever stop you choose.' | Lede |
| price | number, 1 to 99999 | 1290 | Price |
| currency | GBP · EUR · USD | 'GBP' | Currency |
| deposit | number, 0 to 9999 | 100 | 0 hides the deposit line. |
| ship | text | 'March 2027' | Ships |
| palette | studio · daylight | 'studio' | A black studio sweep, or a white seamless in daylight. |
| finish | graphite · ink · steel · brass | 'graphite' | Lens finish |
| blades | number, 5 to 16 | 9 | Also the shape of the bokeh once stopped down. |
| stop | 1.4 · 2 · 2.8 · 4 · 5.6 · 8 · 11 | '2.8' | The f-stop the ring rests on, and the one the sample is shot at before anyone turns it. |
| light | number, 0 to 345 | 315 | The lens’s lamp: 0 from above, clockwise. |
| sound | boolean | false | Synthesised detent clicks, only after the ring is touched. |
Methods
mount(element, options, { Iris })- Builds the block inside the element and returns its handle. Hand it the Iris it is built with.
handle.update(next = {})- Change options in place.
handle.destroy()- Stops it and cleans up after it.
States
- At restThe lens rests on f/2.8 on a lit studio sweep; the sample shows f/2.8 · 1/1000 s · ISO 100; the iris is asleep.
- IntroThe lens waits shut until a third in view, then opens to its stop through the spring.
- Turning the ringDrag the knurled ring (click stops, no lag) or use the arrow keys: the sample's background blur, bokeh size and shape and the exposure line follow, driven by the slider's own value.
- Wide openf/1.4 · 1/4000 s: the city lights become large round rim-lit discs, the background blurs and the corners darken slightly; you look into the lens's glass.
- Stopped downf/11 · 1/60 s: the discs close to nine-sided points and the street comes sharp.
- ShutPast f/22 the ring clicks shut: the sample goes black and the readout says 'Shutter closed: no light'.
- PaletteStudio (black sweep, champagne accent, graphite lens) or daylight (white seamless, oxide red, steel lens works well).
- TabletOne column: the lens above the copy; the sample and the buy row side by side; specs in three columns.
- PhoneThe nav wraps, everything stacks, the button goes full width, specs in two columns.
- Reduced motionThe lens rests at its stop, still; turning snaps and the sample follows at once; no transitions.
- Off screenThe iris sleeps; the block runs no loop: the sample repaints only when the ring's value changes.
How it works
Made of: Iris as product, Slider driven sample, Depth of field by aperture, Aperture shaped bokeh, Exposure reciprocity, Mutation observer wiring, Palette tokens from one table.
Original composition; the maker (Holm Optical), the lens (Serein 50) and all copy and specifications are invented. The sample photograph and the lens's glass are canvas paintings in camera-launch.mjs: no image ships. Faces: Instrument Sans and Red Hat Mono (SIL OFL 1.1), full fonts converted to WOFF2.
Built with
More blocks on the same object: