
Maya
Portfolio · Frontend developer
A frontend developer’s portfolio where a brass barometer counts the site’s own CSS rules, and tapping its glass outlines every box on the page.
Free to copy and download. No account needed.

Portfolio · Frontend developer
A frontend developer’s portfolio where a brass barometer counts the site’s own CSS rules, and tapping its glass outlines every box on the page.
Free to copy and download. No account needed.
Maya Okafor, a freelance frontend developer, on a teal wall with a brass barometer that reads how many CSS rules the page holds. Scroll and rules stack up in a column while the needle falls from Fair toward Stormy. A z-index of 9999 sits behind a 1 until you delete an opacity rule, each fix adds a heavier selector, and you tap the glass to outline every box in red. The case opens on repairers’ notes, old browser hacks stay pinned, and rules are deleted until the needle reads Very Dry and the wall dries to cream.
A one-page portfolio for Maya Okafor, a made-up freelance developer who fixes CSS, builds React frontends and draws things in WebGL. A brass barometer hangs beside the copy and its needle counts the page’s real CSS rules; as you scroll, the page adds, overrides and deletes rules while the camera moves around the instrument.
Download the required files and unzip them in a new project folder.
Copy the prompt into your AI coding tool and let it build the site.
Open what your AI tool made next to the live preview of Maya, and ask it to fix what differs.
This is a prompt plus the files it depends on. The prompt alone is not enough.
The fonts, sky pictures, three.js and the barometer module the prompt uses, with licence details. Put them in your project before you run the prompt.
Download files# Build the Maya portfolio website
You are working in an AI coding tool. Build this website in the current project from the specification below. It is a one-page portfolio for a fictional freelance frontend developer, Maya Okafor, who mostly fixes other people's CSS. A brass barometer, drawn live in WebGL, hangs on a verdigris wall. Its needle reads one real number: how many CSS rules the page has. As the visitor scrolls through sixteen short chapters, the page adds rules, overrides them and finally deletes them, and the needle, the dial words, the camera and the colours follow. The visitor can tap the glass, flip a lever, turn a set screw and paste a selector to weigh it.
Build everything yourself except the supporting files listed in section 2. Do not substitute a framework, a different font, a CSS library or a different 3D engine. Keep the copy exactly as written. Do not add analytics, trackers, external embeds or CDN links.
This prompt comes with a required pack of fonts, pictures, three.js and one supporting code module, `world.js`, which draws the barometer and runs the scroll timeline. It is not a text-only prompt. You write the page markup, the styles and the chapter code from this specification.
Results differ between AI tools and models. Follow the specification closely, and report honestly what you built and tested.
## 1. Stack and project setup
- Plain static files: HTML, CSS and JavaScript modules. No framework, no bundler, no TypeScript, no Tailwind, no npm packages.
- three.js 0.187.0 comes in the pack as `vendor/three/three.module.js` and `vendor/three/three.core.js`; `world.js` imports it by that relative path. Do not install it from npm and do not load it from a CDN.
- No inline scripts. The page must run under a strict Content Security Policy (`script-src 'self'`), so every script is a file: `boot.js` (one line, below), `world.js` and `site.js`. The JSON-LD block in the head is data and may stay inline. Inline `style` attributes are fine.
- Create `boot.js` with exactly this content; `index.html` loads it in the head before the styles:
```js
// Runs before the styles: lets the CSS know JavaScript is on.
document.documentElement.classList.add('js');
```
- The page must be served over HTTP, because it uses JavaScript modules. Any static file server works, for example `python -m http.server 8080` or `npx --yes serve -l 8080 .` in the project folder. Opening `index.html` straight from the disk will not work.
- Every URL in the code is relative (`fonts/...`, `img/...`, `./world.js`), so the site works from a domain root or from any sub-folder. Never write a leading-slash URL.
Finished project:
```text
index.html (section 4, written by you)
boot.js (section 1, written by you)
site.css (section 5, written by you)
site.js (section 7, written by you)
world.js (from the pack: barometer, textures, camera and scroll timeline)
fonts/ (from the pack)
img/ (from the pack: five sky pictures and the share picture)
vendor/three/ (from the pack)
licenses/ (from the pack, keep it)
README.md (from the pack, keep it or merge it into yours)
```
## 2. Required files
Required pack, version 1:
- URL: https://sitepeel.dev/website-prompts/barometer-portfolio/assets-v1.zip
- SHA-256: `206295af61f3316ded428ceb88b57ec29aad1fcbb6e5475fe5fe996355e8c9e1`
- Size: 886051 bytes
Download it with your tool's web fetch, `curl -fL -o assets-v1.zip <URL>`, or `Invoke-WebRequest`. If `assets-v1.zip` is already in the project folder, use that copy. If you cannot download it, stop and ask the person to save the file into the project folder, then continue. Check the SHA-256 (`shasum -a 256`, `sha256sum` or `certutil -hashfile assets-v1.zip SHA256`) and stop if it differs. Unzip it into the project folder so that `world.js`, `fonts/`, `img/`, `vendor/` and `licenses/` sit next to `index.html`, then delete the zip.
Files in the pack (path, SHA-256):
| File | SHA-256 |
|---|---|
| `README.md` | `60fb3091664da13c106b2ee75668bfbbf1b0e684ae3a818783872cf31206a82d` |
| `fonts/cutive-mono-latin-400-normal.woff2` | `86bac2b356efacde8dbb66e5e931b660a78585c6142cf4a61567f313a9f16271` |
| `fonts/im-fell-english-latin-400-italic.woff2` | `8fc678575e83868f82ce5aa6e023f056ea68d480e16dd108b3e14bc375c8fdea` |
| `fonts/im-fell-english-latin-400-normal.woff2` | `248300df1647bec49155a5cada1d65f719ae633ef48564d1f19b135a8a5b7f5f` |
| `img/share.jpg` | `723799ce3879fa03e3e1f24087e11c85a25c4c90237e2b6b6b1f0d91a272cb29` |
| `img/sky-change.jpg` | `24b255975fea6e032995dbafb9db456a0fc0fe88bf1eab206b26d93cf445198b` |
| `img/sky-fair.jpg` | `9cce8cacfeb2ab16d812409bea8c3a8e3ad28609a1695fe9841abcd24f218195` |
| `img/sky-rain.jpg` | `d66ceb84d2d9f17a90b7405f8bea14d88bc270f3faa92bfd2c8d1cd580d148ac` |
| `img/sky-stormy.jpg` | `b5943443f490e6111c3460dfba88a546054c8620830745a48afddc041a83de37` |
| `img/sky-very-dry.jpg` | `34f960dcc15399921351c1da8de7dab15b5ca615da93aa334ce8ef920fb45042` |
| `licenses/MIT-three.js.txt` | `8b378ebe60e2fe500158cb0ac71cb5e8b7d92953c2abcc63a0eb90499653b5bc` |
| `licenses/OFL-CutiveMono.txt` | `e754f49f329686044ba2bedea5fce5dd436ae78f49a0038a9e08ce9d079617e6` |
| `licenses/OFL-IMFellEnglish.txt` | `18aabf190848725e2576eefb5c29ba06aac1029d02132252a7f312eac2e50cf3` |
| `licenses/PROVENANCE.md` | `522de815685aabe365ef8f76cdbc4046954cfea142f60f9c380c56a6a4a334d6` |
| `vendor/three/three.core.js` | `613e370f76638fdef83926642bf256dc9615684922de1ce1f63a8583e5d78578` |
| `vendor/three/three.module.js` | `104f56145899722094556490d787aae0617cc2fc3382f31df02d724ea1aee341` |
| `world.js` | `6d73cc299709c830be54a1924772f50f3000d6975ef183f458ea85d8b2d628d1` |
The zip also holds `SHA256SUMS.txt` with the same list.
`world.js` is supporting code, written for this project and supplied so the barometer looks and moves the same on every build. Do not rewrite or reformat it; the look depends on its exact numbers. Section 6 explains what it does and the `window.W` interface your chapter code uses.
## 3. Rights and honesty
- IM Fell English and Cutive Mono are under the SIL Open Font License 1.1. Their licences are in `licenses/` and must stay with the font files. Do not rename or modify the fonts.
- three.js is under the MIT licence (`licenses/MIT-three.js.txt`).
- The five sky pictures were generated with an image model for this project. The share picture is a screenshot of the finished page. The barometer, dial, plate and scratches are drawn in code by `world.js`.
- Maya Okafor and everything said about her are invented. Mail goes to `maya@example.com`, a reserved address that cannot be delivered. Before anyone publishes the site, the name, copy and address should be replaced with their own, and the `noindex` tag removed.
- The page mentions real web technologies (CSS, React, WebGL, DevTools, Internet Explorer) only as technical facts. Keep it that way: do not add client logos, testimonials, counts of years or awards.
## 4. Page markup
Create `index.html` exactly as below. It holds the structure, every hook the code needs and all of the copy. The `<style id="weather">` block is content, not styling: it is the old stylesheet the barometer reads, and the chapter code inserts rules into it and deletes them again. Keep every rule in it, in this order. The `min-height` on each chapter sets how long the chapter lasts while scrolling.
```html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="robots" content="noindex">
<title>Maya Okafor. Frontend developer. Fixes other people's CSS.</title>
<meta name="description" content="Freelance frontend developer, React and WebGL. A brass barometer whose needle reads this page's real CSS rule count.">
<meta name="theme-color" content="#17666e">
<meta property="og:title" content="Maya Okafor. Fixes other people's CSS.">
<meta property="og:description" content="A brass barometer whose needle reads this page's real CSS rule count.">
<meta property="og:type" content="website">
<meta property="og:image" content="img/share.jpg">
<meta name="twitter:card" content="summary_large_image">
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ccircle cx='16' cy='16' r='14' fill='%23efe9da' stroke='%23b98a3e' stroke-width='3.5'/%3E%3Cpath d='M16 16 24 8' stroke='%2316203a' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E">
<link rel="preload" href="fonts/im-fell-english-latin-400-normal.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="fonts/cutive-mono-latin-400-normal.woff2" as="font" type="font/woff2" crossorigin>
<script type="application/ld+json">{"@context":"https://schema.org","@type":"Person","name":"Maya Okafor","jobTitle":"Freelance frontend developer","email":"mailto:maya@example.com","knowsAbout":["CSS","React","WebGL"]}</script>
<script src="boot.js"></script>
<link rel="stylesheet" href="site.css">
<style id="weather">
.clearfix:after { content: ""; display: table; clear: both; }
.clearfix { *zoom: 1; }
.ie6-only { _height: 1px; }
.old-gradient { filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#80000000'); }
.header-fix { margin-left: 1px; }
.header-fix-2 { margin-left: 0; }
.header-fix-final { margin-left: 1px; }
.tmp { display: none; }
.tmp2 { display: block; }
.do-not-touch { position: relative; top: -1px; }
.old-nav li { float: left; }
.old-nav li a { padding: 7px 11px 6px; }
.promo-2019 { background: yellow; }
.promo-2019 .close { right: 3px; }
.sidebar-legacy { width: 217px; }
.footer-old { margin-bottom: -2px; }
.btn-old { border-radius: 3px; }
.btn-old-2 { border-radius: 4px; }
.btn-new { border-radius: 4px; }
.btn-new-new { border-radius: 3px; }
.carousel-v1 { height: 412px; }
.carousel-v1 .dot { margin: 0 2px; }
.grid-12 { width: 8.3333%; }
.hidden-ie { display: none; }
.modal-backdrop { z-index: 9998; }
.modal-backdrop-2 { z-index: 9999; }
.cookie-bar { z-index: 99999; }
.fix-safari { -webkit-transform: translateZ(0); }
.fix-safari-2 { -webkit-backface-visibility: hidden; }
.wrapper-inner-inner { overflow: hidden; }
</style>
</head>
<body>
<noscript><p class="noscript">This needle needs JavaScript to read the stylesheet, so it's parked at Fair. Everything else is below, and you can reach Maya at <a href="mailto:maya@example.com">maya@example.com</a>.</p></noscript>
<a class="skip" href="#very-dry-anchor">Skip to Maya's address</a>
<div class="stage" aria-hidden="true">
<svg class="poster" viewBox="-120 -135 240 270" role="presentation">
<circle r="110" fill="#b98a3e"/><circle r="110" fill="none" stroke="#7d5a24" stroke-width="2"/>
<circle r="97" fill="#efe9da"/>
<circle r="88" fill="none" stroke="#16203a" stroke-width="7" stroke-dasharray="1 4.76" transform="rotate(135)"/>
<g font-family="IM Fell English, Georgia, serif" font-style="italic" font-size="13" fill="#16203a" text-anchor="middle">
<text x="-50" y="52">Stormy</text><text x="-58" y="-18">Rain</text><text y="-56">Change</text><text x="48" y="-34">Fair</text><text x="52" y="56">Very Dry</text>
</g>
<g class="poster-needle"><path d="M0 16 L-2.4 0 L0 -84 L2.4 0 Z" fill="#16203a"/></g>
<circle r="7" fill="#b98a3e"/>
<path d="M0 -110 a13 13 0 1 1 .01 0" transform="translate(0 -13)" fill="none" stroke="#b98a3e" stroke-width="4"/>
</svg>
<canvas id="gl"></canvas>
<canvas id="boxes"></canvas>
</div>
<header class="chrome">
<a class="chrome-mail" href="mailto:maya@example.com"><span class="wide">maya@example.com</span><span class="narrow">Email Maya</span></a>
<p class="chrome-count"><output id="count">Reading the stylesheets…</output> <span id="forecast"></span></p>
</header>
<main id="app">
<!-- chapter: fair -->
<section data-chapter="fair" style="min-height: 260vh">
<div class="pin fair-pin">
<h1 class="fair-name">Maya<br>Okafor</h1>
<div class="fair-copy">
<p class="fair-lead">Freelance frontend developer. I fix CSS, build React frontends and draw things in WebGL.</p>
<p class="fair-lead">Half the job is fixing other people’s CSS.</p>
<p class="fair-cta"><a class="btn-brass" href="mailto:maya@example.com">Write to Maya</a> <span>Taking new work.</span></p>
<p class="fair-note">The barometer reads one thing: how many CSS rules this page has. Scroll down and watch it.</p>
<p class="fair-return" id="fair-return" hidden></p>
<p class="sr-only">Maker’s plate on the barometer: i spend half my job fixing other peoples css lol</p>
</div>
</div>
</section>
<!-- chapter: bottom-of-the-file -->
<section data-chapter="bottom-of-the-file" style="min-height: 320vh">
<div class="pin bof-pin">
<div class="bof-words">
<h2>Every stylesheet grows at the bottom.</h2>
<p>Nobody deletes a rule they didn’t write. It might be holding something up. So the new one goes underneath, and the file gets longer.</p>
<p class="bof-now">This page is doing it now. Each line here is a real rule, added while you read.</p>
</div>
<ol class="rule-column" id="rule-column" aria-label="CSS rules added to this page so far"></ol>
</div>
</section>
<!-- chapter: point-nine-nine -->
<section data-chapter="point-nine-nine" style="min-height: 220vh">
<div class="pin p99-pin">
<h2 class="p99-poster" id="p99"><code>opacity: .99</code></h2>
<p class="p99-read">Measured just now: <output id="p99-read">0.99</output></p>
<div class="p99-copy">
<p>One percent of a fade nobody can see. It also starts a new <button class="p99-term" popovertarget="p99-def" type="button">stacking context</button>, so everything inside this element is now sealed off from everything outside it.</p>
<p>filter and will-change do it too, and so does any rotate or scale.</p>
<div id="p99-def" popover class="p99-def">A group of elements that get layered against each other, then get layered as one piece against everything else.</div>
</div>
</div>
</section>
<!-- chapter: nine-thousand -->
<section data-chapter="nine-thousand" style="min-height: 260vh">
<div class="pin nine-pin">
<h2 class="nine-head">Nine thousand nine hundred and ninety-nine, behind a one.</h2>
<div class="nine-stack">
<div class="nine-parent" id="z-parent"><div class="nine-tag" id="z-tag"><b>z-index: 9999</b><small id="z-tag-read"></small></div></div>
<div class="nine-plate" id="z-plate"><b>z-index: 1</b><small id="z-plate-read"></small></div>
</div>
<div class="nine-act">
<p>The parent has opacity: .99, so the 9999 only counts inside that parent. Out here it is outranked by a one.</p>
<button class="btn-brass" id="z-btn" type="button">Delete opacity: .99</button>
<p class="nine-after" id="z-after" hidden>Deleted. Everyone will ask why that took all afternoon.</p>
</div>
</div>
</section>
<!-- chapter: struck-through -->
<section data-chapter="struck-through" style="min-height: 220vh">
<div class="pin struck-pin">
<div class="struck-copy">
<p class="struck-lead">Overridden is not deleted.</p>
<p>Open DevTools on any site older than a year and you’ll find rules with a line through them. The browser read them, threw them out, and will do it again on every load.</p>
<p class="struck-count"><output id="struck-read"></output></p>
</div>
<h2 class="struck-word"><del id="struck-word">Fair</del></h2>
</div>
</section>
<!-- chapter: heavier -->
<section data-chapter="heavier" style="min-height: 280vh">
<div class="pin heavy-pin">
<h2 class="heavy-head">Each fix outweighs the last.</h2>
<ol class="heavy-stair" id="stair"></ol>
<div class="heavy-foot">
<div class="nav"><a class="btn heavy-btn" id="heavy-sample" href="#heavy-note"></a></div>
<p id="heavy-note">The button was blue the whole time somebody wanted it navy, or the other way round. Nobody remembers.</p>
</div>
</div>
</section>
<!-- chapter: nobody-checked -->
<section data-chapter="nobody-checked" style="min-height: 250vh">
<div class="pin nobody-pin">
<div class="nobody-mid">
<p class="nobody-press">Press it.</p>
<button class="nobody-lever" id="lever" type="button" aria-pressed="false" aria-label="Change one global CSS rule"><span></span></button>
<p class="nobody-result" id="lever-note" aria-live="polite"></p>
</div>
</div>
</section>
<!-- chapter: the-tap -->
<section data-chapter="the-tap" style="min-height: 460vh">
<div class="pin tap-pin">
<div class="tap-left">
<h2 class="tap-word">Stormy</h2>
<p class="tap-copy">People tap barometers. It frees a sticking needle, and you see which way it really wants to go.</p>
<p class="tap-blue">Still blue in the glass.</p>
</div>
<div class="tap-right">
<button class="btn-brass tap-btn" id="tap" type="button" aria-pressed="false">Tap the glass</button>
<div class="tap-result" hidden>
<code class="tap-code">* { outline: 1px solid red; }</code>
<p>One line. Every box on the page, at once. It's the oldest trick in the trade.</p>
<p class="tap-count"><output id="tap-count"></output></p>
</div>
</div>
</div>
</section>
<!-- chapter: turned-over -->
<section data-chapter="turned-over" style="min-height: 340vh">
<div class="pin over-pin">
<div class="over-copy">
<h2>Repairers sign the inside.</h2>
<p>Watch and instrument repairers scratch small marks inside the case when they service one, where the owner will never look. Developers leave theirs in comments.</p>
<ul class="over-notes">
<li><code>/* temp fix */</code></li>
<li><code>/* do not touch */</code></li>
<li><code>/* no idea why this works */</code></li>
<li><code>/* remove after launch */</code></li>
</ul>
</div>
</div>
</section>
<!-- chapter: set-screw -->
<section data-chapter="set-screw" style="min-height: 240vh">
<div class="pin screw-pin">
<h2 class="screw-head" id="screw-head"><code>margin-top: <span id="screw-val">-3</span>px</code></h2>
<div class="screw-rule" aria-hidden="true"></div>
<div class="screw-copy">
<p>Nobody left at the company knows why it’s there.</p>
<label class="screw-label" for="screw">Turn it and see what it was holding up.</label>
<input class="screw-range" id="screw" type="range" min="-8" max="4" step=".1" value="-3">
<p class="screw-note" id="screw-note" aria-live="polite"></p>
</div>
</div>
</section>
<!-- chapter: spare-parts -->
<section data-chapter="spare-parts" style="min-height: 280vh">
<div class="pin tray-pin">
<h2 class="tray-head">Still mounted.</h2>
<ul class="board">
<li class="tag tag-a"><code>.clearfix:after</code><p>Held a parent open around its floats, in the years before flexbox.</p></li>
<li class="tag tag-b"><code>*zoom: 1</code><p>Triggered hasLayout in Internet Explorer 6 and 7. The asterisk was a parsing bug, used on purpose.</p></li>
<li class="tag tag-c"><code>_height: 1px</code><p>Only Internet Explorer 6 read the underscore. Everything else skipped the line.</p></li>
<li class="tag tag-d"><code>filter: progid: DXImageTransform. Microsoft.gradient(...)</code><p>How you got a gradient in old Internet Explorer.</p></li>
</ul>
<p class="tray-foot">Internet Explorer was retired on 15 June 2022. These are all still out there.</p>
</div>
</section>
<!-- chapter: taken-in -->
<section data-chapter="taken-in" style="min-height: 260vh">
<div class="pin taken-pin">
<article class="card" id="card">
<h2 class="card-title">Taken in for repair and new work</h2>
<p>Other people’s CSS. Stacking bugs and layout bugs in a stylesheet nobody wants to open. I read it, find out what each rule is holding up, and take out what’s holding up nothing.</p>
<p>React. Frontends, built new or taken over halfway.</p>
<p>WebGL. Things on a page that have to be drawn, every frame, by hand. This barometer is one.</p>
<p class="card-jan">Half of this is janitorial. The other half draws brass.</p>
<p class="card-foot"><a href="mailto:maya@example.com">Write to Maya</a> <span>Customer’s copy no. <output id="card-no"></output> Name: <span class="blank"> </span></span></p>
</article>
</div>
</section>
<!-- chapter: sixteen-point-six -->
<section data-chapter="sixteen-point-six" style="min-height: 260vh">
<div class="pin six-pin">
<h2 class="six-fig"><output id="six-ms">16.6</output> ms</h2>
<div class="six-copy">
<p>That’s the budget for one frame at sixty a second. Every pixel of this brass is worked out on its own, without knowing what its neighbour got.</p>
<p class="six-px">Drawn this frame: <output id="six-px">0</output> pixels</p>
<button class="btn-brass" id="six-hold" type="button">Hold to see the surface normals</button>
</div>
</div>
</section>
<!-- chapter: the-good-part -->
<section data-chapter="the-good-part" style="min-height: 360vh">
<div class="pin good-pin">
<div class="good-words">
<h2 class="good-poster">Deleting.</h2>
<p class="good-line">Now the good part. A good day fixing CSS ends with fewer lines than it started with.</p>
<p class="good-gone"><output id="good-gone">0</output> rules removed</p>
</div>
<ol class="good-col" id="good-col" aria-hidden="true"></ol>
</div>
</section>
<!-- chapter: no-weather -->
<section data-chapter="no-weather" style="min-height: 280vh">
<div class="pin nw-pin">
<div class="nw-copy">
<h2 class="nw-head">There was no weather.</h2>
<p>The needle only ever read one thing. How many CSS rules were on this page. It fell when rules were added, and the sky stayed blue the whole time, because nothing looked wrong.</p>
<p class="nw-last">Most broken stylesheets look fine too.</p>
<p class="sr-only">Behind the dial is a disc of five sky photographs, one for each word on the dial: Stormy, Rain, Change, Fair and Very Dry.</p>
</div>
</div>
</section>
<!-- chapter: very-dry -->
<section data-chapter="very-dry">
<span id="very-dry-anchor"></span>
<div class="vd-track" style="min-height: 280vh">
<div class="pin vd-pin">
<div class="vd-form">
<h2 class="vd-word">Very Dry</h2>
<p class="vd-count"><output id="vd-count"></output></p>
<form id="vd" class="vd-fields" novalidate>
<label for="vd-sel">Your worst selector</label>
<p class="vd-help" id="vd-help">Paste it. I’ll tell you how heavy it is.</p>
<input id="vd-sel" name="selector" autocomplete="off" spellcheck="false" aria-describedby="vd-help vd-out" placeholder="#app div.nav a.btn:hover">
<p class="vd-out" id="vd-out" aria-live="polite"></p>
<button class="btn-brass" type="submit">Send it to Maya</button>
</form>
</div>
<a class="vd-mail" id="vd-mail" href="mailto:maya@example.com">maya@example.com</a>
<button class="vd-copy" id="vd-copy" type="button">Copy the address</button>
</div>
</div>
<footer class="plate">
<p class="plate-name">Maya Okafor</p>
<p>Set in IM Fell English and Cutive Mono. The barometer is built from code in the browser, part by part.</p>
<p>Deliberately absent: client logos and a count of years.</p>
<p>Keys 1 to 9 jump between the first nine chapters.</p>
<p class="plate-last">The last number on this plate is the rule count, right now. <output id="plate-count"></output></p>
</footer>
</section>
</main>
<div class="sr-only" aria-live="polite" id="say"></div>
<script type="module" src="site.js"></script>
</body>
</html>
```
## 5. Styles
Create `site.css` exactly as below. Notes on the parts that matter most:
- Colour tokens: `--wet-verdigris #17666e` (the wall at first), `--dry-chalk #d9d3bf` (the wall at the end), `--brass #b98a3e`, `--enamel #efe9da`, `--blued-steel #16203a`. `world.js` switches `--wall`, `--ink` and `--metal` when the page "dries out" near the end, so every colour must go through these variables.
- Each chapter is a tall `section`; inside it, `.pin` is `position: sticky` and fills the screen, so the words stay put while the chapter's scroll plays. `world.js` writes the chapter's progress (0 to 1) to the section's `--p` custom property and puts the class `on` on the current chapter; the entrance animations in the `/* world/02-entrances.css */` part key off `.on`.
- The WebGL canvas `#gl` and the 2D canvas `#boxes` are fixed behind the words. `.poster` is an SVG drawing of the barometer shown until WebGL is ready (`body.gl-ready`) and kept when WebGL fails (`body.no-gl`).
- Under 720px wide, and on any portrait screen (width / height below 0.8, the same rule `world.js` uses for its narrow camera path), the layout becomes one column: the barometer sits in the top half of the screen and every chapter's words sit in the lower half. Two extra blocks at the end shrink the type for short phones (about 320 x 640) and landscape phones (about 844 x 390).
- Chapters overlap by one screen (`margin-top: -100svh`), so a chapter section itself never takes clicks (`pointer-events: none`); only the current chapter's `.pin` and the footer plate do. Without this, the next chapter's empty section would sit over the lower half of the current one and swallow clicks on its buttons.
- The two header items can carry a small plate of wall colour: always on phones, and on wide screens in the last two chapters, where the camera brings the brass under the header.
- `prefers-reduced-motion: reduce` turns off the entrance animations and the swing.
```css
/* world/00-tokens.css */
@font-face { font-family: "IM Fell English"; src: url(fonts/im-fell-english-latin-400-normal.woff2) format("woff2"); font-style: normal; font-weight: 400; font-display: swap; }
@font-face { font-family: "IM Fell English"; src: url(fonts/im-fell-english-latin-400-italic.woff2) format("woff2"); font-style: italic; font-weight: 400; font-display: swap; }
@font-face { font-family: "Cutive Mono"; src: url(fonts/cutive-mono-latin-400-normal.woff2) format("woff2"); font-style: normal; font-weight: 400; font-display: swap; }
@font-face { font-family: "Fell Fallback"; src: local("Georgia"); size-adjust: 92%; ascent-override: 92%; descent-override: 24%; }
@font-face { font-family: "Mono Fallback"; src: local("Courier New"); size-adjust: 100%; }
:root {
--wet-verdigris: #17666e;
--dry-chalk: #d9d3bf;
--brass: #b98a3e;
--enamel: #efe9da;
--blued-steel: #16203a;
--red: #ff0000;
--wall: var(--wet-verdigris);
--ink: var(--enamel);
--metal: color-mix(in oklab, var(--brass) 42%, var(--enamel));
--dim: color-mix(in oklab, var(--ink) 72%, var(--wall));
--display: "IM Fell English", "Fell Fallback", Georgia, serif;
--type: "Cutive Mono", "Mono Fallback", "Courier New", monospace;
--settle: cubic-bezier(.2, .9, .25, 1);
--out: cubic-bezier(.16, 1, .3, 1);
--size-body: clamp(16px, 1.15vw + 10px, 19px);
--size-small: clamp(15px, .45vw + 11px, 17px);
--size-head: clamp(38px, 4.4vw, 64px);
--size-display: clamp(64px, 11vw, 176px);
--size-poster: clamp(96px, 22vw, 400px);
--gutter: clamp(20px, 5vw, 72px);
}
/* world/01-base.css */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--wall); scrollbar-color: var(--brass) var(--wall); scrollbar-width: thin; -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--ink); font: 400 var(--size-body)/1.5 var(--type); font-synthesis: none; overflow-x: clip; -webkit-font-smoothing: antialiased; }
::selection { background: var(--brass); color: var(--blued-steel); }
body.outlined ::selection { background: var(--red); color: var(--enamel); }
h1, h2, h3, p, ol, ul { margin: 0; padding: 0; }
ol, ul { list-style: none; }
h1, h2, h3 { font: 400 var(--size-head)/1.05 var(--display); text-wrap: balance; letter-spacing: -.01em; }
p { text-wrap: pretty; max-width: 58ch; }
code { font: inherit; }
a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; transition: text-decoration-thickness 120ms linear, text-underline-offset 160ms var(--out); }
a:hover { text-decoration-thickness: 2px; text-underline-offset: .28em; }
a:active { text-decoration-thickness: 3px; text-underline-offset: .12em; }
:focus-visible { outline: 1px solid var(--brass); outline-offset: 3px; }
.btn-brass { display: inline-flex; align-items: center; min-height: 48px; padding: 10px 20px; font: inherit; color: var(--blued-steel); background: var(--brass); border: 0; border-radius: 2px; box-shadow: inset 0 1px 0 color-mix(in oklab, var(--enamel) 55%, var(--brass)), inset 0 -2px 0 color-mix(in oklab, var(--blued-steel) 40%, var(--brass)); cursor: pointer; transition: transform 90ms linear, background-color 140ms linear; }
.btn-brass:hover { background: color-mix(in oklab, var(--enamel) 22%, var(--brass)); }
.btn-brass:active { transform: translate3d(0, 2px, 0); box-shadow: inset 0 2px 0 color-mix(in oklab, var(--blued-steel) 40%, var(--brass)); }
.stage { position: fixed; inset: 0; z-index: 0; background: var(--wall); }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#gl { opacity: 0; }
body.gl-ready #gl { opacity: 1; }
body.gl-ready .poster { visibility: hidden; }
#boxes { pointer-events: none; }
.poster { position: absolute; right: 4vw; top: 50%; height: 82vh; transform: translateY(-50%); max-width: 62vw; }
.poster-needle { transform: rotate(45deg); transition: transform 500ms var(--settle); }
body:not(.gl-ready) .poster-needle { animation: tremble 900ms steps(3) infinite; }
@keyframes tremble { 50% { translate: .4px 0; } }
.chrome { position: fixed; z-index: 5; inset: 0 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px var(--gutter); font-size: var(--size-small); pointer-events: none; }
.chrome a, .chrome output { pointer-events: auto; }
/* Each header item can carry a plate of wall colour, so it stays readable when the brass passes under it. */
.chrome-mail, .chrome-count { min-height: 44px; display: inline-flex; padding: 0 10px; margin: 0 -10px; border-radius: 2px; white-space: nowrap; }
.chrome-mail, .chrome-count { align-items: center; }
.chrome-mail .narrow { display: none; }
.chrome-count { font-variant-numeric: tabular-nums; text-align: right; }
body:has([data-chapter="no-weather"].on, [data-chapter="very-dry"].on) :is(.chrome-mail, .chrome-count) { background: color-mix(in oklab, var(--wall) 25%, var(--enamel)); }
#forecast { font-family: var(--display); font-style: italic; font-size: 1.3em; line-height: 1; margin-left: .5em; }
main { position: relative; z-index: 2; }
[data-chapter] { position: relative; }
.pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: clip; padding: 84px var(--gutter) 40px; display: flex; flex-direction: column; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; left: var(--gutter); top: -60px; z-index: 9; background: var(--brass); color: var(--blued-steel); padding: 12px 16px; }
.skip:focus { top: 12px; }
.noscript { position: relative; z-index: 9; padding: 90px var(--gutter) 0; }
@media (max-width: 720px), (max-aspect-ratio: 799/1000) {
/* On phones the barometer hangs right under the header: each header item gets a small plate of wall colour so it reads over the brass. */
.chrome { padding-top: 10px; padding-bottom: 10px; gap: 10px; }
.chrome-mail, .chrome-count { background: var(--wall); }
.chrome-mail .wide { display: none; }
.chrome-mail .narrow { display: inline; }
.poster { right: 50%; transform: translate(50%, 0); top: 8vh; height: 44vh; max-width: 86vw; }
}
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
.stage, .chrome, .skip { display: none; }
body, html { background: #fff; color: #000; }
.pin { position: static; height: auto; overflow: visible; }
[data-chapter] { min-height: 0 !important; break-inside: avoid; }
}
/* world/02-entrances.css */
/* Text never scrolls across the instrument. A chapter's words stay still and arrive in their own way. */
/* Chapters overlap by a screen, so a section never takes clicks itself: only the current chapter's .pin (and the footer plate) do. */
.js main > [data-chapter] { margin-top: -100svh; pointer-events: none; }
.js main > [data-chapter]:first-child { margin-top: 0; }
.js [data-chapter] .pin { opacity: 0; pointer-events: none; }
.js [data-chapter].on .pin { opacity: 1; pointer-events: auto; }
@keyframes paint-on { from { clip-path: inset(-10% 100% -10% 0); } to { clip-path: inset(-10% -5% -10% 0); } }
@keyframes pressed-in { from { transform: translate3d(0, -14px, 0) scale(1.02); } to { transform: none; } }
@keyframes rise-edge { from { clip-path: inset(100% -5% -10% -5%); } to { clip-path: inset(-10% -5% -10% -5%); } }
@keyframes hung { from { transform: translate3d(0, -34px, 0) rotate(-4deg); } to { transform: none; } }
.on .bof-words { animation: paint-on 700ms steps(24) both; }
.on .p99-poster { animation: paint-on 520ms var(--out) both; }
.on .nine-head { animation: pressed-in 240ms var(--out) both; }
.on .nine-stack { animation: hung 420ms var(--out) both; }
.on .struck-word { animation: rise-edge 620ms var(--out) both; }
.on .heavy-head { animation: pressed-in 260ms var(--out) both; }
.on .nobody-press { animation: paint-on 400ms steps(8) both; }
.on .tap-word { animation: rise-edge 520ms var(--out) both; }
.on .over-copy { animation: paint-on 620ms var(--out) both; }
.on .screw-head { animation: pressed-in 300ms var(--out) both; }
.on .tag { animation: hung 460ms var(--out) both; }
.on .card { animation: hung 480ms var(--out) both; }
.on .six-fig { animation: rise-edge 560ms var(--out) both; }
.on .good-poster { animation: paint-on 480ms steps(9) both; }
.on .nw-head { animation: paint-on 720ms var(--out) both; }
.on .vd-word { animation: rise-edge 560ms var(--out) both; }
@media (prefers-reduced-motion: reduce) { .on * { animation: none !important; } }
@media print { .js main > [data-chapter] { margin-top: 0; } .js [data-chapter] .pin { opacity: 1; } }
/* chapter: fair */
.fair-pin { justify-content: flex-end; padding-bottom: 8vh; }
.fair-name { font: 400 clamp(84px, 12.6vw, 220px)/.84 var(--display); letter-spacing: -.035em; margin-bottom: 4vh; transform: translate3d(calc(var(--p, 0) * -3vw), 0, 0); }
.fair-copy { max-width: 42ch; display: flex; flex-direction: column; gap: 6px; }
.fair-lead { font-size: var(--size-body); }
.fair-cta { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; font-size: var(--size-body); }
.fair-cta .btn-brass { text-decoration: none; }
.fair-cta span { color: var(--metal); }
.fair-note { margin-top: 10px; color: var(--dim); font-size: var(--size-small); }
.fair-return { font-size: var(--size-small); color: var(--metal); }
@media (max-width: 720px), (max-aspect-ratio: 799/1000) { .fair-name { font-size: 25vw; margin-bottom: 18px; } .fair-pin { padding-bottom: 30px; } }
/* chapter: bottom-of-the-file */
.bof-pin { flex-direction: row; justify-content: space-between; gap: 5vw; align-items: stretch; }
.bof-words { position: absolute; left: 49vw; top: 15vh; width: min(310px, calc(51vw - var(--gutter) - min(23vw, 340px) - 2vw)); display: flex; flex-direction: column; gap: 18px; font-size: var(--size-small); }
.bof-words h2 { font-size: clamp(32px, 3.1vw, 50px); }
.bof-now { color: var(--metal); }
.rule-column { position: absolute; right: var(--gutter); top: 84px; bottom: 26px; width: min(23vw, 340px); display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; font-size: 14.5px; line-height: 1.55; }
.rule-column li { display: flex; gap: 10px; white-space: nowrap; flex: none; padding-inline: 4px; cursor: default; transition: background-color 120ms linear, color 120ms linear; }
.rule-column li:hover { background: color-mix(in oklab, var(--brass) 28%, transparent); color: var(--enamel); }
.rule-column .n { color: var(--metal); font-variant-numeric: tabular-nums; flex: none; }
.rule-column code { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.rule-column .note { color: var(--dim); }
@media (max-width: 720px), (max-aspect-ratio: 799/1000) {
.bof-pin { display: block; }
.bof-words { position: static; width: auto; padding-top: 41vh; }
.bof-words h2 { font-size: 34px; }
.bof-now { display: none; }
.rule-column { top: auto; left: var(--gutter); right: var(--gutter); bottom: 20px; width: auto; height: 8.6em; }
}
/* chapter: point-nine-nine */
.p99-pin { justify-content: flex-start; padding-top: 11vh; }
.p99-poster { font: 400 clamp(72px, 15.8vw, 300px)/1 var(--display); letter-spacing: -.04em; white-space: nowrap; transform: translate3d(calc(var(--p, 0) * -4vw), 0, 0); }
.p99-poster code { font: inherit; }
.p99-poster::selection, .p99-poster code::selection { background: color-mix(in oklab, var(--brass) 99%, transparent); }
.p99-read { font-size: var(--size-small); color: var(--dim); }
.p99-copy { position: absolute; right: var(--gutter); bottom: 8vh; width: min(32vw, 430px); display: flex; flex-direction: column; gap: 12px; font-size: var(--size-small); }
.p99-term { font: inherit; color: inherit; background: none; border: 0; padding: 0; min-height: 44px; display: inline; cursor: help; text-decoration: underline dotted 1px; text-underline-offset: .2em; transition: color 120ms linear; }
.p99-term:hover { color: var(--brass); }
.p99-term.read { text-decoration-style: solid; }
.p99-def { max-width: 320px; font: var(--size-small)/1.5 var(--type); color: var(--blued-steel); background: var(--enamel); border: 1px solid var(--brass); padding: 14px 16px; margin: auto; }
@media (max-width: 720px), (max-aspect-ratio: 799/1000) {
.p99-pin { justify-content: flex-end; padding-bottom: 22px; }
.p99-poster { white-space: normal; font-size: 27vw; line-height: .95; }
.p99-copy { position: static; width: auto; margin-top: 12px; }
}
/* chapter: nine-thousand */
.nine-pin { padding-top: 13vh; }
.nine-head { max-width: min(15em, 54vw); font-size: var(--size-head); }
.nine-stack { position: absolute; left: 28vw; top: 38vh; width: 34vw; height: 30vh; min-width: 320px; }
.nine-parent { position: relative; }
.nine-tag, .nine-plate { position: absolute; display: flex; flex-direction: column; justify-content: flex-end; padding: 16px; width: 24vw; min-width: 220px; height: 20vh; font-size: var(--size-small); border-radius: 2px; }
.nine-tag b, .nine-plate b { font: 400 clamp(24px, 2.6vw, 36px)/1 var(--display); }
.nine-tag small, .nine-plate small { font-size: 13px; }
.nine-tag { justify-content: flex-start; left: 0; top: 0; z-index: 9999; background: var(--brass); color: var(--blued-steel); transition: transform 320ms var(--settle); }
.nine-plate { left: 8vw; top: 8vh; z-index: 1; background: var(--enamel); color: var(--blued-steel); box-shadow: inset 0 1px 0 #fff; }
.nine-act { position: absolute; right: var(--gutter); bottom: 9vh; width: min(30vw, 400px); display: flex; flex-direction: column; gap: 16px; align-items: flex-start; font-size: var(--size-small); }
.nine-after { color: var(--metal); min-height: 3em; }
@media (max-width: 720px), (max-aspect-ratio: 799/1000) {
.nine-pin { padding-top: 41vh; }
.nine-head { font-size: 26px; }
.nine-stack { position: relative; left: 0; top: 0; width: 100%; height: 27vh; margin-top: 16px; min-width: 0; }
.nine-tag, .nine-plate { width: 62vw; height: 15vh; min-width: 0; }
.nine-plate { left: 26vw; top: 8vh; }
.nine-act { position: static; width: auto; }
}
/* chapter: struck-through */
.struck-pin { justify-content: space-between; }
.struck-copy { max-width: 31ch; display: flex; flex-direction: column; gap: 12px; font-size: var(--size-small); }
.struck-lead { font: italic 400 clamp(26px, 2.6vw, 38px)/1.1 var(--display); }
.struck-count { color: var(--metal); }
.struck-word { font: 400 clamp(120px, 22vw, 400px)/.74 var(--display); letter-spacing: -.04em; margin-bottom: 2vh; }
.struck-word del { text-decoration: none; position: relative; display: inline-block; }
.struck-word del::after { content: ""; position: absolute; left: -3%; right: -3%; top: 56%; height: max(4px, .035em); background: currentColor; transform: scaleX(calc(min(var(--p, 0) * 1.7, 1))); transform-origin: left center; transition: opacity 120ms linear; }
.struck-word del:hover::after { opacity: 0; }
@media (max-width: 720px), (max-aspect-ratio: 799/1000) { .struck-word { font-size: 44vw; } .struck-pin { padding-top: 41vh; } }
/* chapter: heavier */
.heavy-pin { padding-left: 30vw; padding-top: 9vh; }
.heavy-head { font-size: var(--size-head); margin-bottom: 3vh; }
.heavy-stair { display: flex; flex-direction: column; gap: .4em; }
.heavy-stair li { display: flex; align-items: baseline; gap: 14px; opacity: 0; transform: translate3d(0, -8px, 0); transition: transform 200ms var(--settle), opacity 80ms linear; }
.heavy-stair li.on { opacity: 1; transform: none; }
.heavy-stair code { font: 400 var(--s)/1.04 var(--display); -webkit-text-stroke: var(--stroke) currentColor; overflow-wrap: anywhere; }
.heavy-stair .score { font-size: 13px; color: var(--metal); font-variant-numeric: tabular-nums; flex: none; }
.heavy-foot { margin-top: auto; display: flex; align-items: center; gap: 24px; font-size: var(--size-small); }
.heavy-btn { display: inline-flex; align-items: center; min-height: 48px; padding: 8px 18px; background: var(--enamel); border-radius: 2px; text-decoration: none; white-space: nowrap; transition: transform 90ms linear; }
.heavy-btn:hover { background: #fff; }
.heavy-btn:active { transform: translate3d(0, 2px, 0); }
@media (max-width: 720px), (max-aspect-ratio: 799/1000) {
.heavy-pin { padding-left: var(--gutter); padding-top: 41vh; }
.heavy-head { font-size: 30px; margin-bottom: 10px; }
.heavy-stair li { white-space: normal; flex-direction: column; gap: 0; }
.heavy-stair code { font-size: calc(var(--s) * .5); }
.heavy-foot { flex-direction: column; align-items: flex-start; gap: 10px; }
}
/* chapter: nobody-checked */
.nobody-pin { align-items: flex-start; justify-content: center; padding-left: 16vw; }
.nobody-press { font: italic 400 var(--size-display)/1 var(--display); letter-spacing: -.03em; }
.nobody-mid { display: flex; flex-direction: column; gap: 30px; align-items: flex-start; }
.nobody-lever { width: 96px; height: 58px; padding: 7px; border: 1px solid var(--brass); background: color-mix(in oklab, var(--wall) 60%, #000); border-radius: 2px; cursor: pointer; transition: border-color 120ms linear; }
.nobody-lever span { display: block; width: 44px; height: 42px; background: var(--brass); box-shadow: inset 0 1px 0 var(--enamel), inset 0 -3px 0 color-mix(in oklab, var(--blued-steel) 45%, var(--brass)); transition: transform 240ms var(--settle); border-radius: 1px; }
.nobody-lever:hover { border-color: var(--enamel); }
.nobody-lever:active span { box-shadow: inset 0 2px 0 color-mix(in oklab, var(--blued-steel) 45%, var(--brass)); }
.nobody-lever[aria-pressed="true"] span { transform: translate3d(38px, 0, 0); }
.nobody-result { max-width: 38ch; min-height: 7em; font-size: var(--size-small); }
@media (max-width: 720px), (max-aspect-ratio: 799/1000) { .nobody-pin { padding-left: var(--gutter); justify-content: flex-end; padding-bottom: 28px; } .nobody-press { font-size: 72px; } .nobody-lever { width: 124px; height: 72px; } .nobody-lever span { width: 58px; height: 56px; } .nobody-lever[aria-pressed="true"] span { transform: translate3d(50px, 0, 0); } }
/* chapter: the-tap */
.tap-pin { flex-direction: row; justify-content: space-between; align-items: flex-end; gap: 24px; padding-bottom: 7vh; }
.tap-left, .tap-right { width: clamp(180px, 17vw, 270px); position: relative; }
.tap-right { display: flex; flex-direction: column; gap: 22px; align-items: flex-start; }
.tap-word { font: italic 400 clamp(56px, 6.4vw, 104px)/.9 var(--display); margin-bottom: 22px; letter-spacing: -.02em; }
.tap-copy { font-size: var(--size-small); line-height: 1.5; }
.tap-blue { margin-top: 14px; font-size: 13px; color: var(--dim); }
.tap-btn { font-size: var(--size-body); }
.tap-code { display: block; font-size: 15px; color: var(--enamel); line-height: 1.4; }
.tap-result { display: flex; flex-direction: column; gap: 12px; font-size: var(--size-small); line-height: 1.5; }
.tap-result[hidden] { display: none; }
.tap-count { color: var(--dim); font-variant-numeric: tabular-nums; }
body.outlined #boxes { z-index: 1; }
@media (max-width: 720px), (max-aspect-ratio: 799/1000) {
.tap-pin { flex-direction: column; justify-content: flex-end; align-items: stretch; padding-bottom: 26px; gap: 14px; }
.tap-left, .tap-right { width: 100%; }
.tap-word { font-size: 56px; margin-bottom: 8px; }
.tap-blue { display: none; }
.tap-btn { width: 100%; justify-content: center; min-height: 56px; }
}
/* chapter: turned-over */
.over-pin { align-items: flex-start; justify-content: center; }
.over-copy { width: min(33vw, 440px); display: flex; flex-direction: column; gap: 18px; font-size: var(--size-small); }
.over-notes { display: flex; flex-direction: column; gap: 6px; color: var(--metal); }
.over-notes li { transition: color 120ms linear; }
.over-notes li:hover { color: var(--enamel); }
@media (max-width: 720px), (max-aspect-ratio: 799/1000) { .over-pin { align-items: stretch; justify-content: flex-end; padding-bottom: 24px; } .over-copy { width: auto; } .over-copy h2 { font-size: 34px; } }
/* chapter: set-screw */
.screw-pin { justify-content: center; padding-right: 38vw; }
.screw-head { font: 400 clamp(52px, 6vw, 108px)/1 var(--display); letter-spacing: -.03em; margin-top: var(--magic, -3px); position: relative; }
.screw-head code { font: inherit; font-variant-numeric: tabular-nums; }
.screw-rule { height: 1px; background: var(--brass); width: 100%; max-width: 100%; margin-top: 3px; }
.screw-copy { margin-top: 28px; display: flex; flex-direction: column; gap: 10px; max-width: 44ch; font-size: var(--size-small); }
.screw-range { -webkit-appearance: none; appearance: none; width: min(42vw, 480px); height: 44px; background: transparent; cursor: grab; }
.screw-range:active { cursor: grabbing; }
.screw-range::-webkit-slider-runnable-track { height: 3px; background: var(--brass); }
.screw-range::-moz-range-track { height: 3px; background: var(--brass); }
.screw-range::-webkit-slider-thumb { -webkit-appearance: none; width: 34px; height: 34px; margin-top: -16px; border-radius: 50%; background: linear-gradient(35deg, transparent 46%, var(--blued-steel) 46% 54%, transparent 54%), var(--brass); box-shadow: inset 0 1px 0 var(--enamel); transition: transform 120ms var(--settle); }
.screw-range::-moz-range-thumb { width: 34px; height: 34px; border: 0; border-radius: 50%; background: linear-gradient(35deg, transparent 46%, var(--blued-steel) 46% 54%, transparent 54%), var(--brass); }
.screw-range:hover::-webkit-slider-thumb { transform: scale(1.08); }
.screw-note { min-height: 1.6em; color: var(--metal); }
@media (max-width: 720px), (max-aspect-ratio: 799/1000) { .screw-pin { justify-content: flex-end; padding-bottom: 26px; } .screw-pin { padding-right: var(--gutter); } .screw-head { font-size: 10.6vw; white-space: nowrap; } .screw-range { width: 100%; } .screw-rule { width: 100%; } }
/* chapter: spare-parts */
.tray-pin { justify-content: flex-start; padding-top: 11vh; }
.tray-head { font: italic 400 clamp(56px, 6.4vw, 104px)/.95 var(--display); letter-spacing: -.03em; }
.board { position: absolute; inset: 0; }
.tag { position: absolute; background: var(--enamel); color: var(--blued-steel); padding: 26px 22px 18px 22px; display: flex; flex-direction: column; gap: 8px; font-size: var(--size-small); line-height: 1.45; border-radius: 1px; clip-path: polygon(16px 0, 100% 0, 100% 100%, 0 100%, 0 16px); box-shadow: 0 1px 1px color-mix(in oklab, var(--blued-steel) 35%, transparent); transition: transform 240ms var(--settle); }
.tag::before { content: ""; position: absolute; left: 13px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: var(--wall); box-shadow: inset 0 0 0 1px var(--brass); }
.tag::after { content: ""; position: absolute; left: 17px; top: -56px; width: 1px; height: 72px; background: var(--enamel); transform: rotate(9deg); transform-origin: bottom; }
.tag code { font: 400 clamp(21px, 2.3vw, 36px)/1.1 var(--display); overflow-wrap: anywhere; }
.tag:hover { transform: rotate(0deg) translate3d(0, 4px, 0) !important; }
.tag-a { left: 47vw; top: 12vh; width: 24vw; transform: rotate(-1.6deg); }
.tag-b { left: 73vw; top: 30vh; width: 22vw; transform: rotate(1.2deg); }
.tag-c { left: 8vw; top: 42vh; width: 25vw; transform: rotate(.9deg); }
.tag-d { left: 37vw; top: 61vh; width: 33vw; transform: rotate(-.8deg); }
.tray-foot { position: absolute; left: var(--gutter); bottom: 4vh; max-width: 30ch; font-size: var(--size-small); color: var(--metal); }
@media (max-width: 720px), (max-aspect-ratio: 799/1000) {
.tray-pin { padding-top: 72px; }
.tray-head { font-size: 58px; }
.board { position: static; display: flex; flex-direction: column; gap: 9px; margin-top: 12px; }
.tag { position: relative; left: auto; top: auto; width: 100%; padding: 12px 14px 10px 34px; gap: 2px; font-size: 13px; }
.tag code { font-size: 20px; }
.tag::after { display: none; }
.tag-a, .tag-c { transform: rotate(-.5deg); }
.tag-b, .tag-d { transform: rotate(.5deg); }
.tray-foot { position: static; margin-top: 10px; max-width: none; }
}
/* chapter: taken-in */
.taken-pin { justify-content: center; align-items: center; }
.card { background: var(--enamel); color: var(--blued-steel); width: min(760px, 92vw); padding: 52px 54px 34px; rotate: calc(-1.4deg + var(--sway, 0) * 1deg); box-shadow: 0 2px 2px color-mix(in oklab, var(--blued-steel) 45%, transparent), 0 14px 28px color-mix(in oklab, var(--blued-steel) 40%, transparent); display: flex; flex-direction: column; gap: 14px; font-size: var(--size-body); line-height: 1.5; position: relative; }
.card::before { content: ""; position: absolute; top: 12px; left: 50%; width: 11px; height: 11px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, var(--enamel), var(--brass) 45%, var(--blued-steel)); box-shadow: 0 0 0 6px color-mix(in oklab, var(--brass) 18%, transparent); }
.card-title { font: 400 clamp(32px, 3.2vw, 50px)/1.05 var(--display); }
.card-jan { font-family: var(--display); font-style: italic; font-size: 1.4em; }
.card-foot { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; align-items: center; border-top: 1px dashed currentColor; padding-top: 12px; max-width: none; font-size: 13px; }
.card-foot a { min-height: 44px; display: inline-flex; align-items: center; font-size: var(--size-small); }
.blank { display: inline-block; width: 110px; border-bottom: 1px solid currentColor; }
@media (max-width: 720px), (max-aspect-ratio: 799/1000) { .card { padding: 40px 22px 20px; rotate: 0deg; } .taken-pin { justify-content: flex-end; padding-bottom: 20px; } }
/* chapter: sixteen-point-six */
.six-pin { justify-content: space-between; align-items: flex-start; }
.six-fig { font: 400 clamp(76px, 9.4vw, 160px)/.9 var(--display); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.six-fig.over { color: var(--dry-chalk); }
.six-copy { align-self: flex-start; width: min(40vw, 500px); display: flex; flex-direction: column; gap: 12px; align-items: flex-start; font-size: var(--size-small); }
.six-px { color: var(--metal); font-variant-numeric: tabular-nums; }
@media (max-width: 720px), (max-aspect-ratio: 799/1000) { .six-copy { width: auto; align-self: stretch; } .six-fig { font-size: 21vw; } .six-pin { justify-content: flex-end; gap: 14px; padding-bottom: 24px; } }
/* chapter: the-good-part */
.good-pin { justify-content: flex-end; }
.good-words { position: absolute; left: var(--gutter); width: 48vw; top: 13vh; display: flex; flex-direction: column; gap: 10px; }
.good-now { font-size: var(--size-small); }
.good-poster { font: italic 400 var(--size-display)/.9 var(--display); letter-spacing: -.03em; }
.good-line { font-size: var(--size-small); max-width: 36ch; }
.good-gone { color: var(--metal); font-size: var(--size-small); font-variant-numeric: tabular-nums; }
.good-col { position: absolute; left: var(--gutter); bottom: 5vh; width: min(30vw, 420px); font-size: 12.5px; line-height: 1.5; overflow: hidden; max-height: 30vh; }
.good-col li { white-space: nowrap; overflow: hidden; height: 1.5em; }
.good-col li.struck { text-decoration: line-through; }
.good-col li.gone { height: 0; }
.good-col li:hover { color: var(--metal); }
@media (max-width: 720px), (max-aspect-ratio: 799/1000) { .good-words { left: var(--gutter); top: 42vh; bottom: auto; width: auto; } .good-col { left: var(--gutter); right: var(--gutter); width: auto; top: auto; bottom: 18px; max-height: 7em; } .good-poster { font-size: 72px; } }
/* chapter: no-weather */
.nw-pin { justify-content: flex-end; }
.nw-copy { width: min(38vw, 520px); display: flex; flex-direction: column; gap: 14px; font-size: var(--size-small); }
.nw-head { font: italic 400 clamp(46px, 6.4vw, 104px)/.98 var(--display); letter-spacing: -.02em; }
.nw-last { font-size: var(--size-body); color: var(--metal); }
@media (max-width: 720px), (max-aspect-ratio: 799/1000) { .nw-copy { width: auto; } .nw-head { font-size: 46px; } .nw-pin { padding-bottom: 22px; } }
/* chapter: very-dry */
.vd-pin { justify-content: flex-end; padding-bottom: 5vh; }
.vd-form { position: absolute; right: var(--gutter); top: 84px; width: min(38vw, 480px); display: flex; flex-direction: column; gap: 8px; font-size: var(--size-small); }
.vd-word { font: italic 400 clamp(52px, 6.4vw, 108px)/.95 var(--display); letter-spacing: -.02em; }
.vd-count { color: var(--metal); margin-bottom: 14px; font-variant-numeric: tabular-nums; }
.vd-fields { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.vd-fields label { font-size: var(--size-body); }
.vd-fields input { width: 100%; min-height: 48px; padding: 10px 12px; font: 16px var(--type); color: var(--blued-steel); background: var(--enamel); border: 1px solid var(--blued-steel); border-radius: 2px; caret-color: var(--brass); transition: border-color 120ms linear; }
.vd-fields input:hover { border-color: var(--brass); }
.vd-fields input::placeholder { color: color-mix(in oklab, var(--blued-steel) 45%, var(--enamel)); }
.vd-out { min-height: 3em; font-variant-numeric: tabular-nums; }
.vd-mail { font: 400 clamp(46px, 11.2vw, 200px)/.95 var(--display); letter-spacing: -.035em; text-decoration: none; white-space: nowrap; align-self: flex-end; color: var(--ink); text-shadow: 0 1px 0 color-mix(in oklab, var(--enamel) 60%, transparent); }
.vd-mail:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .08em; }
.vd-copy { font: inherit; font-size: var(--size-small); align-self: flex-end; min-height: 44px; color: inherit; background: none; border: 0; cursor: pointer; text-decoration: underline; text-underline-offset: .2em; transition: color 120ms linear; }
.vd-copy:hover { color: var(--brass); }
.vd-copy:active { translate: 0 1px; }
.plate { pointer-events: auto; position: relative; z-index: 3; background: var(--brass); color: var(--blued-steel); padding: 44px var(--gutter) 52px; display: grid; gap: 8px; font-size: var(--size-small); transform: translate3d(0, calc(var(--lever, 0) * 3px), 0); box-shadow: inset 0 1px 0 var(--enamel); }
.plate-name { font: italic 400 clamp(38px, 5vw, 76px)/1 var(--display); }
.plate-last { font-variant-numeric: tabular-nums; }
@media (max-width: 720px), (max-aspect-ratio: 799/1000) {
.vd-form { position: static; width: auto; padding-top: 40vh; }
.vd-word { font-size: 54px; }
.vd-out { min-height: 1.6em; }
.vd-mail { font-size: 10.4vw; align-self: stretch; min-height: 44px; }
}
/* short phones (about 320 x 640): the barometer still takes the top of the screen, so every chapter's words get smaller */
@media (max-width: 720px) and (max-height: 700px) {
:root { --size-body: 15px; --size-small: 13.5px; }
.fair-name { font-size: 15.5vw; margin-bottom: 10px; }
.fair-cta { margin-top: 8px; gap: 8px 14px; }
.fair-note { margin-top: 4px; }
.bof-words { padding-top: 38vh; gap: 10px; }
.bof-words h2 { font-size: 26px; }
.rule-column { height: 6em; bottom: 14px; }
.nine-pin { padding-top: 38vh; }
.nine-head { font-size: 20px; max-width: none; }
.nine-stack { height: 19vh; margin-top: 10px; }
.nine-tag, .nine-plate { height: 11vh; padding: 10px 12px; }
.nine-plate { top: 6vh; }
.nine-act { gap: 10px; }
.nine-after { min-height: 0; }
.struck-pin { padding-top: 38vh; padding-bottom: 20px; }
.struck-copy { gap: 8px; }
.struck-lead { font-size: 24px; }
.struck-word { font-size: 30vw; }
.heavy-pin { padding-top: 38vh; padding-bottom: 18px; }
.heavy-head { font-size: 24px; margin-bottom: 6px; }
.heavy-stair { gap: .2em; }
.heavy-foot { gap: 6px; }
.heavy-btn { min-height: 44px; }
.tray-pin { padding-top: 64px; padding-bottom: 14px; }
.tray-head { font-size: 40px; }
.board { gap: 6px; margin-top: 8px; }
.tag { padding: 8px 12px 8px 32px; font-size: 12px; line-height: 1.35; }
.tag::before { top: 11px; }
.tag code { font-size: 17px; }
.tray-foot { margin-top: 6px; font-size: 12px; }
.card { padding: 26px 18px 14px; gap: 8px; font-size: 13.5px; }
.card-title { font-size: 24px; }
.card-jan { font-size: 1.25em; }
.taken-pin { padding-bottom: 14px; }
}
/* landscape phones (about 844 x 390): the wide layout stays, with smaller type so each chapter fits the short screen */
@media (min-aspect-ratio: 1/1) and (max-height: 520px) {
:root { --size-body: 14px; --size-small: 12.5px; --size-head: 30px; --size-display: 64px; }
.pin { padding-top: 64px; padding-bottom: 16px; }
.fair-name { font-size: min(12.6vw, 17vh); margin-bottom: 2vh; }
.fair-pin { padding-bottom: 4vh; }
.fair-copy { gap: 2px; }
.fair-cta { margin-top: 6px; }
.fair-note { margin-top: 4px; }
.nine-tag, .nine-plate { height: 18vh; padding: 10px 12px; }
.struck-word { font-size: min(22vw, 30vh); }
.heavy-head { margin-bottom: 1vh; }
.heavy-stair code { font-size: calc(var(--s) * .62); }
.heavy-btn { min-height: 40px; }
.tray-head { font-size: 44px; }
.tag { padding: 18px 14px 10px; font-size: 12px; }
.tag code { font-size: 20px; }
.card { padding: 22px 28px 12px; gap: 6px; font-size: 13px; }
.card-title { font-size: 24px; }
.card-foot a { min-height: 36px; }
.six-fig { font-size: 64px; }
.good-poster { font-size: 64px; }
.nw-head { font-size: 44px; }
.vd-form { top: 60px; gap: 4px; }
.vd-word { font-size: 40px; }
.vd-count { margin-bottom: 4px; }
.vd-out { min-height: 1.5em; }
.vd-mail, .vd-copy { align-self: flex-start; }
.vd-mail { font-size: 5.4vw; }
}
```
## 6. The supplied world module
`world.js` is an ES module. It imports three.js from `./vendor/three/three.module.js`, creates the global `window.W`, reads `document.styleSheets`, builds the barometer and starts one `requestAnimationFrame` loop. You do not edit it. You only need to know what it does and which parts of `W` the chapter code uses.
What it does on its own:
- **Rules and the needle.** `W.countRules()` counts every CSS rule on the page, nested rules included. A schedule of rules is inserted into and removed from `<style id="weather">` as the scroll position moves: its own 30 "fix" rules arrive in chapter 2 and every scheduled rule leaves again in chapter 14 ("Deleting."). The rule count turns into inches of mercury between 27.85 and 31.05, and the inches into a dial word: below 28.6 Stormy, below 29.3 Rain, below 29.8 Change, below 30.4 Fair, otherwise Very Dry. The header shows `<count> CSS rules` in `#count` and the word in `#forecast`, and the tab title becomes `<word>. Maya Okafor, frontend developer`. The needle eases to its angle with a little momentum, and the small sky disc below the hub turns to the picture that matches the word.
- **Chapter time.** `W.t` is the chapter index plus the progress through that chapter, for example 7.5 halfway through the eighth chapter. Under reduced motion it snaps to the middle of each chapter. Each frame it sets `--p` on the current section, `1` on earlier ones and `0` on later ones, toggles `.on` on the current section, and toggles `body.past-open` once `W.t > 0.7`.
- **Camera.** Two keyframe tables (wide screens, and narrow screens where width / height < 0.8) give the camera position, the look target, the barometer's turn, how far the glass front opens and how far the back hinges open, all eased with smoothstep between keys. The barometer swings slightly with the pointer and with scroll speed.
- **Weather.** Between `W.t` 5.9 and 8.4 a storm darkens the light; from 13 the page dries: `--wall` becomes `--dry-chalk`, `--ink` and `--metal` become `--blued-steel`, and the theme colour becomes `#d9d3bf`. From 14.4 the scene turns to day.
- **Keyboard and focus.** Keys 1 to 9 scroll to the first nine chapters; focusing an element inside a chapter scrolls that chapter into view.
- **Fallback.** If WebGL cannot start, it logs a warning, adds `body.no-gl` and keeps the SVG poster; the needle in the poster still follows the rule count. The rest of the page works.
The `W` interface the chapter code uses:
| Member | What it is |
|---|---|
| `W.t` | Chapter time, as above |
| `W.reduced` | `true` when the visitor prefers reduced motion |
| `W.store.get(key)`, `W.store.set(key, value)` | `localStorage` under the prefix `barometer.`, safe in private windows |
| `W.say(text)` | Writes into the polite live region `#say` |
| `W.schedule` | Array of rule records `{ id, css, add, rem, shown?, legacy?, off? }`. A rule is live while `add <= W.t < rem` and `off` is not set. You may `push` records into it |
| `W.addRule(id, css, add, rem = 13.2)` | Shortcut that pushes a record |
| `W.live` | Array of the ids currently inserted, in stylesheet order |
| `W.syncRules(t)` | Inserts and removes rules for time `t`; returns `true` when something changed |
| `W.onRulesChanged()` | Recounts, moves the needle, updates the header, then calls every listener |
| `W.toggleRule(id, css, on)` | Adds or removes a hand-toggled rule at the end of the weather sheet, then calls `onRulesChanged` |
| `W.listeners` | A `Set` of functions. Each is called with no argument after the rules change, and with `true` once per frame |
| `W.onFrame(fn)` | Calls `fn(dt)` every frame (dt in milliseconds, capped at 64) |
| `W.specificity(selector)` | Returns `[ids, classes, types]` |
| `W.chapterIndex(id)` | Index of the section whose `data-chapter` is `id` |
| `W.progressOf(id)` | That chapter's progress, clamped to 0 to 1 |
| `W.count`, `W.arrival` | Rule count now, and the count when the page arrived |
| `W.storedLast` | The rule count saved on the visitor's previous visit, or `null` |
| `W.outline`, `W.setOutline(on)` | Red outline mode: toggles `body.outlined`, the rule `* { outline: 1px solid red; }`, and red boxes drawn around every part of the barometer on `#boxes` |
| `W.boxedParts` | How many barometer parts got a red box in the last frame |
| `W.tapKick`, `W.shake` | Set them to kick the needle and shake the camera; the loop decays them |
| `W.velocity` | Smoothed scroll speed in pixels per frame |
| `W.pointer` | Pointer position, `x` and `y` from -0.5 to 0.5 |
| `W.frame` | `{ dt, pixels }`: smoothed frame time in ms and the canvas pixel count |
| `W.stage` | `null` until WebGL is up (and when it fails). Then `W.stage.scene` (three.js scene), `W.stage.normalMat` (a normals material) and `W.stage.inst` (the instrument) |
| `W.stage.inst.setStruck(on)` | Draws a strike through the word Fair on the dial |
| `W.stage.inst.ringAtTwo` | The screw at two o'clock on the bezel (a three.js object) |
| `W.stage.inst.backScrew` | The set screw on the back plate (a three.js object) |
Always guard with `W.stage?.` because WebGL may be missing or still loading.
## 7. Chapter code
Create `site.js`. Its first line is `import './world.js';`. Then one block per chapter, in page order, each wrapped in its own `{ ... }` so that names like `btn` or `paint` do not clash, each preceded by a comment `/* chapter: <name> */`. Three chapters (`turned-over`, `spare-parts`, `no-weather`) need no code. All copy below is exact; the curly apostrophes are part of it.
### fair
If `W.storedLast` is set, un-hide `#fair-return` and set its text to `You left this page at <W.storedLast> rules.`
### bottom-of-the-file
Define `W.ruleRows = () => W.schedule.filter((r) => r.shown)` (the 30 fix rules `world.js` marks as shown). Write a `render()` added to `W.listeners`:
1. Take the shown rules whose id is in `W.live`. If their number equals the number of children of `#rule-column`, return.
2. Otherwise empty `#rule-column` and, for each rule, append an `li` holding: a `span.n` with the rule's 1-based position in `W.live`, padded to three digits (`007`); a `code` with the CSS before any `/*` comment, trimmed; and, when the CSS has a comment, a `span.note` with `/*` plus the comment. Set the `li`'s `title` to `Specificity a, b, c` from `W.specificity` of the selector (the part before `{`).
### point-nine-nine
`W.addRule('p99', '#p99 { opacity: .99; }', 1.97)`. Add a listener that writes `getComputedStyle(#p99).opacity` into `#p99-read`. Clicking `.p99-term` adds the class `read` (the popover itself is native HTML).
### nine-thousand
Push the rule `{ id: 'z-op', css: '#z-parent { opacity: .99; }', add: 2.9, rem: 13.25 }` into `W.schedule`. If `W.store.get('z-deleted') === '1'`, set its `off` to `true`.
`paint()`: the button `#z-btn` reads `Put it back` when the rule is off and `Delete opacity: .99` when on; `#z-after` is hidden unless off; `#z-tag` gets `transform: translate3d(0, 0, 0) scale(1.03)` when off and no inline transform when on; `#z-tag-read` shows `computed: ` plus the computed `z-index` of `#z-tag`, `#z-plate-read` the same for `#z-plate`.
Button click: flip `off`, store `'1'` or `'0'` under `z-deleted`, call `W.syncRules(W.t)`, `W.onRulesChanged()`, `paint()`, then `W.say('Rule deleted. The 9999 is in front now.')` or `W.say('Rule restored. The 9999 is behind the 1 again.')`. Add a listener that calls `paint()` only when called without an argument.
### struck-through
Add four rules with `W.addRule('st' + i, '#struck-word { color: var(--ink); }', 3.2 + i * .12)` for i = 0 to 3. A `count()` listener (only when called without an argument) walks every stylesheet's top-level rules (skip sheets that throw) and counts rules that have a `selectorText`, a `style.color`, and whose selector `#struck-word` matches. If more than one, `#struck-read` reads `<n> rules set the colour of this word. One wins.`, otherwise it is empty. Every frame, call `W.stage?.inst.setStruck(W.t >= 4.45 && W.t < 13.55)`.
### heavier
Six steps, selector and declaration:
1. `.btn` / `color: blue`
2. `.nav .btn` / `color: navy`
3. `div.nav a.btn` / `color: blue`
4. `#app div.nav a.btn` / `color: navy`
5. `#app div.nav a.btn` / `color: blue !important`
6. `#app#app div.nav a.btn` / `color: navy !important`
For each step i: the CSS is `selector + ' { ' + declaration + ' }'`; push `{ id: 'h' + i, css, add: 5.08 + i * .13, rem: 13.3 + i * .01 }` into `W.schedule`. Append to `#stair` an `li` with custom properties `--s: min(Apx, Bvw + 12px)` where A is 20, 26, 34, 44, 56, 70 and B is 1.5, 1.9, 2.5, 3.2, 4, 5, and `--stroke` of 0, 0, .3, .6, 1, 1.5 px. Inside: a `code` with the CSS and a `span.score` with the specificity joined by `, `, plus ` !` when the declaration has `!important`.
Every frame: an `li` gets class `on` while `W.t >= add` and its rule is not off; the last such index wins. When the winning index changes, and on the very first frame, `#heavy-sample` reads `Button` when none, otherwise `Winning: rule <n> of 6` (so the link is never empty). Clicking `#heavy-sample` (prevent the default jump) flips `off` on the sixth rule, then `W.syncRules(W.t)`, `W.onRulesChanged()`, and forces the label to refresh.
### nobody-checked
State `on` starts as `W.store.get('lever') === '1'`; `pull` starts at 0. `paint(arrived)`: set `aria-pressed` on `#lever` to the state, set the root custom property `--lever` to 1 or 0, and set `#lever-note` to empty when off; when on, to `Still down from last time. Look at the screw at two o’clock on the bezel.` if `arrived`, otherwise `Something moved, and it wasn’t here. Look at the screw at two o’clock on the bezel. If you get to the bottom of the page, check the plate too.`
Click: flip, store `'1'`/`'0'` under `lever`, `W.toggleRule('lever', ':root { --lever-rule: 1; }', on)`, `paint(false)`. On load, call `paint(on)` but do not call `W.toggleRule` yet: `world.js` only knows the needle's scale once its loop has started, and calling it at load throws and stops every chapter after this one. Instead, on the first frame (inside the `W.onFrame` callback, once), if the lever is still on, apply the same toggleRule. Every frame, ease `pull += (target - pull) * .1` toward 1 or 0 and, if `W.stage?.inst.ringAtTwo` exists, set its `position.z = .128 + pull * .028` and `rotation.z = pull * 1.57`.
### the-tap
`apply(on, fromScroll)`: `W.setOutline(on)`; `.tap-result` hidden unless on; `#tap` reads `Tap again to clear it` or `Tap the glass` and gets `aria-pressed`. When on: `W.tapKick = W.reduced ? 0 : -.05` and `W.shake = W.reduced ? 0 : .017`; unless `fromScroll`, call `navigator.vibrate?.(12)`; after two animation frames count `document.querySelectorAll('*').length` and set `#tap-count` to `<elements> page elements. <W.boxedParts or 0> instrument parts.` and say `Outlined <elements> page elements and <parts> instrument parts.` When off, say `Outlines cleared.`
Click: remember the visitor has tapped, then `apply(!W.outline, false)`. Every frame, only while the visitor has never tapped: when the current chapter is at or past `the-tap` and its progress is over .55, turn outlines on automatically (`apply(true, true)`); turn the automatic outlines off again when `W.t` passes `chapterIndex('turned-over') + .7` or falls back below `chapterIndex('the-tap') + .3`.
### set-screw
The range `#screw` runs from -8 to 4. On input, read the value; if it is within .15 of -3, snap it back to exactly -3; that is the goal. Every frame: ease `turned += (goal - turned) * .4`; `#screw-val` shows `-3` at -3, otherwise the goal with one decimal (and `0` within .05 of zero); set `--magic` on `#screw-head` to `turned` px with two decimals (the CSS uses it as the heading's margin, so the line moves); `#screw-note` is `That is not what it was.` whenever the goal is not -3, otherwise `The other lever’s still down, by the way.` if the stored lever is down, else empty. Rotate `W.stage?.inst.backScrew` to `rotation.z = (turned + 3) * .55`.
### taken-in
Every frame, ease `sway` toward `clamp(W.velocity * .012, -1, 1)` by .12 and write it to `--sway` on `#card` with three decimals. When `W.t >= 11` and `#card-no` is empty, fill it with `W.count`; when `W.t < 11`, empty it.
### sixteen-point-six
The button `#six-hold` shows the brass as surface normals while held: `set(on)` changes the label to `Let go to get the brass back` or `Hold to see the surface normals` and sets `W.stage.scene.overrideMaterial` to `W.stage.normalMat` or `null`. Pointer down sets on; pointer up, leave or cancel sets off unless it was toggled by keyboard. Space or Enter (prevent default) toggles and keeps it.
Every frame: if the current chapter is not this one, release it (clear the keyboard toggle too) and reset `W.stage.scene.environmentRotation.y` to 0, then stop. Otherwise set `environmentRotation.y = W.pointer.x * 1.1`, and every 15th frame write `W.frame.dt` with one decimal into `#six-ms`, toggle class `over` on `.six-fig` when it is above 16.8, and write `W.frame.pixels` formatted with `toLocaleString('en-GB')` into `#six-px`.
### the-good-part
Build the list `#good-col` from `W.ruleRows()` followed by the first 12 legacy rules (`W.schedule` records with `legacy`); each `li` holds the rule's CSS before any comment. Track whether the pointer is over the list. Every frame, only while `12.9 <= W.t <= 14.2`: each `li` gets class `struck` from `W.t >= rem - .05` (not while hovered) and class `gone` from `W.t >= rem`; `#good-gone` shows how many scheduled rules have `W.t >= rem`.
### very-dry
- `#vd-copy` copies `maya@example.com` with the Clipboard API and reads `Copied.`; if that fails, `Select the address and copy it by hand.`; after 1.8 s it returns to `Copy the address`.
- Typing in `#vd-sel` (trimmed): empty clears `#vd-out`. If `document.querySelector(value)` throws, show `That doesn’t parse as a selector yet. Check for a stray bracket.` Otherwise show `Specificity a, b, c.` and, when the id count is 3 or more, add ` That one is a confession.`
- Submitting the form (prevent default) opens `mailto:maya@example.com` with subject `CSS, sent from the barometer` and, when a selector was typed, the body `My worst selector:` + blank line + the selector + blank line, both URL-encoded.
- A listener (only without an argument) writes `W.count` into `#plate-count`, and sets `#vd-count` to `This page started with <W.arrival> CSS rules. It has <W.count> now.` while the count is below the arrival count, otherwise empty.
## 8. Interactions to confirm by hand
1. First screen: the name, two lines about Maya (what she does, then the CSS line), the brass button `Write to Maya` with `Taking new work.` beside it, and the brass barometer on the right (on a phone, on top). The header shows a live rule count and a dial word.
2. Scroll slowly: rule lines appear in a numbered column, the count rises, the needle falls through Change and Rain, and the camera moves to new parts of the barometer for each chapter.
3. `Delete opacity: .99` brings the 9999 tag in front of the 1 plate; `Put it back` reverses it. Every button stays clickable through the whole of its chapter, including the second half.
4. The lever turns the screw at two o'clock on the bezel. Reload with the lever down: the page still works to the end and the lever note says it is still down.
5. `Tap the glass` outlines every element in red and boxes every part of the barometer; the needle jumps.
6. The barometer turns round and the back opens on scratched notes; the set screw slider moves the heading line and turns the screw on the back.
7. Holding `Hold to see the surface normals` repaints the brass in rainbow normals.
8. In `Deleting.` rules are struck and removed, the count drops, the needle climbs to Very Dry and the wall dries to chalk.
9. Pasting `#app div.nav a.btn:hover` shows `Specificity 1, 3, 2.`; the email copies.
## 9. Verify, then show the result
Serve the folder (section 1) and open it. Check desktop near 1440 x 900, a portrait tablet near 768 x 1024, and phones near 390 x 844 and 320 x 640 for horizontal overflow, words over the barometer, missing files, console errors and any request to another domain. Scroll the whole page once at each size; with a browser tool, check the interactions in section 8. If WebGL is unavailable where you test, say so: the page then keeps the drawn barometer.
Finish by telling the person the local address, what you built and tested, the tool and model you are, and anything missing or different. Do not call the result pixel-identical to the demo at https://sitepeel.dev/website-prompts/barometer-portfolio/preview/.Opening the page…