diff --git a/README.md b/README.md index 93a81cf..96894d7 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Limits

-One commit gate and five skill files for coding agents. +One commit gate and ten skill files for coding agents. The gate is the part that cannot be ignored: it rejects a commit or a pull request whose message does not carry the five-key slice report. The skills describe how to produce one. @@ -56,17 +56,16 @@ npm run gate:check -- pr-body.md ## The skills -| Skill | Owns | Fires when | +| Group | Skills | Fires when | | --- | --- | --- | -| **`steerloop`** | Interaction gates: when to stop, what a slice is, what the report contains | Every coding task, at the start | -| **`craftloop`** | Engineering depth: spec, architecture, security, verification, git and PR delivery | Substantial work | -| **`webperf`** | Web performance: symptom to one fix with the instrument that proves it | A slow page, or a change touching loading, bundles, images, queries | -| **`landing-page-design`** | Landing pages end to end: intake, structure, copy, and a fixed visual system | Building or reviewing a marketing page, section, or component | -| **`figma-designer`** | Designing inside Figma with variables, text styles and auto layout | Work on a Figma file through the Figma MCP | +| Process | `steerloop`, `craftloop`, `be-ambitious` | Every coding task; substantial work; a request worth deepening rather than enlarging | +| Web | `webperf` | A slow page, or a change touching loading, bundles, images, queries | +| Design | `landing-page-design`, `figma-designer`, `hallmark`, `anatomy`, `beautify-github-readme` | A landing page, a Figma file, an anti-slop visual pass, an isometric figure, a repository README | +| Prose | `stop-slop` | Drafting, editing or reviewing text | -`craftloop` is vendored here with two sentences changed: an unanswered gate counts as a blocker, and a value the request does not state is the user's decision rather than a default to invent. +`steerloop` is the only one this repository measures. `craftloop` is included with two sentences changed: an unanswered gate counts as a blocker, and a value the request does not state is the user's decision rather than a default to invent. -`landing-page-design` and `figma-designer` are MIT, copied verbatim from their author at a pinned commit. Provenance and license: [`THIRD_PARTY_NOTICE.md`](./THIRD_PARTY_NOTICE.md). +The rest are vendored under MIT at pinned commits, copied verbatim. Provenance, licenses and what was left out: [`THIRD_PARTY_NOTICE.md`](./THIRD_PARTY_NOTICE.md). ## How it works @@ -142,8 +141,8 @@ skills/craftloop/SKILL.md the method skills/craftloop/references/ security rules, loaded on demand skills/webperf/SKILL.md web performance router skills/webperf/references/ 31 recipes, one per symptom -skills/landing-page-design/ vendored, MIT, see THIRD_PARTY_NOTICE.md -skills/figma-designer/ vendored, MIT, see THIRD_PARTY_NOTICE.md +skills/* five original, five vendored +THIRD_PARTY_LICENSES/ MIT texts for the vendored skills gate/steerloop-gate.mjs the report validator gate/steerloop-gate.test.mjs 26 tests, run by npm test .githooks/commit-msg hook that calls the validator diff --git a/THIRD_PARTY_LICENSES/dannymac180-skills.txt b/THIRD_PARTY_LICENSES/dannymac180-skills.txt new file mode 100644 index 0000000..dd2f6a5 --- /dev/null +++ b/THIRD_PARTY_LICENSES/dannymac180-skills.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Dan McAteer + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/THIRD_PARTY_LICENSE b/THIRD_PARTY_LICENSES/elaya-ai-design-skills.txt similarity index 100% rename from THIRD_PARTY_LICENSE rename to THIRD_PARTY_LICENSES/elaya-ai-design-skills.txt diff --git a/THIRD_PARTY_LICENSES/hardikpandya-stop-slop.txt b/THIRD_PARTY_LICENSES/hardikpandya-stop-slop.txt new file mode 100644 index 0000000..e0ede9b --- /dev/null +++ b/THIRD_PARTY_LICENSES/hardikpandya-stop-slop.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Hardik Pandya + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/THIRD_PARTY_LICENSES/nutlope-hallmark.txt b/THIRD_PARTY_LICENSES/nutlope-hallmark.txt new file mode 100644 index 0000000..f4bfc53 --- /dev/null +++ b/THIRD_PARTY_LICENSES/nutlope-hallmark.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Hallmark contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/THIRD_PARTY_LICENSES/oil-oil-beautify-github-readme.txt b/THIRD_PARTY_LICENSES/oil-oil-beautify-github-readme.txt new file mode 100644 index 0000000..80fa9b5 --- /dev/null +++ b/THIRD_PARTY_LICENSES/oil-oil-beautify-github-readme.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 oil-oil + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/THIRD_PARTY_LICENSES/wheresryan22-anatomy.txt b/THIRD_PARTY_LICENSES/wheresryan22-anatomy.txt new file mode 100644 index 0000000..aa20733 --- /dev/null +++ b/THIRD_PARTY_LICENSES/wheresryan22-anatomy.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Ryan + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/THIRD_PARTY_NOTICE.md b/THIRD_PARTY_NOTICE.md index 9ce5197..3b471a0 100644 --- a/THIRD_PARTY_NOTICE.md +++ b/THIRD_PARTY_NOTICE.md @@ -1,13 +1,21 @@ # Third-party notices -## landing-page-design, figma-designer +Skills vendored from other repositories. All are MIT; the license text for each is in `THIRD_PARTY_LICENSES/`. -- Source: https://github.com/elayadesign/ai-design-skills -- Commit: `456d9e0d3e2d84c748bb143c6ca3d90c45e16213` (2026-11-02) -- Copyright (c) 2026 Elaya -- License: MIT, full text in `THIRD_PARTY_LICENSE` -- Files are copied verbatim and are not modified here. +| Vendored skill | Source | Commit | License file | +| --- | --- | --- | --- | +| `landing-page-design`, `figma-designer` | elayadesign/ai-design-skills | `456d9e0` | `elaya-ai-design-skills.txt` | +| `be-ambitious` | DannyMac180/skills | `7dc63b7` | `dannymac180-skills.txt` | +| `hallmark` | nutlope/hallmark | `407fa68` | `nutlope-hallmark.txt` | +| `stop-slop` | hardikpandya/stop-slop | `8da1f03` | `hardikpandya-stop-slop.txt` | +| `anatomy` | wheresryan22/anatomy | `1482e84` | `wheresryan22-anatomy.txt` | +| `beautify-github-readme` | oil-oil/beautify-github-readme | `d6562a5` | `oil-oil-beautify-github-readme.txt` | -Both skills are self-contained: `landing-page-design` carries its own visual -system, `figma-designer` extends the official Figma skills and expects the -Figma MCP server to be available. +Files are copied verbatim and not modified here. + +Deliberate omissions, to keep the repository small: + +- `anatomy` ships without `examples/` (A4 PDFs and demo HTML, 10 MB). +- `hallmark` ships with its theme images, because the theme references point at them. + +`steerloop`, `webperf` and the gate are original to this repository. `craftloop` belongs to its author and is included with two sentences changed, noted in the README. diff --git a/assets/readme/build_hero.py b/assets/readme/build_hero.py index 67e616b..748546d 100644 --- a/assets/readme/build_hero.py +++ b/assets/readme/build_hero.py @@ -43,7 +43,7 @@ def hero() -> None: canvas.paste(panel, (500, 16), panel) d = ImageDraw.Draw(canvas) - d.text((72, 104), "AGENT SKILLS · FIVE FILES", font=font("consola.ttf", 17), fill=MUTED) + d.text((72, 104), "AGENT SKILLS · TEN FILES", font=font("consola.ttf", 17), fill=MUTED) d.text((72, 146), "steerloop", font=font("segoeuib.ttf", 92), fill=FG) d.text((74, 262), "One slice at a time. The agent asks", font=font("segoeui.ttf", 25), fill=(201, 205, 210)) d.text((74, 296), "before it writes code.", font=font("segoeui.ttf", 25), fill=(201, 205, 210)) @@ -55,7 +55,7 @@ def hero() -> None: d.text((90, 362), cmd, font=cf, fill=ACCENT) d.line([(72, 420), (72 + tw + 36, 420)], fill=(58, 58, 58)) - d.text((72, 430), "steerloop · craftloop · webperf · landing-page-design · figma-designer", font=font("consola.ttf", 14), fill=DIM) + d.text((72, 430), "10 SKILLS · MIT · npx skills add lukavtz/steerloop", font=font("consola.ttf", 14), fill=DIM) canvas.save(HERE / "hero.png", optimize=True) diff --git a/assets/readme/hero.png b/assets/readme/hero.png index ce77951..3b9cecd 100644 Binary files a/assets/readme/hero.png and b/assets/readme/hero.png differ diff --git a/package.json b/package.json index 681fceb..553de08 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "gate", ".githooks", "THIRD_PARTY_NOTICE.md", - "THIRD_PARTY_LICENSE", + "THIRD_PARTY_LICENSES", "README.md", "LICENSE" ] diff --git a/skills/anatomy/SKILL.md b/skills/anatomy/SKILL.md new file mode 100644 index 0000000..36f22e4 --- /dev/null +++ b/skills/anatomy/SKILL.md @@ -0,0 +1,185 @@ +--- +name: anatomy +description: Build crafted, highly detailed, interactive isometric SVG figures that explain a technical idea as a real physical object (a test rig, a dial gauge, a cabinet of drawers, a plotter, a lock), with many small precise solid parts, four-tone shading, correct painter's order, a framed card with title, hint and live readout, and calm eased motion. Use this whenever someone wants an isometric illustration, an explanatory diagram or figure for docs, a blog post, a landing page or an article, a "Linear-style" or "premium" technical drawing, an interactive explainer, or an SVG that shows how a system, algorithm or component works, even if they never say "isometric". Works framework-free (TypeScript/JS that writes SVG and HTML) and in React/Next.js, and can add realistic WebGL shaders (fire, exhaust, water, caustics, lamp light) that live inside the drawing in the same isometric perspective. Also prints a figure as an A4 PDF (poster, drawing or handout) and publishes it to the Anatomy community gallery when asked. +license: MIT +compatibility: Written for Claude Code; also runs in Antigravity, OpenCode, Codex and MiniMax Code. Needs Node.js 20.10+, and Chrome or Chromium for the checks. +metadata: + opencode/slash: "true" +--- + +# Anatomy + +This skill makes figures like a small instrument on a bench: a heavy base on feet, rails with tick rulers, a carriage on bushings, knurled knobs, coil springs, a dial gauge whose needle moves, screws as tiny dots. The reader understands the idea because they recognise the machine. Every number the figure shows comes from the same model that moves its parts. + +Eight complete examples ship with the skill. Open the closest one before you start. Each framework-free example is built with `node examples//build.mjs`, which writes a standalone HTML page next to the script; add `--light` for the light theme. + +- `examples/dial-indicator/` is the smallest: a dial gauge on a stand, about 300 lines in all. +- `examples/desk-computer/` is framework-free SVG: a desk computer with a keyboard you can type on. The typed line appears on a CRT screen drawn in the plane of the case front, and the picture collapses to a line and a dot when you switch it off. It has about 85 solids and 850 paths. +- `examples/arcade-cabinet/` is an upright arcade cabinet with its side panel off, a Hero of about 240 solids and 15 cables. A quarter flies into the slot, rolls down the coin chute at the speed a rolling disc reaches on a 30° slope, trips the coin-switch wire and drops into the cash box; the switch's pulse runs chunk by chunk along its cable to the board, and the CRT warms up, self-tests and runs an attract mode drawn in the plane of the tilted monitor. The stick tilts and closes a microswitch under the panel. It shows how to place a camera so a cutaway's mechanism stays in view, a concave board drawn as a prism along any axis, moving parts rebuilt in the page from the same module the build uses, and live coins and a wire drawn in reserved slots of the settled order. `node build.mjs --audit` proves the geometry. +- `examples/raptor-engine/` is a rocket engine hanging in a test stand. Its round parts come from `kit/lathe.mjs` and its pipes and harness from `kit/tube.mjs`. It comes apart into 11 assemblies with staggered springs and per-frame depth re-sorting. Every part records its true shape, and `node build.mjs --audit` (`kit/audit.mjs`) proves, at rest, apart and in every replayed frame of the explode, that nothing passes through anything, that every end sits on a real mount, that no bend pinches, folds or lands on another line, that no curved profile's slope wobbles, and that every overlap is drawn in depth order. A WebGL plume, shock, splash and steam render between the back and front SVG. It is the reference for dense pipework, smooth shading and fades. +- `examples/ripple-tank/` is a school ripple tank on tall legs over a paper screen, seen from 44° up. Two WebGL layers (lamp light, shadows and caustics on the paper, and the water's reflections and glass) are registered to the isometric planes and driven by a pure dispersion and optics model (`model.mjs`); a frequency change travels out from the dippers through a history texture. +- `examples/test-rig/` is a production figure from a real site (React/Next): a glass button on a spring-mounted carriage, a finger probe on a rail that presses and pulls, and a dial gauge reading the lean. It has 53 solids and about 470 paths. +- `examples/spot-plate/` is a second production figure from the same site: six pairs of glass drops on a spot plate, each pair drawn from one distance field, so a pair closer than `merge` runs together into one piece of glass. A fan of feeler blades sets `merge`, one blade per gap. It is the reference for shapes that morph into each other and for one control driving many parts. +- `examples/turning-dial/` is the optional 3D mode: a combination dial that turns in true 3D with a small robot hand on it. It has about 90 live parts in metal materials, a second turn group, a hinge, a three-hinge finger that lifts and a pod that breaks off as a free body. A WebGL LED, its light pool and sparks follow the moving parts. `stress.mjs` beside it is a dense hand of about 380 parts in a cluttered workshop, used to measure performance. + +The test rig is the quality bar for the drawing itself. The Raptor is the bar for shader work: a WebGL effect has to reach its standard of world-space, no-pop, seamless rendering. + +## The one idea that matters + +**The object is the explanation.** Don't draw boxes, arrows and labels. Invent a real, well-made physical thing whose working *is* the concept. Here is how earlier figures mapped: + +| Concept | Object | +|---|---| +| One shared GPU context serving many canvases | A gantry plotter: one print head visiting 16 wells | +| A cache key that skips work when nothing changed | A pin-tumbler lock: when every pin matches, the plug turns and nothing is redrawn | +| Seven render targets with different bytes per texel | A chest of seven drawers, each as deep as its bytes | +| A separable blur (49 × 49 taps vs 49 + 49) | A bed-of-nails stamp beside two combs on rails | +| A spring that presses and leans | A test rig with springs, a probe and a dial gauge | +| A height profile | A profile (contour) gauge pressed against the edge | +| Light that depends on facing | A small photo studio: key and fill lamps around a turntable | + +Two ways this fails, both seen in practice: + +- **Too abstract.** Stacked plates, floating slabs or labelled boxes don't read as anything. +- **Too flat and bland.** One big slab with a few lines on it has no volume, no parts and nothing to discover. + +The fix for both is the same: a recognisable machine, built from many small, precise, purposeful parts. + +**Every creation is highly detailed.** This holds for every figure, however small the idea or the request: a quick explainer is still a dense, real machine, never a few slabs. What scales with the size (workflow step 1) is how far you push it: a Figure gets the 4× sweep over its subject and mechanism, a Hero or an Epic over the whole drawing. +- **Read the real thing.** Build it the way the real object is built: every screw, seam, bevel, bushing, label plate, cable with its connector, scale with its ticks, and the parts that hold the parts. +- **Two looks.** At 1× it reads as one clear machine. At 4× every region still has something true to find; a bare face or an empty corner is unfinished work, not calm. +- **Purposeful, never noise.** Detail comes from parts that belong to the mechanism. Each one sits on another part, ends on an edge, and fades rather than stops. +- **Check it last.** Before you finish, zoom to 4× (over the subject and mechanism for a Figure, the whole drawing for a Hero or an Epic) and add the real parts that are missing wherever a region is plain. + +## Workflow + +Work in this order. Write the concept and the parts list before any geometry. Most of the quality is decided there. + +1. **Size it before you start.** Name the size before any other work, and tell the user roughly how long it will take when the tier below calls for an estimate. + - **Figure**: one mechanism, 40–80 parts, SVG with at most one WebGL layer. Name the size and build it without asking. Do not quote a time to the user, since a Figure often finishes in well under an hour. For the progress checks below, budget up to an hour. + - **Hero**: a dense object, several WebGL layers or one 3D subject, 80–150 parts. About 2–4 hours. Say so, then build it unless the user asked for something quick. + - **Epic**: a whole vehicle, building or plant with many moving systems, or the 3D mode on more than one subject. 6 hours or more. Do not start it. Give the estimate, propose a Hero version that keeps the core of the idea, and list what the full version would add. Build the Epic only when the user chooses it. + - Whatever the size, have a working page that opens in the browser within the first hour, and deepen it from there. Run `date` at the start and at each step, and when a step runs past twice its share of the estimate, tell the user where it stands and what is left. +2. **Truth first.** Collect the real numbers and behaviour of the thing being explained: sizes, counts, thresholds, curves. The readout, motion and caption must all be true. If you can, write the model as a small pure module, like `rig.ts` in the test-rig example, and drive everything from it. +3. **Invent the object.** Pick a machine, tool, instrument or piece of furniture whose mechanism maps one-to-one onto the concept. Say in one sentence what moves and what that motion means. Never copy a reference image: take its finish, not its object. +4. **Parts list.** Write at least 40 parts (40–80 for a Figure, 80–150 for a Hero, more for an Epic), grouped: base (plate, feet, groove, corner screws, label plate, ruler strip), structure (posts, rails, frame bars, end stops), mechanism (carriage, bushings, springs, plunger, needle), controls (knurled knob, thumb screw, crown) and the subject itself, which is the one lit part. Each part sits on another part. `references/craft.md` has a vocabulary of parts with recipes. +5. **Plan the world.** Use world units of about 1 px of the real thing: x and y on the floor, z up. Lay out plans as rounded rectangles `{x, y, w, d, r}` and circles. Choose the camera: azimuth 45° by default, 35–60° to show the long side, elevation 30° (higher, like the ripple tank's 44°, to look into something open). Then fit with `fitProjection(points, width, height, { pad, azimuth })`. +6. **Build geometry once.** Precompute every static path in a geometry module with the kit: `slabOf`, `cylinder`, `extrude`, `planOutline`, `topTicks`, `knurl`, `coil`, `radialTicks` and so on. Round parts on any axis (bells, flanges, valves, actuators) come from `kit/lathe.mjs`, and pipes and cables from `kit/tube.mjs`. Moving parts are built once at a rest position and moved with `translateAlong`. Only parts whose shape changes are rebuilt per frame. +7. **Paint back to front, bottom to top.** Sort repeated parts with `depthOf`. Split anything that wraps another part into a back half and a front half: the springs around a rod, the bars of a frame around a carriage. A moving part is drawn in the slot where it physically sits. See "Painter's order" in `references/craft.md`. Once a figure has pipes, cables and round parts, stop tuning keys by eye: record each item's shape as you put it into `A.recorder(P, { order, spring })`, let `A.settle(R, P)` measure true depth wherever two items overlap and set the keys, and end the build with `A.auditOrExit(R, P)`. Route pipes before you draw them: real ports at both ends, legs along the structure, crossings on straights, collars gapping the pipe (`references/craft.md`, section 8). Record the true shape of what you draw: a stand-in shape that silences the audit is a bug, and the audit fails one. A rod that slides out of a gland is one rod from `G.rodOut`, recorded with `A.slide`. +8. **Frame it.** Put the figure in a card: `Fig n` at top left, a short title at top right, the interaction hint at bottom left and the live readout at bottom right. Legend keys and a true caption go under the card, and words stay out of the drawing apart from at most one tiny engraved label. +9. **Make it live.** Use calm time-based motion: exponential follow or real springs. An idle tour loops when nobody touches it. The figure responds to pointer and keyboard, stops when offscreen, and goes still under reduced motion. Write attributes on refs and don't re-render per frame. See `references/motion.md`. +10. **Verify like a critic.** The owner finds faults by zooming in, so you zoom in first. Read every PNG you make. + - Capture desktop, phone (390 wide), hover and several moments of motion with `scripts/capture.mjs`; use `scripts/drive.mjs` for sequences, the apart pose and the `--no-webgl` fallback. + - **Run the audit to zero.** With pipes, cables or round parts, `node build.mjs --audit` must end `audit passed`, every failing line at 0: clearance at rest, apart and in mid-flight, terminals, loose ends, folds, self-overlap, crowding (against slender solids too), stand-in shapes, support, wobble, saddles and depth order. Fix an interlock in the geometry, never with a key bias. + - **Run the line check to zero.** The audit never sees line markup. `node scripts/lines.mjs page.html --out shots/lines.png` (and on the `-light` page, and in every resting pose with `drive.mjs`'s `["lines"]` action) must print `line ends: 0`: every seam, rule, rib, tick and pointer ends on a stroke, a dot or an outline. Read the ringed PNG. + - **4× close-ups of every junction in both themes** (build `--light` too), assembled and apart: every flange, tee, elbow, clamp, valve, bellows, band, saddle, ball joint and crossing, every curved body (no tone staircase), every place a texture ends (on an edge or fading), flat box faces with their seams, every textured hose at a chunk joint, every sliding rod at rest and at full stroke, and every window with text or shader content in it. + - **Shaders:** a contact sheet slowed with `["slow", 0.05]` across every transition; nothing pops, no colour switch, edges read 0. In light, also log ink per frame through each transition (it must follow the light monotonically) and crop where the ink meets strokes at 8–16× (`references/verify.md`, "Light-theme shaders"). + - Put your PNG next to the examples and ask: is it instantly a real object, rich in small parts with volume, with every line ending on something? Is it highly detailed at 1× and still rewarding at 4×, with no bare face or empty corner? Iterate until yes. Checklist: `references/verify.md`. + +## Setup + +The kit is in `kit/`: + +| File | Use it for | +|---|---| +| `kit/iso-kit.ts` | The whole core in one file: camera, solids, a parts library, an SVG string renderer, card and page builders, and the CSS (`ISO_CSS`). Copy it into a TypeScript project. | +| `kit/iso-kit.mjs` | The same core compiled to plain ESM, for Node scripts. Import it directly. | +| `kit/iso.css` | `ISO_CSS` written out. Import it once and put `class="iso"` (plus `data-theme="light"` for light) on a wrapper or ``. | +| `kit/react/draw.tsx` | Server-safe React components: `Solid`, `Line`, `Wire`, `Dots`, `FaceText`, `IsoFigure`, `Plate`. | +| `kit/react/live.tsx` | `"use client"` hooks: `useReadout`, `useLoop`, `useEased`, `useInView`, `useStillness`, plus `spring` and `follow`. | +| `kit/lathe.mjs` | Round parts along any axis: `frameAlong`, `lathe` (smooth shading switches on by itself for any profile with a smooth knot), `solidOf`, `disc`, `ringBand`, `sphereOf`, `saddleOf`, `bandsOf` (one curved body cut into depth-sortable bands that share one surface, with one outline from `sidesOf`), visible arcs, ribs and bolt circles on round surfaces (`ribsOf` and `dotsOf` take `fade`, `ribsOf` takes `seams`), `rodOut` for a rod that slides out of a gland, and `fillet` for pipe routes. | +| `kit/tube.mjs` | `tubePieces` splits a 3D pipe or cable into depth-sortable chunks (with `breaks`, `gaps` under collars and clamps, elliptical end caps, and `rings` for a braid, corrugation or wrap that follows the cross-section through every joint), and `tubeSvg` draws one; `crossingsOf` finds where a route passes through a clamp, `runsOf` the drawn runs. Its `.tb-*` fills are in `ISO_CSS`. | +| `kit/audit.mjs` | Proves the geometry. `recorder(P, { order, spring })` collects items, shapes (turned bodies, slabs, prisms, boxes, balls, tubes, pads cut by their host) and routes as the helpers draw them; `settle(R, P)` ray-casts every overlapping pair for true depth, at rest, apart and in the replayed explode, and sets the painter's keys (`overlapsOf`, `orderKeys`); `auditOrExit(R, P)` is the `--audit` hook that runs every check (`clearances`, `solidClearances`, `terminals`, `looseEnds`, `supports`, `folds`, `selfOverlaps`, `crowding` with slender solids as lines, `coverage` for stand-in shapes, `wobble`, `seats`, `depthOrder`) and exits non-zero on any problem. `A.slide` records a rod that slides out of a gland. `references/kit.md`, section 12. | +| `kit/gl.mjs` | The WebGL layer for shaders inside the drawing: `GLSL_ISO` (the camera in GLSL, including `rayOf` and `pixelOf`), `glCamera(P)`, `glLayer(...)`, and the JS envelopes `smooth`, `burst` and `settle`. For 3D figures, `GLSL_TURN` and `glslPose(name)` bring world points into a moving group and mask a front canvas with `coverOf`. | +| `kit/turn.mjs`, `kit/turn-build.mjs`, `kit/turn-audit.mjs` | The optional 3D mode. `turn-build.mjs` has `turning(P, { recorder })`: groups (turn, slide, hinge, free), live layers, convex parts with materials, and `T.build`. `turn.mjs` is the runtime: `TURN.mount`, the controller, `TURN.cover`, `TURN.poseUniforms` and `TURN_CSS`. `turn-audit.mjs` has `orbitOrExit`, the orbit audit over every turn angle and motion clip. `references/3d.md`. | +| `scripts/capture.mjs` | Headless Chrome screenshots, close-ups and console checks, with WebGL on. Run with `node`. | +| `scripts/drive.mjs` | Scripted headless Chrome with WebGL: move, click, key, slow motion, wait-until, eval, shots and contact sheets that catch pops; `--no-webgl` and `--preload`. | +| `scripts/lines.mjs` | The line-end check on a built page, in headless Chrome: every texture line must end on a stroke, a dot or an outline. Rings the failures with `--out`; exits 1 on any. | +| `scripts/inline-kit.mjs` | `kitScript()`, `glScript()` and `turnScript()` return the kit, the WebGL layer and the 3D runtime as source to inline into a standalone page. | +| `scripts/turn-check.mjs`, `scripts/turn-bench.mjs` | 3D figures: fidelity against the kit builders, a z-buffer order check, pixel pops, line ends at 24 angles and frame timing in the browser; Node CPU time per part kind. | +| `scripts/print.mjs`, `scripts/print-sheet.mjs` | Printable sheets: freeze poses of a built page as vector stills and lay them out as an A4 or Letter PDF in three formats (poster, drawing, detailed). `references/print.md`. | + +Pick the path that fits the project: + +- **Standalone HTML, a static SVG, a blog post or any non-React site.** Write a Node build script like `examples/dial-indicator/build.mjs`. It imports `kit/iso-kit.mjs`, assembles strings with `solidSvg`, `lineSvg`, `dotsSvg`, `wireSvg` and `faceTextSvg`, wraps them with `figureSvg` and `plateHtml`, and writes the page with `pageHtml({ script: kitScript() + live })`, or `kitScript() + glScript() + live` when it has a shader. For a lone `.svg` file use `figureSvg({ standalone: "dark" | "light" })`, which embeds the styles. +- **React or Next.js.** Copy `kit/` into the project (for example `components/iso/`). Keep geometry in plain `.ts` modules, build the static art in a server component with the `draw.tsx` components, and pass it as element props to one `"use client"` live component that moves things. `references/react.md` explains the split and a trap with large pages. + +## Craft rules (short form) + +These are the rules that separate a crafted figure from a diagram. `references/craft.md` gives the full reasoning and recipes. + +- **Solids, not wireframes.** Every part is filled in paper colour and painted in order, so things in front hide things behind. No see-through edges and no dashed hidden lines. +- **Let the kit shade.** `extrude` returns four side tones by facing plus a lighter top. Keep it for anything with height, and use `flat` only for floors and inlays thinner than 1 unit. +- **Tone hierarchy.** Base and feet are `lo`, structure is `mid` and the subject is `hi`. Exactly one accent is `lit` (white in dark, black in light): the part the reader should watch. Grooves are `faint`, minor ticks `lo`, major ticks `mid` and the zero mark `hi`. Use colour only when colour is the subject, such as red, green and blue channels. +- **Small precise detail, never noise.** Use bevels of 0.4–1.6, grooves inset 3–5 from an edge, screws as 0.4–0.55 dots with a ring at the corners of plates, knurls on knobs, ruler ticks every 4–5 units with a major every 5th, and a label plate with three rule lines. Each detail belongs to a part. +- **Lines resolve.** Every line ends on something: a face, another line or a terminal dot. Connectors are `Wire`s whose terminal dots land on objects. There are no leader lines, balloons, dimension arrows or labels floating in the air. +- **No pipe or cable passes through anything.** Not through another pipe, cable or solid, at rest, apart or in any frame of the explode. Keep about 1.5 radii of clearance to everything but a line's own connection, run lines beside the structure rather than across the subject's face, and gap a pipe wherever a flange, band, bellows, clamp or valve wraps it. Parts meet flush, tangent or rim-on-surface, never sunk in: a flange's back face lands on its port (on a saddle pad, `G.saddleOf`, when the port is curved), a branch leaves from a ball tee, and every end, apart too, finishes on a flange, coupling, connector shell or terminal dot. +- **Every crossing is drawn in true depth order.** Where two items overlap on screen, the nearer is drawn on top, proved by `A.settle` and the audit, not tuned by eye. Lines cross on straights, well apart in depth: a bend, end or clamp that lands on another line's outline reads as a joint (a rod, tie rod, post or rail counts as a line: a pipe's last leg never runs along one on screen), a leg that points at the viewer and then turns pinches to a V (leave such a port through an elbow ball), and a route never doubles back on screen. A pair that can't be ordered interlocks, and the fix is a cut or a tangent contact, never a bias. +- **Curved surfaces shade smoothly, never in a staircase.** Mark curved knots smooth (`[s, r, 1]`) and `lathe` shades them from one monotone curve that also draws the outline; give any curved body larger than a fitting an analytic profile with `smooth: { slope }`, cut long bodies with `G.bandsOf`, and use `G.sphereOf` for balls. Tone bands taper to nothing instead of ending on a straight cut, and seams go under the outline (`inner`). +- **A texture ends on a real edge or fades.** Ribs, bolt circles, rule lines, seams and grooves never stop in the middle of a surface, flat or curved: `ribsOf` and `dotsOf` take `fade` (draw faded ribs with `fadedSvg`), a rib row ends on its seams (`ribsOf(…, { seams: true })`), a seam or weld on a box wraps its corners (`k.sideSeam`, as the slab's `inner`), a line on one face runs edge to edge, vents are closed slots, ticks hang from a ruler strip's edge, a single line that must stop ramps out with `fadeLineSvg`, and a row whose features face up (holes on top of a ring) is seen all round (`all: true`). A texture on a pipe (braid, corrugation, wrap) follows its cross-section and runs through every chunk joint: `tubePieces(…, { rings })`, never a dashed stroke down the centreline. A pipe's shine and shade run onto its end caps and through every chunk joint. Only rule lines that stand for printed text, a needle's tail and a pointer's tip may stop on a bare face, marked `free`. +- **Shaders never pop or cut off.** Every uniform rides an envelope with an attack and a decay, phase changes are crossfades driven by the physical quantity, every term reaches zero before any bound or canvas edge, and the effect lives in world space in the figure's own camera (see below). +- **Things on faces fit them.** Text a machine displays fits its window at its widest string and is clipped to it; content seen through an opening is clipped by the opening as well as by its own plane, with the recess walls drawn. +- **Volume.** Give things real thickness, make them stand on other things, and put a soft halo under the base and under anything lifted. +- **Composition.** Centre the figure and let it fill about 55–65% of the card. Keep a consistent scale across a set of figures, and make sure it still reads at 390 px wide. + +## WebGL inside the drawing + +Use a shader only for what lines can't draw: fire and exhaust, water and caustics, real lamp light, glow, steam. The parts stay SVG. The core rules come from the first shader figure, whose colour change between phases looked cut rather than crossfaded: + +- **Three layers.** A back SVG holds what the effect covers, the canvas holds the effect (`pointer-events: none`), and a front SVG holds what covers it. Split a part, or the effect, when it is on both sides. +- **World space, same camera.** Build every shader point from `onFloor`, `onWallX` and `onWallY`, or march the pixel's ray `rayOf(vb) + t·towardViewer()`. Size everything in world units times `uK`. Anything lying on a plane registers exactly with that plane's SVG lines. +- **Nothing pops.** Every uniform follows an envelope with an attack and a decay (the kit's `burst` for events, `settle` for levels). Phase changes are crossfades where colour shifts continuously with the physical quantity, and a fade-out only gets darker. +- **No hard cut-offs.** Every term reaches zero before any `if`, bound or canvas edge, and before any cell edge of a cell noise. +- **Seen through an opening, masked twice.** Content behind a window or a recess is masked in its own plane and by the opening in the face plane, multiplied (`references/webgl.md`, section 5). +- **Blending.** Use `tonemap()` and dither. In dark, a canvas that only adds light uses premultiplied output with `mix-blend-mode: screen`, and one that must also darken (the ripple tank's water) stays normal-blended. +- **Light theme ships, and its shaders are designed for paper.** Use normal premultiplied alpha, never screen. Write the colour the paper should show and solve for the ink. A glow is a saturated body with a pale core, a coloured rim and an alpha floor, never a darkened dark-theme colour: that gave the Raptor's "red ink smoke". + - What the light falls on takes a tint, and the cavity that holds it gets a darker physical ground (soot, refractory, water depth). + - Hot bodies follow one blackbody ink table shared with the fallback. + - Ink only grows with light: fade the finished ink once, never one term at a time. + - Ink ends at each stroke's inner edge. + - Measure ink per frame. `references/webgl.md`, section 8, has the recipes and the faults reviewers found. +- **Restraint.** Cap the device ratio at 1.5 and render only while the effect is active and onscreen. Reduced motion gets one still frame, and the SVG must still read without WebGL. + +Read `references/webgl.md` before writing any shader. + +## 3D: figures that turn (beta) + +3D is an option like WebGL. Use it when a part moving in depth is the idea: a dial or turntable that turns, fingers that flex, a piece that breaks off and falls. The rest of the figure stays static kit art. + +It is in beta: the engine is proved on its example and one test figure, not yet on a production figure. Turn one subject at a time and keep the clutter around it static. A small figure runs at 60 fps; a dense 380-part flexing hand measured about 20 fps at 1440 and 13–15 fps on a phone profile (390 px, 4× CPU throttle) on a heavily loaded machine. + +- **Live parts are the kit's own picture.** Each frame, convex kit primitives (prisms, rounds, domes, balls with flats, lathes, tubes) are re-projected and re-shaded by the kit's rules. A turn by θ is the kit drawing at azimuth `a − θ`. +- **Order comes from separating planes.** Same-group pairs get a plane fixed in the group, pairs on different links get one fixed in their common frame, and the rest are solved each frame. The audit proves there are no cycles at any angle or in any clip frame. +- **Contacts are flush, tangent or rim-on-flat.** Joints are coaxial knuckle discs on the child group that touch the parent's link, or the audit calls the whole child group loose. No live line spans two moving groups: a cable crosses a joint through a clip on each side, or reaches the turntable through a slip ring at the hub. +- **Live tubes bend in near-horizontal planes or inside fittings, and never point along the view.** A bend needs R ≥ 2r / sin²(e − θmax), where θmax includes the pitch range of every hinge it rides: 8r is the bound when flat, and on a ±12° hinge it is 21r. Each route runs from mount surface to mount surface, with its ports in `gaps`. That holds at every angle and in every pose. +- **Materials remap the ramp.** Gold, chrome, steel, gunmetal, rubber, brass and copper each have a light and a dark set; tones still come from facing. +- **Free groups break off without a jump.** Coaxial parts are fixed pictures with turning textures. +- **Shaders follow the motion.** Anchor them to a group with `controller.anchor` or `toGroup`, occlude a front canvas with `coverOf`, and keep world effects (smoke, falling sparks, oil on the bench) out of group space. +- **Verify with `--audit`** (`turn audit passed`) and `scripts/turn-check.mjs` (`--fidelity`, `--order`, `--pops`, `--lines`, `--perf`). Iterate with `--quick --only=…`. Only a full run proves the figure, and it takes 15–20 minutes for 30 parts, so run it in the background. + +Read `references/3d.md` first. + +## Printable sheets (A4) + +When the user wants the figure on paper (a handout, a poster, a PDF, an A4 or Letter sheet), print it from the finished figure instead of drawing again. Write a `sheet.mjs` next to the build: the poses to capture as `drive.mjs` actions, the parts as CSS selectors over the live SVG, and the words, every one of them true to the model. Then run `node scripts/print.mjs sheet.mjs --format all --png` and read every page. + +- **poster** (the default): one page, the name set large, the question, big numbers, the figure with numbered pins and every part with one line. +- **drawing**: one page, a technical drawing with a parts list, a specification, an inset and a strip of steps with the working parts lit. +- **detailed**: 2–4 pages, scaled to the machine: an overview with pins and round close-ups; "How it works" with each step as a large lit still (six per page, the why in the last slot); and for complex figures an "Assemblies" page with up to four large close-ups of part groups (`assemblies` in the spec). A simple figure stays at 2 pages; `maxPages` caps it. + +Offer all three when the user hasn't picked one. When the page shows a figure that has a PDF, put a link to it on the card with `pdfButton(href)` from `kit/pdf-button.mjs` inside the plate body (see `examples/push-button/build.mjs`); print first, then rebuild the page. `examples/raptor-engine/sheet.mjs` and `examples/arcade-cabinet/sheet.mjs` are the references. Read `references/print.md` first. + +## References + +Read these as you need them: + +- `references/craft.md`: the look in depth, including the parts vocabulary with code, tone tables, painter's order patterns, round parts, pipes and harnesses, exploded views, screens on faces, and the anti-patterns that got figures rejected. Read it before designing. +- `references/kit.md`: the API, with signatures and examples. +- `references/motion.md`: live behaviour (loops, springs, tours, pointer, keyboard, accessibility, reduced motion), plus envelopes for one-shot events, exploded views, depth re-sorting and arming, in vanilla JS and React. +- `references/react.md`: the React/Next.js server/client split, element props and the large-payload key-warning trap. +- `references/verify.md`: the `capture.mjs` and `drive.mjs` commands, the review checklist (including shaders) and common faults. +- `references/webgl.md`: shaders inside the drawing: when one earns its place, the layer stack, the camera contract, ray-marching in the iso camera, the full API with a minimal page, the craft rules with the bugs that taught them, the light theme (inks on paper, per-phenomenon recipes, the reviewers' faults), and how to verify them. +- `references/walkthrough.md`: how the test rig was designed, step by step, from concept to code. +- `references/3d.md`: the optional 3D mode: groups and poses, live layers, convex parts and their rules, materials, free groups, hinge chains, painter's order, static clutter around a turntable, shaders that follow the turn, the orbit audit, browser checks, performance and limits. +- `references/print.md`: printable A4 or Letter sheets from a built figure: the three formats, the `sheet.mjs` spec (poses, parts as selectors, focus, hide, crops, rasters for WebGL) and how to check the PDF. +- `references/publish.md`: sharing a finished figure in the community gallery with `scripts/publish.mjs`, only when the user asks; nothing is pushed for them. diff --git a/skills/anatomy/agents/openai.yaml b/skills/anatomy/agents/openai.yaml new file mode 100644 index 0000000..dcdc373 --- /dev/null +++ b/skills/anatomy/agents/openai.yaml @@ -0,0 +1,3 @@ +interface: + display_name: "Anatomy" + short_description: "Explain an idea as a crafted, interactive isometric machine" diff --git a/skills/anatomy/references/3d.md b/skills/anatomy/references/3d.md new file mode 100644 index 0000000..e7cd7c6 --- /dev/null +++ b/skills/anatomy/references/3d.md @@ -0,0 +1,352 @@ +# 3D: parts that turn in the drawing + +The optional 3D mode ("turning groups") lets some parts of a figure move as rigid bodies: a dial or turntable that spins, fingers that flex, a piece that breaks off and tumbles. Those parts are re-projected and re-shaded every frame by the kit's own rules and painted in an order solved from separating planes. Everything else stays ordinary static kit art. A figure that doesn't opt in is untouched. + +**Status: beta.** The engine is proved on `examples/turning-dial` and one test figure (a desk fan built from this document alone), not yet on a production figure. Turn one subject at a time, keep clutter static, and measure your figure against section 15 before you add parts. + +## Contents +1. When a figure earns 3D +2. The model +3. A minimal page +4. The authoring API +5. Part kinds and the rules that keep them true +6. Materials +7. Free groups: parts that break off +8. Hinge chains: hands and fingers +9. Painter's order and why it is correct +10. Shading and fades +11. Static layers and a messy workshop around a turntable +12. Shaders that follow the turn and the groups +13. The orbit audit +14. Browser checks +15. Performance +16. Known limits + +## 1. When a figure earns 3D + +Only when the motion is the explanation: a dial whose numbers are read as it turns, a turntable that shows an object from every side, a wheel pack, a hand that grips or breaks. Never as decoration. A figure that only needs a part to slide or a needle to swing stays 2D: `translateAlong` and a re-drawn needle are cheaper and exact. + +## 2. The model + +- **Groups.** A group is a rigid frame with a pose. Kinds: `turn` (about a vertical axis through `pivot`, any angle), `slide` (along a direction, `0…travel`), `hinge` (about any axis through a point, within `range`, in degrees) and `free` (any rotation plus a translation, set by the figure every frame). Groups nest: a pose is relative to the parent. +- **Rest.** Every constructor takes **world coordinates at rest** (every group value 0, every free group `null`). The engine subtracts each group's origin, so the recorder (`A.recorder`), the kit and the engine share one world. +- **Live layers.** A live layer is one `` in the stage. Live and static layers stack in the order of `T.stack([...])`: for example `back svg → [dial live] → back canvas → [hand live] → front canvas → front svg`. +- **The identity.** Turning a group by θ about a vertical axis is exactly the kit drawing at azimuth `a − θ`, because the kit's light is camera-locked. So every frame of a turn group is the kit's own picture at P′(θ), shifted; the kit builders at P′(θ) are the fidelity reference, and every kit screen-space audit runs unchanged at P′(θ). Hinges and free groups compose matrices instead (correct, slightly slower). + +## 3. A minimal page + +`examples/turning-dial/` is the reference scene: a dial with a knurl, ticks and numerals, a second turn group (an index wheel under a window), a hinge (a pawl riding the knurl), a hand of about 80 parts with materials, a three-hinge finger that lifts, a hex pod that breaks off as a free group, and a WebGL LED, light pool and sparks. `examples/turning-dial/stress.mjs` is the performance scene (a dense hand on a turntable in a cluttered workshop); it is not audit-clean, so take patterns from `build.mjs`. + +`build.mjs`, reduced to its skeleton: +```js +import * as k from "../../kit/iso-kit.mjs"; +import * as A from "../../kit/audit.mjs"; +import { turning } from "../../kit/turn-build.mjs"; +import * as TA from "../../kit/turn-audit.mjs"; +import { turnScript, glScript } from "../../scripts/inline-kit.mjs"; + +export const P = k.fitProjection(points, W, H, { pad: 22, azimuth: 40, elevation: 31 }); +export const R = A.recorder(P); +export const T = turning(P, { recorder: R }); +const dial = T.group("dial", { turn: { pivot: [0, 0] } }); +const lift = T.group("f2.mcp", { parent: dial, hinge: { point: C1, axis: w, range: [-22, 0] } }); +const hand = T.layer("hand"); +T.stack(["back", "hand", "front"]); +export const follow = (values) => ({ ...values, "f2.mcp": -22 * (values.lift ?? 0) }); +export const poses = () => Array.from({ length: 720 }, (_, i) => follow({ dial: i * 0.5, lift: (i % 90) / 90 })); + +T.round({ name: "dial.body", group: dial, layer: hand, F: VERT(0, 0), s0: 10, s1: 14.4, r: 50, material: "steel", details: { ribs: { s0: 10.9, s1: 13.7, count: 150, seams: true, tone: "lo" } } }); +T.prism({ name: "hand.palm", group: dial, layer: hand, plan: PALM, z: 19.4, h: 8, bevel: 0.9, material: "gold" }); +T.tube({ name: "cable.red", group: dial, layer: hand, route, r: 0.7, hue: "red", material: "rubber", gaps }); +// … static kit art: R.put({ name, layer: "back", svg, shapes }) as usual … + +const out = T.build({ statics: R.items, poses, verify: argv.includes("--verify") }); +A.settle(R, P); +if (argv.includes("--audit")) { + A.auditOrExit(R, P); + TA.orbitOrExit(T, R, P, { sweep: { at: (x) => follow({ dial: x }), from: 0, to: 360, frame: 0.3 }, clips: [{ name: "tap", at: (t) => follow({ dial: 40 + 12 * t, lift: tapAt(t) }), from: 0, to: 4, frame: 1 / 60 }] }); +} +const stage = `
${backSvg}${out.layerSvg("hand", { width: W, height: H })}${frontSvg}
`; +const page = k.pageHtml({ title, theme, body: k.plateHtml({ …, body: `${stage}` }), script: turnScript() + LIVE }); +``` +`live.js`: +```js +const controller = TURN.mount(stage, DATA.turn, { follow, onHold: () => (touring = false), onFrame: () => paint() }); +function tick(now) { + … + controller.set({ dial: angle, lift }); + frame = visible && moving ? requestAnimationFrame(tick) : 0; +} +``` +The figure owns the loop (`motion.md`); the controller never runs its own `requestAnimationFrame`. `out.css` is `TURN_CSS` (the face band rules, materials, hue tubes and the `.iso-turn` stacking): include it once. + +**In React or Next.js** (`references/react.md`): copy `turn.mjs`, `turn-build.mjs` and `turn-audit.mjs` beside the kit with the imports rewritten (`./iso-kit.mjs` → `./kit`, and so on), and `TURN_CSS` as a `turn.css` imported once. The geometry module (server) runs `turning(…)` and `T.build(…)` and returns the stage markup (`out.layerSvg(name, { width, height })` for each live layer, in stack order between the static SVGs and canvases) plus `out.data` in the figure's data. The client mount calls `TURN.mount(stageElement, data.turn, { follow, onHold, onFrame })` and drives `controller.set(...)` from its own loop; return `controller.destroy` from the effect's cleanup. A verify build can put `out.verify` in the data and have the mount assign `window.__isoVerify` for `turn-check --order`. + +## 4. The authoring API + +### Scene +| Call | What it does | +|---|---| +| `turning(P, { recorder, scale = 1 })` | The builder `T`. Pass the kit recorder so every live shape is recorded for the kit audit too. | +| `T.group(name, { parent?, turn: { pivot: [x, y] } })` | Rotation about the vertical through `pivot`, value in degrees. | +| `T.group(name, { parent?, slide: { direction, travel } })` | Translation, value `0…travel` world units. | +| `T.group(name, { parent?, hinge: { point, axis, range: [lo, hi] } })` | Rotation about `axis` through `point`, value in degrees within `range`. | +| `T.group(name, { parent?, free: { origin } })` | A free rigid body (section 7). Value `{ R: [9] \| q: [x, y, z, w] \| axis, angle, t: [3], world? }` or `null` for rest. | +| `T.layer(name)`, `T.stack([…])` | Live layers and the full stack of live and static layer names, back to front. | +| `T.build({ statics, poses, verify = false, strict = true })` | Solves every pair, proves every static item's layer, packs the page data. `poses` is the figure's reachable states (a list or a function returning one): every motion clip, sampled. Throws a readable error on any pair with no separating plane, any static that can't be proved, any non-convex part. `strict: false` keeps interlocked pairs (so a planted fault reaches the audit). | + +`T.build` returns `out = { svg, data, css, report, layerSvg(name, { width, height }), verify }`. `out.data` goes to the page (`DATA.turn`). `out.report` has `parts`, `layers` (per layer: `planar`, `framed`, `dynamic`, `skip` counts), `tight`, `margins`, `proofs`, `seconds`. + +### Constructors +Common options on every constructor: `{ name, group, layer, tone = "hi", crease = "faint", lit = false, material, owner, details = {} }`. + +| Constructor | Part | +|---|---| +| `T.prism({ plan, z, h, steps, bevel })` | An upright kit slab (the kit `extrude` rule). | +| `T.prism({ F, polygon, s0, s1, round = 0, steps = 4, bevel = 0 })` | A convex polygon in frame `F = { o, a, u, v }` extruded along `F.a` from `s0` to `s1`, any axis (the `prismOf` rule). | +| `T.round({ F, s0, s1, r \| [r0, r1], ends = ["flat", "flat"], fixed })` | Cylinder or cone frustum; each end `"flat"`, `"dome"` (radius must equal the side's: a capsule) or `"open"`. One dome and one flat end is a half-capsule, and any length works, even one shorter than the radius (a nose cone on a motor can). A vertical round in an upright group becomes a `fixed` picture automatically (`fixed: false` stops it). | +| `T.lathe({ F, profile, slope, radius })` | A general convex smooth body (r(s) concave). Costly; prefer rounds. | +| `T.ball({ c, r, flats: [{ n, d }] })` | A sphere; each flat keeps n·(p − c) ≤ d and draws its rim as a cap, so `n` is the flat's outward normal. Without flats it is a `fixed` picture, and it takes no `details`. It is the costliest kind to draw (section 15). | +| `T.tube({ route, r, chunk = 6, turn = 20, gaps, breaks, caps, rings, hue, material, bundle, owner, touch })` | The kit `tubePieces` semantics, chunked; `hue` is `"red" \| "green" \| "blue"`; records `R.route`. The route runs from mount surface to mount surface. The port, gland or clamp at each end is a separate part with `owner` set to the tube's name, and its span along the route goes in `gaps`. A route that starts at a port's outer face fails `terminals` in the kit audit (below). | +| `T.fixed({ svg, anchor, shapes, hull, F })` | Any kit markup whose picture never changes under the group's motion, moved by `translate`. | +| `T.plane({ part, o, u, v, svg, fade = [0.04, 0.3], normal })` | Line or text markup in a plane of the part (ticks, numerals, label plates), placed by one matrix, faded by facing. | +| `T.billboard({ part, at, normal, svg, fade })` | Screen-aligned markup at a projected point (an SVG fallback for a shader glow), faded by facing. `svg` is in viewBox px centred on the projected point, not in world units: multiply world sizes by `G.scaleOf(P)` (`` fills a lens of radius 1.1). | +| `T.split(part, { n, d })` | Two parts cut by the plane (prism: any plane through it along or across the axis; round: across). The cut edges are not stroked. Use it to break a genuine cycle. | + +### Details (in the part's frame: `s` along the axis, `x` and `y` in `u` and `v`) +Each constructor has its own frame and takes its own detail kinds. Anything else is ignored without a warning. + +| Constructor | Frame `[s, x, y]` | Takes | +|---|---|---| +| `T.round`, `T.lathe` | `F`: `s` along `F.a`, `x` along `F.u`, `y` along `F.v` | `seams`, `ribs`, `bolts`, `dots`, `rings`, `rules` | +| `T.prism({ F, polygon })` | `F` | `dots`, `seams`, `bevel` | +| `T.prism({ plan, z, h })` | The world: `s` is z, `x` and `y` are world x and y | `dots`, `seams` (z values), `bevel` | +| `T.ball` with flats | Origin `c`, `a` = the first flat's `n`, `u` and `v` from `G.frameAlong(c, n)`. The flat is at `s = d` and the far pole at `s = −r` | `bolts`, `dots`, `rings`, `rules` | +| `T.ball` without flats | None: a fixed picture | Nothing | +| `T.fixed({ F })` | `F` (no `F`: no details) | `bolts`, `dots`, `rings`, `rules` | + +A centre dot on a domed spinner `T.ball({ c, r: 4.5, flats: [{ n: [-1, 0, 0], d: 0 }] })` (the flat faces −x, the dome +x) sits at `at: [-4.5, 0, 0], normal: [1, 0, 0]`: `s = −r` is the pole. `[4.5, 0, 0]` would land 4.5 behind the flat, inside whatever the spinner is mounted on. For a ring or a rule on a prism face, use `T.plane`. +```js +details: { + seams: [s…], // rings on rounds, ring seams on prisms + ribs: { s0, s1, count, phase, twist, fade: [0.1, 0.55], seams: true, tone }, // knurl rows on rounds + bolts: [{ s, r, count, phase, size: 0.5, tone: "mid", fade: [0.04, 0.42] }], // bolt circles + dots: [{ at: [s, x, y], normal, size, tone }], + rings: [{ at: [s, x, y], normal, r, tone }], // become planes + rules: [{ points: [[s, x, y]…], tone, free }], // become planes + bevel: 0.4…1.6, // prism cap bevel (faded slots) +} +``` +Every detail fades with facing: dots and bolts by `smoothstep(0.04, 0.42, n·V)`, ribs per rib, bevel lines per edge, planes on the group's opacity. No texture stops at full strength. + +### Runtime (`kit/turn.mjs`, inlined with `turnScript()`) +| Call | What it does | +|---|---| +| `TURN.mount(stage, data, { onHold, onFrame, follow })` | Binds every live layer in `stage`, renders the rest pose, installs `window.__isoTurn`. `follow(values)` maps figure values to group values on every `set` (one input drives coupled groups). `onFrame(controller)` runs after each render (draw shaders here). `onHold()` runs when a tool calls the hook. | +| `controller.set(values \| θ, { detail })` | Sets group values (a number sets the first turn group), renders synchronously, returns stats. `detail` (0…1) scales faded lines, ribs and dots (section 15). | +| `controller.angleAt(clientX, clientY, z, group)` | The pointer as an unwrapped angle about the group's pivot on the plane at height `z` (drag a dial). | +| `controller.pose(name)` | The group's world pose `{ R, t }`. | +| `controller.detach(name)` | The `{ world: true, R, t }` value that continues a free group's current pose in the world frame (no jump). | +| `controller.anchor(group, restPoint, restDir?)` | Where a rest-world point (and direction) of a group is now: `{ world, screen, direction }`. Spark sources, flame roots, LED positions. | +| `controller.cover(names, options)`, `order(layer)`, `orderIndex(layer)`, `events()`, `stats()`, `frames()`, `cams()`, `scene()`, `values`, `destroy()` | Cover masks (section 12), paint order, order-change events, `{ ms, writes, moved, forced, refined, unseparated, emitted }`. | +| `TURN.cover(controller, names \| [names, names…], { polygons = 6, edges = 10, pad = 0.3, layers })` | `{ uCoverEdge, uCoverCount, dropped, parts }` for `coverOf`. | +| `TURN.poseUniforms(controller, group, prefix = "uGroup")` | `{ prefixX, prefixY, prefixZ, prefixT }` such that `toGroup(p)` gives the group's **rest-world** coordinates. | +| `TURN.materials`, `TURN.materialCss()` | The material names; the material CSS alone (it is already in `TURN_CSS`). | +| `TURN.exact(on)` | Write path coordinates unrounded (6 decimals) instead of to 0.01 px. The orbit audit turns it on for the continuity line; a page never needs it. | +| `TURN.rotation(axis, degrees)`, `TURN.quat(q)`, `TURN.compose(A, B)` | 3×3 rotations as arrays, for free poses. | +| `TURN.floorOf(scene, group, R)` | The lowest z of a group's parts under rotation `R` (relative to its origin): to set a piece down flush. | +| `window.__isoTurn` | `{ controller, set, get, order, events, stats, layers }`; every call holds the figure (`onHold`). `set` takes a number or a values object. | + +## 5. Part kinds and the rules that keep them true + +These are binding; the build and the audit fail without them. +- **Convex parts only.** A stepped dial is tiers; a notched wheel is a hub disc plus rim sectors; a U-bracket is three prisms; a hand's shell is plates. `T.prism` checks its polygon, `T.lathe` its profile. +- **Contacts are flush, tangent or rim-on-flat.** A rim on a sphere is not separable: give the ball a flat (`T.ball({ flats })`) and land the rim on it. A pad sunk into its host is not allowed in a live layer (`separation` fails with `interlock A × B −0.6`). +- **Joints.** The two links stay at least 0.2 apart, and the joint is bridged by a knuckle disc on the child group: coaxial with the hinge axis, and touching the parent's link, flush or tangent. A disc coaxial with its hinge (or any flat face turning in its own plane) is invariant under the hinge, so it never collides, and it is the contact the kit audit needs. With nothing in the child group touching the parent, `rigid` reports every part of the child group as `support loose`. Links meeting at a joint share one radius; dome centres sit the same distance from the joint so the gap holds at any angle (two domes of radius r at distance c from the joint stay apart while cos(β/2) ≥ r/c). A trunnion on a yoke: + ```js + T.round({ name: "yaw.arm+", group: yaw, layer, F: VERT(0, 11.7), s0: 40, s1: 61, r: 1 }); + T.round({ name: "head.can", group: tilt, layer, F: frameOf([0, 0, 56], [1, 0, 0], [0, 0, 1]), s0: -12, s1: 8, r: 9 }); + T.round({ name: "head.trunnion+", group: tilt, layer, F: frameOf([0, 9, 56], [0, 1, 0], [0, 0, 1]), s0: 0, s1: 1.7, r: 4.5 }); + ``` + `tilt` hinges about y through `[0, 0, 56]`. The can reaches y = 9 and the arm starts at y = 10.7, so the links are 1.7 apart. The trunnion runs from 9 to 10.7: it sits on the can and its end face is tangent to the arm. Ending it at 10.5, with a 0.2 gap to the arm, fails `rigid` for the whole head. +- **No live line spans two moving groups.** A cable or hose crossing a flexing joint is two routes ending in a clip or port on each side of the joint, or crosses at the hinge axis through a rotary union (banjo). A cable that must reach a turning part from static ground goes up the axis through a slip ring at the hub (section 11). +- **Tubes bend nearly flat or inside fittings.** A bend of radius R in a plane tilted θ from horizontal, toward the viewer, is an ellipse on screen whose tightest radius is R·sin²(e − θ) (in world units; × `G.scaleOf(P)` for px). `folds` fails a bend that turns more than 90° on screen round less than 2r, and `self` one under r. So a bend needs **R ≥ 2r / sin²(e − θmax)**, where θmax is the plane's own tilt plus the pitch range of every hinge it rides on (a turn group sweeps the tilt through every azimuth, so the worst case always comes round). At e = 30°: + + | θmax | 0° | 5° | 8° | 10° | 12° | 15° | 20° | + |---|---|---|---|---|---|---|---| + | R ≥ | 8r | 11r | 14r | 17r | 21r | 30r | 66r | + + 8r is the bound itself on a horizontal plane, not a margin: take 10r. Past about 15° no practical radius holds, so turn inside a fitting (clip block, banjo, elbow ball, a junction box) or run the line straight. Draw bends with `G.fillet(points, R)`, never the view-dependent fillet. The audit's `folds` and `self` run at every angle and pose. +- **Tubes never point along the view.** A tube's tangent elevation stays out of 15°–45° and −45°–−15° at e = 30° (`endon`), in every pose: on a hinge chain, check the link's pitch range too (a cable on a link that flexes 30° will fail). +- **Lathes are the one kind with small residual steps** (≤ 2.5 tone·px² where a band changes topology). Prefer rounds, domes and balls with flats for live parts. + +## 6. Materials + +A part's material is one option on its constructor (`material: "gold"`). Tones still come from facing exactly as the kit's do; a material remaps the ramp (the four shades, the top, paper, outline and line tones, dots and the tube body, shine and shade), with a light and a dark set each. + +| Material | Look | +|---|---| +| `gold` | Champagne-gold anodised aluminium: warm pale top, bronze shadows, dark bronze outline. | +| `chrome` | Bright polished steel: a light far band, a dark reflection band (n·L 0.2–0.42) next to a bright band and a white highlight. Non-monotonic on purpose: the bands move with facing, never jump. | +| `steel` | Satin steel, monotonic and cool. | +| `gunmetal` | Dark blue-grey metal with light dots. | +| `rubber` | Black rubber and cable sheath with a soft sheen. With `hue`, a tube becomes a coloured sheath (the hue mixed into the rubber ramp). | +| `brass`, `copper` | Warm metals for fittings, ports, valves. | + +Static parts use the same families as plain classes: wrap kit markup in `…` (the example's index wedge). The rules live in `TURN_CSS`; a page with static art only can include `TURN.materialCss()`. A dark plate inside a light page picks the dark set (`.iso[data-theme="dark"] [data-mat]` is ordered last). + +On a light page a material figure is far stronger than kit greys: keep the ground (bench, base, plates) in kit tones and put materials on the subject, so it reads as the lit, finished object. + +## 7. Free groups: parts that break off + +`T.group("pod", { parent: dial, free: { origin } })` makes a rigid body whose pose the figure sets every frame. At rest (`null`) it sits exactly where it was built, attached: the parent carries it. To break it off, start setting a pose relative to the parent: there is no single-frame change because the first value is the identity. +- **Falling onto the turntable**: keep the parent as the turntable group, so the piece lands and then turns with it. Compute the flight as a pure function of time (`breakAt(t)` in the example: a somersault about the centroid, a ballistic arc, a flush landing found with `TURN.floorOf`, a decaying slide and yaw). A pure function can be sampled by the build and the audit, and played backwards. +- **Falling off onto the bench**: switch to world space with `controller.detach(name)`, which returns `{ world: true, R, t }` continuing the current pose, then integrate from there. +- **Order**: a free group's parts are paired at runtime with every part of their layer (by screen box, then a GJK plane cached per relative pose); intra-group pairs are planar. Cycles among free parts are possible in principle; the audit samples the clips and reports them. +- **Proof**: give the build the clips in `poses()` (every frame of the break at several turn angles), and the audit the same clips (`clips`). The audit poses every shape in every clip frame and checks clearances against live and static parts (`posed`), order, cycles and continuity. + +## 8. Hinge chains: hands and fingers + +Each link is a hinge group whose parent is the previous link (`T.group("f0.j1", { parent: f0j0, hinge: { point: J1, axis: w, range } })`). A wrist is a hinge carrying the palm; a thumb base is a hinge (vertical axis) carrying the thumb chain. Drive the chain from one figure value through `follow` (`lift` → three angles). +- Pairs on different links are solved at build where possible: a pair whose swept volumes over the build's `poses()` have a plane in their common ancestor's frame with margin ≥ 0.1 becomes a **framed** plane (no runtime GJK). Only near-joint pairs stay dynamic (GJK, warm-started, cached while the two groups keep their relative pose). So `poses()` must cover the motion: if a gesture leaves the sampled range, the audit's `unseparated` line names the pair ("framed plane: … add it to poses()"). +- Keep ranges physical and small: a three-link finger at ±5° per joint already reads as a hand moving; 20° per joint needs every route and contact re-proved. +- **A route on a hinged link carries the link's pitch range.** Section 5's `endon` rule and its bend bound both use the tilt the line can reach, not the tilt at rest: a horizontal 90° bend at R = 8.6r (inside the 8r rule for a flat plane) on a ±12° hinge fails `folds` and `self`, because at 12° of pitch it needs 21r. Make the line straight into a junction box, or move the bend to the parent. + +## 9. Painter's order and why it is correct + +Every pair of parts that can overlap on screen gets one relation: a plane fixed in their shared group (planar), a plane fixed in their common ancestor's frame (framed), a GJK plane each frame (dynamic, different groups that move relative to each other) or a skip (neighbouring chunks of one route). B is in front of A when n·V > 0 in that frame. Order is a stable Kahn sort keyed by the previous frame's order; on a stall, edges between parts whose exact screen hulls are apart (or touch within 0.1 px) are dropped; a remaining stall is a forced pick, counted and made fatal by the audit. + +Correct because two disjoint convex solids whose projections overlap are both hit by some view ray, and a separating plane crosses that ray once. Flicker-free because a plane's relation flips only when the plane is edge-on, and then the two footprints lie on opposite sides of a line: swapping them changes no pixel. Edge-on relations (|n·V| < 1e-7) add no edge. + +## 10. Shading and fades + +- Flat faces (prism sides, caps, ball flats) use the kit's thresholds (`EB` for upright prisms, `LB` otherwise) through a smoothed staircase: a face holds the kit tone except within ±0.035 of a threshold, where it crossfades in 64 steps per band (`data-q`, 0…256). That fine step keeps chrome's high-contrast bands smooth. +- **The continuity line measures the unrounded geometry.** The page writes path coordinates rounded to 0.01 px, which moves an edge by at most 0.005 px, far below a device pixel. Measured on those rounded paths, a long edge's rounding steps never shrink, so the halving test once read large flat faces (the example's palm, a desk fan's 21-tall prism arms) as jumps that were not there. `orbit` therefore switches the runtime to exact coordinates (`TURN.exact(true)`) for the continuity line and back afterwards; large flat faces are fine on turning groups. +- Curved surfaces always use analytic iso-light bands (`labelledArcs`), never facets. Capsule domes are nested hulls; balls with flats are clipped caps. Bands are born at zero width. +- Faded-line slots hold ribs and bevels: alphas quantised to 1/32, as many slots as the build's orbit sweep shows a set needs. +- `lit: true` uses the lit tokens; with a material, the material's lit set. + +## 11. Static layers and a messy workshop around a turntable + +Every static item carries `layer` (`R.put({ …, layer: "back" })`) and the build proves a constant relation with every live layer over all reachable states, by the first rule that holds: a **horizontal plane** (the item is wholly under or over the layer's z range), the **cylinder rule** (the item lies wholly behind or in front of the turn group's swept cylinder along the view's floor direction), **never overlap** on screen, or a **swept-envelope plane**. Otherwise: `static S interleaves live layer Λ: split S at z = …, or move it`. + +Authoring rules for a dense workshop (`examples/turning-dial/stress.mjs` proves 450 relations: bench, turntable base, power unit, tool rack, cable reel, tray, wrench, three bench cables): +- **Keep clutter outside the swept cylinder or under the turntable plane.** Tall things (power units, racks, lamps) go behind or in front of the cylinder of radius R (the live layer's reach from the axis) along the view's floor direction (cos a, sin a). Things beside it, neither behind nor in front, must be low. +- **Anything under the turntable's lowest live z is behind the live layer, even when it sits in front on the bench.** It belongs in a layer under the live one (`back`), not `front`: the build says so. +- **A cable that must reach the turning part** runs on the bench to the stationary base, climbs inside it and reaches the turning part through a slip ring or rotary joint at the hub. Draw the static run to a port on the base, and start the live cables from a terminal block on the turning platter. No route ever spans static ground and a turning group. +- Static cables lie flat on the bench (bends in the bench plane, R ≥ 8r) so they never fold, and end on a port, a reel or a free end marked `free`. A cable resting on the bench (centre at bench top + r) touches it, which the kit's `clearance` check fails (`close stand.feed × stand.bench clearance 0.00 < 0.40`) unless the route says so: `R.route(name, route, r, { owner: name, limp: true, touch: ["stand.bench"] })`. +- `stress.mjs` is a performance and layer-proof scene, not an audit-clean one: its bench cables have no `touch` and its hand has loose links, so the kit audit fails it. Copy authoring patterns from `build.mjs`. + +## 12. Shaders that follow the turn and the groups + +`kit/gl.mjs` gains (both opt-in; old fragments see nothing new): +- `GLSL_TURN`: `uGroupX/Y/Z/T`, `toGroup(p)`, `toWorld(g)`, `dirToGroup(d)`, `dirToWorld(d)`, and the cover masks `uCoverEdge[60]`, `uCoverCount[6]`, `coverOf(vb, soft)`. +- `glslPose(Name, prefix = "uName")`: the same four functions for any group (`toDial`, `fromDial`, `dirToDial`, `dirFromDial`), so one shader can follow several groups. +- `glLayer` sends arrays longer than 4 to `vec2`/`vec3`/`vec4` uniform arrays by their declared type (float arrays unchanged). + +How a shader follows the motion: +1. **Content on a moving part** (an LED on a fingertip, a flame from a ruptured line's end, oil jetting from a pipe end): take the anchor every frame with `controller.anchor(group, restPoint, restDir)` and pass `world`, `screen` and `direction` as uniforms. Draw it on the **front canvas** (over the live layer) and occlude it with the parts painted after it: `const c = TURN.cover(controller, [partName]); layer.draw({ ...c, … })` and `ink *= 1. - coverOf(vb, .7 * px)`. Every live part is convex, so its hull is its exact silhouette; the cover is pushed out 0.3 vb so ink stops at the occluder's stroke, never in it. Several targets share the six polygons: `TURN.cover(controller, [["hand.f2.p3"], ["hand.pod.socket"]])`. +2. **Content fixed to a turning surface** (oil pooling on the turntable, a texture revealed by light on a dial): pass `TURN.poseUniforms(controller, "dial", "uDial")` and evaluate in rest-world coordinates: `vec3 q = toDial(onFloor(vb, FACE_Z));` The pool turns with the dial. +3. **Content in world space** (smoke rising, sparks after they leave the source, oil pooling on the bench outside the turntable): never touch a group transform. Emit particles from an anchor's world position at birth and integrate them in world space (the example's sparks): the turn doesn't drag them along. +4. **Back canvas** (light falling on a surface under the parts that cover it): put the canvas between two live layers. The example splits its dial into its own live layer `dial` under `hand`, so the LED's pool lands on the dial face and the hand covers it with no masks at all. + +Every rule of `webgl.md` still holds: envelopes, windows to 0 before any bound, light-theme inks (saturated bodies, pale cores, tinted ground, ink only grows with light), dither, canvas edges at 0, an SVG fallback (`T.billboard` inside the owning part, hidden under `[data-gl]`, handed over with `(1 − u)/(1 − u·α)`). The cover chunk uses 70 uniform vectors: read `MAX_FRAGMENT_UNIFORM_VECTORS` and keep the SVG fallback below 128. `GLSL_TURN` defines `toWorld`: don't prepend it to a fragment that declares its own. + +## 13. The orbit audit + +`node build.mjs --audit` runs the kit audit, then `TA.orbitOrExit(T, R, P, options)`, which prints one line per check and ends `turn audit passed` or `turn audit failed: n problems` (exit 1). Only a full run ends `turn audit passed`: a run with `only` ends `turn audit partial: no problems in what ran (n lines skipped by only)`, and a quick one `turn audit quick: no problems in what ran (quick run, undersampled: the full run is the proof)`. + +Options: `sweep: { at(x), from, to, frame }` (the turn), `clips: [{ name, at(t), from, to, frame }]` (gestures, the break-apart: every frame at 60 fps), `poses` (extra states), `crowd: [[route, part]…]` (pairs exempt from `crowding`, after you have looked), `cover`, `fittings: [[route, from, to]]` (stretches inside a fitting, exempt from `endon`), `quick` (≈ 10× fewer states, for iteration), `only: ["order", "rigid", "swept", "posed", "routes", "coverage", "continuity", "depth"]` (an unknown name throws), `log`. The example takes `--quick`, `--only=a,b` and `--verbose`. `only` runs these lines: `order` → `unseparated`, `cycles`, `forced`, `swaps`; `routes` → `folds`, `self`, `crowding`, `endon`; `depth` → `depth`, `layers`; the others their own line. `separation` always runs. A line that did not run prints `skipped`. + +**Time and how to iterate.** The orbit audit is slow, and its time grows with parts × states. Measured on a 28-part desk fan (one turn, one hinge, one clip): `--quick` 85 s, full 17 minutes. The example scene takes several minutes; budget about 30–40 s per part for a full run. That is past a 10-minute shell timeout, so: +1. Iterate with `--quick --only=…` on the lines you are fixing. +2. `--quick` alone before the final run. It undersamples: it checked 100 halving candidates against 800 in the full run and missed 20 `continuity` failures the full run found. +3. The final full run in the background (`node build.mjs --audit > audit.txt 2>&1 &`), read when it ends. Only that run's `turn audit passed` counts. + +| Line | Fails on | Fix | +|---|---|---| +| `separation` | A same-group pair with no plane (margin < −0.08) | Split, a flat, or a flush contact | +| `unseparated` | A cross-group pair interpenetrating while their hulls overlap; a framed plane that a state breaks | Fix the contact or the motion; add the motion to `poses()` | +| `cycles` | A cycle among overlapping parts in some state; prints the parts, the state range and the split plane (the cycle edge with the largest margin) | `T.split` that part on that plane | +| `forced` | The runtime had to force a pick | As cycles | +| `swaps` | Two overlapping parts swap order while overlapping more than 0.25 px² (0.5 px² for a pair built flush, margin under 0.05: at the instant their contact plane is edge-on, the true overlap is a line, and the drawn curves leave a sliver about 0.1 px wide) | Look first: `drive.mjs page.html '[["orbit", "swap.png", θ−0.3, θ+0.2, 0.1, null, 6, [x, y, w, h]]]'` (θ from the line; the region round the pair in CSS px of the plate, at scale 6). Something that appears or vanishes in one step is a drawing bug, not an order bug. Engines before 2026-10-06 drew a round with one `"dome"` end shorter than its radius with a wedge behind its flat end, which vanished when that end went edge-on: copy the current `turn.mjs`. A clean swap with sane order on both sides (`__isoTurn.order`) is a wrong plane: report it with the part pair and θ | +| `layers` | A static item on the wrong side of a live part (ray-cast) | Move it or split it (section 11) | +| `rigid` | Kit clearances, terminals, supports, solid clearances at rest | As in the kit audit. `support loose` on every part of a hinged group: nothing in it touches the parent (the knuckle disc, section 5). `terminal … from X`: the route starts at a port's face, not the mount (the `T.tube` row, section 4). `clearance … × stand.bench`: a bench cable without `touch` (section 11) | +| `swept` | A static shape inside a turn group's swept envelope | Move it out of the cylinder | +| `posed` | Shapes of different groups (and moving live × static) passing through each other in any sampled state | The motion or the geometry | +| `folds`, `self`, `endon` | Live routes at every angle and posed state | Section 5 (bend radius with the pitch range, section 8) | +| `crowding` | A live route's end or bend lands on the outline of a slender solid (a rod, post, stem) at some angle | A line parallel to a turning rod crosses the rod's outline at some angle whatever its offset, so you can't design it out. Look at the angles it names (`["turn", θ]` and a 4× shot), and if it reads as two separate parts, list the pair in `crowd: [["cable.a", "yaw.stem"]]`, or route the line inside the rod. A line that is not parallel: approach across the rod | +| `coverage` | A part's recorded shape covers < 60% of its drawing | Record the true shape | +| `depth` | The ray-cast oracle disagrees with the engine order | Report it | +| `continuity` | Per 0.05°: tone step > 1/16 band, a birth > 2 px², a dot α step > 0.01, a faded α step > 1/32 + 0.005, outline motion over 1.5·ω·Δθ + 0.05 px; and the halving test | A detail that stops: fade it. A part whose outline or face boundary jumps in one step: find the angle with an orbit sheet at 0.1°; on a plain kit primitive it is an engine bug, report it with the part and θ. `--quick` undersamples: only the full run counts | + +The halving test re-emits each candidate step at ½, ¼ and ⅛ of itself with exact coordinates, rasterises the frames at 4× (jittered samples on 8 sub-scanlines) and measures the pixels that change owner, weighted by tone. A smooth change halves with the step; a jump doesn't. A step is a discontinuity when it stays above 60% at each halving and is still ≥ 2 tone·px² at ⅛, measured at 4× and again at 16×: a step that fails at 4× fails only if it also fails at 16×. Measured on the page's rounded paths instead, every long edge keeps a floor of about its length × 0.01 px that never shrinks; that floor is what flagged large flat faces before the switch to exact coordinates. Every line has a planted fault that fails it (`3d/engine/plants.mjs` in the build session: a sunk pad, a pinwheel of three tilted sticks, a vertical-plane fibre bend, a tube at 30°, a stopped rib row). + +## 14. Browser checks + +```sh +node examples/turning-dial/build.mjs --light --verify # writes turning-dial-verify-light.html +node scripts/turn-check.mjs examples/turning-dial/build.mjs --fidelity +node scripts/turn-check.mjs page-verify.html --order --step 1 +node scripts/turn-check.mjs page-verify.html --order --states clip.json +node scripts/turn-check.mjs page.html --pops --no-webgl --step 1 --out shots/pops +node scripts/turn-check.mjs page.html --lines # and the dark page +node scripts/turn-check.mjs page.html --perf --width 1440 +node scripts/turn-check.mjs page.html --perf --width 390 --throttle 4 +node scripts/turn-bench.mjs examples/turning-dial/build.mjs +node scripts/drive.mjs page.html '[["turn", 37], ["shot", "a.png"], ["orbit", "orbit.png", 0, 345, 15]]' +``` +- `--fidelity` (Node): prisms against `k.extrude`/`G.prismOf` (outline, top and faces each ≤ 0.06 px), rounds and lathes against `G.lathe(…, smooth)` (outline ≤ 0.05 px against the kit drawn at 10×, bands ≤ 0.5 px; the line also prints the outline against the kit's own paths, which round to 0.1 px, so 0.08–0.13 px there is expected and not judged), tubes against `tubePieces` (0.05 px), at P′(θ). Control: one prism drawn 2° off must fail. +- `--order`: the recorded shapes in a WebGL z-buffer against the DOM painter's fills, 2×; a live pair with 4+ interior pixels fails. Control: each live layer reversed must give ≥ 1000 px. Static × live mismatches are listed (static recorded shapes are often stand-ins, such as a slab for a plate with a window). `--part name` prints a part's footprint in both images. `--step` sweeps the **first turn group only**, with every other group at rest: a hinge, a slide or a clip needs `--states`. +- `--pops`: first difference (θ → θ + 0.02°, two erosions) and second difference (0.1°, |2b − a − c| > 56, or > 6 on flat pixels, one erosion; a core of 6 px fails). Control: the largest part hidden for one frame. `--out dir` saves the first core's frames. With `--states`, consecutive entries are treated as neighbouring frames and only the first difference runs, so the list must be **one continuous path in steps of about 0.02°**: 529 unrelated yaw × tilt poses gave 404 false failures; a tilt sweep of 1201 states at 0.02° gave 0. +- `--states file.json`: a list of value objects instead of angles. Write them from the build module, which exports `follow` and the clip functions: + ```js + import { writeFileSync } from "node:fs"; + import { follow, nodAt } from "./build.mjs"; + const at = (t) => follow({ yaw: 20 + 30 * t, tilt: nodAt(t) }); + writeFileSync("clip.json", JSON.stringify(Array.from({ length: 241 }, (_, i) => at(i / 60)))); + writeFileSync("tilt-path.json", JSON.stringify(Array.from({ length: 1201 }, (_, i) => follow({ yaw: 30, tilt: -12 + i * 0.02 })))); + ``` + `clip.json` (every 60 fps frame of the clip) is for `--order`; `tilt-path.json` (one hinge swept at 0.02°) is for `--pops`. Run `--pops` on one path per hinge, at a turn angle where the hinge's parts overlap the most. + +## 15. Performance + +Measured by `turn-bench` (Node CPU) and `turn-check --perf` (browser, 240 frames at 1.1°). + +**What a part costs.** `turn-bench` prints the Node time per part by kind. In prism units (one live prism, about 0.03–0.04 ms per frame on the build machine): + +| Kind | Cost | Kind | Cost | +|---|---|---|---| +| `fixed` (vertical rounds, plain balls) | 0.5 | `round` | 2.5–4 | +| `prism` | 1 | `ball` with flats | 8–10 | +| tube chunk | 2–3 | `lathe` | about 25 | + +A figure's weight is the sum. A **small figure** weighs up to about 50 (a few dozen parts, mostly prisms and fixed pictures); a **dense** one up to about 230. The desk fan (28 parts: 6 prisms, 7 fixed, 5 tube chunks, 8 rounds, 2 balls with flats) weighs about 65, and measured 1.6–1.9 ms of Node CPU per frame and a 6.0 ms browser task at 1440, so it is over the small-figure line, mostly because of its two balls. The turning dial (88 parts, 42 rounds, one lathe) weighs about 225 and measures 6.4–7.2 ms. A ball with flats is the right part for a domed end with a rim landing on it (section 5), but it costs as much as nine prisms; a plain ball or a vertical round is a fixed picture and nearly free. Times vary by machine and load: compare kinds within one run, and measure your own figure. + +| Measure | Budget for a small figure (weight ≤ 50) | Budget for a dense figure (weight ≤ 230) | +|---|---|---| +| Node CPU per frame | ≤ 2 ms | ≤ 7 ms | +| Browser main-thread task at 1440, DPR 2 | ≤ 6 ms | ≤ 13 ms (60 fps) | +| Main thread at 390, DPR 3, 4× CPU | ≤ 16 ms | ≤ 33 ms (30 fps) | +| `data.turn` JSON | | ≤ 250 KB | + +Levers, in order: +1. `fixed` for every vertical-axis turned part and every plain sphere (automatic). +2. Planes for every set of lines or text on a face; upright prism tops are one matrix. +3. Small parts sample by device pixels: rings, caps and domes of a part under 30 px round take 12–16 samples, never the large-part minimums. +4. **Framed planes and the relative-pose cache** (automatic): cross-group pairs cost nothing while their groups keep their relative pose (a pure turntable turn), and pairs whose motion the build sampled are framed planes. +5. **Adaptive half rate** (the figure's loop): keep an exponential moving average of `controller.set(...)` time; above 14 ms render the live layers on alternate frames (time-based motion unchanged), below 9 ms every frame again (`stress.mjs`'s loop). +6. **Detail by speed** (opt-in): `controller.set(values, { detail })` with `detail = settle(1 − smoothstep(120, 240, |ω|°/s), 0.25 s)`: faded lines, ribs and dots scale and are skipped below 0.01. Outlines and tones are never reduced. + +Authoring rules that keep a figure inside budget: about 150–250 live parts per moving group; small details as `details` (dots, rings, bolts) rather than parts; static clutter as static art; one live layer per independently moving region; tubes chunked at 6 with as few chunks as the bends allow. The measured numbers for the example and the stress scene are in the skill's build notes; a 380-part flexing hand on this machine is a 30 fps figure at 1440 with the half-rate lever, not a 60 fps one. + +## 16. Known limits + +- Vertical turn axes take the azimuth shortcut; other rotations compose matrices. +- Only convex parts. Concave bodies are convex pieces; ball flats replace rim-on-sphere joints. +- Live tubes obey the fold and end-on rules: there are no swept-tube silhouettes, so turns happen flat or in fittings, and no route spans two moving groups. +- No automatic splitting: a cycle is an audit failure with a suggested plane. +- Flat faces crossfade over ±0.035 of score (about 8° of turn). +- Lathes keep small residual steps where a band changes topology. +- Free groups pair at runtime with their whole layer; dozens of debris pieces cost GJK while they move. +- Phones: the budget aims at 30 fps, not 60, and only a figure inside it gets there. The 380-part stress scene (`examples/turning-dial/stress.mjs`) measured about 20 fps at 1440 and 13–15 fps at 390 with 4× CPU throttle, with the half-rate lever, on a heavily loaded machine. There is no canvas painter. diff --git a/skills/anatomy/references/craft.md b/skills/anatomy/references/craft.md new file mode 100644 index 0000000..935fa66 --- /dev/null +++ b/skills/anatomy/references/craft.md @@ -0,0 +1,325 @@ +# Craft + +How a figure comes to read as a crafted object rather than a diagram. Every rule here came from a figure that was rejected or approved by a demanding reviewer. + +## Contents +1. What "crafted" means +2. Anti-patterns +3. Parts vocabulary, with recipes +4. Tones +5. Painter's order +6. Camera and composition +7. Themes +8. Round parts and pipes +9. Exploded views +10. Screens and things on faces +11. Shaders + +## 1. What "crafted" means + +The approved figures share five qualities. + +1. **A real object you could build.** The reader names it at a glance: a test rig, a dial indicator, a chest of drawers, a gantry plotter, a lock. It is invented for the subject, never traced from a reference. +2. **Many small, precise parts.** A good inline figure has 30–60 solids and 300–500 paths. A hero subject that really has more parts can carry far more: the desk computer has about 85 solids, and the Raptor about 270 solids in 478 depth-sorted items. Every part rests on another part, aligns to its neighbours and has a job. Density comes from structure (feet, rails, stops, bushings, knobs), not from texture. +3. **Volume.** Parts have real thickness, sides shaded in four tones, lighter tops, bevels that catch light, and a soft halo underneath. +4. **Calm.** Thin 0.6 px lines and a restrained palette. One lit accent tells the eye where to look. Motion is eased and slow enough to follow. +5. **Truth.** The readout shows live, correct numbers, and the motion follows the real model: springs with real stiffness, true sizes and thresholds. + +## 2. Anti-patterns + +Reviewers rejected each of these, so don't do them: + +- **Abstract stacks.** Floating plates, slabs or tiles standing for "layers" are too abstract to read as anything. If you need layers, make them drawers, trays in a rack, plates on guide pillars, or cards in a holder. +- **One big plain slab.** A large surface with a few lines is too flat and bland. Break it into a base, a carriage and parts; add a groove, screws, a ruler and a label plate. +- **Blueprint furniture.** Leader lines, balloons with numbers, dimension arrows, hatching, dashed hidden edges and floating labels belong in the legend and caption, not the drawing. +- **Lines that stop in mid-air.** Guide fans, connectors that end short of a part, or a crease that stops before the silhouette corner. Every line must land on something. +- **Wireframes.** See-through boxes where the back edges show. +- **Colour everywhere.** Keep it monochrome unless colour is the subject: one lit accent plus true RGB only for colour channels. A fluid is not colour by default: oil in a sight glass, water in a tank and coolant in a pipe are tints of the figure's own inks, and the `--no-webgl` fallback draws the same tint the shader does. A blind-test bench painted its oil saturated orange in an otherwise grey figure, and its fallback oil was grey. +- **Text in the drawing.** Allow at most one tiny engraved label (`FaceText` on a face). Everything else goes in the card corners, legend or caption. +- **Copying a reference.** Take mood and finish from a reference, then invent the object. +- **Raw pointer jumps.** Parts that snap to the cursor. Ease everything. +- **Pipes through pipes.** On the first Raptor the owner zoomed in and found cables and lines passing through the main ducts and through each other, "which makes no sense". At 1× it looked fine. Every pipe and cable keeps clear of everything but its own connection, every crossing is drawn in true depth order, and `kit/audit.mjs` proves both (section 8, "Clearance and crossings"). +- **Textures that stop.** On the same close-up, rows of bolt dots on the chamber stopped dead in the middle of the surface, and the bell and throat were shaded as a staircase of flat tone blocks. Both read as broken. The owner's words: if a texture has to end, "we'd rather fade them out at the end than an instant stop". Shade curved surfaces smoothly, and make a texture end on a real edge or fade out (section 8, "Shading and textures on curved surfaces"). +- **Shaders that pop or are cut.** The first Raptor plume changed colour instantly between its phases, "as if cut out", and a glow ended in a straight line at the canvas edge. Every shader term rides an envelope and reaches zero before any bound (`webgl.md`, section 7). +- **Textures that stop, on flat faces too.** The same fault came back on a later figure's boxes, where no curved-surface rule reached it: a tank's weld seam inset 6 units from each rounded corner, a manifold face line inset 4, a row of faint ticks floating on a bare bedplate with no ruler under them, cooling ribs that stopped 2 units short of the seam arcs at both ends, and a hose braid drawn as a dashed stroke down the centreline that ended in two straight hard edges along the hose and broke at every chunk joint. A seam on a box runs edge to edge round the visible corners (`k.sideSeam`), ribs end on seams at the same `s` (`ribsOf(…, { seams: true })`), ticks hang from a ruler strip's edge, and a texture on a pipe comes from `tubePieces(…, { rings })`. `node scripts/lines.mjs page.html` fails every line end that touches nothing (`verify.md`, "Line ends"). +- **Stand-in shapes.** To quiet the audit a builder recorded a 0.45-thick disc at the tip of each of five overlapping rod copies, and a sliver for a second rod that was drawn sunk into its cylinder head. The audit passed and said nothing about either rod, and the lit rod's outline was notched every 12 units while it moved. Record the true shape of what you draw; the audit's stand-in check fails an item whose recorded shapes cover less than 60% of its drawing. A rod that slides out of a gland is one rod (section 3, "Rod out of a gland"). +- **Dark-theme glows pasted on white.** The owner made light the shipping theme for every site figure, and seven shader figures built on a dark plate had to be converted. Taking a dark glow and darkening it gave "red ink smoke" (the Raptor's light plume). It also gave flames drawn as outlines, sparks that looked like dirt, salmon-coloured cooling glass, grey fades and cavities that got heavier as the fire went out. On paper, light reads through saturation and a darker physical ground (section 7, and `webgl.md`, section 8). +- **Fixing one close-up by eye.** Tuning a painter's key or nudging a waypoint until one screenshot looks right breaks another frame or another theme. The Raptor's hand-set keys looked right at 1× and had 323 depth-order problems. Measure (section 8, "Clearance and crossings"), then look. + +## 3. Parts vocabulary, with recipes + +`P` is the projection and `k` is the kit, as in `import * as k from "./iso-kit"`. Heights are in world units, with z up. Draw each recipe's solids in the order listed. + +### Base plate on feet +```js +const PLATE = { x: -128, y: -64, w: 262, d: 128, r: 8 }; +halo: `` +feet: for (const [x, y] of byDepth(k.corners(PLATE, 22))) { + k.cylinder(x, y, 7, -17, 1.6, P, 28) // flange, tone lo + k.cylinder(x, y, 5.4, -15.4, 3.4, P, 28) // foot, tone mid + } +slab: k.slabOf(PLATE, -12, 12, P, 8, 1.6) // tone mid, bevel 1.6 +groove: k.planOutline(k.insetPlan(PLATE, 5), 0, P) // line lo +screws: k.corners(PLATE, 10) → k.ring(x, y, 2.2, 0, P, 16) (line lo) + dots size .5 +``` +Sort feet with `byDepth = (pts) => [...pts].sort((a, b) => k.depthOf([a[0], a[1], 0], P) - k.depthOf([b[0], b[1], 0], P))`. + +### Ruler strip and label plate +```js +const strip = { x: -110, y: PLATE.y + PLATE.d - 15, w: 230, d: 7, r: 1 }; +k.slabOf(strip, 0, 0.6, P, 3) // tone lo, crease none +const t = k.topTicks(strip.x + 4, strip.x + strip.w - 4, 4, 5, strip.y + 0.8, 0.6, [2, 3.6], P); +t.minor → line lo, t.major → line mid +label plate: k.slabOf(plan, 0, 0.8, P, 4) + k.planOutline(k.insetPlan(plan, 1.6), 0.8, P) (faint) + + three k.lineOnTop rule lines of different lengths (lo, { free: true }) + two screw dots +``` +Ticks only live on a ruler strip or a dial face, rooted on its edge: `topTicks` grows each tick from `edge`, so put `edge` on (or within 1 unit of) the strip's edge, and `sideTicks` hangs them from `top`, so pass the face's top edge, not 2 units below it. A row of marks on a bare plate is a texture that floats at both ends. The label plate's rule lines stand for printed text, so they are the one place a line may stop on a bare face: pass `free: true` so the line check knows it was meant. + +### Seams, welds and trim lines on a box +```js +const seam = k.sideSeam(TANK, 14, P, 6); // visible near half of the plan at z = 14, round the corners +k.solidSvg(k.slabOf(TANK, 6, 98, P, 6, 1.2), { tone: "mid", inner: k.lineSvg(seam, { tone: "faint" }) }) +``` +A seam, weld bead, band or lid line on a box wraps the visible corners and ends exactly on the vertical silhouette edges, like `sideArc` on a cylinder. Pass the slab's own `steps` so the seam follows the same facets, and pass it as `inner` so its ends sit under the outline. A line that belongs to one face only (a stiffener, a panel joint) runs the full face, edge to edge: `segment([x, y, z0], [x, y, z1])` with `z0` and `z1` the face's bottom and top, never `z0 + 3`. Slots and vents are closed outlines (a `planOutline` of a thin rounded plan, or the same in a face plane), so they have no ends at all. Never inset a line by a few units from its corners: at 4× it reads as a texture that stops. + +### Rod out of a gland +A piston rod, a plunger or a slide whose visible length changes as it moves is one rod, built once at full length (visible plus stroke), with the part inside the gland clipped away: +```js +const ROD = G.rodOut(F, gland, tip, r, P, { stroke }); // F.a points out of the gland +svg = `${k.solidSvg(ROD.paths, { lit: true })}` +R.put({ ..., move: G.mul3(F.a, stroke), svg, shapes: [R.solid(A.slide(F, gland, tip, r, { name: "rod" }))] }) +live: el.setAttribute("transform", `translate(${dx} ${dy})`); holdStill(el, [dx, dy]) // dx, dy: the item's screen offset this frame +``` +`rodOut` returns the rod's paths from `gland − stroke` to `tip` and a clip that covers it from the gland face to `tip + stroke`. The clip path carries `data-hold`; whatever moves the item calls `holdStill(el, [dx, dy])` with the same screen offset, which moves the clip the other way, so the gland face stays put while the rod slides through it. The same helper retracts a rod into a gland (a load cylinder) when its item moves the other way. Draw a faint seal ring (`circleOf` at the gland face, radius `r + 0.4`) on the gland. Record it with `A.slide`, which the audit poses by stretching the rod from the gland face instead of translating it, so clearances, depth and solid checks see the true rod in every frame. Never fake the extension with overlapping copies: each copy's lit edge stops where the next one's fill starts, and the outline is notched every few units while it moves. + +### Rails, end stops and a carriage +```js +rails: for y of [-20, 15]: k.slabOf({ x: 2, y, w: 122, d: 5, r: 1 }, 0, 3, P, 3, 0.4) // mid +stops: k.slabOf({ x, y: -23, w: 5, d: 46, r: 1.2 }, 0, 7, P, 3, 0.5) + 2 screw dots on top +carriage (built at x = 0, moved with translateAlong): + k.slabOf({ x: -28, y: -24, w: 56, d: 48, r: 3 }, 3, 5, P, 5, 0.6) + bushings: small slabs at the four corners, taller than the plate, with screw dots + rivets: a row of 0.4 dots along the front edge + handle: a small neck slab plus a knurled cylinder on the front face +``` + +### Post, collar, clamp and thumb screw +```js +k.cylinder(px, py, 5, z0, 4, P, 28) // collar +k.cylinder(px, py, 3.2, z0 + 4, h, P, 28) // post, crease none +k.sideArc(px, py, 3.2, z, P, 16) // faint seam rings on the post +k.slabOf({ x: px - 7, y: py - 7, w: 14, d: 14, r: 2.5 }, zc, 12, P, 4, 0.6) // clamp block +thumb screw: a 2.8 × 3 neck slab from the clamp face + k.cylinder(r 2.6, h 6) + k.knurl(..., 18) +``` + +### Knurled knob with a pointer +```js +k.cylinder(cx, cy, 6, z, 4, P, 32) // mid +k.knurl(cx, cy, 6, z, z + 4, 36, P) // line lo +k.lineOnTop([cx - 3, cy], [cx + 4.6, cy], z + 4, P) // pointer, line hi +``` + +### Coil spring around a rod (split for painter's order) +```js +const c = k.coil(xFrom, xTo, [rodY, rodZ], 4.2, 6, "x", P); +c.back → line lo, drawn BEFORE the rod +rod → k.slabOf({ x, y: rodY - 2, w, d: 4, r: 1.8 }, rodZ - 2, 4, P, 3) +c.front → line mid, drawn AFTER the rod +``` +Rebuild the coil each frame when it compresses, by changing `xFrom`/`xTo`. It is cheap. + +### Dial gauge (face up) +```js +k.cylinder(x, y, R, z, 10, P, 64, 0.8) // puck, tone hi, crease lo +k.knurl(x, y, R, top - 3.4, top, 84, P, 0.3) // knurled bezel band, lo +k.sideArc(x, y, R, top - 3.4, P, 40) // band seam, faint +k.ring(x, y, R - 2.2, top, P, 64) // bezel ring, lo +const t = k.radialTicks(x, y, R - 3, 50, 5, top, [1.3, 2.8], P) // minor lo, major mid +crown: two small slabs on the +x side; lug: a slab joining the arm +needle: k.lineOnTop(tail, tip, top + 0.2, P), tone lit, stroke-width 1.1, rebuilt per frame +hub: k.ring(x, y, 1.6, top, P, 16) +``` + +### Drawer with a pull and label holder +```js +case: k.slabOf(casePlan, z, h, P, 4, 0.8) +front: a thin slab on the near face; pull: two posts plus a bar (small slabs) +holder: an inset outline on the front with a card slab inside; rivets as 0.45 dots +open: translate the drawer along its axis with translateAlong; its box (floor plus 3 walls) + is drawn before the front, and its contents are engraved on the floor +``` + +### Turntable with degree ticks +```js +k.cylinder(cx, cy, R, z, 4, P, 72, 0.8) +k.radialTicks(cx, cy, R - 1, 72, 6, z + 4, [1.2, 2.6], P) +rotate: rebuild only what turns (or the object on top) at the new angle each frame +``` + +### Perforations, vents and a pulsing dot grid +```js +k.dotGrid(x, y, cols, rows, gap, zTop, P) → dotsSvg(points, { size: .45, tone: "lo" }) +// add { pulse: true } for a slow pulsing grid on an "active" part +``` + +### Lamp, probe and finger +These are stacks of cylinders: housing, cap ring, collar, stem, pad. Seam rings come from `sideArc`, and the lock screw is a small slab plus a cylinder head on the side. + +## 4. Tones + +| Element | Tone | +|---|---| +| Base, feet, floors | `lo` | +| Structure: posts, rails, frame, carriage, case | `mid` | +| The subject: the thing being explained | `hi` | +| The part the reader should watch now | `lit` (one only) | +| Grooves, inset outlines, floor grid | `faint` | +| Minor ticks | `lo` | +| Major ticks | `mid` | +| Zero mark, pointer line | `hi` | +| Screws and rivets | dots `mid` at 0.4–0.55 | +| Crease (top/side join) | `faint` (default), `lo` on hi parts | + +A `Solid` with `lit` gets a white edge and a lighter top. Use it for the moving subject, the plunger or a picked drawer. + +## 5. Painter's order + +- Draw the base first, then everything resting on it. +- Within a level, sort by `depthOf(centre, P)`, ascending: far before near. +- **Split wrapping parts.** For a spring or a frame around a carriage, draw the back half, then the inner part, then the front half. In the test rig: back frame bars → rods with the back coil halves → carriage → glass → front coil halves → front bars → dial. +- **Moving parts** are drawn at their slot in the order, inside a `` that moves them. If a moving part can pass in front of and behind the same neighbour, split the neighbour or bound the motion so the order never changes. +- **Things standing on a stepped surface.** Order the steps so the taller ones are further back. A probe resting on a lower step then can't be hidden by a taller one in front of it. +- Vertical parts that pass through a horizontal one (a post through a clamp) are drawn in two segments, below and above, around the horizontal part. +- **A clip cut is an edge.** Where a clip ends one part against another (a cable-chain run entering its loop, a rod at a gland), make the clip's section flush with the joint plane, and draw a stroked edge along the cut that moves with the clip (`data-clip`). On the plasma cutter, a run's clip section reached past the joint. The run's top face and slot bars were drawn 26 units into the loop's hollow and ended on a vertical cut with no stroke, which is a line stopping in mid-air. Re-ordering the painter's keys wouldn't have fixed it: the loop link's end face really is behind the run. +- **Dense figures settle their keys from geometry.** Past a few dozen overlapping parts, hand-set biases fight each other. Give every item its true shape and let `kit/audit.mjs` measure which surface is nearer wherever two items overlap, then `orderKeys` raises each key just enough to satisfy every pair (`kit.md`, section 12). What it can't satisfy is a pair that interlocks, which needs a split. The first Raptor's hand-set keys left 190 pairs drawn the wrong way round assembled and 133 apart; measured keys took both to zero. +- **Crossings sort per chunk.** A pipe or cable is drawn as `tubePieces` chunks, each its own item at its own depth, so one line can pass in front of one part and behind the next. Where two lines cross on screen, the chunk nearer the camera is drawn later; a crossing can only be ordered if neither chunk also runs behind the other somewhere else, so break long chunks at a crossing (`breaks`). + +## 6. Camera and composition + +- Default camera: azimuth 45°, elevation 30°. Rotate the azimuth (35–60°) so the face that carries the mechanism points at the viewer. The test rig uses 57° to show the long side. Raise the elevation to look into something open: the ripple tank uses 44° so the water surface and the paper under the tank both read. +- Fit with `fitProjection(boxCorners(...) ∪ tallest points, width, height, { pad: 24–34, azimuth })`. Typical viewBoxes are 600 × 340–380. +- The object fills about 55–65% of the card. Leave air around it, don't let it touch the corner labels, and keep sizes consistent across a set of figures. +- On phones (390 px), check it still reads. If parts get too small, scale the SVG up to about 110–118% inside a card with `overflow: hidden` and a negative margin, as `stretch.css` does in the test-rig example. + +## 7. Themes + +`ISO_CSS` defines tokens on `.iso`, with dark as the default and `.iso[data-theme="light"]` for light. Every fill and stroke reads a token, so a theme is just a token set. To tune one: + +- **Paper** (`--anatomy-paper`) equals the card colour, so fills hide what is behind without showing as patches. +- **Shades.** Four steps from darkest (0, facing away from the light) to lightest (3). Keep them close: about 3% apart in luminance. +- **Lines.** In dark mode, `hi` is near-white and `faint` barely above the paper. Light mode inverts this. +- **Halo.** A blurred dark fill under the base: strong in dark mode, about 30% in light. + +**Light ships.** Every figure on the isometrics site is light, and that includes its shaders. Design light first and keep dark working where that is cheap. What the seven shader conversions taught about the drawing: +- **Every colour is a token.** A colour typed into a figure's CSS or its shader is a theme bug waiting to happen. Give it a light value and a dark override (`.x { --x: … }`, then `.iso[data-theme="dark"] .x { --x: … }`). Where the shader needs the same colour, read it from the token (`webgl.md`, section 8.3). +- **Cavities get their own token set.** The inside of a furnace mouth, a ladle, a vessel seen through a cutaway, a water column or a duct window is darker for a reason: soot, refractory, depth, shadow. Give its group a class that redefines `--anatomy-paper`, `--anatomy-face`, `--anatomy-top`, the four shades and the line tones to darker, warmer or bluer greys. Keep all the tones so it still has form, mix it toward the light's hue by a variable the live code writes, and set the tokens to `inherit` in dark. Glows then have a ground, without a black box. +- **Mind nested themes.** A dark plate can sit on a light page. A rule written `.iso:not([data-theme="dark"]) .x` also matches through the page around it. Order the dark rule after the light one, or key on the plate's own theme. +- **Opacity fades a pale colour to grey.** Anything that fades by opacity in light (a fallback glow, a lit accent) gets a saturated token, and its tints are multiply-blended so the lines under them stay visible. + +## 8. Round parts and pipes + +Engines, pumps, valves, lamps and instruments are mostly turned parts and pipes. `kit/lathe.mjs` and `kit/tube.mjs` build them along any axis (`references/kit.md`, sections 10 and 11). `examples/raptor-engine/build.mjs` has every recipe below in working form. + +### Turned parts: think in meridians +Write a part as its half-section: a list of `[s, r]` from one end to the other, and turn it with `G.solidOf(profile, F, P)`. +- **Steps and shoulders** are where the radius jumps at one `s`: `[6, 12], [6, 9]`. They make the crease lines that read as machining. +- **Curves** are many points marked smooth (`[s, r, 1]`), so no crease is drawn across them: a bell, a dome, a fillet into a flange. The kit shades any profile with a smooth vertex smoothly on its own (`smooth: "auto"`), so the shading follows the curve instead of stepping facet by facet; pass `smooth: false` only to opt out. +- **A waisted body is never hulled.** A profile that narrows in the middle (a throat, a spool) has a concave outline. `lathe` notices when its true silhouette lies more than half a pixel inside the hull of its rings and then fills and outlines it with the silhouette and the visible end arcs instead (`fill: "auto"`, or force `"surface"`). Drawn as a hull, the Raptor throat was a straight cone with a pale unshaded strip and a seam that stopped 8 px short of the outline. +- **Seams and weld lines** on a curved surface are `G.arcOf(F, s, r, P, { slope })`, with the profile's slope at that ring, drawn `faint` and passed as the solid's `inner` (`solidSvg(paths, { inner: lineSvg(arcOf(…), { tone: "faint" }) })`; the Raptor's `S` and `Ln` are one-line wrappers over these), so they sit under the outline. They end exactly at the limb, a little short of it. Concatenated after the solid, each seam's round cap lands on the edge stroke and the dark-theme outline of the Raptor's actuator barrels looked dashed at 4×. +- **A long body** (a nozzle, a barrel) is cut into bands with `G.bandsOf(profile, cuts, F, P, { radius, slope })`, so each band depth-sorts against the pipes that wrap it. The bands share one `steps`, one normal field and one surface, their own outlines come cleared, and `sidesOf` draws one continuous outline for the whole body (`kit.md`, section 10), so the tone curves run through every joint without a step and the sides don't kink. Without an analytic `radius` and `slope` it fits one curve through the whole profile, never one per band. +- **A ring around a band** (a stiffening ring on a chamber, a collar) splits the band: band, ring, band. Drawn as one long band with the ring on top, the ring's back half paints over the band (or the band hides the ring's front); split, each piece orders itself. The Raptor chamber jacket is three bands between its two rings. +- **An open end** is a `ringBand` lip, with a filled void (`circleOf`) for the dark inside and the inside arc from `arcOf(..., { inward: true, least: -1 })`. Bolt dots go around the lip. + +### Parts on a round body +- **Flange:** its back face sits on the route end, so the route ends exactly on the mount's surface and the disc runs from there back along the pipe (`centre = end − tangent · t/2`). `disc(-t/2, t/2, r, frameAlong(centre, axis), P)`, with a bolt circle `dotsOf(F, faceS, 0.74r, 8, P, { all: true })` on the face that points at the viewer. Skip the bolts when the face is edge-on (`|dot(a, V)| < 0.12`). +- **Boss or port** on a curved wall: a short `disc` along the outward normal, with a `faint` face ring (`circleOf`) when it faces you. This is where a sense line, igniter or plug lands. Make it at least as wide as the flange that lands on it; a flange that overhangs its boss floats at the rim. +- **Saddle pad.** A flat flange on a curved body leaves a gap at its rim (the sagitta, `R − √(R² − a²)`): an 11.6 flange on an 18.4 pump body stood 4 units off at the sides. Wherever that gap would be more than about 0.15, seat the flange on a pad: a short cylinder whose base follows the host surface (`G.saddleOf(F, a, start, h, P)` with `start(angle)` found from the host's shape, the Raptor's `padOn`/`boss(..., { host })`). Record it as a disc `cut` by its host and marked `seated`, so the audit sees its true shape. Keep the pad inside one band of the host (an overhang under a step is drawn in front of the band that hides it; a Raptor pad lowered until its rim touched the step below became an interlock in every frame) and off the host's silhouette: a pad that straddles the silhouette is half in front of and half behind its host, and no painter's order draws it. The Raptor's LOX duct moved from 130° to 150° for that reason. **A saddle belongs to its host's assembly.** Its base is cut to the host's curve, so if it flies out with the pipe the cut base is on show apart: the Raptor's hot-gas pad, cut to the methane pump's turbine and ring, became a jagged shard with a pointed tail. Give the pad to the host's piece (`boss("ftp", …, { host: FTP_TURBINE })`) and let the moving pipe's flange leave its flat top; the audit's `seats` lists every seated shape whose host moves with another assembly. +- **Igniter plug, one terminal.** A plug carries either the igniter line (leaving its outer face along its axis) or the exciter cable, never both. The cable lands on its own small boss beside it. +- **Valve on a pipe:** a bulged `lathe` profile on `frameAlong(point, tangent)` turned with `smooth: true`, with bolt dots on both end faces, a round neck and an actuator box with a lid outline and two screws. It sits on a straight leg (body length plus both fillet cuts), the pipe is gapped under its body, and the actuator stands perpendicular to the pipe: up on a level pipe, sideways (a round can) on a vertical one, never along the pipe. +- **Volute:** `spiral(F, s, r0, r1, a0, a1)` fed to `tubePieces` with a radius that grows along it. Keep its centreline at housing radius plus tube radius plus 0.3, so it wraps the housing tangentially; a volute sunk into the housing is a pipe through a solid. +- **Ball joints and tees** are spheres (`sphereOf`): a rod-end bearing on an actuator, a cast tee where a branch meets a manifold. +- **Knurls, ribs and fins on a tilted axis:** `ribsOf`. Vanes on a face: `spokesOf` with a `sweep`. + +### Pipes +- Lay out a route as a few straight legs between real ports, then `fillet` it with a bend of about 2.6 × the pipe radius. Pipes bend; they don't kink. +- End every pipe on a port with a flange, or on a block with a terminal dot. A pipe that stops in the air is a line that stops in the air. +- Add the parts a real line has: bands where it is clamped or welded (`bands: [0.5]`), a bellows where it must flex (a run of thin `disc`s, `bellows: [from, to, count]`), and a valve where flow is controlled. These are the Raptor `pipe()` helper's options (`kit.md`, section 11). +- Use few sizes, all big enough to tell apart: main ducts (r 5–8), feed lines (r 2–4), sense lines (r 0.9–1.5), cables (r 0.5–0.65). + +### Choosing waypoints +Route the big lines first (ducts, downcomers, manifolds), then feed lines, then sense lines, then cables, so each smaller line routes round what is already there. For each route: +- **Start on the port's normal.** The first leg leaves the port straight out along its surface normal, long enough for the flange, then the bend: `fillet` takes at most 0.48 of the shorter leg, so a leg shorter than about twice the bend radius gives a tight bend, and a turn right at a port facing the viewer pinches ("Clearance and crossings", step 5). +- **Follow structure.** Legs run parallel to the body they follow (along a chamber, up a downcomer) or round it on a ring at a fixed radius (`arcPoints`), offset from its skin by the body's own clearance: skin radius plus about 1.5 × the line's radius. The owner's close-up showed sense lines fanning across the chamber's face and over the main duct to reach their block; on the new build the long line from the nozzle manifold runs up the left side, the fuel-valve cable runs up beside the downcomer, and the harness comes down from the controller in parallel drops into clamped lanes. +- **Stay on your side of the subject.** A line that serves a port on the far side goes round the back or round the side at a ring, never diagonally across the front of the thing being explained. +- **Prefer legs across the screen.** A leg that runs straight toward or away from the viewer projects short and makes every turn at its ends a cusp or a V ("Clearance and crossings", steps 4 and 5). +- **Leave room for fittings.** A valve, bellows or clamp needs a straight leg at least its body plus both bend allowances (`r_bend · tan(turn / 2)` each). On a bend the straight body cuts into the pipe; the Raptor's downcomer was rerouted so its valve sits on a straight run, and the oxygen duct gained a vertical straight for its valve. +- **Don't land on a rod.** A pipe's last leg must not run along a rod, tie rod, post or rail on screen, and its end fitting must not sit on one's outline: the blind-test bench's hose ran its last leg parallel to a tie rod, 2 px above it, so the rod read as plugged into the hose fitting. Approach the port across the rods, or turn the elbow so the leg lies across the screen. The audit's `crowding` treats every slender solid (length over 4× its radius or half-width) as a line, so it fails these. Check every pose too: a ferrule that sits on a moving plate's edge at the end of the stroke reads as touching it. +- **Cross deliberately.** If two lines must cross on screen, they cross once, on straights, at a clear angle, and far enough apart in depth that the clearance check passes with room to spare. A crossing near a bend or an end reads as a joint ("Clearance and crossings", step 6). +- **Split, don't overlap.** Where something wraps a pipe (flange, band, bellows disc, clamp, valve body), the pipe is gapped there and a piece ends on each face (`tubePieces` `gaps`, `crossingsOf` for clamps). Run through it as one chunk, the pipe is both behind and in front of the collar and no key can order it. The Raptor chamber jacket was split at its two rings for the same reason. + +### Contacts and junctions +Every place two parts meet is either a flat face on a flat face, a tangent contact, or a rim landing on a round body. Nothing is sunk into anything: a sunk part is both in front of and behind its host, and no painter's order can draw it. +- **Flush.** A rod ends on the face of its clevis; a boss starts on the surface it stands on; a lug is a short pin from the housing to the ball. +- **Rim on a round body.** A cylinder of radius `a` meeting a sphere or tube of radius `R` ends where its rim lies on the surface, `sqrt(R² − a²)` from the centre. Its end face is then hidden inside the host and nothing shows through. This is how the Raptor's actuator rods meet their ball joints and how the manifold tube and the downcomer meet their tee. +- **Tees.** A branch into a pipe is a sphere fitting a little larger than both: the run is gapped where its rim meets the sphere and the branch ends on the sphere. Size the sphere so neither pipe's rim pokes into the other: for a branch of radius `b` into a run of radius `a`, `R ≥ sqrt(a² + b²)`. +- **Stand-offs.** A ring that would have to sink into a curved body to touch it (a manifold round a bell) stands clear by at least half its tube radius on small radial pads. +- **Valves and bellows on straights.** A straight lathe on a curved pipe cuts into it at both ends. Put them where the route is straight for their whole length. +- **Two flanges, one joint.** Where a duct bolts to a pump outlet flange, the duct's own flange meets the outlet flange face to face; two flanges in the same place interlock. Each part then keeps a flange when the figure comes apart. +- **Branches have fittings.** A branch leaves its run from a tee (a ball the run is gapped under, the branch starting where its rim meets the ball) or from a saddle pad on the run, never from a bare spot on the run's skin. +- **Struts end in ball joints.** A strut's eye disc laid along an oblique axis sinks into whatever it meets. Give each end a short stem along the host's normal, a ball on the stem, and the rod between the balls (rim on sphere at all four joints). +- **Balls with flats for joints that move.** In a 3D figure a rim landing on a sphere can't be ordered at every angle. Give the ball a flat (`T.ball({ flats: [{ n, d }] })`, recorded as `A.ball(c, r, { flats })`) and land the rim on the flat, or use coaxial knuckle discs. `references/3d.md`, section 5. +- **Everything is held.** Every solid is connected through contacts to the stand: brackets carry boxes, studs carry harness clamps, a gearbox plate joins a motor to its actuator. A clamp that touches only the cable it holds floats. + +### Clearance and crossings +A pipe keeps about 1.5 radii between its centreline and anything but its own connection, so a 0.6 cable passes 0.3 clear of a duct's skin and a duct keeps half its radius off its neighbours. Where two lines must cross on screen, they cross in depth, one well in front of the other, and the chunk keys order them; where a pipe passes through a collar, clamp or valve it is gapped there (`kit.md`, section 11). Prove it rather than eyeballing it: +1. Record a shape for every item and every tube as you build, into one `A.recorder(P, { order, spring })` (`kit.md`, section 12): `R.put` for drawn items with their `shapes`, `R.solid` for each shape, `R.route` for each pipe and cable. Make the helpers do it, so nothing escapes. There is a recorded shape for everything the kit draws: `A.slab`, `A.extruded` and `A.cylinder` for floor prisms, `A.solid`, `A.lathe` and `A.disc` for turned parts (traced along the same curve the drawing uses), `A.prism` for `prismOf`, `A.ball`, and tubes. +2. Settle the painter's keys with `A.settle(R, P)` on every build: it measures the overlaps in every state the figure rests in (assembled and apart) and in every frame of its real explode (`explodeStates` replays the live springs and stagger) and runs `orderKeys`. +3. End the build with `A.auditOrExit(R, P)` and run `node build.mjs --audit` until every failing line prints zero. An interlocked pair is a geometry bug (a split, a gap or a tangent contact fixes it); don't bias it away. +4. Lines don't double back on screen. A horizontal leg that runs away from the viewer reads as going up, so a pipe that runs away and then drops reads as a cusp, a pipe ending in mid-air. Route the leg sideways on screen first (the audit's `folds` finds every case: a screen turn over 140° within 4 radii while the real turn is under 110°). +5. No outline folds back on itself, and no bend pinches to a point on screen. A leg that points at the viewer and then turns (a sense line leaving a jacket boss radially and climbing to a block, a pigtail leaving a transducer tip and hooking back) projects its fillet edge-on, and the two legs meet in a V with no visible radius. `folds` measures the screen radius of every visible bend over 90° and fails it when it is under twice the tube's screen radius. Fixes, in order of preference: let the turn happen inside a fitting (a ball tee on the boss, the line leaving it toward its next point: the Raptor's `elbow`, used by sense0, sense2, sense5 and the fuel-rich igniter line); bend in a plane that faces the viewer (the Raptor's pigtails loop in the transducer's own radial plane, which faces the camera; its local helper `sideOn(d) = unit3(cross3(unit3(V − d·(V·d)), d))`, with `V = G.viewOf(P)`, gives the direction across the screen from a leg along `d`, so a bend in the plane of `d` and `sideOn(d)` faces the viewer); move the port to where its normal lies across the screen. A bend in a plane whose normal makes `f = |n·V|` with the view projects to a screen radius of about `R·f²`; once that is under the tube's screen half-width, the inner edge of a single chunk runs backwards and the outline crosses itself in a little knot (the audit's `selfOverlaps`). `fillet(…, { P, tube })` raises each corner's radius to clear that, but only as far as the legs allow, so give a turn next to a port at least `R + 3r` of straight leg. A port that faces the viewer squarely (the Raptor's speed pickup on the methane pump) makes every approach a hairpin: move it. +6. Crossings happen on straights, clearly. Where one line's bend or end lands on another's outline on screen (touching, or overlapping by any amount), the eye reads a joint or a line threaded through another, whatever the true depth: a pigtail hook that peeks out from behind a sense-line elbow, a flange that lands on another line's band in the apart pose, a cable that runs along a short duct on screen and over its end flange. A fitting counts too: a harness clamp whose outline lands on another line reads as that line growing out of the clamp, as the Raptor's clamp did on the oxygen-to-preburner line apart. The audit's `crowding` lists every visible case, assembled and apart; reroute one line so the meeting is a clear crossing of two straights or a visible gap of at least a pixel (two for a clamp). Excuse a pair only after you have looked at it at 8× (`CROWD_OK`). + +The first Raptor had 54 clearance problems (39 pass-throughs) and 323 depth-order problems; the routes in this section took both to zero. + +### Shading and textures on curved surfaces +- **Smooth shading** (automatic on any profile with a smooth knot; `smooth: { slope }` or `{ slope, radius }` for an analytic curve; `bandsOf` for a body in bands; `sphereOf` for balls) on every curved surface: bells, throats, domes, cones, valve bulges, balls. A flat facet tone per row is only right on a cylinder. Each tone is one polygon over the whole body for as long as its region count holds, so no row seams show. +- **A texture ends on an edge or fades, along the axis too.** Each rib's `s0` and `s1` land exactly on a drawn step, crease or seam arc at the same `s`: pass `seams: true` and `ribsOf` returns the two seam arcs with the ribs, so they can't drift apart (the blind-test motor ran its ribs from 26 to 88 with seams at 24 and 90, and every rib stopped 2 units short at both ends). Where a rib row has no seam, let it run onto the face that ends the band (`s0`, `s1` equal to the band's ends) or fade it. +- **A texture on a pipe follows its cross-section.** Braid, corrugation, tape wrap and armour come from `tubePieces(route, r, P, { rings: { pitch, twist, cross, fade } })`: rings (or with `twist`, helices, and with `cross: true`, a braid of both hands) placed by 3D arc length along the whole route, each drawn as the visible front arc of its cross-section, fading toward both limbs and ending on the ferrule and gap faces. Never a `stroke-dasharray` along a chunk's centreline: it ends in straight hard edges along the hose, doesn't wrap the round section, piles up on the inside of bends, and restarts at every chunk joint. +- **Textures end on an edge or fade.** Ribs and bolt circles that are limited to the side facing you stop wherever the cut-off falls, in the middle of the surface: the bolt circles on the Raptor's chamber rings did, in the owner's close-up. Use `ribsOf(..., { fade })` with `fadedSvg`, and `dotsOf(..., { fade })`, so they fade out toward the turn (the Raptor uses `fade: [0.04, 0.42]` for bolt dots and `[0.1, 0.55]` for ribs). Seam arcs and band lines already end on the silhouette. A single texture line that has to stop in the middle of a face (a groove that runs out, a weld bead short of a corner) is drawn with `fadeLineSvg(points, { fade: [start, end] })`, which ramps it out over a few px with a gradient along the line; never let it end on a bare cut. Choose the cut-off from the way the feature faces, not from the ring it sits on: spray holes on top of a deluge ring face up and are seen all the way round, so they take `all: true`. Culled by the ring's outward normal (`least: -0.2`), the Raptor's row stopped at full strength just past the ring's sides while the ring ran on round the back, bare. Never cut a row on an up-facing feature with a radial `least`; if part of it really is hidden, `fade` toward the turn. +- **Smooth tones taper.** Where a tone band appears or disappears along a curved profile, it is born at zero width and grows (`smooth` refines rows by screen error until each boundary is within 0.35 px and every change of band count happens in a sliver). A band that ends on a straight cut across the surface, or a pale wedge of bare fill, is the bug the reviewer finds first. +- **Shape and shading describe one curve.** Smooth runs of a profile are interpolated with a monotone cubic Hermite curve (Fritsch–Carlson), and the kit uses that same curve for the normals, the tone sheets, the silhouette and the hull. A natural spline overshoots near a peak: on the Raptor's valves it put three sign changes of slope into a body that rises and falls once, and the tone bands zig-zagged across the bulge like wood grain while the outline stayed a polyline with a nub at every profile point. A monotone curve can only turn where the profile turns. +- **The monotone Hermite is only C1.** Its `dr/ds` is a piecewise quadratic: with hand-typed knots it plateaus at each knot and overshoots between them, and tone bands, which follow the slope, stall and then lurch, a staircase in scallops. The Raptor throat had extrema of slope at five places on a profile that bends one way; its deck cone wobbled more mildly. Any curved body larger than a fitting needs an analytic profile `r(s)` and its derivative passed as `smooth: { slope }`, sampled at 20–30 knots: the throat is `√(24.2² + (c·(s − 146))²)`, the cone `48·(1 − x)^0.8` closed to `r = 0` at its tip with a vertical tangent, so the outline rounds over the tip instead of peaking above a flat tip disc. The audit's `wobble` fails any profile smoothed without a `slope` whose `dr/ds` turns between its ends. +- **Outlines are ellipses, not facet polygons.** Facet counts are for tone fills only (about 3 px per facet on screen, `stepsFor(r, 32, 160, scale)`); every silhouette, rim and crease is sampled from the analytic circle at about 1.5 px, and creases and bevels end exactly where the faces turn away. A 20-sided flange outline next to a 96-sample torus reads as a notch at 4×. +- **Tube stripes.** Shine and shade bands run continuously through chunk joints and on to the very end: at every capped end they follow the outward half of the end ellipse, and at an end face turned toward you they stop on its inner rim, which is drawn. At a joint the stripes overhang the body by a further 0.5 (bodies overlap by 0.5, stripes by 1), and every frame is computed from the whole route, so the later chunk's stripe covers its own body's anti-aliased cut and ends on an identical stripe. With body and stripe cut on one line, a hairline crossed the volute's shade band at every joint, light in light theme and dark in dark. Check them at 4× at every bend, tee, bellows and flange, and on a strongly curved tapered tube. Anything you draw on a chunk yourself (a texture, flow marks) follows the same rule: compute it from the whole route, phase it by 3D arc length from the route's start, and extend it over the chunk's stripe overhang (1 unit past each joint), or the joint shows as a half-dash, a doubled mark or a notch. The `rings` option does this for you. + +### Harness routing +Cables are the easiest way to ruin a figure: a cable drawn across the subject's face reads as a scribble. Route them like a real harness: +- **Lanes.** Run cables in parallel lanes on a ring around the body (`arcPoints` at a fixed `s`, each lane offset 1.4 units out and 0.2 along for r 0.62 cables). They leave the lane only to branch to their plug. +- **Enter in order.** Cables come down from the connectors in parallel drops and join the ring where their drop meets their lane (at `acos(x / laneR)`), so the innermost lane is fed by the connector nearest the front and no drop crosses another. +- **Leave in order.** The outermost lane leaves the ring first; an inner cable that turns outward while outer lanes still run beside it has to cross them. +- **Follow structure.** A cable that has to climb runs up beside a pipe (the Raptor's valve cable runs up the downcomer) instead of crossing open space in front of the engine. +- **Short branches.** Go from the lane straight to the port. Don't run diagonally across the subject's face. +- **Clamps** (`disc(-0.9, 0.9, r, frameAlong(point, tangent))`, tone `mid`) hold the lanes to the body at regular angles. Gap each cable where it passes through a clamp (`crossingsOf`), or the clamp and the cable interlock. +- **Ends land.** Each cable starts at a connector on the controller or a junction box and ends on a plug, sensor tip, valve lid or bulkhead connector, never on a clamp or in the air beside the bundle. An end that stays with its own assembly gets a terminal dot; an end on another assembly gets a connector shell (`cable(..., { shells: [false, true] })`) that moves with the cable. +- **Count what you draw.** Push every route into a list (`CABLES`) and build the readout from its length. The first Raptor readout claimed 8 cables while 11 were drawn. + +## 9. Exploded views +An exploded view earns its place when the parts are the explanation (what feeds what, in what order): +- Choose the assemblies the real thing comes apart into (the Raptor has 11), not single solids. +- Move each assembly along its real disassembly direction, far enough that its silhouette clears its neighbours: down along the axis for stacked stages, out radially for side units. +- Every part keeps a home. Parts that bridge two assemblies (actuators, cables) go with the one they stay attached to, and when apart they still end on something of their own: a flange, a coupling nut at a quick-disconnect, a connector shell on a cable. Strut ends are ball studs on their hosts with the rod leaving with its assembly, and saddle pads stay on their hosts. Mark each end that comes off its mount when apart (`free: [true, false]`); the audit's `looseEnds` fails every other end that touches nothing of another owner in the apart state, and lists the free ones so each is a choice. +- Highlight and motion are separate. A sensor bolted to the chamber highlights with the plumbing but rides the chamber's spring (`ride`, emitted as `data-ride`). Moved with another assembly's vector on its own spring, it slides along its mount and sinks into it mid-flight. +- Choose explode vectors and the stagger so nothing passes through anything, in any frame: `references/motion.md` ("Order the stagger so nothing has to pass through") has the rules, and the audit replays every frame of the real springs, opening, closing and reversing halfway, and fails on any pass-through. +- List the assemblies in the legend as numbered buttons (`01 Gimbal and thrust puck`…) that select, the same as hovering does. +- Springs, staggering and per-frame depth re-sorting are in `references/motion.md`. + +## 10. Screens and things on faces +A screen, a dial face or a display is drawn in the plane of the face it sits on (`examples/desk-computer/`): +- **The face plane.** `sideMatrix([0, y], 0, P, "left")` maps a group's local `(x, −z)` coordinates onto the vertical face at `y`. Draw everything on the screen (the glow, scanlines, a mark, `` and a cursor) in those flat coordinates inside that ``. +- **A recess.** Clip the screen to its rounded outline with a `clipPath` in the same plane, and draw the recess's inner sides as quads between the face and the face moved `depth` back. Shade the sides by facing (tops `iso-top`, sides by shade). Draw the outline `lo` on the face and `faint` at the back. +- **Motion on the face** is a transform in face coordinates. The CRT power-off scales the picture about the screen centre to a line, then to a dot, with a beam line and a fading dot. +- **Text the machine displays** (a typed line, a counter's digits) is part of the object, not a label, so the one-label rule doesn't apply. Keep it in the screen's own type and size, and fit it: the cap height is about 0.55 of the window's height and the widest string you will ever show (`8.88`, the longest unit) must fit its width with a margin of about a tenth of the height. Clip it to the window like any screen. A blind-test flow meter set 5.6 px digits in a 12.8 × 8 window, so the leading digit crossed the window's left border and the digit tops ran into the unit label. +- **Content seen through an opening** (a sight glass, a gauge window, a recess) sits behind the face, so draw the opening's inner walls between the face and the back plane, shaded by facing, and clip the content to the opening in the face plane as well as its own. A strip of bare face inside the opening reads as a hole drawn on the surface. For a shader behind an opening, `webgl.md`, section 5. + +## 11. Shaders +Some subjects can't be drawn with lines: fire, exhaust, water, caustics, real lamp light, steam. These go in a WebGL layer *inside* the drawing, in world space and in the same camera, between a back SVG and a front SVG. `references/webgl.md` has the layer stack, the camera contract, the craft rules (nothing pops, no hard cut-offs, tonemap and dither, blending per theme) and how to verify them. Everything in this page still applies to the SVG around the effect. Its section 8 covers the light theme, which ships: inks solved from the colour the paper should show, ink that grows with the light, a dark physical ground for every glow, recipes for hot metal, glass, sparks, flame, steam, plasma and Cherenkov light, and a no-WebGL fallback that matches the shader. diff --git a/skills/anatomy/references/kit.md b/skills/anatomy/references/kit.md new file mode 100644 index 0000000..fee710a --- /dev/null +++ b/skills/anatomy/references/kit.md @@ -0,0 +1,419 @@ +# Kit API + +Everything is in `kit/iso-kit.ts`, with the same API in `kit/iso-kit.mjs`. World coordinates are `[x, y, z]`, with x and y on the floor and z up, in units of about 1 px. Screen coordinates are `[sx, sy]` in the SVG viewBox. Paths come back as SVG `d` strings, rounded to 0.1. + +## Contents +1. Types +2. Camera +3. Solids +4. Lines on faces +5. Parts library +6. Moving things +7. SVG strings (framework-free) +8. Card and page +9. React components +10. Round parts on any axis (`kit/lathe.mjs`) +11. Pipes, tubes and cables (`kit/tube.mjs`) +12. The audit (`kit/audit.mjs`) +13. The WebGL layer (`kit/gl.mjs`) +14. Tools +15. Turning groups (`kit/turn.mjs`, `turn-build.mjs`, `turn-audit.mjs`) + +## 1. Types +```ts +type Flat = [number, number]; // screen point +type Point3 = [number, number, number]; // world point +type Plane = [number, number]; // floor point (x, y) +interface Plan { x: number; y: number; w: number; d: number; r: number } // rounded rectangle on the floor +interface Projection { origin: Flat; scale: number; azimuth?: number; elevation?: number } +interface SolidPaths { fill; outline; crease; top; shades: string[4]; bevel?; seamless? } +type Tone = "hi" | "mid" | "lo" | "faint"; +type LineTone = Tone | "lit" | "red" | "green" | "blue"; +``` + +## 2. Camera +| Function | What it does | +|---|---| +| `fitProjection(points: Point3[], width, height, { pad = 24, headroom = 0, azimuth = 45, elevation = 30 })` | A projection that centres and fits these points in the viewBox. Pass every extreme point, such as `boxCorners(plan, z0, z1)` and the tallest tip. | +| `iso(point, P)` | World to screen. | +| `depthOf(point, P)` | Larger means nearer the viewer. Sort ascending to paint back to front. | +| `towardViewer(P)` | The floor direction pointing at the viewer, `[cos a, sin a]`. Faces whose normal points this way are visible. | +| `screenRise(h, P)` | How many screen px a height of `h` covers. | +| `cameraOf(P)` | The raw sines and cosines. | + +## 3. Solids +All solids are prisms: a floor outline extruded straight up. + +| Function | What it does | +|---|---| +| `slabOf(plan, z, h, P, steps = 8, bevel = 0)` | A rounded box. `steps` is the points per corner (2–4 for small parts, 8–10 for large rounded ones). `bevel` (0.3–1.6) adds a highlight line inset on the top along the visible edges, running into the silhouette corners. | +| `cylinder(cx, cy, r, z, h, P, steps = 32, bevel = 0)` | A round post, puck, foot, knob or pad. Use 16–20 steps for small ones and 56–72 for big discs. | +| `extrude(ring: Plane[], z, h, P, { convex = true, bevel })` | Any floor outline. For concave outlines pass `convex: false` (the fill becomes faces rather than a hull). | +| `ringOf(plan, steps)` | A rounded-rectangle outline as points. | +| `roundedPlan(plan, steps)` | The same thing. | +| `circleRing(cx, cy, r, steps)` | A circle outline as points. | +| `insetPlan(plan, by)` | Shrinks a plan (use a negative `by` to grow it). Keeps the radius sensible. | +| `corners(plan, inset)` | Four floor points inset from the corners, for feet and screws. | +| `boxCorners(plan, z0, z1)` | The eight corners, for `fitProjection`. | +| `haloOf(plan, z, h, P)` | A fill path for a soft shadow: ``. | + +What a `SolidPaths` contains: +- `fill`: paper-coloured, it hides whatever is behind. +- `shades[0..3]`: visible sides, bucketed by how they face the light. +- `top`: the top face, lighter. +- `crease`: where top meets the visible sides. +- `bevel`: optional. +- `outline`: the silhouette. + +`solidSvg` and `` paint them in that order. + +## 4. Lines on faces +| Function | What it draws | +|---|---| +| `onTop(points: Plane[], z, P, closed?)` | A polyline on a horizontal face. | +| `lineOnTop(a, b, z, P)` | One segment on a horizontal face. | +| `planOutline(plan, z, P, steps)` | A rounded-rectangle outline on a face, used for grooves and inlays (`insetPlan`). | +| `ring(cx, cy, r, z, P, steps)` | A circle on a face, used for screw rings, bezels and seats. | +| `segment(a, b, P)` | Any 3D segment. | +| `rise(at, z0, z1, P)` | A vertical segment. | +| `pointsAt(points, P)` | Projects a list of points, for screw and rivet dots. | +| `dotGrid(x, y, cols, rows, gap, z, P)` | Projected perforations. | +| `topMatrix(at, z, P, along = "x")` | A transform that lays text flat on a top face, for `faceTextSvg`/`FaceText`. | +| `sideMatrix(at, z, P, "left" \| "right")` | The same, on a vertical face. | + +## 5. Parts library +| Function | Returns | +|---|---| +| `knurl(cx, cy, r, z0, z1, count, P, inset = 0.4)` | Vertical lines on the visible half of a cylinder. | +| `sideArc(cx, cy, r, z, P, steps)` | The visible front half of a horizontal circle on a cylinder side: seams and bands. | +| `sideSeam(plan, z, P, steps = 8)` | The same for a box: the visible near half of the rounded plan at height `z`, wrapping its corners and ending exactly on the slab's vertical silhouette edges. Pass the slab's own `steps`, and draw it as the slab's `inner`. It is the way to draw a weld bead, a band, a lid seam or a trim line on a box: never a `segment` inset from the corners. | +| `ringSeam(ring, z, P)` | `sideSeam` for any floor outline (the ring you gave `extrude`). | +| `sideRing(center: Point3, r, "x" \| "y", P)` | A circle on a vertical face: bores, rod ends, lenses. | +| `coil(from, to, [cy, cz], r, turns, "x" \| "y", P)` | `{ back, front }` spring halves, so you can paint back → rod → front. | +| `topTicks(from, to, step, every, edge, z, [minor, major], P, axis)` | `{ minor, major }` ruler ticks on a top face, growing from the line `edge` in +y (or +x). | +| `sideTicks(from, to, step, every, face, top, [minor, major], P, axis)` | Ticks hanging down a vertical face. | +| `radialTicks(cx, cy, r, count, every, z, [minor, major], P, from = 0, span = 2π)` | Dial and turntable ticks. Angle 0 points to −y, increasing clockwise as seen from above. | + +## 6. Moving things +| Function | What it does | +|---|---| +| `translateAlong(P, [dx, dy, dz])` | A `"translate(x y)"` string that moves a pre-built group by a world offset. Use it for carriages, drawers, plungers and lifts. | +| `holdStill(element, [dx, dy])` | Gives every `[data-hold]` element inside `element` the opposite translate, so a clip stays where it is while the group it sits in moves by `[dx, dy]` screen units. Call it with the same offset whenever you move an item that holds a `G.rodOut` clip. | +| `axisVector(P, [1, 0, 0])` | The screen vector of one world unit. Use it to turn pointer movement into world movement. | + +Rotations about z can't be done with a screen transform: rebuild the rotating paths for each frame or step. That is cheap for a needle, a pointer or a small part. + +## 7. SVG strings (framework-free) +| Function | Notes | +|---|---| +| `solidSvg(paths, { tone = "hi", crease = "faint", halo, lit, flat, className, inner })` | When `paths.seamless` is set (smooth lathe shading, `sphereOf`), the group gets `data-seamless` and `ISO_CSS` strokes each tone region in its own colour, 0.4 wide, so the many abutting tone sheets show no hairline seams. `inner` is extra line markup placed just before the outline (`iso-edge`), for seams, weld lines and band lines that must sit under the silhouette stroke; the React `Solid` takes it as a prop. | +| `lineSvg(d, { tone = "lo", dotted, dashed, flow, className, free })` | `flow` animates dashes; use it for things moving along a path. `free: true` (or `"start"`, `"end"`) writes `data-free`, telling `scripts/lines.mjs` that an end is meant to stop on a bare face: rule lines that stand for printed text, a needle's tail, a pointer's tip. Every other line end must land on something. | +| `dotsSvg(points, { size = 0.5, tone = "mid", pulse })` | A point may carry a third value, its opacity (`[x, y, 0.4]`), which is how `dotsOf(..., { fade })` fades a bolt circle out instead of stopping it. | +| `fadedSvg(list, style)` | Draws a set of lines that each carry an opacity, `[{ d, alpha }]` or `[d, alpha]`, as returned by `ribsOf(..., { fade })`. Lines are grouped by opacity in steps of 0.05, each group in one ``, and lines under 0.02 are dropped. Use it for any texture whose members fade one by one toward a limb: ribs, fins, knurls, rule lines. | +| `fadeLineSvg(points, { fade = [start, end], tone = "lo", className, stops = 6 })` | One line (screen points) that fades out over its first `start` and last `end` px instead of stopping (each ramp carries `data-free` on its faded end, so the line check passes it). Each ramp is stroked with a `userSpaceOnUse` linear gradient along its own chord (a smoothstep in `stops` steps, the colour taken from `var(--anatomy-)`, so both themes work), and the middle is a plain `lineSvg`, so there are no overlapping caps, beads or seams. Use it for a texture line that ends in the middle of a face: a groove that runs out, a weld line that stops short of a corner, a rule on a curved plate. Keep a ramp shorter than a quarter turn of the line, since a linear gradient follows the chord. Gradient ids are a hash of the path, so the same line drawn twice shares one. | +| `wireSvg(from, to, { via = [], tone = "lo", dotted, dashed, flow, ends: "both" \| "from" \| "to" \| "none", size = 1.2 })` | A connector with terminal dots. | +| `faceTextSvg(transform, text, { size = 3, tone = "mid", anchor })` | | +| `groupSvg(children, { class, transform, "data-part": … })` | | +| `figureSvg({ width, height, label, body, standalone: false \| "dark" \| "light", className })` | The ``. `label` is the accessible description: say what the object is and what it shows. `className` is added to its class, which helps when you stack it under a canvas (`rt-back`, `rp-back`). | + +## 8. Card and page +| Function | Notes | +|---|---| +| `plateHtml({ fig, title, hint, readout, keys: [{ mark, label }], caption, body })` | The card. `mark` is one of `raised`, `flat`, `lit`, `edge`, `dim`, `dotted`, `dashed`, `red`, `green`, `blue`. The readout element carries `data-readout`, so live code writes to it. | +| `pageHtml({ title, theme = "dark", body, script, width = 650 })` | A standalone document with `ISO_CSS` inlined. | +| `kitScript()` | From `scripts/inline-kit.mjs`. Prepend it to `script` so the page can call kit functions such as `lineOnTop` and `translateAlong` while animating. | +| `glScript()` | From `scripts/inline-kit.mjs`. The source of `kit/gl.mjs` (`GLSL_ISO`, `glCamera`, `glLayer`, `smooth`, `burst`, `settle`), to inline after `kitScript()` on a page with a shader: `script: kitScript() + glScript() + live`. It doesn't depend on the kit, so a page whose live code calls no kit function can inline it alone (the Raptor uses `glScript() + LIVE`). Everything is one module script, so live code must not redeclare `smooth`, `burst` or `settle`: a second `const smooth` is a SyntaxError that kills the page. | +| `turnScript()` | From `scripts/inline-kit.mjs`. The 3D runtime (`TURN`, `TURN_CSS`) with `export` stripped, for a page with live parts: `script: turnScript() + glScript() + live`. Its internals are prefixed `t3`/`T3_`, so it inlines beside the kit and the WebGL layer. | +| `ISO_CSS` | All the styles. `kit/iso.css` is the same text. | + +## 9. React components +From `kit/react/draw.tsx`, which is server-safe: + +- `` (`inner` is line markup placed under the outline, as for `solidSvg`) +- `` +- `` +- `` (a point may carry opacity as `[x, y, alpha]`, as for `dotsSvg`) +- `text` +- `` …svg children… `` +- `` …figure… `` + +From `kit/react/live.tsx`, which is `"use client"`: + +- `useReadout()` returns `{ anchor, say }`. Put `anchor` on your root element; `say(text)` writes the card's readout. +- `useLoop(tick: (dt, calm) => keepGoing, running)` runs a frame loop while `running` and while `tick` returns true. It returns `kick()` to restart it. +- `follow(current, target, dt, seconds, calm)` is exponential easing. +- `spring(state, target, dt, stiffness, damping, calm)` is a sub-stepped spring. It returns true when settled. +- `useEased(target, seconds)` returns an eased number as React state. Fine for small figures. +- `useInView(ref)`, `useStillness()`, `asksForStillness()`. +- `Stage` is the wrapper `IsoFigure` uses. It adds `data-inview` for CSS animations. + +## 10. Round parts on any axis (`kit/lathe.mjs`) +`kit/iso-kit.mjs` builds prisms that stand on the floor. `kit/lathe.mjs` turns a profile around **any** axis, for bells, chambers, flanges, valve bodies, pump volutes, pipe fittings, actuators lying at an angle, and connectors on a vertical face. It returns the same `SolidPaths` as `slabOf`, so `solidSvg` paints them. Import it as `import * as G from "../../kit/lathe.mjs"`. + +**Frames.** A frame is `{ o, a, u, v }`: an origin, the unit axis, and two unit radial directions. A point on the part is `(s, r, angle)`: `s` along the axis from `o`, `r` from the axis, and `angle` from `u` toward `v`. + +| Function | What it does | +|---|---| +| `frameAlong(o, a)` | A frame on axis `a` through `o`, with `u` and `v` chosen for you. Use it for pipes, bosses and flanges at any angle. | +| `frameOf(o, a, u, v)` | A frame with explicit radial directions, so angles mean something: `G.frameOf([0, 0, z], [0, 0, 1], [1, 0, 0], [0, 1, 0])` makes angle 0 point along +x. | +| `pointOf(F, s, r, angle)` | The world point. | +| `radialOf(F, angle)`, `tangentOf(F, angle)`, `angleToward(F, direction)` | Directions in the frame, and the angle that faces a direction. | + +**Solids.** A meridian is a list of `[s, r]` points along the axis. Add a third element (`[s, r, 1]`) to mark a smooth ring, so no crease line is drawn there. Use that for curved profiles such as a bell or a dome. A meridian with any smooth vertex is shaded smoothly on its own (`smooth` defaults to `"auto"`, which is `softOf(meridian)`); pass `smooth: false` to opt out, `true` or `{ rows }` to force it on a profile without smooth vertices, and `{ slope }` or `{ slope, radius }` for an analytic curve. + +**Smooth shading.** Without it every facet row gets one flat tone, and a curved profile shows a staircase of tone blocks (the first Raptor bell and throat did, and the reviewer saw it at once). With `smooth` the side of each meridian segment is shaded from an interpolated normal: the tone boundaries become the true iso-light curves, sampled at `rows` levels and emitted as one polygon per tone region, so they run as clean curves across the whole part. +- `smooth: true` interpolates each run of smooth vertices (`[s, r, 1]`) with a monotone cubic Hermite curve (Fritsch–Carlson slopes: zero where the profile turns, a weighted harmonic mean elsewhere), and uses that one curve for the normals, the tone sheets, the silhouette and the hull, resampled until it is within 0.2 px of the chord. Shading and outline then describe the same shape, and the normal can only change sign where the profile does. Use it for any profile with smooth vertices: domes, throats, cones, valve bulges, a flame cone. (A natural spline overshoots near a peak; on a valve bulge it zig-zagged the tone bands across the body.) +- `smooth: { slope }` takes the normal from an analytic `dr/ds`, so a body cut into bands shares one normal field and the tone curves cross the band joints without a step. With a `slope` alone the profile points are joined straight, so sample the analytic `r(s)` densely (20–30 knots on a throat), and the silhouette of a waisted body uses the same `slope`, so the outline follows the true curve too. +- `smooth: { slope, radius }` also takes the surface from an analytic `r(s)`: the tone sheets, the hull and the silhouette all follow `radius` between the knots, so two knots are enough for a band. This is what `bandsOf` passes to every band. +- **Hand-typed knots are not a curve.** The monotone Hermite is only C1: its `dr/ds` is a piecewise quadratic that plateaus at every knot and overshoots between them, so tone bands stall and then lurch, a staircase in scallops. The Raptor throat (`[128, 31, 1], [134, 27.6, 1], …`) showed it at 5×. Any curved body larger than a fitting gets an analytic profile and `smooth: { slope }`: the throat is `r = √(24.2² + (c·(s − 146))²)`, the flame cone `r = 48·(1 − x)^0.8` closed to `r = 0` at the tip, the valve bulge an ellipse, the gimbal puck `18.4 − a·|s − 297.5|⁴`. The audit's `wobble` lists every profile smoothed without a `slope` whose `dr/ds` turns between its ends. +- `rows` (default 6) is the starting sampling along each segment. Rows are then split until every tone boundary is within `error` (0.35 px) of a straight chord, and wherever the number of bands changes down to `depth` (8) levels or to `fineness` (0.1 px) on screen, whichever comes first, so a band that appears or disappears is born at zero width in a sliver instead of ending on a straight cut. Each tone is then emitted as one polygon for as long as its own number of regions holds, across every meridian segment and smooth knot of the body, and only that tone is bridged where its count changes; a band that comes and goes no longer cuts the other tones into rows. That made a small turned ball about half the size and removed the row seams. Visibility uses the drawn facet's normal, so the tones always reach the outline; every tone polygon is wound the same way, so overlapping pieces of one tone never cancel into a hole. +- The result is marked `seamless` (see `solidSvg`). Flat caps (rings where `s` doesn't change) keep their facet shading. + +| Function | What it does | +|---|---| +| `lathe(meridian, F, P, { steps = stepsFor(rMax, 32, 160, scaleOf(P)), fill = "auto", hole = null, bevel = 0, rims = "all", smooth = "auto", waist = 0.5 })` | The general solid of revolution. Facets are shaded in four tones by the kit's light and bucketed like `extrude`. `fill: "auto"` uses the hull of the rings unless the true silhouette lies more than `waist` px inside it (a throat, a spool), and then fills and outlines the body with `silhouettePoints` on both sides joined by the visible end arcs (only when the silhouette is unbroken along the whole side: a body whose surface faces you head-on somewhere, like a valve bulge that leaves its neck at a right angle, falls back to the hull, because joining the broken pieces drew stray triangles across it); `"surface"` forces that, `"hull"` forces the hull; `fill: "facets"` fills only the visible facets and draws no outline, which you need for a concave or open shape seen from inside. `hole: [s, r]` cuts a round hole into the fill and outline, for the end of a tube. `bevel` adds a highlight inset from a closed cap (a meridian end at `r = 0`). `rims` keeps the outline on the end rings: `"all"`, `"none"`, `"first"`, `"last"` or `"ends"`. Only hull edges along the first or last ring are dropped; edges along interior rings always stay, so the side silhouette stays whole. | +| `solidOf(profile, F, P, options)` | Closes a profile to the axis at both ends and picks `steps` from the largest radius. It is the usual way to make a turned part: `G.solidOf([[0, 12], [6, 12], [8, 9, 1], [20, 9]], F, P)`. | +| `bandOfProfile(profile, F, P, options)` | An open band with no caps, for one stretch of a long body that is split into depth-sorted pieces. Prefer `bandsOf`, which cuts the whole body at once. | +| `bandsOf(profile, cuts, F, P, { slope, radius, steps, rows = 6, rims = "none", fill = "auto", samples = 72 })` | One curved body (`s` rising along `profile`) cut at the `s` values in `cuts` into depth-sortable bands that share one normal field, one surface and one facet count. Pass the analytic `slope` and `radius`, or neither: then `profileCurve(profile)` makes them from the profile (the monotone Hermite through each run of smooth knots, straight elsewhere), so no band ever has its own end slopes. Returns `{ bands, sidesOf, radius, slope, steps, s0, s1 }`. Each band is `{ s0, s1, profile, paths, outline, seam }`: `paths` is ready for `solidSvg` with its outline cleared, `outline` is the band's own chord outline if you need it (the last band of the Raptor skirt keeps it), `seam` is the visible arc where it meets the next band (put it in `inner`), and `profile` is what to record for the audit (`A.solid(F, band.profile, { radius })`). `sidesOf(from = s0, to = s1, { ends = false \| true \| "first" \| "last", count = samples })` returns `{ d, points }`: the body's two analytic side edges over that span as one path, optionally with the visible rim arcs at its ends, plus their 3D points to record (`points.map((list) => A.tube(list, 0.4 / scale))`). Draw `d` as one item with a small depth bias over the bands, so the outline is one continuous curve. | +| `profileCurve(profile, { slope, radius })` | `{ s0, s1, radius(s), slope(s) }` for a profile whose `s` rises: the curve `smooth` draws through it. Throws if `s` doesn't rise, since a step in a profile is a crease and belongs to a separate solid. | +| `outlineOf(meridian, F, P, { steps, fill, hole, rims, smooth, waist })` | Only the `fill` and `outline` of `lathe`, without the shading, for a body whose outline you draw separately. | +| `softOf(meridian)` | True when any vertex is marked smooth. | +| `disc(s0, s1, r, F, P, options)` | A short cylinder on the axis: pucks, flanges, bosses, pins, plugs. | +| `ringBand(s0, s1, rIn, rOut, F, P, options)` | An annulus with thickness: a flange or collar around something. | +| `stepsFor(radius, least = 16, most = 112, scale = 0)` | A facet count. With `scale` (screen px per unit, `scaleOf(P)`) it keeps every facet about 3 px long on screen; `disc`, `ringBand`, `solidOf`, `bandOfProfile` and `lathe` use that (32–160) when you pass no `steps`. Facets only set the tone fills: outlines, rims, creases and bevels are sampled from the true circle at about 1.5 px and end exactly where the faces turn away. | +| `saddleOf(F, a, start, s1, P, { steps })` | A saddle pad: a cylinder of radius `a` along `F.a` from a curved host surface to a flat face at `s1`. `start(angle)` is where each generator leaves the host (find it by bisecting the host's `sdf`), or a number `R` for a host cylinder perpendicular to `F.a` (then `saddleStart(R, a, angle)` gives each generator's start). The fill is the union of its visible facets and face, the outline its two side generators, the visible part of the saddle curve and the face rim, so it meets the host along the true intersection. Seat flanges on it wherever a flat flange on a curved body would leave a rim gap. | +| `prismOf(F, polygon, s0, s1, P)` and `stadium(r0, r1, offset)` | A prism of any convex `[x, y]` polygon in the frame's `u`, `v` plane, extruded along `F.a`, with facet tones, the hull as fill and outline, and creases only at sharp corners. `stadium` is the hull of two circles, for a gearbox plate joining a motor to an actuator. | +| `sphereOf(centre, r, P, { steps = 48 })` | A ball with exact smooth tones: each tone region is the projected hull of a spherical cap, so it costs four small polygons instead of a turned profile. Use it for rod-end bearings, tee fittings and knobs. It is `seamless`. | +| `silhouettePoints(profile, F, P, { samples = 72, slope, radius })` | The two side edges of `silhouetteOf` as 3D point lists, to record the outline's shape for the audit. | +| `silhouetteOf(profile, F, P, { samples = 72, slope, radius })` | The two analytic side edges of the surface of revolution through `profile` (`[s, r]` points, linearly interpolated), as one path of two polylines: the points where the surface turns away from the viewer (`cos(θ − φ) = r′·aV/|V⊥|`). Use it to draw one continuous outline over a body built in bands. Where the surface faces the viewer head-on (`|c| > 1`) a sample is skipped. Pass the analytic `slope` (the same one the bands are shaded with) so the edge doesn't kink at every profile point. | + +**Lines and dots on round surfaces.** These draw only what faces the viewer. `slope` is `dr/ds` of the surface at that ring, so a line on a cone or bell hides where the real surface turns away. + +| Function | What it does | +|---|---| +| `arcOf(F, s, r, P, { slope = 0, steps, least = 0.02, inward = false, from = 0, to = 2π, trim = 0.3 })` | The visible arc of a ring on the surface: seams, bands, weld lines, a lip. The limb angles are solved exactly (`t = φ ± acos(c)`), and each end that stops at the limb is shortened by `trim` px so its round cap stays inside the outline stroke. `inward: true` draws the arc you see on an inner surface, such as the inside of a nozzle. `least: -1` gives the whole ring. Draw seams *under* the outline: `solidSvg(paths, { inner: lineSvg(arcOf(…), { tone: "faint" }) })`. Appended after the solid, a faint seam cap paints over the edge stroke and notches the silhouette at every seam. | +| `circleOf(F, s, r, P, steps)` | A full closed circle, such as a face ring, a bore or a void you fill. | +| `ribsOf(F, s0, s1, r, count, P, { phase, twist, least = 0.12, r1 = r, fade, seams })` | Visible axial lines: a knurl, ribs or fins along any axis. `twist` makes them helical and `r1` lets them run along a cone. With `fade: [lo, hi]` it returns `[{ d, alpha }]`, each rib's opacity a smoothstep of how much it faces you, so the set fades out toward the turn instead of stopping at `least`. Draw them with `fadedSvg`. `seams: true` (or `"first"`, `"last"`) adds the seam arcs at `s0` and `s1` to the result (at full opacity), so a rib row and the seams it ends on always share one `s`; leave it off only where the ribs end on a step or a band end that is already drawn. | +| `rodOut(F, from, to, r, P, { stroke, ...latheOptions })` | A rod that slides out of a gland at `s = from` (`F.a` points out of it), its tip at `to` at rest, travelling up to `stroke` further out, or the same rod retracting into it. Returns `{ paths, clip, from, to, stroke, reach }`: `paths` is one rod from `from − stroke` to `to`, and `clip` a path covering the rod from the gland face to `to + stroke`. Draw `solidSvg(paths)`, move the item, call `holdStill`, and record `A.slide(F, from, to, r)` (`craft.md`, section 3). | +| `spokesOf(F, s, r0, r1, count, P, { phase, sweep, from, to })` | Radial lines on a face, for vanes and turbine blades. | +| `dotsOf(F, s, r, count, P, { phase, slope, least = 0.08, all = false, fade })` | Screen points of a bolt circle on the visible side. Pass them to `dotsSvg`. Use `all: true` for a face you see head-on. A `least` well above 0 stops the circle in the middle of the surface; pass `fade: [0.04, 0.42]` instead and the dots carry a falling opacity. | +| `fadeOf(value, [lo, hi])` | The smoothstep both fades use. | +| `facingOf(F, angle, P, slope)` | How much a surface at that angle faces the viewer. Positive means visible. | + +**Paths in 3D**, for pipes and cables. + +| Function | What it does | +|---|---| +| `fillet(points, radius, perArc = 7, { P, tube, margin = 1.3 })` | Rounds every corner of a polyline with a bend of `radius`, clamped to the room available (0.48 of the shorter leg). Lay out a pipe as a few straight legs, then fillet it. With `P` and `tube` (the pipe radius) each corner's bend grows to `margin · tube / (0.7 · f²)`, where `f = |n · V|` is how squarely the bend's plane faces the viewer: a bend seen edge-on projects to a radius `R·f²`, and below the tube's own radius the outline folds back on itself. The legs still cap it, so a turn next to a port facing you needs long legs or an elbow fitting. | +| `resample(points, spacing)`, `pathLength(points)`, `cut(points, from, to)` | Even spacing, total length, and a sub-path by arc length. | +| `pointAlong(points, at)`, `tangentAlong(points, at)` | Position and direction at an arc length. Use them to place flanges, bands, valves and clamps on a route. | +| `spiral(F, s, r0, r1, a0, a1, steps = 28)` | 3D points of a widening spiral, such as a pump volute. Feed them to `tubePieces` with a radius function. | +| `arcPoints(F, s, r, a0, a1, steps = 24)` | 3D points around a ring, such as a manifold, a deluge ring or a harness lane. | + +**Camera and vectors.** +- `viewOf(P)` is the unit direction to the viewer, so `dot3(p, viewOf(P))` equals `depthOf(p, P)`. +- `lightOf(P)` is the kit's light. +- `scaleOf(P)` is the screen units per world unit. +- `toneOf(normal, P)` and `bandOf(score)` give the four-tone bucket. +- `hullOf(points)` and `runsOf(flags)` are the hull and run helpers the module uses itself. +- The vector helpers are `dot3`, `add3`, `sub3`, `mul3`, `len3`, `unit3`, `cross3` and `lerp3`. + +**A long curved body in bands.** Cut it with `bandsOf` so each band depth-sorts against the pipes that wrap it. Every band shares the body's `steps`, its normal field and its surface, so tone curves cross every joint without a step, and the outline comes from `sidesOf` as one curve instead of a chord per band that kinks at every joint. The Raptor bell: +```js +const BELL = G.bandsOf([[3.2, bell(3.2)], [116, bell(116)]], [14, 28, 44, 60, 76, 92, 106], ENGINE, P, { radius: bell, slope: bellSlope, steps: 96, rows: 8 }); +BELL.bands.forEach((band, index) => put("nozzle", ex(ENGINE, (band.s0 + band.s1) / 2), S(band.paths, { tone: "hi", inner: index === 2 ? Ln(band.seam, { tone: "faint" }) : "" }), { shapes: [record(A.solid(ENGINE, band.profile, { radius: bell }))] })); +const SIDES = BELL.sidesOf(3.2, 106, { ends: "first" }); +put("nozzle", ex(ENGINE, 105), Ln(SIDES.d, { tone: "hi" }), { bias: 0.2, shapes: SIDES.points.map((points) => A.tube(points, 0.4 / KS)) }); +``` +Don't build bands by hand from separate `bandOfProfile` calls on two-knot chords with their own Hermite fits: each band then has its own end slopes, its tones step at every joint, and its chord outline kinks. + +**Known traps.** +- **Four-tone quantisation follows the slope of each facet row** when a body isn't smoothed. Mark every curved knot smooth (`[s, r, 1]`) and the shading follows on its own; a profile of hard knots that still describes a curve needs `smooth: true`. Use `bandsOf` on a body cut into bands. +- **Smooth shading is heavier.** A small turned ball with `smooth` costs about 9 KB; `sphereOf` costs under 3 KB. Use `sphereOf` for balls and keep `rows` low on small parts. + +## 11. Pipes, tubes and cables (`kit/tube.mjs`) +```js +import { tubePieces, tubeSvg, runsOf, crossingsOf } from "../../kit/tube.mjs"; +``` +| Function | What it does | +|---|---| +| `tubePieces(points3, radius, P, { maxLength = 30, spacing = 2.2, closed = false, breaks = [], gaps = [], caps = true, stripes = "auto" })` | Splits a 3D route into chunks of at most `maxLength` world units. Each one is drawn as a 2D ribbon with a paper body, a shine band toward the light, a shade band away from it, and two edge lines. Neighbouring pieces overlap by 0.5 units, and the edge lines are cut from the same overlapped span as the body, so neither a seam nor a notch in the outline shows at a joint. The shine and shade run 0.5 further than the body at every open end, so a stripe covers the anti-aliased cut of the body under it and its own cut lies on the neighbour's identical stripe; every frame normal is a central difference along the whole route, so the stripes of two chunks coincide exactly where they overlap (with both cut on one line, a hairline crossed the volute's shade band at every joint). `radius` is a number or a function of `t` (0 to 1 along the route), for tapers and volutes. `breaks` are arc lengths where a chunk must end (at a crossing, or where the pipe turns back past a part). `gaps` are `[from, to]` arc-length spans that are not drawn because a collar, clamp, valve or fitting covers them; the pipe ends flat on each side of a gap. Every end next to a gap gets an elliptical cap (the projected cross-section, with its outer half-arc as an edge), and so do the route's own two ends unless you pass `caps: false` (or `[start, end]`, such as `[false, true]` for a branch whose start hides inside a tee collar), so a pipe meets a flange face along the right curve instead of a straight cut. The shine and shade stripes follow the cap: onto the outward half of the ellipse when the end face is turned away, and up to its inner rim (drawn as an edge) when the face is turned toward you, so no stripe stops short of the end. A closed route with no gaps wraps its first and last pieces round each other. Returns `[{ mid, body, shine, shade, edges, wide, points, radii, ends, from, to }]`: `mid` is the chunk's centre in world space, to depth-sort it; `wide` is true when the route is wide enough on screen for its shine and shade bands (decided once for the whole route from its widest point, so a taper never drops its stripes at one chunk joint; `stripes: true` or `false` overrides it); `points` and `radii` are the chunk's 3D centreline and radii (record them for the audit); `ends` says which ends are real ends rather than joints with a neighbour. | +| `tubeSvg(piece, { tone = "hi" })` | One piece as ``. Shine and shade appear only on `wide` pieces, then the piece's rings (`.tb-ring`), then the edges. | +| `tubePieces(…, { rings: { pitch = 3, twist = 0, cross = false, fade = [0.1, 0.55], phase = 0, steps = 16, tone = "lo" } })` | A texture that follows the pipe's cross-section: a braid, corrugation, tape wrap or armour. Stations sit every `pitch` units of 3D arc length from the route's start (`phase` shifts them), so the pattern is continuous through every chunk joint; each is drawn as the visible front arc of the cross-section there, split into short segments whose opacity is `fadeOf(facing, fade)`, so the texture fades toward both limbs instead of ending on a hard line. `twist` (in radii) turns each ring into a helix that advances that far from limb to limb, and `cross: true` adds the other hand, for a braid. Rings run over each chunk's stripe overhang, so the later chunk at a joint draws an identical piece over its own body's cut, and stop on real ends and gap faces (rings keep a third of a pitch off an end face, helices end on it). Each piece carries `rings: [{ d, alpha }]`; `ringsSvg(rings, tone)` draws them alone. | +| `runsOf(total, gaps)` | The drawn `[from, to]` spans of a route of length `total` once `gaps` are taken out. Record each run as its own tube for the audit. | +| `crossingsOf(points, centre, axis, radius)` | Arc lengths where a route crosses the disc of a clamp or collar (the plane through `centre` normal to `axis`, within `radius`). Turn each into a gap of the clamp's thickness. | + +The fills for `.tb-body`, `.tb-shine` and `.tb-shade` are part of `ISO_CSS` (and `kit/iso.css`), so `tubeSvg` works on any kit page with no extra CSS. Override them in page CSS only to restyle tubes, as the Raptor does for selected parts (`.it[data-on] .tb-body`). + +**Depth-sorting tubes.** A pipe runs between parts at many depths, so draw each piece at its own depth: put it in your item list with key `G.dot3(piece.mid, G.viewOf(P))`, next to the solids it passes. Use short pieces (`maxLength` 6–18) where a pipe weaves between neighbours, and long ones (400) for a ring that lies flat on the floor. To split a pipe between SVG layers, test `piece.mid`. The ripple tank's motor cable goes three ways: pieces over the bridge (`piece.mid[2] > Z.top - 1 && piece.mid[1] < IN.y + IN.d - 10`) to the front SVG before the bar, the rest above the rim to the front SVG after the near caps, and the run down the leg to the control box to the middle SVG. Its lamp cable sends the pieces that hang over the base edge (`piece.mid[1] < BASE.y - 0.2`) to the back SVG. In a figure as dense as the Raptor, don't tune these keys by eye: record the pieces and let `orderKeys` (section 12) settle them. + +**Anything that wraps a pipe splits it.** A collar, band, bellows disc, clamp or valve body is wider than the pipe it sits on. If the pipe runs through it as one chunk, the chunk is both behind and in front of the collar and no key can order them: the collar either hides the pipe's near side or the pipe paints over the collar's face. Gap the pipe at the collar (`gaps: [[at - t/2, at + t/2]]`): the far piece ends at the collar's back face, the near piece starts at its front face, and both order cleanly. The Raptor's `pipe()` does this for its own end flanges, bands, bellows and valve, and `cable()` for the harness clamps via `crossingsOf`. + +The Raptor's `pipe()` helper is a good pattern: +1. `fillet` the control points with a bend of 2.6 × r (at least 3). A valve or bellows needs a straight leg at least as long as its body plus both fillet cuts (`r_bend · tan(turn / 2)` each); put it on a bend and its ends cut into the pipe. +2. Work out the collars first (end flanges, bands, bellows discs, the valve body) and pass their spans as `gaps`. +3. `tubePieces` the route, recording each chunk with its `points` and `radii`, and each drawn run as a tube for the audit. +4. Draw the collars, owned by the pipe (`owner`), so the audit doesn't count a pipe's own flange as a collision. + +`cable()` adds a terminal dot at an end that stays with its own assembly and a connector shell (`shells: [start, end]`) at an end that lands on another one, so every cable still ends on something when the figure comes apart. Both helpers take `free: [start, end]` for an end that comes off its mount when the figure is apart, and fillet with `{ P, tube: r }` (see `fillet`). A line that must leave a port facing the viewer starts from an `elbow` (a ball on the boss, rim on sphere at both joints, the line leaving it toward its next point), so the turn happens inside a fitting. `pipe()` puts each end flange's back face on the route end and can end a line in a `coupling` (a union nut at a quick-disconnect) instead of a flange. + +## 12. The audit (`kit/audit.mjs`) +```js +import * as A from "../../kit/audit.mjs"; +``` +**The one-line hook.** Make a recorder, let every drawing helper put its items and record its shapes into it, settle the keys, and end the build with `auditOrExit`: +```js +const R = A.recorder(P, { order: STAGGER, spring: SPRING }); +R.put({ piece: "base", at: centre, bias: 0.1, svg, shapes: [R.solid(A.slab(plan, 0, 6, { name: "base.plate" }))] }); +R.route("base.cable", route, 0.6, { piece: "base", gaps, limp: true }); +A.settle(R, P); +R.items.sort((a, b) => a.key - b.key); +A.auditOrExit(R, P, { crowd: [] }); +``` +`node build.mjs --audit` then prints the report and exits non-zero on any failing line; without the flag `auditOrExit` returns at once. A figure that doesn't come apart passes no `order` and every explode check reduces to the rest pose. + +| Function | What it does | +|---|---| +| `recorder(P, { order = [], spring = {}, ground = grounded })` | `{ items, solids, tubes, routes, put, solid, route, nameFor }`. `put({ at, bias, key, name, piece, move, ride, shapes, ...rest })` adds a drawn item (its key is `dot3(at, V) + bias` unless you pass `key`; the rest, such as `svg`, `route` and `chunk`, is kept on the item) and stamps its shapes with the item's `move`, `ride` and `piece`. `solid(shape)` records a shape and returns it, for the item's `shapes` or for static parts drawn outside the sorted layer. `route(name, points, radius, { owner, touch, bundle, limp, gaps, closed, ends, rims, free, piece, move, ride })` records a pipe or cable: one tube per drawn run between `gaps`, with its `tips`, `tipAxes`, `tipRims` and `free` ends, plus the route for `folds` and `crowding`. `nameFor(base)` numbers repeated names (`base`, `base#2`, …). `order` and `spring` are the live page's stagger and spring. | +| `explodeStates(order, spring, { uniform = 10, stride = 4 })` | `{ depth, frames, apart }`: the depth-solver states (uniform shares, every `stride`th replayed frame with reversals at every stagger boundary, prefix states) and the clearance frames (every replayed frame plus the prefix states). `{ depth: [0], frames: [] }` when nothing comes apart. | +| `settle(R, P, { states, skip = sameRun, ...overlapOptions })` | Runs `overlapsOf` and `orderKeys` and writes the keys onto the items. It keeps the order the items had, so you may sort `R.items` afterwards. Run it on every build. | +| `audit(R, P, { allow, crowd, cover, ground, frames, apart })` | Every check below on the recorded shapes, as one result for `report` and `failures`: clearance at rest, apart and in every frame, solid clearance, crowding at rest and apart (against slender solids too), stand-in shapes, terminals, loose ends, folds, self-overlaps, wobble, seats, supports and depth order. `allow` excuses depth pairs, `crowd` crowding pairs, `cover` stand-in items. It never sees line markup: run `scripts/lines.mjs` on the page for that. | +| `auditOrExit(R, P, { flag = "--audit", argv, ...auditOptions })` | With the flag: `audit`, print the report and a summary line, and set `process.exitCode = 1` on any failure. | +| `sameRun(a, b)`, `grounded(shape)` | Neighbouring chunks of one route (skipped by the overlap pass), and the default ground (a shape with `ground: true` in its meta or a name starting `stand.`). | +| `keyAt(item, state, V)`, `labelOf(state)`, `cameraBasis(P)` | An item's sort key in an explode state (`key + lift · share`), a state's printable label, and the camera's screen-right, screen-down and toward-viewer unit vectors `{ R, D, V }`, for probes of your own. | + +A detailed figure fails in ways the eye misses until a reviewer zooms in: a pipe or cable that passes through something, at rest or in any frame of the explode, a flange that floats off its mount, a part that hangs in the air or is sunk into its neighbour, a route that doubles back or pinches to a point on screen, a bend or end that lands on another line's outline, a cable end that dangles when the figure comes apart, and two things drawn in the wrong order where they overlap. The audit measures all of them from the real geometry. On the Raptor (478 items, 1,119 depth states, about 4,400 replayed and prefix frames for clearance) the keys take about a minute on every build and a full `--audit` about three minutes in all, most of it the per-frame clearance. + +**Shapes.** Record a shape for everything you draw, in world units, as you build it: + +| Constructor | Shape | +|---|---| +| `solid(F, profile, { radius, ...meta })` | A turned part: the profile closed to the axis at both ends, the same `[s, r]` list you give `solidOf`. Runs of smooth knots are traced along the same Hermite curve the drawing uses (or along `radius(s)`, as for a `bandsOf` band), so the recorded surface is the drawn one, not its chords. | +| `lathe(F, meridian, { radius, ...meta })` | The shape of `G.lathe(meridian, F, P)` with the same tracing: any closed meridian (rings, valve bodies, cans). | +| `body(F, polygon, meta)` | Any closed `[s, r]` polygon turned round `F`, taken as it is. Edges that lie on the axis are not surface, so a point deep inside a disc measures its true depth. | +| `disc(F, s0, s1, r, meta)`, `ring(F, s0, s1, rIn, rOut, meta)` | Flanges, bosses, pins, collars. | +| `box(min, max, meta)`, `orientedBox(centre, axes, half, meta)` | Square blocks; a beam at 45°. | +| `slab(plan, z, height, meta, steps = 8)`, `extruded(ring, z, height, meta)`, `cylinder(cx, cy, r, z, height, meta)` | The shapes of `slabOf`, `extrude` and `cylinder`: the same rounded plan or any polygon ring (convex or not) stood on the floor, so a rounded deck corner or an L-shaped bracket is checked as drawn. | +| `prism(F, polygon, s0, s1, meta)` | The shape of `G.prismOf`: any polygon in the frame's `u`, `v` plane extruded along `F.a`. | +| `traced(meridian, { radius, error = 0.02, depth = 6 })` | The polygon `solid` and `lathe` record. | +| `ball(at, r, meta)` | Spheres and terminal dots (`size / scale` world units). `meta.flats: [[nx, ny, nz, d]]` cuts flats (the half-space n·(p − c) ≤ d is kept): `sdf` is `max(\|p − c\| − r, n·(p − c) − d …)`, surface samples include the flats' rims, `boundsOf` is unchanged (conservative). The 3D mode's knuckle balls record this. | +| `tube(points, radius, meta)` | A pipe or cable centreline with a radius (number, function of 0..1, or a list per point). | +| `slide(F, from, to, r, meta)` | A rod sliding out of a gland at `from` (a `disc` from `from` to `to`). Posed in an explode or stroke state, it stretches from the gland face to `to + offset · F.a` instead of translating, so every check sees the rod that is drawn. Put it on the moving item (the one with the stroke `move`). | +| `moved(shape, offset)`, `sdf(shape, p)`, `boundsOf(shape)` | Helpers: translate, signed distance (negative inside), world bounds. | + +`meta` carries `name` (used in reports, and matched by prefix: `"nozzle.bell*"`), `owner` (a pipe's own flanges, bands and valve), `touch` (names a tube may touch on purpose, such as the clamps round a harness), `bundle` (cables in one harness may lie side by side, and a clamp carries its harness's bundle), `joined` (runs of one gapped pipe), `limp` (a cable: it holds nothing up), `anchor: false` (a clamp: an end may not count it as its mount), `fitting` (a clamp or collar whose centre `crowding` checks against other lines), `seated` (a pad or rim-on-sphere joint sunk into its host by design), `cut` (a shape or list of shapes subtracted from this one: a saddle pad is a disc cut by its host) and `curve` (the smoothed profile of a turned part with no analytic slope, for `wobble`). Tube runs also carry `tips` (the route's true end points, or `null` for an end that merges into a body, like a volute's start), `tipAxes`, `tipRims` (the flange or connector radius at each end), `free` (ends that are meant to come off their mount apart), `offset` and `total` (where the run sits on its route). Every shape carries the `move`, `ride` and `piece` of the item that draws it, so it can be posed in any explode state. + +**States.** An explode state is a number (every assembly at that share) or `{ label, shares }`, one share per assembly. `uniformStates(10)` gives 0, 0.1 … 1; they are not frames anyone sees, so they only feed the key solver. `springStates(order, { stagger, stiffness, damping, substeps, fps = 60, settle = 1e-3, stride = 1, reversals = [] })` replays the live page's own springs with their stagger, opening from rest and closing from apart, one state per frame at `fps` until every spring is within `settle` of its target (about 1.2 s each way on the Raptor, so the slow tail of every collapse is checked too). `stride: 4` keeps every fourth frame, for the depth raster. `reversals` adds the paths a quick hover makes: open, then close again after that many seconds (and the reverse), with the page's own scheduling: on a reversal only the assemblies whose target changes are rescheduled, staggered among themselves, so one that has just left comes straight back and one still waiting simply stays home. **`reversalsOf(order, stagger)`** gives a reversal 8 ms either side of every stagger boundary: that is where the bad windows are (a reversal 15 ms before the next start left the hot-gas duct flying out into a methane pump still parked at home), and three hand-picked times missed every one. **`prefixStates(order, { shares = [0.25, 0.5, 0.75, 1] })`** adds the static states behind the prefix rule: the first `k − 1` assemblies fully out, the `k`-th at each share, the rest home. Shares along the stagger are always non-increasing (earlier assemblies lead, opening, closing and reversing), so every reachable frame lies between these. A 40 ms sample missed whole pass-throughs: between two samples the nozzle travelled 15 units, more than twice the widest pipe. `shareOf(item, state)` reads an item's share from its `ride` (or `piece`), and `offsetOf(item, state)` is its move times that share. + +**`overlapsOf(items, P, { step = 0.25, tolerance = 0.3, least = 0.25, states = [0], skip })`** finds every pair of drawn items whose screen footprints overlap in each state and, on a grid of `step` viewBox units over the overlap, ray-casts both shapes along the camera ray. A cell counts when one surface is more than `tolerance` nearer. Each side's flagged cells are closed (one dilate, one erode, so an aliased sliver becomes solid), eroded once (so the hairline along a real contact drops out), and the largest connected piece is measured in px²; a side is "in front" when that area is at least `least`. At the old 0.5 step with a 4-neighbour core count, a whole flange sunk into a pump housing and every cable crossing (a 0.5 cable is under three cells wide) read as noise. Each item is ray-cast once, at home; in any state its raster is that one shifted on screen by its offset (rounded to the grid) and in depth by `offset · V`, which is exact for a translation. Pair results are cached by the pair's relative shift, so pairs that move together are measured once. On the Raptor, 1,119 states (uniform, every fourth frame of every replayed path, prefix states) cost less than the old 61. `skip(a, b)` excludes pairs, such as neighbouring chunks of one pipe. + +**`orderKeys(items, overlaps, { gap = 0.02 })`** turns every one-sided pair into a rule in that pair's state: `keyFront − keyBack ≥ gap + shareBack · liftBack − shareFront · liftFront`. It is linear in the keys, so one longest-path relaxation settles all states at once and only ever moves an item later. A loop that can't be met drops its weakest rule (`dropped`). Pairs in front of each other in different places are `cycles`. + +**`depthOrder(items, P, { overlaps, solved, rest, allow })`** checks the final order in every state. At rest (`rest`, default the states 0 and 1) and in every replayed spring frame, every wrong pair is a problem: a clean misorder, an interlock and a pair no key of the form `k + lift · share` can hold all show on screen. In the uniform states only a clean misorder counts; interlocks there are listed as passing. `allow` takes `[patternA, patternB]` pairs to excuse explicitly. + +**`clearances(tubes, solids, { ratio = 0.5, least = 0.2, state, only, mounts })`** samples every tube and lists every place it comes closer than `max(least, ratio · r)` to a solid or another tube. Near a run's flat end it measures the end ring, not a sphere that would overhang the cut. Only an end's own mount (the shape its rim sits on, see `mountsOf`), that mount's pipe, and the fittings of a line that shares the mount or lands on this tube are excused, and only within `r + gap + 1` of the end; near an end anything else may still not be entered by more than 0.1. Pass `state` to pose everything (the excuse holds only while tube and mount are within 0.05 of where they sit together) and `only: "through"` to list penetrations alone. A tube's distance to another tube is the true capped-cylinder distance, so a run that ends flat under a flange doesn't grow a phantom round cap that the next run seems to enter. + +**`mountsOf(tubes, solids)`**, **`terminals(tubes, solids)`** find, for every tube end, the nearest anchored shape to its end rim (12 points at the flange or connector radius) and list every end whose rim isn't within 0.15 of it: a flange standing off its port, a flat flange on a curved body (the rim gap), a cable that stops beside the bundle or inside a clamp. + +**`looseEnds(tubes, solids, { state = 1 })`** lists every tube end that, in that explode state, touches no solid of another owner that moves with it. Its own flange, coupling or connector shell does not count (with it, the check could never fail: 25 Raptor ends rested only on their own fitting). Ends marked `free` are reported separately as a deliberate list; everything else fails. + +**`supports(solids, tubes, { ground, touch = 0.15, sunk = 0.5 })`** builds a contact graph of solids and rigid tubes and lists every solid not connected to the `ground` (default: names starting `stand.`), plus every pair of solids sunk more than `sunk` into each other unless they share an owner or one is `seated` on the other (named in its `cut`). A seated pad is excused against its host only: the Raptor's igniter flange sunk 0.5 into the hot-gas pad of another assembly hid behind a blanket `seated` flag. `hanging` lists rigid tubes that connect to nothing held, and fails too. + +**`solidClearances(solids, { state, sunk = 0.5 })`** poses the solids and, for every pair that sits at a different offset in that state, tests each one's surface points against the other's `sdf`; anything more than `sunk` inside fails (a seated pad and its host are excused). Run it at state 1 and in every replayed and prefix state: a housing, pad or flange of one assembly sweeping through another's body is invisible to the tube checks. + +**`seats(solids)`** lists every `seated` shape cut to a host that moves with another assembly. Apart, its cut base is on show: the hot-gas duct's saddle, cut to the methane pump's turbine and ring, flew out as a jagged shard with a pointed tail. A saddle belongs to its host's assembly; the moving line meets it on its flat face. + +**`selfOverlaps(items, P, { fold = 0.25, least = 0.5 })`** checks each drawn tube chunk against itself: where the screen centreline turns on a radius under the tube's screen half-width, the inner edge of the ribbon runs backwards and the single-chunk outline crosses itself (a knot with the hidden leg's edges showing through). It fails when that fold is at least `least` px and the spot isn't covered by another item. A leg that points at the viewer and turns within a radius or two of a port is the usual cause. + +**`wobble(solids, { samples = 20 })`** samples `dr/ds` of every recorded `curve` at 20 points per segment and lists the `s` values where it turns between the run's ends. + +**`folds(routes, P, { fold = 140, turn = 110, pinch = 2, items })`** lists every route (`{ name, points, r }`) whose screen direction turns more than `fold` degrees within four radii while its real turn is under `turn` (the cusp of a pipe that runs away from the viewer and then drops), and every bend that turns more than 90° on screen round a radius under `pinch` × the tube's screen radius, measured over spans of 1.5, 3 and 6 radii (a fillet seen edge-on: the V of a leg that points at the viewer and then climbs). A pinch within three tube widths of an end is a stub seen end-on and doesn't count. With `items`, only bends you can see count: each is ray-cast against every drawn shape. + +**`crowding(routes, P, { gap = 1, bend = 30, links, items, allow, state, clear = 2 })`** lists every place where a route's bend (a 3D turn over `bend` degrees within ±2 radii) or end lands on another route's outline on screen: the outlines closer than `gap` px or overlapping, with both lines visible there (ray-cast against `items`; a route's own flanges, shells and clamps count as the route). Those read as a joint or a line threaded through another, whatever the true depth. A bend is never excused by overlapping deeply; an end only when the other line is straight there and the end's tip itself is clear of it. Every `fitting` (a harness clamp) is checked too: a clamp whose outline lands within `clear` px of another line reads as that line growing out of the clamp, as the Raptor's harness clamp did on the oxygen-to-preburner line in the apart pose. `links` (from **`linksOf(tubes, mounts)`**) excuses lines that really meet: one mounted on the other, both on one mount. `state` poses routes and items in an explode state, so the apart pose is checked too (routes carry `move`, `ride`, `piece`). `allow` takes `[patternA, patternB]` pairs you have looked at and judged clear. + +**`slenderOf(solids, { ratio = 4, least = 0.3 })`** turns every slender recorded solid (a turned part, prism or box longer than `ratio` × its radius or half-width: tie rods, piston rods, posts, rails, handles) into a pseudo-route, which `audit` passes to `crowding` as `rods`. A tube's bend or end that lands on one fails like one landing on another tube (`crowding: hose.B end × cyl.tie-rod (rod)`), unless the tube is mounted on it or on something linked to it. Rods are only ever the line landed on: their own ends aren't checked. + +**`coverage(items, P, { least = 0.6, pad = 1, allow })`** compares, for every item with an `svg` string, the screen box of what it draws (`markupBox(svg)`: every path, circle, line, rect and polyline, through `transform`s and `clip-path`s, without halos, text and defs) with the screen box of its recorded shapes (`footprintOf(shape, cameraBasis(P))`), and lists every item whose shapes cover less than `least` of its drawing: `stand-in shapes: rod.rod its shapes cover 4% of its drawing`. A sliver recorded for a long rod, or one shape recorded for an item that draws three parts, makes every other check blind to the rest. `audit` takes `cover: [names]` to excuse items whose drawing really reaches past their body; look at each first. + +**`report(result)`** formats everything; **`failures(result)`** counts what should fail the build. + +The Raptor wires it like this (`examples/raptor-engine/build.mjs`): its `put`, `tubeItems` and `record` are thin wrappers over `R.put`, `R.route` and `R.solid`, and the end of the build is +```js +A.settle(R, P); +items.sort((a, b) => a.key - b.key); +A.auditOrExit(R, P, { crowd: CROWD_OK }); +``` +The live page reads the same `STAGGER` and `SPRING` from its data, so the audit and the page can't drift apart. Every helper (`turned`, `band`, `flangeAt`, `boss`, `padOn`, `boxAt`, `valveOn`, `pipe`, `cable`, `clampAt`, `strut`, the actuators) records its shape as it puts its item, and the static stand drawn in the back layer (deck, flame cone, deluge ring and feed, columns, splices) is recorded as fixed shapes owned by `stand.frame`, so an explode vector that drove a part into the stand would fail too. Nothing escapes the check. + +## 13. The WebGL layer (`kit/gl.mjs`) +| Export | What it is | +|---|---| +| `GLSL_ISO` | The GLSL prelude that `glLayer` prepends. It holds the camera uniforms (`uCanvas`, `uView`, `uOrigin`, `uK`, `uCam`, `uTime`) and the functions `viewOf`, `project`, `towardViewer`, `rayOf`, `pixelOf`, `lightDir`, `onFloor`, `onWallX`, `onWallY`, `hash12`, `hash13`, `noise2`, `noise3`, `fbm2`, `fbm3`, `window` and `tonemap`. Don't redefine any of them in your fragment: GLSL rejects a second `rayOf`. | +| `rayOf(vb)` (GLSL) | The world point under viewBox point `vb` on the vertical plane through the origin that faces the camera. `rayOf(vb) + t·towardViewer()` is that pixel's whole ray; larger `t` is nearer the viewer. | +| `pixelOf()` (GLSL) | World units per canvas pixel, `(uView.x / uCanvas.x) / uK`. Divide by `uCam.z` for the floor's depth direction, or by `uCam.w` up a wall. | +| `glCamera(P)` | `{ origin, k, cam }` for a projection. Works in Node, so put it in the page `DATA`. | +| `glLayer({ canvas, fragment, view, camera, uniforms = [], fixed = {}, extensions = [], maxRatio = 1.5, onError })` | Returns `{ gl, extensions, set(values), draw(values, time), clear() }`, or `null` without WebGL or on a compile error. `uniforms` names the uniforms you will send per frame. `fixed` is `{ name: value }`, set once at creation, for everything that never changes (plans, heights, theme constants). `extensions` lists GLSL extensions such as `"GL_OES_standard_derivatives"`; each one the context supports is enabled and prepended as `#extension … : enable`, and the returned `extensions` lists those that were. | +| `set(values)` | Sets uniforms without drawing, for a value that changes rarely. | +| `draw(values, time)` | Fits the canvas, sets the camera uniforms and `uTime`, then `values`, and draws. | +| `clear()` | Clears to transparent, only if something was drawn. | +| `smooth(a, b, x)` | Smoothstep in JS. | +| `burst(age, rise, fall)` | An event envelope: a smoothstep attack over `rise` seconds, then exponential decay with time constant `fall`. 0 for `age ≤ 0`. | +| `settle(state, target, dt, seconds, calm = false)` | A critically damped spring on `state = { x, v }` with time constant `seconds`, four sub-steps. Snaps to the target once both error and velocity are below 1e-4. Returns true while still moving. `calm` jumps straight to the target. | + +| `GLSL_TURN` | Opt-in GLSL for 3D figures, prepended by the figure to its fragment: `uGroupX/Y/Z/T`, `toGroup(p)` (world → the group's rest-world coordinates), `toWorld(g)`, `dirToGroup(d)`, `dirToWorld(d)`, and the cover masks `uCoverEdge[60]`, `uCoverCount[6]`, `coverOf(vb, soft)` (1 inside a part painted after the effect). It defines `toWorld`: don't prepend it to a fragment that declares its own. The chunk uses 70 uniform vectors. | +| `glslPose(Name, prefix = "uName")` | The same four functions for any group: `toName`, `fromName`, `dirToName`, `dirFromName` over `prefixX/Y/Z/T`, so one shader follows several groups. Feed it `TURN.poseUniforms(controller, group, prefix)`. | + +A value for `fixed`, `set` or `draw` can be a number (float), an array of length 2–4 (`vec2`–`vec4`), or an array or `Float32Array` longer than 4, which goes to the uniform array of the declared type: `uniform3fv` for `uniform vec3 name[N]` (cover edges, spark positions), `uniform2fv`/`uniform4fv` likewise, and `uniform1fv` for `uniform float name[N]`. There are no ints, matrices or samplers through these calls; a `sampler2D` defaults to texture unit 0, so bind a texture with `layer.gl` (the ripple tank's history texture). Names that aren't in `uniforms` or `fixed`, and uniforms the compiler optimised away, are skipped. + +`smooth`, `burst` and `settle` are plain JS: import them from `kit/gl.mjs` in a module, or get them for free on a page that inlines `glScript()`. `references/webgl.md` has the full contract, a minimal page and the craft rules. + +## 14. Tools +| Script | Use it for | +|---|---| +| `scripts/capture.mjs` | One-shot screenshots: desktop, phone, hover, keys, timed shots, 4× zooms, reduced motion, console check. Chrome starts with WebGL on (SwiftShader allowed), so shaders show. `--times` delays are measured from the first shot; `--key` sends the same key codes as `drive.mjs` (`7` is `Digit7`, `Comma` sends `,`). | +| `scripts/drive.mjs` | Scripted sessions in headless Chrome with WebGL on: scroll, move, click, key, slow, until, eval, shots and contact sheets. `--no-webgl` checks the SVG fallback and `--preload file.js` runs a script before the page's own. Use it for shader transitions and anything with a sequence. See `references/verify.md`. | +| `scripts/lines.mjs` | The line-end check: every texture line in the card must end on a stroke, a dot or an outline, or under a later fill. `--out` rings the failures; exits 1 on any. The same check is the `["lines"]` action of `drive.mjs`. See `references/verify.md`, "Line ends". | +| `scripts/inline-kit.mjs` | `kitScript()`, `glScript()` and `turnScript()` return the kit, the WebGL layer and the 3D runtime as plain script, to inline into a standalone page. | +| `scripts/drive.mjs` `["turn", value, group?]` | 3D figures: sets the first turn group (or `group`, or a values object) through `window.__isoTurn` and waits two frames. | +| `scripts/drive.mjs` `["orbit", out.png, from, to, step, sel?, scale?, [x,y,w,h]?, columns?]` | 3D figures: a contact sheet across angles, each frame labelled θ°. 15° over a full turn; 0.1° across an order change; 1° across a fold-prone bend. | +| `scripts/turn-check.mjs` | 3D figures. `build.mjs --fidelity` (Node: prisms, rounds, lathes and tubes against the kit builders at P′(θ)); `page.html --order` (needs a `--verify` build), `--pops`, `--lines`, `--perf`, `--states file.json`, `--part name`, `--out dir`. Every check runs its planted control first. `references/3d.md`, section 14. | +| `scripts/turn-bench.mjs` | 3D figures: `emit` and `order` CPU time in Node over 360 angles, per part kind (median of 7). | + +## 15. Turning groups (`kit/turn.mjs`, `turn-build.mjs`, `turn-audit.mjs`) +The optional 3D mode. `references/3d.md` is the guide; this is the reference. +```js +import { turning, separate, gjk } from "../../kit/turn-build.mjs"; +import { TURN, TURN_CSS } from "../../kit/turn.mjs"; +import * as TA from "../../kit/turn-audit.mjs"; +``` + +### `turning(P, { recorder, scale = 1 })` → `T` +| Member | What it does | +|---|---| +| `T.group(name, { parent?, turn: { pivot } \| slide: { direction, travel } \| hinge: { point, axis, range } \| free: { origin } })` | A rigid group. Values: degrees (turn, hinge), world units (slide), `{ R \| q \| axis+angle, t, world? }` or `null` (free). | +| `T.layer(name)`, `T.stack(names)` | Live layers and the full back-to-front stack of live and static layer names. | +| `T.prism`, `T.round`, `T.lathe`, `T.ball`, `T.tube`, `T.fixed`, `T.plane`, `T.billboard`, `T.split` | Parts, in world coordinates at rest. Common options `{ name, group, layer, tone, crease, lit, material, owner, details }`. Signatures in `3d.md`, section 4. | +| `T.build({ statics, poses, verify, strict })` | `{ svg, data, css, report, layerSvg(name, { width, height }), verify, planesByName }`. | +| `T.parts`, `T.groups`, `T.layers`, `T.routes`, `T.data`, `T.built` | The scene, for the audit and the checks. | + +`details`: `seams`, `ribs: { s0, s1, count, phase, twist, fade, seams, tone }`, `bolts: [{ s, r, count, phase, size, tone, fade }]`, `dots: [{ at, normal, size, tone }]`, `rings: [{ at, normal, r, tone }]`, `rules: [{ points, tone, free }]`, `bevel`. Each constructor takes its own subset in its own frame (a ball's `s` runs along its first flat's normal; a prism takes dots, seams and bevel only): the table in `3d.md`, section 4. Materials: `gold`, `chrome`, `steel`, `gunmetal`, `rubber`, `brass`, `copper`. + +`separate(A, B, hints)` and `gjk(A, B, warm)` return `{ n, d, margin }` for two point sets (the build's plane solver). + +### `TURN` (runtime) +| Member | What it does | +|---|---| +| `TURN.mount(stage, data, { onHold, onFrame, follow })` | The controller: `set(values \| θ, { detail })`, `render()`, `angleAt(x, y, z, group)`, `values`, `pose(name)`, `detach(name)`, `anchor(group, restPoint, restDir?)`, `cover(names, options)`, `order(layer)`, `orderIndex(layer)`, `events()`, `stats()`, `frames()`, `cams()`, `scene()`, `destroy()`. Installs `window.__isoTurn`. | +| `TURN.cover(controller, names \| [names…], { polygons = 6, edges = 10, pad = 0.3, layers })` | `{ uCoverEdge, uCoverCount, dropped, parts }` for `coverOf`. | +| `TURN.poseUniforms(controller, group, prefix = "uGroup")` | Four `vec3` for `GLSL_TURN` or `glslPose`. | +| `TURN.anchor(scene, cams, group, point, dir)`, `TURN.floorOf(scene, group, R)` | Anchors outside a controller; the lowest z of a group under a rotation. | +| `TURN.rotation(axis, deg)`, `TURN.quat(q)`, `TURN.compose(A, B)` | Rotations as `[9]`, for free poses. | +| `TURN.materials`, `TURN.materialCss()`, `TURN.css()`, `TURN_CSS` | Material names; the CSS. | +| `TURN.camera`, `TURN.poses`, `TURN.cams`, `TURN.prepare`, `TURN.emit`, `TURN.order`, `TURN.frame`, `TURN.gjk`, `TURN.disjoint`, `TURN.q`, `TURN.levels` | The pipeline, for tools: cameras per group, a prepared scene, one part's frame, a layer's order. | + +### Orbit audit (`kit/turn-audit.mjs`) +| Export | What it does | +|---|---| +| `orbitOrExit(T, R, P, { flag = "--audit", argv, sweep, clips, poses, crowd, cover, fittings, quick, only, log })` | Runs `orbit` when the flag is present, prints the report, sets exit code 1 on any failure. Ends `turn audit passed` only for a full run; with `only` it ends `turn audit partial`, with `quick` `turn audit quick` (`3d.md`, section 13). | +| `orbit(T, R, P, options)`, `orbitReport(result)`, `orbitFailures(result)` | The checks, the text, the count. `result.skipped` lists the lines `only` left out (printed `skipped`); `result.quick` is set for a quick run. | +| `posed(shape, pose)`, `eventsOf(T, layer)` | A recorded shape moved by a group pose; a layer's edge-on angles. | diff --git a/skills/anatomy/references/motion.md b/skills/anatomy/references/motion.md new file mode 100644 index 0000000..2274ff6 --- /dev/null +++ b/skills/anatomy/references/motion.md @@ -0,0 +1,165 @@ +# Motion and interaction + +A figure is alive when its mechanism moves the way the real thing would: a carriage glides and settles, a spring overshoots once, a needle swings to the new reading. Motion should be calm enough to follow and true to the model. + +## Principles +- **Time-based.** Take `dt` from `requestAnimationFrame` timestamps and clamp it to 1/30 s so a background tab doesn't jump. Never step a fixed amount per frame. +- **Ease toward targets.** Pointer and keyboard set a *target*, and the part follows with exponential easing (`x += (target − x)·(1 − e^(−dt/τ))`, τ = 0.1–0.3 s) or a spring. Parts never snap to the cursor. +- **Real springs where the subject is springy.** Use stiffness and damping from the real model, sub-stepped about 240 times a second for stability. Snap to the target once both error and velocity fall below 5e-4. +- **One loop per figure.** A single `tick(dt)` updates the model, then writes the DOM through refs: `setAttribute("transform" | "d")`, `textContent`, `dataset`. Don't re-render React per frame. +- **Stop when settled or offscreen.** Use an `IntersectionObserver` with rootMargin `120px 0px`, and read the newest entry (`entries[entries.length - 1]`): when the stage leaves and comes back between two callbacks, one callback delivers both entries oldest first, and reading the first one leaves the figure frozen on screen. Stop the loop once everything has reached its target. +- **Reduced motion.** When `prefers-reduced-motion: reduce` is set, jump to targets with no tour, flow or pulse. The figure must still respond to input. +- **Idle tour.** When nobody is interacting, play a scripted loop after about 1.4 s that shows the point of the figure. Pause it on hover, focus or press, and resume about 3.6 s after the last interaction. The tour drives the same targets the user would. +- **Readout updates live** from the same model, in true units and short: `block 2 · reads 14.0 px`, `120.0 × 32.0 · lean 10.6 px`. Read it from where the parts are, not from the target: the Raptor says `taking apart` or `closing up` while any spring is moving or pending, and only then `apart · 11 assemblies` or `1,630 kg · cold`. Take a phase word and the number beside it from the same instant of the same source: a blind-test bench printed `end of stroke · relief 85 bar` (the word from the model, the number from a gauge needle lagging 0.25 s behind it) although its relief valve cracks at 92, and `idle · 44 bar` just after retracting. + +## Pointer +- Map the pointer to world space with the screen vector of an axis. Use `axisVector(P, [1, 0, 0])` for motion along x, or map the figure's width fraction onto the part's travel range. The range mapping is simpler and feels better when the travel is short. +- Hover previews and press commits. On touch there is no hover, so make a tap act and keep `touch-action: pan-y` so the page still scrolls. +- Use pointer capture while dragging, and release it on `pointerup` or `pointercancel`. + +## Keyboard and accessibility +- The figure's root is focusable (`tabIndex=0`) with `role="slider"` (or `"group"` plus buttons when there are discrete choices), an `aria-label` that explains the controls, and `aria-valuenow`/`aria-valuetext` in words, such as "Pressed: 129.6 by 34.6 pixels, leaning 10.6 px". Write the value text when the reader's choice changes (a part selected, apart or assembled, firing or cold), not from the loop: screen readers announce every change of a focused slider's value text, so a readout ticking each frame ("Pc 290 bar · 222 tf") became a stream of numbers. Keep the visual readout and the accessible value separate (the Raptor's `say()` writes only the readout, `describe()` the value text); the live region carries the phases. +- Keys: arrows step by a sensible unit (Shift for bigger steps), Home and End go to the extremes, Space or Enter presses or toggles, and Escape releases. +- Show a focus ring: `outline: 1px solid var(--anatomy-muted); outline-offset: 6px`. +- The `` carries `role="img"` and an `aria-label` describing the object and what it shows. + +## Vanilla loop (framework-free) +```js +let frame = 0, last = 0, visible = false, touring = !still.matches, clock = 0; +function tick(now) { + const dt = last ? Math.min((now - last) / 1000, 1 / 30) : 1 / 60; + last = now; + const calm = still.matches; + if (touring) { clock += dt; target = tourAt(clock); } + x = calm ? target : x + (target - x) * (1 - Math.exp(-dt / 0.28)); + springTo(tip, heightUnder(x), dt, 420, 26, calm); + draw(); // setAttribute on refs, readout.textContent = … + const settled = !touring && x === target && tip.rate === 0; + frame = visible && !settled ? requestAnimationFrame(tick) : 0; +} +const run = () => { if (!frame && visible) { last = 0; frame = requestAnimationFrame(tick); } }; +new IntersectionObserver((entries) => { visible = entries[entries.length - 1].isIntersecting; if (visible) run(); }, { rootMargin: "120px 0px" }).observe(stage); +``` +`examples/dial-indicator/build.mjs` contains a complete version, with the tour, pointer mapping and keyboard stops. + +## React loop +Keep static art in props built on the server and move only `` wrappers and the paths that change shape: + +```tsx +"use client"; +export function RigLive(props: { base: React.ReactNode; carriage: React.ReactNode; dial: React.ReactNode }) { + const { anchor, say } = useReadout(); + const car = React.useRef(null); + const needle = React.useRef(null); + const state = React.useRef({ x: REST, target: REST, tip: { at: 0, rate: 0 } }); + const visible = useInView(anchor); + const kick = useLoop((dt, calm) => { + const s = state.current; + s.x = follow(s.x, s.target, dt, 0.28, calm); + const settled = spring(s.tip, heightUnder(s.x), dt, 420, 26, calm); + car.current?.setAttribute("transform", translateAlong(P, [s.x, 0, 0])); + needle.current?.setAttribute("d", needleAt(s.tip.at)); + say(readoutOf(s)); + return !(settled && s.x === s.target); + }, visible); + return ( +
{ state.current.target = toWorld(e); kick(); }}> + + {props.base} + {props.carriage} + {props.dial} + + +
+ ); +} +``` +`examples/test-rig/live.tsx` is the full production version, with springs, a tour, press and pull, keyboard handling and aria. + +## Shapes that change +When a part changes shape rather than position (a swelling capsule, a compressing spring, a needle turning), rebuild only its paths each frame with the kit, using `slabOf`, `coil` or `lineOnTop`, and write them to its paths: `fill`, `shades[0..3]`, `top`, `crease`, `bevel`, `outline`. One solid costs well under 0.1 ms. Measure it: a frame should stay under about 1 ms of script. +- **Precomputed frames step.** A lever drawn from 41 prebuilt frames over ±15° moved its knob about 0.8 px per frame, visible in slow motion. Rebuild a rotating part each frame, or precompute enough frames that one step moves nothing more than 0.25 px. +- **A rod that slides out of a gland** doesn't change shape: it is one full-length rod that moves, clipped at the gland face by a clip that stays put (`G.rodOut`, `holdStill`, `craft.md`, section 3). Never draw it as several overlapping copies. + +## Envelopes for one-shot events +A flash, a click, a pop, a shake or a shock is an event with an age, not a value you set. Drive it with an envelope that has an attack and a decay. `kit/gl.mjs` exports `smooth(a, b, x)` (smoothstep) and `burst(age, rise, fall)`, which is `smooth(0, rise, age)` times `exp(−(age − rise)/fall)` after the peak and 0 before the event: +```js +import { smooth, burst, settle } from "../../kit/gl.mjs"; +const flash = calm ? 0 : burst(clock - mainAt, 0.08, 0.13); +``` +On a standalone page `glScript()` already inlines all three, so use them directly and don't declare your own: a second `const smooth` in the same module script is a SyntaxError. +- The attack is 40–120 ms, and the smoothstep gives it zero slope at onset. Setting a value to 1 in one frame is a pop. +- Store the event's start time (`mainAt = clock`) and compute every envelope from its age each frame. Two events that overlap then simply add. +- Give each event its own flag (`popped`), so a quick restart can't swallow the next one and can't cut off one that is still fading. +- Under reduced motion every event envelope is 0. + +## Critically damped settle +For a value that should arrive without overshoot (a hue, a brightness, a lamp, a reach, a frequency), use the kit's `settle(state, target, dt, seconds, calm)`: a critically damped spring on `state = { x, v }` with time constant `seconds`, `v += (w²·(target − x) − 2w·v)·dt` with `w = 1/seconds`, in four sub-steps. It is smoother than exponential follow, because velocity is continuous too. It snaps to the target once error and velocity are both below 1e-4, jumps there under `calm`, and returns true while still moving, so it can keep the loop alive: +```js +const moving = settle(freq, state.tf, dt, 0.625, calm); +``` +The ripple tank runs its frequency (0.625 s) and dipper spacing (0.4 s) through `settle`, so a key press or a pointer move never jumps the wavelength. +- **Separate what a phase changes.** When one physical quantity (say chamber pressure) drives colour, shape and brightness, a fast spring on that quantity makes all three jump at once. Give colour its own slower `settle` (0.3–1 s), and compute brightness so it moves one way through the change. +- **A fade-out only gets darker.** When a stop begins, freeze the brightness at its current level and scale it only by quantities that fall. +- **Changing a spring changes its neighbours.** Damping one spring critically slows every phase that relied on its old overshoot, so recheck all of them. + +## Exploded views +Taking a machine apart on hover is a strong way to show its parts (`examples/raptor-engine/`): +- **Build every piece at its assembled position**, tagged with an assembly name, and give each assembly a world move vector (`PIECES.nozzle.move = [0, 0, -120]`). Moves follow the real assembly: the nozzle drops furthest, side units slide out radially (`out(deg, r, z)`), and the stand doesn't move. +- **One spring per assembly**, with value 0 for assembled and 1 for apart. The Raptor uses stiffness 64 and drag 14.2, just under critical, so the parts settle with a hint of weight, and sub-steps 4 times per frame. +- **Stagger the springs.** Opening, each assembly's target changes 35 ms after the previous one, in an order that lets nothing pass through anything (the Raptor: `nozzle, downcomer, controller, plumbing, lox, ftp, hotgas, chamber, orpb, otp, gimbal, stand`, see "Order the stagger" below). Closing uses the reverse order, so the machine folds back together from the inside out. Keep pending targets as `{ value, at }` and apply them when `clock >= at`. +- **On a reversal, reschedule only what changes.** When the reader reverses mid-way (a quick hover, Space, a tap), cancel the pending target of every assembly that hasn't left yet and stagger only the ones whose target changes, by their index in that shorter list. The last one out is then the first one back, at once. Rescheduling the whole list left the early assemblies flying out toward apart for 0.3 s while later ones sat at home, and the explode only worked because the next assembly moved out of the way 35 ms later: a reversal in that window drove the hot-gas duct into a methane pump that hadn't left. With this rule, shares along the stagger stay in order in every frame (earlier assemblies always lead), which is what the prefix rule below relies on. +- **Move with transforms.** Each item's screen offset is its move vector, projected and multiplied by the spring value: `translate(tx ty)`. Remove the attribute at 0, so an assembled figure is exactly the static art. +- **Keep the lines landing.** Parts that join two assemblies (an actuator between the frame and a pump lug, or a cable between a box and a plug) belong to the assembly they physically stay with, and they still end on something when apart. Cables get terminal dots at both ends. +- **Selection.** Hover, the keyboard arrows and a parts list all select one assembly. The selected parts become the one `lit` accent: CSS on `.it[data-on]` moves `hi` to `lit` and `mid` to `hi`, and switches tops and sides to the lit fills. Every other part steps down one tone (`hi` to `mid`, `mid` to `lo`) through CSS on `[data-focus]`, and the readout says what the selected part does. + +## Depth re-sorting of moving parts +Parts that move toward or away from the viewer change painter's order as they move. When they do, sort every frame: +- Give every item a static key `k = dot3(ref, viewOf(P)) + bias`, where `ref` is its centre and `bias` settles ties between touching parts. Also give it a lift: `lift = dot3(move, viewOf(P))`. +- Each frame, its key is `k + lift × spring`. Sort the indices by that key, and **re-append the DOM nodes only when the order actually changed** (one `DocumentFragment`). Most frames change nothing. +- Store the key and the move vector on the element (`data-k`, `data-m`), so the live script needs no geometry. +- Tubes are sorted per piece (`tubePieces` → `piece.mid`), so a pipe can pass in front of one part and behind another. +- **Settle the static keys from the motion, not just the rest poses.** Each item's key is `k + lift × spring`, but with staggered springs every assembly has its own share in any frame, so two items that are ordered right assembled and apart can still be drawn the wrong way round in between: in the first Raptor a pressurisation line hid behind an actuator column it was in front of for 40% of every explode. The Raptor measures true depth for every overlapping pair at 0, 0.1 … 1, at every fourth frame of its own springs replayed with the live stagger until they settle, opening, closing and reversed either side of every stagger boundary, and in the prefix states (`A.explodeStates(STAGGER, SPRING).depth`, which is `[...A.uniformStates(10), ...A.springStates(STAGGER, { ...SPRING, stride: 4, reversals: A.reversalsOf(STAGGER, SPRING.stagger) }), ...A.prefixStates(STAGGER)]`, 1,119 states, and the default of `A.settle(R, P)` for a recorder made with `{ order: STAGGER, spring: SPRING }`), and `orderKeys` solves all of them at once (each rule uses that frame's shares). Opening and closing alone left wrong pairs in the frames a quick hover makes: a purge flange that should sit in front of the chamber band vanished behind it on a reversal at 0.20 s. The audit fails on any wrong pair at rest and in any replayed frame; only the uniform states, which nobody sees, may hold an interlock. +- **One source for the springs.** Keep the stagger order and the spring constants (`SPRING = { stagger, stiffness, damping, substeps }`) in the build and pass them to the page in its data, so the audit replays exactly what the viewer sees. +- **Move a part with what it is mounted on (`ride`).** A sensor bolted to the chamber highlights with the plumbing but rides the chamber's spring. Each item records `ride` (the assembly whose spring moves it, found from its move vector) next to `piece` (the assembly it highlights with), the page reads `data-ride`, and `place()` uses `piece[node.ride].x` for both the translate and the sort. An item that borrows another assembly's vector but keeps its own spring slides along its mount and sinks into it mid-flight. +- **The prefix rule.** Every assembly's path must be clear of every later-leaving assembly parked at home, with the earlier ones out: that is the frame a reversal at a stagger boundary freezes. `A.prefixStates(STAGGER)` poses exactly those (the first `k − 1` out, the `k`-th at 0.25 … 1, the rest home) and the audit checks them with the replayed frames. On the Raptor it moved the hot-gas manifold after the methane pump it bolts to (its vector points into the pump), and the controller before the plumbing (the oxygen-to-preburner line is enclosed by the controller's sense lines, so it can only leave after them). +- **Order the stagger so nothing has to pass through.** The springs overlap: with 35 ms between starts and about a second to settle, every assembly is moving at once, and relative motion is a blend of every vector. The first Raptor explode passed 66 pairs through each other in mid-flight. The rules that took it to zero, checked every frame and on reversals by the audit: + - **Whoever is outside leaves first.** On each side, the part that everything else is tucked behind or under moves first: the Raptor's nozzle drops before anything (everything sits on it), and the downcomer, which runs outside every sense line and harness that reaches the methane pump, goes second. Closing reverses it, so the outer part is also the last one home. + - **When a part's explode vector points into a face of another assembly, that assembly comes earlier in the order.** The downcomer drops 84 onto the nozzle's port tee; the nozzle drops 120 and leaves 35 ms earlier, so the port is always below the flange, opening and closing. + - **Point every vector away from every face the part touches while the other side is still in place**, not only the two it bolts to: a line threaded between the chamber and the pump must move in the sector both mount normals allow (the Raptor's jacket lines go to −120° with no drop, sliding off both pads), a cable wrapped round a core part may only move in the sector that is outward for its whole wrap (a 90° wrap allows 90°; a wrap over 180° allows nothing, so shorten it or end it on the near side), and a line that would sweep down over a part bolted below it must not drop. + - **Things threaded through each other share a spring.** Sense lines that rise through the harness ring into a block, and the harness under that block, cannot have separate springs: with 35 ms between them they shear past each other. The Raptor's sense lines and block ride the controller (`BLOCK_MOVE = PIECES.controller.move`, so `ride` resolves to `controller`) while still highlighting as plumbing. + - **Give each line that is mounted on one part only the move of that part.** + - **Check the paths a viewer can make**, not only the two from rest: a quick hover reverses the springs halfway (`reversals`), and an assembly that is late on the way back can sweep through a cable that is already home. Reverse at every stagger boundary (`A.reversalsOf`), not at a few round times: the bad windows are about 15 ms wide, and 0.15, 0.3 and 0.5 s missed all of them. Feed those frames to the depth states as well as to the clearance check, and test solids against solids too (`A.solidClearances`): a flange tucked under an overhang on its host met the host's spring tail on the way home, 0.67 deep, with every tube check at zero. + +## Turning by hand +For a 3D figure (`references/3d.md`): +- **Drag.** `controller.angleAt(clientX, clientY, zFace, "dial")` is the pointer's angle on the face's plane, unwrapped across turns. On pointer down, store it and the current target. On move, set target = start + Δ, and capture the pointer once the move passes about 1.5°. The group follows with exponential follow (τ = 0.12 s). The stage keeps `touch-action: pan-y`. +- **Keys.** Arrow keys step by one division, Shift steps by ten, Home returns to the index. +- **Coupled groups.** Drive them from one value through `follow(values)` (a wheel at a quarter of the dial, a finger chain from one `lift`), so a tool, a drag and the tour all agree. +- **Gestures and clips are pure functions of time** (`tapAt(t)`, `breakAt(t)`): the build samples them, the audit walks them frame by frame, and the page can play them backwards to reset with no jump. +- **Hook takeover.** Any `window.__isoTurn` call runs `onHold`: stop the tour, and keep values a tool set until the reader acts again. +- **Half rate.** A dense figure keeps an average of `controller.set` time and renders on alternate frames above 14 ms, every frame below 9 ms, with time-based motion unchanged. +- Reduced motion gets one still frame. Offscreen, the loop stops (IntersectionObserver). + +## Arming +If an action needs the machine in a certain state (assembled before firing, door closed before spinning), arm first: +1. Set the targets that bring it into that state (`setApart(false)`, `select(null)`). +2. Mark it armed: the button shows `data-state="armed"` and the readout says `closing up · arming`. +3. Start the action's clock only when every spring has arrived and nothing is pending. + +Never run the action on a half-exploded machine, and never snap the parts home to save time. + +## Taking over from the tour +When the user acts during the idle tour, stop the tour and leave the state where it is. If your take-over helper resets something (for example, it forces the power on), and the user's action is itself a toggle of that thing, the two cancel out in the same frame and replay an animation. Pass the helper a flag (`takeOver(switching)`), and test every toggle in every phase of the tour, not only the default one. + +A step key pressed during the tour must step from the value the reader sees, not from the tour's target, which may be far ahead. The ripple tank's keys start from `freq.x` and `gap.x` while touring (`state.tf` and `state.td` otherwise), and `steer()` zeroes both springs' velocity when it takes over, so the value only moves in the key's direction. + +## Announcing phases +For a machine with phases, add a visually hidden `aria-live="polite"` element and write only phase changes to it: `arming`, `chill-down, venting`, `preburners lit`, `main stage`, `shutdown`, `cold`. Never write per-frame numbers to it. For a continuous control, wait until the input has been quiet for about 700 ms before you announce (the ripple tank's `announce`). Leave the live region empty at load and fill it with the current state on `focus`, so a screen reader hears the state when it arrives rather than a stale line. A button whose label changes ("Ignite" to "Shut down") doesn't also need `aria-pressed`. + +## CSS motion +- `.iso-line[data-flow]` animates dashes, for things travelling along a path. +- `.iso-dots circle[data-pulse]` blinks a dot grid slowly, for an "active" surface. +- For hover lifts, wrap a group with `transition: transform 700ms var(--anatomy-ease)` and translate it up on hover. + +All of these switch off under reduced motion in `ISO_CSS`. diff --git a/skills/anatomy/references/print.md b/skills/anatomy/references/print.md new file mode 100644 index 0000000..ed403f1 --- /dev/null +++ b/skills/anatomy/references/print.md @@ -0,0 +1,81 @@ +# Printable sheets (A4) + +A finished figure can also be printed: one A4 (or US Letter) PDF that explains the machine on paper, drawn from the same page and the same model as the live figure. Make one only when the user asks for something printable: a handout, a poster, a PDF, an A4 or Letter sheet, something for a classroom wall or a binder. + +`scripts/print.mjs` does the work. It opens the built light page in headless Chrome, plays the poses you list, and freezes each pose as vector SVG (WebGL layers as a 2× PNG). Then it lays the stills out in one of three formats and prints the PDF with Chrome. + +```bash +node scripts/print.mjs examples/raptor-engine/sheet.mjs # poster, A4 +node scripts/print.mjs examples/raptor-engine/sheet.mjs --format all --png +node scripts/print.mjs examples/arcade-cabinet/sheet.mjs --format detailed --letter +``` + +It writes `--a4.pdf` and `.html` next to the spec (`-letter` with `--letter`), plus a preview `.png` with `--png`. It exits 1 when a format runs past its page count. + +## The three formats + +| Format | Pages | What is on it | Use it for | +|---|---|---|---| +| `poster` (default) | 1 | The name set large, the question and a short lead, a column of big numbers, the figure with numbered pins, then every part with one line on what it does | A wall, a cover sheet, a first look | +| `drawing` | 1 | A drawing header with a number, the figure with pins, a parts list, a specification, a small inset of another pose, then a strip of steps with the parts at work lit | A technical handout | +| `detailed` | 2 | Page 1: the figure with pins and lettered close-up marks, the question, lead, numbers, every part with its line, and round close-ups under the figure. Page 2: each step as a large lit still with two or three sentences, the why, and the specification | Homework, a binder, someone who wants to understand it fully | + +All three are minimal and print well in black and white: hairline rules, one sans for words, mono uppercase only for labels, black pins, and the figure in the light theme on white paper. + +## The spec + +A sheet is a module next to the example, `sheet.mjs`, whose default export says where the page is, what to capture and what to say. Every number and sentence in it must come from the figure's model or caption, the same truth rule as the figure itself. + +```js +export default { + page: "raptor-engine-light.html", // the built light page, relative to this file + out: "raptor-engine", // output base name + layers: ".rp-stage > svg.rp-back, .rp-stage > svg.rp-front", // the SVG layers to freeze, back to front + rasterSelector: ".rp-stage", // the box that WebGL shots are cropped from + strip: [".rp-deckglow"], // elements to drop from every still + reduced: true, // emulate reduced motion (calm, no tour); false to catch animation + views: { // poses, captured in this order, each after its actions + rest: {}, + apart: { actions: [["key", " "], ["wait", 2500]], reset: [["key", " "], ["wait", 2500]] }, + firing: { actions: [["key", "i"], ["wait", 3500]], raster: { region: [250, 150, 432, 530] } }, + }, + name, title, number, tagline, question, lead, quote, + numbers: [["230", "tf", "thrust at sea level"]], + spec: [["Chamber", "300 bar"]], + why: { title: "Why full flow?", text: "…" }, + parts: [{ id: "otp", name: "Oxygen turbopump", say: "…", select: '.it[data-piece="otp"]', at: [x, y] }], + main: { view: "apart", crop: [x, y, w, h], layers: [1], hide: ["stand"] }, + inset: { label: "Assembled", view: "rest", crop: [x, y, w, h] }, + steps: [{ view: "apart", title: "…", text: "…", focus: ["otp", "ftp"] }], + details: [{ title: "…", text: "…", around: ["otp"], focus: ["otp"] }], +}; +``` + +- **Actions** are `drive.mjs` actions. `["slow", 0.03]` then `["until", js]` catches a moment of an animation exactly (the arcade's coin in the chute); `reset` puts the page back before the next view. +- **Parts** are CSS selectors over the live SVG, so any figure works: the Raptor's assemblies are `.it[data-piece]` groups, the arcade's are `[data-name^="mech"]` prefixes from its recorder names. A part without a `name` is not listed or pinned, but steps can still light it (`coin`) or hide it (`stand`). The pin sits at the centre of the part's largest shape; give `at` (viewBox units) where that lands in empty space. Pins that crowd each other spread apart and draw a hairline back to their point. +- **Focus** lights the listed parts (black lines) and greys everything else, labelled or not. **Hide** removes a part from that still: hide what stands in front of a close-up (the arcade's coin door in front of the mech). +- **Crops** are in the figure's viewBox units. Without one, the main view crops to its drawn content; steps and close-ups crop around their focus or `around` parts, never below 42% of the main crop's width. +- **Rasters** are for WebGL only. Mark the view `raster` with the viewBox `region` to shoot; the plume prints as a 2× PNG inside the vector page. +- **Text** has to fit: titles of five words or fewer for steps, one line per part, two or three sentences per step. The script fails when a format runs onto another page. + +## Check it + +1. Build the light page first (`node build.mjs --light`). +2. Run with `--format all --png` and read every PNG. Look for pins on empty space, a close-up that shows the wrong part, a lit part hidden behind another, and text cut at the foot of the page. +3. Zoom into the PDF or the HTML at 4× (`drive.mjs` `["shot", out, ".ps", 4, [x, y, w, h]]` on `.html?print`): lines must be vector and crisp, and the lit parts must stand out at the size of a step still. +4. Print one page if you can. Light-grey dims and hairlines must still read on an office laser printer. + +## A PDF link on the figure + +`kit/pdf-button.mjs` exports `pdfButton(href)`: a small "PDF" link with an icon at the top right of the card, carrying its own CSS so pages without it are unchanged. Put it first inside the plate body and only when the file exists (`examples/push-button/build.mjs`). Order: build the light page, print, then rebuild so the button appears. + +## Longer detailed sheets + +`detailed` runs 2–4 pages, chosen from the spec: + +1. Overview (always): pinned figure, numbers, parts with a line each, round close-ups (`details`). +2. How it works: steps six to a page, the `why` taking the last slot; more steps flow onto another page. +3. Assemblies (when the spec has `assemblies`): up to four per page, each `{ title, text, parts: [ids] }` drawn as a large lit close-up with its own pins and part numbers. Give a figure with ten or more parts three or four groups. +4. The specification closes the last page. + +`maxPages` (2–4, default 4) caps the count: assembly pages drop first, and too many steps for the cap is an error. `examples/raptor-engine/sheet.mjs` (3 pages) is the reference; `push-button` and `arcade-cabinet` stay at 2. diff --git a/skills/anatomy/references/publish.md b/skills/anatomy/references/publish.md new file mode 100644 index 0000000..c8675ef --- /dev/null +++ b/skills/anatomy/references/publish.md @@ -0,0 +1,45 @@ +# Publishing a figure to the community gallery + +The community gallery is the repository `wheresryan22/anatomy-community`. People share plain HTML figures there: a build script that writes standalone pages next to itself, as the skill's examples do, in any theme. React and Next.js figures can't be submitted. + +Publish only when the user asks to share or publish a figure. Never send anything without their explicit yes. + +## Steps + +1. **Check the figure is finished.** Its pages are built and up to date, the line check passes, `--audit` passes if it has pipes, cables or round parts, and with reduced motion on it holds one still pose. The gallery checks all of this too. +2. **Ask the user for what only they can give:** + - their GitHub username (the author); `gh api user --jq .login` shows who the GitHub CLI is signed in as; + - a title (at most 80 characters) and a short kebab-case id; + - the license: MIT (the default) or CC-BY-4.0; + - confirmation that it is their own work and they are happy to share it. + The prompt is the request that made the figure; reuse it, trimmed to 600 characters. +3. **Get a local clone of the gallery,** if they have none: `gh repo clone wheresryan22/anatomy-community -- --single-branch` (only `main`: the previews branch holds every image and grows large). Cloning the main repository is fine: the submit step makes a fork for them if they need one. +4. **Show the plan,** without doing anything: + ```sh + node /scripts/publish.mjs
--into --id \ + --title "..." --author --prompt "..." \ + [--agent "Claude Code"|OpenCode|Codex|Antigravity|Other] --model "..." [--minutes 45] [--tokens 1.2M] \ + [--license MIT|CC-BY-4.0] \ + [--tags a,b] [--audit] [--pages a.html,b.html] --submit --dry-run + ``` + Pass `--agent` for the agent you are running in and `--model` for the model you are (the gallery requires it, like `claude-opus-5-5` or `gpt-5-codex`). In Claude Code the time to make and the tokens spent are read from this session's log on their own: from the request that made the figure to the request to publish it, idle gaps over 10 minutes left out, cache reads not counted. In another agent, pass `--minutes` and `--tokens` if you can see your session's usage; otherwise leave them out rather than guess. Read the plan back to the user: it names the fork (if any), the branch, the folder it adds and where the pull request goes. +5. **Only after the user says yes,** run the same command with `--yes` instead of `--dry-run`. It copies only the figure's source into `figures///src/`, points its kit imports at the clone's `.skill/` link, records the kit fingerprint, checks the build, saves a preview to `shots/-/preview.png`, then commits that folder alone, pushes, and opens the pull request. Give the user the link it prints. + - If it says a file reaches outside the figure folder and the skill, copy what that file needs into the figure folder, rebuild, and publish again. + - If it can't tell which pages are the figure, pass `--pages`. + - To send an updated version later, run it again with `--force`; it updates the same pull request. +6. **Without `--submit`** the script stops after preparing the folder and prints the git and `gh` commands instead; use that if the user prefers to send it themselves. + +People without a terminal can also submit through the gallery's **Submit a figure** issue form, with a link to a GitHub Gist holding the figure's source. + +## What the gallery rejects + +- network calls or outside addresses; +- `eval` or `new Function`; +- frames, cookies, or reaching the page around the figure; +- build imports other than the skill, the figure's own files and `node:fs`, `node:path`, `node:url`, `node:crypto` or `node:process`; +- reading environment variables; +- files other than source text under `src/`, or committed built pages; +- builds that write anything but their pages, or that differ between two runs; +- figures that keep moving with reduced motion on. + +Write figures that way from the start if the user plans to share them. diff --git a/skills/anatomy/references/react.md b/skills/anatomy/references/react.md new file mode 100644 index 0000000..02bc04e --- /dev/null +++ b/skills/anatomy/references/react.md @@ -0,0 +1,42 @@ +# React and Next.js + +## File layout for one figure +``` +components/iso/ the kit: iso-kit.ts, iso.css, react/draw.tsx, react/live.tsx +components/figures/rig/ + model.ts pure model: true numbers, springs, readout text (no DOM) + view.ts world layout constants, the projection P (fitProjection), helpers like at(point) + geometry.ts every static path, computed once at module load + frame.ts paths for the parts that change shape: frameOf(state) -> { glass, coils, needle, ... } + art.tsx server component: static parts as JSX constants, passed to the live component + live.tsx "use client": refs, loop, pointer and keyboard, aria, writes the readout + rig.css scoped tokens and styles (e.g. .rig { … }) + figure.tsx +``` +`examples/test-rig/` follows this layout. It uses `rig.ts`, `view.ts`, `geometry.ts`, `pose.ts`, `art.tsx`, `live.tsx` and `figure.tsx`. + +## The server/client split +- Geometry is pure TypeScript, so it runs on the server and the client receives finished path strings. No geometry code is shipped unless a moving part needs to rebuild per frame. Then `frame.ts` is imported by `live.tsx` and ships to the client. +- `art.tsx` builds the static parts as JSX (`` and so on) and passes them as element props, such as `base`, `rail`, `carriage` and `dial`, to the `"use client"` live component. The live component places them in painter's order and wraps the moving ones in ``. +- Only the live component and `kit/react/live.tsx` are client code. `draw.tsx` is server-safe. + +## The large-page key-warning trap +On a big page the server payload is large, and React streams some element props as deferred (lazy) chunks. The client renders `{props.dial}` among siblings. It can't mark a lazy as key-checked, so once the lazy resolves to an element without a key, React logs "Each child in a list should have a unique key", pointing at your live component or at `IsoFigure`. The same figure on a small test page logs nothing, so checking one figure at a time misses it. + +There are two fixes, and you should do both from the start: + +1. **Give the root of every element prop a stable key:** `const DIAL = (…)`, and `` for fragments. Keys on a single element cost nothing. +2. **Keep `"use client"` components out of server-built art.** Every client component element inside a server tree becomes a lazy reference, which makes all of its ancestors lazy too. If parts of the art need interactivity (hover-to-highlight, for example), make them plain `` and handle events with delegation in the live component. + +Any array you build with `.map` needs keys as usual. + +## Styles +- Import `iso.css` once, globally or in the figure. Put `className="iso"` on a wrapper (or ``) for the tokens, plus `data-theme="light"` for the light theme. +- Scope per-figure tokens to the figure's class (`.rig { --rig-glass-top: … }`) and override kit tokens inside `.iso-plate` only when the card needs it. +- Don't put figure tokens on `:root`. + +## Readout +`useReadout()` finds the nearest `.iso-plate [data-readout]` from its `anchor`, and `say(text)` writes it without re-rendering. Render the resting text on the server so it is right before hydration. + +## Hydration +Render the rest pose on the server and on the client's first render; start motion only in effects. Don't read `window` while rendering. `asksForStillness()` is safe because it is only called inside effects and loops. diff --git a/skills/anatomy/references/verify.md b/skills/anatomy/references/verify.md new file mode 100644 index 0000000..b2cdd2b --- /dev/null +++ b/skills/anatomy/references/verify.md @@ -0,0 +1,351 @@ +# Verify + +Look at the figure the way a demanding reviewer would, before anyone else does. Rendering it is cheap, and guessing is expensive. + +## Capture +`scripts/capture.mjs` starts its own headless Chrome (set `CHROME_PATH` if it can't find one), loads a file or URL, and clips to `.iso-plate` by default. It also prints the readout, any console errors or exceptions, and whether the page scrolls sideways. + +```sh +node scripts/capture.mjs page.html --out shots/desk.png # desktop 1440, dpr 2 +node scripts/capture.mjs page.html --out shots/phone.png --width 390 # phone +node scripts/capture.mjs page.html --out shots/hover.png --hover 0.7,0.5 # pointer at 70% across +node scripts/capture.mjs page.html --out shots/tour.png --times 1200,2400,3600 # motion: extra shots over time +node scripts/capture.mjs page.html --out shots/keys.png --key ArrowRight,ArrowRight +node scripts/capture.mjs page.html --out shots/joint.png --zoom 200,80,220,170 # close-up at 4x, in card px +node scripts/capture.mjs page.html --out shots/still.png --reduced # reduced motion +node scripts/capture.mjs http://localhost:3000/docs --select "figure:nth-of-type(3) .iso-plate" # one figure on a dev-server page +``` +`--select` takes any CSS selector; by default it clips to the first `.iso-plate`. Each `--times` delay counts from the first shot, so `1200,2400,3600` shoots at about 1.2, 2.4 and 3.6 s after it (a capture takes 60–200 ms, so delays closer together than that run late), saved as `name-.png`. `--key` sends the same key codes as `drive.mjs` (`7` as `Digit7`, `.` as `Period`; write a comma as `Comma`, since the list is comma separated). The other options are `--height` (1000), `--scale` (2), `--wait` (2500 ms before the first shot), `--zoom-scale` (4) and `--theme dark|light`. Read every PNG you make: open it and look. + +Both scripts start Chrome with WebGL on (`--enable-unsafe-swiftshader --ignore-gpu-blocklist`), so shaders show in `capture.mjs` stills too. Use `drive.mjs` for anything that has to be timed or slowed down. + +## Drive +`scripts/drive.mjs` runs a scripted session in headless Chrome with WebGL on. Use it for sequences: hover, then click, then type, then wait for a phase. Use it also for slowed-down contact sheets that catch pops, and for the no-WebGL fallback. It prints the readout after each shot, then any console errors and exceptions. + +```sh +node scripts/drive.mjs page.html '[["wait",1500],["move",".rt-stage",0.7,0.4],["wait",600],["shot","shots/hover.png"]]' +node scripts/drive.mjs page.html --actions steps.json --height 1300 +node scripts/drive.mjs page.html --actions steps.json --width 390 +node scripts/drive.mjs page-light.html --actions steps.json --reduced +node scripts/drive.mjs page.html --actions steps.json --no-webgl +node scripts/drive.mjs page-light.html --actions steps.json --preload slow.js +``` +Options are `--width` (1440), `--height` (1100), `--scale` (1), `--reduced`, `--theme dark|light`, `--no-webgl` (every `getContext("webgl")` or `"webgl2"` returns `null`, to check the SVG fallback), `--preload file.js` (a script that runs before the page's own scripts: counters, stubs, hooks, or `window.__driveSpeed=0.04` to run slowly from the first frame) and `--actions file.json`. Selectors default to the first `.iso-plate`, and fractions run 0..1 across the element. + +`--theme` (in both scripts) only emulates `prefers-color-scheme`. Kit pages choose their theme when they are built (`data-theme` on ``) and ignore that media query, so to check the light theme, build with `--light` and drive the `-light.html` file. + +| Action | What it does | +|---|---| +| `["scroll", sel]` | Scrolls the element into the middle of the viewport. | +| `["wait", ms]` | Waits. | +| `["move", sel, fx, fy]` | Glides the mouse there in 10 steps, firing `pointermove`. | +| `["click", sel, fx?, fy?]` | Clicks, at the centre by default. | +| `["drag", sel, fx0, fy0, fx1, fy1, steps?]` | Presses at one point, glides to the other in `steps` (20) moves a frame apart, releases. These are real input events (pointer id 1), so a handler that calls `setPointerCapture` works. Test drag-to-turn with it: `PointerEvent`s dispatched from `eval` have no active pointer, and `setPointerCapture` throws `NotFoundError` and aborts the handler. | +| `["key", key, sel?, code?]` | Focuses `sel` (default `[tabindex="0"]`) and presses a key: `"i"`, `"Escape"`, `"ArrowRight"`, `" "`, `"7"`. Digits send `DigitN`, letters `KeyX` and punctuation its proper code (`Space`, `Minus`, `Comma`…). Pass `code` for keys that share a name: `["key", "Shift", null, "ShiftRight"]`, `["key", "Enter", null, "NumpadEnter"]`. | +| `["slow", factor]` | Runs the page's `requestAnimationFrame` timestamps and `performance.now` at `factor` × real time: `["slow", 0.05]` is 20× slow motion, so a sheet catches a 100 ms event in many frames. `["slow", 1]` restores real time. | +| `["until", js, timeoutMs?]` | Polls a JS expression every 25 ms until it is truthy (default 10 s), and prints a line if it times out. | +| `["eval", js]` | Runs JS in the page and prints the result. Promises are awaited. | +| `["shot", out, sel?, scale?, [x,y,w,h]?]` | Screenshots an element, or a region of it in CSS px. | +| `["sheet", out, every, count, sel?, scale?, [x,y,w,h]?, columns?]` | Takes `count` frames `every` ms apart and tiles them into one numbered PNG. | +| `["turn", value, group?]` | 3D figures: sets `window.__isoTurn` (a number sets the first turn group, `group` names another, an object sets several) and waits two frames. | +| `["orbit", out, from, to, step, sel?, scale?, [x,y,w,h]?, columns?]` | 3D figures: a contact sheet across angles of the first turn group, each frame labelled. `["orbit", "swap.png", 129.7, 130.2, 0.1, null, 6, [x, y, w, h]]` is a 6× close-up of one order change. | +| `["lines", out?, sel?, { tolerance }?]` | The line-end check below, in whatever pose the actions before it left the figure (apart, mid-stroke). `out` writes the card with every floating end ringed. A failure makes the run exit 1. | + +Traps: +- **Shots are correct after `scroll`**, so you can scroll to a figure lower on a page. A viewport tall enough for the whole card (`--height 1300`) is still the simplest: the figure is visible at scroll 0, and its `IntersectionObserver` starts it. +- **Frame spacing in a sheet is `every` plus the capture time** (60–200 ms, more on heavy WebGL pages, where capture also stalls animation frames). For transitions faster than that, put `["slow", 0.05]` before the sheet and `["slow", 1]` after it. `wait`, `every` and the page's `setTimeout` timers stay in real time, so at 0.05 a sheet every 100 ms is 5 ms of page time apart, and an idle tour's resume timer still fires on the wall clock: a key press holds it off for only about 3.6 s of real time, so press a harmless key again before each slowed sheet. An event that starts on load needs the page slow from its first frame: `--preload` a file with `window.__driveSpeed=0.04`. +- **Slow mode doesn't slow timers.** `setTimeout` runs on the wall clock, so during a long slowed capture an idle tour's resume timer (the Raptor's 3.6 s `quietTour`) can restart the tour and close the engine mid-sheet. Before every slowed sheet stop the tour and wait for rest: preload a stub for that timer (`const st = window.setTimeout; window.setTimeout = (f, d, ...a) => (d === 3600 ? 0 : st(f, d, ...a));`), press `Escape`, `["until", "document.querySelector('[data-readout]').textContent.includes('cold')"]`, and only then the key that starts the transition. A sheet labelled "opening" that starts from a tour that has already opened films a close. +- **Wait for a phase, don't guess.** `["until", "document.querySelector('[data-readout]').textContent.includes('main stage')", 8000]` returns as soon as the readout reaches the phase. +- **A `null` selector is the default.** In every action a missing or `null` selector means the first `.iso-plate` (for `key`, the focusable `[tabindex="0"]`), so `["sheet", "s.png", 200, 16, null, 0.5]` films the card. +- **Long eval strings break inline JSON quoting.** Put anything with `eval` or `until` in `--actions steps.json`. +- **Pages inline their live code as ``); + const args = ["scripts/capture.mjs", page, "--out", output, "--wait", "0", "--scale", "1"]; + if (interaction === "hover") args.push("--hover", "0.5,0.5"); + if (interaction === "key") args.push("--key", "ArrowRight"); + if (timed) args.push("--times", "2500"); + if (zoom) args.push("--zoom", "20,20,40,30", "--zoom-scale", "1"); + const result = await execute(process.execPath, args, { timeout: 30000 }); + const png = pngOf(await readFile(timed ? output.replace(/\.png$/, "-2500.png") : output)); + return { ...result, png }; + } finally { + await rm(directory, { recursive: true, force: true }); + } +} + +for (const [name, mode, interaction, timed, zoom, size, bounds] of [ + ["keyboard resize crops the actual enlarged figure", "resize", "key", false, false, [192, 132], "180x120"], + ["pointer resize crops the actual enlarged figure", "resize", "hover", false, false, [192, 132], "180x120"], + ["keyboard movement follows the current figure position", "move", "key", false, false, [112, 92], "100x80 at 220,140"], + ["timed resize recomputes the later crop", "resize", "key", true, false, [192, 132], "180x120"], + ["timed movement follows the later figure position", "move", "key", true, false, [112, 92], "100x80 at 220,140"], + ["relative zoom moves with the interacted figure", "move", "key", false, true, [40, 30], "100x80 at 220,140"], + ["static figure retains its original crop", "static", null, false, false, [112, 92], "100x80"], + ["static relative zoom retains its original crop", "static", null, false, true, [40, 30], "100x80"], +]) test(name, async () => { + const result = await capture(mode, interaction, timed, zoom); + assert.ok(result.stdout.includes("native bounds " + bounds), result.stdout); + assert.deepEqual([result.png.width, result.png.height], size); + assert.deepEqual(result.png.center, [255, 0, 0]); + assert.match(result.stdout, /console: clean/); +}); diff --git a/skills/anatomy/scripts/capture-selector.test.mjs b/skills/anatomy/scripts/capture-selector.test.mjs new file mode 100644 index 0000000..089f02e --- /dev/null +++ b/skills/anatomy/scripts/capture-selector.test.mjs @@ -0,0 +1,131 @@ +import assert from "node:assert/strict"; +import { execFile } from "node:child_process"; +import { access, mkdtemp, readFile, rm, writeFile } from "node:fs/promises"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +import { promisify } from "node:util"; +import test from "node:test"; + +const execute = promisify(execFile); + +async function capture(selector, svgOnly = false, keys = false) { + const directory = await mkdtemp(join(tmpdir(), "anatomy-capture-target-")); + try { + const page = join(directory, "figure.html"); + const out = join(directory, "capture.png"); + const content = svgOnly + ? '' + : `
first:0
second:0
`; + await writeFile(page, '' + content); + const args = ["scripts/capture.mjs", page, "--out", out, "--wait", "0", "--scale", "1"]; + if (selector !== undefined) args.push("--select", selector); + if (keys) args.push("--key", "ArrowRight"); + let result; + try { + result = { code: 0, ...await execute(process.execPath, args, { timeout: 30000 }) }; + } catch (error) { + result = { code: error.code, stdout: error.stdout, stderr: error.stderr }; + } + let png; + try { + await access(out); + png = await readFile(out); + } catch {} + return { ...result, png }; + } finally { + await rm(directory, { recursive: true, force: true }); + } +} + +function dimensions(png) { + assert.ok(png); + assert.equal(png.subarray(1, 4).toString(), "PNG"); + return [png.readUInt32BE(16), png.readUInt32BE(20)]; +} + +test("an absent explicit figure selector fails without an unrelated screenshot", async () => { + const result = await capture("#removed-figure"); + assert.equal(result.code, 1); + assert.match(result.stderr, /Capture target not found: #removed-figure/); + assert.equal(result.png, undefined); + assert.doesNotMatch(result.stdout, /saved /); +}); + +test("a malformed explicit selector retains an actionable capture diagnostic", async () => { + const result = await capture("[invalid"); + assert.equal(result.code, 1); + assert.match(result.stderr, /Capture target not found: \[invalid/); + assert.equal(result.png, undefined); +}); + +test("a matching selector captures the requested second figure", async () => { + const result = await capture("#second"); + assert.equal(result.code, 0, result.stderr); + assert.deepEqual(dimensions(result.png), [72, 52]); + assert.match(result.stdout, /60x40/); +}); + +test("default selection retains the first plate", async () => { + const result = await capture(undefined); + assert.equal(result.code, 0, result.stderr); + assert.deepEqual(dimensions(result.png), [112, 92]); + assert.match(result.stdout, /100x80/); +}); + +test("default selection retains the standalone SVG fallback", async () => { + const result = await capture(undefined, true); + assert.equal(result.code, 0, result.stderr); + assert.deepEqual(dimensions(result.png), [92, 52]); + assert.match(result.stdout, /80x40/); +}); + +test("an explicit target reports that figure's readout", async () => { + const result = await capture("#second"); + assert.equal(result.code, 0, result.stderr); + assert.match(result.stdout, /readout "second:0"/); +}); + +test("keyboard interaction reaches the explicitly selected figure", async () => { + const result = await capture("#second", false, true); + assert.equal(result.code, 0, result.stderr); + assert.match(result.stdout, /readout "second:1"/); + assert.deepEqual(dimensions(result.png), [72, 52]); +}); + +async function driveTarget(actions, standaloneLines = false) { + const directory=await mkdtemp(join(tmpdir(),"anatomy-drive-target-")); + try{ + const page=join(directory,"figure.html"),out=join(directory,"selected.png"),file=join(directory,"actions.json"); + const svg=''; + await writeFile(page,`
first:0${svg}
second:0${svg}
`); + await writeFile(file,JSON.stringify(actions.map(action=>action.map(value=>value==='OUTPUT'?out:value)))); + const args=standaloneLines?["scripts/lines.mjs",page,"--select","#missing","--wait","0"]:["scripts/drive.mjs",page,"--actions",file]; + let result;try{result={code:0,...await execute(process.execPath,args,{timeout:30000})};}catch(error){result={code:error.code,stdout:error.stdout,stderr:error.stderr};} + let png;try{png=await readFile(out);}catch{}return{...result,png}; + }finally{await rm(directory,{recursive:true,force:true});} +} +for(const [name,action] of [ + ["shot",["shot","OUTPUT","#missing"]], + ["move",["move","#missing",.5,.5]], + ["click",["click","#missing"]], + ["drag",["drag","#missing",0,0,1,1]], + ["scroll",["scroll","#missing"]], + ["key",["key","ArrowRight","#missing"]], + ["lines",["lines",null,"#missing"]], +])test(`drive ${name} rejects an absent explicit target instead of continuing`,async()=>{ + const result=await driveTarget([action,["eval","'after missing target'"]]);assert.equal(result.code,1,result.stdout);assert.match(result.stderr,/(Drive|Line) target not found: #missing/);assert.doesNotMatch(result.stdout,/after missing target/);assert.equal(result.png,undefined); +}); +test("standalone lines rejects an absent selected figure",async()=>{ + const result=await driveTarget([],true);assert.equal(result.code,1,result.stdout);assert.match(result.stderr,/Line target not found: #missing/); +}); +test("drive targets the requested figure for keyboard input screenshot and reported readout",async()=>{ + const result=await driveTarget([["key","ArrowRight","#second"],["shot","OUTPUT","#second"],["eval","document.querySelector('#first [data-readout]').textContent"]]); + assert.equal(result.code,0,result.stderr);assert.match(result.stdout,/readout "second:1"/);assert.match(result.stdout,/eval: "first:0"/);assert.deepEqual(dimensions(result.png),[68,48]); +}); +test("drive defaults preserve first-figure keyboard focus and reporting",async()=>{ + const result=await driveTarget([["key","ArrowRight"],["shot","OUTPUT"],["eval","document.querySelector('#second [data-readout]').textContent"]]); + assert.equal(result.code,0,result.stderr);assert.match(result.stdout,/readout "first:1"/);assert.match(result.stdout,/eval: "second:0"/);assert.deepEqual(dimensions(result.png),[108,88]); +}); +test("line selection preserves real rooted-line checks on the requested SVG",async()=>{ + const result=await driveTarget([["lines",null,"#second svg"]]);assert.equal(result.code,0,result.stderr);assert.match(result.stdout,/line ends: 0 of [1-9]\d* ends on [1-9]\d* lines float/); +}); diff --git a/skills/anatomy/scripts/capture.mjs b/skills/anatomy/scripts/capture.mjs new file mode 100644 index 0000000..715b644 --- /dev/null +++ b/skills/anatomy/scripts/capture.mjs @@ -0,0 +1,269 @@ +import { chromePort } from "./chrome-port.mjs"; +import { spawn } from "node:child_process"; +import { existsSync, mkdirSync, mkdtempSync, readdirSync, rmSync, writeFileSync } from "node:fs"; +import { homedir, tmpdir } from "node:os"; +import { dirname, join, resolve } from "node:path"; +import { pathToFileURL } from "node:url"; + +if (typeof WebSocket === "undefined" && !process.execArgv.includes("--experimental-websocket")) { + const child = spawn(process.execPath, ["--experimental-websocket", ...process.argv.slice(1)], { stdio: "inherit" }); + child.on("exit", (code) => process.exit(code ?? 1)); +} else { + await main(); +} + +function usage() { + console.log(`Capture a figure with headless Chrome. + + node capture.mjs [options] + + --out output path (default: capture.png in the current directory) + --width viewport width (default 1440; use 390 for a phone) + --height viewport height (default 1000) + --scale device pixel ratio (default 2) + --wait time to let the page settle before the first shot (default 2500) + --select clip to this element (default: .iso-plate, else the whole page) + --zoom clip a region inside the selected element, in CSS px, for close-up checks + --zoom-scale pixel ratio for --zoom shots (default 4) + --hover move the mouse to this fraction of the selected element first (e.g. 0.6,0.5) + --key press keys on the focused figure first, comma separated (e.g. Tab,ArrowRight,7,Escape); + Tab is skipped (the figure is focused for you), a comma is written Comma + --times extra shots at these delays, each measured from the first shot (not from the previous one), + saved as name-.png; a capture takes 60-200 ms, so delays closer than that run late + --reduced emulate prefers-reduced-motion: reduce + --theme emulate prefers-color-scheme + +Prints the clip box, console errors, uncaught exceptions and whether the page scrolls sideways.`); +} + +function parse(argv) { + const options = { width: 1440, height: 1000, scale: 2, wait: 2500, zoomScale: 4, times: [] }; + const rest = []; + for (let index = 0; index < argv.length; index++) { + const arg = argv[index]; + const next = () => argv[++index]; + if (arg === "--out") options.out = next(); + else if (arg === "--width") options.width = Number(next()); + else if (arg === "--height") options.height = Number(next()); + else if (arg === "--scale") options.scale = Number(next()); + else if (arg === "--wait") options.wait = Number(next()); + else if (arg === "--select") options.select = next(); + else if (arg === "--zoom") options.zoom = next().split(",").map(Number); + else if (arg === "--zoom-scale") options.zoomScale = Number(next()); + else if (arg === "--hover") options.hover = next().split(",").map(Number); + else if (arg === "--key") options.keys = next().split(","); + else if (arg === "--times") options.times = next().split(",").map(Number); + else if (arg === "--reduced") options.reduced = true; + else if (arg === "--theme") options.theme = next(); + else if (arg === "--help" || arg === "-h") options.help = true; + else rest.push(arg); + } + options.target = rest[0]; + return options; +} + +function problemWith(options) { + const positive = (value) => Number.isFinite(value) && value > 0; + const numbers = (list, count) => list.length === count && list.every(Number.isFinite); + for (const name of ["width", "height", "scale", "zoomScale"]) if (!positive(options[name])) return `--${name === "zoomScale" ? "zoom-scale" : name} needs a number above 0`; + if (!Number.isFinite(options.wait) || options.wait < 0) return "--wait needs a number of milliseconds, 0 or more"; + if (options.zoom && !(numbers(options.zoom, 4) && options.zoom[2] > 0 && options.zoom[3] > 0)) return "--zoom needs x,y,w,h in CSS px, with a width and height above 0"; + if (options.hover && !numbers(options.hover, 2)) return "--hover needs fx,fy, two fractions like 0.6,0.5"; + if (!options.times.every((delay) => Number.isFinite(delay) && delay >= 0)) return "--times needs milliseconds, 0 or more, comma separated"; + if (options.theme !== undefined && options.theme !== "dark" && options.theme !== "light") return "--theme must be dark or light"; +} + +function chromePath() { + const candidates = [ + process.env.CHROME_PATH, + "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome", + "/Applications/Chromium.app/Contents/MacOS/Chromium", + "/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary", + "/usr/bin/google-chrome", + "/usr/bin/google-chrome-stable", + "/usr/bin/chromium", + "/usr/bin/chromium-browser", + "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe", + "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe", + ...(process.env.LOCALAPPDATA ? [join(process.env.LOCALAPPDATA, "Google\\Chrome\\Application\\chrome.exe")] : []), + "C:\\Program Files\\Microsoft\\Edge\\Application\\msedge.exe", + "C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe", + ].filter(Boolean); + const playwright = join(homedir(), "Library/Caches/ms-playwright"); + if (existsSync(playwright)) { + for (const dir of readdirSync(playwright).sort().reverse()) { + for (const sub of ["chrome-mac-arm64/Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing", "chrome-mac/Chromium.app/Contents/MacOS/Chromium"]) { + candidates.push(join(playwright, dir, sub)); + } + } + } + const linux = join(homedir(), ".cache/ms-playwright"); + if (existsSync(linux)) for (const dir of readdirSync(linux).sort().reverse()) for (const sub of ["chrome-linux64/chrome", "chrome-linux/chrome"]) candidates.push(join(linux, dir, sub)); + const win = join(homedir(), "AppData/Local/ms-playwright"); + if (existsSync(win)) for (const dir of readdirSync(win).sort().reverse()) for (const sub of ["chrome-win/chrome.exe", "chromium-win64/chrome.exe"]) candidates.push(join(win, dir, sub)); + return candidates.find((path) => existsSync(path)); +} + +async function main() { + const options = parse(process.argv.slice(2)); + if (options.help || !options.target) { + usage(); + process.exit(options.help ? 0 : 1); + } + const problem = problemWith(options); + if (problem) { + console.error(`capture: ${problem}`); + process.exit(1); + } + const url = /^https?:|^file:/.test(options.target) ? options.target : pathToFileURL(resolve(options.target)).href; + const out = resolve(options.out ?? "capture.png"); + const binary = chromePath(); + if (!binary) { + console.error("No Chrome found. Set CHROME_PATH to a Chrome or Chromium binary."); + process.exit(1); + } + const profile = mkdtempSync(join(tmpdir(), "iso-capture-")); + const chrome = spawn(binary, [ + "--headless=new", ...(process.platform === "linux" ? ["--no-sandbox"] : []), ...(process.platform === "win32" ? ["--do-not-de-elevate"] : []), + "--remote-debugging-port=0", + `--user-data-dir=${profile}`, + "--no-first-run", + "--no-default-browser-check", + "--hide-scrollbars", + "--allow-file-access-from-files", + "--enable-unsafe-swiftshader", + "--ignore-gpu-blocklist", + "about:blank", + ]); + const port = await chromePort(chrome, profile); + const finish = (code) => { + chrome.kill("SIGKILL"); + try { + rmSync(profile, { recursive: true, force: true }); + } catch {} + process.exit(code); + }; + try { + const target = await (await fetch(`http://127.0.0.1:${port}/json/new?about:blank`, { method: "PUT" })).json(); + const socket = new WebSocket(target.webSocketDebuggerUrl); + let id = 0; + const pending = new Map(); + const problems = []; + let loaded = () => {}; + socket.onmessage = (message) => { + const data = JSON.parse(message.data); + if (data.method === "Page.loadEventFired") loaded(); + if (data.id && pending.has(data.id)) { + pending.get(data.id)(data); + pending.delete(data.id); + } else if (data.method === "Runtime.consoleAPICalled" && (data.params.type === "error" || data.params.type === "warning")) { + problems.push(`console.${data.params.type}: ${data.params.args.map((arg) => arg.value ?? arg.description ?? "").join(" ").slice(0, 400)}`); + } else if (data.method === "Runtime.exceptionThrown") { + const detail = data.params.exceptionDetails; + problems.push(`exception: ${detail.exception?.description ?? detail.text}`.slice(0, 600)); + } + }; + await new Promise((done) => (socket.onopen = done)); + const send = (method, params = {}) => + new Promise((done, fail) => { + const call = ++id; + const timer = setTimeout(() => { + pending.delete(call); + fail(new Error(`Chrome did not answer ${method} within 60 s`)); + }, 60000); + pending.set(call, (data) => { + clearTimeout(timer); + done(data); + }); + socket.send(JSON.stringify({ id: call, method, params })); + }); + const evaluate = async (expression) => (await send("Runtime.evaluate", { expression, awaitPromise: true, returnByValue: true })).result?.result?.value; + const sleep = (ms) => new Promise((done) => setTimeout(done, ms)); + await send("Runtime.enable"); + await send("Page.enable"); + const features = []; + if (options.reduced) features.push({ name: "prefers-reduced-motion", value: "reduce" }); + if (options.theme) features.push({ name: "prefers-color-scheme", value: options.theme }); + if (features.length) await send("Emulation.setEmulatedMedia", { features }); + await send("Emulation.setDeviceMetricsOverride", { width: options.width, height: options.height, deviceScaleFactor: options.scale, mobile: options.width < 600 }); + const load = new Promise((done) => { + loaded = done; + setTimeout(done, 10000); + }); + const navigation = await send("Page.navigate", { url }); + if (navigation.error) throw new Error(`Navigation failed: ${navigation.error.message}`); + if (navigation.result?.errorText) throw new Error(`Navigation failed: ${navigation.result.errorText}`); + await load; + await sleep(Math.min(options.wait, 1500)); + await evaluate(`(async()=>{const h=document.documentElement.scrollHeight;for(let y=0;ysetTimeout(r,60))}scrollTo(0,0)})()`); + await sleep(Math.max(0, options.wait - 1500)); + const select = options.select ?? ".iso-plate"; + const boxOf = async () => { + const box = await evaluate(`(()=>{let el;try{el=document.querySelector(${JSON.stringify(select)})}catch{};if(!el&&${options.select === undefined})el=document.querySelector("svg")||document.body;if(!el)return null;el.scrollIntoView({block:"center"});const r=el.getBoundingClientRect();return {x:r.left+scrollX,y:r.top+scrollY,w:r.width,h:r.height,vx:r.left,vy:r.top}})()`); + if (!box) throw new Error(`Capture target not found: ${select}`); + return box; + }; + let box = await boxOf(); + if (options.hover) { + await sleep(300); + box = await boxOf(); + const x = box.vx + box.w * options.hover[0]; + const y = box.vy + box.h * options.hover[1]; + await send("Input.dispatchMouseEvent", { type: "mouseMoved", x: box.vx + 2, y: box.vy + 2 }); + await sleep(60); + for (let step = 1; step <= 12; step++) { + await send("Input.dispatchMouseEvent", { type: "mouseMoved", x: box.vx + 2 + ((x - box.vx - 2) * step) / 12, y: box.vy + 2 + ((y - box.vy - 2) * step) / 12 }); + await sleep(30); + } + await sleep(1200); + } + if (options.keys) { + const focus = options.select === undefined ? `document.querySelector('[tabindex="0"]')` : `(()=>{const el=document.querySelector(${JSON.stringify(select)});return el.matches('[tabindex="0"]')?el:el.querySelector('[tabindex="0"]')||el.closest('[tabindex="0"]')||el})()`; + await evaluate(`(()=>{const f=${focus};if(f)f.focus()})()`); + const named = { " ": "Space", "-": "Minus", "=": "Equal", ",": "Comma", ".": "Period", "/": "Slash", ";": "Semicolon", "'": "Quote", "[": "BracketLeft", "]": "BracketRight", "\\": "Backslash", "`": "Backquote" }; + for (const entry of options.keys) { + if (entry === "Tab") continue; + const key = entry === "Comma" ? "," : entry === "Space" ? " " : entry; + const code = named[key] ?? (/^[0-9]$/.test(key) ? `Digit${key}` : key.length === 1 ? `Key${key.toUpperCase()}` : key); + await send("Input.dispatchKeyEvent", { type: "keyDown", key, code, text: key === "Enter" ? "\r" : key.length === 1 ? key : undefined, windowsVirtualKeyCode: key === " " ? 32 : key === "Enter" ? 13 : 0 }); + await send("Input.dispatchKeyEvent", { type: "keyUp", key, code, windowsVirtualKeyCode: key === "Enter" ? 13 : undefined }); + await sleep(250); + } + await sleep(1200); + } + const shoot = async (path, clip, scale) => { + const shot = await send("Page.captureScreenshot", { format: "png", captureBeyondViewport: true, clip: { ...clip, scale } }); + mkdirSync(dirname(path), { recursive: true }); + writeFileSync(path, Buffer.from(shot.result.data, "base64")); + }; + const clipOf = () => { + if (!options.zoom) return { clip: { x: box.x - 6, y: box.y - 6, width: box.w + 12, height: box.h + 12 }, scale: 1 }; + const [zx, zy, zw, zh] = options.zoom; + return { clip: { x: box.x + zx, y: box.y + zy, width: zw, height: zh }, scale: options.zoomScale / options.scale }; + }; + box = await boxOf(); + const first = clipOf(); + await shoot(out, first.clip, first.scale); + const shotAt = Date.now(); + const readoutOf = () => evaluate(options.select === undefined ? `(document.querySelector("[data-readout]")||{}).textContent||""` : `(()=>{const el=document.querySelector(${JSON.stringify(select)});const plate=el.closest(".iso-plate")||el.querySelector(".iso-plate")||el;return(plate.querySelector("[data-readout]")||{}).textContent||""})()`); + const readouts = []; + for (const delay of [...options.times].sort((a, b) => a - b)) { + await sleep(Math.max(0, shotAt + delay - Date.now())); + box = await boxOf(); + const next = clipOf(); + await shoot(out.replace(/\.png$/, `-${delay}.png`), next.clip, next.scale); + readouts.push(`+${delay}ms "${await readoutOf()}"`); + } + const sideways = await evaluate(`document.documentElement.scrollWidth > innerWidth + 1`); + const readout = await readoutOf(); + console.log(`saved ${out}`); + console.log(`clip ${Math.round(box.x)},${Math.round(box.y)} ${Math.round(box.w)}x${Math.round(box.h)} · readout "${readout}" · scrolls sideways: ${sideways ? "YES" : "no"}`); + if (readouts.length) console.log(`readout over time: ${readouts.join(" · ")}`); + console.log(problems.length ? problems.join("\n") : "console: clean"); + socket.close(); + finish(0); + } catch (error) { + console.error(error); + finish(1); + } +} diff --git a/skills/anatomy/scripts/capture.test.mjs b/skills/anatomy/scripts/capture.test.mjs new file mode 100644 index 0000000..fc92ca8 --- /dev/null +++ b/skills/anatomy/scripts/capture.test.mjs @@ -0,0 +1,60 @@ +import assert from "node:assert/strict"; +import { execFile } from "node:child_process"; +import { mkdtemp, readFile, rm, writeFile } from "node:fs/promises"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +import { promisify } from "node:util"; +import { fileURLToPath } from "node:url"; +import test from "node:test"; + +const execute = promisify(execFile); +const capture = fileURLToPath(new URL("capture.mjs", import.meta.url)); + +test("capture creates nested output directories for initial and timed screenshots", async () => { + const directory = await mkdtemp(join(tmpdir(), "anatomy-capture-")); + try { + const page = join(directory, "figure.html"); + const output = join(directory, "shots", "closeups", "figure.png"); + await writeFile(page, '
Figure
'); + const result = await execute(process.execPath, [capture, page, "--out", output, "--wait", "0", "--times", "20", "--scale", "1"], { timeout: 30000 }); + assert.match(result.stdout, /console: clean/); + for (const name of [output, output.replace(/\.png$/, "-20.png")]) { + const png = await readFile(name); + assert.deepEqual([...png.subarray(0, 8)], [137, 80, 78, 71, 13, 10, 26, 10]); + assert.ok(png.length > 100); + } + } finally { + await rm(directory, { recursive: true, force: true }); + } +}); + +test("capture retains existing-directory output", async () => { + const directory = await mkdtemp(join(tmpdir(), "anatomy-capture-")); + try { + const page = join(directory, "figure.html"); + const output = join(directory, "figure.png"); + await writeFile(page, '
Figure
'); + await execute(process.execPath, [capture, page, "--out", output, "--wait", "0"], { timeout: 30000 }); + assert.ok((await readFile(output)).length > 100); + } finally { + await rm(directory, { recursive: true, force: true }); + } +}); + +test("capture rejects option values that would be ignored or break the clip", async () => { + const directory = await mkdtemp(join(tmpdir(), "anatomy-capture-")); + try { + const page = join(directory, "figure.html"); + const output = join(directory, "figure.png"); + await writeFile(page, '
Figure
'); + const cases = [["--zoom", "1,2", /--zoom needs x,y,w,h/], ["--zoom", "1,2,0,5", /--zoom needs x,y,w,h/], ["--hover", "0.5", /--hover needs fx,fy/], ["--times", "fast", /--times needs milliseconds/], ["--width", "wide", /--width needs a number above 0/], ["--scale", "0", /--scale needs a number above 0/], ["--wait", "abc", /--wait needs a number/], ["--theme", "sepia", /--theme must be dark or light/]]; + for (const [flag, value, message] of cases) { + const error = await execute(process.execPath, [capture, page, "--out", output, flag, value], { timeout: 30000 }).then(() => null, (failure) => failure); + assert.equal(error?.code, 1, `${flag} ${value}`); + assert.match(error.stderr, message); + } + await assert.rejects(readFile(output)); + } finally { + await rm(directory, { recursive: true, force: true }); + } +}); diff --git a/skills/anatomy/scripts/chrome-port.mjs b/skills/anatomy/scripts/chrome-port.mjs new file mode 100644 index 0000000..cb8e224 --- /dev/null +++ b/skills/anatomy/scripts/chrome-port.mjs @@ -0,0 +1,36 @@ +import { rmSync } from "node:fs"; + +export async function chromePort(chrome, profile) { + try { + return await new Promise((done, fail) => { + let text = ""; + const clean = () => { + clearTimeout(timer); + chrome.stderr.off("data", data); + chrome.off("error", error); + chrome.off("exit", exited); + }; + const error = (cause) => { + clean(); + fail(cause); + }; + const exited = (code, signal) => error(new Error(`Chrome exited before startup: ${code ?? signal}`)); + const data = (chunk) => { + text += chunk; + const match = text.match(/DevTools listening on ws:\/\/[^:]+:(\d+)\//); + if (match) { + clean(); + done(Number(match[1])); + } + }; + const timer = setTimeout(() => error(new Error("Chrome did not start")), 20000); + chrome.stderr.on("data", data); + chrome.on("error", error); + chrome.on("exit", exited); + }); + } catch (error) { + chrome.kill("SIGKILL"); + rmSync(profile, { recursive: true, force: true }); + throw error; + } +} diff --git a/skills/anatomy/scripts/chrome-startup.test.mjs b/skills/anatomy/scripts/chrome-startup.test.mjs new file mode 100644 index 0000000..ef9cb5a --- /dev/null +++ b/skills/anatomy/scripts/chrome-startup.test.mjs @@ -0,0 +1,38 @@ +import assert from "node:assert/strict"; +import { execFile } from "node:child_process"; +import { chmod, mkdtemp, readFile, rm, writeFile, access } from "node:fs/promises"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +import { promisify } from "node:util"; +import { fileURLToPath } from "node:url"; +import test from "node:test"; + +const execute = promisify(execFile); + +for (const name of ["capture", "drive", "turn-check"]) { + test(`${name} removes its profile when Chrome exits before startup`, async () => { + const directory = await mkdtemp(join(tmpdir(), "anatomy-chrome-startup-")); + let profile; + try { + const binary = join(directory, "chrome"); + const receipt = join(directory, "profile.txt"); + await writeFile(binary, '#!/bin/sh\nfor arg in "$@"; do\n case "$arg" in --user-data-dir=*) printf "%s" "${arg#--user-data-dir=}" > "$ANATOMY_PROFILE_RECEIPT";; esac\ndone\nexit 7\n'); + await chmod(binary, 0o755); + const started = performance.now(); + let result; + try { + await execute(process.execPath, [fileURLToPath(new URL(`${name}.mjs`, import.meta.url)), join(directory, "figure.html"), ...(name === "drive" ? ["[]"] : name === "turn-check" ? ["--lines"] : [])], { timeout: 30000, env: { ...process.env, CHROME_PATH: binary, ANATOMY_PROFILE_RECEIPT: receipt } }); + } catch (error) { + result = error; + } + profile = await readFile(receipt, "utf8"); + assert.equal(result?.code, 1); + await assert.rejects(access(profile), { code: "ENOENT" }); + assert.ok(performance.now() - started < 10000); + assert.match(result.stderr, /Chrome exited before startup.*7/); + } finally { + if (profile) await rm(profile, { recursive: true, force: true }); + await rm(directory, { recursive: true, force: true }); + } + }); +} diff --git a/skills/anatomy/scripts/curve-density.test.mjs b/skills/anatomy/scripts/curve-density.test.mjs new file mode 100644 index 0000000..73fe0da --- /dev/null +++ b/skills/anatomy/scripts/curve-density.test.mjs @@ -0,0 +1,59 @@ +import assert from "node:assert/strict"; +import { execFile } from "node:child_process"; +import { mkdtemp, rm, writeFile } from "node:fs/promises"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +import { promisify } from "node:util"; +import test from "node:test"; + +const execute = promisify(execFile); +for (const [name, path, x, y] of [ + ["cubic between fixed samples", "M20 400C20 20 480 20 480 400", 25.166015625, 333.203125], + ["quadratic between fixed samples", "M20 400Q250 20 480 400", 58.33333333333333, 341.94444444444446], +]) test(`native SVG ${name} roots an attached line`, async () => { + const directory = await mkdtemp(join(tmpdir(), "anatomy-curve-density-")); + try { + const file = join(directory, "figure.html"); + await writeFile(file, `
`); + const actions = JSON.stringify([["eval", `document.querySelector('#curve').isPointInStroke(new DOMPoint(${x},${y}))`], ["lines"]]); + let result; + try { result = { code: 0, ...await execute(process.execPath, ["scripts/drive.mjs", file, actions], { timeout: 30000 }) }; } + catch (error) { result = { code: error.code, stdout: error.stdout, stderr: error.stderr }; } + assert.match(result.stdout, /eval: true/); + assert.match(result.stdout, /line ends: (?:0|1) of 1/); + assert.equal(result.code, 0, `native audit exit expected 0 received ${result.code}\n${result.stdout}`); + assert.match(result.stdout, /line ends: 0 of 1/); + } finally { await rm(directory, { recursive: true, force: true }); } +}); + +for (const [name, path, x, y, transform, attached] of [ + ["nonuniform transformed cubic", "M20 400C20 20 480 20 480 400", 25.166015625, 333.203125, "matrix(3 0 0 0.5 0 0)", true], + ["collinear overshooting cubic", "M20 120C400 120 400 120 100 120", 315, 120, "", true], + ["detached cubic endpoint", "M20 400C20 20 480 20 480 400", 45.166015625, 333.203125, "", false], +]) test(`native SVG ${name} retains actual attachment`, async () => { + const directory = await mkdtemp(join(tmpdir(), "anatomy-curve-bound-")); + try { + const file = join(directory, "figure.html"); + await writeFile(file, `
`); + const actions = JSON.stringify([["eval", `document.querySelector('#curve').isPointInStroke(new DOMPoint(${x},${y}))`], ["lines"]]); + let result; + try { result = { code: 0, ...await execute(process.execPath, ["scripts/drive.mjs", file, actions], { timeout: 30000 }) }; } + catch (error) { result = { code: error.code, stdout: error.stdout, stderr: error.stderr }; } + assert.match(result.stdout, new RegExp(`eval: ${attached}`)); + assert.equal(result.code, attached ? 0 : 1, result.stdout); + assert.match(result.stdout, new RegExp(`line ends: ${attached ? 0 : 1} of 1`)); + } finally { await rm(directory, { recursive: true, force: true }); } +}); + +test("native audit refuses curves whose approximation budget cannot prove the bound", async () => { + const directory = await mkdtemp(join(tmpdir(), "anatomy-curve-budget-")); + try { + const file = join(directory, "figure.html"); + await writeFile(file, '
'); + let result; + try { result = { code: 0, ...await execute(process.execPath, ["scripts/drive.mjs", file, '[["lines"]]'], { timeout: 30000 }) }; } + catch (error) { result = { code: error.code, stdout: error.stdout, stderr: error.stderr }; } + assert.equal(result.code, 1); + assert.match(result.stderr, /Curve audit could not establish its screen-space sampling bound/); + } finally { await rm(directory, { recursive: true, force: true }); } +}); diff --git a/skills/anatomy/scripts/drive-actions.test.mjs b/skills/anatomy/scripts/drive-actions.test.mjs new file mode 100644 index 0000000..253c4ef --- /dev/null +++ b/skills/anatomy/scripts/drive-actions.test.mjs @@ -0,0 +1,74 @@ +import assert from "node:assert/strict"; +import { execFile } from "node:child_process"; +import { mkdtemp, rm, writeFile } from "node:fs/promises"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +import { promisify } from "node:util"; +import { fileURLToPath } from "node:url"; +import test from "node:test"; + +const execute = promisify(execFile); +const drive = fileURLToPath(new URL("drive.mjs", import.meta.url)); + +async function run(actions) { + const directory = await mkdtemp(join(tmpdir(), "anatomy-drive-actions-")); + try { + const page = join(directory, "figure.html"); + const file = join(directory, "actions.json"); + await writeFile(page, '
Figure
'); + await writeFile(file, JSON.stringify(actions)); + try { + return { code: 0, ...await execute(process.execPath, [drive, page, "--actions", file], { timeout: 30000 }) }; + } catch (error) { + return { code: error.code, stdout: error.stdout, stderr: error.stderr }; + } + } finally { + await rm(directory, { recursive: true, force: true }); + } +} + +test("unknown actions fail instead of silently skipping verification", async () => { + const result = await run([["unti", "false", 1]]); + assert.equal(result.code, 1); + assert.match(result.stderr, /unknown action unti/); +}); + +test("valid actions still execute after validation", async () => { + const result = await run([["wait", 1], ["eval", "({checked:true})"]]); + assert.equal(result.code, 0); + assert.match(result.stdout, /eval: \{"checked":true\}/); +}); + +test("an invalid later action fails before earlier actions execute", async () => { + const result = await run([["eval", "({shouldNotRun:true})"], ["screenshot", "out.png"]]); + assert.equal(result.code, 1); + assert.doesNotMatch(result.stdout, /shouldNotRun/); +}); + +test("orbit rejects a step that never reaches its end angle", async () => { + for (const action of [["orbit", "out.png", 90, 0, 0], ["orbit", "out.png", 0, 90, -10], ["orbit", "out.png", 0, 90, "10"]]) { + const result = await run([action]); + assert.equal(result.code, 1, JSON.stringify(action)); + assert.match(result.stderr, /orbit needs numeric from, to and a nonzero step/); + } +}); + +test("sheet rejects a count that yields no frames", async () => { + for (const action of [["sheet", "out.png", 50, 0], ["sheet", "out.png", 50, 2.5], ["sheet", "out.png", -1, 3]]) { + const result = await run([action]); + assert.equal(result.code, 1, JSON.stringify(action)); + assert.match(result.stderr, /sheet needs a non-negative every/); + } +}); + +test("a valid orbit and sheet still pass validation", async () => { + const orbit = join(tmpdir(), `anatomy-orbit-${process.pid}.png`); + const sheet = join(tmpdir(), `anatomy-sheet-${process.pid}.png`); + try { + const result = await run([["eval", "window.__isoTurn={set(){}}"], ["orbit", orbit, 0, 20, 10], ["sheet", sheet, 10, 2]]); + assert.equal(result.code, 0, result.stderr); + } finally { + await rm(orbit, { force: true }); + await rm(sheet, { force: true }); + } +}); diff --git a/skills/anatomy/scripts/drive-async-until.test.mjs b/skills/anatomy/scripts/drive-async-until.test.mjs new file mode 100644 index 0000000..932513b --- /dev/null +++ b/skills/anatomy/scripts/drive-async-until.test.mjs @@ -0,0 +1,53 @@ +import assert from "node:assert/strict"; +import { execFile } from "node:child_process"; +import { mkdtemp, rm, writeFile, access } from "node:fs/promises"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +import { promisify } from "node:util"; +import test from "node:test"; + +const execute = promisify(execFile); +async function run(actions, script = "") { + const directory = await mkdtemp(join(tmpdir(), "anatomy-driver-regression-")); + try { + const page = join(directory, "figure.html"); + const file = join(directory, "actions.json"); + const output = join(directory, "orbit.png"); + await writeFile(page, `
rest
`); + await writeFile(file, JSON.stringify(typeof actions === "function" ? actions(output) : actions)); + let result; + try { result = { code: 0, ...await execute(process.execPath, ["scripts/drive.mjs", page, "--actions", file], { timeout: 15000 }) }; } + catch (error) { result = { code: error.code, stdout: error.stdout, stderr: error.stderr }; } + result.hasImage = await access(output).then(() => true, () => false); + console.log(JSON.stringify(result)); + return result; + } finally { await rm(directory, { recursive: true, force: true }); } +} + +for (const expression of ["false", "Promise.resolve(false)", "new Promise(()=>{})"]) + test(`until times out and stops after ${expression}`, async () => { + const result = await run([["until", expression, 100], ["eval", "'AFTER_FAILED_WAIT'"]]); + assert.equal(result.code, 1); + assert.match(result.stderr, /until: timed out/); + assert.doesNotMatch(result.stdout, /AFTER_FAILED_WAIT/); + }); + +test("until awaits a delayed asynchronous condition", async () => { + const result = await run([["until", "new Promise(resolve=>setTimeout(()=>{window.ready=true;resolve(true)},100))", 1000], ["eval", "window.ready"]]); + assert.equal(result.code, 0); + assert.match(result.stdout, /eval: true/); +}); + +test("until propagates a rejected asynchronous condition", async () => { + const result = await run([["until", "Promise.reject(new Error('async condition failed'))", 1000], ["eval", "'AFTER_REJECTION'"]]); + assert.equal(result.code, 1); + assert.match(result.stderr, /async condition failed/); + assert.doesNotMatch(result.stdout, /AFTER_REJECTION/); +}); + +for (const expression of ["true", "({ready:true})", "(()=>{})", "Promise.resolve({ready:true})"]) + test(`until preserves truthiness of ${expression}`, async () => { + const result = await run([["until", expression, 1000], ["eval", "'AFTER_SUCCESS'"]]); + assert.equal(result.code, 0); + assert.match(result.stdout, /AFTER_SUCCESS/); + }); diff --git a/skills/anatomy/scripts/drive-page-load.test.mjs b/skills/anatomy/scripts/drive-page-load.test.mjs new file mode 100644 index 0000000..efb3d81 --- /dev/null +++ b/skills/anatomy/scripts/drive-page-load.test.mjs @@ -0,0 +1,32 @@ +import assert from "node:assert/strict"; +import { execFile } from "node:child_process"; +import { createServer } from "node:http"; +import { promisify } from "node:util"; +import { fileURLToPath } from "node:url"; +import test from "node:test"; + +const execute = promisify(execFile); +const drive = fileURLToPath(new URL("drive.mjs", import.meta.url)); + +test("drive waits for a slow page to finish loading before running actions", async () => { + const server = createServer((request, response) => { + if (request.url === "/slow.js") { + setTimeout(() => { + response.setHeader("content-type", "text/javascript"); + response.end("window.slowScriptRan = true"); + }, 2500); + } else { + response.setHeader("content-type", "text/html"); + response.end('
Figure
'); + } + }); + await new Promise((done) => server.listen(0, "127.0.0.1", done)); + try { + const { port } = server.address(); + const actions = JSON.stringify([["eval", "document.readyState + ' ' + Boolean(window.slowScriptRan)"]]); + const result = await execute(process.execPath, [drive, `http://127.0.0.1:${port}/`, actions], { timeout: 30000 }); + assert.match(result.stdout, /eval: "complete true"/); + } finally { + server.close(); + } +}); diff --git a/skills/anatomy/scripts/drive-turn-controller.test.mjs b/skills/anatomy/scripts/drive-turn-controller.test.mjs new file mode 100644 index 0000000..b5a7878 --- /dev/null +++ b/skills/anatomy/scripts/drive-turn-controller.test.mjs @@ -0,0 +1,49 @@ +import assert from "node:assert/strict"; +import { execFile } from "node:child_process"; +import { mkdtemp, rm, writeFile, access } from "node:fs/promises"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +import { promisify } from "node:util"; +import test from "node:test"; + +const execute = promisify(execFile); +async function run(actions, script = "") { + const directory = await mkdtemp(join(tmpdir(), "anatomy-driver-regression-")); + try { + const page = join(directory, "figure.html"); + const file = join(directory, "actions.json"); + const output = join(directory, "orbit.png"); + await writeFile(page, `
rest
`); + await writeFile(file, JSON.stringify(typeof actions === "function" ? actions(output) : actions)); + let result; + try { result = { code: 0, ...await execute(process.execPath, ["scripts/drive.mjs", page, "--actions", file], { timeout: 15000 }) }; } + catch (error) { result = { code: error.code, stdout: error.stdout, stderr: error.stderr }; } + result.hasImage = await access(output).then(() => true, () => false); + console.log(JSON.stringify(result)); + return result; + } finally { await rm(directory, { recursive: true, force: true }); } +} + +for (const script of ["", "window.__isoTurn={}"]) + for (const action of ["turn", "orbit"]) + test(`${action} rejects a missing callable turn controller (${script || "absent"})`, async () => { + const result = await run(out => [action === "turn" ? ["turn", 90] : ["orbit", out, 0, 90, 90], ["eval", "'AFTER_FAILED_TURN'"]], script); + assert.equal(result.code, 1); + assert.match(result.stderr, /requires window\.__isoTurn\.set/); + assert.doesNotMatch(result.stdout, /AFTER_FAILED_TURN/); + assert.equal(result.hasImage, false); + }); + +const controller = "window.turns=[];window.__isoTurn={set(value){window.turns.push(value);document.querySelector('[data-readout]').textContent=JSON.stringify(value)}}"; +test("turn preserves numeric, named-group and object poses", async () => { + const result = await run([["turn", 90], ["turn", 0.5, "lift"], ["turn", {dial:45,lift:1}], ["eval", "window.turns"]], controller); + assert.equal(result.code, 0); + assert.match(result.stdout, /eval: \[90,\{"lift":0.5\},\{"dial":45,"lift":1\}\]/); +}); + +test("orbit still visits its requested poses and writes an image", async () => { + const result = await run(out => [["orbit", out, 0, 90, 90], ["eval", "window.turns"]], controller); + assert.equal(result.code, 0); + assert.match(result.stdout, /eval: \[0,90\]/); + assert.equal(result.hasImage, true); +}); diff --git a/skills/anatomy/scripts/drive.mjs b/skills/anatomy/scripts/drive.mjs new file mode 100644 index 0000000..825e508 --- /dev/null +++ b/skills/anatomy/scripts/drive.mjs @@ -0,0 +1,332 @@ +import { chromePort } from "./chrome-port.mjs"; +import { spawn } from "node:child_process"; +import { existsSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, rmSync, writeFileSync } from "node:fs"; +import { homedir, tmpdir } from "node:os"; +import { dirname, join, resolve } from "node:path"; +import { pathToFileURL } from "node:url"; +import { LINE_ENDS } from "./line-ends.mjs"; + +if (typeof WebSocket === "undefined" && !process.execArgv.includes("--experimental-websocket")) { + const child = spawn(process.execPath, ["--experimental-websocket", ...process.argv.slice(1)], { stdio: "inherit" }); + child.on("exit", (code) => process.exit(code ?? 1)); +} else { + await main(); +} + +function usage() { + console.log(`Drive a figure in headless Chrome: move, click, type, wait, screenshot, and build contact sheets. + + node drive.mjs '' [--width 1440] [--height 1100] [--scale 1] [--reduced] [--theme dark|light] [--no-webgl] [--preload file.js] + node drive.mjs --actions steps.json + + --reduced emulate prefers-reduced-motion: reduce + --theme t emulate prefers-color-scheme: dark or light (only pages that read the media query follow it) + --no-webgl make canvas.getContext("webgl"/"webgl2") return null, to check the SVG fallback + --preload js run a script before the page's own scripts (counters, stubs, hooks) + Kit pages set their theme at build time (body data-theme), so drive the -light.html build for light. + Put anything with eval strings in an --actions file: inline JSON quoting breaks easily. + +Actions run in order. A missing or null selector means the first .iso-plate (the key action focuses [tabindex="0"]). +Fractions are 0..1 across the element. + ["scroll", sel] scroll an element into the middle of the viewport + ["wait", ms] wait + ["move", sel, fx, fy] glide the mouse to a point of the element (fires pointermove) + ["click", sel, fx?, fy?] click a point of the element (centre by default) + ["drag", sel, fx0, fy0, fx1, fy1, steps?] + press at one point of the element, glide to another in steps (20) one frame apart, + release: real pointer events (pointerId 1), so setPointerCapture works + ["key", key, sel?, code?] focus sel (default [tabindex="0"]) and press a key ("i", "Escape", "ArrowRight", " ", "7"); + pass code for keys that share a name ("Shift" + "ShiftRight", "Enter" + "NumpadEnter") + ["slow", factor] run the page's requestAnimationFrame and performance.now clock at factor x real + time (0.05 = 20x slow motion) so sheets catch 100 ms events; ["slow", 1] restores it + ["until", js, timeoutMs?] poll a JS expression until it is truthy (default 10 s); a timeout stops the run with exit 1 + ["eval", js] run JS in the page and print the result + ["shot", out.png, sel?, scale?, [x,y,w,h]?] screenshot an element, or a region of it in CSS px + ["lines", out.png?, sel?, options?] check every texture line's two ends: each must land on a stroke, a dot or an outline + (within options.tolerance, 1 viewBox px), or hide under a fill painted later; a short + straight mark (a tick) needs one rooted end; lines with data-free and fade ramps are + exempt. Prints each floating end in card px; out.png marks them with rings. Any failure + makes the run exit 1 + ["turn", value, group?] set a 3D figure's turn through window.__isoTurn (a number sets the first turn group, + group names another), then wait two animation frames + ["orbit", out.png, from, to, step, sel?, scale?, [x,y,w,h]?, columns?] + a contact sheet across angles of a 3D figure: each frame is turned, waits two + animation frames, is captured and labelled with its angle + ["sheet", out.png, every, count, sel?, scale?, [x,y,w,h]?, columns?] + take count frames every ms and tile them into one PNG, to catch pops and seams; + each capture also takes 60-200 ms (more on heavy WebGL pages), so combine with ["slow", 0.05] for transitions + +Prints the readout after each shot, then console errors and exceptions.`); +} + +function chromePath() { + const candidates = [ + process.env.CHROME_PATH, + "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome", + "/Applications/Chromium.app/Contents/MacOS/Chromium", + "/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary", + "/usr/bin/google-chrome", + "/usr/bin/google-chrome-stable", + "/usr/bin/chromium", + "/usr/bin/chromium-browser", + "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe", + "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe", + ...(process.env.LOCALAPPDATA ? [join(process.env.LOCALAPPDATA, "Google\\Chrome\\Application\\chrome.exe")] : []), + "C:\\Program Files\\Microsoft\\Edge\\Application\\msedge.exe", + "C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe", + ].filter(Boolean); + const playwright = join(homedir(), "Library/Caches/ms-playwright"); + if (existsSync(playwright)) { + for (const dir of readdirSync(playwright).sort().reverse()) { + for (const sub of ["chrome-mac-arm64/Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing", "chrome-mac/Chromium.app/Contents/MacOS/Chromium", "chrome-linux/chrome"]) { + candidates.push(join(playwright, dir, sub)); + } + } + } + const linux = join(homedir(), ".cache/ms-playwright"); + if (existsSync(linux)) for (const dir of readdirSync(linux).sort().reverse()) for (const sub of ["chrome-linux64/chrome", "chrome-linux/chrome"]) candidates.push(join(linux, dir, sub)); + const win = join(homedir(), "AppData/Local/ms-playwright"); + if (existsSync(win)) for (const dir of readdirSync(win).sort().reverse()) for (const sub of ["chrome-win/chrome.exe", "chromium-win64/chrome.exe"]) candidates.push(join(win, dir, sub)); + return candidates.find((path) => existsSync(path)); +} + +async function main() { + const argv = process.argv.slice(2); + if (!argv.length || argv.includes("--help") || argv.includes("-h")) { + usage(); + process.exit(argv.length ? 0 : 1); + } + const options = { width: 1440, height: 1100, scale: 1, reduced: false, theme: null, actions: null, noWebgl: false, preload: null }; + const rest = []; + for (let index = 0; index < argv.length; index++) { + const arg = argv[index]; + if (arg === "--width") options.width = Number(argv[++index]); + else if (arg === "--height") options.height = Number(argv[++index]); + else if (arg === "--scale") options.scale = Number(argv[++index]); + else if (arg === "--reduced") options.reduced = true; + else if (arg === "--theme") options.theme = argv[++index]; + else if (arg === "--no-webgl") options.noWebgl = true; + else if (arg === "--preload") options.preload = readFileSync(argv[++index], "utf8"); + else if (arg === "--actions") options.actions = JSON.parse(readFileSync(argv[++index], "utf8")); + else rest.push(arg); + } + const [target, script] = rest; + const actions = options.actions ?? JSON.parse(script ?? "[]"); + const kinds = new Set(["scroll", "wait", "move", "click", "drag", "key", "slow", "until", "eval", "shot", "lines", "turn", "orbit", "sheet"]); + if (!Array.isArray(actions)) throw new Error("actions must be an array"); + for (const action of actions) { + if (!Array.isArray(action) || !kinds.has(action[0])) throw new Error(`unknown action ${Array.isArray(action) ? action[0] : action}`); + if (action[0] === "orbit") { + const [, , from, to, step] = action; + if (![from, to, step].every(Number.isFinite) || step === 0 || (step > 0 ? from > to : from < to)) throw new Error(`orbit needs numeric from, to and a nonzero step that moves from ${from} toward ${to}, got step ${step}`); + } + if (action[0] === "sheet") { + const [, , every, count] = action; + if (!Number.isFinite(every) || every < 0 || !Number.isInteger(count) || count < 1) throw new Error(`sheet needs a non-negative every and a whole count of at least 1, got every ${every} and count ${count}`); + } + } + const url = /^https?:|^file:/.test(target) ? target : pathToFileURL(resolve(target)).href; + const binary = chromePath(); + if (!binary) { + console.error("No Chrome found. Set CHROME_PATH to a Chrome or Chromium binary."); + process.exit(1); + } + const profile = mkdtempSync(join(tmpdir(), "iso-drive-")); + const chrome = spawn(binary, ["--headless=new", ...(process.platform === "linux" ? ["--no-sandbox"] : []), ...(process.platform === "win32" ? ["--do-not-de-elevate"] : []), "--remote-debugging-port=0", `--user-data-dir=${profile}`, "--no-first-run", "--no-default-browser-check", "--hide-scrollbars", "--allow-file-access-from-files", "--enable-unsafe-swiftshader", "--ignore-gpu-blocklist", "about:blank"]); + const port = await chromePort(chrome, profile); + const finish = (code) => { + chrome.kill("SIGKILL"); + try { + rmSync(profile, { recursive: true, force: true }); + } catch {} + process.exit(code); + }; + try { + const page = await (await fetch(`http://127.0.0.1:${port}/json/new?about:blank`, { method: "PUT" })).json(); + const socket = new WebSocket(page.webSocketDebuggerUrl); + let id = 0; + const pending = new Map(); + const problems = []; + let loaded = () => {}; + socket.onmessage = (message) => { + const data = JSON.parse(message.data); + if (data.method === "Page.loadEventFired") loaded(); + if (data.id && pending.has(data.id)) { + pending.get(data.id)(data); + pending.delete(data.id); + } else if (data.method === "Runtime.consoleAPICalled" && (data.params.type === "error" || data.params.type === "warning")) { + problems.push(`console.${data.params.type}: ${data.params.args.map((arg) => arg.value ?? arg.description ?? "").join(" ").slice(0, 600)}`); + } else if (data.method === "Runtime.exceptionThrown") { + const detail = data.params.exceptionDetails; + problems.push(`exception: ${detail.exception?.description ?? detail.text}`.slice(0, 600)); + } + }; + await new Promise((done) => (socket.onopen = done)); + const send = (method, params = {}, patience = 60000) => + new Promise((done, fail) => { + const call = ++id; + const timer = setTimeout(() => { + pending.delete(call); + fail(new Error(`Chrome did not answer ${method} within ${Math.round(patience / 1000)} s`)); + }, patience); + pending.set(call, (data) => { + clearTimeout(timer); + done(data); + }); + socket.send(JSON.stringify({ id: call, method, params })); + }); + const evaluate = async (expression, patience) => { + const reply = await send("Runtime.evaluate", { expression, awaitPromise: true, returnByValue: true }, patience); + if (reply.error) throw new Error(reply.error.message); + const exception = reply.result?.exceptionDetails; + if (exception) throw new Error(exception.exception?.description ?? exception.text); + return reply.result?.result?.value; + }; + const sleep = (ms) => new Promise((done) => setTimeout(done, ms)); + await send("Runtime.enable"); + await send("Page.enable"); + const features = []; + if (options.reduced) features.push({ name: "prefers-reduced-motion", value: "reduce" }); + if (options.theme) features.push({ name: "prefers-color-scheme", value: options.theme }); + if (features.length) await send("Emulation.setEmulatedMedia", { features }); + const SLOW = `(()=>{const raf=window.requestAnimationFrame.bind(window);let real=null,virtual=0;window.__driveSpeed=1;window.requestAnimationFrame=(callback)=>raf((now)=>{if(real===null){real=now;virtual=now}virtual+=(now-real)*window.__driveSpeed;real=now;callback(virtual)});const clock=performance.now.bind(performance);let base=null,shown=0;performance.now=()=>{const now=clock();if(base===null){base=now;shown=now}shown+=(now-base)*window.__driveSpeed;base=now;return shown}})();`; + const NO_GL = `(()=>{const get=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=function(kind,...rest){if(/webgl/.test(String(kind)))return null;return get.call(this,kind,...rest)}})();`; + const early = [SLOW, options.noWebgl ? NO_GL : "", options.preload ?? ""].filter(Boolean).join("\n"); + await send("Page.addScriptToEvaluateOnNewDocument", { source: early }); + await send("Emulation.setDeviceMetricsOverride", { width: options.width, height: options.height, deviceScaleFactor: options.scale, mobile: options.width < 600 }); + const load = new Promise((done) => { + loaded = done; + setTimeout(done, 10000); + }); + const navigation = await send("Page.navigate", { url }); + if (navigation.error) throw new Error(`Navigation failed: ${navigation.error.message}`); + if (navigation.result?.errorText) throw new Error(`Navigation failed: ${navigation.result.errorText}`); + await load; + await sleep(1200); + const targetOf = (selector, fallback = ".iso-plate") => `(()=>{const select=${JSON.stringify(selector ?? null)};const el=document.querySelector(select??${JSON.stringify(fallback)});if(select!==null&&!el)throw new Error("Drive target not found: "+select);return el})()`; + const boxOf = (selector) => evaluate(`(()=>{const el=${targetOf(selector)}||document.body;const r=el.getBoundingClientRect();return {x:r.left,y:r.top,w:r.width,h:r.height,sx:scrollX,sy:scrollY}})()`); + const readout = (selector) => evaluate(selector == null ? `(document.querySelector("[data-readout]")||{}).textContent||""` : `(()=>{const el=${targetOf(selector)};return(el.matches('[data-readout]')?el:el.querySelector('[data-readout]')||el.closest('.iso-plate')?.querySelector('[data-readout]')||{}).textContent||""})()`); + const capture = async (selector, scale = 1, region) => { + const box = await boxOf(selector); + const x = box.x + box.sx; + const y = box.y + box.sy; + const clip = region ? { x: x + region[0], y: y + region[1], width: region[2], height: region[3], scale } : { x: x - 4, y: y - 4, width: box.w + 8, height: box.h + 8, scale }; + const shot = await send("Page.captureScreenshot", { format: "png", clip, captureBeyondViewport: true }); + return shot.result.data; + }; + const save = (out, base64) => { + mkdirSync(dirname(resolve(out)), { recursive: true }); + writeFileSync(out, Buffer.from(base64, "base64")); + }; + let mouse = [4, 4]; + let failed = 0; + for (const action of actions) { + const [kind, ...args] = action; + if (kind === "wait") await sleep(args[0]); + else if (kind === "scroll") await evaluate(`(()=>{const el=${targetOf(args[0])};if(el)el.scrollIntoView({block:"center"})})()`); + else if (kind === "move") { + const box = await boxOf(args[0]); + const to = [box.x + box.w * args[1], box.y + box.h * args[2]]; + for (let step = 1; step <= 10; step++) { + await send("Input.dispatchMouseEvent", { type: "mouseMoved", x: mouse[0] + ((to[0] - mouse[0]) * step) / 10, y: mouse[1] + ((to[1] - mouse[1]) * step) / 10 }); + await sleep(16); + } + mouse = to; + } else if (kind === "click") { + const box = await boxOf(args[0]); + const to = [box.x + box.w * (args[1] ?? 0.5), box.y + box.h * (args[2] ?? 0.5)]; + await send("Input.dispatchMouseEvent", { type: "mouseMoved", x: to[0], y: to[1] }); + await send("Input.dispatchMouseEvent", { type: "mousePressed", x: to[0], y: to[1], button: "left", clickCount: 1 }); + await send("Input.dispatchMouseEvent", { type: "mouseReleased", x: to[0], y: to[1], button: "left", clickCount: 1 }); + mouse = to; + } else if (kind === "drag") { + const box = await boxOf(args[0]); + const from = [box.x + box.w * args[1], box.y + box.h * args[2]]; + const to = [box.x + box.w * args[3], box.y + box.h * args[4]]; + const steps = Math.max(1, args[5] ?? 20); + await send("Input.dispatchMouseEvent", { type: "mouseMoved", x: from[0], y: from[1] }); + await send("Input.dispatchMouseEvent", { type: "mousePressed", x: from[0], y: from[1], button: "left", buttons: 1, clickCount: 1 }); + for (let step = 1; step <= steps; step++) { + await send("Input.dispatchMouseEvent", { type: "mouseMoved", x: from[0] + ((to[0] - from[0]) * step) / steps, y: from[1] + ((to[1] - from[1]) * step) / steps, button: "left", buttons: 1 }); + await sleep(16); + } + await send("Input.dispatchMouseEvent", { type: "mouseReleased", x: to[0], y: to[1], button: "left", buttons: 0, clickCount: 1 }); + mouse = to; + } else if (kind === "key") { + await evaluate(`(()=>{const el=${targetOf(args[1], '[tabindex="0"]')};if(el)el.focus()})()`); + const key = args[0]; + const named = { " ": "Space", "-": "Minus", "=": "Equal", ",": "Comma", ".": "Period", "/": "Slash", ";": "Semicolon", "'": "Quote", "[": "BracketLeft", "]": "BracketRight", "\\": "Backslash", "`": "Backquote" }; + const code = args[2] ?? (named[key] ?? (/^[0-9]$/.test(key) ? `Digit${key}` : key.length === 1 ? `Key${key.toUpperCase()}` : key)); + await send("Input.dispatchKeyEvent", { type: "keyDown", key, code, text: key === "Enter" ? "\r" : key.length === 1 ? key : undefined, windowsVirtualKeyCode: key === " " ? 32 : key === "Enter" ? 13 : 0 }); + await send("Input.dispatchKeyEvent", { type: "keyUp", key, code, windowsVirtualKeyCode: key === "Enter" ? 13 : undefined }); + } else if (kind === "eval") console.log("eval:", JSON.stringify(await evaluate(args[0]))); + else if (kind === "slow") await evaluate(`window.__driveSpeed=${Number(args[0])}`); + else if (kind === "until") { + const limit = Date.now() + (args[1] ?? 10000); + let ok = false; + while (Date.now() < limit) { + ok = await evaluate(`Promise.race([Promise.resolve(${args[0]}).then(Boolean), new Promise((done) => setTimeout(() => done(false), ${Math.max(0, limit - Date.now())}))])`, Math.max(0, limit - Date.now()) + 60000); + if (ok) break; + await sleep(25); + } + if (!ok) throw new Error(`until: timed out waiting for ${args[0]}`); + } + else if (kind === "shot") { + const [out, selector, scale, region] = args; + save(out, await capture(selector, scale ?? 1, region)); + console.log(`shot ${out} · readout "${await readout(selector)}"`); + } else if (kind === "sheet") { + const [out, every, count, selector, scale, region, columns] = args; + const frames = []; + const texts = []; + for (let index = 0; index < count; index++) { + if (index) await sleep(every); + frames.push(await capture(selector, scale ?? 0.5, region)); + texts.push(await readout(selector)); + } + const tiled = await evaluate(`(async()=>{const frames=${JSON.stringify(frames)};const cols=${columns ?? Math.min(count, 6)};const images=await Promise.all(frames.map(src=>new Promise(done=>{const image=new Image();image.onload=()=>done(image);image.src="data:image/png;base64,"+src})));const w=images[0].width,h=images[0].height,rows=Math.ceil(images.length/cols);const canvas=document.createElement("canvas");canvas.width=w*cols;canvas.height=h*rows;const ctx=canvas.getContext("2d");ctx.fillStyle="#808080";ctx.fillRect(0,0,canvas.width,canvas.height);images.forEach((image,index)=>{ctx.drawImage(image,(index%cols)*w,Math.floor(index/cols)*h);ctx.fillStyle="#ff00aa";ctx.font="bold 12px monospace";ctx.fillText(String(index),(index%cols)*w+6,Math.floor(index/cols)*h+16)});return canvas.toDataURL("image/png").split(",")[1]})()`); + save(out, tiled); + console.log(`sheet ${out} · ${count} frames every ${every} ms · readouts ${texts.map((text, index) => `${index}:"${text}"`).join(" ")}`); + } else if (kind === "turn") { + const [value, group] = args; + const call = group ? `window.__isoTurn.set(${JSON.stringify({ [group]: value })})` : `window.__isoTurn.set(${typeof value === "object" ? JSON.stringify(value) : Number(value)})`; + await evaluate(`(()=>{if(typeof window.__isoTurn?.set!=="function")throw new Error("${kind} action requires window.__isoTurn.set");${call};return new Promise((done)=>requestAnimationFrame(()=>requestAnimationFrame(()=>done(true))))})()`); + } else if (kind === "orbit") { + const [out, from, to, step, selector, scale, region, columns] = args; + const frames = []; + const labels = []; + for (let at = from; step > 0 ? at <= to + 1e-9 : at >= to - 1e-9; at += step) { + const angle = Math.round(at * 1000) / 1000; + await evaluate(`(()=>{if(typeof window.__isoTurn?.set!=="function")throw new Error("${kind} action requires window.__isoTurn.set");window.__isoTurn.set(${angle});return new Promise((done)=>requestAnimationFrame(()=>requestAnimationFrame(()=>done(true))))})()`); + frames.push(await capture(selector, scale ?? 0.5, region)); + labels.push(`${angle}°`); + } + const tiled = await evaluate(`(async()=>{const frames=${JSON.stringify(frames)};const labels=${JSON.stringify(labels)};const cols=${columns ?? 6};const images=await Promise.all(frames.map(src=>new Promise(done=>{const image=new Image();image.onload=()=>done(image);image.src="data:image/png;base64,"+src})));const w=images[0].width,h=images[0].height,rows=Math.ceil(images.length/cols);const canvas=document.createElement("canvas");canvas.width=w*cols;canvas.height=h*rows;const ctx=canvas.getContext("2d");ctx.fillStyle="#808080";ctx.fillRect(0,0,canvas.width,canvas.height);images.forEach((image,index)=>{ctx.drawImage(image,(index%cols)*w,Math.floor(index/cols)*h);ctx.fillStyle="#ff00aa";ctx.font="bold 12px monospace";ctx.fillText(labels[index],(index%cols)*w+6,Math.floor(index/cols)*h+16)});return canvas.toDataURL("image/png").split(",")[1]})()`); + save(out, tiled); + console.log(`orbit ${out} · ${frames.length} frames ${from}°…${to}° every ${step}°`); + } else if (kind === "lines") { + const [out, selector, extra] = args; + const result = await evaluate(`(${LINE_ENDS})(${JSON.stringify({ select: selector ?? null, show: Boolean(out), ...(extra ?? {}) })})`); + if (!result) { + console.log("lines: the check did not run"); + failed++; + continue; + } + console.log(`line ends: ${result.problems.length} of ${result.ends} ends on ${result.lines} lines float`); + for (const problem of result.problems) console.log(` ${problem.what} ${problem.end}${problem.mark ? " (a mark: neither end rooted)" : ""} ${problem.gap == null ? "nothing nearby" : `${problem.gap.toFixed(2)} px from anything`} at card ${problem.at.join(",")} length ${problem.length} d ${problem.d}…${problem.opacity < 1 ? ` opacity ${problem.opacity}` : ""}`); + if (out) { + save(out, await capture(selector, 2)); + await evaluate(`(document.querySelector("[data-line-ends]")||{remove(){}}).remove()`); + console.log(`shot ${out}`); + } + failed += result.problems.length; + } + } + console.log(problems.length ? problems.join("\n") : "console: clean"); + socket.close(); + finish(failed ? 1 : 0); + } catch (error) { + console.error(error); + finish(1); + } +} diff --git a/skills/anatomy/scripts/drive.test.mjs b/skills/anatomy/scripts/drive.test.mjs new file mode 100644 index 0000000..676094c --- /dev/null +++ b/skills/anatomy/scripts/drive.test.mjs @@ -0,0 +1,86 @@ +import assert from "node:assert/strict"; +import { execFile } from "node:child_process"; +import { mkdtemp, rm, writeFile } from "node:fs/promises"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +import { promisify } from "node:util"; +import { fileURLToPath } from "node:url"; +import test from "node:test"; + +const execute = promisify(execFile); + +async function drive(expression, action = "eval") { + const directory = await mkdtemp(join(tmpdir(), "anatomy-drive-test-")); + try { + const page = join(directory, "figure.html"); + const actions = join(directory, "actions.json"); + await writeFile(page, '
Owned figure
'); + await writeFile(actions, JSON.stringify([[action, expression, 200]])); + try { + return { code: 0, ...await execute(process.execPath, [fileURLToPath(new URL("drive.mjs", import.meta.url)), page, "--actions", actions], { timeout: 30000 }) }; + } catch (error) { + return { code: error.code, stdout: error.stdout, stderr: error.stderr }; + } + } finally { + await rm(directory, { recursive: true, force: true }); + } +} + +test("drive fails when a browser assertion throws", async () => { + const result = await drive("(()=>{throw new Error('drive assertion failed')})()"); + assert.equal(result.code, 1); + assert.match(result.stderr, /drive assertion failed/); + assert.doesNotMatch(result.stdout, /console: clean/); +}); + +test("drive fails when an awaited browser promise rejects", async () => { + const result = await drive("Promise.reject(new Error('drive async assertion failed'))"); + assert.equal(result.code, 1); + assert.match(result.stderr, /drive async assertion failed/); +}); + +test("drive preserves a successful JSON evaluation", async () => { + const result = await drive("({checked: true})"); + assert.equal(result.code, 0); + assert.match(result.stdout, /eval: \{"checked":true\}/); + assert.match(result.stdout, /console: clean/); +}); + +test("drive preserves a successful undefined evaluation", async () => { + const result = await drive("void 0"); + assert.equal(result.code, 0); + assert.match(result.stdout, /eval: undefined/); + assert.match(result.stdout, /console: clean/); +}); + +test("drive reports a browser evaluation syntax error", async () => { + const result = await drive("(()"); + assert.equal(result.code, 1); + assert.match(result.stderr, /SyntaxError/); +}); + +test("drive reports an assertion thrown while waiting for a condition", async () => { + const result = await drive("(()=>{throw new Error('until assertion failed')})()", "until"); + assert.equal(result.code, 1); + assert.match(result.stderr, /until assertion failed/); +}); + +test("drive accepts a condition that is already true however short the wait", async () => { + const directory = await mkdtemp(join(tmpdir(), "anatomy-drive-test-")); + try { + const page = join(directory, "figure.html"); + const actions = join(directory, "actions.json"); + await writeFile(page, '
Owned figure
'); + await writeFile(actions, JSON.stringify([["until", "true", 1], ["until", "Promise.resolve(1)", 1]])); + const result = await execute(process.execPath, [fileURLToPath(new URL("drive.mjs", import.meta.url)), page, "--actions", actions], { timeout: 30000 }); + assert.match(result.stdout, /console: clean/); + } finally { + await rm(directory, { recursive: true, force: true }); + } +}); + +test("drive preserves a successful wait condition", async () => { + const result = await drive("document.querySelector('.iso-plate') !== null", "until"); + assert.equal(result.code, 0); + assert.match(result.stdout, /console: clean/); +}); diff --git a/skills/anatomy/scripts/enter-key.test.mjs b/skills/anatomy/scripts/enter-key.test.mjs new file mode 100644 index 0000000..a0a3204 --- /dev/null +++ b/skills/anatomy/scripts/enter-key.test.mjs @@ -0,0 +1,38 @@ +import assert from "node:assert/strict"; +import { execFile } from "node:child_process"; +import { mkdtemp, rm, writeFile } from "node:fs/promises"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +import { promisify } from "node:util"; +import test from "node:test"; + +const execute = promisify(execFile); +async function run(kind, args) { + const directory = await mkdtemp(join(tmpdir(), "anatomy-enter-key-")); + try { + const file = join(directory, "figure.html"); + await writeFile(file, `
waiting
`); + return await execute(process.execPath, ["scripts/" + kind + ".mjs", file, ...(kind === "capture" ? ["--out", join(directory, "shot.png"), "--wait", "0", "--key", args] : [JSON.stringify(args)])], { timeout: 30000 }); + } finally { await rm(directory, { recursive: true, force: true }); } +} +for (const code of [undefined, "NumpadEnter"]) + test(`drive Enter ${code || "default"} performs the native button action`, async () => { + const result = await run("drive", [["key", "Enter", "#button", code], ["eval", "window.clicked||0"]]); + assert.match(result.stdout, /eval: 1/); + }); +test("drive Enter performs native implicit form submission", async () => { + const result = await run("drive", [["key", "Enter", "#field"], ["eval", "window.submitted||0"]]); + assert.match(result.stdout, /eval: 1/); +}); +test("capture Enter applies native activation before the screenshot", async () => { + const result = await run("capture", "Enter"); + assert.match(result.stdout, /readout "activated"/); +}); +test("drive preserves native Space, arrow and printable key behavior", async () => { + const result = await run("drive", [["key", " ", "#button"], ["key", "ArrowRight", "#range"], ["key", "a", "#field"], ["eval", "({clicked:window.clicked||0,range:document.querySelector('#range').value,text:document.querySelector('#field').value})"]]); + assert.match(result.stdout, /"clicked":1,"range":"6","text":"a"/); +}); +test("capture preserves native Space activation", async () => { + const result = await run("capture", "Space"); + assert.match(result.stdout, /readout "activated"/); +}); diff --git a/skills/anatomy/scripts/fidelity-cut.test.mjs b/skills/anatomy/scripts/fidelity-cut.test.mjs new file mode 100644 index 0000000..c3bf289 --- /dev/null +++ b/skills/anatomy/scripts/fidelity-cut.test.mjs @@ -0,0 +1,70 @@ +import assert from "node:assert/strict"; +import { execFile } from "node:child_process"; +import { mkdtemp, rm, writeFile } from "node:fs/promises"; +import { tmpdir } from "node:os"; +import { join, resolve } from "node:path"; +import { promisify } from "node:util"; +import { pathToFileURL } from "node:url"; +import test from "node:test"; +const execute = promisify(execFile); +async function run(kind, split = false, open = false, corrupt = null, options = {}) { + const directory = await mkdtemp(join(tmpdir(), "anatomy-fidelity-cut-")); + try { + const file = join(directory, "fixture.mjs"); + const module = pathToFileURL(resolve("kit/turn-build.mjs")).href; + const frameModule = pathToFileURL(resolve("kit/lathe.mjs")).href; + const runtime = pathToFileURL(resolve("kit/turn.mjs")).href; + const origin = options.origin ?? [0, 0, 0]; + const axis = options.axis ?? [0, 0, 1]; + const polygon = options.polygon ?? [[-2, -2], [2, -2], [2, 2], [-2, 2]]; + const cutPlane = options.cutPlane ?? { n: [0, 0, 1], d: 5 }; + await writeFile(file, `import {turning} from ${JSON.stringify(module)};import * as G from ${JSON.stringify(frameModule)}; +export const P={origin:[0,0],scale:1,azimuth:45,elevation:30};export const T=turning(P);T.layer('parts');const group=T.group('assembly',{turn:{pivot:[5,2]}});const F=G.frameAlong(${JSON.stringify(origin)},${JSON.stringify(axis)});const base={name:'body',group,F,s0:0,s1:10};const part=${kind === "prism" ? `T.prism({...base,polygon:${JSON.stringify(polygon)}})` : `T.round({...base,r:2,fixed:false,ends:${open ? "['open','flat']" : "['flat','flat']"}})`};${split ? `T.split(part,${JSON.stringify(cutPlane)});` : ""}T.build();${corrupt ? `const {TURN}=await import(${JSON.stringify(runtime)});const emit=TURN.emit;TURN.emit=(run,cam,frame)=>{const f=emit(run,cam,frame);for(const role of ${JSON.stringify(corrupt === "edge" ? ["edge"] : corrupt === "fill" ? ["fill"] : ["fill", "edge"])})if(run.role[role]!==undefined)f.d[run.role[role]]=f.d[run.role[role]].replace(/-?\\d+(?:\\.\\d+)?/g,n=>String(Number(n)+20));return f;};` : ""}`); + return await execute(process.execPath, ["scripts/turn-check.mjs", file, "--fidelity", "--angles", "0,45,90,180"], { timeout: 30000 }); + } finally { await rm(directory, { recursive: true, force: true }); } +} +function compared(stdout, kind) { + if (kind === "prism") assert.ok(Number(stdout.match(/over (\d+) faces/)[1]) > 0); + else { + assert.ok(Number(stdout.match(/rounds: (\d+) frames/)[1]) > 0); + assert.ok(Number(stdout.match(/of (\d+) interior cells/)[1]) > 0); + } +} +for (const kind of ["prism", "round"]) test(`actual fidelity CLI accepts split ${kind} with intentionally unstroked cuts`, async () => { + const result = await run(kind, true); + assert.match(result.stdout, /fidelity passed/); + compared(result.stdout, kind); + if (kind === "prism") assert.match(result.stdout, /control .*fails as it should/); +}); +test("actual fidelity CLI honors an unsplit open round end", async () => { + const result = await run("round", false, true); + assert.match(result.stdout, /fidelity passed/); + compared(result.stdout, "round"); +}); +for (const kind of ["prism", "round"]) test(`actual fidelity CLI preserves an unsplit closed ${kind} control`, async () => { + const result = await run(kind); + assert.match(result.stdout, /fidelity passed/); + compared(result.stdout, kind); + if (kind === "prism") assert.match(result.stdout, /control .*fails as it should/); +}); +for (const split of [false, true]) test(`actual fidelity CLI transforms upright frame prism (${split ? "split along axis" : "unsplit"})`, async () => { + const result = await run("prism", split, false, null, { origin: [4, -3, 2], polygon: [[-3, -1], [3, -1], [3, 1], [-3, 1]], cutPlane: { n: [1, 0, 0], d: 4 } }); + assert.match(result.stdout, /fidelity passed/); + compared(result.stdout, "prism"); + assert.match(result.stdout, /control .*fails as it should/); +}); +test("actual fidelity CLI transforms upright frame prism with downward axis", async () => { + const result = await run("prism", false, false, null, { origin: [4, -3, 12], axis: [0, 0, -1], polygon: [[-3, -1], [3, -1], [3, 1], [-3, 1]] }); + assert.match(result.stdout, /fidelity passed/); + compared(result.stdout, "prism"); + assert.match(result.stdout, /control .*fails as it should/); +}); +for (const kind of ["prism", "round"]) for (const split of [false, true]) for (const fault of (split ? ["edge", "geometry", "fill"] : ["edge", "geometry"])) + test(`actual fidelity CLI detects ${fault} corruption of ${split ? "split" : "unsplit"} ${kind}`, async () => { + await assert.rejects(run(kind, split, false, fault), (error) => { + assert.equal(error.code, 1); + assert.match(error.stdout, /(?:prisms|rounds) FAILED/); + assert.match(error.stdout, /fidelity failed/); + return true; + }); + }); diff --git a/skills/anatomy/scripts/fidelity-tube-coverage.test.mjs b/skills/anatomy/scripts/fidelity-tube-coverage.test.mjs new file mode 100644 index 0000000..71cc379 --- /dev/null +++ b/skills/anatomy/scripts/fidelity-tube-coverage.test.mjs @@ -0,0 +1,40 @@ +import assert from "node:assert/strict"; +import { execFile } from "node:child_process"; +import { mkdtemp, rm, writeFile } from "node:fs/promises"; +import { tmpdir } from "node:os"; +import { join, resolve } from "node:path"; +import { promisify } from "node:util"; +import { pathToFileURL } from "node:url"; +import test from "node:test"; +const execute = promisify(execFile); +async function run(mode = "healthy", role = "body", caps = true) { + const directory = await mkdtemp(join(tmpdir(), "anatomy-fidelity-tube-")); + try { + const file = join(directory, "fixture.mjs"); + const build = pathToFileURL(resolve("kit/turn-build.mjs")).href; + const runtime = pathToFileURL(resolve("kit/turn.mjs")).href; + await writeFile(file, `import {turning} from ${JSON.stringify(build)};import {TURN} from ${JSON.stringify(runtime)}; +export const P={origin:[0,0],scale:1,azimuth:45,elevation:30};export const T=turning(P);T.layer('parts');const group=T.group('assembly',{turn:{pivot:[5,2]}});T.tube({name:'route',group,route:[[0,0,0],[0,0,10]],r:1,chunk:20,caps:${caps}});T.build(); +const emit=TURN.emit;TURN.emit=(run,cam,frame)=>{const f=emit(run,cam,frame);if(run.kind==='tube'&&${JSON.stringify(mode)}!=='healthy'){const index=run.role[${JSON.stringify(role)}];if(index!==undefined)f.d[index]=f.d[index].replace(/M([^M]*)/g,(all,body)=>{const nums=(body.match(/-?\\d+(?:\\.\\d+)?/g)??[]).map(Number);const mode=${JSON.stringify(mode)};if(mode==='empty')return'M';if(mode==='single')return'M'+nums.slice(0,2).join(' ');if(mode==='partial')return'M'+[0,2,4].map(i=>nums.slice(i,i+2).join(' ')).join('L')+(/Z\\s*$/.test(body)?'Z':'');if(mode==='offset')return all.replace(/-?\\d+(?:\\.\\d+)?/g,n=>String(Number(n)+20));const pts=[];for(let i=0;ip.join(' ')).join('L')+(/Z\\s*$/.test(body)?'Z':'');});}return f;};`); + return await execute(process.execPath, ["scripts/turn-check.mjs", file, "--fidelity", "--angles", "0,45,90,180"], { timeout: 30000 }); + } finally { await rm(directory, { recursive: true, force: true }); } +} +for (const role of ["body", "edges"]) for (const mode of ["empty", "single", "partial"]) test(`native fidelity rejects ${mode} ${role} path coverage`, async () => { + await assert.rejects(run(mode, role), (error) => { + assert.equal(error.code, 1); + assert.match(error.stdout, /tubes FAILED/); + assert.match(error.stdout, /fidelity failed/); + return true; + }); +}); +for (const caps of [true, false]) test(`native fidelity preserves a healthy ${caps ? "capped" : "open"} tube`, async () => { + const result = await run("healthy", "body", caps); + assert.match(result.stdout, /tubes: [1-9]\d* chunk frames at 4 angles/); + assert.match(result.stdout, /fidelity passed/); +}); +for (const role of ["body", "edges"]) test(`native fidelity permits equivalent ${role} resampling`, async () => { + assert.match((await run("resample", role)).stdout, /fidelity passed/); +}); +test("native fidelity continues rejecting displaced tube geometry", async () => { + await assert.rejects(run("offset"), (error) => error.code === 1 && /tubes FAILED/.test(error.stdout)); +}); diff --git a/skills/anatomy/scripts/fingerprint.mjs b/skills/anatomy/scripts/fingerprint.mjs new file mode 100644 index 0000000..a641496 --- /dev/null +++ b/skills/anatomy/scripts/fingerprint.mjs @@ -0,0 +1,31 @@ +import { createHash } from "node:crypto"; +import { readdirSync, readFileSync, statSync } from "node:fs"; +import { join, relative, sep } from "node:path"; + +export const KIT_FILES = (path) => path === "scripts/inline-kit.mjs" || (path.startsWith("kit/") && !path.split("/").some((part) => part.startsWith("."))); + +const sha256 = (data) => createHash("sha256").update(data).digest("hex"); + +export function fingerprintOf(entries) { + const lines = entries + .filter(([path]) => KIT_FILES(path)) + .map(([path, content]) => `${path}\0${sha256(content)}\n`) + .sort(); + if (!lines.length) throw new Error("fingerprint: no kit files found"); + return `sha256:${sha256(lines.join(""))}`; +} + +function walk(root, dir = root, out = []) { + for (const name of readdirSync(dir)) { + const full = join(dir, name); + const stat = statSync(full); + if (stat.isDirectory()) walk(root, full, out); + else if (stat.isFile()) out.push(relative(root, full).split(sep).join("/")); + } + return out; +} + +export function fingerprintOfSkill(skillRoot) { + const files = [...walk(join(skillRoot, "kit")).map((path) => `kit/${path}`), "scripts/inline-kit.mjs"]; + return fingerprintOf(files.map((path) => [path, readFileSync(join(skillRoot, path))])); +} diff --git a/skills/anatomy/scripts/inline-kit.mjs b/skills/anatomy/scripts/inline-kit.mjs new file mode 100644 index 0000000..acabd3f --- /dev/null +++ b/skills/anatomy/scripts/inline-kit.mjs @@ -0,0 +1,26 @@ +import { readFileSync } from "node:fs"; +import { dirname, join } from "node:path"; +import { fileURLToPath } from "node:url"; + +const KIT = join(dirname(fileURLToPath(import.meta.url)), "..", "kit"); +const strip = (file) => readFileSync(join(KIT, file), "utf8").replace(/^export /gm, ""); + +export function kitScript() { + return strip("iso-kit.mjs"); +} + +export function glScript() { + return strip("gl.mjs"); +} + +export function turnScript() { + return strip("turn.mjs"); +} + +export function fixedScript() { + return strip("turn-fixed.mjs") + "\n" + strip("canvas-painter.mjs"); +} + +export function glSharedScript() { + return strip("gl-shared.mjs"); +} diff --git a/skills/anatomy/scripts/line-ends.mjs b/skills/anatomy/scripts/line-ends.mjs new file mode 100644 index 0000000..50c42c1 --- /dev/null +++ b/skills/anatomy/scripts/line-ends.mjs @@ -0,0 +1,325 @@ +function lineEnds({ select = null, tolerance = 1, root: rootSlack = 2, mark = 7, least = 0.3, cover = 0.5, show = false } = {}) { + const plate = select == null ? document.querySelector(".iso-plate") || document.body : document.querySelector(select); + if (!plate) throw new Error(`Line target not found: ${select}`); + const box = plate.getBoundingClientRect(); + const style = document.createElement("style"); + style.textContent = `${select || ".iso-plate"} *{pointer-events:none!important}${select || ".iso-plate"} svg,${select || ".iso-plate"} svg *{pointer-events:visiblePainted!important}`; + document.head.append(style); + const skipClass = ["iso-edge", "iso-bevel", "iso-crease", "tb-edge"]; + const svgs = [...(plate.matches("svg") ? [plate] : []), ...plate.querySelectorAll("svg")]; + const shapes = svgs.flatMap((svg) => [...svg.querySelectorAll("path, line, polyline, polygon, circle, ellipse, rect")]).filter((el) => !el.closest("defs, clipPath, mask, pattern, marker, symbol")); + const opacityOf = (el) => { + let alpha = 1; + for (let node = el; node && node.nodeType === 1; node = node.parentElement) { + const cs = getComputedStyle(node); + if (cs.display === "none") return 0; + alpha *= Number(cs.opacity); + if (node === plate) break; + } + return getComputedStyle(el).visibility === "hidden" ? 0 : alpha; + }; + const numbers = (text) => (text.match(/-?(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?/gi) || []).map(Number); + const subpathsOf = (d, curveTolerance) => { + const out = []; + let current = null; + let x = 0; + let y = 0; + let sx = 0; + let sy = 0; + let control = null; + const push = (px, py) => { + current.points.push([px, py]); + x = px; + y = py; + }; + const start = (px, py) => { + current = { points: [[px, py]], closed: false }; + out.push(current); + x = sx = px; + y = sy = py; + }; + let curveBudget = 16384; + const chordDistance = (point, first, last) => { + const dx = last[0] - first[0]; + const dy = last[1] - first[1]; + const span = dx * dx + dy * dy; + const along = span > 0 ? Math.max(0, Math.min(1, ((point[0] - first[0]) * dx + (point[1] - first[1]) * dy) / span)) : 0; + return Math.hypot(point[0] - first[0] - along * dx, point[1] - first[1] - along * dy); + }; + const curve = (points) => { + const pending = [points]; + while (pending.length) { + if (--curveBudget < 0) throw new Error("Curve audit could not establish its screen-space sampling bound"); + const controlPoints = pending.pop(); + const first = controlPoints[0]; + const last = controlPoints[controlPoints.length - 1]; + if (controlPoints.slice(1, -1).every((point) => chordDistance(point, first, last) <= curveTolerance)) { + push(...last); + continue; + } + const left = [first]; + const right = [last]; + let level = controlPoints; + while (level.length > 1) { + level = level.slice(1).map((point, index) => [(level[index][0] + point[0]) / 2, (level[index][1] + point[1]) / 2]); + left.push(level[0]); + right.push(level[level.length - 1]); + } + pending.push(right.reverse(), left); + } + }; + const cubic = (x1, y1, x2, y2, px, py) => { + curve([[x, y], [x1, y1], [x2, y2], [px, py]]); + control = { kind: "cubic", point: [x2, y2] }; + }; + const quad = (x1, y1, px, py) => { + curve([[x, y], [x1, y1], [px, py]]); + control = { kind: "quadratic", point: [x1, y1] }; + }; + for (const [, command, args] of d.matchAll(/([MmLlHhVvCcSsQqTtAaZz])([^MmLlHhVvCcSsQqTtAaZz]*)/g)) { + const v = numbers(args); + const rel = command === command.toLowerCase(); + const C = command.toUpperCase(); + const ox = () => (rel ? x : 0); + const oy = () => (rel ? y : 0); + if (C === "Z") { + if (current) { + current.closed = true; + push(sx, sy); + } + current = null; + continue; + } + if (C === "M") { + for (let i = 0; i + 1 < v.length; i += 2) { + if (i === 0) start(v[0] + ox(), v[1] + oy()); + else push(v[i] + ox(), v[i + 1] + oy()); + } + control = null; + continue; + } + if (!current) start(x, y); + if (C === "L") for (let i = 0; i + 1 < v.length; i += 2) push(v[i] + ox(), v[i + 1] + oy()); + else if (C === "H") for (const value of v) push(value + ox(), y); + else if (C === "V") for (const value of v) push(x, value + oy()); + else if (C === "C") for (let i = 0; i + 5 < v.length; i += 6) cubic(v[i] + ox(), v[i + 1] + oy(), v[i + 2] + ox(), v[i + 3] + oy(), v[i + 4] + ox(), v[i + 5] + oy()); + else if (C === "S") + for (let i = 0; i + 3 < v.length; i += 4) { + const reflected = control?.kind === "cubic" ? [2 * x - control.point[0], 2 * y - control.point[1]] : [x, y]; + cubic(reflected[0], reflected[1], v[i] + ox(), v[i + 1] + oy(), v[i + 2] + ox(), v[i + 3] + oy()); + } + else if (C === "Q") for (let i = 0; i + 3 < v.length; i += 4) quad(v[i] + ox(), v[i + 1] + oy(), v[i + 2] + ox(), v[i + 3] + oy()); + else if (C === "T") + for (let i = 0; i + 1 < v.length; i += 2) { + const reflected = control?.kind === "quadratic" ? [2 * x - control.point[0], 2 * y - control.point[1]] : [x, y]; + quad(reflected[0], reflected[1], v[i] + ox(), v[i + 1] + oy()); + } + else if (C === "A") { + const arc = document.createElementNS("http://www.w3.org/2000/svg", "path"); + arc.setAttribute("d", `M${x} ${y}${command}${args}`); + const length = arc.getTotalLength(); + const count = Math.max(8, Math.ceil(length / 2)); + for (let index = 1; index <= count; index++) { + const point = arc.getPointAtLength(length * index / count); + push(point.x, point.y); + } + } + if (C !== "C" && C !== "S" && C !== "Q" && C !== "T") control = null; + } + return out; + }; + const geometryOf = (el, curveTolerance) => { + const tag = el.tagName.toLowerCase(); + const num = (name) => Number(el.getAttribute(name) || 0); + if (tag === "path") return subpathsOf(el.getAttribute("d") || "", curveTolerance); + if (tag === "line") return [{ points: [[num("x1"), num("y1")], [num("x2"), num("y2")]], closed: false }]; + if (tag === "polyline" || tag === "polygon") { + const v = numbers(el.getAttribute("points") || ""); + const points = []; + for (let i = 0; i + 1 < v.length; i += 2) points.push([v[i], v[i + 1]]); + if (tag === "polygon" && points.length) points.push(points[0]); + return [{ points, closed: tag === "polygon" }]; + } + if (tag === "rect") { + const [x, y, w, h] = [num("x"), num("y"), num("width"), num("height")]; + const rx = Math.min(w / 2, Math.max(0, el.hasAttribute("rx") ? num("rx") : num("ry"))); + const ry = Math.min(h / 2, Math.max(0, el.hasAttribute("ry") ? num("ry") : num("rx"))); + if (!rx || !ry) return [{ points: [[x, y], [x + w, y], [x + w, y + h], [x, y + h], [x, y]], closed: true }]; + const points = []; + for (const [cx, cy, start] of [[x + w - rx, y + ry, -Math.PI / 2], [x + w - rx, y + h - ry, 0], [x + rx, y + h - ry, Math.PI / 2], [x + rx, y + ry, Math.PI]]) { + for (let index = 0; index <= 32; index++) { + const angle = start + index * Math.PI / 64; + points.push([cx + rx * Math.cos(angle), cy + ry * Math.sin(angle)]); + } + } + points.push(points[0]); + return [{ points, closed: true }]; + } + return []; + }; + const cell = 6; + const grid = new Map(); + const add = (gx, gy, entry) => { + const id = `${gx},${gy}`; + if (!grid.has(id)) grid.set(id, []); + grid.get(id).push(entry); + }; + const lines = []; + let scale = 1; + for (const el of shapes) { + const cs = getComputedStyle(el); + const alpha = opacityOf(el); + if (alpha < 0.1) continue; + const ctm = el.getScreenCTM(); + if (!ctm) continue; + const map = ([px, py]) => [ctm.a * px + ctm.c * py + ctm.e, ctm.b * px + ctm.d * py + ctm.f]; + const tag = el.tagName.toLowerCase(); + const stroked = cs.stroke !== "none" && parseFloat(cs.strokeWidth) > 0 && Number(cs.strokeOpacity) > 0.05; + const filled = cs.fill !== "none" && Number(cs.fillOpacity) > 0.05; + if (tag === "circle" || tag === "ellipse") { + if (!stroked && !filled) continue; + const cx = Number(el.getAttribute("cx") || 0); + const cy = Number(el.getAttribute("cy") || 0); + const rx = Number(el.getAttribute(tag === "circle" ? "r" : "rx") || 0); + const ry = Number(el.getAttribute(tag === "circle" ? "r" : "ry") || 0); + if (rx <= 0 || ry <= 0) continue; + const points = Array.from({ length: 128 }, (_, index) => { + const angle = index * Math.PI * 2 / 128; + return map([cx + rx * Math.cos(angle), cy + ry * Math.sin(angle)]); + }); + const entry = { el, kind: "round", points, cx, cy, rx, ry, filled }; + const xs = points.map(([x]) => x); + const ys = points.map(([, y]) => y); + for (let gx = Math.floor(Math.min(...xs) / cell); gx <= Math.floor(Math.max(...xs) / cell); gx++) for (let gy = Math.floor(Math.min(...ys) / cell); gy <= Math.floor(Math.max(...ys) / cell); gy++) add(gx, gy, entry); + continue; + } + if (!stroked) continue; + const owner = el.closest("svg"); + const viewCtm = owner && owner.getScreenCTM(); + if (viewCtm) scale = Math.hypot(viewCtm.a, viewCtm.b) || scale; + const curveTolerance = 0.15 / Math.max(1, Math.hypot(ctm.a, ctm.b, ctm.c, ctm.d)); + const subpaths = geometryOf(el, curveTolerance).map((sub, index) => ({ ...sub, index, flat: sub.points.map(map) })); + subpaths.forEach((sub) => { + for (let i = 0; i < sub.flat.length - 1; i++) { + const a = sub.flat[i]; + const b = sub.flat[i + 1]; + const entry = { el, kind: "segment", a, b, sub: sub.index, i }; + for (let gx = Math.floor(Math.min(a[0], b[0]) / cell); gx <= Math.floor(Math.max(a[0], b[0]) / cell); gx++) for (let gy = Math.floor(Math.min(a[1], b[1]) / cell); gy <= Math.floor(Math.max(a[1], b[1]) / cell); gy++) add(gx, gy, entry); + } + }); + const checked = el.classList.contains("iso-line") && !skipClass.some((name) => el.classList.contains(name)) && alpha >= least; + if (checked) lines.push({ el, subpaths, alpha, free: el.getAttribute("data-free") }); + } + const near = (p, reach) => { + const out = new Set(); + for (let gx = Math.floor((p[0] - reach) / cell); gx <= Math.floor((p[0] + reach) / cell); gx++) for (let gy = Math.floor((p[1] - reach) / cell); gy <= Math.floor((p[1] + reach) / cell); gy++) for (const entry of grid.get(`${gx},${gy}`) || []) out.add(entry); + return out; + }; + const segmentDistance = (p, a, b) => { + const dx = b[0] - a[0]; + const dy = b[1] - a[1]; + const span = dx * dx + dy * dy; + const t = span > 0 ? Math.max(0, Math.min(1, ((p[0] - a[0]) * dx + (p[1] - a[1]) * dy) / span)) : 0; + return Math.hypot(p[0] - a[0] - dx * t, p[1] - a[1] - dy * t); + }; + const lengthOf = (flat) => flat.reduce((sum, p, i) => (i ? sum + Math.hypot(p[0] - flat[i - 1][0], p[1] - flat[i - 1][1]) : 0), 0); + const hidden = (el, p) => { + const stack = document.elementsFromPoint(p[0], p[1]); + const at = stack.indexOf(el); + const above = at < 0 ? stack : stack.slice(0, at); + return above.some((node) => { + if (!(node instanceof SVGGeometryElement) || node.contains(el)) return false; + const cs = getComputedStyle(node); + return cs.fill !== "none" && Number(cs.fillOpacity) * opacityOf(node) >= cover && node.isPointInFill(new DOMPoint(...inverse(node, p))); + }); + }; + const inverse = (node, p) => { + const m = node.getScreenCTM().inverse(); + return [m.a * p[0] + m.c * p[1] + m.e, m.b * p[0] + m.d * p[1] + m.f]; + }; + const clearance = (line, sub, end, p, reach) => { + let best = Infinity; + const own = sub.flat; + const skipNear = 2 * reach; + const along = [0]; + for (let i = 1; i < own.length; i++) along.push(along[i - 1] + Math.hypot(own[i][0] - own[i - 1][0], own[i][1] - own[i - 1][1])); + const total = along[along.length - 1]; + for (const entry of near(p, reach * 4)) { + if (entry.kind === "round") { + const local = inverse(entry.el, p); + const inside = ((local[0] - entry.cx) / entry.rx) ** 2 + ((local[1] - entry.cy) / entry.ry) ** 2 <= 1; + if (entry.filled && inside) best = 0; + else for (let index = 0; index < entry.points.length; index++) best = Math.min(best, segmentDistance(p, entry.points[index], entry.points[(index + 1) % entry.points.length])); + continue; + } + if (entry.el === line.el && entry.sub === sub.index) { + const from = along[entry.i]; + const to = along[entry.i + 1]; + const gapFrom = end === "start" ? from : total - to; + if (gapFrom < skipNear) continue; + } + best = Math.min(best, segmentDistance(p, entry.a, entry.b)); + } + return best; + }; + const describe = (el) => { + const item = el.closest("[data-part], [data-name], [data-item], .it"); + const tag = item && item !== el ? (item.getAttribute("data-part") || item.getAttribute("data-name") || item.getAttribute("data-item") || `it k ${item.getAttribute("data-k") || ""}`) : ""; + return `${el.getAttribute("class")}${el.getAttribute("data-tone") ? ` ${el.getAttribute("data-tone")}` : ""}${tag ? ` in ${tag}` : ""}`; + }; + const problems = []; + let ends = 0; + const slack = tolerance * scale; + const rooted = rootSlack * scale; + for (const line of lines) { + for (const sub of line.subpaths) { + if (sub.closed || sub.flat.length < 2) continue; + const first = sub.flat[0]; + const last = sub.flat[sub.flat.length - 1]; + if (Math.hypot(first[0] - last[0], first[1] - last[1]) < 0.05 * scale) continue; + const length = lengthOf(sub.flat); + if (length < 0.2 * scale) continue; + const result = {}; + for (const [end, p] of [["start", first], ["end", last]]) { + if (line.free === "" || line.free === "both" || line.free === end) { + result[end] = 0; + continue; + } + ends++; + result[end] = hidden(line.el, p) ? 0 : clearance(line, sub, end, p, Math.max(slack, rooted)); + } + const straight = sub.flat.length === 2 || sub.flat.every((q) => segmentDistance(q, first, last) < 0.15 * scale); + const isMark = straight && length <= mark * scale; + const fail = (end) => result[end] !== undefined && result[end] > slack; + let bad = []; + if (isMark) { + const best = Math.min(result.start ?? Infinity, result.end ?? Infinity); + if (!(best <= rooted)) bad = ["start", "end"].filter((end) => result[end] !== undefined && result[end] > 0); + } else bad = ["start", "end"].filter(fail); + for (const end of bad) { + const p = end === "start" ? first : last; + problems.push({ what: describe(line.el), d: (line.el.getAttribute("d") || "").slice(0, 36), end, mark: isMark, gap: result[end] / scale, at: [Math.round((p[0] - box.left) * 10) / 10, Math.round((p[1] - box.top) * 10) / 10], client: p, opacity: Math.round(line.alpha * 100) / 100, length: Math.round((length / scale) * 10) / 10 }); + } + } + } + style.remove(); + problems.sort((a, b) => b.gap - a.gap); + if (show) { + const ns = "http://www.w3.org/2000/svg"; + const overlay = document.createElementNS(ns, "svg"); + overlay.setAttribute("data-line-ends", ""); + overlay.setAttribute("style", `position:fixed;left:0;top:0;width:${innerWidth}px;height:${innerHeight}px;pointer-events:none;z-index:2147483647;overflow:visible`); + for (const problem of problems) { + const ring = document.createElementNS(ns, "circle"); + ring.setAttribute("cx", problem.client[0]); + ring.setAttribute("cy", problem.client[1]); + ring.setAttribute("r", 5); + ring.setAttribute("style", "fill:none;stroke:#ff0050;stroke-width:1.5"); + overlay.append(ring); + } + document.body.append(overlay); + } + return { ends, lines: lines.length, problems: problems.map(({ client, ...rest }) => rest) }; +} + +export const LINE_ENDS = lineEnds.toString(); diff --git a/skills/anatomy/scripts/lines-arcs.test.mjs b/skills/anatomy/scripts/lines-arcs.test.mjs new file mode 100644 index 0000000..1092519 --- /dev/null +++ b/skills/anatomy/scripts/lines-arcs.test.mjs @@ -0,0 +1,50 @@ +import assert from "node:assert/strict"; +import { execFile } from "node:child_process"; +import { mkdtemp, rm, writeFile } from "node:fs/promises"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +import { promisify } from "node:util"; +import { fileURLToPath } from "node:url"; +import test from "node:test"; + +const execute = promisify(execFile); +const lines = fileURLToPath(new URL("lines.mjs", import.meta.url)); + +async function check(arc, line) { + const directory = await mkdtemp(join(tmpdir(), "anatomy-lines-arcs-")); + try { + const page = join(directory, "figure.html"); + await writeFile(page, `
`); + try { + return { code: 0, ...await execute(process.execPath, [lines, page, "--wait", "0"], { timeout: 30000 }) }; + } catch (error) { + return { code: error.code, stdout: error.stdout, stderr: error.stderr }; + } + } finally { + await rm(directory, { recursive: true, force: true }); + } +} + +test("the empty chord of an arc does not root a line", async () => { + const result = await check("M20 50A30 30 0 0 1 80 50", "M50 50L50 70"); + assert.equal(result.code, 1); + assert.match(result.stdout, /line ends: 2 of 2/); +}); + +test("the actual middle of an arc roots a line", async () => { + const result = await check("M20 50A30 30 0 0 1 80 50", "M50 20L50 0"); + assert.equal(result.code, 1); + assert.match(result.stdout, /line ends: 1 of 2/); +}); + +test("relative arcs retain their endpoint and curvature", async () => { + const result = await check("M20 50a30 30 0 0 1 60 0", "M50 20L50 0"); + assert.equal(result.code, 1); + assert.match(result.stdout, /line ends: 1 of 2/); +}); + +test("arc endpoints preserve fully rooted lines", async () => { + const result = await check("M20 50A30 30 0 0 1 80 50", "M20 50L80 50"); + assert.equal(result.code, 0); + assert.match(result.stdout, /line ends: 0/); +}); diff --git a/skills/anatomy/scripts/lines-bezier.test.mjs b/skills/anatomy/scripts/lines-bezier.test.mjs new file mode 100644 index 0000000..55ff583 --- /dev/null +++ b/skills/anatomy/scripts/lines-bezier.test.mjs @@ -0,0 +1,28 @@ +import assert from "node:assert/strict"; +import { execFile } from "node:child_process"; +import { mkdtemp, rm, writeFile } from "node:fs/promises"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +import { promisify } from "node:util"; +import test from "node:test"; + +const execute = promisify(execFile); +for (const [name, path, x, y] of [ + ["quadratic then smooth cubic", "M20 60 Q40 20 60 60 S80 100 100 60", 72.5, 75], + ["cubic then smooth quadratic", "M20 60 C30 20 50 20 60 60 T100 60", 80, 60], + ["matching cubic continuation", "M20 60 C30 20 50 20 60 60 S80 100 100 60", 76.25, 90], + ["matching quadratic continuation", "M20 60 Q40 20 60 60 T100 60", 80, 80], +]) test(`native SVG ${name} roots a line on the actual curve`, async () => { + const directory = await mkdtemp(join(tmpdir(), "anatomy-bezier-control-")); + try { + const file = join(directory, "figure.html"); + await writeFile(file, `
`); + const actions = JSON.stringify([["eval", `document.querySelector('#curve').isPointInStroke(new DOMPoint(${x},${y}))`], ["lines"]]); + let result; + try { result = { code: 0, ...await execute(process.execPath, ["scripts/drive.mjs", file, actions], { timeout: 30000 }) }; } + catch (error) { result = { code: error.code, stdout: error.stdout, stderr: error.stderr }; } + assert.match(result.stdout, /eval: true/); + assert.equal(result.code, 0); + assert.match(result.stdout, /line ends: 0 of 1/); + } finally { await rm(directory, { recursive: true, force: true }); } +}); diff --git a/skills/anatomy/scripts/lines-round.test.mjs b/skills/anatomy/scripts/lines-round.test.mjs new file mode 100644 index 0000000..d451a5f --- /dev/null +++ b/skills/anatomy/scripts/lines-round.test.mjs @@ -0,0 +1,56 @@ +import assert from "node:assert/strict"; +import { execFile } from "node:child_process"; +import { mkdtemp, rm, writeFile } from "node:fs/promises"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +import { promisify } from "node:util"; +import { fileURLToPath } from "node:url"; +import test from "node:test"; + +const execute = promisify(execFile); +const lines = fileURLToPath(new URL("lines.mjs", import.meta.url)); + +async function check(shape, path) { + const directory = await mkdtemp(join(tmpdir(), "anatomy-lines-round-")); + try { + const page = join(directory, "figure.html"); + await writeFile(page, `
${shape}
`); + try { + return { code: 0, ...await execute(process.execPath, [lines, page, "--wait", "0"], { timeout: 30000 }) }; + } catch (error) { + return { code: error.code, stdout: error.stdout, stderr: error.stderr }; + } + } finally { + await rm(directory, { recursive: true, force: true }); + } +} + +test("line ends above a flat ellipse are floating", async () => { + const result = await check('', "M30 30L50 30"); + assert.equal(result.code, 1); + assert.match(result.stdout, /line ends: 2 of 2/); +}); + +test("line ends inside an unfilled circle are floating", async () => { + const result = await check('', "M30 50L50 50"); + assert.equal(result.code, 1); + assert.match(result.stdout, /line ends: 2 of 2/); +}); + +test("line ends on ellipse rims remain rooted", async () => { + const result = await check('', "M10 50L90 50"); + assert.equal(result.code, 0); + assert.match(result.stdout, /line ends: 0/); +}); + +test("a nonuniformly scaled circle does not root nearby floating ends", async () => { + const result = await check('', "M30 20L50 20"); + assert.equal(result.code, 1); + assert.match(result.stdout, /line ends: 2 of 2/); +}); + +test("line ends inside a filled ellipse remain rooted", async () => { + const result = await check('', "M30 50L50 50"); + assert.equal(result.code, 0); + assert.match(result.stdout, /line ends: 0/); +}); diff --git a/skills/anatomy/scripts/lines-rounded-rect.test.mjs b/skills/anatomy/scripts/lines-rounded-rect.test.mjs new file mode 100644 index 0000000..7fd1df4 --- /dev/null +++ b/skills/anatomy/scripts/lines-rounded-rect.test.mjs @@ -0,0 +1,32 @@ +import assert from "node:assert/strict"; +import { execFile } from "node:child_process"; +import { mkdtemp, rm, writeFile } from "node:fs/promises"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +import { promisify } from "node:util"; +import test from "node:test"; + +const execute = promisify(execFile); +for (const [name, attributes, x, y, rooted, transform = ""] of [ + ["rounded cutaway rejects square-corner attachment", 'width="100" height="80" rx="30"', 0, 0, false], + ["rounded curve accepts its native attachment", 'width="100" height="80" rx="30"', 8.78679656440357, 8.786796564403573, true], + ["elliptical corner accepts its native attachment", 'width="100" height="80" rx="30" ry="10"', 4.019237886466836, 5, true], + ["missing horizontal radius follows vertical radius", 'width="100" height="80" ry="20"', 5.857864376269049, 5.857864376269051, true], + ["oversized radii clamp independently", 'width="100" height="80" rx="200" ry="200"', 14.644660940672622, 11.715728752538102, true], + ["affine corner preserves transformed attachment", 'width="100" height="80" rx="30"', 8.78679656440357, 8.786796564403573, true, "matrix(2 .2 .4 1 50 50)"], + ["ordinary square retains its original attachment", 'width="100" height="80"', 0, 0, true], + ["explicit zero radius remains square", 'width="100" height="80" rx="0" ry="30"', 0, 0, true], +]) test(name, async () => { + const directory = await mkdtemp(join(tmpdir(), "anatomy-rounded-rect-lines-")); + try { + const file = join(directory, "figure.html"); + await writeFile(file, `
`); + const actions = JSON.stringify([["eval", `document.querySelector('#outline').isPointInStroke(new DOMPoint(${x},${y}))`], ["lines"]]); + let result; + try { result = { code: 0, ...await execute(process.execPath, ["scripts/drive.mjs", file, actions], { timeout: 30000 }) }; } + catch (error) { result = { code: error.code, stdout: error.stdout, stderr: error.stderr }; } + assert.match(result.stdout, new RegExp(`eval: ${rooted}`)); + assert.equal(result.code, rooted ? 0 : 1, result.stderr); + assert.match(result.stdout, new RegExp(`line ends: ${rooted ? 0 : 1} of 1`)); + } finally { await rm(directory, { recursive: true, force: true }); } +}); diff --git a/skills/anatomy/scripts/lines.mjs b/skills/anatomy/scripts/lines.mjs new file mode 100644 index 0000000..c95e143 --- /dev/null +++ b/skills/anatomy/scripts/lines.mjs @@ -0,0 +1,31 @@ +import { spawn } from "node:child_process"; +import { dirname, join } from "node:path"; +import { fileURLToPath } from "node:url"; + +const argv = process.argv.slice(2); +if (!argv.length || argv.includes("--help") || argv.includes("-h")) { + console.log(`Check that every texture line in a figure ends on something. + + node lines.mjs [--out marks.png] [--tolerance 1] [--select css] [--wait 1500] [drive.mjs flags] + +Every open subpath of every .iso-line (seams, grooves, ribs, rule lines, ticks, needles) must end on another stroke, +a dot or an outline within the tolerance (viewBox px), or under a fill painted after it. A short straight mark (a tick) +needs one rooted end. Outlines, creases, bevels and tube edges are the kit's own and are not checked. Lines drawn with +fadeLineSvg ramp out and pass; lineSvg(d, { free: true | "start" | "end" }) marks an end that is meant to stop (a needle +tip, rule lines standing for printed text). Exits 1 if any end floats; --out writes the card with each one ringed.`); + process.exit(argv.length ? 0 : 1); +} +const take = (flag, fallback) => { + const at = argv.indexOf(flag); + if (at < 0) return fallback; + const value = argv[at + 1]; + argv.splice(at, 2); + return value; +}; +const out = take("--out", null); +const tolerance = Number(take("--tolerance", 1)); +const select = take("--select", null); +const wait = Number(take("--wait", 1500)); +const actions = JSON.stringify([["wait", wait], ["lines", out, select, { tolerance }]]); +const child = spawn(process.execPath, [join(dirname(fileURLToPath(import.meta.url)), "drive.mjs"), argv[0], actions, ...argv.slice(1)], { stdio: "inherit" }); +child.on("exit", (code) => process.exit(code ?? 1)); diff --git a/skills/anatomy/scripts/lines.test.mjs b/skills/anatomy/scripts/lines.test.mjs new file mode 100644 index 0000000..934529d --- /dev/null +++ b/skills/anatomy/scripts/lines.test.mjs @@ -0,0 +1,38 @@ +import assert from "node:assert/strict"; +import { execFile } from "node:child_process"; +import { mkdtemp, rm, writeFile } from "node:fs/promises"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +import { promisify } from "node:util"; +import { fileURLToPath } from "node:url"; +import test from "node:test"; + +const execute = promisify(execFile); +const lines = fileURLToPath(new URL("lines.mjs", import.meta.url)); + +async function check(path) { + const directory = await mkdtemp(join(tmpdir(), "anatomy-lines-")); + try { + const page = join(directory, "figure.html"); + await writeFile(page, ``); + try { + return { code: 0, ...await execute(process.execPath, [lines, page, "--select", "#figure", "--wait", "0"], { timeout: 30000 }) }; + } catch (error) { + return { code: error.code, stdout: error.stdout, stderr: error.stderr }; + } + } finally { + await rm(directory, { recursive: true, force: true }); + } +} + +test("a selected SVG checks its own floating lines", async () => { + const result = await check("M20 20L180 20"); + assert.equal(result.code, 1); + assert.match(result.stdout, /line ends: 2 of 2 ends on 1 lines float/); +}); + +test("a selected SVG preserves closed-path exemption", async () => { + const result = await check("M20 20L180 20L180 80L20 80Z"); + assert.equal(result.code, 0); + assert.match(result.stdout, /line ends: 0/); +}); diff --git a/skills/anatomy/scripts/navigation.test.mjs b/skills/anatomy/scripts/navigation.test.mjs new file mode 100644 index 0000000..506f043 --- /dev/null +++ b/skills/anatomy/scripts/navigation.test.mjs @@ -0,0 +1,55 @@ +import assert from "node:assert/strict"; +import { execFile } from "node:child_process"; +import { mkdtemp, rm, writeFile } from "node:fs/promises"; +import { createServer } from "node:net"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +import { promisify } from "node:util"; +import { fileURLToPath } from "node:url"; +import test from "node:test"; + +const execute = promisify(execFile); + +async function run(name, kind) { + const directory = await mkdtemp(join(tmpdir(), "anatomy-navigation-")); + try { + let target = join(directory, "figure.html"); + if (kind === "valid") await writeFile(target, '
Figure
'); + if (kind === "refused") { + const server = createServer(); + await new Promise((resolve) => server.listen(0, "127.0.0.1", resolve)); + target = `http://127.0.0.1:${server.address().port}/`; + await new Promise((resolve) => server.close(resolve)); + } + const args = [fileURLToPath(new URL(`${name}.mjs`, import.meta.url)), target, ...(name === "capture" ? ["--out", join(directory, "shot.png"), "--wait", "0"] : ["[]"])]; + try { + return { code: 0, ...await execute(process.execPath, args, { timeout: 30000 }) }; + } catch (error) { + return { code: error.code, stdout: error.stdout, stderr: error.stderr }; + } + } finally { + await rm(directory, { recursive: true, force: true }); + } +} + +for (const name of ["capture", "drive"]) { + test(`${name} fails a missing local page`, async () => { + const result = await run(name, "missing"); + assert.equal(result.code, 1); + assert.match(result.stderr, /Navigation failed.*ERR_FILE_NOT_FOUND/); + assert.doesNotMatch(result.stdout, /console: clean/); + }); + + test(`${name} fails refused HTTP navigation`, async () => { + const result = await run(name, "refused"); + assert.equal(result.code, 1); + assert.match(result.stderr, /Navigation failed.*ERR_CONNECTION_REFUSED/); + assert.doesNotMatch(result.stdout, /console: clean/); + }); + + test(`${name} preserves successful local navigation`, async () => { + const result = await run(name, "valid"); + assert.equal(result.code, 0); + assert.match(result.stdout, /console: clean/); + }); +} diff --git a/skills/anatomy/scripts/orbit-sampling.test.mjs b/skills/anatomy/scripts/orbit-sampling.test.mjs new file mode 100644 index 0000000..33af2cd --- /dev/null +++ b/skills/anatomy/scripts/orbit-sampling.test.mjs @@ -0,0 +1,50 @@ +import assert from "node:assert/strict"; +import { execFile } from "node:child_process"; +import { mkdtemp, rm, writeFile } from "node:fs/promises"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +import { promisify } from "node:util"; +import test from "node:test"; + +const execute = promisify(execFile); +const page = "examples/turning-dial/turning-dial-verify-light.html"; +async function run(args) { + try { return { code: 0, ...await execute(process.execPath, ["scripts/turn-check.mjs", page, ...args], { timeout: 60000 }) }; } + catch (error) { return { code: error.code, stdout: error.stdout, stderr: error.stderr }; } +} +for (const step of ["NaN", "Infinity", "-1", "721"]) + test(`rejects orbit step ${step} instead of passing an empty sweep`, async () => { + const result = await run(["--order", "--step", step]); + assert.equal(result.code, 1); + assert.match(result.stderr, /--step must be a finite number/); + assert.doesNotMatch(result.stdout, /turn check passed/); + }); +test("rejects an empty explicit pose list instead of auditing zero states", async () => { + const directory = await mkdtemp(join(tmpdir(), "anatomy-orbit-states-")); + try { + const file = join(directory, "states.json"); await writeFile(file, "[]"); + const result = await run(["--order", "--states", file]); + assert.equal(result.code, 1); assert.match(result.stderr, /nonempty JSON list/); + assert.doesNotMatch(result.stdout, /turn check passed/); + } finally { await rm(directory, { recursive: true, force: true }); } +}); +test("rejects a nonfinite fine step instead of silently skipping the second difference", async () => { + const result = await run(["--pops", "--step", "360", "--fine", "NaN"]); + assert.equal(result.code, 1); assert.match(result.stderr, /--fine must be a finite number/); + assert.doesNotMatch(result.stdout, /turn check passed/); +}); +test("preserves a valid native orbit sweep and its planted control", async () => { + const result = await run(["--order", "--step", "360"]); + assert.equal(result.code, 0); assert.match(result.stdout, /order: 1 states/); + assert.match(result.stdout, /order control.*fails as it should/); assert.match(result.stdout, /turn check passed/); +}); + +test("preserves a nonempty explicit pose list and its planted control", async () => { + const directory = await mkdtemp(join(tmpdir(), "anatomy-orbit-states-")); + try { + const file = join(directory, "states.json"); await writeFile(file, "[0,90]"); + const result = await run(["--order", "--states", file]); + assert.equal(result.code, 0); assert.match(result.stdout, /order: 2 states/); + assert.match(result.stdout, /order control.*fails as it should/); assert.match(result.stdout, /turn check passed/); + } finally { await rm(directory, { recursive: true, force: true }); } +}); diff --git a/skills/anatomy/scripts/print-sheet.mjs b/skills/anatomy/scripts/print-sheet.mjs new file mode 100644 index 0000000..970fa67 --- /dev/null +++ b/skills/anatomy/scripts/print-sheet.mjs @@ -0,0 +1,466 @@ +export const PAPER = { + a4: { name: "A4", w: 210, h: 297, px: [794, 1123] }, + letter: { name: "Letter", w: 215.9, h: 279.4, px: [816, 1056] }, +}; + +export const FORMATS = ["poster", "drawing", "detailed"]; + +export const DIM = { hi: "#cdcdd1", mid: "#dddde0", lo: "#e9e9eb", dot: "#d2d2d6" }; +export const ON = { hi: "#000000", mid: "#2a2a2e", lo: "#707076", dot: "#000000" }; +export const TONES = ["hi", "mid", "lo", "dot"]; + +const MM = 96 / 25.4; +const MARGIN = 16; +const PIN_GAP = 4.4; + +const esc = (text) => String(text).replace(/&/g, "&").replace(//g, ">").replace(/"/g, """); +const round = (value) => Math.round(value * 10) / 10; +const two = (n) => String(n).padStart(2, "0"); +const LETTERS = "ABCDEFGH"; + +export function fitAspect([x, y, w, h], aspect) { + if (w / h < aspect) { + const grow = h * aspect - w; + return [x - grow / 2, y, w + grow, h].map(round); + } + const grow = w / aspect - h; + return [x, y - grow / 2, w, h + grow].map(round); +} + +export function pad([x, y, w, h], share) { + const p = Math.max(w, h) * share; + return [x - p, y - p, w + 2 * p, h + 2 * p].map(round); +} + +export function boxOf(view, ids, padBy = 0) { + const boxes = ids.map((id) => view.boxes?.[id]).filter(Boolean); + if (!boxes.length) throw new Error(`no boxes for ${ids.join(", ")}`); + const x0 = Math.min(...boxes.map((b) => b[0])) - padBy; + const y0 = Math.min(...boxes.map((b) => b[1])) - padBy; + const x1 = Math.max(...boxes.map((b) => b[2])) + padBy; + const y1 = Math.max(...boxes.map((b) => b[3])) + padBy; + return [x0, y0, x1 - x0, y1 - y0].map(round); +} + +export function frameOf(view) { + return view.raster ? view.raster.region : view.content ? pad(view.content, 0.02) : view.vb; +} + +export function focusCrop(view, ids, aspect, frame, least = 0.42) { + const box = pad(boxOf(view, ids), 0.18); + const minW = frame[2] * least; + const grown = box[2] < minW ? [box[0] - (minW - box[2]) / 2, box[1], minW, box[3]] : box; + const [x, y, w, h] = fitAspect(grown, aspect); + const cx = Math.max(frame[0], Math.min(frame[0] + frame[2] - w, x)); + const cy = Math.max(frame[1], Math.min(frame[1] + frame[3] - h, y)); + return [w > frame[2] ? x : cx, h > frame[3] ? y : cy, w, h].map(round); +} + +export function relax(pins, minGap, rounds = 80) { + const out = pins.map((pin) => ({ ...pin, pos: [...pin.at] })); + for (let round = 0; round < rounds; round++) { + let moved = false; + for (let i = 0; i < out.length; i++) { + for (let j = i + 1; j < out.length; j++) { + const a = out[i].pos; + const b = out[j].pos; + let dx = b[0] - a[0]; + let dy = b[1] - a[1]; + let d = Math.hypot(dx, dy); + if (d >= minGap) continue; + if (d < 1e-6) { + dx = Math.cos(i + j); + dy = Math.sin(i + j); + d = 1; + } + const push = (minGap - d) / 2 + 1e-3; + a[0] -= (dx / d) * push; + a[1] -= (dy / d) * push; + b[0] += (dx / d) * push; + b[1] += (dy / d) * push; + moved = true; + } + } + if (!moved) break; + } + return out; +} + +export function layerTable(views) { + const ids = new Map(); + const defs = []; + const refs = {}; + for (const [name, view] of Object.entries(views)) { + refs[name] = (view.layers ?? []).map((html) => { + if (!ids.has(html)) { + const id = `pl${ids.size}`; + ids.set(html, id); + defs.push(`${html}`); + } + return ids.get(html); + }); + } + return { defs: defs.join(""), refs }; +} + +function useStyle({ focus, hide }) { + let style = ""; + if (focus?.length) { + style += TONES.map((tone) => `--anatomy-${tone}:${DIM[tone]};--part-${tone}:${DIM[tone]}`).join(";") + ";"; + style += focus.map((id) => TONES.map((tone) => `--on-${id}-${tone}:${ON[tone]}`).join(";")).join(";") + ";"; + } + if (hide?.length) style += hide.map((id) => `--show-${id}:none`).join(";") + ";"; + return style; +} + +export function figure(ctx, use, { crop, widthMm, pins = [], marks = [], weight }) { + const view = ctx.views[use.view]; + if (!view) throw new Error(`no captured view "${use.view}"`); + const [x, y, w, h] = crop ?? frameOf(view); + const perMm = w / widthMm; + const lineWeight = weight ?? Math.max(0.32, Math.min(0.6, ((widthMm * MM) / w) * 0.9)); + let art; + if (view.raster) { + const [rx, ry, rw, rh] = view.raster.region; + art = ``; + } else { + const layers = use.layers ?? ctx.refs[use.view].map((_, index) => index); + const style = useStyle(use); + art = layers.map((index) => ``).join(""); + } + const placed = relax(pins, PIN_GAP * perMm); + const leaders = placed + .filter((pin) => Math.hypot(pin.pos[0] - pin.at[0], pin.pos[1] - pin.at[1]) > 1.6 * perMm) + .map((pin) => ``) + .join(""); + const markSvg = marks + .map((mark) => ``) + .join(""); + const overlay = leaders || markSvg ? `${markSvg}${leaders}` : ""; + const pct = (px, py) => `left:${round(((px - x) / w) * 100)}%;top:${round(((py - y) / h) * 100)}%`; + const pinHtml = placed.map((pin) => `${pin.n}`).join(""); + const markHtml = marks.map((mark) => `${mark.label}`).join(""); + return `
${art}${overlay}${pinHtml}${markHtml}
`; +} + +function mainOf(ctx) { + const main = ctx.spec.main; + const view = ctx.views[main.view]; + if (!view) throw new Error(`no captured view "${main.view}"`); + return { main, view, crop: main.crop ?? frameOf(view) }; +} + +function pinsOf(ctx, view) { + return ctx.parts.map((part, index) => ({ n: index + 1, at: part.at ?? view.anchors?.[part.id] })).filter((pin) => pin.at); +} + +function detailsOf(ctx) { + return (ctx.spec.details ?? []).map((detail, index) => { + const view = ctx.views[detail.view ?? ctx.spec.main.view]; + const crop = detail.crop ?? fitAspect(pad(boxOf(view, detail.around), 0.14), 1); + return { ...detail, view: detail.view ?? ctx.spec.main.view, crop, label: LETTERS[index] }; + }); +} + +function numbersHtml(spec, cls = "ps-num") { + return (spec.numbers ?? []).map(([n, unit, label]) => `
${esc(n)}${esc(unit)}${esc(label)}
`).join(""); +} + +function legendHtml(ctx) { + return ctx.parts.map((part, index) => `
  • ${two(index + 1)}
    ${esc(part.name)}${part.say ? `${esc(part.say)}` : ""}
  • `).join(""); +} + +const BASE_CSS = (paper) => ` +@page{size:${paper.w}mm ${paper.h}mm;margin:0} +*{box-sizing:border-box} +html,body{margin:0;padding:0;background:#e9e9e6} +body{-webkit-print-color-adjust:exact;print-color-adjust:exact} +.iso[data-theme="light"]{--anatomy-paper:#ffffff;--anatomy-card:#ffffff;--anatomy-face:#ffffff} +.ps{width:${paper.w}mm;height:${paper.h}mm;margin:0 auto;background:#fff;overflow:hidden;color:#151517;padding:${MARGIN}mm ${MARGIN}mm 12mm;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;break-after:page;position:relative} +.ps:last-of-type{break-after:auto} +@media screen{html:not(.ps-bare) .ps{margin:10mm auto;box-shadow:0 1px 2px #0002,0 8px 30px #0001}html.ps-bare,html.ps-bare body{background:#fff}} +@media print{html,body{background:#fff}.ps{margin:0;box-shadow:none}} +.ps-fig{position:relative;width:100%} +.ps-fig>svg{position:absolute;inset:0;width:100%;height:100%;overflow:hidden;display:block} +.ps-fig>svg.ps-over{overflow:visible;pointer-events:none} +.ps-over line{stroke:#151517;stroke-width:.5px;vector-effect:non-scaling-stroke} +.ps-over circle{fill:#151517} +.ps-over .ps-mark{fill:none;stroke:#151517;stroke-width:.6px;stroke-dasharray:2 2;vector-effect:non-scaling-stroke} +.ps-pin{position:absolute;transform:translate(-50%,-50%);width:3.6mm;height:3.6mm;border-radius:50%;background:#151517;color:#fff;display:grid;place-items:center;font:500 6pt/1 "Helvetica Neue",Helvetica,Arial,sans-serif;font-variant-numeric:tabular-nums;box-shadow:0 0 0 .4mm #fff} +.ps-letter{background:#fff;color:#151517;box-shadow:0 0 0 .2mm #151517} +.ps-mono{font:400 6pt/1.5 Menlo,ui-monospace,monospace;letter-spacing:.1em;text-transform:uppercase;color:#8a8a8f} +.ps-fit{min-height:0;container-type:size} +.ps-fit>.ps-fig{width:min(100cqw,calc(100cqh * var(--ps-aspect)))} +.ps-ft{display:flex;justify-content:space-between;gap:6mm} +`; + +function posterPage(ctx, paper) { + const { spec } = ctx; + const { main, view, crop } = mainOf(ctx); + const figW = 112; + const css = ` +.pp{display:grid;grid-template-columns:54mm 1fr;grid-template-rows:auto minmax(0,1fr) auto auto;column-gap:8mm} +.pp-mast{grid-column:1/-1;display:flex;align-items:flex-end;justify-content:space-between;gap:6mm} +.pp-mast h1{margin:0;font-size:52pt;line-height:.86;font-weight:500;letter-spacing:-.045em} +.pp-mast .ps-mono{text-align:right} +.pp-side{padding-top:10mm;display:flex;flex-direction:column} +.pp-q{font-size:12pt;line-height:1.15;font-weight:500;letter-spacing:-.01em;margin:0 0 3mm} +.pp-lead{font-size:7.8pt;line-height:1.5;margin:0 0 9mm;color:#55555b} +.ps-num{padding:2.6mm 0;border-top:.15mm solid #d4d4d6} +.ps-num:last-child{border-bottom:.15mm solid #d4d4d6} +.ps-num b{display:block;font-size:17pt;line-height:1;letter-spacing:-.03em;font-weight:500} +.ps-num small{font-size:7.5pt;font-weight:400;margin-left:.8mm;letter-spacing:0;color:#55555b} +.ps-num span{display:block;margin-top:1mm;font:400 5.8pt/1.3 Menlo,ui-monospace,monospace;letter-spacing:.08em;text-transform:uppercase;color:#8a8a8f} +.pp-art{padding-top:6mm;display:flex;justify-content:center;align-items:flex-start} +.pp-art>div{width:100%;height:100%} +.pp-legend{grid-column:1/-1;margin:4mm 0 0;padding:5mm 0 0;border-top:.15mm solid #151517;list-style:none;columns:3;column-gap:6mm} +.pp-legend li{break-inside:avoid;display:grid;grid-template-columns:6mm 1fr;margin-bottom:2.4mm} +.pp-legend li>span{font:400 6.2pt/1.5 Menlo,ui-monospace,monospace;color:#8a8a8f} +.pp-legend b{display:block;font-size:7.2pt;font-weight:500;line-height:1.3} +.pp-legend i{display:block;font-style:normal;font-size:6.6pt;line-height:1.35;color:#77777d} +.pp .ps-ft{grid-column:1/-1;margin-top:3mm} +.pp-wide{grid-template-columns:1fr 1fr;grid-template-rows:auto auto minmax(0,1fr) auto auto} +.pp-wide .pp-art{grid-column:1/-1;grid-row:2;padding-top:8mm;height:auto} +.pp-wide .pp-art>div{height:auto;container-type:normal}.pp-wide .pp-art .ps-fig{width:100%} +.pp-wide .pp-side{grid-column:1/-1;grid-row:3;padding-top:6mm;display:grid;grid-template-columns:1fr 1fr;column-gap:10mm;align-content:start} +.pp-wide .pp-side>div{display:grid;grid-template-columns:1fr 1fr;column-gap:6mm;align-content:start} +`; + const tags = [spec.number, "How it works", spec.tagline].filter(Boolean).map(esc).join("
    "); + const wide = crop[2] / crop[3] > 1.15; + const html = `
    +

    ${esc(spec.name)}

    ${tags}
    + +
    ${figure(ctx, main, { crop, widthMm: Math.min(figW, 190 * (crop[2] / crop[3])), pins: pinsOf(ctx, view) })}
    +
      ${legendHtml(ctx)}
    +
    Anatomy${esc(spec.quote ?? "")}${paper.name}
    +
    `; + return { css, html }; +} + +function drawingPage(ctx, paper) { + const { spec } = ctx; + const { main, view, crop } = mainOf(ctx); + const inner = paper.w - MARGIN * 2; + const mainW = 106; + const gap = 8; + const sideW = inner - mainW - gap; + const seqH = 34; + const steps = spec.steps ?? []; + const frameW = (inner - 5 * (steps.length - 1)) / Math.max(1, steps.length); + const aspect = frameW / seqH; + const list = ctx.parts.map((part, index) => `
  • ${two(index + 1)}${esc(part.name)}
  • `).join(""); + const rows = (spec.spec ?? []).map(([key, value]) => `
    ${esc(key)}
    ${esc(value)}
    `).join(""); + let inset = ""; + if (spec.inset) { + const insetView = ctx.views[spec.inset.view]; + const insetCrop = spec.inset.crop ?? frameOf(insetView); + const width = Math.min(sideW, 52 * (insetCrop[2] / insetCrop[3])); + inset = `
    ${esc(spec.inset.label)}
    ${figure(ctx, spec.inset, { crop: insetCrop, widthMm: width })}
    `; + } + const seq = steps + .map((step, index) => { + const stepView = ctx.views[step.view]; + const frame = step.frame ?? (stepView.raster ? stepView.raster.region : main.view === step.view ? crop : frameOf(stepView)); + const stepCrop = step.crop ?? (step.focus?.length && !stepView.raster ? focusCrop(stepView, step.focus, aspect, frame) : fitAspect(frame, aspect)); + return `
    ${figure(ctx, step, { crop: stepCrop, widthMm: frameW, weight: 0.42 })}

    ${two(index + 1)}${esc(step.title)}

    `; + }) + .join(""); + const css = ` +.pd{display:grid;grid-template-columns:${mainW}mm ${sideW}mm;grid-template-rows:auto minmax(0,1fr) auto auto;column-gap:${gap}mm} +.pd-hd{grid-column:1/-1;display:flex;justify-content:space-between;align-items:flex-end;gap:6mm;padding-bottom:5mm;border-bottom:.15mm solid #151517} +.pd-hd h1{margin:1.6mm 0 0;font-size:17pt;font-weight:500;letter-spacing:-.015em;line-height:1.1} +.pd-no{text-align:right;white-space:nowrap} +.pd-no b{display:block;font:500 17pt/1.1 "Helvetica Neue",Helvetica,Arial,sans-serif;letter-spacing:-.01em;color:#151517;text-transform:none;margin-top:1.6mm} +.pd-main{padding-top:7mm} +.pd-main>.ps-fit{width:100%;height:100%} +.pd-side{padding-top:7mm;display:flex;flex-direction:column;gap:7mm;min-height:0} +.pd-side ol{list-style:none;margin:2.4mm 0 0;padding:0} +.pd-side li{display:grid;grid-template-columns:6mm 1fr;font-size:7.2pt;line-height:1.25;padding:.9mm 0} +.pd-side li span{font:400 6.4pt/1.4 Menlo,ui-monospace,monospace;color:#8a8a8f} +.pd-side dl{margin:2.4mm 0 0} +.pd-side dl div{display:grid;grid-template-columns:18mm 1fr;font-size:7.2pt;padding:.9mm 0} +.pd-side dt{color:#8a8a8f}.pd-side dd{margin:0} +.pd-inset{margin-top:auto} +.pd-inset .ps-fig{margin-top:2mm} +.pd-seq{grid-column:1/-1;padding-top:5mm;border-top:.15mm solid #151517;display:grid;grid-template-columns:repeat(${Math.max(1, steps.length)},1fr);column-gap:5mm} +.pd-frame{height:${seqH}mm;display:grid;place-items:center;overflow:hidden} +.pd-step p{margin:1.8mm 0 0;font-size:7pt;line-height:1.3} +.pd-step p span{display:block;font:400 6pt/1.4 Menlo,ui-monospace,monospace;color:#8a8a8f;margin-bottom:.4mm} +.pd .ps-ft{grid-column:1/-1;margin-top:6mm} +`; + const html = `
    +
    ${esc(spec.kicker ?? "Explained drawing")}

    ${esc(spec.title ?? spec.name)}

    ${spec.number ? `
    Drawing${esc(spec.number)}
    ` : ""}
    +
    ${figure(ctx, main, { crop, widthMm: Math.min(mainW, 170 * (crop[2] / crop[3])), pins: pinsOf(ctx, view) })}
    +
    ${list ? `
    Parts
      ${list}
    ` : ""}${rows ? `
    Specification
    ${rows}
    ` : ""}${inset}
    +${steps.length ? `
    ${seq}
    ` : ""} +
    AnatomyNot to scale${paper.name} · 1 / 1
    +
    `; + return { css, html }; +} + +function detailedPages(ctx, paper) { + const { spec } = ctx; + const { main, view, crop } = mainOf(ctx); + const details = detailsOf(ctx); + const marks = details + .filter((detail) => detail.view === main.view && detail.around) + .map((detail) => { + const [bx, by, bw, bh] = boxOf(view, detail.around); + const only = detail.around.length === 1 ? ctx.parts.find((part) => part.id === detail.around[0]) : null; + const c = detail.mark ?? only?.at ?? (only && view.anchors?.[only.id]) ?? [bx + bw / 2, by + bh / 2]; + return { c, r: Math.min(Math.hypot(bw, bh) / 2 + 4, crop[2] * 0.13), label: detail.label }; + }); + const steps = spec.steps ?? []; + const thumb = 54; + const wideMain = crop[2] / crop[3] > 1.15; + const stepsHtml = steps + .map((step, index) => { + const stepView = ctx.views[step.view]; + const frame = step.frame ?? (stepView.raster ? stepView.raster.region : main.view === step.view ? crop : frameOf(stepView)); + const stepCrop = step.crop ?? (step.focus?.length && !stepView.raster ? focusCrop(stepView, step.focus, 1, frame, 0.36) : fitAspect(frame, 1)); + return `
    ${figure(ctx, step, { crop: stepCrop, widthMm: thumb, weight: 0.45 })}
    ${two(index + 1)}

    ${esc(step.title)}

    ${step.text ? `

    ${esc(step.text)}

    ` : ""}
    `; + }); + const detailHtml = details + .map((detail) => `
    ${figure(ctx, detail, { crop: detail.crop, widthMm: 30, weight: 0.55 })}
    ${detail.label}${esc(detail.title)}${detail.text ? `${esc(detail.text)}` : ""}
    `) + .join(""); + const rows = (spec.spec ?? []).map(([key, value]) => `
    ${esc(key)}
    ${esc(value)}
    `).join(""); + const tags = [spec.number, spec.tagline].filter(Boolean).map(esc).join("
    "); + const css = ` +.pe1{display:grid;grid-template-columns:1fr 62mm;grid-template-rows:auto minmax(0,1fr) auto;column-gap:8mm} +.pe-left{display:flex;flex-direction:column;min-height:0} +${wideMain ? ".pe-left>.pe-art{flex:0 0 auto}.pe-left>.pe-art>.ps-fit{height:auto;container-type:normal}.pe-left .ps-fig{width:100%}.pe-left .pe-sub{margin-top:8mm}" : ""} +.pe-left>.pe-art{flex:1;min-height:0} +.pe-mast{grid-column:1/-1;display:flex;align-items:flex-end;justify-content:space-between;gap:6mm;padding-bottom:5mm;border-bottom:.15mm solid #151517} +.pe-mast h1{margin:0;font-size:40pt;line-height:.9;font-weight:500;letter-spacing:-.04em} +.pe-mast .ps-mono{text-align:right} +.pe-art{padding-top:7mm} +.pe-art>.ps-fit{width:100%;height:100%} +.pe-side{padding-top:7mm;display:flex;flex-direction:column;min-height:0} +.pe-q{font-size:11pt;line-height:1.18;font-weight:500;letter-spacing:-.01em;margin:0 0 2.4mm} +.pe-lead{font-size:7.5pt;line-height:1.5;margin:0 0 5mm;color:#55555b} +.pe-nums{display:grid;grid-template-columns:1fr 1fr;column-gap:4mm;margin-bottom:6mm} +.pe-num{padding:2mm 0;border-top:.15mm solid #d4d4d6} +.pe-num b{display:block;font-size:13pt;line-height:1;letter-spacing:-.025em;font-weight:500} +.pe-num small{font-size:6.6pt;font-weight:400;margin-left:.6mm;color:#55555b;letter-spacing:0} +.pe-num span{display:block;margin-top:.8mm;font:400 5.4pt/1.3 Menlo,ui-monospace,monospace;letter-spacing:.07em;text-transform:uppercase;color:#8a8a8f} +.pe-legend{list-style:none;margin:2mm 0 0;padding:0} +.pe-legend li{display:grid;grid-template-columns:6mm 1fr;padding:1.1mm 0;border-top:.15mm solid #ececee} +.pe-legend li>span{font:400 6pt/1.5 Menlo,ui-monospace,monospace;color:#8a8a8f} +.pe-legend b{display:block;font-size:7pt;font-weight:500;line-height:1.3} +.pe-legend i{display:block;font-style:normal;font-size:6.4pt;line-height:1.35;color:#77777d} +.pe1 .ps-ft,.pe2 .ps-ft{grid-column:1/-1;margin-top:5mm} +.pe2{display:flex;flex-direction:column} +.pe-top{display:flex;justify-content:space-between;align-items:flex-end;padding-bottom:4mm;border-bottom:.15mm solid #151517} +.pe-top h2{margin:0;font-size:17pt;font-weight:500;letter-spacing:-.015em} +.pe-steps{display:grid;grid-template-columns:1fr 1fr;column-gap:8mm;row-gap:7mm;padding-top:7mm} +.pe-step{display:grid;grid-template-columns:${thumb}mm 1fr;column-gap:4mm;align-items:start} +.pe-thumb{width:${thumb}mm;height:${thumb}mm;display:grid;place-items:center;overflow:hidden;background:#f7f7f6;border-radius:1.4mm} +.pe-thumb .ps-fig{width:${thumb}mm} +.pe-n{font:400 6pt/1.4 Menlo,ui-monospace,monospace;color:#8a8a8f} +.pe-step h3{margin:.6mm 0 1.4mm;font-size:10pt;font-weight:500;letter-spacing:-.01em;line-height:1.2} +.pe-step p{margin:0;font-size:7.8pt;line-height:1.5;color:#3a3a40} +.pe-sub{margin-top:5mm;padding-top:3.4mm;border-top:.15mm solid #151517} +.pe-details{display:grid;grid-template-columns:repeat(${Math.max(1, details.length)},1fr);column-gap:5mm;margin-top:3mm} +.pe-detail{margin:0} +.pe-ring{width:30mm;height:30mm;border-radius:50%;overflow:hidden;box-shadow:0 0 0 .2mm #151517;display:grid;place-items:center;background:#fff} +.pe-ring .ps-fig{width:30mm} +.pe-detail figcaption{margin-top:2.4mm;position:relative;padding-left:5.6mm} +.pe-tag{position:absolute;left:1.8mm;top:2mm} +.pe-detail b{display:block;font-size:7.6pt;font-weight:500;line-height:1.3} +.pe-detail i{display:block;font-style:normal;font-size:6.8pt;line-height:1.4;color:#55555b;margin-top:.6mm} +.pe-end{margin-top:auto;display:grid;grid-template-columns:40mm 1fr;column-gap:8mm;padding-top:4mm;border-top:.15mm solid #151517} +.pe-why{align-self:center;padding:5mm;border-left:.15mm solid #151517} +.pe-why h4{margin:0 0 2mm} +.pe-why p{margin:0;font-size:8.4pt;line-height:1.5;color:#151517} +.pe-end dl{margin:0;columns:2;column-gap:8mm} +.pe-end dl div{display:grid;grid-template-columns:18mm 1fr;font-size:6.9pt;padding:.6mm 0;break-inside:avoid} +.pe-end dt{color:#8a8a8f}.pe-end dd{margin:0} +`; + const page1 = `
    +

    ${esc(spec.name)}

    ${tags}
    How it works · 1 / 2
    +
    ${figure(ctx, main, { crop, widthMm: Math.min(108, 165 * (crop[2] / crop[3])), pins: pinsOf(ctx, view), marks })}
    ${details.length ? `
    Close-ups
    ${detailHtml}
    ` : ""}
    + +
    Anatomy${esc(spec.quote ?? "")}${paper.name} · 1 / 2
    +
    `; + const plan = detailedPlan(spec); + const total = plan.total; + const why = spec.why ? `

    ${esc(spec.why.title)}

    ${esc(spec.why.text)}

    ` : ""; + const stepHtml = stepsHtml; + const pages = [page1]; + let at = 0; + for (let n = 0; n < plan.stepPages; n++) { + const pageNo = pages.length + 1; + const take = stepHtml.slice(at, at + STEPS_PER_PAGE); + at += take.length; + const last = n === plan.stepPages - 1; + pages.push(`
    +

    How it works${plan.stepPages > 1 ? ` ${n + 1} / ${plan.stepPages}` : ""}

    ${esc(spec.name)} · ${paper.name} · ${pageNo} / ${total}
    +
    ${take.join("")}${last ? why : ""}
    +${last && rows && !plan.assemblyPages ? `
    Specification
    ${rows}
    ` : ""} +
    AnatomyNot to scale${paper.name} · ${pageNo} / ${total}
    +
    `); + } + const assemblies = (spec.assemblies ?? []).slice(0, plan.assemblyPages * ASSEMBLIES_PER_PAGE); + for (let n = 0; n < plan.assemblyPages; n++) { + const pageNo = pages.length + 1; + const group = assemblies.slice(n * ASSEMBLIES_PER_PAGE, (n + 1) * ASSEMBLIES_PER_PAGE); + const cards = group + .map((a) => { + const v = ctx.views[a.view ?? main.view]; + const frame = v.raster ? v.raster.region : (a.view ?? main.view) === main.view ? crop : frameOf(v); + const c = a.crop ?? focusCrop(v, a.parts, 1, frame, 0.3); + const nums = a.parts.map((id) => ctx.parts.findIndex((part) => part.id === id) + 1).filter((x) => x > 0).sort((x, y) => x - y); + const pins = pinsOf(ctx, v).filter((pin) => nums.includes(pin.n)); + return `
    ${figure(ctx, { view: a.view ?? main.view, layers: a.layers ?? main.layers, hide: a.hide ?? main.hide, focus: a.parts }, { crop: c, widthMm: ASM_W, pins, weight: 0.5 })}

    ${esc(a.title)}

    ${a.text ? `

    ${esc(a.text)}

    ` : ""}${nums.length ? `
    Parts ${nums.map(two).join(" · ")}
    ` : ""}
    `; + }) + .join(""); + const last = n === plan.assemblyPages - 1; + pages.push(`
    +

    Assemblies

    ${esc(spec.name)} · ${paper.name} · ${pageNo} / ${total}
    +
    ${cards}
    +${last && rows ? `
    Specification
    ${rows}
    ` : ""} +
    AnatomyNot to scale${paper.name} · ${pageNo} / ${total}
    +
    `); + } + const extra = ` +.pe-cont{font:400 7pt/1 Menlo,ui-monospace,monospace;color:#8a8a8f;letter-spacing:.08em;margin-left:2mm;vertical-align:middle} +.pe-asms{display:grid;grid-template-columns:1fr 1fr;column-gap:8mm;row-gap:7mm;padding-top:7mm} +.pe-asm-art{width:${ASM_W}mm;height:${ASM_W}mm;display:grid;place-items:center;overflow:hidden;background:#f7f7f6;border-radius:1.4mm} +.pe-asm-art .ps-fig{width:${ASM_W}mm} +.pe-asm h3{margin:3mm 0 1.2mm;font-size:10pt;font-weight:500;letter-spacing:-.01em} +.pe-asm p{margin:0;font-size:7.6pt;line-height:1.5;color:#3a3a40} +.pe-asm-parts{margin-top:1.6mm} +.pe-asms+.pe-end{margin-top:6mm} +`; + return { css: css + extra, html: pages.join("").replace(/How it works · 1 \/ 2/, `How it works · 1 / ${total}`).replace(/()A4 · 1 \/ 2(<\/span>)/, `$1${paper.name} · 1 / ${total}$2`).replace(new RegExp(`${paper.name} · 1 / 2`, "g"), `${paper.name} · 1 / ${total}`) }; +} + +const STEPS_PER_PAGE = 6; +const ASSEMBLIES_PER_PAGE = 4; +const ASM_W = 80; + +export function detailedPlan(spec) { + const steps = (spec.steps ?? []).length; + const slots = steps + (spec.why ? 1 : 0); + const stepPages = Math.max(1, Math.ceil(slots / STEPS_PER_PAGE)); + let assemblyPages = Math.ceil((spec.assemblies ?? []).length / ASSEMBLIES_PER_PAGE); + const cap = Math.max(2, Math.min(4, spec.maxPages ?? 4)); + if (1 + stepPages > cap) throw new Error(`${steps} steps need ${1 + stepPages} pages, over maxPages ${cap}; cut steps`); + assemblyPages = Math.min(assemblyPages, cap - 1 - stepPages); + return { stepPages, assemblyPages, total: 1 + stepPages + assemblyPages }; +} + +const LAYOUTS = { poster: posterPage, drawing: drawingPage, detailed: detailedPages }; + +export function sheetHtml(capture, spec, paper = PAPER.a4, format = spec.format ?? "poster") { + const layout = LAYOUTS[format]; + if (!layout) throw new Error(`unknown format "${format}"; use one of ${FORMATS.join(", ")}`); + const { defs, refs } = layerTable(capture.views); + const ctx = { views: capture.views, refs, spec, parts: (spec.parts ?? []).filter((part) => part.name) }; + const { css, html } = layout(ctx, paper); + return `${esc(spec.title ?? spec.name)}${html}`; +} + +export function pagesOf(format, spec = {}) { + return format === "detailed" ? detailedPlan(spec).total : 1; +} diff --git a/skills/anatomy/scripts/print-sheet.test.mjs b/skills/anatomy/scripts/print-sheet.test.mjs new file mode 100644 index 0000000..d3abdb2 --- /dev/null +++ b/skills/anatomy/scripts/print-sheet.test.mjs @@ -0,0 +1,139 @@ +import { test } from "node:test"; +import assert from "node:assert/strict"; +import { FORMATS, PAPER, boxOf, detailedPlan, fitAspect, focusCrop, layerTable, pagesOf, relax, sheetHtml } from "./print-sheet.mjs"; +import { captureScript } from "./print.mjs"; + +const layer = (id) => ``; + +function fakeCapture() { + const view = { + vb: [0, 0, 400, 600], + content: [20, 20, 360, 560], + layers: [``, layer("pump") + layer("bell") + layer("frame")], + boxes: { pump: [100, 100, 180, 160], bell: [120, 300, 260, 520], frame: [0, 0, 400, 40] }, + anchors: { pump: [140, 130], bell: [190, 410], frame: [200, 20] }, + }; + return { + css: ".iso-line{stroke:#000}", + views: { + rest: view, + apart: { ...view, layers: [view.layers[0], layer("pump") + layer("bell")] }, + fire: { vb: [0, 0, 400, 600], layers: [], boxes: {}, anchors: {}, raster: { region: [50, 50, 300, 400], href: "data:image/png;base64,AAAA" } }, + }, + }; +} + +const SPEC = { + name: "Test engine", + title: "Test engine: how it works", + number: "AN-900", + tagline: "A test", + question: "How does it work?", + lead: "It pumps, then it burns.", + quote: "One line", + numbers: [["1", "x", "one"], ["2", "y", "two"]], + spec: [["Mass", "1 kg"]], + why: { title: "Why?", text: "Because." }, + parts: [ + { id: "pump", name: "Pump", say: "Raises the pressure." }, + { id: "bell", name: "Bell", say: "Turns pressure into speed." }, + { id: "frame" }, + ], + main: { view: "apart" }, + inset: { label: "Assembled", view: "rest" }, + steps: [ + { view: "apart", title: "Pump", text: "It pumps.", focus: ["pump"] }, + { view: "apart", title: "Bell", text: "It burns.", focus: ["bell"], hide: ["frame"] }, + { view: "fire", title: "Fire", text: "It fires." }, + ], + details: [{ title: "The pump", text: "Close up.", around: ["pump"], focus: ["pump"] }], +}; + +test("fitAspect keeps the box and reaches the aspect", () => { + for (const aspect of [0.5, 1, 2.4]) { + const [x, y, w, h] = fitAspect([10, 20, 100, 50], aspect); + assert.ok(Math.abs(w / h - aspect) < 0.01); + assert.ok(x <= 10 && y <= 20 && x + w >= 110 && y + h >= 70); + } +}); + +test("boxOf unions part boxes and throws on unknown parts", () => { + const view = fakeCapture().views.rest; + assert.deepEqual(boxOf(view, ["pump", "bell"]), [100, 100, 160, 420]); + assert.throws(() => boxOf(view, ["nope"]), /no boxes/); +}); + +test("focusCrop has the asked aspect and stays inside a larger frame", () => { + const view = fakeCapture().views.rest; + const frame = [0, 0, 400, 600]; + const [x, y, w, h] = focusCrop(view, ["pump"], 1, frame); + assert.ok(Math.abs(w / h - 1) < 0.01); + assert.ok(x >= 0 && y >= 0 && x + w <= 400.1 && y + h <= 600.1); + assert.ok(x <= 100 && x + w >= 180); +}); + +test("relax pushes pins apart to the gap and keeps distant pins still", () => { + const out = relax([{ n: 1, at: [0, 0] }, { n: 2, at: [1, 0] }, { n: 3, at: [1, 1] }, { n: 4, at: [100, 100] }], 10); + for (let i = 0; i < 3; i++) for (let j = i + 1; j < 3; j++) assert.ok(Math.hypot(out[i].pos[0] - out[j].pos[0], out[i].pos[1] - out[j].pos[1]) >= 9.99); + assert.deepEqual(out[3].pos, [100, 100]); +}); + +test("layerTable stores a layer shared by two views once", () => { + const { defs, refs } = layerTable(fakeCapture().views); + assert.equal(refs.rest[0], refs.apart[0]); + assert.notEqual(refs.rest[1], refs.apart[1]); + assert.equal((defs.match(/ { + for (const format of FORMATS) { + const html = sheetHtml(fakeCapture(), SPEC, PAPER.a4, format); + assert.equal((html.match(/
    (\d+) m[1]); + assert.deepEqual(pins, ["1", "2"], format); + assert.ok(html.includes("Pump") && html.includes("Bell")); + assert.ok(!/https?:\/\//.test(html.replace(/xmlns="http:\/\/www\.w3\.org\/2000\/svg"/g, "")), `${format} reaches outside the page`); + } +}); + +test("focus lights the asked parts, dims the rest and hide removes a part", () => { + const html = sheetHtml(fakeCapture(), SPEC, PAPER.a4, "drawing"); + assert.match(html, /--part-hi:#cdcdd1;[^"]*--on-pump-hi:#000000/); + assert.match(html, /--on-bell-hi:#000000;[^"]*--show-frame:none/); + assert.match(html, / { + const html = sheetHtml(fakeCapture(), SPEC, PAPER.a4, "detailed"); + assert.match(html, /class="ps-mark"/); + assert.match(html, /ps-letter[^>]*>A { + assert.match(sheetHtml(fakeCapture(), SPEC, PAPER.letter, "poster"), /@page\{size:215\.9mm 279\.4mm/); + assert.throws(() => sheetHtml(fakeCapture(), SPEC, PAPER.a4, "zine"), /unknown format/); +}); + +test("captureScript is one expression that carries the part selectors", () => { + const script = captureScript({ parts: [{ id: "pump", name: "Pump", select: '[data-name^="pump"]' }, { id: "x", name: "X" }], strip: [".glow"] }); + assert.doesNotThrow(() => new Function(`return ${script}`)); + assert.ok(script.includes('[data-name^=\\"pump\\"]')); + assert.ok(script.includes(".glow")); + assert.ok(!script.includes('"id":"x"')); +}); + +test("detailed grows from 2 to 4 pages with steps and assemblies, under a cap", () => { + const steps = (n) => Array.from({ length: n }, (_, i) => ({ title: `s${i}` })); + const asm = (n) => Array.from({ length: n }, (_, i) => ({ title: `a${i}`, parts: ["pump"] })); + assert.equal(detailedPlan({ steps: steps(5), why: { title: "w", text: "t" } }).total, 2); + assert.equal(detailedPlan({ steps: steps(5), assemblies: asm(4) }).total, 3); + assert.equal(detailedPlan({ steps: steps(9), assemblies: asm(4) }).total, 4); + assert.equal(detailedPlan({ steps: steps(9), assemblies: asm(8) }).total, 4); + assert.equal(detailedPlan({ steps: steps(5), assemblies: asm(4), maxPages: 2 }).total, 2); + assert.throws(() => detailedPlan({ steps: steps(19) }), /over maxPages/); + const html = sheetHtml(fakeCapture(), { ...SPEC, assemblies: [{ title: "Pump group", parts: ["pump"] }] }, PAPER.a4, "detailed"); + assert.equal((html.match(/
    [--format poster|drawing|detailed|all] [--letter] [--png] [--out name] + + sheet.mjs a module whose default export names the built page, the poses to capture, the parts and the text + (see references/print.md and examples/raptor-engine/sheet.mjs) + --format f poster (one page, big title, numbers and a legend; the default), drawing (one page, parts list, + specification and a strip of steps), detailed (two pages: the figure with every part, then the steps, + close-ups and the why), or all + --letter US Letter instead of A4 + --png also write a preview PNG of the sheet + --out name output base name (default: the spec's out, else the page name) + +Writes --a4.html and .pdf next to the spec.`); +} + +export function chromePath() { + const candidates = [ + process.env.CHROME_PATH, + "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome", + "/Applications/Chromium.app/Contents/MacOS/Chromium", + "/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary", + "/usr/bin/google-chrome", + "/usr/bin/google-chrome-stable", + "/usr/bin/chromium", + "/usr/bin/chromium-browser", + "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe", + "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe", + ...(process.env.LOCALAPPDATA ? [join(process.env.LOCALAPPDATA, "Google\\Chrome\\Application\\chrome.exe")] : []), + "C:\\Program Files\\Microsoft\\Edge\\Application\\msedge.exe", + "C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe", + ].filter(Boolean); + const playwright = join(homedir(), "Library/Caches/ms-playwright"); + if (existsSync(playwright)) { + for (const dir of readdirSync(playwright).sort().reverse()) { + for (const sub of ["chrome-mac-arm64/Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing", "chrome-mac/Chromium.app/Contents/MacOS/Chromium", "chrome-linux/chrome"]) { + candidates.push(join(playwright, dir, sub)); + } + } + } + const linux = join(homedir(), ".cache/ms-playwright"); + if (existsSync(linux)) for (const dir of readdirSync(linux).sort().reverse()) for (const sub of ["chrome-linux64/chrome", "chrome-linux/chrome"]) candidates.push(join(linux, dir, sub)); + return candidates.find((path) => existsSync(path)); +} + +export function captureScript(spec) { + const config = { + layers: spec.layers ?? ".iso-stage svg.iso-svg, .iso-plate svg.iso-svg", + strip: spec.strip ?? [], + parts: (spec.parts ?? []).filter((part) => part.select).map(({ id, select }) => ({ id, select })), + frame: spec.rasterSelector ?? ".iso-stage", + }; + return `(() => { + const C = ${JSON.stringify(config)}; + const TONES = ["hi", "mid", "lo", "dot"]; + const layers = [...document.querySelectorAll(C.layers)].filter((svg) => svg.viewBox && svg.viewBox.baseVal && svg.viewBox.baseVal.width); + if (!layers.length) return { __print: true, error: "no layers match " + C.layers }; + const base = layers[0]; + const vbox = base.viewBox.baseVal; + const rect = base.getBoundingClientRect(); + const k = vbox.width / rect.width; + const toVb = (b) => [vbox.x + (b.left - rect.left) * k, vbox.y + (b.top - rect.top) * k, vbox.x + (b.right - rect.left) * k, vbox.y + (b.bottom - rect.top) * k]; + const sets = C.parts.map((part) => ({ id: part.id, els: layers.map((svg) => [...svg.querySelectorAll(part.select)]) })); + const boxes = {}; + const anchors = {}; + for (const set of sets) { + let box = null; + let best = null; + for (const el of set.els.flat()) { + const b = el.getBoundingClientRect(); + if (!b.width && !b.height) continue; + const v = toVb(b); + box = box ? [Math.min(box[0], v[0]), Math.min(box[1], v[1]), Math.max(box[2], v[2]), Math.max(box[3], v[3])] : v; + for (const shape of el.matches("path,circle,ellipse,rect,polygon") ? [el] : el.querySelectorAll("path,circle,ellipse,rect,polygon")) { + if (shape.closest(".iso-halo, [class*=halo]")) continue; + const s = shape.getBoundingClientRect(); + const area = s.width * s.height; + if (!best || area > best.area) best = { area, at: [(toVb(s)[0] + toVb(s)[2]) / 2, (toVb(s)[1] + toVb(s)[3]) / 2] }; + } + } + if (box) boxes[set.id] = box.map((n) => Math.round(n * 10) / 10); + if (best) anchors[set.id] = best.at.map((n) => Math.round(n * 10) / 10); + } + const html = layers.map((svg, index) => { + const live = new Map(); + for (const set of sets) for (const el of set.els[index]) live.set(el, set.id); + const clone = svg.cloneNode(true); + const walkLive = [...svg.querySelectorAll("*")]; + const walkClone = [...clone.querySelectorAll("*")]; + walkLive.forEach((el, at) => { + const id = live.get(el); + if (!id) return; + const cs = getComputedStyle(el); + const tokens = TONES.map((tone) => "--anatomy-" + tone + ":var(--on-" + id + "-" + tone + ",var(--part-" + tone + "," + (cs.getPropertyValue("--anatomy-" + tone).trim() || "currentColor") + "))").join(";"); + const target = walkClone[at]; + const own = target.getAttribute("style"); + target.setAttribute("style", (own ? own.replace(/;?\\s*$/, ";") : "") + tokens + ";display:var(--show-" + id + "," + (cs.display === "none" ? "none" : "inline") + ")"); + target.setAttribute("data-print-part", id); + }); + for (const sel of C.strip) clone.querySelectorAll(sel).forEach((el) => el.remove()); + clone.querySelectorAll("title,desc").forEach((el) => el.remove()); + clone.querySelectorAll("[id]").forEach((el) => el.setAttribute("id", "ps" + index + "-" + el.id)); + let inner = clone.innerHTML; + clone.querySelectorAll("[id]").forEach((el) => { + const old = el.id.slice(("ps" + index + "-").length); + inner = inner.split("url(#" + old + ")").join("url(#" + el.id + ")").split('href="#' + old + '"').join('href="#' + el.id + '"'); + }); + return inner; + }); + let content = null; + for (const svg of layers) for (const el of svg.children) { + if (el.tagName === "defs" || el.tagName === "title" || el.tagName === "desc") continue; + const b = el.getBoundingClientRect(); + if (!b.width || !b.height) continue; + const v = toVb(b); + content = content ? [Math.min(content[0], v[0]), Math.min(content[1], v[1]), Math.max(content[2], v[2]), Math.max(content[3], v[3])] : v; + } + const css = [...document.querySelectorAll("style")].map((s) => s.textContent).join("\\n"); + const r = (document.querySelector(C.frame) || base.parentElement).getBoundingClientRect(); + return { __print: true, vb: [vbox.x, vbox.y, vbox.width, vbox.height], content: content && [content[0], content[1], content[2] - content[0], content[3] - content[1]].map((n) => Math.round(n * 10) / 10), k, offset: [(rect.left - r.left), (rect.top - r.top)], layers: html, boxes, anchors, css, readout: (document.querySelector("[data-readout]") || {}).textContent || "" }; +})()`; +} + +function drive(page, actions, { reduced, width, height }) { + const profile = mkdtempSync(join(tmpdir(), "iso-print-")); + const file = join(profile, "actions.json"); + writeFileSync(file, JSON.stringify(actions)); + const args = [DRIVE, page, "--actions", file, "--width", String(width), "--height", String(height)]; + if (reduced) args.push("--reduced"); + const log = join(profile, "out.txt"); + const fd = openSync(log, "w"); + const run = spawnSync(process.execPath, args, { stdio: ["ignore", fd, "pipe"], encoding: "utf8", maxBuffer: 1 << 26 }); + closeSync(fd); + const stdout = readFileSync(log, "utf8"); + rmSync(profile, { recursive: true, force: true }); + if (run.status !== 0) throw new Error(`drive.mjs failed:\n${(run.stderr || stdout || "").slice(-2000)}`); + return stdout + .split("\n") + .filter((line) => line.startsWith("eval: ")) + .map((line) => JSON.parse(line.slice(6))); +} + +export async function capture(spec, pagePath) { + const options = { reduced: spec.reduced ?? true, width: spec.width ?? 1200, height: spec.height ?? 1200 }; + const views = Object.entries(spec.views ?? { rest: {} }); + const script = captureScript(spec); + const actions = [["wait", spec.settle ?? 1200]]; + for (const [, view] of views) actions.push(...(view.actions ?? []), ["eval", script], ...(view.reset ?? [])); + const results = drive(pagePath, actions, options).filter((result) => result && result.__print); + if (results.length !== views.length) throw new Error(`expected ${views.length} captures, got ${results.length}`); + const out = { views: {}, css: "" }; + results.forEach((result, index) => { + if (result.error) throw new Error(result.error); + out.css = result.css; + const [name, view] = views[index]; + out.views[name] = { vb: result.vb, content: result.content, layers: result.layers, boxes: result.boxes, anchors: result.anchors, k: result.k, offset: result.offset, readout: result.readout, raster: view.raster ? true : undefined }; + }); + const rasters = views.filter(([, view]) => view.raster); + if (rasters.length) { + const dir = mkdtempSync(join(tmpdir(), "iso-print-shots-")); + const shots = [["wait", spec.settle ?? 1200]]; + for (const [name, view] of views) { + shots.push(...(view.actions ?? [])); + if (view.raster) { + const captured = out.views[name]; + const region = view.raster.region ?? captured.vb; + const [vx, vy] = captured.vb; + const box = [(region[0] - vx) / captured.k + captured.offset[0], (region[1] - vy) / captured.k + captured.offset[1], region[2] / captured.k, region[3] / captured.k].map((n) => Math.round(n)); + shots.push(["shot", join(dir, `${name}.png`), view.raster.selector ?? spec.rasterSelector ?? ".iso-stage", view.raster.scale ?? 2, box]); + out.views[name].raster = { region, file: join(dir, `${name}.png`) }; + } + shots.push(...(view.reset ?? [])); + } + drive(pagePath, shots, options); + for (const [name] of rasters) { + const raster = out.views[name].raster; + if (!existsSync(raster.file)) throw new Error(`raster shot for ${name} was not written`); + raster.href = `data:image/png;base64,${readFileSync(raster.file).toString("base64")}`; + delete raster.file; + } + rmSync(dir, { recursive: true, force: true }); + } + return out; +} + +export function printPdf(htmlFile, pdfFile, { png, paper, pages: expected = 1 } = {}) { + const binary = chromePath(); + if (!binary) throw new Error("No Chrome found. Set CHROME_PATH to a Chrome or Chromium binary."); + const profile = mkdtempSync(join(tmpdir(), "iso-print-pdf-")); + const common = ["--headless=new", ...(process.platform === "linux" ? ["--no-sandbox"] : []), "--disable-gpu", "--hide-scrollbars", "--no-first-run", "--no-default-browser-check", "--mute-audio", "--allow-file-access-from-files", `--user-data-dir=${profile}`]; + const url = pathToFileURL(htmlFile).href; + if (existsSync(pdfFile)) rmSync(pdfFile); + spawnSync(binary, [...common, "--no-pdf-header-footer", `--print-to-pdf=${pdfFile}`, url], { stdio: "ignore", timeout: 120000 }); + if (png) spawnSync(binary, [...common, "--force-device-scale-factor=2", `--window-size=${paper.px[0]},${paper.px[1] * expected}`, `--screenshot=${png}`, `${url}?print`], { stdio: "ignore", timeout: 120000 }); + rmSync(profile, { recursive: true, force: true }); + if (!existsSync(pdfFile) || !statSync(pdfFile).size) throw new Error(`Chrome did not write ${pdfFile}`); + const pages = (readFileSync(pdfFile, "latin1").match(/\/Type\s*\/Page(?![s\w])/g) ?? []).length; + return { pages, bytes: statSync(pdfFile).size }; +} + +async function main() { + const argv = process.argv.slice(2); + if (!argv.length || argv.includes("--help") || argv.includes("-h")) { + usage(); + process.exit(argv.length ? 0 : 1); + } + const rest = []; + const options = { letter: false, png: false, out: null, format: null }; + for (let index = 0; index < argv.length; index++) { + const arg = argv[index]; + if (arg === "--letter") options.letter = true; + else if (arg === "--png") options.png = true; + else if (arg === "--out") options.out = argv[++index]; + else if (arg === "--format") options.format = argv[++index]; + else rest.push(arg); + } + const specFile = resolve(rest[0]); + const spec = (await import(pathToFileURL(specFile).href)).default; + const dir = dirname(specFile); + const pagePath = resolve(dir, spec.page); + if (!existsSync(pagePath)) throw new Error(`no built page at ${pagePath}; build the figure with --light first`); + const paper = options.letter ? PAPER.letter : PAPER.a4; + const formats = options.format === "all" ? FORMATS : [options.format ?? spec.format ?? "poster"]; + for (const format of formats) if (!FORMATS.includes(format)) throw new Error(`unknown format "${format}"; use one of ${FORMATS.join(", ")} or all`); + const base = options.out ?? spec.out ?? spec.page.replace(/(-light)?\.html$/, ""); + const captured = await capture(spec, pagePath); + for (const part of spec.parts ?? []) { + if (part.select && !captured.views[spec.main.view].boxes[part.id]) console.warn(`warning: part ${part.id} matched nothing in view ${spec.main.view}`); + } + let failed = false; + for (const format of formats) { + const name = `${base}-${format}-${options.letter ? "letter" : "a4"}`; + const html = sheetHtml(captured, spec, paper, format); + const htmlFile = join(dir, `${name}.html`); + writeFileSync(htmlFile, html); + const pdfFile = join(dir, `${name}.pdf`); + const png = options.png ? join(dir, `${name}.png`) : null; + const expected = pagesOf(format, spec); + const { pages, bytes } = printPdf(htmlFile, pdfFile, { png, paper, pages: expected }); + console.log(`wrote ${name}.html (${(html.length / 1024).toFixed(0)} KB) and ${name}.pdf (${(bytes / 1024).toFixed(0)} KB, ${pages} page${pages === 1 ? "" : "s"})${png ? ` and ${name}.png` : ""}`); + if (pages !== expected) { + console.error(`${format} should print on ${expected} page${expected === 1 ? "" : "s"} but runs to ${pages}; shorten the text or the steps until it fits`); + failed = true; + } + } + if (failed) process.exit(1); +} + +if (process.argv[1] && resolve(process.argv[1]) === fileURLToPath(import.meta.url)) await main(); diff --git a/skills/anatomy/scripts/publish.mjs b/skills/anatomy/scripts/publish.mjs new file mode 100644 index 0000000..257c0f5 --- /dev/null +++ b/skills/anatomy/scripts/publish.mjs @@ -0,0 +1,338 @@ +import { spawnSync } from "node:child_process"; +import { cpSync, existsSync, lstatSync, mkdirSync, readdirSync, readFileSync, readlinkSync, renameSync, rmSync, symlinkSync, writeFileSync } from "node:fs"; +import { basename, dirname, extname, isAbsolute, join, relative, resolve, sep } from "node:path"; +import { fileURLToPath } from "node:url"; +import { fingerprintOfSkill } from "./fingerprint.mjs"; +import { describe, fromThisSession, parseMinutes, parseTokens } from "./session.mjs"; + +const SKILL = resolve(dirname(fileURLToPath(import.meta.url)), ".."); +const SOURCE_TYPES = [".mjs", ".js", ".css", ".html", ".json", ".md", ".txt", ".svg"]; +const SKIP_DIRS = ["node_modules", "shots", ".git"]; +const ID = /^[a-z0-9]+(-[a-z0-9]+)*$/; +const AGENTS = ["Claude Code", "OpenCode", "Codex", "Antigravity", "Other"]; +const LICENSES = ["MIT", "CC-BY-4.0"]; +const KINDS = ["SVG", "SVG + WebGL", "SVG + 3D", "SVG + WebGL + 3D"]; + +const posix = (path) => path.split(sep).join("/"); +const inside = (root, path) => path === root || path.startsWith(root + sep); + +function usage(message) { + if (message) console.error(`publish: ${message}\n`); + console.log(`Copy a figure into a local clone of the community gallery, ready for a pull request. + + node scripts/publish.mjs
    --into --id --title "..." --prompt "..." --author + [--agent "Claude Code"|OpenCode|Codex|Antigravity|Other] [--model "..."] [--minutes 45] [--tokens 1.2M] [--no-session] + [--license MIT|CC-BY-4.0] [--tags a,b] + [--build build.mjs] [--pages a.html,b.html] [--kind "SVG + WebGL"] [--audit] [--no-preview] [--force] + [--submit [--yes] [--dry-run] [--upstream owner/repo]] + +The figure must be plain HTML: a build script that writes standalone pages next to itself, in any theme. +Only the source is copied, to figures///: the gallery's CI builds the pages and the poster. +In Claude Code, the time to make and the tokens spent are read from this session's own log (from the request that +made the figure up to the request to publish it, with idle gaps over 10 minutes left out); --minutes and --tokens +override them, and --no-session leaves them out. Other agents pass them if they know them. +Without --submit nothing is pushed: the command prints the git and gh commands to run when you are ready. +With --submit it also sends the figure as a pull request, using the GitHub CLI (gh): it shows the plan and asks +first (--yes skips the question, --dry-run only shows the plan). People who can push to the gallery get a branch +there; everyone else gets a fork, made for them.`); + process.exit(message ? 1 : 0); +} + +function parse(argv) { + const options = { agent: "Claude Code", license: "MIT", build: "build.mjs", tags: [], upstream: "wheresryan22/anatomy-community" }; + const take = (index) => { + const value = argv[index + 1]; + if (value === undefined || value.startsWith("--")) usage(`${argv[index]} needs a value`); + return value; + }; + for (let index = 0; index < argv.length; index++) { + const arg = argv[index]; + if (arg === "--help" || arg === "-h") usage(); + else if (["--into", "--id", "--title", "--prompt", "--author", "--agent", "--model", "--license", "--build", "--kind", "--date"].includes(arg)) options[arg.slice(2)] = take(index++); + else if (arg === "--tags") options.tags = take(index++).split(",").map((tag) => tag.trim()).filter(Boolean); + else if (arg === "--pages") options.pages = take(index++).split(",").map((page) => page.trim()); + else if (arg === "--minutes") { + options.minutes = parseMinutes(take(index++)); + if (!options.minutes) usage("--minutes takes a duration like 45, 45m, 2h or 1h30m"); + } else if (arg === "--tokens") { + options.tokens = parseTokens(take(index++)); + if (!options.tokens) usage("--tokens takes a count like 380000, 450k or 1.2M"); + } else if (arg === "--no-session") options.noSession = true; + else if (arg === "--audit") options.audit = true; + else if (arg === "--force") options.force = true; + else if (arg === "--no-preview") options.noPreview = true; + else if (arg === "--submit") options.submit = true; + else if (arg === "--yes") options.yes = true; + else if (arg === "--dry-run") options.dryRun = true; + else if (arg === "--upstream") options.upstream = take(index++); + else if (arg.startsWith("--")) usage(`unknown option ${arg}`); + else if (!options.source) options.source = arg; + else usage(`unexpected argument ${arg}`); + } + for (const key of ["source", "into", "id", "title", "prompt", "author"]) if (!options[key]) usage(`missing ${key === "source" ? "the figure folder" : `--${key}`}`); + if (!ID.test(options.id)) usage("--id must be kebab-case, like token-bucket-bench"); + if (!AGENTS.includes(options.agent)) usage(`--agent must be one of: ${AGENTS.join(", ")}`); + if (!LICENSES.includes(options.license)) usage(`--license must be one of: ${LICENSES.join(", ")}`); + if (options.kind && !KINDS.includes(options.kind)) usage(`--kind must be one of: ${KINDS.join(", ")}`); + return options; +} + +function listFiles(root, dir = root, out = []) { + for (const name of readdirSync(dir).sort()) { + const full = join(dir, name); + const stat = lstatSync(full); + if (name.startsWith(".") || stat.isSymbolicLink()) continue; + if (stat.isDirectory()) { + if (!SKIP_DIRS.includes(name)) listFiles(root, full, out); + } else out.push(posix(relative(root, full))); + } + return out; +} + +function detectPages(source, files, given) { + const html = files.filter((file) => !file.includes("/") && file.endsWith(".html")); + if (given) { + const named = given.filter(Boolean); + for (const page of named) if (!files.includes(page)) throw new Error(`page ${page} not found in ${source}; build the figure first`); + const pages = {}; + for (const page of named) pages[themeOf(source, page) === "light" ? "light" : themeOf(source, page) === "dark" ? "dark" : page.replace(/\.html$/, "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 24)] = page; + return pages; + } + const pairs = html.filter((file) => !file.endsWith("-light.html") && html.includes(file.replace(/\.html$/, "-light.html"))); + if (pairs.length === 1) return { light: pairs[0].replace(/\.html$/, "-light.html"), dark: pairs[0] }; + const singles = html.filter((file) => !/-verify(?:-light)?\.html$/.test(file) && !/^turning-stress/.test(file)); + if (!pairs.length && singles.length === 1) return { [themeOf(source, singles[0]) === "light" ? "light" : "page"]: singles[0] }; + throw new Error(`can't tell which pages are the figure (found: ${html.join(", ") || "none"}); pass --pages a.html,b.html`); +} + +const themeOf = (source, page) => (readFileSync(join(source, page), "utf8").match(/]*\bdata-theme="([a-z-]+)"/) ?? [])[1] ?? ""; + +function detectKind(text) { + const webgl = /getContext\(\s*["']webgl2?["']|\bGLSL_ISO\b|\bglLayer\b/.test(text); + const turning = /\bTURN\.mount\b|\bturnScript\b|\bTURN_CSS\b|class="[^"]*iso-turn/.test(text); + return `SVG${webgl ? " + WebGL" : ""}${turning ? " + 3D" : ""}`; +} + +export function rewriteSkillPaths(text, { fromDir, toDir, source, skill, skillLink }) { + const outside = []; + const rewritten = text.replace(/(["'])((?:\.{1,2}\/|\/)[^"'\n]*)\1/g, (literal, quote, path) => { + const target = resolve(fromDir, path); + const dotted = (from, to) => { + const r = posix(relative(from, to)); + return r.startsWith(".") ? r : `./${r}`; + }; + if (!/\.[a-z]+$/i.test(path) && !inside(skill, target)) return literal; + if (inside(source, target)) return isAbsolute(path) ? `${quote}${dotted(fromDir, target)}${quote}` : literal; + if (inside(skill, target)) return `${quote}${dotted(toDir, join(skillLink, relative(skill, target)))}${quote}`; + if (/\.(m?js|css|json|html|svg)$/.test(path)) outside.push(path); + return literal; + }); + return { text: rewritten, outside }; +} + +function run(args, cwd) { + const result = spawnSync(process.execPath, args, { cwd, encoding: "utf8", maxBuffer: 64 << 20 }); + if (result.status !== 0) throw new Error(`${args.map((a) => basename(a)).join(" ")} failed:\n${`${result.stdout}${result.stderr}`.trim().split("\n").slice(-12).join("\n")}`); + return result.stdout; +} + +export function publish(options) { + const log = options.log ?? (() => {}); + const source = resolve(options.source); + const repo = resolve(options.into); + if (!existsSync(join(source, options.build))) throw new Error(`no ${options.build} in ${source}`); + if (!existsSync(join(repo, "figures")) || !existsSync(join(repo, "scripts", "validate.mjs"))) throw new Error(`${repo} doesn't look like a clone of anatomy-community (no figures/ or scripts/validate.mjs)`); + if (inside(SKILL, source) && !inside(join(SKILL, "examples"), source)) throw new Error("the figure folder is inside the skill itself; publish the folder where the figure was built"); + const author = options.author.replace(/^@/, ""); + if (!/^[A-Za-z0-9](?:[A-Za-z0-9]|-(?=[A-Za-z0-9])){0,38}$/.test(author)) throw new Error("--author must be a GitHub username"); + const dest = join(repo, "figures", author.toLowerCase(), options.id); + if (existsSync(dest)) { + if (!options.force) throw new Error(`figures/${author.toLowerCase()}/${options.id} already exists; pick another --id or pass --force to replace it`); + } + const replaced = existsSync(dest) ? `${dest}.replaced` : null; + if (replaced) { + rmSync(replaced, { recursive: true, force: true }); + renameSync(dest, replaced); + } + try { + const all = listFiles(source); + const typed = all.filter((file) => SOURCE_TYPES.includes(extname(file).toLowerCase())); + const pages = detectPages(source, typed, options.pages); + const lightPage = pages.light ?? null; + for (const page of Object.values(pages)) if (page && !typed.includes(page)) throw new Error(`page ${page} not found in ${source}; build the figure first`); + const outputs = new Set(Object.values(pages).filter(Boolean)); + const files = typed.filter((file) => !outputs.has(file) && !/-verify(?:-light)?\.html$/.test(file)); + const skipped = all.filter((file) => !files.includes(file) && !outputs.has(file)); + + const skillLink = join(repo, ".skill"); + const kit = fingerprintOfSkill(SKILL); + const outside = []; + for (const file of files) { + const from = join(source, file); + const to = join(dest, "src", file); + mkdirSync(dirname(to), { recursive: true }); + if (/\.m?js$/.test(file)) { + const result = rewriteSkillPaths(readFileSync(from, "utf8"), { fromDir: dirname(from), toDir: dirname(to), source, skill: SKILL, skillLink }); + outside.push(...result.outside.map((path) => `${file}: ${path}`)); + writeFileSync(to, result.text); + } else cpSync(from, to); + } + if (outside.length) { + rmSync(dest, { recursive: true, force: true }); + throw new Error(`these files reach outside the figure folder and the skill; move what they need into the folder:\n ${outside.join("\n ")}`); + } + + let linked = "existing"; + if (!existsSync(skillLink)) { + symlinkSync(SKILL, skillLink, process.platform === "win32" ? "junction" : "dir"); + linked = "created"; + } else if (fingerprintOfSkill(skillLink) !== kit) { + const where = lstatSync(skillLink).isSymbolicLink() ? readlinkSync(skillLink) : skillLink; + throw new Error(`${repo}/.skill (${where}) is a different kit version than this skill; remove it and run again`); + } + + const build = []; + if (pages.light) build.push([`src/${options.build}`, "--light"]); + if (Object.keys(pages).some((name) => name !== "light")) build.push([`src/${options.build}`]); + for (const command of build) { + log(`building ${command.includes("--light") ? "the light page" : "the page"} (heavy figures take a minute or two)…`); + run(command, dest); + } + let preview = null; + if (!options.noPreview) { + log("taking a preview…"); + const shots = join(repo, "shots", `${author.toLowerCase()}-${options.id}`); + mkdirSync(shots, { recursive: true }); + preview = join(shots, "preview.png"); + run([join(SKILL, "scripts", "capture.mjs"), join(dest, "src", lightPage ?? Object.values(pages)[0]), "--reduced", "--width", "1200", "--out", preview], dest); + } + const measured = options.noSession || (options.minutes && options.tokens) ? null : fromThisSession({ prompt: options.prompt }); + const minutes = options.minutes ?? measured?.minutes; + const tokens = options.tokens ?? measured?.tokens; + if (measured) log(`time and tokens from this session: ${describe(measured)}`); + const pageText = Object.values(pages).filter(Boolean).map((page) => readFileSync(join(dest, "src", page), "utf8")).join("\n"); + for (const page of outputs) rmSync(join(dest, "src", page), { force: true }); + const figure = { + id: options.id, + title: options.title.trim(), + author, + prompt: options.prompt.trim(), + kind: options.kind ?? detectKind(pageText), + agent: options.agent, + ...(options.model ? { model: options.model } : {}), + ...(minutes ? { minutes } : {}), + ...(tokens ? { tokens } : {}), + skill: { kit }, + build, + pages: Object.fromEntries(Object.entries(pages).filter(([, page]) => page).map(([key, page]) => [key, `src/${page}`])), + preview: lightPage ? "light" : Object.keys(pages)[0], + ...(options.audit ? { audit: true } : {}), + license: options.license, + ...(options.tags.length ? { tags: options.tags } : {}), + created: options.date ?? new Date().toISOString().slice(0, 10), + }; + writeFileSync(join(dest, "figure.json"), JSON.stringify(figure, null, 2) + "\n"); + + if (replaced) rmSync(replaced, { recursive: true, force: true }); + return { dest, figure, skipped, linked, preview, measured }; + } catch (error) { + rmSync(dest, { recursive: true, force: true }); + if (replaced) renameSync(replaced, dest); + throw error; + } +} + +export function submitPlan({ login, canPush, upstream, author, id, title }) { + const name = upstream.split("/")[1]; + const target = canPush ? upstream : `${login}/${name}`; + const folder = `figures/${author.toLowerCase()}/${id}`; + const branch = `figure/${id}`; + const steps = [ + ...(canPush ? [] : [{ say: `make (or reuse) your fork, ${target}`, gh: ["repo", "fork", upstream, "--clone=false"] }]), + { say: "let git use your GitHub CLI login", gh: ["auth", "setup-git"] }, + { say: `start ${branch} from the gallery's latest main`, git: ["fetch", "--quiet", `https://github.com/${upstream}.git`, "main"] }, + { git: ["switch", "--quiet", "-C", branch, "FETCH_HEAD"] }, + { say: `add ${folder} and nothing else`, publish: true }, + { git: ["add", "--", folder] }, + { git: ["commit", "--quiet", "-m", `Add ${title}`, "--", folder] }, + { say: `push it to ${target}`, git: ["push", "--quiet", "--force", `https://github.com/${target}.git`, `HEAD:refs/heads/${branch}`] }, + { say: `open the pull request on ${upstream}`, pr: { repo: upstream, head: canPush ? branch : `${login}:${branch}`, title: `Add ${title}` } }, + ]; + return { target, branch, folder, steps }; +} + +async function confirm(question) { + if (!process.stdin.isTTY) return false; + const { createInterface } = await import("node:readline/promises"); + const rl = createInterface({ input: process.stdin, output: process.stdout }); + const answer = await rl.question(question); + rl.close(); + return /^y(es)?$/i.test(answer.trim()); +} + +async function submit(options) { + const gh = (args) => spawnSync("gh", args, { encoding: "utf8" }); + const repo = resolve(options.into); + const who = gh(["api", "user", "--jq", ".login"]); + if (who.error || who.status !== 0) throw new Error("--submit needs the GitHub CLI, signed in: install it from https://cli.github.com and run gh auth login"); + const login = who.stdout.trim(); + const author = options.author.replace(/^@/, ""); + if (login.toLowerCase() !== author.toLowerCase()) throw new Error(`you're signed in to GitHub as ${login}, but --author is ${author}; they must match`); + const perm = gh(["api", `repos/${options.upstream}`, "--jq", ".permissions.push"]); + if (perm.status !== 0) throw new Error(`can't see ${options.upstream} with your GitHub login`); + const plan = submitPlan({ login, canPush: perm.stdout.trim() === "true", upstream: options.upstream, author, id: options.id, title: options.title.trim() }); + console.log(`\nSubmitting as @${login}:`); + for (const step of plan.steps) if (step.say) console.log(` · ${step.say}`); + if (!options.noSession && !(options.minutes && options.tokens)) { + const measured = fromThisSession({ prompt: options.prompt }); + const shown = { minutes: options.minutes ?? measured?.minutes, tokens: options.tokens ?? measured?.tokens }; + console.log(shown.minutes && shown.tokens ? ` · record ${describe(shown)} to make it${measured ? " (read from this session)" : ""}` : " · no time or token count (not run inside Claude Code; pass --minutes and --tokens to add them)"); + } else if (options.minutes || options.tokens) console.log(` · record${options.minutes ? ` ${options.minutes} min` : ""}${options.tokens ? ` ${options.tokens} tokens` : ""}`); + console.log(` (in ${repo})`); + if (options.dryRun) return console.log("\ndry run: nothing was done"); + if (!options.yes && !(await confirm("\nGo ahead? [y/N] "))) throw new Error("not submitted (answer y, or pass --yes after asking)"); + const run = (tool, args) => { + const result = spawnSync(tool, args, { cwd: repo, encoding: "utf8" }); + if (result.status !== 0) throw new Error(`${tool} ${args.slice(0, 2).join(" ")} failed:\n${`${result.stdout}${result.stderr}`.trim()}`); + return result.stdout.trim(); + }; + let published; + for (const step of plan.steps) { + if (step.gh) run("gh", step.gh); + if (step.git) run("git", step.git); + if (step.publish) { + const onMain = run("git", ["ls-tree", "--name-only", "HEAD", "--", plan.folder]) !== ""; + published = publish({ ...options, force: options.force || !onMain, log: (line) => console.log(` ${line}`) }); + } + if (step.pr) { + const open = gh(["pr", "list", "--repo", step.pr.repo, "--head", plan.branch, "--state", "open", "--json", "url", "--jq", ".[0].url"]).stdout.trim(); + const url = open || run("gh", ["pr", "create", "--repo", step.pr.repo, "--base", "main", "--head", step.pr.head, "--title", step.pr.title, "--body", `${published.figure.prompt}\n\nPublished with Anatomy's publish.mjs.`]); + console.log(`\nSubmitted: ${url}\nThe checks run there, and a preview of your figure appears on it when they finish.`); + } + } +} + +if (process.argv[1] && resolve(process.argv[1]) === fileURLToPath(import.meta.url)) { + const options = parse(process.argv.slice(2)); + if (options.submit) { + submit(options).catch((error) => { + console.error(`publish: ${error.message}`); + process.exit(1); + }); + } else try { + console.log(`publishing ${options.id}…`); + const { dest, figure, skipped, linked, preview } = publish({ ...options, log: (line) => console.log(` ${line}`) }); + const repo = resolve(options.into); + console.log(`published figures/${figure.author.toLowerCase()}/${figure.id} (${figure.kind}, kit ${figure.skill.kit.slice(7, 19)}): source only, the gallery builds the pages`); + if (figure.minutes && figure.tokens) console.log(` made in ${describe(figure)}`); + if (skipped.length) console.log(` left out (not a source type): ${skipped.join(", ")}`); + console.log(` .skill link: ${linked}`); + if (preview) console.log(` preview: ${preview} (not committed; CI makes the real one)`); + const where = `figures/${figure.author.toLowerCase()}/${figure.id}`; + console.log(`\nCheck it:\n cd ${repo}\n node scripts/validate.mjs ${where}`); + console.log(`\nWhen you are happy with it, from your fork of anatomy-community:\n git switch -c figure/${figure.id}\n git add ${where}\n git commit -m "Add ${figure.title.replace(/"/g, "'")}"\n git push -u origin figure/${figure.id}\n gh pr create --repo wheresryan22/anatomy-community --fill`); + } catch (error) { + console.error(`publish: ${error.message}`); + process.exit(1); + } +} diff --git a/skills/anatomy/scripts/publish.test.mjs b/skills/anatomy/scripts/publish.test.mjs new file mode 100644 index 0000000..10a1cf6 --- /dev/null +++ b/skills/anatomy/scripts/publish.test.mjs @@ -0,0 +1,119 @@ +import assert from "node:assert/strict"; +import { spawnSync } from "node:child_process"; +import { cpSync, existsSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, rmSync, writeFileSync } from "node:fs"; +import { tmpdir } from "node:os"; +import { join, resolve } from "node:path"; +import test from "node:test"; +import { fingerprintOf, fingerprintOfSkill } from "./fingerprint.mjs"; +import { publish, rewriteSkillPaths } from "./publish.mjs"; + +const SKILL = resolve(import.meta.dirname, ".."); + +function gallery() { + const repo = mkdtempSync(join(tmpdir(), "anatomy-gallery-")); + mkdirSync(join(repo, "figures")); + mkdirSync(join(repo, "scripts")); + writeFileSync(join(repo, "scripts", "validate.mjs"), ""); + return repo; +} + +test("the fingerprint matches the gallery's algorithm", () => { + assert.equal(fingerprintOf([["kit/a.mjs", "1"], ["kit/b.mjs", "2"], ["scripts/inline-kit.mjs", "3"]]), fingerprintOf([["kit/b.mjs", "2"], ["scripts/inline-kit.mjs", "3"], ["kit/a.mjs", "1"]])); + assert.equal(fingerprintOf([["kit/a.mjs", "1"], ["kit/b.mjs", "2"], ["scripts/inline-kit.mjs", "3"]]), "sha256:a249319b0f2a8db4899fbb430c782c55b7699df73809c5c0e4c07495c72eae8c"); + assert.match(fingerprintOfSkill(SKILL), /^sha256:[0-9a-f]{64}$/); +}); + +test("skill paths are rewritten to the gallery's .skill link, and nothing else", () => { + const source = "/work/fig"; + const text = 'import * as k from "../../kit/iso-kit.mjs";\nimport { kitScript } from "../../scripts/inline-kit.mjs";\nimport "./live.mjs";\nconst x = "/2";'; + const { text: out, outside } = rewriteSkillPaths(text, { fromDir: join(SKILL, "examples", "x"), toDir: "/g/figures/x/src", source: join(SKILL, "examples", "x"), skill: SKILL, skillLink: "/g/.skill" }); + assert.deepEqual(outside, []); + assert.match(out, /from "\.\.\/\.\.\/\.\.\/\.skill\/kit\/iso-kit\.mjs"/); + assert.match(out, /from "\.\.\/\.\.\/\.\.\/\.skill\/scripts\/inline-kit\.mjs"/); + assert.match(out, /import "\.\/live\.mjs"/); + assert.match(out, /"\/2"/); + const away = rewriteSkillPaths('import "../../elsewhere/x.mjs";', { fromDir: source, toDir: "/g/figures/x/src", source, skill: SKILL, skillLink: "/g/.skill" }); + assert.deepEqual(away.outside, ["../../elsewhere/x.mjs"]); +}); + +test("publishing copies only the source, under the author, and it rebuilds byte for byte", () => { + const repo = gallery(); + try { + const { dest, figure } = publish({ source: join(SKILL, "examples", "dial-indicator"), into: repo, id: "dial-indicator", title: "Dial indicator", prompt: "/anatomy a dial indicator", author: "Octo-Cat", agent: "Codex", license: "MIT", build: "build.mjs", tags: [], date: "2026-10-12", noPreview: true }); + assert.equal(dest, join(repo, "figures", "octo-cat", "dial-indicator")); + assert.equal(figure.author, "Octo-Cat"); + assert.ok(!existsSync(join(dest, "src", "dial-indicator.html")) && !existsSync(join(dest, "src", "dial-indicator-light.html")) && !existsSync(join(dest, "poster.png")), "no built pages or poster are left"); + assert.equal(figure.kind, "SVG"); + assert.equal(figure.skill.kit, fingerprintOfSkill(SKILL)); + assert.deepEqual(figure.build, [["src/build.mjs", "--light"], ["src/build.mjs"]]); + assert.deepEqual(figure.pages, { dark: "src/dial-indicator.html", light: "src/dial-indicator-light.html" }); + for (const command of figure.build) assert.equal(spawnSync(process.execPath, command, { cwd: dest }).status, 0); + for (const page of ["dial-indicator.html", "dial-indicator-light.html"]) assert.ok(readFileSync(join(dest, "src", page)).equals(readFileSync(join(SKILL, "examples", "dial-indicator", page))), page); + assert.ok(existsSync(join(repo, ".skill", "kit", "iso-kit.mjs"))); + assert.throws(() => publish({ source: join(SKILL, "examples", "dial-indicator"), into: repo, id: "dial-indicator", title: "x", prompt: "x", author: "octo-cat", agent: "Codex", license: "MIT", build: "build.mjs", tags: [], noPreview: true }), /already exists/); + } finally { + rmSync(repo, { recursive: true, force: true }); + } +}); + +test("publishing refuses a folder that is not a gallery clone", () => { + const empty = mkdtempSync(join(tmpdir(), "not-gallery-")); + try { + assert.throws(() => publish({ source: join(SKILL, "examples", "dial-indicator"), into: empty, id: "x", title: "x", prompt: "x", author: "x", agent: "Codex", license: "MIT", build: "build.mjs", tags: [], noPreview: true }), /doesn't look like a clone of anatomy-community/); + } finally { + rmSync(empty, { recursive: true, force: true }); + } +}); + +test("publisher accepts only the gallery's supported licenses", () => { + const repo = gallery(); + const command = (license, id) => spawnSync(process.execPath, [ + join(SKILL, "scripts", "publish.mjs"), join(SKILL, "examples", "dial-indicator"), + "--into", repo, "--id", id, "--title", "Dial indicator", "--prompt", "/anatomy a dial indicator", + "--author", "Octo-Cat", "--license", license, "--no-preview", + ], { encoding: "utf8" }); + try { + for (const license of ["MIT", "CC-BY-4.0"]) { + const id = license.toLowerCase().replace(/[^a-z0-9]+/g, "-"); + const result = command(license, id); + assert.equal(result.status, 0, result.stderr); + const figure = JSON.parse(readFileSync(join(repo, "figures", "octo-cat", id, "figure.json"), "utf8")); + assert.equal(figure.license, license); + } + const invalid = command("GPL-3.0", "unsupported-license"); + assert.equal(invalid.status, 1); + assert.match(invalid.stderr, /--license must be one of: MIT, CC-BY-4\.0/); + assert.ok(!existsSync(join(repo, "figures", "octo-cat", "unsupported-license"))); + } finally { + rmSync(repo, { recursive: true, force: true }); + } +}); + +import { submitPlan } from "./publish.mjs"; + +test("--submit: people who can push get a branch; everyone else a fork made for them", () => { + const owner = submitPlan({ login: "wheresryan22", canPush: true, upstream: "wheresryan22/anatomy-community", author: "wheresryan22", id: "token-bucket", title: "Token bucket" }); + assert.equal(owner.target, "wheresryan22/anatomy-community"); + assert.ok(!owner.steps.some((s) => s.gh?.[1] === "fork")); + assert.deepEqual(owner.steps.at(-1).pr, { repo: "wheresryan22/anatomy-community", head: "figure/token-bucket", title: "Add Token bucket" }); + const guest = submitPlan({ login: "Octo-Cat", canPush: false, upstream: "wheresryan22/anatomy-community", author: "Octo-Cat", id: "token-bucket", title: "Token bucket" }); + assert.equal(guest.target, "Octo-Cat/anatomy-community"); + assert.deepEqual(guest.steps[0].gh, ["repo", "fork", "wheresryan22/anatomy-community", "--clone=false"]); + assert.equal(guest.steps.at(-1).pr.head, "Octo-Cat:figure/token-bucket"); + assert.ok(guest.steps.some((s) => s.git?.[0] === "add" && s.git.at(-1) === "figures/octo-cat/token-bucket"), "only the figure's folder is added"); +}); + +test("a failed --force publish leaves the existing figure as it was", () => { + const repo = gallery(); + const common = { source: join(SKILL, "examples", "dial-indicator"), into: repo, id: "dial-indicator", title: "Dial indicator", prompt: "/anatomy a dial indicator", author: "octo-cat", agent: "Codex", license: "MIT", build: "build.mjs", tags: [], date: "2026-10-12", noPreview: true }; + try { + const { dest } = publish(common); + const before = readFileSync(join(dest, "figure.json"), "utf8"); + assert.throws(() => publish({ ...common, force: true, pages: ["missing.html"] }), /page missing\.html not found/); + assert.equal(readFileSync(join(dest, "figure.json"), "utf8"), before); + assert.ok(existsSync(join(dest, "src", "build.mjs"))); + assert.deepEqual(readdirSync(join(repo, "figures", "octo-cat")), ["dial-indicator"]); + } finally { + rmSync(repo, { recursive: true, force: true }); + } +}); diff --git a/skills/anatomy/scripts/react-dots-opacity.test.mjs b/skills/anatomy/scripts/react-dots-opacity.test.mjs new file mode 100644 index 0000000..2761a6b --- /dev/null +++ b/skills/anatomy/scripts/react-dots-opacity.test.mjs @@ -0,0 +1,51 @@ +import assert from "node:assert/strict"; +import { mkdtempSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs"; +import { createRequire } from "node:module"; +import { tmpdir } from "node:os"; +import { dirname, join, resolve } from "node:path"; +import test from "node:test"; +import * as G from "../kit/lathe.mjs"; +const require = createRequire(import.meta.url); +const ts = require("typescript"); +const React = require("react"); +const { renderToStaticMarkup } = require("react-dom/server"); +const directory = mkdtempSync(join(tmpdir(), "anatomy-react-solid-")); +try { + for (const file of ["kit/iso-kit.ts", "kit/react/live.tsx", "kit/react/draw.tsx"]) { + const output = join(directory, file.replace(/\.tsx?$/, ".js")); + mkdirSync(dirname(output), { recursive: true }); + const result = ts.transpileModule(readFileSync(resolve(file), "utf8"), { fileName: file, compilerOptions: { module: ts.ModuleKind.CommonJS, target: ts.ScriptTarget.ES2022, jsx: ts.JsxEmit.React } }); + writeFileSync(output, result.outputText); + } + const { Dots } = require(join(directory, "kit/react/draw.js")); + const P = { origin: [0, 0], scale: 1, azimuth: 45, elevation: 30 }; + test("actual React renderer preserves the kit's faded bolt circle", () => { + const points = G.dotsOf(G.frameAlong([0, 0, 0], [0, 0, 1]), 2, 4, 32, P, { fade: [0.04, 0.42] }); + assert.ok(points.some((point) => point.length === 3)); + const html = renderToStaticMarkup(React.createElement(Dots, { points })); + const circles = [...html.matchAll(/]*>/g)].map(([circle]) => circle); + assert.equal(circles.length, points.length); + points.forEach((point, index) => { + if (point[2] === undefined) assert.doesNotMatch(circles[index], /fill-opacity/); + else assert.equal(Number(circles[index].match(/fill-opacity="([^"]+)"/)[1]), point[2]); + }); + }); + test("actual React renderer preserves opacity while dots pulse", () => { + const html = renderToStaticMarkup(React.createElement(Dots, { points: [[2, 3, 0.25]], pulse: true })); + assert.match(html, /fill-opacity="0.25"/); + assert.match(html, /data-pulse=""/); + assert.match(html, /--pulse-at:0ms/); + }); + test("actual React renderer clamps negative opacity to zero", () => { + const html = renderToStaticMarkup(React.createElement(Dots, { points: [[0, 0, -0.5]] })); + assert.match(html, /fill-opacity="0"/); + }); + test("actual React renderer preserves ordinary opaque points", () => { + const html = renderToStaticMarkup(React.createElement(Dots, { points: [[2.22, 3.33], [4, 5, 1]], size: 0.75, tone: "lo" })); + assert.doesNotMatch(html, /fill-opacity/); + assert.match(html, /cx="2.2" cy="3.3" r="0.75"/); + assert.match(html, /data-tone="lo"/); + }); +} finally { + rmSync(directory, { recursive: true, force: true }); +} diff --git a/skills/anatomy/scripts/react-readout-first-write.test.mjs b/skills/anatomy/scripts/react-readout-first-write.test.mjs new file mode 100644 index 0000000..7b89090 --- /dev/null +++ b/skills/anatomy/scripts/react-readout-first-write.test.mjs @@ -0,0 +1,37 @@ +import assert from "node:assert/strict"; +import { execFile } from "node:child_process"; +import { mkdtempSync, rmSync, writeFileSync } from "node:fs"; +import { createRequire } from "node:module"; +import { tmpdir } from "node:os"; +import { dirname, join, resolve } from "node:path"; +import { promisify } from "node:util"; +import test from "node:test"; +const require = createRequire(import.meta.url); +const { build } = require("esbuild"); +const nodePaths = (process.env.NODE_PATH ?? "").split(":").filter(Boolean); +const alias = Object.fromEntries(["react", "react-dom"].map(name => [name, dirname(require.resolve(name+"/package.json", { paths: nodePaths }))])); +const directory = mkdtempSync(join(tmpdir(), "anatomy-react-readout-")); +let observed; +try { + const entry = `import React,{useEffect,useLayoutEffect} from 'react';import {createRoot} from 'react-dom/client';import {flushSync} from 'react-dom';import {useReadout} from ${JSON.stringify(resolve("kit/react/live.tsx"))}; +const changes={};function Probe({mode}){const{anchor,say}=useReadout();useLayoutEffect(()=>{const node=anchor.current.closest('.iso-plate').querySelector('[data-readout]');const observer=new MutationObserver(records=>changes[mode]=(changes[mode]??0)+records.length);observer.observe(node,{childList:true});if(mode==='layout')say('layout');return()=>observer.disconnect();},[]);useEffect(()=>{if(mode==='empty')say('');if(mode==='healthy'||mode==='repeat')say(mode);setTimeout(()=>{if(mode==='layout')say('layout');if(mode==='repeat')say('repeat');},20);},[]);return React.createElement('div',{className:'iso-plate',id:mode},React.createElement('span',{'data-readout':true},'rest'),React.createElement('div',{ref:anchor}));} +flushSync(()=>createRoot(document.getElementById('root')).render(React.createElement(React.Fragment,null,...['layout','empty','healthy','repeat'].map(mode=>React.createElement(Probe,{key:mode,mode})))));setTimeout(()=>{const values=Object.fromEntries(['layout','empty','healthy','repeat'].map(mode=>[mode,document.querySelector('#'+mode+' [data-readout]').textContent]));window.readoutObserved={values,changes};document.getElementById('results').textContent=JSON.stringify(window.readoutObserved);},100);`; + await build({ stdin: { contents: entry, resolveDir: process.cwd(), loader: "jsx" }, bundle: true, outfile: join(directory, "fixture.js"), platform: "browser", nodePaths, alias }); + writeFileSync(join(directory, "fixture.html"), '
    ');
    +  const result = await promisify(execFile)(process.execPath, ["scripts/drive.mjs", join(directory, "fixture.html"), JSON.stringify([["eval", "({observed:window.readoutObserved,html:document.body.innerHTML})"]])], { timeout: 30000, maxBuffer: 16 * 1024 * 1024 });
    +  const payload = result.stdout.match(/eval: (.*)/);
    +  assert.ok(payload, "actual ReactDOM client must complete and publish its native DOM observations");
    +  const inspection = JSON.parse(payload[1]);
    +  observed = inspection.observed;
    +  console.log("actual client inspection:", JSON.stringify(inspection));
    +  assert.ok(observed?.values, `actual native observations are required: ${result.stdout}`);
    +} finally {
    +  rmSync(directory, { recursive: true, force: true });
    +}
    +test("native ReactDOM readout accepts its first empty text", () => assert.equal(observed.values.empty, ""));
    +test("native ReactDOM readout accepts layout-effect text before passive binding", () => assert.equal(observed.values.layout, "layout"));
    +test("native ReactDOM readout preserves ordinary passive-effect text", () => assert.equal(observed.values.healthy, "healthy"));
    +test("native ReactDOM readout preserves duplicate-write suppression", () => {
    +  assert.equal(observed.values.repeat, "repeat");
    +  assert.equal(observed.changes.repeat, 1);
    +});
    diff --git a/skills/anatomy/scripts/react-readout-target.test.mjs b/skills/anatomy/scripts/react-readout-target.test.mjs
    new file mode 100644
    index 0000000..757a2b7
    --- /dev/null
    +++ b/skills/anatomy/scripts/react-readout-target.test.mjs
    @@ -0,0 +1,46 @@
    +import assert from "node:assert/strict";
    +import { execFile } from "node:child_process";
    +import { mkdtemp, rm, writeFile, mkdir, copyFile } from "node:fs/promises";
    +import { createRequire } from "node:module";
    +import { tmpdir } from "node:os";
    +import { dirname, join, resolve } from "node:path";
    +import { promisify } from "node:util";
    +import test from "node:test";
    +
    +const require = createRequire(import.meta.url);
    +const { build } = require("esbuild");
    +const nodePaths = (process.env.NODE_PATH ?? "").split(":").filter(Boolean);
    +const alias = Object.fromEntries(["react", "react-dom"].map(name => [name, dirname(require.resolve(name + "/package.json", { paths: nodePaths }))]));
    +const directory = await mkdtemp(join(tmpdir(), "anatomy-readout-target-"));
    +let observed;
    +try {
    +  const entry = `import React,{useLayoutEffect} from 'react';import {createRoot} from 'react-dom/client';import {flushSync} from 'react-dom';import {useReadout} from ${JSON.stringify(resolve("kit/react/live.tsx"))};
    +const modes=['readout','same','anchor','late','healthy'];const roots={};const sayers={};const old={};
    +function Probe({mode,phase}){const{anchor,say}=useReadout();sayers[mode]=say;useLayoutEffect(()=>{say(phase&&mode!=='same'?'reading 2':'reading 1')},[phase]);return React.createElement('section',{className:'iso-plate',key:mode==='anchor'?phase:'stable'},React.createElement('h2',null,mode),mode==='late'&&!phase?null:React.createElement('span',{'data-readout':true,key:mode==='readout'||mode==='same'?phase:'stable'},'rest'),React.createElement('div',{ref:anchor}));}
    +for(const mode of modes){roots[mode]=createRoot(document.getElementById(mode));flushSync(()=>roots[mode].render(React.createElement(Probe,{mode,phase:0})));old[mode]=document.querySelector('#'+mode+' [data-readout]')}
    +window.advance=()=>{for(const mode of modes)flushSync(()=>roots[mode].render(React.createElement(Probe,{mode,phase:1})));window.observed=Object.fromEntries(modes.map(mode=>[mode,{text:document.querySelector('#'+mode+' [data-readout]')?.textContent,oldText:old[mode]?.textContent,oldConnected:old[mode]?.isConnected}]));return window.observed};
    +window.repeat=async()=>{const node=document.querySelector('#healthy [data-readout]');let writes=0;const observer=new MutationObserver(records=>writes+=records.length);observer.observe(node,{childList:true});sayers.healthy('reading 2');sayers.healthy('reading 2');await Promise.resolve();observer.disconnect();return writes};`;
    +  await build({ stdin: { contents: entry, resolveDir: process.cwd(), loader: "jsx" }, bundle: true, outfile: join(directory, "fixture.js"), platform: "browser", nodePaths, alias });
    +  const page = join(directory, "fixture.html");
    +  await writeFile(page, '

    React readout after target replacement

    Expected: reading 2 in every card except same, which must show reading 1.

    '); + const actions = [["eval", "window.advance()"], ["eval", "window.repeat()"]]; + if (process.env.ANATOMY_PROOF_DIR) { + await mkdir(process.env.ANATOMY_PROOF_DIR, {recursive:true}); + actions.push(["shot", join(process.env.ANATOMY_PROOF_DIR, "light.png"), "body"], ["eval", "document.body.dataset.theme='dark'"], ["shot", join(process.env.ANATOMY_PROOF_DIR, "dark.png"), "body"]); + } + const result = await promisify(execFile)(process.execPath, ["scripts/drive.mjs", page, JSON.stringify(actions)], {timeout:30000}); + const payloads = [...result.stdout.matchAll(/eval: (.*)/g)].map(match=>JSON.parse(match[1])); + observed = payloads[0]; + observed.repeatWrites = payloads[1]; + console.log(JSON.stringify(observed)); +} finally { await rm(directory, {recursive:true,force:true}); } + +for(const mode of ["readout","anchor","late","healthy"]) + test(`readout writes to the current ${mode} target`,()=>assert.equal(observed[mode].text,"reading 2")); +test("replacement accepts the same text as the old target",()=>assert.equal(observed.same.text,"reading 1")); +for(const mode of ["readout","anchor"]) + test(`detached ${mode} target is no longer written`,()=>{ + assert.equal(observed[mode].oldConnected,false); + assert.equal(observed[mode].oldText,"reading 1"); + }); +test("unchanged targets still suppress duplicate writes",()=>assert.equal(observed.repeatWrites,0)); diff --git a/skills/anatomy/scripts/react-solid-seamless.test.mjs b/skills/anatomy/scripts/react-solid-seamless.test.mjs new file mode 100644 index 0000000..b99d16e --- /dev/null +++ b/skills/anatomy/scripts/react-solid-seamless.test.mjs @@ -0,0 +1,47 @@ +import assert from "node:assert/strict"; +import { mkdtempSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs"; +import { createRequire } from "node:module"; +import { tmpdir } from "node:os"; +import { dirname, join, resolve } from "node:path"; +import test from "node:test"; +import * as G from "../kit/lathe.mjs"; +const require = createRequire(import.meta.url); +const ts = require("typescript"); +const React = require("react"); +const { renderToStaticMarkup } = require("react-dom/server"); +const directory = mkdtempSync(join(tmpdir(), "anatomy-react-solid-")); +try { + for (const file of ["kit/iso-kit.ts", "kit/react/live.tsx", "kit/react/draw.tsx"]) { + const output = join(directory, file.replace(/\.tsx?$/, ".js")); + mkdirSync(dirname(output), { recursive: true }); + const result = ts.transpileModule(readFileSync(resolve(file), "utf8"), { fileName: file, compilerOptions: { module: ts.ModuleKind.CommonJS, target: ts.ScriptTarget.ES2022, jsx: ts.JsxEmit.React } }); + writeFileSync(output, result.outputText); + } + const { Solid } = require(join(directory, "kit/react/draw.js")); + const P = { origin: [0, 0], scale: 1, azimuth: 45, elevation: 30 }; + for (const lit of [false, true]) test(`actual React renderer preserves seamless sphere tone regions with lit=${lit}`, () => { + const paths = G.sphereOf([0, 0, 0], 4, P); + assert.equal(paths.seamless, true); + assert.ok(paths.shades.some(Boolean)); + const html = renderToStaticMarkup(React.createElement("svg", null, React.createElement(Solid, { paths, lit }))); + assert.match(html, /data-seamless=""/); + assert.equal(/data-lit=""/.test(html), lit); + assert.match(html, /class="iso-shade"/); + }); + test("actual React renderer preserves ordinary hard solids", () => { + const paths = G.prismOf(G.frameAlong([0, 0, 0], [0, 0, 1]), [[-1, -1], [1, -1], [1, 1], [-1, 1]], 0, 2, P); + assert.equal(Boolean(paths.seamless), false); + const html = renderToStaticMarkup(React.createElement(Solid, { paths })); + assert.doesNotMatch(html, /data-seamless/); + assert.match(html, /class="iso-line iso-edge"/); + }); + test("actual React renderer preserves seamless opt-out and child ordering", () => { + const paths = { ...G.sphereOf([0, 0, 0], 4, P), seamless: false }; + const html = renderToStaticMarkup(React.createElement(Solid, { paths, inner: React.createElement("circle", { id: "inner" }) }, React.createElement("circle", { id: "child" }))); + assert.doesNotMatch(html, /data-seamless/); + assert.ok(html.indexOf('id="inner"') < html.indexOf('class="iso-line iso-edge"')); + assert.ok(html.indexOf('id="child"') > html.indexOf('class="iso-line iso-edge"')); + }); +} finally { + rmSync(directory, { recursive: true, force: true }); +} diff --git a/skills/anatomy/scripts/react-visibility-target.test.mjs b/skills/anatomy/scripts/react-visibility-target.test.mjs new file mode 100644 index 0000000..3a4793b --- /dev/null +++ b/skills/anatomy/scripts/react-visibility-target.test.mjs @@ -0,0 +1,38 @@ +import assert from "node:assert/strict"; +import { execFile } from "node:child_process"; +import { mkdtemp, rm, writeFile } from "node:fs/promises"; +import { createRequire } from "node:module"; +import { tmpdir } from "node:os"; +import { dirname, join, resolve } from "node:path"; +import test from "node:test"; +import { promisify } from "node:util"; +const require = createRequire(import.meta.url); +const { build } = require("esbuild"); +const nodePaths = (process.env.NODE_PATH ?? "").split(":").filter(Boolean); +const alias = Object.fromEntries(["react", "react-dom"].map(name => [name, dirname(require.resolve(name+"/package.json", { paths: nodePaths }))])); +const directory = await mkdtemp(join(tmpdir(), "anatomy-visibility-target-")); +let observed; +try { + const entry = `import React,{StrictMode,useRef,useState,useEffect} from 'react';import {createRoot} from 'react-dom/client';import {flushSync} from 'react-dom';import {useInView} from ${JSON.stringify(resolve("kit/react/live.tsx"))}; +function Probe({mode}){const ref=useRef(null);const [phase,setPhase]=useState(false);const visible=useInView(ref);useEffect(()=>{const timer=setTimeout(()=>setPhase(true),150);return()=>clearTimeout(timer)},[]);const absent=mode==='late'&&!phase;const distant=(mode==='swap'&&!phase)||(mode==='moved'&&phase);return React.createElement('section',{id:'probe-'+mode,'data-visible':String(visible),'data-phase':String(phase)},absent?null:React.createElement('div',{ref,key:mode==='swap'?String(phase):'stable','data-target':mode,style:{position:'absolute',top:distant?'5000px':'20px',left:'20px',width:'20px',height:'20px'}},mode));} +for(const mode of ['swap','late','healthy','moved','strict'])flushSync(()=>createRoot(document.getElementById(mode)).render(mode==='strict'?React.createElement(StrictMode,null,React.createElement(Probe,{mode})):React.createElement(Probe,{mode})));setTimeout(()=>{window.visibilityObserved=Object.fromEntries(['swap','late','healthy','moved','strict'].map(mode=>[mode,{visible:document.querySelector('#probe-'+mode).dataset.visible,phase:document.querySelector('#probe-'+mode).dataset.phase,top:document.querySelector('[data-target="'+mode+'"]').getBoundingClientRect().top}]))},700);`; + await build({ stdin: { contents: entry, resolveDir: process.cwd(), loader: "jsx" }, bundle: true, outfile: join(directory,"fixture.js"), platform: "browser", nodePaths, alias }); + const page = join(directory,"figure.html"); + await writeFile(page,'
    '); + const result = await promisify(execFile)(process.execPath,["scripts/drive.mjs",page,JSON.stringify([["eval","window.visibilityObserved"]])],{timeout:30000}); + const payload = result.stdout.match(/eval: (.*)/); + assert.ok(payload, result.stdout); + observed = JSON.parse(payload[1]); + assert.ok(observed, result.stdout); +} finally { await rm(directory,{recursive:true,force:true}); } +test("native visibility observes a replacement node on the same ref",()=>{ + assert.equal(observed.swap.phase,"true");assert.equal(observed.swap.top,20);assert.equal(observed.swap.visible,"true"); +}); +test("native visibility observes a target mounted after the initial empty ref",()=>{ + assert.equal(observed.late.phase,"true");assert.equal(observed.late.top,20);assert.equal(observed.late.visible,"true"); +}); +test("an unchanged visible target stays observed",()=>assert.equal(observed.healthy.visible,"true")); +test("the same target becoming distant retains real visibility updates",()=>{ + assert.equal(observed.moved.top,5000);assert.equal(observed.moved.visible,"false"); +}); +test("native StrictMode effect replay preserves ordinary observation",()=>assert.equal(observed.strict.visible,"true")); diff --git a/skills/anatomy/scripts/session.mjs b/skills/anatomy/scripts/session.mjs new file mode 100644 index 0000000..014803d --- /dev/null +++ b/skills/anatomy/scripts/session.mjs @@ -0,0 +1,107 @@ +import { existsSync, readdirSync, readFileSync, statSync } from "node:fs"; +import { homedir } from "node:os"; +import { join } from "node:path"; + +export const IDLE_CAP = 10 * 60 * 1000; + +export function parseMinutes(text) { + const value = String(text ?? "").trim().toLowerCase(); + if (!value) return null; + if (/^\d+$/.test(value)) return Number(value); + const match = value.match(/^(?:(\d+(?:[.,]\d+)?)\s*(?:h|hr|hrs|hours?))?\s*(?:(\d+)\s*(?:m|min|mins|minutes?))?$/); + if (!match || (!match[1] && !match[2])) return undefined; + return Math.round(Number((match[1] ?? "0").replace(",", ".")) * 60 + Number(match[2] ?? 0)) || undefined; +} + +export function parseTokens(text) { + const value = String(text ?? "").trim().toLowerCase().replace(/[\s,_]/g, "").replace(/tokens?$/, ""); + if (!value) return null; + const match = value.match(/^(\d+(?:\.\d+)?)([km]?)$/); + if (!match) return undefined; + const tokens = Math.round(Number(match[1]) * (match[2] === "m" ? 1e6 : match[2] === "k" ? 1e3 : 1)); + return tokens >= 1 && tokens <= 1e10 ? tokens : undefined; +} + +function walk(dir, out = []) { + for (const name of existsSync(dir) ? readdirSync(dir) : []) { + const full = join(dir, name); + if (statSync(full).isDirectory()) walk(full, out); + else if (name.endsWith(".jsonl")) out.push(full); + } + return out; +} + +export function sessionFiles(sessionId, root = join(homedir(), ".claude", "projects")) { + if (!sessionId || !/^[0-9a-f-]{8,64}$/i.test(sessionId) || !existsSync(root)) return []; + for (const project of readdirSync(root)) { + const main = join(root, project, `${sessionId}.jsonl`); + if (existsSync(main)) return [main, ...walk(join(root, project, sessionId))]; + } + return []; +} + +function entriesOf(file) { + const out = []; + for (const line of readFileSync(file, "utf8").split("\n")) { + if (!line.trim()) continue; + try { + const entry = JSON.parse(line); + if (entry && typeof entry.timestamp === "string") out.push(entry); + } catch {} + } + return out; +} + +const textOf = (entry) => { + const content = entry.message?.content; + if (typeof content === "string") return content; + if (Array.isArray(content)) return content.filter((part) => part?.type === "text").map((part) => part.text).join("\n"); + return ""; +}; + +const squash = (text) => text.toLowerCase().replace(/\s+/g, " ").trim(); + +export function measure(files, { prompt = "" } = {}) { + if (!files.length) return null; + const [main, ...side] = files; + const mainEntries = entriesOf(main).sort((a, b) => a.timestamp.localeCompare(b.timestamp)); + const asks = mainEntries.filter((entry) => entry.type === "user" && !entry.isSidechain && textOf(entry)); + const head = squash(prompt).slice(0, 48); + const start = + (head && asks.find((entry) => squash(textOf(entry)).includes(head))) ?? + asks.find((entry) => /\/anatomy\b|\banatomy\b/i.test(textOf(entry))) ?? + mainEntries[0]; + if (!start) return null; + const end = asks.find((entry) => entry.timestamp > start.timestamp && /\bpublish\b/i.test(textOf(entry)) && /\b(community|gallery)\b/i.test(textOf(entry))); + const from = start.timestamp; + const to = end?.timestamp ?? "￿"; + const inWindow = (entry) => entry.timestamp >= from && entry.timestamp < to; + + const all = [...mainEntries, ...side.flatMap(entriesOf)].filter(inWindow); + const times = [...new Set(all.map((entry) => Date.parse(entry.timestamp)).filter(Number.isFinite))].sort((a, b) => a - b); + let active = 0; + for (let i = 1; i < times.length; i++) active += Math.min(times[i] - times[i - 1], IDLE_CAP); + + const perMessage = new Map(); + for (const entry of all) { + const usage = entry.type === "assistant" ? entry.message?.usage : null; + if (!usage) continue; + const key = `${entry.sessionId ?? ""}:${entry.agentId ?? ""}:${entry.message?.id ?? entry.uuid}`; + const spent = (usage.input_tokens ?? 0) + (usage.cache_creation_input_tokens ?? 0) + (usage.output_tokens ?? 0); + perMessage.set(key, Math.max(perMessage.get(key) ?? 0, spent)); + } + const tokens = [...perMessage.values()].reduce((sum, spent) => sum + spent, 0); + if (!tokens) return null; + const last = end?.timestamp ?? (times.length ? new Date(times.at(-1)).toISOString() : from); + return { minutes: Math.max(1, Math.round(active / 60000)), tokens, from, to: last }; +} + +export function fromThisSession({ prompt, env = process.env, root } = {}) { + return measure(sessionFiles(env.CLAUDE_CODE_SESSION_ID, root), { prompt }); +} + +export function describe({ minutes, tokens }) { + const time = minutes < 60 ? `${minutes} min` : `${Math.floor(minutes / 60)} h${minutes % 60 ? ` ${minutes % 60} min` : ""}`; + const count = tokens >= 1e6 ? `${(tokens / 1e6).toFixed(1).replace(/\.0$/, "")}M` : tokens >= 1e3 ? `${Math.round(tokens / 1e3)}k` : String(tokens); + return `about ${time} and ${count} tokens`; +} diff --git a/skills/anatomy/scripts/session.test.mjs b/skills/anatomy/scripts/session.test.mjs new file mode 100644 index 0000000..ebb10dc --- /dev/null +++ b/skills/anatomy/scripts/session.test.mjs @@ -0,0 +1,54 @@ +import assert from "node:assert/strict"; +import { mkdirSync, mkdtempSync, writeFileSync } from "node:fs"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +import { test } from "node:test"; +import { describe, fromThisSession, measure, parseMinutes, parseTokens } from "./session.mjs"; + +const at = (minute) => new Date(Date.UTC(2026, 9, 12, 10, 0) + minute * 60000).toISOString(); +const user = (minute, text) => ({ type: "user", timestamp: at(minute), message: { role: "user", content: text } }); +const reply = (minute, id, input, output, extra = {}) => ({ type: "assistant", timestamp: at(minute), message: { id, usage: { input_tokens: input, cache_creation_input_tokens: 1000, cache_read_input_tokens: 999999, output_tokens: output } }, ...extra }); +const lines = (entries) => entries.map((entry) => JSON.stringify(entry)).join("\n") + "\n"; + +function session() { + const root = mkdtempSync(join(tmpdir(), "session-")); + const id = "0123abcd-0000-0000-0000-000000000000"; + mkdirSync(join(root, "-work", id, "subagents"), { recursive: true }); + writeFileSync(join(root, "-work", `${id}.jsonl`), lines([ + user(0, "fix the readme"), + reply(1, "m0", 50, 50), + user(5, "/anatomy explain how a token bucket works, interactive"), + reply(6, "m1", 100, 200), + reply(6, "m1", 100, 400), + reply(8, "m2", 10, 20), + reply(70, "m3", 10, 20), + user(80, "publish this figure to the community gallery"), + reply(81, "m4", 5000, 5000), + ])); + writeFileSync(join(root, "-work", id, "subagents", "agent-1.jsonl"), lines([reply(7, "s1", 300, 300, { isSidechain: true, agentId: "a1" })])); + return { root, id }; +} + +test("time and tokens cover the figure's request up to the publish request", () => { + const { root, id } = session(); + const result = fromThisSession({ prompt: "/anatomy explain how a token bucket works, interactive", env: { CLAUDE_CODE_SESSION_ID: id }, root }); + assert.equal(result.tokens, 1100 + 400 + 1030 + 1030 + 1600); + assert.equal(result.minutes, 3 + 10); + assert.equal(result.from, at(5)); + assert.equal(result.to, at(80)); +}); + +test("no session, no numbers", () => { + assert.equal(fromThisSession({ env: {} }), null); + assert.equal(measure([]), null); +}); + +test("hand-given values are read like the gallery reads them", () => { + assert.equal(parseMinutes("1h30m"), 90); + assert.equal(parseMinutes("45"), 45); + assert.equal(parseMinutes("soon"), undefined); + assert.equal(parseTokens("1.2M"), 1200000); + assert.equal(parseTokens("450k"), 450000); + assert.equal(parseTokens("lots"), undefined); + assert.equal(describe({ minutes: 95, tokens: 1240000 }), "about 1 h 35 min and 1.2M tokens"); +}); diff --git a/skills/anatomy/scripts/turn-audit-samples.test.mjs b/skills/anatomy/scripts/turn-audit-samples.test.mjs new file mode 100644 index 0000000..52c2cc3 --- /dev/null +++ b/skills/anatomy/scripts/turn-audit-samples.test.mjs @@ -0,0 +1,26 @@ +import assert from "node:assert/strict"; +import test from "node:test"; +import { samplesOf } from "../kit/turn-audit.mjs"; +const clip = (from, to) => ({ from, to, periodic: false }); +test("a clip is sampled through its final instant and never past it", () => { + for (const [from, to, frame] of [[0, 1, 0.4], [0, 1, 0.3], [0, 0.42, 1 / 60], [0.5, 1.01, 1 / 60], [0, 2.5, 4 / 60]]) { + const xs = samplesOf(clip(from, to), frame); + assert.equal(xs[0], from); + assert.equal(xs[xs.length - 1], to); + assert.ok(xs.every((x, i) => x >= from && x <= to && (i === 0 || x > xs[i - 1])), `${from}..${to} by ${frame}: ${xs}`); + assert.ok(xs.every((x, i) => i === 0 || x - xs[i - 1] <= frame + 1e-9)); + } +}); +test("a clip whose length is a whole number of frames keeps its frames", () => { + assert.deepEqual(samplesOf(clip(0, 1), 0.25), [0, 0.25, 0.5, 0.75, 1]); + assert.equal(samplesOf(clip(0, 1), 1 / 60).length, 61); + assert.equal(samplesOf(clip(0, 1.5), 1 / 60).length, 91); +}); +test("an empty clip has a single sample", () => { + assert.deepEqual(samplesOf(clip(2, 2), 1 / 60), [2]); +}); +test("a periodic sweep still stops one frame short of the repeat", () => { + const xs = samplesOf({ from: 0, to: 360, periodic: true }, 90); + assert.deepEqual(xs, [0, 90, 180, 270]); + assert.equal(samplesOf({ from: 0, to: 360, periodic: true }, 0.3).length, 1200); +}); diff --git a/skills/anatomy/scripts/turn-bench.mjs b/skills/anatomy/scripts/turn-bench.mjs new file mode 100644 index 0000000..cfe425a --- /dev/null +++ b/skills/anatomy/scripts/turn-bench.mjs @@ -0,0 +1,74 @@ +import { resolve } from "node:path"; +import { pathToFileURL } from "node:url"; +import { TURN } from "../kit/turn.mjs"; + +const argv = process.argv.slice(2); +if (!argv.length || argv.includes("--help")) { + console.log(`Time a 3D figure's runtime in Node: emit and order over 360 angles, CPU time, median of 7 rounds. + + node scripts/turn-bench.mjs examples/turning-dial/build.mjs [--rounds 7] [--unit 1] + +The build module must export T (from turning()); if it also exports follow(values), every angle is mapped through it.`); + process.exit(argv.length ? 0 : 1); +} +const take = (flag, fallback) => { + const at = argv.indexOf(flag); + return at < 0 ? fallback : Number(argv[at + 1]); +}; +const rounds = take("--rounds", 7); +const unit = take("--unit", 1); +const mod = await import(pathToFileURL(resolve(argv[0])).href); +const T = mod.T; +const follow = mod.follow ?? ((values) => values); +const scene = TURN.prepare(T.data, { unit }); +const runs = scene.runs; +const frames = runs.map((run) => TURN.frame(run)); +const turn = T.groups.find((g) => g.kind === "turn"); +const angles = Array.from({ length: 360 }, (_, i) => i + 0.37); +const cams = angles.map((angle) => TURN.cams(scene, follow({ [turn.name]: angle }))); +for (let i = 0; i < 20; i++) for (const run of runs) TURN.emit(run, run.group >= 0 ? cams[i][run.group] : cams[i].world, frames[run.index]); +const perPart = runs.map(() => []); +const orderTimes = []; +const frameTimes = []; +const cpuFrames = []; +for (let round = 0; round < rounds; round++) { + const sums = new Float64Array(runs.length); + let orderSum = 0; + const cpu0 = process.cpuUsage(); + const wall0 = performance.now(); + const previous = scene.layers.map((layer) => layer.rest); + for (let a = 0; a < angles.length; a++) { + const c = cams[a]; + for (const run of runs) { + const t0 = performance.now(); + TURN.emit(run, run.group >= 0 ? c[run.group] : c.world, frames[run.index]); + sums[run.index] += performance.now() - t0; + } + const t1 = performance.now(); + scene.layers.forEach((layer, index) => { + previous[index] = TURN.order(layer, frames, c, previous[index], {}, scene); + }); + orderSum += performance.now() - t1; + } + const cpu = process.cpuUsage(cpu0); + cpuFrames.push((cpu.user + cpu.system) / 1000 / angles.length); + frameTimes.push((performance.now() - wall0) / angles.length); + orderTimes.push(orderSum / angles.length); + runs.forEach((run, index) => perPart[index].push(sums[index] / angles.length)); +} +const median = (list) => list.slice().sort((x, y) => x - y)[Math.floor(list.length / 2)]; +const kinds = new Map(); +runs.forEach((run, index) => { + const kind = run.kind === "tube" ? "tube chunk" : run.kind; + if (!kinds.has(kind)) kinds.set(kind, []); + kinds.get(kind).push(median(perPart[index])); +}); +console.log(`turn-bench ${argv[0]} · ${runs.length} parts · ${angles.length} angles · median of ${rounds} rounds · unit ${unit}`); +for (const [kind, list] of [...kinds].sort((a, b) => b[1].reduce((s, v) => s + v, 0) - a[1].reduce((s, v) => s + v, 0))) { + const total = list.reduce((s, v) => s + v, 0); + console.log(` ${kind.padEnd(11)} ${String(list.length).padStart(4)} parts · ${(total / list.length).toFixed(4)} ms per part · ${total.toFixed(3)} ms per frame · slowest ${Math.max(...list).toFixed(4)} ms`); +} +const slow = runs.map((run, index) => [run.name, median(perPart[index])]).sort((a, b) => b[1] - a[1]).slice(0, 6); +console.log(` slowest parts: ${slow.map(([name, ms]) => `${name} ${ms.toFixed(3)}`).join(" · ")}`); +console.log(` order ${median(orderTimes).toFixed(3)} ms per frame (${scene.layers.map((layer) => `${layer.name}: ${layer.parts.length} parts, ${layer.planar.length / 5} planes, ${layer.dynamic.length / 2} dynamic`).join("; ")})`); +console.log(` frame ${median(frameTimes).toFixed(3)} ms wall · ${median(cpuFrames).toFixed(3)} ms CPU`); diff --git a/skills/anatomy/scripts/turn-check.mjs b/skills/anatomy/scripts/turn-check.mjs new file mode 100644 index 0000000..a3a84bc --- /dev/null +++ b/skills/anatomy/scripts/turn-check.mjs @@ -0,0 +1,664 @@ +import { chromePort } from "./chrome-port.mjs"; +import { spawn } from "node:child_process"; +import { existsSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, rmSync, writeFileSync } from "node:fs"; +import { homedir, tmpdir } from "node:os"; +import { dirname, join, resolve } from "node:path"; +import { pathToFileURL } from "node:url"; +import { LINE_ENDS } from "./line-ends.mjs"; + +function usage() { + console.log(`Checks for 3D figures (turning groups). + + node turn-check.mjs build.mjs --fidelity [--angles 7,37,…] + Node: every live prism against k.extrude / G.prismOf, every round and lathe against G.lathe(smooth) and every tube + against tubePieces, at P'(θ). Control: one prism drawn 2° off must fail. + node turn-check.mjs page.html [--order] [--pops] [--lines] [--perf] [--step 1] [--states states.json] + [--width 1440] [--height 1100] [--scale 2] [--throttle 1] [--no-webgl] [--out dir] + --order needs a --verify build: the recorded shapes in a WebGL z-buffer (part-ID colours, 2x) against the live + layers' fills in DOM order. Fails on any live pair with 4 or more interior pixels. Static × live mismatches + are listed (the layer proofs and the orbit audit own them). Control: each live layer's order reversed at + 0, 90, 180 and 270 must give at least 1000 mismatched pixels. + --pops first difference θ → θ+0.02° at every step, and second difference at 0.1° over a full turn; control: one + part's fill hidden for one frame must fail. Run with --no-webgl and the tour held. + --lines LINE_ENDS at 24 angles (run it on the light and the dark page); control: a planted floating line must fail. + --perf 240 frames at 1.1° per frame driven through the controller inside requestAnimationFrame: script, task, + style and layout per frame, frame interval median and p95, live elements, writes and moves per frame. + --states a JSON list of value objects to visit instead of angles (gestures, a break-apart). + The angle is the figure's first turn group (window.__isoTurn.set(θ)).`); +} + +function chromePath() { + const candidates = [ + process.env.CHROME_PATH, + "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome", + "/Applications/Chromium.app/Contents/MacOS/Chromium", + "/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary", + "/usr/bin/google-chrome", + "/usr/bin/google-chrome-stable", + "/usr/bin/chromium", + "/usr/bin/chromium-browser", + "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe", + "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe", + ...(process.env.LOCALAPPDATA ? [join(process.env.LOCALAPPDATA, "Google\\Chrome\\Application\\chrome.exe")] : []), + "C:\\Program Files\\Microsoft\\Edge\\Application\\msedge.exe", + "C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe", + ].filter(Boolean); + const playwright = join(homedir(), "Library/Caches/ms-playwright"); + if (existsSync(playwright)) for (const dir of readdirSync(playwright).sort().reverse()) for (const sub of ["chrome-mac-arm64/Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing", "chrome-mac/Chromium.app/Contents/MacOS/Chromium", "chrome-linux/chrome"]) candidates.push(join(playwright, dir, sub)); + const linux = join(homedir(), ".cache/ms-playwright"); + if (existsSync(linux)) for (const dir of readdirSync(linux).sort().reverse()) for (const sub of ["chrome-linux64/chrome", "chrome-linux/chrome"]) candidates.push(join(linux, dir, sub)); + const win = join(homedir(), "AppData/Local/ms-playwright"); + if (existsSync(win)) for (const dir of readdirSync(win).sort().reverse()) for (const sub of ["chrome-win/chrome.exe", "chromium-win64/chrome.exe"]) candidates.push(join(win, dir, sub)); + return candidates.find((path) => existsSync(path)); +} + +async function browser(target, { width, height, scale, throttle, noWebgl }) { + const binary = chromePath(); + if (!binary) { + console.error("No Chrome found. Set CHROME_PATH to a Chrome or Chromium binary."); + process.exit(1); + } + const profile = mkdtempSync(join(tmpdir(), "turn-check-")); + const chrome = spawn(binary, ["--headless=new", ...(process.platform === "linux" ? ["--no-sandbox"] : []), ...(process.platform === "win32" ? ["--do-not-de-elevate"] : []), "--remote-debugging-port=0", `--user-data-dir=${profile}`, "--no-first-run", "--no-default-browser-check", "--hide-scrollbars", "--allow-file-access-from-files", "--enable-unsafe-swiftshader", "--ignore-gpu-blocklist", "about:blank"]); + const port = await chromePort(chrome, profile); + const page = await (await fetch(`http://127.0.0.1:${port}/json/new?about:blank`, { method: "PUT" })).json(); + const socket = new WebSocket(page.webSocketDebuggerUrl); + let id = 0; + const pending = new Map(); + const problems = []; + socket.onmessage = (message) => { + const data = JSON.parse(message.data); + if (data.id && pending.has(data.id)) { + pending.get(data.id)(data); + pending.delete(data.id); + } else if (data.method === "Runtime.consoleAPICalled" && (data.params.type === "error" || data.params.type === "warning")) problems.push(`console.${data.params.type}: ${data.params.args.map((arg) => arg.value ?? arg.description ?? "").join(" ").slice(0, 400)}`); + else if (data.method === "Runtime.exceptionThrown") problems.push(`exception: ${data.params.exceptionDetails.exception?.description ?? data.params.exceptionDetails.text}`.slice(0, 400)); + }; + await new Promise((done) => (socket.onopen = done)); + const send = (method, params = {}) => + new Promise((done) => { + const call = ++id; + pending.set(call, done); + socket.send(JSON.stringify({ id: call, method, params })); + }); + const evaluate = async (expression) => { + const result = await send("Runtime.evaluate", { expression, awaitPromise: true, returnByValue: true }); + if (result.result?.exceptionDetails) throw new Error(JSON.stringify(result.result.exceptionDetails).slice(0, 800)); + return result.result?.result?.value; + }; + await send("Runtime.enable"); + await send("Page.enable"); + const NO_GL = `(()=>{const get=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=function(kind,...rest){if(/webgl/.test(String(kind))&&!this.dataset.check)return null;return get.call(this,kind,...rest)}})();`; + if (noWebgl) await send("Page.addScriptToEvaluateOnNewDocument", { source: NO_GL }); + await send("Emulation.setDeviceMetricsOverride", { width, height, deviceScaleFactor: scale, mobile: width < 600 }); + if (throttle > 1) await send("Emulation.setCPUThrottlingRate", { rate: throttle }); + const url = /^https?:|^file:/.test(target) ? target : pathToFileURL(resolve(target)).href; + await send("Page.navigate", { url }); + await new Promise((done) => setTimeout(done, 1500)); + const close = () => { + socket.close(); + chrome.kill("SIGKILL"); + try { + rmSync(profile, { recursive: true, force: true }); + } catch {} + }; + return { send, evaluate, close, problems }; +} + +const HELPERS = String.raw`(() => { + const stage = document.querySelector(".iso-turn") || document.querySelector(".iso-stage"); + const svgs = [...stage.querySelectorAll(":scope > svg")]; + const hook = window.__isoTurn; + const C = hook.controller; + const vb = svgs[0].viewBox.baseVal; + const W = vb.width; + const H = vb.height; + const css = [...document.querySelectorAll("style")].map((s) => s.textContent).join("\n"); + const theme = (stage.closest("[data-theme]") || document.body).getAttribute("data-theme") || "dark"; + const setState = (state) => (typeof state === "number" ? C.set(state) : C.set(state)); + const matrixOf = (el) => { + const m = el.ownerSVGElement.getScreenCTM().inverse().multiply(el.getScreenCTM()); + return "matrix(" + m.a + " " + m.b + " " + m.c + " " + m.d + " " + m.e + " " + m.f + ")"; + }; + const decode = async (svg, w, h) => { + const url = URL.createObjectURL(new Blob([svg], { type: "image/svg+xml" })); + const image = new Image(); + await new Promise((done, fail) => { image.onload = done; image.onerror = fail; image.src = url; }); + const canvas = Object.assign(document.createElement("canvas"), { width: w, height: h }); + const ctx = canvas.getContext("2d", { willReadFrequently: true }); + ctx.drawImage(image, 0, 0, w, h); + URL.revokeObjectURL(url); + return ctx.getImageData(0, 0, w, h).data; + }; + window.__tc = { stage, svgs, hook, C, W, H, css, theme, setState, matrixOf, decode }; + return { W, H, layers: svgs.map((s) => s.dataset.live || null), theme }; +})()`; + +const ZBUFFER = String.raw`(() => { + const { svgs, C, W, H, setState, matrixOf, decode } = window.__tc; + const V = window.__isoVerify; + const SCALE = 2; + const w = W * SCALE; + const h = H * SCALE; + const STATIC = 30000; + const add3 = (a, b) => [a[0] + b[0], a[1] + b[1], a[2] + b[2]]; + const mul3 = (a, k) => [a[0] * k, a[1] * k, a[2] * k]; + const sub3 = (a, b) => [a[0] - b[0], a[1] - b[1], a[2] - b[2]]; + const dot3 = (a, b) => a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; + const cross3 = (a, b) => [a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0]]; + const unit3 = (a) => { const l = Math.hypot(a[0], a[1], a[2]) || 1; return [a[0] / l, a[1] / l, a[2] / l]; }; + const frameOf = (F) => { + if (F.u && F.v) return F; + const a = unit3(F.a); + const helper = Math.abs(a[2]) > 0.9 ? [1, 0, 0] : [0, 0, 1]; + const u = unit3(cross3(helper, a)); + return { o: F.o, a, u, v: cross3(a, u) }; + }; + function meshOf(shape) { + const tris = []; + const quad = (a, b, c, d) => tris.push(a, b, c, a, c, d); + if (shape.kind === "prism") { + const F = frameOf(shape.F); + const at = (s, [x, y]) => add3(add3(F.o, mul3(F.a, s)), add3(mul3(F.u, x), mul3(F.v, y))); + const n = shape.poly.length; + const centre = shape.poly.reduce((s, p) => [s[0] + p[0] / n, s[1] + p[1] / n], [0, 0]); + for (const s of [shape.s0, shape.s1]) for (let i = 0; i < n; i++) tris.push(at(s, centre), at(s, shape.poly[i]), at(s, shape.poly[(i + 1) % n])); + for (let i = 0; i < n; i++) quad(at(shape.s0, shape.poly[i]), at(shape.s0, shape.poly[(i + 1) % n]), at(shape.s1, shape.poly[(i + 1) % n]), at(shape.s1, shape.poly[i])); + } else if (shape.kind === "body") { + const F = frameOf(shape.F); + const count = 72; + const ring = (s, r) => Array.from({ length: count }, (_, j) => { const t = (j / count) * Math.PI * 2; return add3(add3(F.o, mul3(F.a, s)), add3(mul3(F.u, r * Math.cos(t)), mul3(F.v, r * Math.sin(t)))); }); + const poly = shape.poly; + for (let i = 0; i < poly.length; i++) { + const [s0, r0] = poly[i]; + const [s1, r1] = poly[(i + 1) % poly.length]; + if (r0 < 1e-9 && r1 < 1e-9) continue; + const a = ring(s0, r0); + const b = ring(s1, r1); + for (let j = 0; j < count; j++) quad(a[j], a[(j + 1) % count], b[(j + 1) % count], b[j]); + } + } else if (shape.kind === "ball") { + const rows = 32; + const cols = 64; + const flats = shape.flats || []; + const at = (i, j) => { + const phi = (i / rows) * Math.PI; + const t = (j / cols) * Math.PI * 2; + let n = [Math.sin(phi) * Math.cos(t), Math.sin(phi) * Math.sin(t), Math.cos(phi)]; + let p = mul3(n, shape.r); + for (const [nx, ny, nz, d] of flats) { + const k = nx * p[0] + ny * p[1] + nz * p[2]; + if (k > d) p = sub3(p, mul3([nx, ny, nz], k - d)); + } + return add3(shape.o, p); + }; + for (let i = 0; i < rows; i++) for (let j = 0; j < cols; j++) quad(at(i, j), at(i, j + 1), at(i + 1, j + 1), at(i + 1, j)); + } else if (shape.kind === "box") { + const c = (sx, sy, sz) => add3(shape.o, add3(add3(mul3(shape.axes[0], sx * shape.half[0]), mul3(shape.axes[1], sy * shape.half[1])), mul3(shape.axes[2], sz * shape.half[2]))); + const v = [c(-1, -1, -1), c(1, -1, -1), c(1, 1, -1), c(-1, 1, -1), c(-1, -1, 1), c(1, -1, 1), c(1, 1, 1), c(-1, 1, 1)]; + for (const [a, b, cc, d] of [[0, 1, 2, 3], [4, 5, 6, 7], [0, 1, 5, 4], [1, 2, 6, 5], [2, 3, 7, 6], [3, 0, 4, 7]]) quad(v[a], v[b], v[cc], v[d]); + } else if (shape.kind === "tube") { + const pts = []; + const radii = []; + shape.points.forEach((p, i) => { + if (pts.length && Math.hypot(p[0] - pts[pts.length - 1][0], p[1] - pts[pts.length - 1][1], p[2] - pts[pts.length - 1][2]) < 1e-6) return; + pts.push(p); + radii.push(shape.radii[i]); + }); + if (pts.length < 2) return tris; + const count = 20; + let u = null; + const rings = pts.map((p, i) => { + const t = unit3(sub3(pts[Math.min(pts.length - 1, i + 1)], pts[Math.max(0, i - 1)])); + if (!u) { const helper = Math.abs(t[2]) > 0.9 ? [1, 0, 0] : [0, 0, 1]; u = unit3(cross3(helper, t)); } else u = unit3(sub3(u, mul3(t, dot3(u, t)))); + const v = cross3(t, u); + const r = radii[i]; + return Array.from({ length: count }, (_, j) => { const a = (j / count) * Math.PI * 2; return add3(p, add3(mul3(u, r * Math.cos(a)), mul3(v, r * Math.sin(a)))); }); + }); + for (let i = 0; i < rings.length - 1; i++) for (let j = 0; j < count; j++) quad(rings[i][j], rings[i][(j + 1) % count], rings[i + 1][(j + 1) % count], rings[i + 1][j]); + for (const [index, p] of [[0, pts[0]], [rings.length - 1, pts[pts.length - 1]]]) for (let j = 0; j < count; j++) tris.push(p, rings[index][j], rings[index][(j + 1) % count]); + } + return tris; + } + const canvas = Object.assign(document.createElement("canvas"), { width: w, height: h }); + canvas.dataset.check = "1"; + const gl = canvas.getContext("webgl", { antialias: false, preserveDrawingBuffer: true, alpha: false, depth: true }); + const vs = "attribute vec3 p;uniform vec3 uR0;uniform vec3 uR1;uniform vec3 uR2;uniform vec3 uT;uniform vec3 uM0;uniform vec3 uM1;uniform vec2 uO;uniform vec3 uV;uniform vec2 uView;uniform float uSpan;void main(){vec3 q=vec3(dot(uR0,p),dot(uR1,p),dot(uR2,p))+uT;vec2 s=uO+vec2(dot(uM0,q),dot(uM1,q));gl_Position=vec4(s.x/uView.x*2.-1.,1.-s.y/uView.y*2.,-dot(uV,q)/uSpan,1.);}"; + const fs = "precision highp float;uniform vec3 uId;void main(){gl_FragColor=vec4(uId,1.);}"; + const compile = (type, source) => { const sh = gl.createShader(type); gl.shaderSource(sh, source); gl.compileShader(sh); if (!gl.getShaderParameter(sh, gl.COMPILE_STATUS)) throw new Error(gl.getShaderInfoLog(sh)); return sh; }; + const program = gl.createProgram(); + gl.attachShader(program, compile(gl.VERTEX_SHADER, vs)); + gl.attachShader(program, compile(gl.FRAGMENT_SHADER, fs)); + gl.linkProgram(program); + gl.useProgram(program); + const loc = (name) => gl.getUniformLocation(program, name); + const where = { p: gl.getAttribLocation(program, "p"), R0: loc("uR0"), R1: loc("uR1"), R2: loc("uR2"), T: loc("uT"), M0: loc("uM0"), M1: loc("uM1"), O: loc("uO"), V: loc("uV"), view: loc("uView"), span: loc("uSpan"), id: loc("uId") }; + const bufferOf = (shapes) => { + const pos = []; + for (const shape of shapes) for (const p of meshOf(shape)) pos.push(p[0], p[1], p[2]); + const b = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, b); + gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(pos), gl.STATIC_DRAW); + return { b, count: pos.length / 3 }; + }; + const parts = V.parts.map((part, index) => ({ index, group: part.group, name: part.name, mesh: bufferOf(part.shapes) })); + const statics = V.statics.map((item) => ({ rank: item.rank, mesh: bufferOf(item.shapes) })); + const colour = (id) => [((id + 1) & 255) / 255, (((id + 1) >> 8) & 255) / 255, 0]; + const zIds = () => { + const cams = C.cams(); + const world = cams.world; + gl.viewport(0, 0, w, h); + gl.enable(gl.DEPTH_TEST); + gl.depthFunc(gl.LESS); + gl.clearColor(0, 0, 0, 1); + gl.clearDepth(1); + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); + gl.uniform3f(where.M0, world.m[0], world.m[1], world.m[2]); + gl.uniform3f(where.M1, world.m[3], world.m[4], world.m[5]); + gl.uniform2f(where.O, world.ox, world.oy); + gl.uniform3f(where.V, world.V[0], world.V[1], world.V[2]); + gl.uniform2f(where.view, W, H); + gl.uniform1f(where.span, 4000); + const draw = (mesh, R, t, id) => { + gl.uniform3f(where.R0, R[0], R[1], R[2]); + gl.uniform3f(where.R1, R[3], R[4], R[5]); + gl.uniform3f(where.R2, R[6], R[7], R[8]); + gl.uniform3f(where.T, t[0], t[1], t[2]); + gl.uniform3fv(where.id, colour(id)); + gl.bindBuffer(gl.ARRAY_BUFFER, mesh.b); + gl.enableVertexAttribArray(where.p); + gl.vertexAttribPointer(where.p, 3, gl.FLOAT, false, 0, 0); + gl.drawArrays(gl.TRIANGLES, 0, mesh.count); + }; + const eye = [1, 0, 0, 0, 1, 0, 0, 0, 1]; + for (const item of statics) draw(item.mesh, eye, [0, 0, 0], STATIC + item.rank); + for (const part of parts) { + const cam = part.group >= 0 ? cams[part.group] : null; + draw(part.mesh, cam ? cam.R : eye, cam ? cam.t : [0, 0, 0], part.index); + } + const pixels = new Uint8Array(w * h * 4); + gl.readPixels(0, 0, w, h, gl.RGBA, gl.UNSIGNED_BYTE, pixels); + const ids = new Int32Array(w * h); + for (let y = 0; y < h; y++) for (let x = 0; x < w; x++) { const i = ((h - 1 - y) * w + x) * 4; ids[y * w + x] = pixels[i] + pixels[i + 1] * 256 - 1; } + return ids; + }; + const toId = (id) => "rgb(" + ((id + 1) & 255) + "," + (((id + 1) >> 8) & 255) + ",0)"; + const painterSvg = (reverse = false) => { + const out = []; + let rank = 0; + for (const svg of svgs) { + if (svg.dataset.live) { + const nodes = [...svg.querySelectorAll("[data-p]")]; + if (reverse) nodes.reverse(); + for (const node of nodes) for (const el of node.querySelectorAll(".iso-fill, .tb-body")) out.push(''); + } else { + for (const el of svg.querySelectorAll(".iso-fill, .tb-body")) out.push(''); + rank++; + } + } + return '' + out.join("") + ""; + }; + const pIds = async (reverse) => { + const data = await decode(painterSvg(reverse), w, h); + const ids = new Int32Array(w * h); + for (let i = 0; i < w * h; i++) ids[i] = data[i * 4] + data[i * 4 + 1] * 256 - 1; + return ids; + }; + const nameOf = (id) => (id >= STATIC ? "static layer " + (id - STATIC) : id < 0 ? "empty" : V.parts[id].name); + const joint = (a, b) => { + const m = /^(.*):(\d+)$/; + const x = a.match(m); + const y = b.match(m); + return Boolean(x && y && x[1] === y[1] && Math.abs(Number(x[2]) - Number(y[2])) <= 1); + }; + async function check(state, { reverse = false } = {}) { + setState(state); + const Z = zIds(); + const P = await pIds(reverse); + const tally = new Map(); + const interior = (ids, i, x, y) => { + const v = ids[i]; + for (let dy = -1; dy <= 1; dy++) for (let dx = -1; dx <= 1; dx++) { const xx = x + dx; const yy = y + dy; if (xx < 0 || yy < 0 || xx >= w || yy >= h || ids[yy * w + xx] !== v) return false; } + return true; + }; + let total = 0; + for (let y = 1; y < h - 1; y++) + for (let x = 1; x < w - 1; x++) { + const i = y * w + x; + const p = P[i]; + const z = Z[i]; + if (p === z || p < 0 || z < 0) continue; + if (!interior(P, i, x, y) || !interior(Z, i, x, y)) continue; + const key = p + "|" + z; + tally.set(key, (tally.get(key) || 0) + 1); + total++; + } + const live = []; + const layers = []; + for (const [key, px] of tally) { + const [p, z] = key.split("|").map(Number); + const a = nameOf(p); + const b = nameOf(z); + if (p >= STATIC || z >= STATIC) layers.push({ painter: a, truth: b, px }); + else if (!joint(a, b)) live.push({ painter: a, truth: b, px }); + } + live.sort((x, y) => y.px - x.px); + layers.sort((x, y) => y.px - x.px); + return { total, live, layers, stats: C.stats() }; + } + async function footprint(state, name) { + setState(state); + const index = V.parts.findIndex((part) => part.name === name); + const Z = zIds(); + const P = await pIds(false); + const boxOf = (ids) => { + let n = 0, x0 = w, y0 = h, x1 = -1, y1 = -1; + for (let i = 0; i < ids.length; i++) if (ids[i] === index) { n++; const x = i % w, y = (i / w) | 0; x0 = Math.min(x0, x); y0 = Math.min(y0, y); x1 = Math.max(x1, x); y1 = Math.max(y1, y); } + return { px: n, box: n ? [x0 / SCALE, y0 / SCALE, x1 / SCALE, y1 / SCALE] : null }; + }; + return { painter: boxOf(P), truth: boxOf(Z) }; + } + window.__tc.order = { check, footprint }; + return { parts: parts.length, statics: statics.length, w, h }; +})()`; + +const POPS = String.raw`(() => { + const { stage, svgs, W, H, css, theme, setState, decode } = window.__tc; + const SCALE = 2; + const w = W * SCALE; + const h = H * SCALE; + let hidden = null; + const svgString = () => '' + svgs.map((s) => '' + s.innerHTML + "").join("") + ""; + async function render(state, hide = null) { + setState(state); + if (hide !== null) { + hidden = stage.querySelector('[data-p="' + hide + '"]'); + if (hidden) hidden.setAttribute("display", "none"); + } + const data = await decode(svgString(), w, h); + if (hidden) { + hidden.removeAttribute("display"); + hidden = null; + } + const lum = new Float32Array(w * h); + for (let i = 0; i < w * h; i++) lum[i] = 0.2126 * data[i * 4] + 0.7152 * data[i * 4 + 1] + 0.0722 * data[i * 4 + 2]; + return lum; + } + const erode = (mask) => { + const out = new Uint8Array(w * h); + for (let y = 1; y < h - 1; y++) + for (let x = 1; x < w - 1; x++) { + const i = y * w + x; + if (!mask[i]) continue; + let all = 1; + for (let dy = -1; dy <= 1 && all; dy++) for (let dx = -1; dx <= 1; dx++) if (!mask[i + dy * w + dx]) { all = 0; break; } + out[i] = all; + } + return out; + }; + const regionOf = (mask) => { + let n = 0; + let x0 = w, y0 = h, x1 = -1, y1 = -1; + for (let y = 0; y < h; y++) for (let x = 0; x < w; x++) if (mask[y * w + x]) { n++; x0 = Math.min(x0, x); y0 = Math.min(y0, y); x1 = Math.max(x1, x); y1 = Math.max(y1, y); } + return { n, box: n ? [x0 / SCALE, y0 / SCALE, x1 / SCALE, y1 / SCALE].map((v) => Math.round(v * 10) / 10) : null }; + }; + async function first(a, b, hide = null) { + const A = await render(a); + const B = await render(b, hide); + let mask = new Uint8Array(w * h); + for (let i = 0; i < w * h; i++) if (Math.abs(A[i] - B[i]) >= 5) mask[i] = 1; + mask = erode(erode(mask)); + return regionOf(mask); + } + let cache = null; + async function second(a, b, c) { + const A = cache && cache.x === a ? cache.lum : await render(a); + const B = cache && cache.y === b ? cache.mid : await render(b); + const Cl = await render(c); + cache = { x: b, lum: B, y: c, mid: Cl }; + let mask = new Uint8Array(w * h); + for (let y = 1; y < h - 1; y++) + for (let x = 1; x < w - 1; x++) { + const i = y * w + x; + const e = Math.abs(2 * B[i] - A[i] - Cl[i]); + if (e <= 6) continue; + let flat = true; + for (let dy = -1; dy <= 1 && flat; dy++) for (let dx = -1; dx <= 1; dx++) if (Math.abs(B[i + dy * w + dx] - B[i]) > 4) { flat = false; break; } + if (e > 56 || flat) mask[i] = 1; + } + mask = erode(mask); + const region = regionOf(mask); + if (window.__tcDump && region.n >= 6 && !window.__tcDumped) { + window.__tcDumped = true; + const png = (lum, scaleBy = 1) => { + const canvas = Object.assign(document.createElement("canvas"), { width: w, height: h }); + const ctx = canvas.getContext("2d"); + const img = ctx.createImageData(w, h); + for (let i = 0; i < w * h; i++) { + const v = Math.max(0, Math.min(255, lum[i] * scaleBy)); + img.data[i * 4] = img.data[i * 4 + 1] = img.data[i * 4 + 2] = v; + img.data[i * 4 + 3] = 255; + } + ctx.putImageData(img, 0, 0); + return canvas.toDataURL("image/png").split(",")[1]; + }; + const diff = new Float32Array(w * h); + for (let i = 0; i < w * h; i++) diff[i] = Math.abs(2 * B[i] - A[i] - Cl[i]); + window.__tcDumped = { a: png(A), b: png(B), c: png(Cl), e: png(diff, 4) }; + } + return region; + } + window.__tc.pops = { first, second, render }; + return { w, h }; +})()`; + +const PERF = String.raw`(async (frames, step, group) => { + const { C, stage } = window.__tc; + const name = group || C.scene().groups.find((g) => g.kind === "turn")?.name; + const base = C.values[name] || 0; + const ms = []; + const writes = []; + const moved = []; + const times = []; + await new Promise((done) => { + let i = 0; + const tick = (now) => { + times.push(now); + const s = C.set({ [name]: base + i * step }); + ms.push(s.ms); + writes.push(s.writes); + moved.push(s.moved); + i++; + if (i < frames) requestAnimationFrame(tick); + else done(); + }; + requestAnimationFrame(tick); + }); + const gaps = times.slice(1).map((t, i) => t - times[i]).sort((a, b) => a - b); + const sorted = (list) => list.slice().sort((a, b) => a - b); + const median = (list) => sorted(list)[Math.floor(list.length / 2)]; + const p95 = (list) => sorted(list)[Math.floor(list.length * 0.95)]; + const live = [...stage.querySelectorAll("svg[data-live] *")].length; + return { frames, setMedian: median(ms), setP95: p95(ms), writes: median(writes), moved: median(moved), gapMedian: median(gaps), gapP95: p95(gaps), live }; +})`; + +async function main() { + const argv = process.argv.slice(2); + if (!argv.length || argv.includes("--help") || argv.includes("-h")) { + usage(); + process.exit(argv.length ? 0 : 1); + } + const value = (flag, fallback) => { + const at = argv.indexOf(flag); + return at >= 0 ? argv[at + 1] : fallback; + }; + const target = argv[0]; + let failed = 0; + if (target.endsWith(".mjs")) { + const F = await import("./turn-fidelity.mjs"); + const { T, P } = await import(pathToFileURL(resolve(target)).href); + const angles = (value("--angles", "") || Array.from({ length: 12 }, (_, i) => 7 + i * 30).join(",")).split(",").map(Number); + const plant = T.parts.find((part) => part.kind === "prism" && part.group && part.group.kind === "turn"); + if (plant) { + const control = F.identity(T, P, angles.slice(0, 2), { plant: plant.name }); + console.log(`control (${plant.name} drawn 2° off): ${control.pass ? "did not fail: the check is broken" : "fails as it should"}`); + if (control.pass) failed++; + } + for (const [name, run] of [["prisms", F.identity], ["rounds", F.rounds], ["tubes", F.tubes]]) { + const result = run(T, P, angles); + console.log(result.text); + for (const line of result.worst) console.log(` ${line}`); + if (!result.pass) { + console.log(`${name} FAILED`); + failed++; + } + } + console.log(failed ? `fidelity failed: ${failed}` : "fidelity passed"); + process.exit(failed ? 1 : 0); + } + const options = { width: Number(value("--width", 1440)), height: Number(value("--height", 1100)), scale: Number(value("--scale", argv.includes("--perf") ? (Number(value("--width", 1440)) < 600 ? 3 : 2) : 1)), throttle: Number(value("--throttle", 1)), noWebgl: argv.includes("--no-webgl") }; + const step = Number(value("--step", 1)); + if (!Number.isFinite(step) || step <= 0 || step > 360) throw new Error("--step must be a finite number greater than 0 and at most 360 degrees"); + const fine = Number(value("--fine", 0.1)); + if (argv.includes("--pops") && (!Number.isFinite(fine) || fine <= 0 || fine > 180)) throw new Error("--fine must be a finite number greater than 0 and at most 180 degrees"); + const out = value("--out", null); + const statesFile = value("--states", null); + const states = statesFile ? JSON.parse(readFileSync(statesFile, "utf8")) : null; + if (statesFile && (!Array.isArray(states) || !states.length)) throw new Error("--states must contain a nonempty JSON list of poses"); + const page = await browser(target, options); + const labelOf = (state, index) => (typeof state === "number" ? `${state.toFixed(3)}°` : `state ${index}`); + try { + const info = await page.evaluate(HELPERS); + console.log(`page ${info.W}×${info.H} · live layers ${info.layers.filter(Boolean).join(", ")} · theme ${info.theme}`); + await page.evaluate(`window.__isoTurn.set(0) && 0`); + const sweep = states ?? Array.from({ length: Math.round(360 / step) }, (_, i) => i * step); + if (argv.includes("--order")) { + const has = await page.evaluate("Boolean(window.__isoVerify)"); + if (!has) { + console.log("order: this page has no window.__isoVerify; build it with --verify"); + failed++; + } else { + const z = await page.evaluate(ZBUFFER); + console.log(`order: ${z.parts} live parts and ${z.statics} static items meshed, z-buffer ${z.w}×${z.h}`); + let control = Infinity; + for (const angle of [0, 90, 180, 270]) { + const r = await page.evaluate(`window.__tc.order.check(${angle}, { reverse: true }).then((r) => r.live.reduce((s, p) => s + p.px, 0))`); + control = Math.min(control, r); + } + console.log(`order control (each live layer reversed at 0, 90, 180, 270): least ${control} mismatched px ${control >= 1000 ? "· fails as it should" : "· did not fail: the check is broken"}`); + if (control < 1000) failed++; + const probe = value("--part", null); + if (probe) for (const state of sweep.slice(0, 12)) console.log(` ${probe} at ${JSON.stringify(state)}: ${JSON.stringify(await page.evaluate(`window.__tc.order.footprint(${JSON.stringify(state)}, ${JSON.stringify(probe)})`))}`); + let bad = 0; + const layerNotes = new Map(); + let worst = 0; + for (let index = 0; index < sweep.length; index++) { + const state = sweep[index]; + const r = await page.evaluate(`window.__tc.order.check(${JSON.stringify(state)})`); + const errors = r.live.filter((p) => p.px >= 4); + worst = Math.max(worst, ...r.live.map((p) => p.px), 0); + if (errors.length) { + bad++; + if (bad <= 30) console.log(` ${labelOf(state, index)}: ${errors.map((e) => `${e.painter} over ${e.truth} ${e.px} px`).join(" · ")}${r.stats.forced ? ` · forced ${r.stats.forced}` : ""}`); + } + for (const l of r.layers) if (l.px >= 16) layerNotes.set(`${l.painter} / ${l.truth}`, Math.max(layerNotes.get(`${l.painter} / ${l.truth}`) ?? 0, l.px)); + } + console.log(`order: ${sweep.length} states · ${bad} with a live pair drawn out of order (4+ interior px at 2x) · worst live pair ${worst} px`); + if (layerNotes.size) console.log(` static × live (recorded static shapes are stand-ins; the layer proofs own these): ${[...layerNotes].slice(0, 8).map(([k, v]) => `${k} ${v}px`).join(" · ")}`); + if (bad) failed++; + } + } + if (argv.includes("--pops")) { + await page.evaluate(POPS); + if (out) await page.evaluate("window.__tcDump = true"); + const plantPart = await page.evaluate(`(() => { const svgs = [...document.querySelectorAll("svg[data-live]")]; const parts = [...svgs[svgs.length - 1].querySelectorAll("[data-p]")]; let best = null; let area = 0; for (const el of parts) { const b = el.getBBox(); if (b.width * b.height > area) { area = b.width * b.height; best = el; } } return best ? Number(best.dataset.p) : null; })()`); + const plantAt = typeof sweep[0] === "number" ? 37 : sweep[0]; + const control = await page.evaluate(`window.__tc.pops.first(${JSON.stringify(plantAt)}, ${JSON.stringify(typeof plantAt === "number" ? plantAt + 0.02 : plantAt)}, ${plantPart})`); + console.log(`pops control (part ${plantPart} hidden for one frame): ${control.n ? `${control.n} px flagged · fails as it should` : "nothing flagged: the check is broken"}`); + if (!control.n) failed++; + let firstBad = 0; + const firstStates = states ?? Array.from({ length: Math.round(360 / step) }, (_, i) => i * step); + for (let index = 0; index < firstStates.length; index++) { + const a = firstStates[index]; + const b = typeof a === "number" ? a + 0.02 : firstStates[index + 1]; + if (b === undefined) break; + const r = await page.evaluate(`window.__tc.pops.first(${JSON.stringify(a)}, ${JSON.stringify(b)})`); + if (r.n) { + firstBad++; + if (firstBad <= 20) console.log(` first difference ${labelOf(a, index)}: ${r.n} px survive two erosions in ${r.box.join(",")}`); + } + } + console.log(`pops, first difference: ${firstStates.length} steps · ${firstBad} with a surviving region`); + if (firstBad) failed++; + if (!states) { + let cores = 0; + const small = []; + for (let x = 0; x + 2 * fine <= 360 + 1e-9; x += fine) { + const r = await page.evaluate(`window.__tc.pops.second(${x.toFixed(4)}, ${(x + fine).toFixed(4)}, ${(x + 2 * fine).toFixed(4)})`); + if (r.n >= 6) { + cores++; + if (cores <= 20) console.log(` second difference at ${(x + fine).toFixed(2)}°: core of ${r.n} px in ${r.box.join(",")}`); + } else if (r.n) small.push(`${(x + fine).toFixed(2)}° ${r.n} px in ${r.box.join(",")}`); + } + console.log(`pops, second difference at ${fine}° over a full turn: ${cores} cores of 6+ px · ${small.length} small cores to read${small.length ? `: ${small.slice(0, 12).join(" · ")}` : ""}`); + const dumped = out ? await page.evaluate("window.__tcDumped && typeof window.__tcDumped === 'object' ? window.__tcDumped : null") : null; + if (dumped) { + mkdirSync(out, { recursive: true }); + for (const [key, data] of Object.entries(dumped)) writeFileSync(join(out, `pops-core-${key}.png`), Buffer.from(data, "base64")); + console.log(` first core dumped to ${out}/pops-core-{a,b,c,e}.png`); + } + if (cores) failed++; + } + } + if (argv.includes("--lines")) { + const angles = Array.from({ length: 24 }, (_, i) => i * 15); + const planted = await page.evaluate(`(() => { window.__isoTurn.set(0); const part = document.querySelector("svg[data-live] [data-p]"); const el = document.createElementNS("http://www.w3.org/2000/svg", "path"); el.setAttribute("class", "iso-line"); el.setAttribute("data-tone", "lo"); el.setAttribute("d", "M5 5L25 9"); el.setAttribute("data-plant", ""); part.appendChild(el); const r = (${LINE_ENDS})({ select: null, show: false }); el.remove(); return r ? r.problems.length : -1; })()`); + console.log(`lines control (a planted floating line): ${planted > 0 ? "fails as it should" : "nothing flagged: the check is broken"}`); + if (!(planted > 0)) failed++; + let bad = 0; + for (const angle of angles) { + const r = await page.evaluate(`(() => { window.__isoTurn.set(${angle}); const r = (${LINE_ENDS})({ select: null, show: false }); return r ? { n: r.problems.length, list: r.problems.slice(0, 4).map((p) => p.what + " " + p.end + " " + p.gap.toFixed(2) + " px at " + p.at.join(",")) } : null; })()`); + if (r && r.n) { + bad += r.n; + console.log(` ${angle}°: ${r.n} floating ends: ${r.list.join(" · ")}`); + } + } + console.log(`lines: ${angles.length} angles · ${bad} floating ends`); + if (bad) failed++; + } + if (argv.includes("--perf")) { + await page.send("Performance.enable"); + const metrics = async () => Object.fromEntries((await page.send("Performance.getMetrics")).result.metrics.map((m) => [m.name, m.value])); + const runs = []; + for (let r = 0; r < 3; r++) { + const before = await metrics(); + const result = await page.evaluate(`(${PERF})(240, 1.1, null)`); + const after = await metrics(); + const per = (key) => ((after[key] - before[key]) * 1000) / result.frames; + runs.push({ ...result, task: per("TaskDuration"), script: per("ScriptDuration"), style: per("RecalcStyleDuration"), layout: per("LayoutDuration") }); + } + const med = (key) => runs.map((r) => r[key]).sort((a, b) => a - b)[1]; + console.log(`perf at ${options.width} px, DPR ${options.scale}, ${options.throttle}× CPU, median of 3 runs of 240 frames at 1.1°: set() ${med("setMedian").toFixed(2)} ms (p95 ${med("setP95").toFixed(2)}) · task ${med("task").toFixed(2)} ms · script ${med("script").toFixed(2)} ms · style ${med("style").toFixed(2)} ms · layout ${med("layout").toFixed(2)} ms per frame · frame interval ${med("gapMedian").toFixed(1)} ms (p95 ${med("gapP95").toFixed(1)}) · ${runs[0].live} live elements · ${med("writes")} writes and ${med("moved")} moves per frame`); + if (out) { + mkdirSync(out, { recursive: true }); + writeFileSync(join(out, `perf-${options.width}-${options.throttle}x.json`), JSON.stringify(runs, null, 1)); + } + } + console.log(page.problems.length ? page.problems.join("\n") : "console: clean"); + if (page.problems.length) failed++; + } catch (error) { + console.error(error); + failed++; + } finally { + page.close(); + } + console.log(failed ? `turn check failed: ${failed}` : "turn check passed"); + process.exit(failed ? 1 : 0); +} + +if (typeof WebSocket === "undefined" && !process.execArgv.includes("--experimental-websocket")) { + const child = spawn(process.execPath, ["--experimental-websocket", ...process.argv.slice(1)], { stdio: "inherit" }); + child.on("exit", (code) => process.exit(code ?? 1)); +} else { + await main(); +} diff --git a/skills/anatomy/scripts/turn-convex-check.test.mjs b/skills/anatomy/scripts/turn-convex-check.test.mjs new file mode 100644 index 0000000..c2329ba --- /dev/null +++ b/skills/anatomy/scripts/turn-convex-check.test.mjs @@ -0,0 +1,30 @@ +import assert from "node:assert/strict"; +import test from "node:test"; +import * as G from "../kit/lathe.mjs"; +import { turning } from "../kit/turn-build.mjs"; +const prism = (polygon, options = {}) => { + const T = turning({ origin: [0, 0], scale: 1, azimuth: 45, elevation: 30 }); T.layer("all"); + const F = G.frameAlong([0, 0, 0], [0, 0, 1]); + return T.prism({ name: "part", F, s0: 0, s1: 2, polygon, ...options }); +}; +const regular = (count, step, radius = 3) => Array.from({ length: count }, (_, i) => [radius * Math.cos(Math.PI / 2 + i * step), radius * Math.sin(Math.PI / 2 + i * step)]); +test("a pentagram is not a convex prism", () => { + assert.throws(() => prism(regular(5, (4 * Math.PI) / 5)), /part is not convex/); +}); +test("a heptagram is not a convex prism, in either winding", () => { + assert.throws(() => prism(regular(7, (4 * Math.PI) / 7)), /part is not convex/); + assert.throws(() => prism(regular(7, (4 * Math.PI) / 7).reverse()), /part is not convex/); +}); +test("a bowtie and an L shape are still rejected", () => { + assert.throws(() => prism([[0, 0], [2, 2], [2, 0], [0, 2]]), /part is not convex/); + assert.throws(() => prism([[0, 0], [4, 0], [4, 1], [1, 1], [1, 4], [0, 4]]), /part is not convex/); +}); +test("convex polygons are still accepted, whichever way they wind", () => { + for (const polygon of [regular(3, (2 * Math.PI) / 3), regular(5, (2 * Math.PI) / 5), regular(12, (2 * Math.PI) / 12), regular(6, (2 * Math.PI) / 6).reverse(), [[0, 0], [5, 0], [10, 0], [10, 10], [0, 10]]]) { + assert.equal(prism(polygon).world.ring.length, polygon.length); + } + assert.ok(prism([[0, 0], [10, 0], [10, 10], [0, 10]], { round: 2, steps: 6 }).world.ring.length > 4); +}); +test("a repeated vertex does not make a convex polygon look concave", () => { + assert.equal(prism([[0, 0], [4, 0], [4, 0], [4, 4], [0, 4], [0, 0]]).world.ring.length, 6); +}); diff --git a/skills/anatomy/scripts/turn-fidelity.mjs b/skills/anatomy/scripts/turn-fidelity.mjs new file mode 100644 index 0000000..fc49917 --- /dev/null +++ b/skills/anatomy/scripts/turn-fidelity.mjs @@ -0,0 +1,414 @@ +import * as k from "../kit/iso-kit.mjs"; +import * as G from "../kit/lathe.mjs"; +import { tubePieces } from "../kit/tube.mjs"; +import { TURN } from "../kit/turn.mjs"; + +const rootOf = (group) => { + let root = group; + while (root && root.parent) root = root.parent; + return root && root.kind === "turn" ? root : null; +}; +const restValues = (T, theta) => Object.fromEntries(T.groups.map((g) => [g.name, g.kind === "turn" && !g.parent ? theta : g.kind === "free" ? null : 0])); + +export function identity(T, P, angles, { plant = null } = {}) { + const scene = TURN.prepare(T.data, { unit: 1 }); +const subpaths = (d) => { + const out = []; + for (const [, body] of (d ?? "").matchAll(/M([^M]*)/g)) { + const nums = (body.match(/-?\d+(?:\.\d+)?(?:e-?\d+)?/g) ?? []).map(Number); + const pts = []; + for (let i = 0; i + 1 < nums.length; i += 2) pts.push([nums[i], nums[i + 1]]); + out.push({ pts, closed: /Z\s*$/.test(body) }); + } + return out; + }; + const segDist = (p, a, b) => { + const dx = b[0] - a[0]; + const dy = b[1] - a[1]; + const l = dx * dx + dy * dy; + const t = l ? Math.max(0, Math.min(1, ((p[0] - a[0]) * dx + (p[1] - a[1]) * dy) / l)) : 0; + return Math.hypot(p[0] - a[0] - dx * t, p[1] - a[1] - dy * t); + }; + const toPoly = (pts, closed) => (pts, closed); + void toPoly; + const distToPoly = (p, poly, closed = true) => { + let best = Infinity; + const n = poly.length; + for (let i = 0; i < (closed ? n : n - 1); i++) best = Math.min(best, segDist(p, poly[i], poly[(i + 1) % n])); + if (n === 1) best = Math.hypot(p[0] - poly[0][0], p[1] - poly[0][1]); + return best; + }; + const oneWay = (A, B) => { + let worst = 0; + for (const p of A) { + let near = null; + let gap = Infinity; + for (const q of B) { + const g = Math.hypot(p[0] - q[0], p[1] - q[1]); + if (g < gap) { + gap = g; + near = q; + } + } + worst = Math.max(worst, gap < 0.15 ? Math.max(Math.abs(p[0] - near[0]), Math.abs(p[1] - near[1])) : distToPoly(p, B)); + } + return worst; + }; + const hausdorff = (A, B) => Math.max(oneWay(A, B), oneWay(B, A)); + const applyMatrix = (pts, t) => { + const v = (t.match(/-?\d+(?:\.\d+)?(?:e-?\d+)?/g) ?? []).map(Number); + return pts.map(([x, y]) => [v[0] * x + v[2] * y + v[4], v[1] * x + v[3] * y + v[5]]); + }; + const levelOf = (score, bands) => { + let u = 0; + for (const t of bands) { + const x = Math.min(1, Math.max(0, (score - (t - 0.035)) / 0.07)); + u += x * x * (3 - 2 * x); + } + return u; + }; + + +const results = { outline: 0, top: 0, faces: 0, compared: 0, skipped: 0, missing: 0, crease: 0 }; +const worstAt = {}; +for (const theta of angles) { + const cams = TURN.cams(scene, restValues(T, theta)); + const Pp = { ...P, azimuth: P.azimuth - theta }; + for (const part of T.parts) { + if (part.kind !== "prism" || !rootOf(part.group) || part.group.kind === "free") continue; + const planted = plant && part.name === plant; + const run = scene.runs[part.id]; + const cam = part.group ? cams[part.group.index] : cams.world; + const f = TURN.emit(run, cam, TURN.frame(run)); + let root = part.group; + while (root && root.parent) root = root.parent; + const pivot = root ? [root.origin[0], root.origin[1], 0] : [0, 0, 0]; + const a = k.iso(pivot, P); + const b = k.iso(pivot, Pp); + const shift = [a[0] - b[0], a[1] - b[1]]; + const sh = (pts) => pts.map(([x, y]) => [x + shift[0], y + shift[1]]); + const { F, ring, s0, s1 } = part.world; + const up = run.up; + const Pk = planted ? { ...Pp, azimuth: Pp.azimuth - 2 } : Pp; + const pts = up ? ring.map(([x, y]) => G.add3(G.add3(F.o, G.mul3(F.a, F.a[2] < 0 ? s1 : s0)), G.add3(G.mul3(F.u, x), G.mul3(F.v, y)))) : null; + const kit = up ? k.extrude(pts.map(([x, y]) => [x, y]), pts[0][2], s1 - s0, Pk) : G.prismOf(F, ring, s0, s1, Pk); + const cut = Boolean(part.spec.cuts?.length); + const mine = subpaths(f.d[run.role[cut ? "fill" : "edge"]])[0].pts; + const theirs = sh(subpaths(kit.fill)[0].pts); + const visible = cut ? oneWay(subpaths(f.d[run.role.edge]).flatMap((path) => path.pts), theirs) : 0; + const ho = Math.max(hausdorff(mine, theirs), visible); + results.outline = Math.max(results.outline, ho); + if (ho > (worstAt[part.name]?.outline ?? -1)) worstAt[part.name] = { ...(worstAt[part.name] ?? {}), outline: ho, at: theta }; + if (up) { + const topMine = applyMatrix(subpaths(part.planPath)[0].pts, f.t[run.role.top]); + const topKit = sh(subpaths(kit.top)[0].pts); + results.top = Math.max(results.top, hausdorff(topMine, topKit)); + } + const kitFaces = kit.shades.map((d) => subpaths(d)).concat(up ? [] : [subpaths(kit.top)]); + const faceCount = up ? run.n : run.n + 2; + for (let i = 0; i < faceCount; i++) { + const role = run.role[`f${i}`]; + const d = f.d[role]; + if (!d) continue; + const q = f.q[role]; + if (q % TURN.q !== 0) { + results.skipped++; + continue; + } + const tone = q / TURN.q; + const pts = subpaths(d)[0].pts; + let best = Infinity; + for (const sp of kitFaces[tone] ?? []) best = Math.min(best, hausdorff(pts, sh(sp.pts))); + if (!Number.isFinite(best)) { + results.missing++; + continue; + } + results.compared++; + results.faces = Math.max(results.faces, best); + } + } +} + + const limit = 0.06; + const pass = results.outline <= limit && results.top <= limit && results.faces <= limit && results.missing === 0; + const worst = Object.entries(worstAt).filter(([, w]) => w.outline > limit).map(([name, w]) => `${name} outline ${w.outline.toFixed(3)} at ${w.at}°`); + return { pass, text: `prisms at ${angles.length} angles: outline ${results.outline.toFixed(4)} px · top ${results.top.toFixed(4)} px · faces ${results.faces.toFixed(4)} px over ${results.compared} faces (${results.skipped} in crossfade windows, ${results.missing} with no kit face of that tone)`, worst }; +} + +export function rounds(T, P, angles, { only = null } = {}) { + const scene = TURN.prepare(T.data, { unit: 1 }); + const CELL = 0.1; +const subpaths = (d) => { + const out = []; + for (const [, body] of (d ?? "").matchAll(/M([^M]*)/g)) { + const nums = (body.match(/-?\d+(?:\.\d+)?(?:e-?\d+)?/g) ?? []).map(Number); + const pts = []; + for (let i = 0; i + 1 < nums.length; i += 2) pts.push([nums[i], nums[i + 1]]); + out.push(pts); + } + return out; + }; + const segDist = (p, a, b) => { + const dx = b[0] - a[0]; + const dy = b[1] - a[1]; + const l = dx * dx + dy * dy; + const t = l ? Math.max(0, Math.min(1, ((p[0] - a[0]) * dx + (p[1] - a[1]) * dy) / l)) : 0; + return Math.hypot(p[0] - a[0] - dx * t, p[1] - a[1] - dy * t); + }; + const distToPoly = (p, poly) => { + let best = Infinity; + for (let i = 0; i < poly.length; i++) best = Math.min(best, segDist(p, poly[i], poly[(i + 1) % poly.length])); + return best; + }; + const hausdorff = (A, B) => { + let worst = 0; + for (const p of A) worst = Math.max(worst, distToPoly(p, B)); + for (const p of B) worst = Math.max(worst, distToPoly(p, A)); + return worst; + }; + function raster(layers, box, grow = 0) { + const [x0, y0, x1, y1] = box; + const w = Math.ceil((x1 - x0) / CELL) + 1; + const h = Math.ceil((y1 - y0) / CELL) + 1; + const out = new Int8Array(w * h).fill(-1); + for (const { tone, d } of layers) { + if (!d) continue; + const mask = new Uint8Array(w * h); + const polys = subpaths(d); + for (let row = 0; row < h; row++) { + const y = y0 + row * CELL + CELL / 2; + const hits = []; + for (const poly of polys) + for (let i = 0; i < poly.length; i++) { + const a = poly[i]; + const b = poly[(i + 1) % poly.length]; + if ((a[1] <= y && b[1] > y) || (b[1] <= y && a[1] > y)) { + const x = a[0] + ((y - a[1]) / (b[1] - a[1])) * (b[0] - a[0]); + hits.push([x, b[1] > a[1] ? 1 : -1]); + } + } + hits.sort((p, q) => p[0] - q[0]); + let wind = 0; + for (let i = 0; i < hits.length - 1; i++) { + wind += hits[i][1]; + if (!wind) continue; + const from = Math.max(0, Math.ceil((hits[i][0] - x0 - CELL / 2) / CELL)); + const to = Math.min(w - 1, Math.floor((hits[i + 1][0] - x0 - CELL / 2) / CELL)); + for (let c = from; c <= to; c++) mask[row * w + c] = 1; + } + } + const reach = Math.round(grow / CELL); + for (let row = 0; row < h; row++) + for (let c = 0; c < w; c++) { + let on = mask[row * w + c]; + for (let dy = -reach; dy <= reach && !on; dy++) + for (let dx = -reach; dx <= reach && !on; dx++) { + if (dx * dx + dy * dy > reach * reach) continue; + const rr = row + dy; + const cc = c + dx; + if (rr >= 0 && cc >= 0 && rr < h && cc < w && mask[rr * w + cc]) on = 1; + } + if (on) out[row * w + c] = tone; + } + } + return { out, w, h }; + } + +const stats = { outline: 0, outlineFine: 0, bands: 0, cells: 0, mismatched: 0, parts: 0 }; +const worst = []; +for (const theta of angles) { + const cams = TURN.cams(scene, restValues(T, theta)); + const Pp = { ...P, azimuth: P.azimuth - theta }; + const Pf = { ...Pp, origin: [Pp.origin[0] * 10, Pp.origin[1] * 10], scale: Pp.scale * 10 }; + for (const part of T.parts) { + if ((part.kind !== "round" && part.kind !== "lathe") || (only && !only.test(part.name)) || !rootOf(part.group) || part.group.kind === "free") continue; + const run = scene.runs[part.id]; + const cam = part.group ? cams[part.group.index] : cams.world; + const f = TURN.emit(run, cam, TURN.frame(run)); + let root = part.group; + while (root && root.parent) root = root.parent; + const pivot = root ? [root.origin[0], root.origin[1], 0] : [0, 0, 0]; + const a = k.iso(pivot, P); + const b = k.iso(pivot, Pp); + const shift = [a[0] - b[0], a[1] - b[1]]; + let F, s0, s1, r0, r1, ends, profile; + if (part.kind === "lathe") { + const { curve, knots } = part.world; + F = part.world.F; + s0 = curve.s0; + s1 = curve.s1; + r0 = curve.radius(s0); + r1 = curve.radius(s1); + ends = ["flat", "flat"]; + profile = [[s0, r0], ...knots.slice(1, -1).map((sv) => [sv, curve.radius(sv), 1]), [s1, r1]]; + } else ({ F, s0, s1, r0, r1, ends, profile } = part.world); + const meridian = [...(ends[0] === "open" ? [] : [[profile[0][0], 0]]), ...profile.filter((p) => p[1] > 1e-9), ...(ends[1] === "open" ? [] : [[profile[profile.length - 1][0], 0]])]; + const domed = ends.includes("dome"); + const radius = (s) => { + if (ends[0] === "dome" && s < s0) return Math.sqrt(Math.max(0, r0 * r0 - (s - s0) ** 2)); + if (ends[1] === "dome" && s > s1) return Math.sqrt(Math.max(0, r1 * r1 - (s - s1) ** 2)); + return r0 + ((r1 - r0) * (Math.max(s0, Math.min(s1, s)) - s0)) / (s1 - s0); + }; + const slope = (s) => { + if (ends[0] === "dome" && s < s0) return -(s - s0) / Math.max(1e-4, radius(s)); + if (ends[1] === "dome" && s > s1) return -(s - s1) / Math.max(1e-4, radius(s)); + return (r1 - r0) / (s1 - s0); + }; + const lo = ends[0] === "dome" ? s0 - r0 : s0; + const hi = ends[1] === "dome" ? s1 + r1 : s1; + const knots = []; + for (let i = 0; i <= 64; i++) knots.push(lo + ((hi - lo) * i) / 64); + const analytic = [[lo, 0], ...knots.slice(1, -1).map((sv) => [sv, radius(sv), 1]), [hi, 0]]; + if (ends[0] !== "dome") analytic.splice(1, 0, [lo, r0]); + if (ends[1] !== "dome") analytic.splice(analytic.length - 1, 0, [hi, r1]); + const lathed = part.kind === "lathe" ? { slope: part.world.curve.slope, radius: part.world.curve.radius } : null; + const kit = lathed ? G.lathe(meridian, F, Pp, { smooth: lathed }) : domed ? G.lathe(analytic, F, Pp, { smooth: { slope, radius } }) : G.lathe(meridian, F, Pp, { smooth: true }); + const kitFine = lathed ? G.lathe(meridian, F, Pf, { smooth: lathed }) : domed ? G.lathe(analytic, F, Pf, { smooth: { slope, radius } }) : G.lathe(meridian, F, Pf, { smooth: true }); + const sh = (pts) => pts.map(([x, y]) => [x + shift[0], y + shift[1]]); + const cut = Boolean(part.spec.cuts?.length); + const mine = subpaths(f.d[run.role[cut ? "fill" : "edge"]])[0]; + const theirs = sh(subpaths(kit.fill)[0]); + const fineRef = subpaths(kitFine.fill)[0].map(([x, y]) => [x / 10 + shift[0], y / 10 + shift[1]]); + const ho = hausdorff(mine, theirs); + const visible = cut ? subpaths(f.d[run.role.edge]).flat().reduce((worst, point) => Math.max(worst, distToPoly(point, fineRef)), 0) : 0; + const hf = Math.max(hausdorff(mine, fineRef), visible); + stats.outline = Math.max(stats.outline, ho); + stats.outlineFine = Math.max(stats.outlineFine, hf); + stats.parts++; + const ours = [0, 1, 2, 3, 4].map((t) => ({ tone: t, d: f.d[run.role[`s${t}`]] })); + for (const end of [0, 1]) { + const role = run.role[`k${end}`]; + if (role === undefined || !f.d[role]) continue; + const q = f.q[role]; + ours.push({ tone: q % TURN.q === 0 ? q / TURN.q : 9, d: f.d[role] }); + } + const theirsLayers = [...kitFine.shades.map((d, t) => ({ tone: t, d })), { tone: 4, d: kitFine.top }].map(({ tone, d }) => ({ tone, d: subpaths(d).map((poly) => "M" + poly.map(([x, y]) => `${x / 10 + shift[0]} ${y / 10 + shift[1]}`).join("L") + "Z").join("") })); + let x0 = Infinity; + let y0 = Infinity; + let x1 = -Infinity; + let y1 = -Infinity; + for (const [x, y] of mine) { + x0 = Math.min(x0, x); + y0 = Math.min(y0, y); + x1 = Math.max(x1, x); + y1 = Math.max(y1, y); + } + const box = [x0 - 1, y0 - 1, x1 + 1, y1 + 1]; + const A = raster(ours, box, 0.2); + const B = raster(theirsLayers, box, 0.2); + const inside = raster([{ tone: 1, d: f.d[run.role.edge] }], box).out; + const capCells = raster([0, 1].map((end) => ({ tone: 1, d: run.role[`k${end}`] !== undefined ? f.d[run.role[`k${end}`]] : "" })), box, 0.6).out; + const capExempt = part.kind === "lathe"; + const insideKit = raster([{ tone: 1, d: "M" + fineRef.map(([x, y]) => `${x} ${y}`).join("L") + "Z" }], box).out; + let worstGap = 0; + const reach = Math.ceil(0.5 / CELL) + 2; + for (let row = 0; row < A.h; row++) + for (let c = 0; c < A.w; c++) { + const i = row * A.w + c; + if (inside[i] < 0 || insideKit[i] < 0) continue; + const ta = A.out[i]; + const tb = B.out[i]; + if (ta === 9 || ta < 0 || tb < 0) continue; + if (capExempt && capCells[i] >= 0) continue; + stats.cells++; + if (ta === tb) continue; + let edge = false; + for (let dy = -3; dy <= 3 && !edge; dy++) for (let dx = -3; dx <= 3; dx++) if (inside[(row + dy) * A.w + c + dx] < 0) edge = true; + if (edge) continue; + stats.mismatched++; + let near = Infinity; + for (let dy = -reach; dy <= reach; dy++) + for (let dx = -reach; dx <= reach; dx++) { + const rr = row + dy; + const cc = c + dx; + if (rr < 0 || cc < 0 || rr >= A.h || cc >= A.w) continue; + if (B.out[rr * A.w + cc] === ta) near = Math.min(near, Math.hypot(dx, dy) * CELL); + } + worstGap = Math.max(worstGap, near); + } + stats.bands = Math.max(stats.bands, worstGap); + if (worstGap > 0.5 || hf > 0.05) worst.push({ part: part.name, theta, band: worstGap, outline: hf }); + } +} + + return { pass: stats.outlineFine <= 0.05 && stats.bands <= 0.5, text: `rounds: ${stats.parts} frames at ${angles.length} angles: outline vs kit ${stats.outline.toFixed(4)} px (kit rounds to 0.1), vs kit at 10x ${stats.outlineFine.toFixed(4)} px · band boundaries ≤ ${stats.bands.toFixed(2)} px apart (${stats.mismatched} of ${stats.cells} interior cells differ)`, worst: worst.sort((a, b) => b.band - a.band || b.outline - a.outline).slice(0, 12).map((w) => `${w.part} at ${w.theta}°: outline ${w.outline.toFixed(3)} px, band ${w.band.toFixed(2)} px`) }; +} + +export function tubes(T, P, angles) { + const scene = TURN.prepare(T.data, { unit: 1 }); +const subpaths = (d) => [...(d ?? "").matchAll(/M([^M]*)/g)].map(([, body]) => { + const nums = (body.match(/-?\d+(?:\.\d+)?(?:e-?\d+)?/g) ?? []).map(Number); + const pts = []; + for (let i = 0; i + 1 < nums.length; i += 2) pts.push([nums[i], nums[i + 1]]); + return pts; + }); + const segDist = (p, a, b) => { + const dx = b[0] - a[0], dy = b[1] - a[1], l = dx * dx + dy * dy; + const t = l ? Math.max(0, Math.min(1, ((p[0] - a[0]) * dx + (p[1] - a[1]) * dy) / l)) : 0; + return Math.hypot(p[0] - a[0] - dx * t, p[1] - a[1] - dy * t); + }; + const compare = (mine, theirs) => { + const A = subpaths(mine); + const B = subpaths(theirs); + if (A.length !== B.length) return { error: Infinity, why: `subpaths ${A.length} vs ${B.length}` }; + let worst = 0; + for (let i = 0; i < A.length; i++) { + if (A[i].length === B[i].length) for (let j = 0; j < A[i].length; j++) worst = Math.max(worst, Math.abs(A[i][j][0] - B[i][j][0]), Math.abs(A[i][j][1] - B[i][j][1])); + else { + for (const [from, to] of [[A[i], B[i]], [B[i], A[i]]]) for (const p of from) worst = Math.max(worst, Math.min(...to.slice(1).map((q, j) => segDist(p, to[j], q)))); + } + } + return { error: worst }; + }; + +const stats = { body: 0, shine: 0, shade: 0, edges: 0, rings: 0, chunks: 0 }; +const bad = []; +for (const theta of angles) { + const cams = TURN.cams(scene, restValues(T, theta)); + const Pp = { ...P, azimuth: P.azimuth - theta }; + const Pf = { ...Pp, origin: [Pp.origin[0] * 10, Pp.origin[1] * 10], scale: Pp.scale * 10 }; + for (const route of T.routes) { + if (route.group && (!rootOf(route.group) || route.group.kind === "free")) continue; + const root = rootOf(route.group); + const pivot = root ? [root.origin[0], root.origin[1], 0] : [0, 0, 0]; + const a = k.iso(pivot, P); + const b = k.iso(pivot, Pp); + const shift = [a[0] - b[0], a[1] - b[1]]; + const kit = tubePieces(route.world, route.r, Pf, { maxLength: route.chunk, spacing: route.spacing, gaps: route.gaps, breaks: route.breaks, caps: route.caps, stripes: route.wide, rings: route.rings }); + const scaled = (d) => subpaths(d).map((pts) => "M" + pts.map(([x, y]) => `${x / 10 + shift[0]} ${y / 10 + shift[1]}`).join("L")).join(""); + const chunks = T.parts.filter((part) => part.route === route.name); + if (kit.length !== chunks.length) { + bad.push(`${route.name}: ${chunks.length} chunks vs kit ${kit.length}`); + continue; + } + chunks.forEach((part, index) => { + const run = scene.runs[part.id]; + const f = TURN.emit(run, route.group ? cams[route.group.index] : cams.world, TURN.frame(run)); + const piece = kit[index]; + stats.chunks++; + for (const key of ["body", "shine", "shade", "edges"]) { + if (run.role[key] === undefined) continue; + const { error, why } = compare(f.d[run.role[key]], scaled(piece[key])); + stats[key] = Math.max(stats[key], error); + if (error > 0.05) bad.push(`${part.name} ${key} at ${theta}°: ${why ?? error.toFixed(3)}`); + } + if (route.rings) { + const mine = run.roles.filter((role) => role.name.startsWith("r")).map((role) => f.d[run.role[role.name]]).join(""); + const theirs = scaled(piece.rings.filter((ring) => ring.alpha * 32 >= 0.5).map((ring) => ring.d).join("")); + const A = subpaths(mine); + const B = subpaths(theirs); + let worst = A.length === B.length ? 0 : Infinity; + for (const seg of A) { + let best = Infinity; + for (const other of B) best = Math.min(best, Math.max(...seg.map((p, j) => Math.hypot(p[0] - other[j][0], p[1] - other[j][1])))); + worst = Math.max(worst, best); + } + stats.rings = Math.max(stats.rings, worst); + if (worst > 0.05) bad.push(`${part.name} rings at ${theta}°: ${A.length} vs ${B.length} segments, worst ${worst.toFixed(3)}`); + } + }); + } +} + + return { pass: !bad.length, text: `tubes: ${stats.chunks} chunk frames at ${angles.length} angles against tubePieces at 10x: body ${stats.body.toFixed(4)} · shine ${stats.shine.toFixed(4)} · shade ${stats.shade.toFixed(4)} · edges ${stats.edges.toFixed(4)} · rings ${stats.rings.toFixed(4)} px`, worst: bad.slice(0, 20) }; +} diff --git a/skills/anatomy/scripts/turn-group-reference.test.mjs b/skills/anatomy/scripts/turn-group-reference.test.mjs new file mode 100644 index 0000000..4f3ca63 --- /dev/null +++ b/skills/anatomy/scripts/turn-group-reference.test.mjs @@ -0,0 +1,40 @@ +import assert from "node:assert/strict"; +import test from "node:test"; +import { turning } from "../kit/turn-build.mjs"; +import { identity } from "./turn-fidelity.mjs"; +const P = { origin: [0, 0], scale: 1, azimuth: 45, elevation: 30 }; +const fixture = () => { const T = turning(P); T.layer("parts"); return T; }; +const prism = (T, group) => T.prism({ name: "pointer", group, plan: { x: 0, y: 0, w: 4, d: 2, r: 0 }, z: 0, h: 1 }); +test("missing named part groups cannot silently pass as static geometry", () => { + const T = fixture(); T.group("dial", { turn: {} }); + assert.throws(() => { prism(T, "dail"); T.build(); identity(T, P, [0, 90]); }, /turning: unknown group dail/); + assert.equal(T.parts.length, 0); +}); +test("missing named parent groups cannot silently root nested motion", () => { + const T = fixture(); T.group("dial", { turn: {} }); + assert.throws(() => T.group("slide", { parent: "dail", slide: { direction: [1, 0, 0], travel: 5 } }), /turning: unknown group dail/); + assert.equal(T.groups.length, 1); +}); +test("duplicate group names cannot alias incompatible motion values", () => { + const T = fixture(); T.group("dial", { turn: {} }); + assert.throws(() => T.group("dial", { slide: { direction: [1, 0, 0], travel: 5 } }), /turning: duplicate group dial/); + assert.equal(T.groups.length, 1); +}); +test("existing named and object group references retain native fidelity", () => { + for (const named of [false, true]) { + const T = fixture(); const group = T.group("dial", { turn: {} }); + const part = prism(T, named ? "dial" : group); + const child = T.group("slide", { parent: named ? "dial" : group, slide: { direction: [1, 0, 0], travel: 5 } }); + assert.equal(part.group, group); assert.equal(child.parent, group); + T.build(); const result = identity(T, P, [0, 90]); + assert.equal(result.pass, true); + assert.match(result.text, /over [1-9]\d* faces/); + } +}); +test("omitted and explicit null groups keep supported static geometry", () => { + for (const group of [undefined, null]) { + const T = fixture(); const part = prism(T, group); + assert.equal(part.group, null); + T.build(); assert.equal(T.parts.length, 1); + } +}); diff --git a/skills/anatomy/scripts/turn-rounded-polygon.test.mjs b/skills/anatomy/scripts/turn-rounded-polygon.test.mjs new file mode 100644 index 0000000..66ea360 --- /dev/null +++ b/skills/anatomy/scripts/turn-rounded-polygon.test.mjs @@ -0,0 +1,25 @@ +import assert from "node:assert/strict"; +import test from "node:test"; +import * as G from "../kit/lathe.mjs"; +import { roundedPolygon, turning } from "../kit/turn-build.mjs"; +const square = [[0, 0], [10, 0], [10, 10], [0, 10]]; +const extent = (ring, axis) => [Math.min(...ring.map((p) => p[axis])), Math.max(...ring.map((p) => p[axis]))]; +test("a repeated vertex does not change the rounded outline", () => { + const expected = roundedPolygon(square, 1, 2); + assert.equal(expected.length, 12); + assert.deepEqual(roundedPolygon([[0, 0], [10, 0], [10, 0], [10, 10], [0, 10]], 1, 2), expected); + assert.deepEqual(roundedPolygon([[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]], 1, 2), expected); + assert.deepEqual(roundedPolygon([[0, 0], [0, 0], [0, 0], [10, 0], [10, 10], [0, 10]], 1, 2), expected); +}); +test("a repeated vertex keeps the rounded outline inside the polygon", () => { + const ring = roundedPolygon([[0, 0], [10, 0], [10, 0], [10, 10], [0, 10]], 1, 2); + assert.deepEqual(extent(ring, 0), [0, 10]); + assert.deepEqual(extent(ring, 1), [0, 10]); +}); +test("a prism with a repeated vertex and a corner radius stays inside its polygon", () => { + const T = turning({ origin: [0, 0], scale: 1, azimuth: 45, elevation: 30 }); T.layer("all"); + const F = G.frameAlong([0, 0, 0], [0, 0, 1]); + const part = T.prism({ name: "block", F, s0: 0, s1: 2, polygon: [[0, 0], [4, 0], [4, 0], [4, 4], [0, 4]], round: 1 }); + assert.deepEqual(extent(part.world.ring, 0), [0, 4]); + assert.deepEqual(extent(part.world.ring, 1), [0, 4]); +}); diff --git a/skills/anatomy/scripts/turn-split-owner.test.mjs b/skills/anatomy/scripts/turn-split-owner.test.mjs new file mode 100644 index 0000000..3b4697b --- /dev/null +++ b/skills/anatomy/scripts/turn-split-owner.test.mjs @@ -0,0 +1,62 @@ +import assert from "node:assert/strict"; +import test from "node:test"; +import * as A from "../kit/audit.mjs"; +import * as G from "../kit/lathe.mjs"; +import { turning } from "../kit/turn-build.mjs"; +import { TURN } from "../kit/turn.mjs"; +import { posed } from "../kit/turn-audit.mjs"; +function fixture(kind, owner = "pipe") { + const T = turning({ origin: [0, 0], scale: 1, azimuth: 45, elevation: 30 }); T.layer("all"); + const group = T.group("assembly", { turn: { pivot: [5, 2] } }); + const F = G.frameAlong([0, 0, 0], [0, 0, 1]); + const base = { name: "ferrule", owner, group, F, s0: 0, s1: 10 }; + const part = kind === "prism" ? T.prism({ ...base, polygon: [[-2, -2], [2, -2], [2, 2], [-2, 2]] }) : T.round({ ...base, r: 2, ...(kind === "default round" ? {} : { fixed: false }) }); + const tube = A.tube([[0, 0, -2], [0, 0, 12]], 0.5, { name: "pipe", owner: "pipe" }); + return { T, part, tube }; +} +for (const kind of ["prism", "round", "default round"]) test(`split ${kind} preserves explicit ownership and its pipe clearance`, () => { + const { T, part, tube } = fixture(kind); + assert.deepEqual(A.clearances([tube], part.shapes), []); + const halves = T.split(part, { n: [0, 0, 1], d: 5 }); + assert.equal(halves.length, 2); + assert.ok(halves.every((half) => half.owner === "pipe" && half.shapes.every((shape) => shape.owner === "pipe"))); + assert.deepEqual(A.clearances([tube], halves.flatMap((half) => half.shapes)), []); + T.build(); + const scene = TURN.prepare(T.data, { unit: 1 }); + for (const angle of [0, 45, 90, 180]) { + const cams = TURN.cams(scene, { assembly: angle }); + const group = T.groups[0]; + const pose = { R: cams[group.index].R, t: cams[group.index].t, origin: group.origin }; + const shapes = halves.flatMap((half) => half.shapes.map((shape) => posed(shape, pose))); + const original = posed(part.shapes[0], pose); + assert.deepEqual(A.clearances([posed(tube, pose)], shapes), []); + for (const z of [2.5, 7.5]) { + const a = angle * Math.PI / 180; + const point = [5 - 4 * Math.cos(a) + 2 * Math.sin(a), 2 - 4 * Math.sin(a) - 2 * Math.cos(a), z]; + const distance = Math.min(...shapes.map((shape) => A.sdf(shape, point))); + assert.ok(distance < 0); + assert.ok(Math.abs(distance - A.sdf(original, point)) < 1e-8); + } + for (const run of scene.runs) { + const frame = TURN.emit(run, cams[run.group], TURN.frame(run)); + assert.ok(frame.d.some((path) => typeof path === "string" && path.length)); + } + } +}); +test("an unrelated pipe still reports real penetration of split fittings", () => { + for (const kind of ["prism", "round", "default round"]) { + const { T, part, tube } = fixture(kind, "other"); + const halves = T.split(part, { n: [0, 0, 1], d: 5 }); + const failures = A.clearances([tube], halves.flatMap((half) => half.shapes)); + assert.equal(failures.length, 2); + assert.ok(failures.every((failure) => failure.kind === "through" && failure.clearance < 0)); + } +}); +test("unowned split parts retain normal collision checking", () => { + for (const kind of ["prism", "round", "default round"]) { + const { T, part, tube } = fixture(kind, null); + const halves = T.split(part, { n: [0, 0, 1], d: 5 }); + assert.ok(halves.every((half) => !half.owner && half.shapes.every((shape) => !shape.owner))); + assert.equal(A.clearances([tube], halves.flatMap((half) => half.shapes)).length, 2); + } +}); diff --git a/skills/be-ambitious/SKILL.md b/skills/be-ambitious/SKILL.md new file mode 100644 index 0000000..5241e96 --- /dev/null +++ b/skills/be-ambitious/SKILL.md @@ -0,0 +1,72 @@ +--- +name: be-ambitious +description: > + Turn a task or prompt into a deeper version of itself, not a bigger one. + Before rewriting, say what a top professional in the field would do that the + user isn't asking for, the rawest source material they would start from, the + specific methods and tools they would use, and what (other than the user or + the model) would show the result is right. Then rewrite the prompt to ask for + exactly that. USE WHEN: /be-ambitious, "be ambitious", "make this prompt + deeper", "what would an expert do here", "raise the bar on this task", + "rewrite my prompt like a pro would ask it". NOT FOR: expanding scope, + adding features, or general prompt polishing for tone or length. +--- + +# Be ambitious + +Adapted from a prompt shared by Felix Rieseberg (Anthropic): + +> I want a deeper version of this task, not a bigger one. Before rewriting it: +> (1) say what a top professional in this field would do here that I'm not +> asking for; (2) name the rawest material they would start from instead of +> what has already been digested for me; (3) name the specific methods and +> tools they would use; (4) say what, other than you or me, would show the +> result is right. Then rewrite my prompt to ask for exactly that. + +## Input + +The task is whatever follows `/be-ambitious`. If nothing follows, use the +user's most recent request in this conversation. If there is none, ask for the +task in one line and stop. + +## Deeper, not bigger + +Keep the user's goal and scope. Depth means a higher standard for the same +outcome: better sources, sharper methods, real verification. Do not add +deliverables, features, or side quests. If a suggestion would make the job +larger rather than better, drop it. + +## Steps + +Name the field first (e.g. "investigative journalism", "SRE incident +response", "clinical pharmacology"), then answer the four questions for that +field. Be concrete: name the actual thing, not the category. + +1. **What a top professional would do that wasn't asked for.** The two or + three moves that separate expert work from competent work here, such as + stating the decision the work serves, checking base rates, reproducing + before fixing, or writing the counter-argument. +2. **The rawest material.** The primary sources they would start from instead + of summaries: the dataset, not the chart; the filing, not the article; the + logs and the code, not the bug report; the paper's methods section, not the + abstract. Say where it lives if you know. +3. **Specific methods and tools.** Named techniques, instruments, libraries, + commands, or frameworks, and why each fits this task. +4. **What, other than the user or the model, would show it is right.** An + external check: a test suite or benchmark, a reproduction, ground-truth + data, a known answer to compare against, a measurement, a domain expert + or reviewer, a real user's behavior. Say what result would count as a + pass and what would count as a failure. + +If you don't know something in the field well enough to answer, say so rather +than inventing a source or tool. + +## Rewrite + +Then write the rewritten prompt in a single fenced block the user can copy. +It should ask for exactly what the four answers describe: start from the raw +material, use the named methods, and end with the external check and its pass +criterion. Keep it about as long as it needs to be, and in the user's voice. + +Stop after the rewrite. Offer in one line to run it now; don't start the task +unless the user says so. diff --git a/skills/beautify-github-readme/SKILL.md b/skills/beautify-github-readme/SKILL.md new file mode 100644 index 0000000..3bc1430 --- /dev/null +++ b/skills/beautify-github-readme/SKILL.md @@ -0,0 +1,200 @@ +--- +name: beautify-github-readme +description: Redesign GitHub README homepages or create project-native pure SVG, hybrid SVG-composed PNG/WebP, and opt-in animated GIF assets. Use when a user asks to beautify, redesign, rebrand, visually upgrade, simplify, or audit a GitHub README; create only a hero, section headers, diagrams, badges, motion graphics, showcase modules, or other README assets; or turn a repository homepage into a cohesive visual story. If whole-README work versus asset-only work is unclear, ask which scope the user wants. For hero-like assets where pure SVG and generated raster material are both viable, explain the tradeoffs and confirm the implementation before creating the asset. +--- + +# Beautify GitHub README + +Turn a repository homepage or requested visual asset into a concise, theme-specific visual story. Treat Markdown as the content layer, deterministic SVG as the layout system, and generated raster material as an optional visual ingredient. + +## Workflow + +### 1. Confirm the mode before editing + +Use exactly one execution mode: + +- **README mode** — improve the whole README: information order, copy hierarchy, proof, Markdown, and visual system. +- **Asset-only mode** — create only the requested static SVG or visual asset set. Static SVG is the default. Only after the user explicitly opts into meaningful motion, optionally deliver a GitHub-safe GIF while keeping the SVG as the editable fallback. Do not rewrite, reorder, or embed anything in the README unless the user explicitly adds that scope. + +If the mode is not explicit, ask one compact question before making changes: + +> Would you like me to improve the whole README or only create visual assets? If asset-only, tell me whether you need a hero, section headers, workflow, badge, motion graphic, or a coordinated set. + +When a hero, badge, workflow, or diagram has meaningful motion and the user has not specified static or animated output, ask one compact follow-up: + +> Should this stay as a static SVG, or would you like a GitHub-safe GIF animation with the SVG kept as the editable fallback? + +GIF is opt-in and never the default. If the user declines, does not answer, or has no meaningful motion case, continue with static SVG only. Do not ask when motion would be purely decorative or the user already chose the output. Read-only inspection is allowed before the answer when it helps understand the repository. Do not interpret “use this Skill,” a repository path, or “beautify it” as permission to modify the whole README. Once the user chooses asset-only mode, expanding into README edits requires new authorization. + +If the user explicitly asks only for an audit, audit without editing and do not force the two-mode question. + +### 2. Inspect before designing + +- Read the existing README, repository tree, package metadata, screenshots, examples, design tokens, logo, and real outputs. +- In asset-only mode, inspect only the context needed to design the requested assets. Reading the README for context does not authorize changing it. +- For a GitHub URL, inspect the current remote page and default branch before proposing changes. +- Identify the audience, the problem solved, the clearest proof, the shortest path to first use, and any claims that lack evidence. +- Preserve unrelated user changes. Start read-only; do not commit, push, rename, or publish without explicit authorization. + +### 3. Confirm the visual implementation before creating hero-like assets + +For a hero, large banner, showcase board, or expressive title system where both implementations are viable, explain the difference and ask before producing the asset: + +> Which implementation would you like? +> +> - **Pure SVG** — fully deterministic, lightweight, sharply scalable, easy to edit, and best for typography, diagrams, code, icons, and geometric or pixel-art scenes. It does not use image generation and is weaker for realistic people, hair, organic texture, complex materials, or cinematic lighting. +> - **Hybrid SVG composition** — use SVG for layout and typography, optionally use ImageGen for a project-specific raster subject, remove its background when appropriate, and compose the layers into a final PNG/WebP. It supports richer characters, materials, and lighting, but is heavier, partly stochastic, and requires generation plus visual validation. Keep the SVG layout source and transparent subject PNG. + +Do not ask this question when the user already chose an implementation, requested an audit, or the asset is obviously deterministic, such as a workflow, architecture diagram, badge, compact section header, or code-native illustration. Do not suggest hybrid composition merely to add decoration. Prefer real screenshots, outputs, logos, or existing project art over generated material. + +If the user delegates the decision, default to pure SVG unless generated or photographic material clearly communicates the repository's identity or mechanism better. Do not begin ImageGen work until the user selects hybrid composition or explicitly delegates the choice. + +Hybrid composition is an implementation source, not normally the published SVG. Relative raster references inside SVG are unreliable across renderers, while base64-embedded raster layers can make the SVG unnecessarily large. Publish the verified final PNG/WebP by default and keep the SVG layout plus raster layers as editable sources. + +### 4. Extract the project story + +Write these before drawing: + +```text +Audience: +One-sentence value: +Primary proof: +First successful action: +Visual theme: +``` + +Do not invent adoption, benchmarks, compatibility, testimonials, or features. Prefer a real screenshot, output, diagram, or generated artifact over decorative stock imagery. + +### 5. Define a theme-specific visual system + +Read [references/visual-direction.md](references/visual-direction.md). Freeze a compact art-direction spec: + +```text +Palette: background / foreground / primary / accent / muted +Typography: system font stack / scale / weight contrast +Shape: radius / stroke / grid / spacing +Motif: one recurring project-specific visual cue +Composition: calm / editorial / technical / playful / cinematic +``` + +Derive the motif from the project. A terminal tool may use prompts and cursor marks; an icon system may use keylines and cutouts; a research project may use coordinates and evidence labels. Never apply the same yellow-grid template to every repository. + +Before designing the hero, read [references/project-native-hero.md](references/project-native-hero.md). Build the title from project content rather than treating it as a banner placed above the proof. Choose the typography, composition, and right-side material from the repository itself. + +### 6. Execute only the selected mode + +#### README mode + +Decide how deeply the README needs to change: + +- **Full redesign** — restructure the story and build a new visual system. +- **Visual refresh** — preserve the information architecture while replacing weak or inconsistent presentation. + +Use the smallest change inside README mode that can produce a meaningful improvement. Rebuild the reading order only when the selected scope requires it. A strong default is: + +1. Hero: name + plain-language value. +2. Proof: screenshots, outputs, or a showcase wall. +3. What it is: one short explanation. +4. Why it is different: mechanism, not slogans. +5. How it works: a short process or architecture. +6. How to use: install + first command. +7. Limits, compatibility, license, or contribution details when relevant. + +Put the example before the long explanation. Remove repeated promises and internal implementation detail that does not help adoption. + +#### Asset-only mode + +- Confirm the requested asset type, whether the user wants one asset or a coordinated set, and whether a meaningful motion candidate should stay static or become a GIF. Derive exact copy and style from the repository when they are unambiguous; ask only for missing decisions that would materially change the result. +- Create the assets under `assets/readme/` or another user-approved path and provide rendered previews. +- Follow the confirmed visual implementation. Default to pure, maintainable SVG for title systems, section headers, diagrams, badges, and deterministic decorative modules. For confirmed hybrid composition, keep the SVG layout source and transparent raster layers, then publish a composed PNG/WebP. +- For approved animation, keep the SVG source, read [references/motion-production.md](references/motion-production.md), and derive a GitHub-safe GIF with the bundled `scripts/render_motion_gif.py` workflow. Do not generate the GIF unless the user opted in. +- Keep one shared visual grammar across a set, but give every asset a specific communication job. +- Do not change README text, reading order, embeds, or links. Offer an embed snippet separately when useful; only insert it after explicit approval. + +### 7. Build the visual layer + +Read [references/github-readme-canvas.md](references/github-readme-canvas.md) and [references/svg-production.md](references/svg-production.md) before creating assets. + +- Use SVG for the hero, section banners, diagrams, and deterministic design modules. +- Use PNG/WebP for screenshots, generated art, photo material, and complex compositing. Use GIF only for approved motion that must play directly on GitHub. +- When hybrid composition is selected, read [references/hybrid-svg-production.md](references/hybrid-svg-production.md), use the `imagegen` Skill for generation and transparency decisions, and keep exact copy out of the generated raster layer. +- Keep body copy, commands, tables, links, and details in Markdown. +- Prefer a `1200`-unit-wide SVG `viewBox`, `width="100%"` embeds, system fonts, semantic alt text, and rounded containers. Treat the `viewBox` as a coordinate system, not the final pixel width: size and preview full-width assets at a conservative `900` CSS-pixel GitHub render. At that width, keep essential diagram text at least `20` SVG units and supporting labels at least `18`; text below that range must be nonessential. If a `360`-pixel mobile preview makes required labels unreadable, reduce density, split the visual, or move the detail into Markdown. +- Use one reusable component grammar, but vary the art direction by repository theme. +- When a showcase contains several artifacts, arrange them with controlled scale, overlap, rotation, and whitespace; keep reading order obvious. +- Let the hero absorb a real project diagram, screenshot, code fragment, output, specimen, or artifact when it makes the first screen more useful. Do not separate the title and proof by habit. +- When the user explicitly wants attribution in a repository they own, design a compact project-native `README MADE WITH` SVG instead of leaving a plain promotional sentence. Keep it near the footer and link it to this Skill. Never add this credit to a third-party repository without the maintainer's explicit request. +- In README mode, when proof would become unreadable inside the hero, use a concise SVG title followed immediately by a larger proof board. When a few artifacts remain legible and define the product, integrate title and proof into one composed raster hero. Let proof legibility decide, not a fixed template. In asset-only mode, keep the requested SVG source and propose any raster or animated derivative as a separate, optional deliverable. + +Do not rasterize the whole README. Do not use scripts, `foreignObject`, remote fonts, essential animation, or CSS that GitHub strips. GitHub does not play animation embedded inside SVG; use a GIF plus static SVG fallback instead. Avoid decorative borders and heavy shadows unless the theme genuinely calls for them. + +### 8. Preview and verify + +- Render a local GitHub-width preview or inspect the README on a local Markdown renderer. +- Check wide and narrow layouts, image legibility, clipped SVG text, missing assets, excessive file size, and dark/light-mode contrast. +- In README mode, run: + +```bash +python3 scripts/audit_readme.py /path/to/repository/README.md +``` + +- Visually inspect the hero, every section transition, and the final call to action. +- In asset-only mode, render and inspect every requested asset at GitHub content width; for GIFs, inspect entry, settled hold, exit, and loop boundary. Verify that the README itself is unchanged unless embedding was separately approved. +- For hybrid assets, inspect the transparent subject on light and dark backgrounds, verify transparent corners and clean edges, then inspect the composed PNG/WebP at wide and narrow GitHub widths. Do not publish an SVG with unresolved local raster references. +- Report what changed, what remains intentionally plain, and which files were deliberately left untouched. + +### 9. Offer optional attribution and showcase sharing after approval + +Only after the user explicitly approves the final README or asset set as satisfactory, make one friendly, non-promotional offer: + +> If you're happy with the finished README, there are two completely optional ways to wrap up: I can design a small project-native “README MADE WITH” signature that links back to this Skill, and—if this is a public repository you own or maintain—I can prepare a PR to add it to the Skill's real-world showcase. Either, both, or neither is perfectly fine. + +- Do not make this offer before final approval, infer satisfaction from silence or successful validation, or repeat it after the user declines. +- Treat the signature and showcase PR as independent choices. Never require attribution in exchange for showcase consideration. +- If the user opts into the signature, follow [references/svg-production.md](references/svg-production.md), show the rendered badge first, and modify the README only after separate approval. +- If the user opts into the showcase, read [references/showcase-contribution.md](references/showcase-contribution.md). Verify that the repository is public and that the user owns or maintains it; draft the exact listing copy and upstream diff before requesting permission to open the PR. +- Do not add a backlink, fork a repository, push a branch, or open a PR without explicit authorization for that specific external action. + +This gate controls unsolicited offers. If the user explicitly requests a signature or showcase contribution earlier, handle that request directly within its stated scope. + +### 10. Hand off safely + +Show the local preview and diff first. Only commit, push, open a PR, merge, rename a repository, or publish assets when the user explicitly asks. + +## Quality bar + +- The first screen explains the project without requiring prior knowledge. +- The design looks native to this project, not to this Skill. +- The hero's visual material comes from the project and is not generic decoration. +- Generated material is optional, project-specific, and never replaces stronger real proof. +- Every visual module has a communication job. +- Real proof appears before abstract claims. +- The README becomes shorter or clearer, not merely more decorated. +- The result still works when images fail: alt text, headings, commands, and links remain meaningful. +- Removing the repository name should not make the hero reusable for an unrelated project. +- Asset-only mode leaves the README byte-for-byte unchanged unless the user explicitly approved embedding or copy edits. +- Optional attribution or showcase sharing appears only after explicit satisfaction and opt-in; declining it never changes the delivered result. + +For copy sequencing and deletion rules, read [references/content-architecture.md](references/content-architecture.md). + +## Invocation examples + +```text +Use $beautify-github-readme to redesign this repository homepage around its developer-tool theme. +``` + +```text +Use $beautify-github-readme to create one SVG hero and three section headers without modifying the README. +``` + +```text +Use $beautify-github-readme to create a hybrid hero: SVG typography and layout, plus an ImageGen character cutout, with a final PNG and editable source layers. +``` + +```text +Use $beautify-github-readme to beautify this repository; if the scope is unclear, ask whether I want a whole-README redesign or asset-only visuals. +``` + +```text +Use $beautify-github-readme to create a GitHub-safe animated GIF hero, keep the SVG source, and do not modify the README until I approve the preview. +``` diff --git a/skills/beautify-github-readme/agents/openai.yaml b/skills/beautify-github-readme/agents/openai.yaml new file mode 100644 index 0000000..4ae4074 --- /dev/null +++ b/skills/beautify-github-readme/agents/openai.yaml @@ -0,0 +1,4 @@ +interface: + display_name: "Beautify GitHub README" + short_description: "Redesign READMEs with pure SVG or hybrid visual assets" + default_prompt: "Use $beautify-github-readme to redesign my README or create visual assets; ask which scope I want, then explain and confirm pure SVG versus hybrid SVG composition when both fit." diff --git a/skills/beautify-github-readme/references/content-architecture.md b/skills/beautify-github-readme/references/content-architecture.md new file mode 100644 index 0000000..46dd822 --- /dev/null +++ b/skills/beautify-github-readme/references/content-architecture.md @@ -0,0 +1,36 @@ +# README content architecture + +## The first-screen test + +Without scrolling, a new visitor should understand: + +1. What is this? +2. What can it do for me? +3. What should I look at next? + +The hero should answer the first two. The next module should provide proof. + +## Plain-language sequence + +Use this sequence unless the repository has a stronger information need: + +```text +Value → Proof → Mechanism → First use → Detail +``` + +Do not begin with architecture, contributor instructions, a command, or a long table of contents when the project is unfamiliar. + +## Editing rules + +- Replace internal jargon with a concrete outcome. +- Explain the mechanism once; remove repeated versions of the same promise. +- Put the shortest working install path before advanced configuration. +- Keep limitations visible when they affect user choice. +- Prefer one example that succeeds end-to-end over many disconnected snippets. +- Use “we” or direct language when it reduces distance, but do not fake community size. + +## Visual-to-text division + +Use visuals for hierarchy, identity, comparison, sequence, and proof. Use Markdown for explanation, commands, API details, links, compatibility, and contribution instructions. + +If a sentence needs to be copied, searched, translated, or frequently updated, keep it out of SVG. diff --git a/skills/beautify-github-readme/references/github-readme-canvas.md b/skills/beautify-github-readme/references/github-readme-canvas.md new file mode 100644 index 0000000..0be7190 --- /dev/null +++ b/skills/beautify-github-readme/references/github-readme-canvas.md @@ -0,0 +1,78 @@ +# GitHub README canvas + +## Reliable building blocks + +GitHub README pages reliably support Markdown, tables, links, code blocks, details blocks, and embedded local images. Use HTML only for simple alignment and image sizing. + +GitHub displays GIF animation but does not play animation embedded inside SVG. Keep an SVG source and static fallback for every animated visual. Read [motion-production.md](motion-production.md) before building motion. + +Recommended image embed: + +```html +

    + Project name and plain-language value +

    +``` + +For a hybrid SVG composition, publish the rendered PNG/WebP instead of an SVG that depends on raster references: + +```html +

    + Project name and plain-language value +

    +``` + +## SVG defaults + +- Use a `1200`-unit-wide `viewBox` for full-width modules. +- Typical heights: hero `300–420`, section banner `120–170`, visual explainer `320–760`. +- Include `` and `<desc>` for major visual modules. +- Use system font families such as `-apple-system`, `BlinkMacSystemFont`, `Segoe UI`, `PingFang SC`, and `sans-serif`. +- Judge type at its rendered size, not only by the number in the SVG. Use `900` CSS pixels as a conservative desktop acceptance width for a full-width `1200`-unit asset: essential diagram text should be at least `20` SVG units (about `15px` rendered), supporting labels at least `18` (about `13.5px`), and section titles at least `40` (about `30px`). Text below `18` units may be used only for nonessential metadata or decoration. +- Use `rx` consistently and keep all important content away from edges. + +## Avoid fragile SVG features + +Do not depend on: + +- `<script>` +- `foreignObject` +- external stylesheets or web fonts +- essential hover states or animation +- remote image URLs inside SVG +- filters that create very large or dirty shadows + +Use paths, shapes, text, patterns, gradients, clipping paths, and simple transforms. + +## Responsive behavior + +GitHub scales the whole image. Preview full-width assets at both `900px` desktop and `360px` mobile widths. Small text and dense diagrams become unreadable on mobile; if required labels fail there, simplify or split the visual and keep the complete explanation in Markdown. + +Avoid multi-column Markdown tables for long prose. They collapse poorly on narrow screens. Full-width visual boards can contain columns because the composition scales as one image, but text inside them must remain large. + +## Asset strategy + +Store repository-specific visuals under: + +```text +assets/readme/ +├── hero.svg +├── hero.png +├── hero.gif +├── showcase.png +├── section-*.svg +├── workflow.svg +└── source/ + ├── hero-layout.svg + ├── hero-subject.png + └── hero-prompt.txt +``` + +Use lowercase hyphenated names. Remove discarded variants before publishing unless the user wants to retain source explorations. + +## Accessibility and trust + +- Write alt text that communicates the purpose, not merely “banner”. +- Do not hide install commands or critical instructions inside images. +- Use real outputs and clearly label conceptual visuals. +- Check that text remains readable on both GitHub light and dark page backgrounds; the safest full-width SVG supplies its own background. diff --git a/skills/beautify-github-readme/references/hybrid-svg-production.md b/skills/beautify-github-readme/references/hybrid-svg-production.md new file mode 100644 index 0000000..4a2f1c2 --- /dev/null +++ b/skills/beautify-github-readme/references/hybrid-svg-production.md @@ -0,0 +1,85 @@ +# Hybrid SVG composition + +Use hybrid composition when deterministic SVG layout needs raster material that SVG cannot express honestly: people, mascots, organic texture, complex surfaces, cinematic lighting, or generated project artifacts. + +Do not use it when a real screenshot, output, logo, or repository-native illustration communicates the project better. Do not add a generic character merely to make the README look polished. + +## Output contract + +Treat SVG as the editable composition source and PNG/WebP as the published README asset: + +```text +assets/readme/ +├── hero.png # or hero.webp; publish this +└── source/ + ├── hero-layout.svg # deterministic layout + ├── hero-subject.png # transparent raster layer + └── hero-prompt.txt # final generation prompt +``` + +Keep chroma-key source images in a temporary project folder during production. Remove discarded or intermediate files before handoff unless the user requests them. + +Do not publish an SVG that depends on absolute paths, unresolved relative raster references, or remote images. Do not base64-embed a large raster layer merely to preserve an `.svg` extension. If the user explicitly wants a self-contained hybrid SVG, explain the file-size and renderer-compatibility tradeoff, then verify the actual GitHub rendering before using it. + +## Production sequence + +1. Freeze the repository story and visual system before generation. +2. Define the raster subject's communication job. Write why it belongs to this project. +3. Build the SVG layout first with a clearly reserved subject area. +4. Invoke the `imagegen` Skill. Keep title text, body copy, labels, logos, and UI chrome out of the generated layer. +5. Generate the subject with its pose, gaze, crop, palette, lighting direction, and negative space matched to the SVG composition. +6. Choose the background strategy: + - Use chroma-key removal for simple opaque or hard-edged subjects. + - Prefer matched-background generation when hair, fur, smoke, glass, translucency, reflections, or soft shadows do not require later repositioning. + - Follow the `imagegen` Skill's confirmation gate if true native transparency is required. +7. Save the final transparent subject inside the project, compose it with the SVG layout, and export one PNG/WebP. +8. Inspect the transparent layer and final composition. Iterate with one targeted change at a time. + +## Chroma-key subject brief + +Use a key color absent from the subject. Default to `#00ff00`; use `#ff00ff` when the subject contains green. + +Include these constraints in the generation prompt: + +```text +Asset type: transparent cutout subject for a GitHub README hero +Composition/framing: match the reserved hero area; specify body crop, gaze, and facing direction +Color palette: use the repository palette; do not use the selected key color in the subject +Constraints: one isolated subject; generous padding; no text; no letters; no logo; no watermark +Background: perfectly flat solid key color with no gradient, texture, floor, reflection, or shadow +``` + +Use the installed helper and parameters defined by the `imagegen` Skill. Do not copy or fork its background-removal script into this Skill. + +## Composition rules + +- Let SVG control typography, exact copy, labels, grids, diagrams, borders, and alignment. +- Let the raster layer provide only the material, character, lighting, or organic detail that benefits from generation. +- Match the generated subject's light direction and edge color to the SVG palette. +- Keep the subject inside a named SVG group or reserved box so it can be replaced without rebuilding the layout. +- Preserve enough contrast around hair, tools, clothing, and other edge details. +- Avoid placing essential proof behind the generated subject. +- Keep commands, links, installation steps, and long explanations in Markdown. + +## Validation + +For the transparent subject, verify: + +- an alpha channel exists; +- all four corners are fully transparent; +- subject coverage is plausible; +- no obvious key-color fringe remains on light or dark backgrounds; +- thin details and intended rim light survive; +- the subject contains no accidental text or watermark. + +For the final asset, verify: + +- `1200`-pixel GitHub width and a narrow preview; +- readable title and labels; +- clean crop and visual balance; +- no missing local image placeholder; +- acceptable PNG/WebP size; +- meaningful alt text; +- the design still feels native to the repository. + +Report the ImageGen mode used, final prompt, transparent asset path, composition source path, published asset path, and any intermediates intentionally retained. diff --git a/skills/beautify-github-readme/references/motion-production.md b/skills/beautify-github-readme/references/motion-production.md new file mode 100644 index 0000000..4bfbb33 --- /dev/null +++ b/skills/beautify-github-readme/references/motion-production.md @@ -0,0 +1,105 @@ +# GitHub-safe README motion + +Use motion only when it explains a sequence, transition, state change, or relationship. GIF is opt-in and never the default. Keep the static SVG as the editable source and fallback; GitHub does not play animation embedded inside SVG, so deliver a GIF for the README only after the user explicitly chooses motion. + +## Confirm the output + +When a hero, badge, workflow, or diagram has meaningful motion and the user has not specified static or animated output, ask once: + +> Should this stay as a static SVG, or would you like a GitHub-safe GIF animation with the SVG kept as the editable fallback? + +Do not ask when motion would be purely decorative or the user already chose an output. +If the user declines or does not answer, continue with static SVG only. + +## Make motion feel comfortable + +- Animate only the few layers needed to explain the idea. One to three focal movements are usually enough. +- Keep entry travel short and visually related to the composition. Start around `4–8%` of the canvas dimension instead of sending elements across the whole frame. +- Use calm ease-out movement around `0.7–1.2 seconds`. Let elements arrive naturally; do not add bounce, elastic overshoot, or abrupt direction changes by default. +- Leave enough still time to read the finished composition. A `1.5–2.5 second` settled hold is a useful starting point. +- Once an element settles, keep it pixel-still. Avoid idle bobbing, pulsing, floating, or rotation unless it communicates a real live state. +- Do not animate every label, icon, and background detail. Motion needs one clear reading order, not constant activity. +- Keep entrance and exit subordinate to the content. If viewers notice the animation technique before they understand the project, simplify it. +- Make the last frame match the first frame so the loop restarts without a visible jump. + +## Motion defaults + +- Start from an approved static SVG. Motion should clarify it, not rescue a weak composition. +- Use `30 FPS`, `4–6 seconds`, and a calm loop as starting points. +- Size raster output for the real embed. Start at the SVG's native canvas width—usually `1200px` for this Skill—and preview it at GitHub's actual content width before increasing resolution. Native-size rendering avoids resampling noise and can be much smaller while looking indistinguishable after browser downscaling. Use `1440–1600px` only when small text genuinely needs it and the loading cost remains acceptable; use `960px` for smaller embeds or previews. +- Keep the first frame meaningful and preserve essential text in Markdown or the static fallback. +- Animate a few semantic layers. Avoid moving grids, noise, gradients, or the whole canvas because full-frame changes inflate the GIF. +- Use ease-out entry, a genuinely still hold, and a short exit that returns cleanly to the first frame. +- Once an element settles, keep it pixel-still unless continuous movement communicates real state. Do not add idle bobbing by default; a one-pixel handoff can look like jitter. +- Avoid flashes, rapid pulses, and motion that competes with reading. + +## Prepare the SVG and motion spec + +Give every animated SVG element a stable `id`. Keep inherited transforms and typography on its ancestor groups; the renderer preserves the ancestor chain when extracting a layer. + +Create a JSON spec next to the SVG: + +```json +{ + "width": 1200, + "fps": 30, + "duration": 5.0, + "colors": 256, + "dither": "none", + "clip_to_base_alpha": true, + "max_size_mb": 2.0, + "reveals": [ + { + "id": "title-highlight", + "axis": "x", + "start": 0.25, + "end": 1.25, + "exit": {"start": 4.1, "end": 4.96} + } + ], + "layers": [ + { + "id": "project-card", + "enter": {"start": 0.4, "end": 1.3, "from": [72, -22]}, + "exit": {"start": 4.1, "end": 4.96, "to": [20, -10]} + } + ] +} +``` + +Offsets use source-SVG units and scale with the requested output width. +Use `clip_to_base_alpha: true` when moving layers must stay inside a rounded full-frame background. Leave it off for assets whose base layer contains intentional transparent holes. + +## Render the GIF + +The bundled script requires Python with Pillow, `ffmpeg`, and either `rsvg-convert` or macOS `sips`: + +```bash +python3 scripts/render_motion_gif.py \ + assets/readme/hero.svg \ + assets/readme/hero.gif \ + --spec assets/readme/hero-motion.json +``` + +Use `--keep-frames /tmp/readme-motion-frames` only when individual layers or frames need inspection. + +## Keep flat animation compact + +- Use one shared palette and `diff_mode=rectangle` so frames store only changed regions. +- Prefer the SVG's native pixel width or a clean integer scale. Arbitrary upscaling introduces interpolation colors that increase GIF size without necessarily improving the README-sized result. Compare candidates at the final CSS width, not at 100% pixels. +- Start with `192` colors for simple flat artwork. Use the full `256` colors when the composition contains prominent text, gradients, translucent shapes, or is displayed full-width. +- Use `dither: none` for large flat fills, text, and interface geometry. Dithering adds moving pixel noise, makes the image dirtier, and increases file size. +- Add dithering only for gradients or photographic material after comparing the rendered result. +- Keep settled frames identical. A still hold compresses well and feels calmer. +- Preserve transparent corners in the final GIF. For rounded artwork, clip every visual layer to the same rounded frame; otherwise square corners or escaped decoration will appear on GitHub. The bundled script converts frame alpha to a reserved chroma key for compact RGB delta encoding, then marks that palette entry transparent in the GIF. If the artwork visibly uses the configured `transparent_color`, the script stops and asks for a different unused key instead of silently creating holes. +- Keep the transparent silhouette stable across the loop. Put moving layers inside an opaque or clipped frame; changing transparent boundaries can leave trails in GIF decoders, so the bundled script rejects them. +- Aim for about `2 MB` for a full-width animated hero and treat `5 MB` as a practical ceiling, even when the hosting limit is larger. If the animation cannot stay light, keep the first-screen hero static and place a smaller GIF demonstration later in the README. + +## Verify before embedding + +1. Inspect entry, the first settled frame, the full hold, exit, and loop boundary. +2. Confirm settled frames are pixel-identical; unexpected differences reveal idle movement or rendering noise. +3. Check the GIF at GitHub content width and on a narrow viewport. +4. Verify frame count, FPS, duration, dimensions, and size with `ffprobe`. +5. Keep the static SVG in the repository even when the README embeds the GIF. +6. Do not replace a README image reference without explicit approval. diff --git a/skills/beautify-github-readme/references/project-native-hero.md b/skills/beautify-github-readme/references/project-native-hero.md new file mode 100644 index 0000000..43da487 --- /dev/null +++ b/skills/beautify-github-readme/references/project-native-hero.md @@ -0,0 +1,112 @@ +# Project-native hero + +Design the README title from the repository's actual content. Do not place a generic banner above a separate screenshot by default. + +## Start from five facts + +Write these before opening the SVG: + +```text +Project category: +Main user: +Main action: +Best proof: +Native visual material: +``` + +Native visual material is the thing the project really works with: cluster relationships, tensors, tables, code, layers, timelines, maps, icons, terminal output, or generated artifacts. + +## Use a stable information anatomy + +A useful title can contain five parts: + +1. Category or technical context. +2. Repository name. +3. One concrete description. +4. Real project material. +5. Small repository metadata. + +Keep the anatomy stable enough to communicate clearly, but move, resize, or omit parts to suit the project. Do not turn it into one fixed template. + +## Choose typography from the project + +| Project character | Useful type direction | +| --- | --- | +| Infrastructure / systems | large sans-serif + mono metadata | +| Research / database | sober serif or restrained sans-serif + measured diagrams | +| Programming language / low-level tool | industrial display type + code mono | +| Creative tool / design system | open sans-serif or expressive display type + specimens | +| Documentation / knowledge project | quiet readable type + editorial hierarchy | + +Use type to express how the project speaks. Do not use serif merely to look premium or monospace merely to look technical. + +## Choose a composition mode + +- **Split** — title on one side, project structure or artifact on the other. Use when the project has one clear visual proof. +- **Integrated** — let diagrams, paths, code, screenshots, or specimens share the same grid as the title. Use when content and identity are inseparable. +- **Artifact wall** — place several real outputs on a controlled diagonal and let the title occupy one cell or the negative space between them. +- **Background proof** — enlarge one real artifact behind or around the title. Use only when contrast remains clear. +- **Title-only** — use typography and spacing alone when the project is intentionally minimal and has no honest visual proof. + +Do not force every repository into a left-title/right-graphic split. Choose the mode after seeing the material. + +## Choose how identity and proof meet + +Two successful openings are both valid. Choose between them by testing proof legibility, not by applying one house template: + +### One-board hero + +Combine the category, project name, plain-language promise, project-native motif, and a few real outputs in one composed PNG/WebP. This works when the outputs stay recognizable at README width and the variety itself explains the product. A UI-generation repository, for example, can place several real interface results around the title so the first image communicates both identity and capability. + +### Title followed by proof + +Use a concise SVG title first, then place a large screenshot wall or showcase immediately below it. This works when the proof contains many pages, dense screenshots, or fine detail that would become too small inside a short hero. A presentation repository, for example, can let the SVG establish the product name and method, while the next image gives the slide outputs enough room to be judged. + +Both openings should preserve the same information functions: + +```text +context → project name → concrete promise → process cue → real proof +``` + +These are roles, not fixed positions. Do not copy the same eyebrow, highlight bar, grid, left/right split, or metadata row across repositories. Reuse the reasoning and redesign the composition from the project's material. + +Ask these before deciding: + +1. Can the proof still be understood when the image is scaled to GitHub content width? +2. Does one artifact explain the product, or does the visitor need to compare several outputs? +3. Is the title likely to change often enough that an editable SVG should stay separate? +4. Would combining title and proof reduce clarity, or merely save vertical space? + +## Combine title and demonstration + +When the first screenshot, output, or diagram explains the project, combine it with the title into one composition: + +```text +category + repository name + concrete description + real proof +``` + +For vector material, keep the whole composition in SVG. For screenshots, photos, or generated raster work, compose the title and images in a layout tool or HTML canvas and export one PNG/WebP. If many artifacts need more room, keep the SVG title and raster proof as two adjacent README modules. Do not rely on fragile external image links inside SVG. + +When pure SVG and generated raster material are both credible for the hero, follow the implementation-choice gate in `SKILL.md` before producing either version. Generated people, mascots, or scenes must have a project-specific communication job; they are not substitutes for real proof. + +## Use project-specific tests + +Before accepting the hero, ask: + +1. If the repository name disappears, could this hero belong to an unrelated project? +2. Does the visual material explain the project, or does it only make the page look technical? +3. Can a first-time visitor tell what the repository does without reading the body? +4. Does the typography fit the project's character and audience? +5. Could the title and proof be composed more tightly instead of appearing as two unrelated blocks? + +If the first answer is yes or the second answer is decoration, redesign it. + +## Example translations + +- Kubernetes: cluster relationships, production scheduling, strict black system layout. +- PyTorch: tensor or network paths, open research spacing, orange computational flow. +- PostgreSQL: tables and relationships, stable deep blue, serif or measured database typography. +- Rust: code structure, industrial display type, strong separation between language and example. +- Icon system: keylines, 4×4 sheets, transparent outputs, cropped specimens. + +Use the examples as reasoning patterns, not as templates to copy. diff --git a/skills/beautify-github-readme/references/showcase-contribution.md b/skills/beautify-github-readme/references/showcase-contribution.md new file mode 100644 index 0000000..ff30106 --- /dev/null +++ b/skills/beautify-github-readme/references/showcase-contribution.md @@ -0,0 +1,44 @@ +# Optional showcase contribution + +Use this workflow only after the user explicitly approves the finished README and opts into sharing a public repository with the `beautify-github-readme` showcase. + +## Eligibility gate + +Confirm all of the following before preparing upstream changes: + +- The repository is public. +- The user owns, maintains, or is authorized to represent it. +- The finished README is already published and visible at the repository URL. +- The upstream showcase does not already list the repository. + +Do not treat an attribution badge as a requirement. A repository may be proposed with or without the badge. + +## Ask once, without pressure + +Use neutral wording and make declining easy: + +> If you'd like to share this result, I can draft a small PR to add the public repository to the real-world showcase in `oil-oil/beautify-github-readme`. This is completely optional, and the upstream maintainers will decide whether to merge it. + +Do not repeat the offer after a decline. Do not create an issue, discussion, fork, branch, or PR merely because the user expressed satisfaction. + +## Prepare the proposal + +1. Inspect the latest default branch of `https://github.com/oil-oil/beautify-github-readme`. +2. Locate the current showcase list and check for duplicates. +3. Draft one factual sentence explaining what the finished README demonstrates. Do not invent adoption, testimonials, results, or product capabilities. +4. Keep the English and Simplified Chinese showcase lists aligned. Show both proposed entries to the user for approval. +5. Check whether a showcase SVG or its accessible description explicitly enumerates repositories. Update it only when needed to keep the visual and alt text accurate; do not overcrowd the graphic merely to add another logo or label. +6. Show the exact upstream files and diff that would change. + +Typical upstream files are `README.md`, `README.zh-CN.md`, and—only when its content becomes inaccurate—the relevant showcase SVG. + +## Publish only with explicit approval + +After the user approves the exact listing copy and diff, ask for explicit authorization to open the PR. Then: + +- Use a normal branch and PR when the authenticated account has upstream access. +- Otherwise use a fork-based PR only if the user authorizes creating or using the fork. +- If neither route is available, provide the prepared patch and PR text without creating external state. +- Report the PR URL and state clearly that upstream maintainers may edit, decline, or merge it. + +Never push directly to the upstream default branch. Never imply that a showcase submission is already accepted. diff --git a/skills/beautify-github-readme/references/svg-production.md b/skills/beautify-github-readme/references/svg-production.md new file mode 100644 index 0000000..7b30819 --- /dev/null +++ b/skills/beautify-github-readme/references/svg-production.md @@ -0,0 +1,202 @@ +# Writing README SVGs + +Use SVG for deterministic layout, typography, diagrams, and title systems that must scale cleanly inside GitHub. When the user selects generated raster material inside an SVG-controlled layout, read [hybrid-svg-production.md](hybrid-svg-production.md) and publish the rendered PNG/WebP by default. + +For motion, keep the SVG as the editable source and derive a GIF for GitHub playback. Read [motion-production.md](motion-production.md) before animating or converting an asset. + +## Start with the canvas + +Use these as starting points, not fixed templates: + +```text +Hero: 1200 × 300–420 +Section title: 1200 × 120–170 +Diagram: 1200 × 320–760 +``` + +Give every full-width SVG a `1200`-unit `viewBox`. Keep important content at least `48–64` units from the edges. A common hero split is roughly 58% title and 42% proof, but change it when the material needs more room. + +## Design for the rendered width + +The `viewBox` is a coordinate system, not a promise that GitHub will display the asset at `1200px`. A full-width `1200`-unit SVG shown in a `900px` content column is scaled to `75%`, so a `16`-unit label becomes only `12px` on screen. + +Use this conversion when reviewing type: + +```text +rendered size = SVG font size × displayed width ÷ viewBox width +``` + +For a `1200`-unit asset, use `900` CSS pixels as a conservative desktop acceptance width unless the repository's actual rendered column is narrower: + +| Role | SVG size | Approx. size at 900px | +| --- | ---: | ---: | +| Hero or project title | `48+` | `36px+` | +| Section title | `40+` | `30px+` | +| Essential diagram or card text | `20+` | `15px+` | +| Supporting label | `18+` | `13.5px+` | +| Nonessential metadata only | `16+` | `12px+` | + +Do not solve small text by changing the `viewBox` from `1200` to `900` while scaling the rest of the composition with it; the proportions stay the same. Increase the text relative to the canvas, reduce density, shorten labels, or split one dense board into multiple visuals. + +Also inspect a `360px` mobile preview. A dense technical diagram may preserve its overall structure there, but any detail required to understand or use the project must remain available in the adjacent Markdown and alt text. If the image itself must carry that detail on mobile, use a taller or narrower composition instead of shrinking the labels. + +## Use this file skeleton + +```svg +<svg xmlns="http://www.w3.org/2000/svg" + width="1200" height="320" viewBox="0 0 1200 320" + role="img" aria-labelledby="title desc"> + <title id="title">Repository name + Plain-language description of the visual. + + + + + + + + + + + + + + + +``` + +Name groups by role. Keep the file readable enough to edit by hand. + +## Build in this order + +1. Draw the background and major structural lines. +2. Place the repository name and concrete description. +3. Add the real project material. +4. Add category and repository metadata. +5. Add only the decoration still needed after the content works. + +If the composition already reads clearly after step 4, stop. + +## Handle typography deliberately + +- Use system font stacks; do not load remote fonts. +- Use `-apple-system`, `BlinkMacSystemFont`, `Segoe UI`, `PingFang SC`, and `sans-serif` for general UI text. +- Use `ui-monospace`, `SFMono-Regular`, `Menlo`, and `monospace` for code and metadata. +- Use `Georgia`, `Songti SC`, and `serif` only when an editorial or established tone fits. +- Use size and weight for hierarchy before adding color or decoration. + +SVG text does not wrap automatically. Split lines explicitly: + +```svg +First line +Second line +``` + +Render after every meaningful copy change. Chinese, English, serif, and sans-serif occupy different widths; do not trust character count alone. + +## Draw project material, not tech decoration + +Use a small vocabulary of native SVG elements: + +- `` for cards, tables, terminals, modules, and devices. +- `` for nodes, ports, states, and markers. +- `` for connections, data curves, flows, and outlines. +- `` to keep each component movable. +- `` only when content genuinely needs cropping. + +Prefer a simplified version of a real architecture, relationship, code sample, output, or interface. Do not add random grids, dots, glowing lines, or circuit patterns merely to signal technology. + +## Choose hand-authored SVG or a layout engine deliberately + +Hand-author the SVG when the visual is compact, tightly integrated with the hero, or depends on a project-specific composition. Exact coordinates are often the simplest maintainable choice for a few boxes, a short flow, or an illustrative proof layer. + +When relationship-heavy diagrams make edge routing, grouping, and label wrapping the dominant work, a structured diagram engine may be used as an optional production aid if it is already available and its license and runtime fit the project. Keep its semantic JSON or other source alongside the exported asset so later edits do not require reconstructing coordinates. The Skill must still work without that engine; do not add a tool-specific runtime as a default requirement. + +For generated diagram output: + +- apply the frozen project palette rather than the engine's house theme; +- use system fonts and disable remote font imports or external asset references; +- export a static SVG or PNG rather than embedding a live renderer; +- inspect the output for ` +``` + +```css +.js [data-reveal] { opacity: 0; transform: translateY(8px); transition: opacity var(--dur-long) var(--ease-out), transform var(--dur-long) var(--ease-out); transition-delay: calc(var(--i, 0) * 40ms); } +.js [data-reveal].is-in { opacity: 1; transform: none; } +@media (prefers-reduced-motion: reduce) { .js [data-reveal] { opacity: 1; transform: none; transition: none; } } +``` + +```js +const io = new IntersectionObserver((es) => es.forEach((e) => { if (e.isIntersecting) { e.target.classList.add('is-in'); io.unobserve(e.target); } }), { rootMargin: '0px 0px -10% 0px' }); +document.querySelectorAll('[data-reveal]').forEach((el) => io.observe(el)); +``` + +Visible with scripting off (62), at its end state under reduced motion, once, and only where the theme lets something move. + +## Figures that compare + +```css +.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); } +.stats > * { padding-inline: var(--space-lg); border-left: 1px solid var(--color-rule); } +.stats > :first-child { padding-left: 0; border-left: 0; } +.stats b { display: block; font: 600 var(--text-3xl)/1 var(--font-display); font-variant-numeric: tabular-nums; } +@media (max-width: 60rem) { .stats { grid-template-columns: minmax(0, 1fr); } .stats > * { padding: var(--space-md) 0; border-left: 0; border-top: 1px solid var(--color-rule); } .stats > :first-child { border-top: 0; } } +``` + +Only figures the user gave (46a), each with its unit and what it counts. + +## A loop that can pause + +Anything moving past 5 seconds (a marquee, an ambient loop, a looping video) holds still until the script runs, stops off-screen and under reduced motion, pauses on hover and focus, and carries a visible pause control (18, WCAG 2.2.2). + +```html +
    + + +
    +``` + +```css +[data-loop]:not(.is-running), [data-loop]:not(.is-running) *, [data-loop]:not(.is-running) *::before, [data-loop]:not(.is-running) *::after { animation-play-state: paused !important; } +html:not(.js) [data-loop-toggle] { display: none; } +@media (prefers-reduced-motion: reduce) { [data-loop-toggle] { display: none; } } +``` + +```js +document.querySelectorAll('[data-loop]').forEach((el) => { + const btn = el.querySelector('[data-loop-toggle]'); + const s = { seen: false, hover: false, focus: false, held: matchMedia('(prefers-reduced-motion: reduce)').matches }; + const sync = () => { + const run = s.seen && !s.hover && !s.focus && !s.held; + el.classList.toggle('is-running', run); + el.querySelectorAll('video').forEach((v) => (run ? v.play().catch(() => {}) : v.pause())); + btn.textContent = s.held ? 'Play' : 'Pause'; + }; + btn.addEventListener('click', () => { s.held = !s.held; sync(); }); + [['pointerenter', 'hover', true], ['pointerleave', 'hover', false], ['focusin', 'focus', true], ['focusout', 'focus', false]].forEach(([t, k, v]) => el.addEventListener(t, () => { s[k] = v; sync(); })); + new IntersectionObserver(([e]) => { s.seen = e.isIntersecting; sync(); }).observe(el); +}); +``` + +## A way past the nav + +```html + +``` + +```css +.skip { position: absolute; left: var(--space-md); top: calc(-1 * var(--space-3xl)); z-index: var(--z-toast); padding: var(--space-xs) var(--space-md); background: var(--color-ink); color: var(--color-paper); } +.skip:focus-visible { top: var(--space-md); } +``` diff --git a/skills/hallmark/references/redesign.md b/skills/hallmark/references/redesign.md new file mode 100644 index 0000000..17f73ad --- /dev/null +++ b/skills/hallmark/references/redesign.md @@ -0,0 +1,88 @@ +# Redesign + +Loaded only when the user names Hallmark with `redesign` or `audit` (`/hallmark redesign `, *redesign the site with Hallmark*). A request that changes an existing design without naming Hallmark (a restyle, new colours or a new theme, a polish, a redesign, a small edit) never loads this file: it is done as asked, in the project's own system. A redesign is a build whose material is the page that exists: SKILL.md still binds, and this file says what the run keeps, what replaces the Step 1 ask and what the sweep adds. The target is the user's own code (a file, a folder, a route on a dev server); a live URL with no source behind it can only be audited, through `--url`. + +## What a redesign keeps + +- **The content.** Every fact, claim, name, price, date and quote the page states. Figures, quotes and logos already there are the user's material: carried over as found and listed in the handoff to verify, one a gate doubts (a trend nobody measured, 46a) included. Nothing is added: no action, section, claim or picture the page did not have, beyond what the user hands over and what a gate requires (a pause on a loop, 18; a focus ring). A drawing made from the page's own facts (its channels, its steps, a figure) is composition, and full depth may make one. +- **The wiring.** Every link, form, field, handler, route, id and test hook; every script, data call and analytics call. Edit markup inside the component that owns it. Never move logic, rename a prop, or drop a `name`, an `id`, a `key`, a `type`, an `href` or a `data-testid` that a script or a test reads. A prop the Floor empties (an emoji passed as an icon) may go with it, named in the handoff. A state the screen has no logic for (a failed load, an undo) is listed for the owner, never built. +- **The files.** No file deleted, no route removed and no component tree replaced without a file-level plan the user approved, and no test edited to make the redesign pass. Documents in the repo (a README, a prompt, a deck) explain the product; they are not page copy. In a git project, start from a clean tree, `.hallmark/` aside (ask the user to commit or stash; never do it for them), so the redesign is one diff they can read and revert. The stylesheet is the redesign's to edit: the append-only rule guards it from a build, not from its own redesign. +- **The brand,** when there is one. A brand is chosen: a logo, a colour or a face the project names (a brand file, a logo asset, named tokens, a font file of its own) or the user states. It stays at every depth, its values read from the project's files, never from memory. A framework default or a look the gates name (the purple-to-blue gradient, Inter as the display, a stock swatch) is not a brand: restyle and full replace it, and the Picks block says so in case it was. A locked `design.md` is the system at every depth. +- **The words,** unless a gate names them. Wording that fails a copy gate (19, 54, 58, 63, 69) is tightened from the facts already on the page, and the handoff lists every changed line, before and after. An eyebrow is never just deleted: where its heading is figurative, the plain label becomes the heading (*Opening hours* over *When to find us* becomes *Opening hours*). Terms, disclaimers and consent text are never reworded. When the user says to keep every word, stamp `copy: verbatim`: 19, 58 and 69 then report as notes. + +## Depth + +The verb is a **full** redesign: the content and the wiring stay, the system and the composition change. A lighter depth runs only when the same request asks for it in so many words, and the Picks block names the depth: + +| Depth | Stays | Changes | Only when the request says | +| --- | --- | --- | --- | +| **full** | the content and the wiring | the system and the composition: shape, hero, section objects, chrome | nothing else: it is the verb | +| **restyle** | the layout | the system: colour, type, radius, shadow, motion, the controls | *keep the layout*, *restyle*, *reskin*, *only the colours and type* | +| **polish** | the system and the layout | only what a gate names: the tells, contrast, states, motion, tokens | *polish*, *keep our look*, *only fix what looks generated* | + +The depths do not blend: a polish that finds the concept wrong says so and recommends the full run, it never smuggles one in. + +**Full depth on an app screen** recomposes each screen inside the shell it has: what leads, and how the figures, tables and forms are arranged (`flow.md` § App screens). Routes, destinations and each component's logic stay; there is no hero stage and no hero review. + +*From scratch* is a build, not a depth: SKILL.md as written, the old page as its Step 2 inventory, in new files beside the old ones. + +## Before + +1. Run the pre-flight (Step 0), then list the pages in the target: route, file, and whether each is a page or an app screen (`flow.md` § App screens). In a framework project start the dev server and record through `--url`; the linter does not render the empty shell `index.html` from disk. An unstamped page has no genre: infer it from the page as Step 1 would from a prompt, and say so. +2. Record the page as it stands: + +``` +node /scripts/sloplint.mjs --genre --render --before [--url ...] [--scope app] +``` + +It prints the findings grouped by gate and writes them to `.hallmark/before.txt`, the screenshots to `.hallmark/before/` and the record to `.hallmark/before.json`: every link, form, field, inline handler, test hook, script tag, selector a script queries, heading and figure. Git ignores the folder's screenshots and records. + +3. Look at the screenshots before you weigh the findings, so the linter does not write the verdict, then give the read in four lines: what the page is for (the audience, the one action); what works and stays (at least one thing); what reads as generated (the worst tells, by gate); what is broken. + +**`audit ` stops here.** It loads `gates.md` § 1, § 4 and § 5, walks the judged gates from the screenshots, and reports the findings by tier with `file:line`, the read, the lightest depth that settles them and what only a deeper one would. It changes none of the project's files. + +## The ask + +One message replaces the Step 1 ask; skip it when the request already answers it or no one can answer: + +> *Before I redesign, three things. 1. **What must stay**: the brand, a section, a page? Say *keep the layout* and I only restyle. 2. **What is wrong with it**, in your words, and the feeling you want instead. 3. **Anything new to show**: screenshots, photos, numbers, a quote. Or say **go ahead** and I will redesign it in full.* + +## The plan + +The Picks block opens with four rows of its own, and nothing is deleted until the user has seen the Files row: + +```markdown +- **Redesign** · full · 3 pages (/, /pricing, /docs) +- **Before** · Floor 14 FAIL · Reflex 9 · a centred template in a stock indigo; the pricing table is clear and stays +- **Keeps** · every link, field and handler · the green and the brand face · the pricing table +- **Files** · edit: app/page.tsx, app/pricing/page.tsx, app/globals.css · create: app/tokens.css, app/base.css · delete: none +``` + +Then the build rows the depth reaches: Theme at restyle and full (dealt, `brand` or locked); Shape, Chrome, Hero, Signature and Sections at full only, where Step 2 runs with the page's own content as its inventory. At polish the block stops after Files. The deal's `--prompt` is the read's first line (what the page is for, in plain nouns), never the page's own copy, which is what the redesign is leaving behind. + +## Build + +- **Polish** is `flow.md` § The sweep, on the user's own page: fix in place, single elements and tokens, never restructure, under the check stamp with `built: the project · redesign: polish`. It loads `gates.md` § 1 to § 5 and `patterns.md`, `interaction-and-states.md` when the page has a form, the theme file an old stamp names, and from `craft.md` only the section a finding points at. +- **Where the layout stays** (polish and restyle), the stamp's `redesign:` field tells sloplint to report the layout gates (6b, 8, 9, 32, 42, 44a, 44c, 58, 77, 79) as notes; at polish the spacing and scale gates (24b, 59, 78) too, so a polish does not re-space a site it was asked to keep. Print them for the user with the depth that would settle them; do not rebuild them. At every depth 58 (the screen budget) is a note too: the words are the owner's, and only a copy gate cuts one. In app scope those gates are skipped, so the handoff's Layout row comes from the read and the review. A theme's own composition rules (its do-nots, the dials that vary between pages) yield to a kept layout: the theme lends its system, and every page takes one dial set. +- **Restyle and full** start from the scaffold, with the depth in the stamp: `theme.mjs scaffold --redesign `, or `scaffold --brand --redesign ` for a kept brand, its tokens filled from the palette and faces the pre-flight found (no `check`: the coordinates are the user's); add `--scope app` for app screens. It writes `tokens.css` and `base.css` beside the project's stylesheet and prints the imports that fit it (`export-formats.md` has the Tailwind and shadcn names). Then the shared components and the chrome, then the pages, the most visited first, each swept before the next. +- **More than one page** at restyle or full: lock the system once the scaffold has run (`design-md.md`). Every page reads it and the variety rule inverts: pages share theme, type and accent, and differ only in shape. One stylesheet for several pages lists a hero posture per route, `hero: Settled (/), Stage (/contact)`. Past three pages, give each page to its own subagent where the harness has them, with `design.md`, the page's files and this file. +- **Full depth** runs the hero stage and the hero review; polish and restyle skip both. The old sections still sit below the new hero at that stage: the stage judges the first screen alone, and what it reports below the fold waits for the sweep. Gate 8 judges the composition, not the order of the content: a kept sequence in a new composition is waived on the record. + +## After + +1. The sweep, against the record: `sloplint --genre --render --kept`. Anything the page had and no longer has is a `FAIL kept` (a link, a form, a field, a handler, a test hook, a script, a selector a script still queries) or a `WARN kept` (a heading, a figure, an image, an id). Restore it, or put it on the record in the stamp: `/* Hallmark · dropped /blog, #team · the user is retiring the blog and the team section */`, or for a line a copy gate named, `/* Hallmark · reworded "Built for modern teams" to "Out of your way" · 19 names the opener */`, or `dropped "" · 69 names it` for a line a gate cuts whole. The run also writes `.hallmark/compare.html`, the before and after screenshots side by side: give the user its path. +2. The project's own checks, where it has them: the type check, the build, the tests. A redesign that breaks one is not finished. +3. The finish review also takes the `before` screenshots and answers what the old page did better (`review-finish.md`). A polish hands it only the full pages at 1440, before and after, and takes at most five findings. A finding that is a plain defect (a misalignment, a broken glyph, a label that lies) is fixed at any depth; one that asks for a new composition joins the layout findings; one that asks for content the page never had goes to the owner in the handoff. +4. The log entry carries `mode: redesign`, `depth` and `scope` (page, site or app), plus the build's fields at full depth. +5. The handoff, ahead of the material ask; where the layout stayed it adds a Layout row (the findings only a full redesign would settle): + +``` +Redesign · full · 3 pages +Before Floor 14 FAIL · Reflex 9 +After Floor 0 · Reflex 1 waived (47b) +Kept 14/14 links · 5/5 fields · 9/9 handlers · 11/11 headings · every figure +Changed the system and the composition: shape, hero, sections, chrome +Dropped none +Yours 2 claims kept as found ("50,000+ teams", the Acme quote) · 4 lines reworded, listed below +Compare .hallmark/compare.html +``` diff --git a/skills/hallmark/references/responsive.md b/skills/hallmark/references/responsive.md new file mode 100644 index 0000000..c23bfed --- /dev/null +++ b/skills/hallmark/references/responsive.md @@ -0,0 +1,46 @@ +# Responsive + +Loaded for an unusual layout. No desktop-only interactions; every page renders without fault from 320 to 1920 CSS pixels. + +## What the script checks and what it cannot + +sloplint covers the mechanical half at 320, 375, 414, 768, 1024, 1280, 1440 and 1920: horizontal scroll and `overflow-x: clip` (34), wrapping controls (49), image tracks and display heads (50), radio tabs (53), stacked sticky elements (56). Check by eye at each width what it cannot see: every desktop sidebar or filter column collapses into a menu or a disclosure, section heads stack to one column, and a per-theme override carries its own mobile rule. + +## Breakpoints + +Two, shared by the whole page, in `rem` so they follow the user's font size. The scaffold steps its tokens down at both: under 60rem (about 960px, the layout breakpoint) gutters drop to 24px and the three section gaps to 80, 96 and 120px; under 40rem (about 640px, the type breakpoint) gutters drop to 16px, the section gaps to 56, 72 and 96px, and column gaps to 16px. Write component rules against the same two widths, in one direction for the whole page. Add a third only where the content itself breaks. + +- **Under 60rem:** multi-column grids go to one column, tilts and clip effects drop, sticky panes unstick, every hero posture collapses to content height (Poster may stay full-bleed). +- **Under 40rem:** display sizes step down, margin captions move inline, annotations consolidate. + +## Fluid and discrete + +`clamp()` for sizes that change continuously (the scale's display tokens already do); media queries for layouts that change discretely. Detect capability with `@media (hover: hover)` and `(pointer: coarse)`, never with width: + +```css +@media (hover: hover) { .link:hover { text-decoration-thickness: 2px; } } +@media (pointer: coarse) { .btn { min-height: 48px; } } +``` + +Body-adjacent UI (meta, nav links, controls) runs larger on a phone and tightens at 60rem (`craft.md` § 9). + +## Clickable text never wraps + +Buttons, primary nav links and CTAs are single-line at every width from 320 to 1920 (49a); footer links, tabs and breadcrumbs too unless a real phrase cannot shorten (49b). When one wraps, in this order: + +1. **Shorten the label.** *Get started free* to *Start free*; *Read the documentation* to *Read the docs*. +2. **`white-space: nowrap`** on the control, and let the row around it reflow. +3. **Collapse the row**, not the labels: under 60rem the links that no longer fit go behind a menu, while two or three short ones that fit stay in the bar. + +## Units and safe areas + +- `dvh` or `svh` for heights that meet mobile browser chrome, never `vh` on a hero (6a); `width: 100%`, never `100vw` (34). +- With `viewport-fit=cover`, fold the safe area into the gutter token: `--gutter: max(16px, env(safe-area-inset-left))`. + +## Tables, images, languages + +- **Tables** on a phone keep the column that names the row and the one that acts on it in view: restack each row as a labelled block, or pin the first column (`craft.md` § 9, F25). Ten columns on a phone is a redesign, not a squeeze. +- **Images:** `srcset` with width descriptors, `` for a different crop, `width` and `height` attributes on every image, `loading="lazy"` below the fold and never on the LCP element. +- **Languages:** logical properties (`margin-inline-start`, `padding-block`), room for 30 to 40% longer strings, no hard-coded date or number formats. + +Never: device sniffing instead of feature queries, hover-only interactions, breakpoints in `px`. diff --git a/skills/hallmark/references/review-finish.md b/skills/hallmark/references/review-finish.md new file mode 100644 index 0000000..00941b1 --- /dev/null +++ b/skills/hallmark/references/review-finish.md @@ -0,0 +1,19 @@ +# Finish review + +You are reviewing a built page against a fixed list. You did not build it and will not be told why anything is the way it is. Read the page, not the intent. Your inputs, and nothing else: the screenshots the render tier wrote (the folds at 1280 x 800, 1440 x 900 and 1920 x 1080, the full page at 1440 and at 375), the page's HTML or component source, the theme or idea line from the stamp, on a theme build the theme file and its picture, the hero review's findings with how each was settled, and `gates.md` § 4. Look at the screenshots first; open the HTML only to quote copy or to locate a finding; the linter has already read the CSS. A pinned pane shows once in a full-page shot: the column beside its later screens is the pin, not an empty half. Batch your reads; stop reading by the tenth turn and write. + +First line: one of `recapture` (a screenshot is missing, blank or shows the wrong thing; list what to recapture and stop), `rebuild` (the first viewport fails the idea or the theme wholesale), `fix` (findings follow), `ship` (nothing owed). + +Then the findings, ranked by cost to the page, at most eight, one line each: the gate or the plain defect, where it is, what you would do. Not findings: a direction you would not have chosen; what the theme file prescribes or refuses (its blooms, a glow on a theme with none); an element the hero review settled, unless you name a new reason. The theme's picture is the bar for finish and never a model: is this page as finished as that one, in a composition of its own? + +Scroll the 1440 full page one screen at a time before ranking: a screen with nothing big enough to be its reason (a head and a line adrift, a narrow column beside an empty half, a section head under 40px, an empty coloured box or a drawn illustration where a photograph or the product should be, a row of counting marks) outranks every detail finding (`layout.md` § 8). Then the copy: name any head that would pass unchanged on a competitor's page (`craft.md` § 6). + +Then one answer to the question no gate can: does the stamp's idea or theme describe the page in front of you? Name the largest gap, or say there is none. + +On a custom run (`theme: custom`) the page owes no shape, composition or hero layout: it was designed from nothing, so judge it as a design, never against `layout.md`. Before the idea line, write two lines of your own from the screenshots: what the page is about, and the one thing a visitor would remember. Then three findings when they fail. **Seen before:** the page, or a section, reads as a template, a catalog theme or a familiar site; name which and where. **Clean:** something is on the page without a job (a device repeated, a decoration, a box around nothing), or a screen has nothing worth looking at. **Carried:** the idea lives in the hero and stops there. + +On a redesign you also get the `before` screenshots, and the content is fixed: never ask for copy, an action or a visual the old page did not have. Add one answer: what did the old page do better? Name anything a visitor could do, read or find before that is harder now; if nothing, say so. On a polish you get only the full pages at 1440, before and after: the layout was kept on purpose, so ask one thing, whether anything still reads as machine-made, in at most five findings. + +On an app screen (the stamp says `shape: app screen`) there is no hero, fold or section rhythm to judge, and the gates `flow.md` § App screens skips are not findings. Read the full screens at 1440 and 375 and ask what someone fluent in the category would: is the hierarchy clear, is the density even, does every control and table work on a phone, are the states there. + +Close with one line naming what must not be diluted while fixing. Where the theme file and its picture disagree, the theme file wins over its picture. Do not fix anything. diff --git a/skills/hallmark/references/review-hero.md b/skills/hallmark/references/review-hero.md new file mode 100644 index 0000000..8b849c6 --- /dev/null +++ b/skills/hallmark/references/review-hero.md @@ -0,0 +1,20 @@ +# Hero review + +You are reviewing the first screen of a page that is still being built. You did not build it and will not be told why anything is the way it is. Your inputs, and nothing else: the four `hero-*` screenshots, the stamp's first two lines, the Picks block's Material and Signature rows, and on a theme build the theme's picture. Batch your reads; stop reading by the tenth turn and write. + +First line: `ship` or `fix`. + +Then at most five findings, one line each, worst first. Ask: + +- Does the headline say something only this product could say, in seven words or fewer? +- Is the content centred in the screen, or does it stop early over a band of nothing? Is the visual beside the text, a real picture (the user's, a photograph, the product built), and does it hold its half of the screen at 60% of its height or more? Where the shape puts no image in the fold (a Marquee, a Poster or a Banner hero), the type is the visual: does it fill the screen? At 1920 the container and the type hold their 1440 size by rule, so extra air there is not a finding. +- Does anything read as a template: a centred stack, a pill or a label above the headline, a gradient blob, an empty coloured box where a picture should be, a drawn illustration, a row of counting marks, two filled buttons side by side? A filled primary beside an outlined or text action that goes somewhere else is the control pair, and a sample of the product built in a slot is the product; neither is a finding. Grey bars or outline cards inside a slot are. +- Is the page's signature, its strongest real thing, on this screen? Delete the picture in your head: if the screen still says the same thing, the picture is too weak or too small. +- Does the type carry the theme at this size? +- With the theme's picture: is this first screen as finished as its first screen, in a composition of its own? + +On a custom run (`theme: custom`) the composition is free: skip the centred, beside-the-text and 60% questions, and ask instead whether this screen is one you would expect a model to make for this prompt. If it is, say what gives it away. + +On a redesign the page's content is fixed and what sits below the first screen is the old page, not yet rebuilt: neither is a finding. Never ask for copy, an action or a visual the page does not have; say in one line what the owner could supply. + +What the theme file prescribes (its blooms, its control pair) or refuses is not a finding. Where the theme file and its picture disagree, the theme file wins over its picture. Do not fix anything. diff --git a/skills/hallmark/references/scroll-choreography.md b/skills/hallmark/references/scroll-choreography.md new file mode 100644 index 0000000..91af31c --- /dev/null +++ b/skills/hallmark/references/scroll-choreography.md @@ -0,0 +1,110 @@ +# Scroll choreography: the one earned pattern + +The default is still none: the reveal-once in `craft.md` § 5 is the page norm. This file is the exception: a scroll-linked pattern used once, on structure, when the content has a sequence worth pinning or scrubbing. sloplint's F8 counts pattern families and flags a second one. + +## Budget + +- **One pattern per page.** Two scroll behaviours compete for the same attention. +- **Never on body text.** Targets are structural: a pinned section, one display element, a 2px spine, figures. Prose never moves under the reader. +- **Hero entrance rules unchanged.** The page-load orchestration in `craft.md` § 5 stays as is; scroll choreography never replaces it, and no element carries both. +- **Static end-state mandatory.** Base CSS shows the finished layout. The choreography lives entirely inside `@supports (animation-timeline: view())` and `@media (prefers-reduced-motion: no-preference) and (min-width: 40rem)`; reduced motion, small screens and browsers without support get the complete page. +- **Order matters:** the `animation` shorthand resets `animation-timeline` and `animation-range`, so declare them after it. +- **`linear` is correct here:** scrubbing maps scroll distance to progress one to one; an easing curve detaches the page from the thumb. +- A pattern counts as one of the page's three motion primitives (`microinteractions.md`). + +## 1 · Pinned chapter: steps reveal while the section is pinned + +The tall track owns a named view-timeline; the pinned pane's steps consume it in slices. (Elements inside a stuck pane cannot drive their own `view()`: they are not moving.) + +```html +
    +
    +

    How it works

    +
    1. …
    2. …
    3. …
    +
    +
    +``` +```css +.chapter { min-height: 280vh; } /* track length = pin duration */ +.chapter__pin { position: sticky; top: calc(var(--banner-height, 0px) + var(--space-xl)); } +@supports (animation-timeline: view()) { + @media (prefers-reduced-motion: no-preference) and (min-width: 40rem) { + .chapter { view-timeline: --chapter block; } + .chapter__steps li { animation: chapter-step linear both; animation-timeline: --chapter; } + .chapter__steps li:nth-child(1) { animation-range: contain 5% contain 30%; } + .chapter__steps li:nth-child(2) { animation-range: contain 30% contain 55%; } + .chapter__steps li:nth-child(3) { animation-range: contain 55% contain 80%; } + @keyframes chapter-step { from { opacity: 0.2; transform: translateY(8px); } to { opacity: 1; transform: none; } } + } +} +``` + +## 2 · Scrub-linked headline: one display element, clip wipe + +For a mid-page Statement head (`layout.md` § 5), never the hero `h1`, whose entrance is the load reveal. One element a page. + +```css +.statement__head { /* base: fully drawn */ } +@supports (animation-timeline: view()) { + @media (prefers-reduced-motion: no-preference) and (min-width: 40rem) { + .statement__head { + animation: head-wipe linear both; + animation-timeline: view(); + animation-range: entry 20% cover 45%; + } + @keyframes head-wipe { + from { clip-path: inset(0 100% 0 0); transform: translateX(-0.25em); } + to { clip-path: inset(0 0 0 0); transform: none; } + } + } +} +``` + +## 3 · Progress spine: `scroll(root)` scaling a 2px rule + +Reading progress as a hairline, not a chrome bar. A functional indicator, so `linear` is canon. Hidden below 40rem (it eats the mobile gutter). + +```css +.spine { position: fixed; inset-block: 0; left: max(1rem, 2vw); width: 2px; background: var(--color-rule); } +.spine::after { content: ""; position: absolute; inset: 0; background: var(--color-accent); + transform-origin: top; transform: scaleY(0); } +@media (max-width: 40rem) { .spine { display: none; } } +@supports (animation-timeline: scroll()) { + @media (prefers-reduced-motion: no-preference) and (min-width: 40rem) { + .spine::after { animation: spine-grow linear both; animation-timeline: scroll(root); } + @keyframes spine-grow { to { transform: scaleY(1); } } + } +} +``` + +## 4 · Sticky diptych: a two-pane pin + +The structure is a Split (`layout.md` § 5) with one side pinned: `.sticky-stack { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--gap-columns); }`, `.pane-sticky { position: sticky; top: calc(var(--banner-height, 0px) + var(--space-xl)); align-self: start; z-index: var(--z-sticky); }` (it docks below a sticky nav, 56), `.pane-scroll { display: grid; gap: var(--space-2xl); }`, each figure at 16:10 and 440px tall or more; under 60rem one column and `position: static`. The choreography adds only this: the scrolling figures fade in on their own `view()` (they move, so self-timelines work); the pinned side holds from one diptych to the next. + +```css +/* base: .sticky-stack grid + .pane-sticky pin, above; the pinned side holds down the page */ +@supports (animation-timeline: view()) { + @media (prefers-reduced-motion: no-preference) and (min-width: 40rem) { + .pane-scroll figure { animation: fig-in linear both; animation-timeline: view(); + animation-range: entry 0% entry 60%; } + @keyframes fig-in { from { opacity: 0.3; transform: translateY(12px); } to { opacity: 1; transform: none; } } + } +} +``` + +## JS fallback (optional, shared) + +When JS is present and `animation-timeline` is not, the one fallback is the reveal-once in `craft.md` § 5, never a scroll listener or a scrub polyfill: + +```html + +``` + +Pair it with a `--dur-long` `--ease-out` transition to the end state, and hide `[data-reveal]` only under the `.js` class the script adds (62). Without script and without support, the static layout is already the finished page. diff --git a/skills/hallmark/references/texture.md b/skills/hallmark/references/texture.md new file mode 100644 index 0000000..f47bc76 --- /dev/null +++ b/skills/hallmark/references/texture.md @@ -0,0 +1,90 @@ +# Texture and print artifacts: a budgeted vocabulary + +Loaded only when the picked theme earns texture (affinity table below) or a custom draw's lineage is print. Texture is a treatment with a budget, never ambience: one artifact family per page, tokened opacity, never animated, never under body text at more than a whisper. Grain smeared everywhere is the tic `flow.md` § Harnesses refuses; grain from this file, on a theme that earns it, is craft. + +## The budget (binds on every artifact) + +- **One artifact family per page.** Grain, halftone, misregistration, scanline or deckle, never two. A risograph print is one family: its grain and its misregistration come from the same drum. A halftone that is a photograph's treatment belongs to the image, not the page, and does not count. +- **Tokened opacity, declared in the token block:** `--texture-opacity` <= 0.08 page-wide, <= 0.15 scoped to a card or plate. Under running body text, <= 0.05 or nothing. A low-frequency wash (a base frequency of 0.02 or lower: a fibre, a paper tone) tints rather than specks and may run to 0.12 page-wide, with contrast measured on the result. +- **Never animated.** No drifting grain, no pulsing dots. +- **`pointer-events: none` and `aria-hidden="true"`** on every overlay; texture never intercepts input, and the retro signal is atmosphere, never a drawn monitor bezel (47a). +- **Perf:** pure CSS or a data-URI SVG filter; no image requests for texture. + +## 1 · Grain (paper) + +A speck grain, tokenised: + +```css +:root { --texture-opacity: 0.08; } +.grained { position: relative; isolation: isolate; } +.grained::after { + content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1; + background-size: 200px 200px; opacity: var(--texture-opacity); + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 -4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E"); +} +``` + +The colour matrix turns the noise into discrete specks (alpha is the noise times nine, minus four), so the grain reads at 1x inside the budget; untreated `feTurbulence` at these opacities is a haze nobody sees. On a dark ground the specks must be light: change the matrix's first three rows to `0 0 0 0 1` so each speck is white, keep the opacity. One plate, one accent card, or the page at 0.08 or less when the theme names grain. + +## 2 · Halftone (dot field) + +A dot screen with a size token: + +```css +:root { --halftone-size: 12px; --halftone-dot: 1.5px; } +.halftone { background-image: radial-gradient(var(--color-ink) var(--halftone-dot), transparent var(--halftone-dot)); + background-size: var(--halftone-size) var(--halftone-size); } +``` + +Plate fills and section bands. Never under or overlapping type. Dot in ink or one spot colour, never the accent at full field strength. + +## 3 · Misregistration (chromatic echo) + +Riso's signature, portable to any print-lineage custom run: + +```css +.misreg { position: relative; display: inline-block; isolation: isolate; } +.misreg::before, .misreg::after { + content: attr(data-text); position: absolute; inset: 0; z-index: -1; + white-space: nowrap; pointer-events: none; +} +.misreg::before { color: var(--color-accent); transform: translate(-2px, -2px); } +.misreg::after { color: var(--color-accent-2, var(--color-focus)); transform: translate(2px, 2px); } +``` + +**One focal word per page, in the hero, under the theme's `waive 38iii`; never every heading.** The span is an inline block so the copies sit on the glyphs whatever the head's line-height, and they print behind the ink so the word keeps its colour; only the fringes carry the echoes. The echo colours are the theme's declared spot inks (`--color-accent` and `--color-accent-2` here, or the theme's own echo tokens); the offset stays 1 to 3px (more reads broken, not printed). It may settle once on load over `--dur-long` at most, static under reduced motion; it never loops. + +## 4 · Scanline (CRT) + +Arcade's recipe; the retro signal is atmosphere, never a drawn monitor bezel (47a): + +```css +:root { --scanline: oklch(from var(--color-ink) l c h / 0.06); } +body::after { content: ""; position: fixed; inset: 0; z-index: var(--z-raised); + pointer-events: none; + background: repeating-linear-gradient(transparent 0 2px, var(--scanline) 2px 3px); } +``` + +`--scanline` is a page-local decorative token at low alpha. Arcade and arcade-adjacent customs only. + +## 5 · Deckle (paper edge) + +For plates, tickets, and stubs on print-lineage pages: + +```css +.deckled { box-shadow: inset 0 0 0 1px var(--color-rule); + mask-image: radial-gradient(6px at 0 50%, transparent 97%, black); + mask-size: 12px 24px; mask-repeat: repeat-y; mask-position: left; } +``` + +One edge, one element class per page (a ticket edge, a stamp perforation). Never on cards generally; it is an artifact, not a border style. + +## Affinity: who earns texture + +A theme earns texture when its Surfaces section names one; a custom draw earns it when its lineage is print (risograph, letterpress, ticket stock, line printer), and then it picks the one artifact that lineage used. The budget above binds every theme, whatever its file says: page-wide grain at 0.08 or less, 0.15 inside one plate, 0.05 or nothing under running text. Examples: Riso (grain and misregistration), Halftone (a dot screen), Paste-up (a fibre wash), Darkroom (film grain), Arcade (scanlines). + +**Never:** a texture a theme does not name, grain on a modern-minimal page, two artifact families on one page, or a texture as ambience over everything because the page felt flat. + +## Reduced motion and accessibility + +The settle-once misregistration and nothing else moves; everything here ships identical under `prefers-reduced-motion: reduce` because nothing animates. Texture never lowers text contrast below the gate-40/41 thresholds: measure contrast on the textured result, not the flat token. diff --git a/skills/hallmark/references/themes/README.md b/skills/hallmark/references/themes/README.md new file mode 100644 index 0000000..cceba05 --- /dev/null +++ b/skills/hallmark/references/themes/README.md @@ -0,0 +1,58 @@ +# Writing a theme file + +Read only when creating or editing a theme. A build never needs it. `node scripts/theme.mjs validate ` checks the contract below and must pass before a theme ships. + +**A theme is a material, nothing else.** It says what a page is made of: paper, ink, faces, rules, radius, depth, texture, controls, motion, voice. It never says what the page contains, in what order, in what shape, or how much room anything gets, and it never ships a component: no signature object, no drawn thing, no named part a page must include. Space, section composition and the hero's size belong to `layout.md` and bind every theme alike; a theme that says "air carries the page" or "whitespace does the structure" is overriding them. Every rule the Floor, `craft.md` or `layout.md` already binds is left out. + +## The header block + +Every file opens with this block, which `scripts/theme.mjs index` compiles into `index.json` (the deal reads the index, never the files): + +``` +--- +name: Coral +slug: coral +genre: modern-minimal +paper: light 96.5 50 +display: grotesk-sans General Sans +accent: warm 28 +posture: restrained +keywords: saas, platform, billing, payments, dashboard, b2b, startup, pricing, analytics, fintech, workflow, onboarding, trust, warm, human +material: warm grey paper, warm charcoal ink, General Sans throughout, soft pills, one coral signal +photo: muted +--- +``` + +- `paper`: band (`light` over 85% L, `mid` 30 to 85, `dark` under 30), then L and hue of `--color-paper`. +- `display`: class, then the face. Classes: `roman-serif`, `high-contrast-serif`, `slab-serif`, `grotesk-sans`, `grotesk-heavy`, `geometric-sans`, `rounded-sans`, `display-condensed`, `display-heavy`, `mono`, `pixel`, `handwritten`, `blackletter`. +- `accent`: band (`warm` 10 to 60°, `cool` 200 to 300°, `neutral` chroma under 0.05, or `chromatic-` for anything else), then the hue. +- `posture`: `restrained`, `committed`, `full-palette` or `drenched`. +- `keywords`: the words in a prompt that route here, lowercase, comma-separated, ten to twenty-five. +- `material`: one line, the deal prints it: paper, ink, faces, surface, signal. Materials only, no objects. +- `photo`: the treatment every photograph on a page takes, written into `base.css` by the scaffold as CSS on every image in a slot: `natural`, `warm`, `muted`, `mono`, `duotone ` or `tint ` (token names without `--color-`, so `duotone ink paper`), optionally followed by `con=`, `sat=`, `vib=`, `exp=`, `sepia=`, `high=` or `shad=` with a whole number. Pick what the material would do to a photograph: a newsprint prints it black, a riso pulls it in two inks, a warm studio keeps it natural. +- `pictured`: written by `scripts/picture.mjs`, the shape and hero posture of the page in the theme's picture, so a build knows which composition is already taken. + +## The picture + +Every theme ships `.jpg` beside its file: the first screen and one lower screen of a finished page built in the theme with the skill, each at 1440 x 900, scaled to 960 wide and stacked (`node scripts/picture.mjs `). The page must sweep clean, pass `layout.md` on every screen, and be one a designer would sign; its lower screen shows the material at work in a full section, and its pictures are real (photographs or the product built), never an empty slot. A build reads the picture for palette balance, type voice and surfaces, never for layout. A theme without a picture validates with a warning. + +## The body, in order, 3,000 to 8,000 bytes + +1. **One paragraph:** what the theme feels like and what it is not. No brand names: describe the register, never the sites that have it. +2. **Tokens:** a `:root` block with the real values in OKLCH: paper, paper-2, paper-3, ink, ink-2, muted, rule, accent, accent-ink, focus; the three font tokens; `--radius-card`, `--radius-pill`, `--rule-hair`, `--shadow-card`; `--tracking-display`, `--display-weight` (the weight every head takes). Optional: `--color-slot` when the slot wash should take a second hue rather than the accent. No comments inside the block: `theme.mjs scaffold` copies it verbatim into a page's `tokens.css`. A theme with colourways lists the alternates in a short table under the block, and the page states its choice in the stamp. +3. **Type:** display, body, and the outlier if any, with weights, tracking, case and leading; sizes come from the shared scale (`layout.md` § 2), so a theme names a step only where its face needs one (a condensed face may set one step larger). Labels, captions, table heads, tags and nav links are the body face a step smaller, sentence case, untracked, or one label face the theme names, never mono unless mono is this theme's material. A head is one weight and one colour; a theme built on an accented word names it and says it appears once. +4. **Surfaces:** four to six bullets: rule weight and where rules run, radius, depth stance, the bands a page may use (which paper, how many), photographs (what kind of picture suits the material, how it is framed and cropped, how it meets the type), the texture budget (naming the `texture.md` recipe if any). +5. **Range:** three or four bullets on what this material makes without a photograph: which compositions of `layout.md` § 5 it sets best and with what (a figure in the display face, rules drawn into a table, the accent as a band that holds a form, a line set as a specimen, the product's own surface). A page in the theme alternates pictures with sections only this material could make (83), so the range is what keeps it from reading as a stock gallery. These are treatments of the shared compositions, never a component a page must include, and never a section order. +6. **Controls:** two or three bullets: the control pair, links, inputs, and where the accent may sit. +7. **Motion:** one to three lines: how fast, how it eases, what may move. +8. **Voice:** one or two lines on the copy's register. +9. **Do-nots:** three to five bullets specific to this theme's own failure modes, never restatements of a gate. +10. **Build hint:** at most 20 lines of CSS carrying the rules that make the material recognisable (the head setting, the control pair, a well or band surface, a texture if any), every colour, duration, easing and space a token (validate refuses raw milliseconds, a bare `ease`, named colours and raw spacing). Font links as one line. + +## What a theme may not carry + +A component or object of any kind (a plate, a sign, a disc, a drawer, a sticker sheet, a ticket, a drawn product, a folio column, a mark the page must draw), a section sequence, a page outline, a mandated nav, footer, hero or imagery, HTML scaffolds, page-part class names, rules about space or density, verbatim copy, invented brand names or people, an eyebrow in any form, a label in tracked capitals or small caps, a stamp or a badge that carries no fact, counts that fix a layout, neighbour comparison tables (the deal computes distance from the header block), or a list of reference sites. + +## Contradictions to avoid + +The field's calibration of the AI look, which the gates enforce: cream paper with a high-contrast serif and a terracotta accent (65); a monospace label voice on a theme whose material is not mono (64); labels, tags or controls in tracked capitals (67); one coloured or bold word inside a head (38iii); middle-dot meta strings and arrow suffixes (63); italic display as a flourish (38); glow shadows and radial halos on dark themes (29). A theme that wants one of these declares it as its material in the header and the file, with the Reflex it waives named once, or it does not have it. diff --git a/skills/hallmark/references/themes/almanac.jpg b/skills/hallmark/references/themes/almanac.jpg new file mode 100644 index 0000000..ca9aa70 Binary files /dev/null and b/skills/hallmark/references/themes/almanac.jpg differ diff --git a/skills/hallmark/references/themes/almanac.md b/skills/hallmark/references/themes/almanac.md new file mode 100644 index 0000000..95a5778 --- /dev/null +++ b/skills/hallmark/references/themes/almanac.md @@ -0,0 +1,103 @@ +--- +name: Almanac +slug: almanac +genre: editorial +paper: mid 84 245 +display: grotesk-sans Hanken Grotesk +accent: chromatic-magenta 350 +posture: restrained +keywords: almanac, yearbook, field guide, reference, handbook, manual, index, catalogue, encyclopedia, data, figures, tables, statistics, research, dataset, records, directory, glossary, specifications +material: cool slate stock with a pale printed sheet, blue-black ink, Hanken Grotesk heads over Newsreader prose with mono figures, two rule weights and square corners, one chart magenta +photo: muted +pictured: Workbench, Stage hero +--- + +# Almanac + +The register of a reference book: cool slate stock, blue-black ink, Hanken Grotesk heads over Newsreader prose, figures in mono lined up to the decimal, rules in two weights, and one deep magenta, the colour a sea chart prints its lights in, kept small. It reads as exact because the rules and the numerals hold the authority, not colour or ornament. It is not a dashboard on grey and not a warm editorial page. + +## Tokens + +```css +:root { + --color-paper: oklch(84% 0.012 245); --color-paper-2: oklch(81% 0.012 245); --color-paper-3: oklch(77% 0.012 245); + --color-ink: oklch(16% 0.020 245); --color-ink-2: oklch(24% 0.018 245); --color-muted: oklch(38% 0.016 245); + --color-rule: oklch(73% 0.013 240); --color-rule-2: oklch(32% 0.018 240); + --color-accent: oklch(45% 0.180 350); --color-accent-2: oklch(37% 0.160 350); --color-accent-ink: oklch(97% 0.006 245); --color-focus: oklch(46% 0.190 350); + --color-sheet: oklch(93.5% 0.008 245); + --font-display: "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif; + --font-body: "Newsreader", ui-serif, Georgia, serif; + --font-outlier: "IBM Plex Mono", ui-monospace, monospace; + --radius-card: 0; --radius-pill: 2px; --rule-hair: 1px; --rule-bar: 2px; --shadow-card: none; + --tracking-display: -0.02em; --display-weight: 600; +} +``` + +## Type + +- **Display:** Hanken Grotesk 600 for every head, `--tracking-display`, line-height 1.05, sentence case, roman; the hero head tightens to -0.035em at line-height 0.95. The grotesk sets structure; the serif never sets a head. +- **Body:** Newsreader 400 and 500 with optical sizing, line-height 1.55; italic is in-paragraph emphasis only. +- **Labels, captions, table heads, meta:** Newsreader 500 a step smaller, sentence case, `--color-muted`. Never mono. +- **Figures:** IBM Plex Mono 400 and 500 with `tabular-nums`, right-aligned in a column, decimals lined up. Mono sets numerals and nothing else; a lone figure (a price, a count) may run to `--text-display` in Plex Mono 500 at -0.04em. + +## Surfaces + +- Two rule weights: `--rule-hair` in `--color-rule` parts rows and divisions; `--rule-bar` in `--color-rule-2` draws one firm line under a head or a table head. Nothing heavier. +- Square corners on every surface, 2px at most on a control. No boxed cards, no shadows: depth is a rule and a paper step (`--color-paper-2` on a well or an alternate row). +- The sheet: `--color-sheet` is the printed page, a pale stock laid on the slate with a 2px ink rule at its head and hairlines inside; the product's own pages and tables sit on it, never a paragraph. +- Bands: a `--color-paper-2` band, or one `--color-ink` band with paper text and mono in the sheet colour. Two bands a page at most; never a magenta field. +- Photographs: the subject at working distance (a harbour at low water, a slipway, the sea under weather), mid to far, flat overcast or first light, no face to the lens. Square, an inset 1px `--color-rule-2` outline, full-bleed or across ten columns; a caption beneath carries a fact; type never sits on a photograph. +- No texture: ruled paper, never a card surface. + +## Range + +- **The page itself:** a table set as the printed book sets it, on the sheet: a dated head over a 2px rule, the row names in Newsreader, times and heights in Plex Mono right-aligned, one row in magenta where the page points; it carries a hero or a split on its own. +- **One chart, set large:** a single series in magenta at 2px across twelve columns, the night or the off-hours shaded in paper steps, every turning point labelled in mono; with a control it becomes the page's one working thing. +- **The file on the ink band:** a header row and a handful of sample lines in Plex Mono in the sheet colour, the column names in magenta, a caption that says what the full file holds. +- **A comparison of editions or plans:** a Table of two or three columns, the firm rule under the head, prices as mono figures, the actions in the last row. + +## Controls + +- A magenta filled control (`--color-accent-ink` on `--color-accent`) beside a hairline-outlined control in ink, both Hanken Grotesk 500 at the 2px radius. +- Links in ink with a 1px magenta underline at a 0.15em offset that thickens on hover; inputs square with a 1px `--color-muted` edge. +- Magenta stays under 5% of a screen: the filled control, link underlines, the one series a chart argues from. + +## Motion + +Nothing moves except state: a row that links tints on hover, a link's underline thickens. No reveal, no count-up, no marquee. + +## Voice + +Declarative, dated, exact: cite the figure, the edition, the source, the unit. Never a hype adjective. + +## Do-nots + +- Never a hot pink or a violet; the magenta holds at L 44, hue 350, deep enough to read as a chart's print. +- Never warm or white paper; slate at hue 245, always tinted. +- Never a boxed card or a drop shadow; two rule weights carry every surface. +- Never a giant count as the hero, a page of small charts, or one mark for each day or port: one chart, set large, carries the data. +- Never a decorative wave or line drifting behind the type; a curve appears only as a chart with its axes. +- Never proportional figures in a column; numerals that compare are Plex Mono, tabular, right-aligned. + +## Build hint + +```html + +``` + +```css +body { color: var(--color-ink-2); } +h1, h2, h3 { font-weight: 600; color: var(--color-ink); } +.num, td.num { font-family: var(--font-outlier); font-variant-numeric: tabular-nums; text-align: right; } +thead th, .rule-firm { border-bottom: var(--rule-bar) solid var(--color-rule-2); } +th { font: 500 var(--text-sm)/1.3 var(--font-body); color: var(--color-muted); text-align: left; } +td { border-top: var(--rule-hair) solid var(--color-rule); } +.btn { border: var(--rule-hair) solid var(--color-ink); border-radius: var(--radius-pill); padding: var(--space-sm) var(--space-lg); font: 500 var(--text-sm)/1 var(--font-display); color: var(--color-ink); background: transparent; } +.btn--primary { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); } .btn--primary:hover { background: var(--color-accent-2); } +.well { background: var(--color-paper-2); border-top: var(--rule-bar) solid var(--color-rule-2); } +.sheet { background: var(--color-sheet); border-top: var(--rule-bar) solid var(--color-ink); } +.band--ink { background: var(--color-ink); color: var(--color-paper); } +.chart .series { fill: none; stroke: var(--color-accent); stroke-width: 2; } +.photo > img { outline: var(--rule-hair) solid var(--color-rule-2); outline-offset: -1px; } +a { color: var(--color-ink); text-decoration-color: var(--color-accent); text-underline-offset: 0.15em; } a:hover { text-decoration-thickness: 2px; } +``` diff --git a/skills/hallmark/references/themes/arcade.jpg b/skills/hallmark/references/themes/arcade.jpg new file mode 100644 index 0000000..dd3be43 Binary files /dev/null and b/skills/hallmark/references/themes/arcade.jpg differ diff --git a/skills/hallmark/references/themes/arcade.md b/skills/hallmark/references/themes/arcade.md new file mode 100644 index 0000000..467e32f --- /dev/null +++ b/skills/hallmark/references/themes/arcade.md @@ -0,0 +1,102 @@ +--- +name: Arcade +slug: arcade +genre: playful +paper: dark 14 312 +display: pixel Silkscreen and Bungee +accent: chromatic-ember 40 +posture: full-palette +keywords: game, indie, game studio, launch party, demo night, hackathon, festival, meetup, retro, pixel, arcade, nostalgia, synth, lo-fi, toy, zine, club night, loud +material: aubergine CRT ground, lilac-white ink, Bungee capitals split in RGB over Chivo, Silkscreen figures, hard offset shadows, ember and acid signals +photo: tint accent +pictured: Marquee Hero, Stage hero +--- + +# Arcade + +A late-night cabinet: an aubergine ground under a CRT screen, Bungee capitals split in RGB over Chivo, Silkscreen figures, hard offset shadows, two loud inks that take turns like two players. Photographs come through the screen, tinted in the lead. It is loud through colour, lettering, light and press physics, never drawn props; not a neon synthwave poster, not a pixel-art game page. + +## Tokens + +```css +:root { + --color-paper: oklch(14% 0.04 312); --color-paper-2: oklch(18.5% 0.042 312); --color-paper-3: oklch(23% 0.045 312); + --color-ink: oklch(95% 0.014 315); --color-ink-2: oklch(87% 0.018 315); --color-muted: oklch(71% 0.024 315); + --color-rule: oklch(34% 0.05 312); + --color-accent: oklch(66% 0.215 40); --color-accent-2: oklch(88% 0.195 115); --color-accent-ink: oklch(14% 0.04 312); + --color-focus: oklch(88% 0.195 115); + --color-crt-r: oklch(63% 0.24 25); --color-crt-g: oklch(80% 0.25 140); --color-crt-b: oklch(60% 0.24 265); --color-crt-c: oklch(78% 0.14 200); --color-shade: oklch(8% 0.02 315); + --font-display: "Bungee", "Impact", sans-serif; --font-body: "Chivo", ui-sans-serif, sans-serif; --font-outlier: "Silkscreen", monospace; + --radius-card: 4px; --radius-pill: 0; --rule-hair: 1px; --rule-bar: 2px; + --shadow-card: 6px 6px 0 var(--color-accent-2); + --tracking-display: 0; --display-weight: 400; +} +``` + +Two dials, each stated in the stamp (`arcade: ember/grille`). Colourway, lead over answer on ground: `ember` (the block above), `sodium` (80% 0.165 72 over 60% 0.145 242 on 14% 0.030 300) or `oxblood` (83% 0.150 90 over 58% 0.200 25 on 16% 0.028 330). Screen: `grille` (1px vertical RGB stripes at low alpha) or `mask` (a triad dot lattice on a 3px pitch). Never mix two on a page. + +## Type + +- **Display:** Bungee 400, uppercase, untracked, line-height 1.02, for the h1, one statement line and the wordmark, each under 28 characters. It carries the RGB split: 1 to 2px of `--color-crt-r` one way and `--color-crt-c` the other, zero blur, one split line per screen. +- **Heads and body:** Chivo; section heads 900 at -0.02em and line-height 1, sentence case; prose 400 at 1.6. +- **Figures:** Silkscreen 700, untracked, tabular, at 40px and up only (it smears smaller), in the two inks, with the unit beside it in Chivo 700. Never a word in Silkscreen but a unit like PM. +- **Labels:** Chivo 700 a step smaller, sentence case. + +## Surfaces + +- `--rule-bar` on wells and anything pressable, `--rule-hair` in `--color-rule` between rows; 4px radius, square tags and inputs. +- Depth: the zero-blur acid offset on anything pressable, a ground step on a well, the cursor row (a row filled ember with `--color-accent-ink` type, like a selected menu line) for the one thing a list wants chosen. Never blur. +- Bands: `--color-paper-2` under the screen, or one ember field with `--color-accent-ink` type and no RGB split. Two a page at most. +- Photographs: the night from inside the room: hands on a stick, keys lit from below, players from behind, nobody facing the lens. Tinted, a `--rule-bar` border, under the screen; big and few. +- The screen (`texture.md` § 4): the dial's layer and a `--color-shade` scanline, static, on bands, wells and photographs; never under running text, never a bezel. + +## Range + +- **Figures as a score line:** the prompt's real numbers in Silkscreen at `--text-display-s` and up, ember and acid alternating, parted by `--rule-bar` verticals across the twelve columns. +- **Two-player comparison:** two wells side by side, one keyed ember and one acid (a top bar and the figure ink), rows matched across them for two audiences or two choices; the inks are the players, nothing is drawn. +- **A timetable or price list as a menu:** Rows of Silkscreen times or prices against Chivo 900 titles on hairlines, one cursor row lit ember. +- **Statement and working control:** one Bungee line at display size on the ember field; or the press surface as a stepper with a running total in Silkscreen at display size. + +## Controls + +- The press surface: an ember fill, Chivo 700, a `--rule-bar` ink border and the acid offset, beside the same surface unfilled. Hover moves away from the shadow, active slams toward it; a stepper button is the same surface square. +- Links in ink with a 2px acid underline; inputs 52px, square, a `--rule-bar` border in `--color-muted`. +- Ember leads and acid answers across controls and figures; never a third ink. + +## Motion + +Press physics on `--dur-micro` and `--ease-out`. A cursor row lights on `steps(1)`, no fade; the RGB split may widen 1px on a display line that links. + +## Voice + +Coin-op plain, said over the noise: the night, the hour, the door price, the machines. Short lines, verbs first, no nostalgia. + +## Do-nots + +- Never magenta and cyan as the pair, never a starfield; the screen is the texture. +- Never a soft shadow, a phosphor glow or a gradient on a button. +- Never a drawn sprite, joystick, controller or pixel character; the night is photographed. +- Never a page of tinted photographs back to back: an ember picture beside an ember picture is one orange wall. + +## Build hint + +```html + +``` + +```css +h1, .display { font-family: var(--font-display); font-weight: 400; line-height: 1.02; text-transform: uppercase; text-shadow: -1.5px 0 0 var(--color-crt-r), 1.5px 0 0 var(--color-crt-c); } +h2, h3 { font-family: var(--font-body); font-weight: 900; letter-spacing: -0.02em; line-height: 1; } +.figure { font-family: var(--font-outlier); font-weight: 700; color: var(--color-accent-2); font-variant-numeric: tabular-nums; } +.btn { background: var(--color-accent); color: var(--color-accent-ink); border: var(--rule-bar) solid var(--color-ink); border-radius: var(--radius-card); padding: var(--space-sm) var(--space-lg); font-weight: 700; + box-shadow: var(--shadow-card); transition: translate var(--dur-micro) var(--ease-out), box-shadow var(--dur-micro) var(--ease-out); } +.btn:active { translate: 3px 3px; box-shadow: 2px 2px 0 var(--color-accent-2); } +.btn--secondary { background: transparent; color: var(--color-ink); } +.row:hover, .row[aria-current] { background: var(--color-accent); color: var(--color-accent-ink); transition: background-color var(--dur-micro) steps(1); } +.well { background: var(--color-paper-2); border: var(--rule-bar) solid var(--color-rule); border-radius: var(--radius-card); } +.crt { position: relative; isolation: isolate; } +.crt::after { content: ""; position: absolute; inset: 0; pointer-events: none; + background-image: + repeating-linear-gradient(to right, color-mix(in oklab, var(--color-crt-r) 5%, transparent) 0 1px, color-mix(in oklab, var(--color-crt-g) 5%, transparent) 1px 2px, color-mix(in oklab, var(--color-crt-b) 5%, transparent) 2px 3px), + repeating-linear-gradient(to bottom, transparent 0 2px, color-mix(in oklab, var(--color-shade) 16%, transparent) 2px 3px); } +``` diff --git a/skills/hallmark/references/themes/atelier.jpg b/skills/hallmark/references/themes/atelier.jpg new file mode 100644 index 0000000..403d342 Binary files /dev/null and b/skills/hallmark/references/themes/atelier.jpg differ diff --git a/skills/hallmark/references/themes/atelier.md b/skills/hallmark/references/themes/atelier.md new file mode 100644 index 0000000..8f198af --- /dev/null +++ b/skills/hallmark/references/themes/atelier.md @@ -0,0 +1,98 @@ +--- +name: Atelier +slug: atelier +genre: editorial +paper: light 94.5 76 +display: roman-serif Sentient +accent: cool 248 +posture: restrained +keywords: fashion, atelier, couture, fragrance, gallery, exhibition, museum, ceramics, furniture, homeware, architecture, design studio, lookbook, collection, craft, small-batch, made by hand, brand story, luxury, object, hotel, boutique hotel, hospitality, stay +material: limewash paper under a slow luminous air, deep umber ink, Sentient light over Hanken Grotesk, cotton card stock with fibre and pressed type, hairlines, matted prints in warm daylight, one cool slate signal +photo: warm con=-6 vib=-10 +pictured: Gallery Hang, Diffusion hero +--- + +# Atelier + +The register of a maker's catalogue held in still air: limewash paper with a slow, luminous haze moving behind it, deep umber ink, Sentient light in heads and statements, Hanken Grotesk for reading, hairlines, one slate signal nearly as dark as the ink. The things a house hands you (a sample strip, a card, a numbered print) are built on cotton stock, lit from the top left, with pressed type and fibre. Not a cream page with a thin luxury serif, not a product page with a blue button. + +## Tokens + +```css +:root { + --color-paper: oklch(94.5% 0.010 76); --color-paper-2: oklch(91.8% 0.013 74); --color-paper-3: oklch(88% 0.015 72); + --color-ink: oklch(19% 0.024 52); --color-ink-2: oklch(31% 0.018 54); --color-muted: oklch(47% 0.014 60); + --color-rule: oklch(81% 0.011 70); + --color-accent: oklch(41% 0.075 248); --color-accent-ink: oklch(96% 0.008 76); --color-focus: oklch(50% 0.095 248); + --color-card: oklch(97.6% 0.007 82); --color-card-edge: oklch(86% 0.012 72); --color-pencil: oklch(52% 0.010 62); + --card-lit: oklch(98.4% 0.006 84); --card-shade: oklch(96.4% 0.008 78); --lit: oklch(99.6% 0.004 85 / 0.9); + --stain-1: oklch(70% 0.075 14); --stain-2: oklch(66% 0.055 132); --stain-3: oklch(60% 0.080 58); --stain-4: oklch(68% 0.045 206); + --font-display: "Sentient", Georgia, serif; --font-body: "Hanken Grotesk", system-ui, sans-serif; + --font-outlier: var(--font-body); + --radius-card: 0; --radius-pill: 3px; --rule-hair: 1px; --rule-head: 1px; + --shadow-card: 0 0 0 1px oklch(30% 0.03 55 / 0.05), 0.5px 1px 1px oklch(30% 0.03 55 / 0.08), 3px 8px 14px -6px oklch(30% 0.03 55 / 0.14), 14px 36px 64px -28px oklch(30% 0.03 55 / 0.3); + --tracking-display: -0.018em; --tracking-statement: -0.022em; --display-weight: 300; --statement-weight: 300; --serif-small: 400; +} +``` + +## Type + +- **Display and statement:** Sentient 300 for every head and for a sentence or a figure at `--text-display-s` or larger, line-height 1.02 to 1.1, sentence case, roman. One weight and one colour a head. +- **Small serif:** Sentient 400 for `h3`, a name on a card, a day, an entry numeral; never under 16px, never a paragraph. +- **Body:** Hanken Grotesk 400, line-height 1.6, `--color-ink-2`. Three weights a page: Sentient 300 and 400, Hanken 400. +- **Labels:** the wall label: Hanken 400 a step smaller, sentence case, untracked; the object in ink, the material or number in `--color-muted`. A numbered edition is pencilled: a blank rule for the hand, then the run, in `--color-pencil`. + +## Surfaces + +- The air: one fixed WebGL field behind the page, domain-warped noise drifting upward in cream and pale amber veils, mixed in linear light, rendered at half size; the pointer's recent path parts it and a chosen item tints it. It shows through the hero and one or two zones; paper sections cover it. A still frame of the same field is the fallback. Never a gradient blob, never a photograph. +- Texture is generated as feTurbulence data URIs: `--grain` (180px, 1.15) multiplied at 0.16 over the air, `--fibre` (220px, 0.85) on all card stock. +- Card stock: cotton in `--color-card`, 2px corners, `--shadow-card`, an inset lit edge top left, an inner hairline frame inset 14px in `--color-card-edge`; type on it is pressed (a 1px lit text shadow below). +- Sample strips: slim cotton blotters with a pointed tip, the item's stain wicking up from the tip, the name printed small and vertical. They fan from a rivet beside a head, hang from a rail as tabs (the chosen one let down on a thread), or tuck behind a card. +- Hairlines on rows; a table or list opens on an ink `--rule-head` rule. Photographs: still life and rooms in warm daylight, hung square with a wall label; the lead picture is a print on a thin cotton mat with a fine bevel and its edition pencilled beneath. + +## Range + +- **Statement:** one sentence of the prompt in Sentient 300 across nine or ten columns, the pencilled edition line and a wall-text paragraph opening on a slate drop cap. +- **The choice as strips:** the collection as blotters on a rail, each a real tab; the chosen one drops, its picture and wall label beside it. +- **Timetable:** days or hours as a ruled table under the ink rule, names in Sentient 400, a closed row muted, never struck through. +- **The booking as a card:** the form as a letterpress card on cotton: the house name pressed, a ringed day picker (a blind impression around the chosen day), engraved time chips, ruled lines to write on, strips tucked behind. + +## Controls + +- A hairline-outlined control in ink at 3px (hover fills ink, paper text) beside an underlined link with a slate underline. No colour-filled control. +- Choices on card stock are pressed in: inset shade top left, lit edge below; chosen takes a 1px ink ring. Fields on a card are a label over a ruled line. +- The slate stays under 4% of a screen: underlines, the drop cap, the focus ring. + +## Motion + +Fade-in after fonts; strips unfurl once on `--ease-out` over `--dur-long`; the air drifts, parts and tints, paused off screen. Reduced motion and no script: a still air, the first item chosen. + +## Voice + +Hand-set, object-precise: the object, the material, the number made, the days the door is open. No superlatives, never "shop now" or "discover". + +## Do-nots + +- Never a warm accent; the signal is cool slate under chroma 0.09. +- Never a bold or high-contrast head; Sentient light carries the voice. +- Never serif running text. +- Never a flat white card or a blurred glass panel; card stock has fibre, a lit edge and one light from the top left. +- Never two still lifes side by side at one size. + +## Build hint + +```html + +``` + +```css +body { color: var(--color-ink-2); line-height: 1.6; } +h1, h2 { font-weight: var(--display-weight); color: var(--color-ink); } h3 { font-weight: var(--serif-small); } +.ruled { border-top: var(--rule-head) solid var(--color-ink); } .ruled > * + * { border-top: var(--rule-hair) solid var(--color-rule); } +.dropcap::first-letter { float: left; font: var(--serif-small) 3.3em/0.8 var(--font-display); padding: 0.1em 0.1em 0 0; color: var(--color-accent); } +.btn { min-height: 52px; border: var(--rule-hair) solid var(--color-ink); border-radius: var(--radius-pill); padding: 0 var(--space-lg); color: var(--color-ink); background: transparent; transition: background-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out); } +.btn:hover { background: var(--color-ink); color: var(--color-paper); } +.stock { border-radius: 2px; background: var(--fibre) 0 0 / 220px, linear-gradient(160deg, var(--card-lit), var(--color-card) 55%, var(--card-shade)); box-shadow: var(--shadow-card), inset 1px 1px 0 var(--lit); text-shadow: 0 1px 0 var(--lit); } +.stock::before { content: ""; position: absolute; inset: 0.875rem; border: var(--rule-hair) solid var(--color-card-edge); } +.air::after { content: ""; position: absolute; inset: 0; background-image: var(--grain); background-size: 180px; opacity: 0.16; mix-blend-mode: multiply; } +``` diff --git a/skills/hallmark/references/themes/bloom.jpg b/skills/hallmark/references/themes/bloom.jpg new file mode 100644 index 0000000..db76ae7 Binary files /dev/null and b/skills/hallmark/references/themes/bloom.jpg differ diff --git a/skills/hallmark/references/themes/bloom.md b/skills/hallmark/references/themes/bloom.md new file mode 100644 index 0000000..2484a94 --- /dev/null +++ b/skills/hallmark/references/themes/bloom.md @@ -0,0 +1,102 @@ +--- +name: Bloom +slug: bloom +genre: atmospheric +paper: light 97 72 +display: grotesk-sans Ranade +accent: warm 36 +posture: committed +keywords: generative, ai creative, music, song, video, image, voice, art, make, create, compose, render, imagine, prompt, creative studio, playground, expressive, warm, daylight, consumer creative, portrait, headshot, selfie, retouch +material: warm off-white paper with grain and a generated working grid, two quiet terracotta blooms, warm umber ink, Ranade with one roman Gambarino figure, rubber and cased parts lit from above, part tones on rounded clips +photo: warm exp=4 +pictured: Workbench, Stage hero +--- + +# Bloom + +Daylight on a working sheet: warm off-white paper with a faint grain, the medium's own grid (a piano roll, a timeline, a ruler) printed into the ground and fading out from the stage, umber ink, Ranade with one roman Gambarino moment. The making happens on the grid in rounded clips; the parts you touch are physical: a rubber cap in a bezel, cases slid from a stack. It is not a dark generative canvas with neon glows, not a cream editorial page, not a terracotta poster. + +## Tokens + +```css +:root { + --color-paper: oklch(97% 0.010 72); --color-paper-2: oklch(94.6% 0.013 70); --color-paper-3: oklch(91.5% 0.016 66); + --color-ink: oklch(21% 0.024 40); --color-ink-2: oklch(31% 0.022 46); --color-muted: oklch(49% 0.02 56); + --color-rule: oklch(88% 0.014 64); --color-sheet: oklch(98.7% 0.007 78); + --color-accent: oklch(53% 0.145 36); --color-accent-2: oklch(66% 0.10 55); --color-accent-soft: oklch(53% 0.145 36 / 0.11); + --color-accent-ink: oklch(98.5% 0.008 72); --color-focus: oklch(53% 0.145 36); + --lane-1: oklch(50% 0.04 55); --lane-2: oklch(48% 0.105 28); --lane-3: oklch(70% 0.115 72); --lane-4: oklch(65% 0.085 12); + --grid-16: oklch(21% 0.024 40 / 0.035); --grid-beat: oklch(21% 0.024 40 / 0.075); --grid-bar: oklch(21% 0.024 40 / 0.15); --grid-row: oklch(21% 0.024 40 / 0.045); + --rubber: oklch(55% 0.15 34); --rubber-hi: oklch(66% 0.125 42); --rubber-lo: oklch(43% 0.125 31); + --umber: oklch(30% 0.03 45); --bezel: oklch(92.5% 0.014 68); --case: oklch(93.5% 0.012 70); + --hi: oklch(99.6% 0.006 80 / 0.75); --shade-1: oklch(21% 0.024 40 / 0.08); --shade-2: oklch(21% 0.024 40 / 0.16); --shade-3: oklch(30% 0.06 40 / 0.28); + --font-display: "Ranade", ui-sans-serif, system-ui, sans-serif; --font-body: var(--font-display); + --font-outlier: "Gambarino", Georgia, serif; --font-code: "Geist Mono", ui-monospace, monospace; + --radius-card: 18px; --radius-inner: 10px; --radius-clip: 6px; --radius-pill: 999px; --rule-hair: 1px; + --shadow-card: 0 1px 2px oklch(21% 0.024 40 / 0.06), 0 18px 36px -18px oklch(21% 0.024 40 / 0.26); + --shadow-lift: 0 2px 4px oklch(21% 0.024 40 / 0.07), 0 36px 72px -32px oklch(45% 0.1 40 / 0.34); + --tracking-display: -0.024em; --display-weight: 600; +} +``` + +## Type + +- **Display:** Ranade 600 for every head, `--tracking-display`, line-height 1.04 to 1.08, sentence case, one colour: the ink. +- **Body:** Ranade 400 at 17 to 18px, line-height 1.55; 500 for labels and controls. Three weights in all. +- **The serif moment:** Gambarino 400, roman, once a page: one figure at 160px or more, or one lede. Never a head, never italic. +- **Labels:** Ranade 500 a step smaller, sentence case, `--color-muted`. Geist Mono only for a ruler's fine numerals and timecodes inside the built product. + +## Surfaces + +- The ground is the medium's grid in CSS: stacked linear gradients for bars, beats, sixteenths and rows (black-key rows tinted every octave for a piano roll), on `--color-sheet` behind the stage, then continued faintly past it and masked to fade out radially. The grid returns in small crops beside steps and at the close. +- On the grid, the work: four part lanes in `--lane-*` tones as rounded clips (`--radius-clip`, a tinted gradient, an inset hairline in the lane tone, a lit top edge) carrying bar waveforms or notes; a hairline playhead; a key strip and a fine-numeral ruler. +- Texture is generated: a 180px feTurbulence grain at 5% over the paper, and at 30% soft-light on rubber. +- Light from above on every part. Two warm blooms stay, quieter: `--color-accent` near 8% top right, `--color-accent-2` near 5% bottom left, fixed. +- Raised warm surfaces, never hairline boxes: `--shadow-card`, `--shadow-lift` for the one that matters. Two bands at most, never terracotta. +- Photographs: daylight at home, hands, an instrument by a window; never a studio at night. + +## Range + +- **The input becoming the output on one grid:** what the user gives (a hum, a sketch, a line) drawn as a trace that settles onto the grid, the result growing in lanes beneath, and Play really plays it. +- **Choices as cased spines:** options as a stack of cases (a colour band striped with light, a card label, pips for its parts); the chosen one slides out and the grid re-arranges. +- **One figure in the serif** beside three steps, each with a small crop of the grid. +- **The result as one clip** on the grid at the close, downloadable. + +## Controls + +- The primary is a rubber cap in a recessed bezel: a domed `--rubber` radial gradient lit from the top, grain, set in a `--bezel` well with an inset shade; it sits at the left of a `--color-sheet` pill with its label, and its ring breathes while the product listens. Press sinks it 1px. +- Secondary: a sheet pill with a shade ring and a lit top edge, or an `--umber` pill. +- Links in terracotta, underlined on hover; inputs 52px pills with a 1px `--color-muted` edge. + +## Motion + +Once, in view: the input draws in (about 3 s), notes settle, the playhead glides home, lanes grow. Transforms and opacity, paused off screen. Reduced motion or no script: the finished arrangement, playhead at the start. The blooms never move. + +## Voice + +Warm, daylight, specific: the verb (hum, make, listen), the output (song, part, scene), and where. + +## Do-nots + +- Never a dark canvas, a neon glow or a third bloom. +- Never a terracotta field or card; terracotta is rubber, a link, a lane. +- Never a grid at full strength across a whole section; it fades from the stage. +- Never an italic serif, and never the serif in a head or in two places. + +## Build hint + +```html + + + +``` + +```css +h1, h2, h3 { font-weight: var(--display-weight); color: var(--color-ink); } +.roll { --beat: 40px; --row: 14px; background-color: var(--color-sheet); background-image: linear-gradient(to right, var(--grid-bar) 1px, transparent 1px), linear-gradient(to right, var(--grid-beat) 1px, transparent 1px), linear-gradient(to right, var(--grid-16) 1px, transparent 1px), linear-gradient(to bottom, var(--grid-row) 1px, transparent 1px); background-size: calc(var(--beat) * 4) 100%, var(--beat) 100%, calc(var(--beat) / 4) 100%, 100% var(--row); } +.clip { --c: var(--lane-1); border-radius: var(--radius-clip); background: linear-gradient(color-mix(in oklab, var(--c) 18%, var(--color-sheet)), color-mix(in oklab, var(--c) 28%, var(--color-sheet))); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--c) 42%, transparent), inset 0 1px 0 var(--hi); } +.rec { border-radius: 50%; background: radial-gradient(circle at 50% 30%, var(--bezel), var(--color-paper-3)); box-shadow: inset 0 2px 3px var(--shade-2), 0 1px 0 var(--hi); } +.rec__cap { border-radius: 50%; background: radial-gradient(120% 110% at 50% 18%, var(--rubber-hi), var(--rubber) 48%, var(--rubber-lo)); box-shadow: inset 0 1px 0.5px var(--hi), 0 5px 9px -3px var(--shade-3); } +.pill { border-radius: var(--radius-pill); background: var(--color-sheet); box-shadow: 0 0 0 1px var(--shade-1), 0 8px 18px -10px var(--shade-2), inset 0 1px 0 var(--hi); font-weight: 500; } +a { color: var(--color-accent); text-underline-offset: 0.2em; } +``` diff --git a/skills/hallmark/references/themes/blueprint.jpg b/skills/hallmark/references/themes/blueprint.jpg new file mode 100644 index 0000000..a3a0662 Binary files /dev/null and b/skills/hallmark/references/themes/blueprint.jpg differ diff --git a/skills/hallmark/references/themes/blueprint.md b/skills/hallmark/references/themes/blueprint.md new file mode 100644 index 0000000..6822eb5 --- /dev/null +++ b/skills/hallmark/references/themes/blueprint.md @@ -0,0 +1,103 @@ +--- +name: Blueprint +slug: blueprint +genre: modern-minimal +paper: mid 35 256 +display: geometric-sans Chakra Petch +accent: neutral 240 +posture: drenched +keywords: architecture, architect, engineering, construction, structural, interiors, planning, surveying, cad, drafting, fabrication, prefab, developer, technical, spec, permit, renovation, build, drawings, architecture studio, timber +material: prussian-blue sheet, white line ink, Chakra Petch capitals over IBM Plex Sans with mono measurements, square double keylines and dimension strings, photographs printed as cyanotypes, the white line as the only signal +photo: duotone paper-3 ink con=30 exp=-10 +pictured: Bento Grid, Poster hero +--- + +# Blueprint + +A drafting sheet as a material: Prussian-blue paper, a white line for ink, Chakra Petch drafted capitals over IBM Plex Sans, mono measurements with their units, keylines instead of cards, and photographs printed as cyanotypes, the sheet's blue in the shadows and its white in the light. It reads technical because everything is a line, a dimension or a print on one ground and the line is the only signal. It is not a dark product page with a blue gradient, not a neon wireframe. + +## Tokens + +```css +:root { + --color-paper: oklch(35% 0.105 256); --color-paper-2: oklch(31% 0.10 257); --color-paper-3: oklch(26.5% 0.095 258); + --color-ink: oklch(97% 0.012 240); --color-ink-2: oklch(90% 0.025 242); --color-muted: oklch(80% 0.045 244); + --color-rule: oklch(93% 0.02 240 / 0.85); --color-rule-2: oklch(93% 0.02 240 / 0.32); + --color-grid: oklch(97% 0.01 240 / 0.09); --color-grid-2: oklch(97% 0.01 240 / 0.2); + --color-accent: oklch(97% 0.012 240); --color-accent-ink: oklch(33% 0.105 256); --color-focus: oklch(97% 0.012 240); + --font-display: "Chakra Petch", ui-sans-serif, sans-serif; --font-body: "IBM Plex Sans", ui-sans-serif, sans-serif; + --font-outlier: "IBM Plex Mono", ui-monospace, monospace; + --radius-card: 0; --radius-pill: 0; --rule-hair: 1px; --rule-heavy: 2px; --shadow-card: none; + --tracking-display: -0.012em; --display-weight: 600; --sheet-inset: 20px; --tick: 14px; +} +``` + +Three sheets, stated in the stamp (`blueprint: cyanotype`). + +| Sheet | Ground, line, muted | +| --- | --- | +| **cyanotype** (default) | the tokens above | +| **whiteprint** | ground `oklch(97.5% 0.006 240)`, ink `oklch(35% 0.105 256)`, muted `oklch(52% 0.07 255)` | +| **brownline** | ground `oklch(86% 0.045 80)`, ink `oklch(28% 0.05 50)`, muted `oklch(45% 0.05 55)`, a red pencil `oklch(45% 0.19 28)` for annotation only | + +## Type + +- **Display:** Chakra Petch 600 for every head, `--tracking-display`, roman, one weight a head: the h1 and h2 uppercase at line-height 1.02 (55a), the h3 in sentence case. +- **Body:** IBM Plex Sans 400 for prose and 500 for labels and controls; reversed on the sheet, nothing lighter than 400. +- **Labels, captions, table heads, meta:** IBM Plex Sans 500 a step smaller, sentence case. IBM Plex Mono 500 sets a measurement with its unit, a stage or drawing number, a year on a dimension string and code, nothing else. + +## Surfaces + +- Lines only: 1px `--color-rule` keylines on every surface, and a second keyline in `--color-rule-2` 5px inside on a figure or a photograph. Radius 0, no shadows; depth is a second line, a `--rule-heavy` line or a one-step darker ground. +- The dimension string: a hairline with a 45° tick (`--tick` long) at each end and short extension lines, its value set above it. It measures something real, never a decoration. +- The grid: 24px minor lines in `--color-grid`, 120px major in `--color-grid-2`, offset by `--sheet-inset`, only under a drawing, a schedule or a chart of real data. +- Bands: `--color-paper-2` or `--color-paper-3`, two a page at most; the sheet is already the colour (drenched), so there is no other field. +- Photographs: structures built and building, shot square-on so they read like drawings (a frame going up, a roof from below, a model on a table), printed as cyanotypes inside the double keyline; pick frames with a real white and a real shadow, since grey prints flat. Type over one sits on a `--color-paper-3` scrim from its edge. + +## Range + +- **Figures as dimensions:** the prompt's one number in Chakra Petch at display size, set on a dimension string that spans ten or twelve columns between its two real ends (a first year and now, a smallest and largest span), the ends in mono. +- **Tables as drawing registers:** a stage schedule, a deliverables list or a price list as a keylined table, stage numbers in mono in their own column, the row title one weight heavier, a `--rule-heavy` line under the head row; on `--color-paper-2` it reads as the register sheet of a set. +- **Forms as a title block:** fields set as cells of a keylined block, each label at the cell's top left, the cells sized by what they hold, the submit in the ink fill at the block's foot. +- **Comparisons and steps as elevations:** two options side by side as columns parted by one heavy line, or stages as a run along one long dimension string with a tick at each stage, each stage a numeral, a title and a line. + +## Controls + +- An ink-filled primary with sheet-coloured text beside a 1px-outlined secondary in ink, both square, 48px, IBM Plex Sans 500. +- Links in ink with a 1px underline that clears on hover; inputs square, 48px, a 1px `--color-rule` keyline on `--color-paper-2`, the white focus ring, never a glow. +- The line is the accent: white on blue, in rules, the primary fill and the focus ring. + +## Motion + +Static, drafted. A rule or a dimension string may draw itself once a page (scaleX from its left tick over `--dur-long` on `--ease-out`); hover on a keylined surface that links darkens its ground one step. + +## Voice + +Specification voice: the building type, the stage, the year, the format, a unit on every figure; nothing a drawing note could not carry. + +## Do-nots + +- Never a filled card, a blur or a lifted panel; the sheet has lines, not layers. +- Never a second colour on the cyanotype, in type or in a photograph; the red pencil belongs to the brownline sheet. +- Never a building, frame or section drawn to stand in for a project, and never a dimension string with an invented value; a drawing is real project data or it is absent. +- Never the grid as wallpaper behind prose, and never a lowercase h1 or h2. +- Never a rounded corner, anywhere. + +## Build hint + +```html + +``` + +```css +h1, h2, h3 { font-weight: 600; } +h1, h2 { text-transform: uppercase; line-height: 1.02; } +.num { font-family: var(--font-outlier); font-weight: 500; } +.fig { position: relative; border: var(--rule-hair) solid var(--color-rule); } +.fig::after { content: ""; position: absolute; inset: 5px; z-index: 2; border: var(--rule-hair) solid var(--color-rule-2); pointer-events: none; } +.dim { position: relative; height: var(--rule-hair); background: var(--color-rule); } +.dim::before, .dim::after { content: ""; position: absolute; top: calc(var(--tick) / -2); width: var(--rule-hair); height: var(--tick); background: var(--color-rule); transform: rotate(45deg); } +.dim::before { left: 0; } .dim::after { right: 0; } +.btn { border: var(--rule-hair) solid var(--color-rule); border-radius: 0; background: transparent; color: var(--color-ink); padding: var(--space-sm) var(--space-lg); font-weight: 500; } +.btn--primary { background: var(--color-ink); border-color: var(--color-ink); color: var(--color-accent-ink); } +``` diff --git a/skills/hallmark/references/themes/broadside.jpg b/skills/hallmark/references/themes/broadside.jpg new file mode 100644 index 0000000..2a5ca23 Binary files /dev/null and b/skills/hallmark/references/themes/broadside.jpg differ diff --git a/skills/hallmark/references/themes/broadside.md b/skills/hallmark/references/themes/broadside.md new file mode 100644 index 0000000..24c416d --- /dev/null +++ b/skills/hallmark/references/themes/broadside.md @@ -0,0 +1,108 @@ +--- +name: Broadside +slug: broadside +genre: editorial +paper: light 92 88 +display: display-condensed Six Caps +accent: warm 33 +posture: committed +keywords: auction, sale, market, fair, event, one night, announcement, town, notice, poster, bill, lots, machinery, tools, festival, fete, hammer, date, venue, tickets +material: grained buff stock, near-black ink, Six Caps and Bevan wood capitals over Archivo Narrow, ink rules at one point or five, one vermilion +photo: duotone ink paper con=20 +pictured: Marquee Hero, Settled hero +--- + +# Broadside + +A printer's bill: grained buff stock, near-black ink, Six Caps fitted to the measure over Bevan, Archivo Narrow small print, rules at one point or five, one vermilion. It is loud because the capitals are tall and the rules heavy, never because anything is drawn; photographs print plainly in the ink, like the plate on a sale bill. Not a western pastiche, nor a soft cream editorial page. + +## Tokens + +```css +:root { + --color-paper: oklch(92% 0.028 88); --color-paper-2: oklch(88.5% 0.032 88); --color-paper-3: oklch(85% 0.036 86); + --color-ink: oklch(18% 0.01 50); --color-ink-2: oklch(30% 0.012 50); --color-muted: oklch(43% 0.02 62); + --color-rule: oklch(75% 0.028 82); + --color-accent: oklch(53% 0.19 33); --color-accent-ink: oklch(95.5% 0.018 88); --color-focus: oklch(53% 0.19 33); + --font-display: "Six Caps", "Impact", sans-serif; --font-display-2: "Bevan", Georgia, serif; + --font-body: "Archivo Narrow", "Arial Narrow", ui-sans-serif, sans-serif; + --font-outlier: var(--font-body); + --radius-card: 0; --radius-pill: 0; --rule-hair: 1px; --rule-bar: 5px; --rule-frame: 3px; + --shadow-card: none; + --tracking-display: 0.02em; --display-weight: 400; + --grain: 0.08; +} +``` + +One dial, the colourway, stated in the stamp (`broadside: bill`). + +| Colourway | Stock | Ink | Accent | +| --- | --- | --- | --- | +| `bill` (default) | the block above | ink | vermilion | +| `inked` | oklch(17% 0.01 60), grain screened | buff oklch(92% 0.028 88) | vermilion at oklch(63% 0.19 33); paper band dark | +| `red-bill` | the vermilion | buff oklch(95.5% 0.018 88), 5.5:1 | buff; posture drenched | + +## Type + +- **Six Caps** 400, uppercase, line-height 0.88, `--tracking-display`, for the h1, big figures and fitted lines. It is fitted, not stepped: each line its own element that never wraps (`white-space: nowrap`, the 55b guard), its size set from its measured width in `cqi` so it fills its column exactly; lines stacked in one block differ in size, as type set by hand does. +- **Bevan** 400 for section heads, item titles, the wordmark and short lines of fact; uppercase, untracked, line-height 1. +- **Archivo Narrow** 400 and 600, line-height 1.5, for everything read; labels, table heads, captions and meta in its 500 a step smaller, sentence case, untracked, `--color-muted`. Figures are Six Caps, or Archivo Narrow tabular in a row. +- Three families, no outlier: one case of wood type, the gothic for scale and the slab for weight. + +## Surfaces + +- Rules: `--rule-bar` in ink above a section, a table or between two columns of a bill, `--rule-hair` in ink under a running head, `--rule-hair` in `--color-rule` between rows. Nothing between one and five. +- Square corners everywhere, no shadow. A frame is a double rule, a `--rule-frame` ink border with a 1px ink keyline 3px inside it, round a well or a photograph. +- Bands: `--color-paper-2`, ink with buff type, or one vermilion band with buff type; two a page at most. +- Photographs: plain daylight documentary at eye level, the thing for sale whole and side-on, a detail at arm's length; nobody facing the lens. Printed in the ink on the stock (the `photo:` duotone), square, in the double-rule frame; type never sits on one, and a caption under it carries a fact. +- Grain, the only texture: the speck layer (`texture.md` § 1) at `--grain`, multiplied on buff and screened on ink, on bands, wells and photograph frames, never under running text. + +## Range + +- A timetable as a bill: each day a column under a five-point rule, its name fitted in Six Caps to the column, the hour in Bevan, the small print under a 1pt rule; columns parted by a five-point vertical rule. +- A count or a date fitted to the full measure in Six Caps, the one vermilion line of its screen, its small print beneath. +- Particulars as rows: a Bevan label on the left, the fact in Archivo Narrow 600 on the right, hair rules between, a five-point rule over the first; a fact not yet known prints as a muted fill, never invented. +- A form on the vermilion band: buff fields with an ink keyline, the ink block as its action, the head in Bevan. + +## Controls + +- An ink-filled block in Archivo Narrow 600, untracked capitals (legal under an uppercase display), beside the same block as an unfilled double-rule frame; square, 48px, one fill a page. +- Links in ink, underlined, vermilion on hover; inputs square, 48px, a 1px ink border. +- Vermilion sets one whole display line (its own element, never part of a head) or one figure a screen, on buff or `--color-paper-2`. + +## Motion + +Printed, so still: a live figure updates in place, a fitted line fits once when the fonts load. No marquee, no hover growth, no reveal. + +## Voice + +A sale bill read aloud: the date, the place, the lot and the hour, each said once. Shouted in capitals, explained in the small print, in the words of the trade it sells to. + +## Do-nots + +- Never a ragged big line; a Six Caps line that does not fill its measure is fitted or cut. +- Never a fourth face outside code: the case is Six Caps, Bevan and the narrow. +- Never a rounded corner; frames, controls and photographs are square. +- Never a second colour, in type or in a picture; photographs print in the ink. +- Never a drawn gavel, star or ornament; the capitals and the photograph are the loud things. +- Never a photograph on every fold; half the bill is type, and the type is the loud half. + +## Build hint + +```html + +``` + +```css +h1, .display { font-family: var(--font-display); font-weight: 400; text-transform: uppercase; line-height: 0.88; letter-spacing: var(--tracking-display); } +.fit { display: block; white-space: nowrap; } +h2, h3, .wordmark { font-family: var(--font-display-2); font-weight: 400; text-transform: uppercase; line-height: 1; letter-spacing: 0; } +.rule-bar { border-top: var(--rule-bar) solid var(--color-ink); } +.frame, .btn--frame { border: var(--rule-frame) solid var(--color-ink); box-shadow: inset 0 0 0 3px var(--color-paper), inset 0 0 0 4px var(--color-ink); } +.frame { padding: var(--space-lg); } .frame--photo { padding: var(--space-2xs); } +.btn { display: inline-flex; align-items: center; min-height: 48px; padding: 0 var(--space-xl); border: 3px solid var(--color-ink); background: var(--color-ink); color: var(--color-paper); font: 600 var(--text-sm)/1 var(--font-body); text-transform: uppercase; } +.btn--frame { background: transparent; color: var(--color-ink); } +.grained { position: relative; isolation: isolate; } +.grained::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: var(--grain); mix-blend-mode: multiply; } /* the speck SVG, texture.md § 1 */ +::selection { background: color-mix(in oklab, var(--color-accent) 30%, transparent); } +``` diff --git a/skills/hallmark/references/themes/brutal.jpg b/skills/hallmark/references/themes/brutal.jpg new file mode 100644 index 0000000..72e8e96 Binary files /dev/null and b/skills/hallmark/references/themes/brutal.jpg differ diff --git a/skills/hallmark/references/themes/brutal.md b/skills/hallmark/references/themes/brutal.md new file mode 100644 index 0000000..7ec6e2c --- /dev/null +++ b/skills/hallmark/references/themes/brutal.md @@ -0,0 +1,95 @@ +--- +name: Brutal +slug: brutal +genre: editorial +paper: light 97.5 95 +display: grotesk-heavy Libre Franklin +accent: chromatic-yellow 105 +posture: committed +keywords: brutalist, raw, bold, high-contrast, statement, agency, design studio, portfolio, streetwear, drop, zine, type-forward, graphic design, poster, festival, collective, no-nonsense, uncompromising +material: near-white poster stock, near-black ink as 3px rules, boxed cells and solid fills, uppercase Libre Franklin 900 over its 400, zero radius, one acid-yellow fill +photo: duotone ink paper con=24 +pictured: Marquee Hero, Poster hero +--- + +# Brutal + +A raw, engineered sheet: near-white poster stock, near-black ink that arrives as 3px rules, boxed cells and solid fills, Libre Franklin at its blackest in tight capitals, zero radius, and one acid yellow that only ever fills. The grid is drawn, not implied: cells share their rules, and a number or a word set big inside a box is the page's ornament. Photographs print hard in the ink. It is not a dark hacker page, not a decorated zine and not a sticker sheet of offset shadows. + +## Tokens + +```css +:root { + --color-paper: oklch(97.5% 0.006 95); --color-paper-2: oklch(94% 0.007 95); --color-paper-3: oklch(89.5% 0.008 95); + --color-ink: oklch(10% 0.006 95); --color-ink-2: oklch(16% 0.006 95); --color-muted: oklch(40% 0.008 95); + --color-rule: oklch(10% 0.006 95); + --color-accent: oklch(90% 0.19 105); --color-accent-ink: oklch(10% 0.006 95); --color-focus: oklch(48% 0.1 110); + --font-display: "Libre Franklin", ui-sans-serif, system-ui, sans-serif; --font-body: var(--font-display); + --font-outlier: var(--font-display); + --radius-card: 0; --radius-pill: 0; --rule-hair: 1px; --rule-bar: 3px; --shadow-card: none; + --tracking-display: -0.03em; --display-weight: 900; +} +``` + +## Type + +- **Display:** Libre Franklin 900, uppercase, `--tracking-display`, line-height 1.0 (the floor for capitals that wrap), one weight per head. A statement or the hero head may run to the display cap and past it; set it to fill the measure, not to sit politely inside it. Uppercase belongs to heads, the wordmark and a word or number set as a cell's whole content. +- **Body:** Libre Franklin 400 at 17 to 18px, line-height 1.5, sentence case, in ink; item titles and controls at 700, sentence case. Three weights in all: 400, 700, 900. +- **Numbers:** index numbers, counts and dates in 900 with `tabular-nums`, at `--text-section` or larger when they carry a row. +- **Labels, captions, table heads:** Libre Franklin 400 a step smaller, sentence case, in `--color-muted`; mono appears only inside code. + +## Surfaces + +- Two rule weights and no others: `--rule-bar` in `--color-rule` boxes a well, a table, a cell or a photograph; `--rule-hair` splits rows inside them. Neighbouring cells share one 3px rule, never two. +- Zero radius on everything. Depth is fill and border, never shadow: bordered paper, an ink fill with paper text, or the one yellow fill under ink; nothing floats above the paper. +- Bands: an `--color-ink` band with paper text, or a `--color-paper-2` band ruled top and bottom with `--rule-bar`; two a page at most. The yellow never runs as a band. +- Photographs: raw documentary of the thing in use, lit by whatever was there (stage light, flash, a street at night): the crowd from inside it, a room before doors, a stage screen; never a posed face. They print hard in the ink (the `photo:` duotone), cropped tight and flush inside a `--rule-bar` frame, or full-bleed where the page is loudest. Type meets a photograph only on a solid ink or paper block set flush against the frame; never a scrim. +- No texture, no ornament, no gradient. + +## Range + +- **An index as a boxed table:** rows inside one 3px box, hairlines between, the number in 900 at section size in its own cell, the entry in 700 at title size, one line in 400; the hovered or current row fills yellow under its ink. +- **A statement:** one blunt sentence in 900 capitals across all twelve columns at display size or larger, sitting on a 3px rule, nothing else on the screen but its attribution. +- **Cells as a bento:** facts set as words or numbers in 900 capitals inside boxed cells that share their rules, one lead cell twice the size, an ink cell for contrast, a photograph flush in one cell. +- **The form as the grid:** fields as boxed cells sharing their rules, a choice set as two big word cells that fill yellow when chosen, the send button an ink cell. + +## Controls + +- The pair: a `--rule-bar` bordered paper button beside a solid ink button with paper text, Libre Franklin 700 in sentence case, 48 to 52px; hover inverts either in one frame. +- Links are ink, underlined; hover fills yellow under the ink. Inputs: zero radius, a `--rule-bar` border, ink on paper, 52px. +- The yellow is a fill, never type, a rule or a ring: a chosen option, a `mark` in running text, a hovered row or link. Always under ink, never over a photograph, under 5% of a screen. Focus takes the deep olive `--color-focus`. + +## Motion + +Nothing glides. State flips in one frame: a surface inverts to ink with paper text, or fills yellow under its ink. No reveal, no bounce, no parallax. + +## Voice + +Blunt, declarative: capitals in the heads, sentence case everywhere else; the trade's own words, no hedging, no hype. Say the thing flat. + +## Do-nots + +- Never a rounded corner or a shadow, blurred or hard-offset; depth is border and fill. +- Never an ornament, a fleuron or a layered offset stack; Brutal is raw, not decorated. +- Never black paper; this is a light sheet with black structure. +- Never a second colour: photographs print in the ink, and the yellow only fills. +- Never two rules where cells meet; a doubled 6px seam reads as a mistake, not as structure. + +## Build hint + +```html + +``` + +```css +h1, h2, .display { font-family: var(--font-display); font-weight: var(--display-weight); text-transform: uppercase; letter-spacing: var(--tracking-display); line-height: 1; } +h3 { font-family: var(--font-display); font-weight: 700; } +.btn { border: var(--rule-bar) solid var(--color-rule); border-radius: 0; padding: var(--space-xs) var(--space-lg); background: var(--color-paper); color: var(--color-ink); font-weight: 700; transition: none; } +.btn:hover, .btn--ink { background: var(--color-ink); color: var(--color-paper); } .btn--ink:hover { background: var(--color-paper); color: var(--color-ink); } +.cells { display: grid; gap: 0; border: var(--rule-bar) solid var(--color-rule); } +.cells > * { margin: calc(var(--rule-bar) * -1) 0 0 calc(var(--rule-bar) * -1); border: var(--rule-bar) solid var(--color-rule); } +.well--ink, .band--ink { background: var(--color-ink); color: var(--color-paper); } +.is-chosen, p mark, a:hover { background: var(--color-accent); color: var(--color-accent-ink); } +.photo { display: block; border: var(--rule-bar) solid var(--color-rule); border-radius: 0; } +::selection { background: var(--color-accent); color: var(--color-accent-ink); } +``` diff --git a/skills/hallmark/references/themes/carnival.jpg b/skills/hallmark/references/themes/carnival.jpg new file mode 100644 index 0000000..cbe7aec Binary files /dev/null and b/skills/hallmark/references/themes/carnival.jpg differ diff --git a/skills/hallmark/references/themes/carnival.md b/skills/hallmark/references/themes/carnival.md new file mode 100644 index 0000000..538beda --- /dev/null +++ b/skills/hallmark/references/themes/carnival.md @@ -0,0 +1,104 @@ +--- +name: Carnival +slug: carnival +genre: editorial +paper: light 92 50 +display: display-heavy Big Shoulders Display +accent: chromatic-yellow 95 +posture: full-palette +keywords: record label, podcast, comedy, indie, zine, poster, illustrator, games, hot sauce, merch, streetwear, cassette, vinyl, live show, festival, loud, maximalist, scrappy +material: tinted paper, deep warm ink, Big Shoulders Display 800 capitals set poster-large over Golos Text, 2px rules, a hard 4px ink shadow, two accents that compete as whole fields +photo: natural vib=20 con=10 +pictured: Label and Ledger, Stage hero +--- + +# Carnival + +A loud, screen-printed register: tinted paper, deep warm ink, Big Shoulders Display capitals over Golos Text, a hard ink shadow and two accents that compete. Every surface is a flat fill with a hard edge, like a print pinned to a wall, and photographs come close and hot, framed the same way. The loudest thing on a page is a fact in the capitals at poster size, not a picture. It is not a pastel playground, a soft-shadow app or a retro costume. + +## Tokens + +```css +:root { + --color-paper: oklch(92% 0.045 50); --color-paper-2: oklch(88% 0.050 45); --color-paper-3: oklch(82% 0.060 40); + --color-ink: oklch(18% 0.080 20); --color-ink-2: oklch(28% 0.060 25); --color-muted: oklch(42% 0.050 30); + --color-rule: oklch(40% 0.21 25); --color-accent: oklch(86% 0.18 95); --color-accent-2: oklch(40% 0.21 25); + --color-accent-ink: oklch(18% 0.080 20); --color-focus: oklch(40% 0.21 25); + --font-display: "Big Shoulders Display", Impact, sans-serif; --font-body: "Golos Text", system-ui, sans-serif; + --font-outlier: var(--font-body); + --radius-card: 2px; --radius-pill: 2px; --rule-hair: 1px; --rule-bar: 2px; --shadow-card: 4px 4px 0 var(--color-ink); + --tracking-display: 0.015em; --display-weight: 800; +} +``` + +One dial, the drop, stated in the stamp (`carnival: diner-sign`); its second accent is also the rule and focus colour. `paper-2` and `paper-3` step 4 and 10 points darker on the paper's hue, `ink-2` and `muted` lighten the ink alike, and the ink sits on every first accent. + +| Drop | Pick for | Paper | Ink | Accent | Accent 2 | +| --- | --- | --- | --- | --- | --- | +| cold-snap (default) | music, winter, cassettes, vinyl | 92% 0.045 50 | 18% 0.080 20 | mustard 86% 0.18 95 | oxblood 40% 0.21 25 | +| citrus-riot | zines, skate, summer drops | 94% 0.040 85 | 20% 0.07 145 | lime 82% 0.20 130 | magenta 28% 0.28 350 | +| diner-sign | food and drink, hospitality, roadside | 95% 0.035 90 | 16% 0.04 30 | cherry 60% 0.22 25 | navy 30% 0.16 250 | +| studio-night | radio, podcasts, blue hour | 88% 0.05 25 | 20% 0.05 270 | cyan 78% 0.18 220 | plum 24% 0.18 320 | +| aqua-park | summer, pool, surf, motels | 94% 0.040 180 | 20% 0.06 200 | turquoise 72% 0.16 195 | coral 36% 0.24 35 | +| pressroom | journalism, newsletters, opinion | 89% 0.025 65 | 16% 0.02 60 | amber 78% 0.18 75 | slate 34% 0.10 240 | + +## Type + +- **Display:** Big Shoulders Display 800, capitals, `--tracking-display`, line-height 1.0 where a head can wrap; a lone word on one nowrap line may run at -0.005em and 0.9. The face is narrow, so it sets a step above the scale: the hero head up to about 160px at 1440, a section head at `--text-display-s`, an item title at `--text-2xl`. +- **Body:** Golos Text 400 and 500, sentence case, full ink. +- **Labels, captions, table heads:** Golos Text 500 a step smaller, sentence case. Never mono. +- **Figures:** a fact that sells (a price, a volume, a count) sets in the display face at the hero's size, tabular, its unit beside it in the same capitals; small figures are Golos Text with `tabular-nums`. + +## Surfaces + +- Two accents that compete: one fills a surface, the other the next, never a gradient between them. +- The hard offset shadow (`--shadow-card`, zero blur) on wells, controls and photographs, never clipped by an overflow; nothing else casts depth. +- Rules: `--rule-bar` in `--color-accent-2` between sections and rows, in ink around a shadowed surface; radius 2px at most. +- Bands: a field of either accent (the second under paper text) or `--color-paper-2`; two a page at most. +- Photographs: the thing itself, close, in hard light or flash, colour pushed, one subject filling the frame: the bottle in a hand, the fruit cut open, a sleeve. A `--rule-bar` ink border on the hard shadow, like a print pinned up, free to tilt a degree or two; type never sits on one, though a flat accent block with a fact may overlap a corner. +- Texture: the halftone screen (`texture.md` § 2) in ink on a well or a band, never under running text or over a photograph. + +## Range + +- **Figures** on a whole accent field: three or four facts in the display capitals at poster size, each over its line in Golos, parted by 2px ink bars, the halftone in one corner of the field and never under a figure. +- **Rows** ruled with `--rule-bar` in the second accent: a question or a name in capitals at item-title size on the left, the answer in Golos at lead size on the right; a picked row inverts to ink with paper type. +- **Statements** on the second accent under paper type, the line at poster size across ten columns, one action beside it. +- **Forms** as a well on the hard shadow: options as ruled rows that invert when chosen, a live total in the capitals. + +## Controls + +- The pair: a first-accent fill beside the same block outlined in ink on paper, both on the hard shadow and in the display face's capitals, untracked. +- Links are ink, underlined in `--color-accent-2`; inputs take a `--rule-bar` ink border on paper and no shadow. +- The first accent fills the primary control, a band or a well; the second carries rules, focus, links and the other fill. + +## Motion + +Mostly still. Hover swaps colour and nothing else; active presses the offset to 1px; nothing lifts. The one loop a page may run is a marquee of words at 8s a cycle or slower. + +## Voice + +Loud, short, funny by being exact: the count, the price, the date, one joke a screen. Heads in capitals, six words or fewer, ending in a full stop; body in sentence case and the present tense, numerals over words. + +## Do-nots + +- Never a soft shadow; hard offset or none. +- Never both accents inside one surface; blending kills the duo-tone read. +- Never sentence-case heads, and never loose tracking. +- Never a grey or ghost button; the secondary is the outlined ink block. +- Never a drawn mascot, flame, skull or doodle; the loud thing is photographed or set in type. + +## Build hint + +```html + +``` + +```css +h1, h2 { font-family: var(--font-display); font-weight: 800; text-transform: uppercase; letter-spacing: var(--tracking-display); line-height: 1; } +.btn { border: var(--rule-bar) solid var(--color-ink); border-radius: var(--radius-pill); box-shadow: var(--shadow-card); padding: var(--space-sm) var(--space-lg); background: var(--color-paper); color: var(--color-ink); font: 800 var(--text-lg)/1 var(--font-display); text-transform: uppercase; } +.btn--primary, .band--a { background: var(--color-accent); color: var(--color-accent-ink); } +.btn:active { box-shadow: 1px 1px 0 var(--color-ink); } +.well, .photo { border: var(--rule-bar) solid var(--color-ink); border-radius: var(--radius-card); box-shadow: var(--shadow-card); background: var(--color-paper-2); } +.band--b { background: var(--color-accent-2); color: var(--color-paper); } +.halftone { background-image: radial-gradient(var(--color-ink) 1.5px, transparent 1.5px); background-size: 12px 12px; } +``` diff --git a/skills/hallmark/references/themes/cobalt.jpg b/skills/hallmark/references/themes/cobalt.jpg new file mode 100644 index 0000000..b829f3d Binary files /dev/null and b/skills/hallmark/references/themes/cobalt.jpg differ diff --git a/skills/hallmark/references/themes/cobalt.md b/skills/hallmark/references/themes/cobalt.md new file mode 100644 index 0000000..bc2882d --- /dev/null +++ b/skills/hallmark/references/themes/cobalt.md @@ -0,0 +1,101 @@ +--- +name: Cobalt +slug: cobalt +genre: modern-minimal +paper: light 98.5 250 +display: grotesk-sans Familjen Grotesk +accent: cool 256 +posture: restrained +keywords: api, sdk, cli, dev tool, developer platform, docs, documentation, infrastructure, backend, database, observability, webhooks, events, type-safe, open source, ship, deploy, developer experience, technical +material: cool near-white paper, blue-grey ink and hairlines, Familjen Grotesk over IBM Plex Sans, a generated ASCII field on an 8 by 16 cell, keycaps and cut-corner panels, JetBrains Mono on graphite, one electric cobalt signal +photo: duotone graphite paper +pictured: Feature Ledger, Field hero +--- + +# Cobalt + +An exact, technical register: cool near-white paper ruled with hairlines, Familjen Grotesk heads over IBM Plex Sans, and a ground made of characters, a generated ASCII field snapped to an 8 by 16 cell that shows the product's own traffic in cobalt tints. Panels are cut on two opposite corners, buttons are keycaps with a real bottom edge, code runs on graphite. It is precise because every edge is a hairline or a cut and every glyph means something; it is not a dark developer page or a terminal costume. + +## Tokens + +```css +:root { + --color-paper: oklch(98.6% 0.005 250); --color-paper-2: oklch(96.2% 0.008 252); --color-paper-3: oklch(93% 0.011 252); + --color-ink: oklch(21% 0.028 262); --color-ink-2: oklch(36% 0.022 260); --color-muted: oklch(50% 0.018 258); + --color-rule: oklch(90% 0.009 252); --color-rule-2: oklch(83% 0.012 252); + --color-graphite: oklch(21% 0.024 262); --color-graphite-2: oklch(26.5% 0.026 262); --color-graphite-ink: oklch(93% 0.010 250); --color-graphite-muted: oklch(69% 0.022 256); + --color-accent: oklch(52% 0.19 258); --color-accent-2: oklch(76% 0.13 254); --color-accent-wash: oklch(95% 0.028 256); --color-accent-ink: oklch(98.6% 0.005 250); --color-focus: oklch(52% 0.19 258); + --color-accent-deep: oklch(43% 0.2 262); --color-accent-edge: oklch(39% 0.16 260); + --color-glyph-1: oklch(89% 0.025 254); --color-glyph-2: oklch(81% 0.045 255); --color-glyph-3: oklch(70% 0.085 256); --color-glyph-4: oklch(60% 0.13 257); + --color-graphite-glyph-1: oklch(33% 0.03 262); --color-graphite-glyph-2: oklch(41% 0.05 260); --color-graphite-glyph-3: oklch(53% 0.1 258); + --color-key-face: oklch(99.4% 0.003 250); --color-key-edge: oklch(80% 0.016 254); + --font-display: "Familjen Grotesk", system-ui, sans-serif; --font-body: "IBM Plex Sans", system-ui, sans-serif; + --font-outlier: "JetBrains Mono", ui-monospace, monospace; + --radius-card: 8px; --radius-input: 6px; --radius-pill: 999px; + --cell-w: 8px; --cell-h: 16px; --cut: 8px; --cut-l: 16px; + --rule-hair: 1px; --shadow-card: 0 1px 2px oklch(21% 0.028 262 / 0.06); + --shadow-key: 0 3px 0 0 var(--color-key-edge), 0 6px 8px -4px oklch(21% 0.028 262 / 0.28), inset 0 1px 0 oklch(100% 0 0 / 0.9); + --shadow-key-accent: 0 3px 0 0 var(--color-accent-edge), 0 6px 8px -4px oklch(30% 0.12 260 / 0.45), inset 0 1px 0 oklch(100% 0 0 / 0.22); + --shadow-key-press: inset 0 1px 2px oklch(21% 0.028 262 / 0.14); + --tracking-display: -0.028em; --display-weight: 600; +} +``` + +## Type + +- **Display:** Familjen Grotesk 600 on heads and figures, 500 on item titles, `--tracking-display`, line-height 1.02, sentence case, tabular figures; a count at 60px and over is the loudest type. +- **Body:** IBM Plex Sans 400 and 500. +- **Labels, table heads, status:** Familjen Grotesk 500 a step smaller, `--color-muted`. Never mono. +- **Code and glyphs:** JetBrains Mono for code, machine values and the field; never a label, head or chip. + +## Surfaces + +- A 1px `--color-rule` edges every surface and splits every row; neutrals tilt to hue 250 to 260. +- Panels, chips and fields are cut on two opposite corners: `border-radius: var(--cut-l) 4px` with `corner-shape: bevel round bevel round` inside `@supports`, `--cut` on small parts, plain 8px and 6px radius as the fallback. Depth is `--shadow-card` and a paper step; only keys have an edge. +- The ground is a generated ASCII field on one canvas, never a picture: noise sampled per 8 by 16 cell into a character ramp, tinted `--color-glyph-1` to `-4` with `--color-accent-deep` for the densest cells, shaped by the product's own flow (raw on one side, resolved on the other). It sits behind the hero; one divider row and one graphite panel (graphite glyph tints) may repeat it, four places at most; a dot grid on the cell stands in without script. +- Graphite is the dark material: `--color-graphite` under `--color-graphite-ink`, `--color-graphite-2` for a selected line or header strip, `--color-graphite-muted` for comments. Syntax takes `--color-accent-2`, never a rainbow. Two bands a page at most, one graphite. +- Photographs are rare: one at most, a real system seen from a distance, in the duotone, no type on it. + +## Range + +- **A table that is the API:** ruled full width, machine values in mono, one row on the cobalt wash. +- **A mapping:** two graphite panes, input and output, matched lines joined by hairline elbows. +- **A timeline as a ruler:** real seconds on one hairline, attempts as notched ticks with their status in Familjen 600 at display size, waits as dimension lines, failure in the error colour. +- **A working control on the prompt's numbers:** its result as one large figure over a meter of fifty mono cells. + +## Controls + +- Keycaps: a key-face button on a 3px bottom edge that lifts 1px on hover and sinks on press; the one primary is a solid cobalt key. Options are keys on a sunken paper-3 tray, the chosen one pressed. +- A command is a cut chip with a working copy key. Links take a cobalt underline on hover. Inputs are cut, `--color-muted` border, cobalt focus. +- Status is text with one icon, never a filled chip. Cobalt stays under 5% of a screen outside the field. + +## Motion + +The field runs at 30 fps with a pointer lens, pauses off screen, and is one composed still under reduced motion. Keys travel over `--dur-micro`; connectors draw in once. No bounce, no parallax. + +## Voice + +Declarative and specific, like a good changelog: the event, the endpoint, the status code. No hype adjectives. + +## Do-nots + +- Never a warm accent, a pill or a gradient button. +- Never noise for its own sake: the field maps traffic or state the product has, and no type sits on its densest cells. +- Never fake code: a snippet compiles or returns; with no host in the prompt, call `example.com`. + +## Build hint + +```html + +``` + +```css +h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: var(--tracking-display); color: var(--color-ink); } h3 { font-weight: 500; } +.key { border: var(--rule-hair) solid var(--color-rule-2); border-radius: var(--radius-input); padding: 0 var(--space-lg); min-height: 48px; background: var(--color-key-face); color: var(--color-ink); font: 500 var(--text-md)/1 var(--font-display); box-shadow: var(--shadow-key); transition: transform var(--dur-micro) var(--ease-out), box-shadow var(--dur-micro) var(--ease-out); } +.key:hover { transform: translateY(-1px); } .key:active { transform: translateY(3px); box-shadow: var(--shadow-key-press); } +.key--primary { background: var(--color-accent); border-color: var(--color-accent-edge); color: var(--color-accent-ink); box-shadow: var(--shadow-key-accent); } +.cut { border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-card); background: var(--color-paper); } +@supports (corner-shape: bevel) { .cut { border-radius: var(--cut-l) 4px var(--cut-l) 4px; corner-shape: bevel round bevel round; } } +.graphite { background: var(--color-graphite); color: var(--color-graphite-ink); } .graphite .token { color: var(--color-accent-2); } +a { text-decoration-color: var(--color-rule-2); text-underline-offset: 0.2em; } a:hover { text-decoration-color: var(--color-accent); } +``` diff --git a/skills/hallmark/references/themes/console.jpg b/skills/hallmark/references/themes/console.jpg new file mode 100644 index 0000000..d972ce6 Binary files /dev/null and b/skills/hallmark/references/themes/console.jpg differ diff --git a/skills/hallmark/references/themes/console.md b/skills/hallmark/references/themes/console.md new file mode 100644 index 0000000..4ee7fd8 --- /dev/null +++ b/skills/hallmark/references/themes/console.md @@ -0,0 +1,99 @@ +--- +name: Console +slug: console +genre: modern-minimal +paper: dark 17 250 +display: grotesk-sans Host Grotesk +accent: chromatic-amber 80 +posture: restrained +keywords: lab, laboratory, protocol, experiment, notebook, science, research, observability, monitoring, version control, audit, compliance, instruments, data, devtools, engineering, telemetry, record, operations, dark, developer +material: graphite ground in three lightness steps, pale ink, hairline panels cut from one surface, Host Grotesk 500 for reading, Atkinson Hyperlegible Mono for what was measured, amber for a person and cool blue for an instrument +photo: duotone paper-3 ink +pictured: Audit Trail, Stage hero +--- + +# Console + +An instrument kept by careful people: a graphite ground stepped in three lightnesses, hairline panels cut from one surface, Host Grotesk for what a person reads, Atkinson Hyperlegible Mono for what an instrument measured, amber for a person and cool blue for an instrument. The ground is neutral so both meanings sit on it at equal weight, and nothing glows. It is not a neon terminal, a glass dashboard or a science-fiction control room. + +## Tokens + +```css +:root { + --color-paper: oklch(17% 0.008 250); --color-paper-2: oklch(21% 0.009 250); --color-paper-3: oklch(13.5% 0.007 250); + --color-ink: oklch(95% 0.005 250); --color-ink-2: oklch(83% 0.008 250); --color-muted: oklch(71% 0.01 250); + --color-rule: oklch(31% 0.01 250); --color-rule-2: oklch(42% 0.012 250); + --color-accent: oklch(82% 0.15 80); --color-accent-ink: oklch(18% 0.04 75); --color-accent-soft: oklch(29% 0.05 80); --color-focus: oklch(82% 0.15 80); + --color-cool: oklch(77% 0.12 245); --color-cool-soft: oklch(29% 0.05 245); + --color-ok: oklch(76% 0.15 150); --color-ok-soft: oklch(24.5% 0.03 150); --color-bad: oklch(70% 0.17 25); --color-bad-soft: oklch(24.5% 0.035 25); + --font-display: "Host Grotesk", ui-sans-serif, system-ui, sans-serif; --font-body: var(--font-display); + --font-outlier: "Atkinson Hyperlegible Mono", ui-monospace, monospace; + --radius-card: 10px; --radius-pill: 6px; --rule-hair: 1px; + --shadow-card: none; + --tracking-display: -0.03em; --display-weight: 500; +} +``` + +One dial, the colourway, stated in the stamp (`console: graphite`): `graphite`, the tokens above; `paper`, ground oklch(98% 0.006 85) under ink oklch(19% 0.010 60), amber oklch(54% 0.14 70) and cool oklch(52% 0.14 250), the paper band turning light; `amber-room`, ground oklch(15% 0.022 70) under ink oklch(95% 0.012 85), amber oklch(82% 0.15 82) and the cool turned to ice oklch(82% 0.08 200). In every colourway amber means a person and cool means an instrument. + +## Type + +- **Display:** Host Grotesk 500, `--tracking-display`, line-height 1.02 to 1.05, sentence case, roman; calm at size, never 700. +- **Body:** Host Grotesk 400 at 16 to 17px, line-height 1.55, in `--color-muted`; the lede in `--color-ink-2`. +- **Labels, captions, table heads, chips:** Host Grotesk 500 a step smaller, sentence case, in `--color-muted`. +- **Measured:** Atkinson Hyperlegible Mono 400 and 500 at 14 to 15px for what an instrument or the system wrote: a reading with its unit, an id, a diff, a timestamp, every figure tabular. Its slashed zero and tailed one are the point; at display size it is the theme's loudest thing. Never a label, a head or a control. + +## Surfaces + +- Hairline panels: a surface is a 1px `--color-rule` with `--color-paper-2` inside, radius 10px (6px on controls). Panels that sit together are one surface divided by 1px rules; `--color-rule-2` marks the selected row or the spine of a trail. +- Three steps, no lamp: the ground, a panel one step up, the deepest step for code, logs, a changed row and photographs. No shadow, glow, bloom or spotlight. +- Bands: a `--color-paper-3` or `--color-paper-2` band, never an amber field; two a page at most. +- Photographs: one or two, of the bench and never a face (gloved hands at a pipette, a rack of tubes), dark and close, black and white from the deepest step to the ink, radius 10px, a 1px rule edge, a caption beneath. +- No texture, no gradient on a surface. + +## Range + +- **Diffs:** a comparison set as two versions in one panel, a gutter of plus and minus in ok and bad, the changed rows on the soft tints, the reason in the person's words beside them. +- **Readings:** a single value at display size in the measured face, the struck value it replaced above it, and who, when and why beneath in amber, cool and ink; a statement made of a record. +- **Trails:** rows as an audit trail on a 1px `--color-rule-2` spine, each entry a version, a person in amber, a time in cool, a reason in ink; a timetable or changelog reads the same way. +- **Panels:** a bento or a comparison cut from one surface with 1px seams, one panel the lead, each panel holding the product at full fidelity rather than a picture of it. + +## Controls + +- The pair: an amber fill with `--color-accent-ink` beside a 1px `--color-rule-2` outline on `--color-paper-2`, both at 6px, Host Grotesk 500. +- A chip carries state only: the label face inside a 1px rule at 4px radius, tinted `--color-accent-soft` or `--color-cool-soft` by meaning. A version picker is a row of such chips, the chosen pair on the cool tint. Inputs sit on `--color-paper-3` inside a 1px rule at 6px; links underline in `--color-rule-2` and turn amber on hover. +- Two meanings: amber is a person (an operator, a deviation, the current step, the one primary control); cool is an instrument (a reading, a trace, a version). Ok and bad exist for diffs and status only. + +## Motion + +A value changes when its source does, over `--dur-short` on `--ease-out`; a chart may draw once. No reveal, parallax or hover lift. + +## Voice + +A lab notebook kept by a careful person: the value, its unit, the time, who signed. A number without a unit or a time is nothing. + +## Do-nots + +- Never swap the meanings; an amber reading or a cool deviation is the theme lying. +- Never a floating card with a shadow under it. +- Never a third signal or a photograph in colour. +- Never mono on a label, a head or a button; mono is what an instrument wrote. +- Never a page of small panels only; one value or one record a page is set large. + +## Build hint + +```html + +``` + +```css +h1, h2, h3 { font-family: var(--font-display); font-weight: 500; letter-spacing: var(--tracking-display); line-height: 1.04; } +.panels { display: grid; gap: var(--rule-hair); background: var(--color-rule); border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-card); overflow: hidden; } +.panels > * { background: var(--color-paper-2); } +.measured { font-family: var(--font-outlier); font-size: var(--text-sm); font-variant-numeric: tabular-nums slashed-zero; } +.reading { font-family: var(--font-outlier); font-size: var(--text-display); font-weight: 400; letter-spacing: -0.04em; line-height: 1; color: var(--color-ink); } +.row--minus { background: var(--color-bad-soft); } .row--plus { background: var(--color-ok-soft); } +.btn { border: var(--rule-hair) solid var(--color-rule-2); border-radius: var(--radius-pill); padding: var(--space-sm) var(--space-md); background: var(--color-paper-2); color: var(--color-ink); font-weight: 500; transition: background-color var(--dur-short) var(--ease-out); } +.btn--primary { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); } +::selection { background: color-mix(in oklab, var(--color-accent) 25%, transparent); } +``` diff --git a/skills/hallmark/references/themes/coral.jpg b/skills/hallmark/references/themes/coral.jpg new file mode 100644 index 0000000..88ddde1 Binary files /dev/null and b/skills/hallmark/references/themes/coral.jpg differ diff --git a/skills/hallmark/references/themes/coral.md b/skills/hallmark/references/themes/coral.md new file mode 100644 index 0000000..5332c4d --- /dev/null +++ b/skills/hallmark/references/themes/coral.md @@ -0,0 +1,102 @@ +--- +name: Coral +slug: coral +genre: modern-minimal +paper: light 97 55 +display: grotesk-sans General Sans +accent: warm 30 +posture: restrained +keywords: saas, platform, billing, payments, invoicing, dashboard, b2b, startup, product, pricing, analytics, fintech, workflow, team, onboarding, trust, warm, human, calm +material: warm grey paper and a felt desk, cotton stationery lit from the left, General Sans throughout with Geist Mono figures, letterpress card controls, coral pressed into the stock for the one settled state +photo: muted sepia=8 +pictured: Conversational FAQ, Desk hero +--- + +# Coral + +A warm, plain product voice made physical: fine stationery on a felt desk, seen from above in one daylight from the left. Records are cotton sheets, envelopes and index cards with real edges; controls are letterpress cards; one coral ink is pressed in where something is settled. General Sans throughout. Not a cream editorial page, not a skeuomorphic toy, not a blue SaaS template. + +## Tokens + +```css +:root { + --color-paper: oklch(97% 0.006 55); --color-paper-2: oklch(94.5% 0.007 55); --color-paper-3: oklch(91.5% 0.009 55); + --color-ink: oklch(21% 0.012 38); --color-ink-2: oklch(29% 0.013 40); --color-muted: oklch(47% 0.013 45); + --color-rule: oklch(87% 0.009 55); --color-rule-2: oklch(81% 0.011 55); + --color-accent: oklch(74% 0.125 30); --color-accent-ink: oklch(21% 0.012 38); --color-accent-2: oklch(54% 0.165 29); --color-focus: oklch(54% 0.17 30); + --color-cotton: oklch(98.8% 0.0045 80); --color-desk: oklch(94.3% 0.008 64); --color-print: oklch(23% 0.012 38); + --color-board: oklch(22% 0.011 40); --color-board-type: oklch(96.5% 0.006 70); --color-paid: oklch(55.5% 0.15 33); + --tex-cotton: url("cotton.svg"); --tex-desk: url("felt.svg"); + --shade: 32% 0.03 50; --lit: 100% 0.005 80; --deep: 7% 0.01 40; + --font-display: "General Sans", ui-sans-serif, system-ui, sans-serif; --font-body: var(--font-display); + --font-outlier: "Geist Mono", ui-monospace, monospace; + --radius-card: 8px; --radius-input: 6px; --radius-pill: 999px; --radius-stock: 8px; --rule-hair: 1px; + --shadow-card: 0 1px 2px oklch(20% 0.01 35 / 0.05); + --edge-stock: inset 0 1px 0 oklch(var(--lit) / 0.9), inset 0 -1px 0 oklch(var(--shade) / 0.07), 0 0 0 0.5px oklch(var(--shade) / 0.22), 0 1px 0 oklch(var(--shade) / 0.12); + --cast-stock: 6px 5px 10px -6px oklch(var(--shade) / 0.3); --cast-stock-lift: 12px 10px 18px -8px oklch(var(--shade) / 0.3); + --press-groove: inset 1px 1.5px 2px oklch(var(--shade) / 0.16), inset -1px -1px 0 oklch(var(--lit) / 0.9), 0 0 0 0.5px oklch(var(--shade) / 0.2); + --tracking-display: -0.03em; --display-weight: 600; +} +``` + +## Type + +- **Display:** General Sans 600, `--tracking-display`, line-height 1.02 to 1.08, sentence case, roman. A lone price sets at two to three times `--text-display`, tracked -0.05em, line-height 0.85, its unit beside it at `--text-title` in 500. +- **Body:** General Sans 400 and 500. On stock, `--color-print`; on board, `--color-board-type`. +- **Labels:** General Sans 500 a step smaller, sentence case, `--color-muted`. +- **Figures in a column:** Geist Mono 400 (General Sans has no tabular figures). A price in a sentence or a head stays General Sans. + +## Surfaces + +- One light, from the left: each paper object takes a lit edge top and left, a shade edge bottom and right, and a cast falling right (`--edge-stock`, `--cast-stock`). +- The hero ground is a desk: `--color-desk` under a daylight radial from the left and a generated felt texture. Records the product handles are built as stationery on it: invoices, letters and statements on cotton sheets, a window envelope with glassine showing the address, replies as correspondence index cards, a groove pressed into a card. Each is CSS on `--color-cotton`, sized from one unit so it scales whole. +- Texture is generated, never a picture: the build writes `cotton.svg`, a 360px tile of two stitched feTurbulence layers (cloud 0.011, grain 0.92, warm and faint) with short fibre strokes, under a lit-to-shade gradient on every paper object; `felt.svg` the same at 0.018. Sections stay plain. +- The settled state (paid, signed, booked) is pressed into the stock: the word in General Sans 600 in `--color-paid`, through an SVG filter that offsets a shade wall into the letterforms and lets a noise mask leave the ink uneven, tilted a few degrees. +- One `--color-ink` band, the board; stationery on it casts from `--deep`. +- Photographs are rare: work at arm's length in daylight, muted; built stationery answers first. + +## Range + +- **The job played as paperwork:** the product's task told in its own documents on the desk (a sheet into an envelope, a reply card tucked under, the outcome pressed in), built in the hero and reused below. +- **Records as an index:** replies, bookings or clients as cotton index cards stacked with offset tabs, beside their record on a full sheet. +- **The price on the board:** the lone figure huge in paper beside a ruled list of what it pays for; the action sits on stationery laid on the band (an envelope flap, a card). +- **The other side:** what the recipient sees, built on cotton, a groove control rewriting it live. + +## Controls + +- Letterpress cards, not pills: 8px radius, 48px tall, cotton stock with `--edge-stock` and `--cast-stock` and the label pressed in (a lit text shadow below it); the primary is ink board with the label pressed the other way. Hover lifts 1px into `--cast-stock-lift`; active presses 1px down. +- A choice of two to four is a groove pressed into cotton (`--press-groove`, 12px radius) with a cotton card riding in it to the chosen stop. +- Inputs 48px, 6px radius, 1px `--color-muted` border, deep coral focus. Status is an ink outline; coral is spent only on the pressed settled state, link underlines and focus. + +## Motion + +Once, after fonts load and in view: the job plays on the desk in about six seconds, transforms and opacity only, paused off screen, then still. Reduced motion and no script show the finished state. + +## Voice + +Plain, warm second-person sentences about the work and the money: who, how much, when, what the product did. Never cute. + +## Do-nots + +- Never cool paper, a blue signal or a second light; every shadow falls right. +- Never a pill button or a flat square button; controls are pressed cards. +- Never a photograph of paper; stationery is built in CSS. +- Never coral as a band, a fill behind text or a head; it is the pressed ink of one settled state. + +## Build hint + +```html + +``` + +```css +h1, h2, h3 { font-weight: var(--display-weight); } +.desk { background-color: var(--color-desk); background-image: radial-gradient(90% 120% at 0% 30%, var(--color-cotton), transparent 62%), var(--tex-desk); } +.stock { background-color: var(--color-cotton); background-image: linear-gradient(100deg, var(--color-cotton), transparent 45%), var(--tex-cotton); color: var(--color-print); box-shadow: var(--edge-stock), var(--cast-stock); } +.btn { min-height: 48px; padding: 0 var(--space-lg); border: 0; border-radius: var(--radius-stock); font-weight: 500; transition: transform var(--dur-short) var(--ease-out); } +.btn--card { background-color: var(--color-cotton); background-image: var(--tex-cotton); color: var(--color-print); text-shadow: 0.5px 0.75px 0 var(--color-cotton); box-shadow: var(--edge-stock), var(--cast-stock); } +.btn--ink { background: var(--color-board); color: var(--color-board-type); text-shadow: 0 -0.75px 0 var(--color-ink); box-shadow: var(--cast-stock); } +.btn:hover { transform: translateY(-1px); box-shadow: var(--edge-stock), var(--cast-stock-lift); } .btn:active { transform: translateY(1px); } +.fig { font-family: var(--font-outlier); font-variant-numeric: tabular-nums; } +a:hover { text-decoration-color: var(--color-accent-2); } +``` diff --git a/skills/hallmark/references/themes/darkroom.jpg b/skills/hallmark/references/themes/darkroom.jpg new file mode 100644 index 0000000..b73ae40 Binary files /dev/null and b/skills/hallmark/references/themes/darkroom.jpg differ diff --git a/skills/hallmark/references/themes/darkroom.md b/skills/hallmark/references/themes/darkroom.md new file mode 100644 index 0000000..7267c24 --- /dev/null +++ b/skills/hallmark/references/themes/darkroom.md @@ -0,0 +1,99 @@ +--- +name: Darkroom +slug: darkroom +genre: atmospheric +paper: dark 12.5 55 +display: display-condensed Sofia Sans Extra Condensed +accent: chromatic-amber 58 +posture: restrained +keywords: photographer, photography, film, analogue, darkroom, prints, portfolio, exhibition, gallery, edition, commission, cinematographer, negative, archive, monochrome, lab, moody, black and white, night, print shop, travel, places, landscape, portrait, photo studio +material: warm print-black ground, a fine light grain, fibre-white ink, hairline Sofia Sans Extra Condensed capitals over Barlow, zero radius, black-and-white photographs printed deeper than the ground, one amber safelight +photo: mono high=-20 shad=-12 +pictured: Photographic, Poster hero +--- + +# Darkroom + +A print room with the lights off: a warm black ground a step lighter than a print's own black, so a photograph sits on it as an object; fibre-white ink; hairline extra-condensed capitals over Barlow; one amber safelight. Photographs are black and white, printed deep and large, and the type carries the rest. It is not a film-strip costume, a moody gradient, flat screen black or a white-matted gallery. + +## Tokens + +```css +:root { + --color-paper: oklch(12.5% 0.008 55); --color-paper-2: oklch(16% 0.009 55); --color-paper-3: oklch(20.5% 0.01 55); + --color-ink: oklch(92% 0.012 78); --color-ink-2: oklch(80% 0.012 75); --color-muted: oklch(64% 0.012 65); + --color-rule: oklch(29% 0.01 55); + --color-accent: oklch(73% 0.15 58); --color-accent-deep: oklch(50% 0.11 52); --color-accent-ink: oklch(12.5% 0.008 55); --color-focus: oklch(73% 0.15 58); + --font-display: "Sofia Sans Extra Condensed", ui-sans-serif, sans-serif; --font-body: "Barlow", ui-sans-serif, sans-serif; + --font-outlier: var(--font-body); + --radius-card: 0; --radius-pill: 0; --rule-hair: 1px; --shadow-card: none; + --tracking-display: -0.005em; --display-weight: 200; --grain: 0.07; +} +``` + +Three colourways, stated in the stamp (`darkroom: amber`). + +| Colourway | Ground, ink, signal | +| --- | --- | +| **amber** (default) | the tokens above | +| **red** | signal `oklch(62% 0.19 32)`, deep `oklch(44% 0.16 32)` | +| **fibre paper** | ground `oklch(95% 0.01 80)`, ink `oklch(14% 0.006 40)`, muted `oklch(46% 0.01 50)`, signal `oklch(50% 0.2 30)`, rule `oklch(80% 0.014 70)`; dark specks at 0.12 | + +## Type + +- **Display:** Sofia Sans Extra Condensed in capitals, 200 on the hero, section heads and figures, 400 on an item title and a control, line-height 1.0, `--tracking-display`, roman. The hairline at scale is the look: being extra-condensed, every display step may set one step above the shared scale, and the hero head runs to poster size across eight columns. +- **Body:** Barlow 400 for prose at 17px and 1.6, so the reading text holds on the dark; Barlow 300 only at lead size and above. +- **Labels, captions, table heads:** Barlow 400 a step smaller, sentence case, untracked, in `--color-muted`; a plate number and a month are this voice. Figures are tabular. No mono. + +## Surfaces + +- Depth is lightness, never light: ground 12.5, well 16, surface 20.5. No vignette, no bloom, no shadow; a print's blacks sit below the ground, which is what makes it read as a print. +- Rules: 1px `--color-rule`, run full width between rows of a sheet and as vertical hairlines between figures; radius 0 everywhere. +- Bands: a `--color-paper-2` well, grained, for the sections that carry no picture; two a page at most, never an amber field. +- Photographs: the work. Black and white, printed deep (open highlights, full blacks, the film's grain); a subject at a distance with room around it, or close and flat. Radius 0, no frame, no mat; full-bleed or held to the columns, never thumbnail size, a caption beneath with the plate number. Type crosses a photograph only over its darkest third, on a scrim of the ground at 40 to 70%. +- Texture: the speck grain of `texture.md` § 1 at `--grain`, on a well; never over a photograph. + +## Range + +- **Figures as an edition:** the prompt's real numbers (plates, prints of each, the run) in the 200 hairline at 12rem and over on a grained well, vertical hairlines between them, each with a muted Barlow line beneath; the size is the drama, the colour stays ink. +- **A collector's sheet:** Rows under full-width hairlines, the label in muted Barlow on the left and the value in display capitals at title size on the right: series, subject, negative, paper, edition, sizes. +- **A process as a contact strip:** Steps across the twelve columns, each stage a hairline numeral at section size over a short line (exposed, developed, printed, editioned), parted by verticals; nothing drawn. +- **A choice set as numerals:** a working picker of plates or sizes in 1px rule cells, each a display numeral at title size, the chosen one lit by the safelight, beside a plain form on the ground. + +## Controls + +- The pair: a 1px ink-outlined secondary beside an amber-filled primary in `--color-accent-ink`, both display capitals at 400, untracked, radius 0, 48px tall. +- Links are ink, underlined in `--color-rule`; the underline turns amber on hover. Inputs: radius 0, a 1px `--color-muted` border on the ground, a steady outline on focus. +- The safelight is scarce: the one filled control, a selected plate, a caption on hover; `--color-accent-deep` is the quieter fill under ink text. + +## Motion + +Still as a print. A photograph may rise once from the ground over `--dur-long`, as in the tray, from a visible default; hover on a linked plate turns its number amber. Nothing else moves. + +## Voice + +Lab notes and a collector's sheet: series, plate, place, month, edition, paper. Exact numbers, short lines, no adjectives about light or soul. + +## Do-nots + +- Never an amber wash, band, glow or amber head; the safelight lights a control or a number, never a section. +- Never a sprocket hole, a film strip, a grease-pencil ring or a drawn frame. +- Never Sofia Sans Extra Condensed above 400 for a head, and never a figure in anything but the 200. +- Never sepia, duotone or a tint on a picture, and never flat screen black under the prints. + +## Build hint + +```html + +``` + +```css +h1, h2, .figure { font-family: var(--font-display); font-weight: 200; text-transform: uppercase; line-height: 1; letter-spacing: var(--tracking-display); } +h3 { font-family: var(--font-display); font-weight: 400; text-transform: uppercase; line-height: 1; } +.btn { min-height: 48px; padding: 0 var(--space-lg); border: var(--rule-hair) solid var(--color-ink); border-radius: 0; background: transparent; color: var(--color-ink); font: 400 var(--text-lg)/1 var(--font-display); text-transform: uppercase; } +.btn--primary { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); } +.well { background: var(--color-paper-2); } +.grained { position: relative; isolation: isolate; } +.grained::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: var(--grain); background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 9 -4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E") 0 0 / 200px 200px; } +::selection { background: color-mix(in oklab, var(--color-accent) 35%, transparent); } +``` diff --git a/skills/hallmark/references/themes/dose.jpg b/skills/hallmark/references/themes/dose.jpg new file mode 100644 index 0000000..500d08f Binary files /dev/null and b/skills/hallmark/references/themes/dose.jpg differ diff --git a/skills/hallmark/references/themes/dose.md b/skills/hallmark/references/themes/dose.md new file mode 100644 index 0000000..eafeaef --- /dev/null +++ b/skills/hallmark/references/themes/dose.md @@ -0,0 +1,98 @@ +--- +name: Dose +slug: dose +genre: modern-minimal +paper: light 97.6 88 +display: grotesk-sans Schibsted Grotesk +accent: chromatic-green 160 +posture: committed +keywords: health, medication, pharmacy, care, carer, family, reminders, schedule, app, mobile, medicine, patients, clinic, prescription, tracking, calm, trust, routine, elderly, parents +material: warm morning paper with a fibre grain and window light, translucent tinted plastic, green-black ink, Schibsted Grotesk over Instrument Sans with DM Mono pharmacy labels, moulded controls, one pharmacy green +photo: natural sat=-15 con=-6 +pictured: Care Register, Organiser hero +--- + +# Dose + +Translucent plastic and daylight: warm morning paper with a fine fibre grain, window light falling across it, bands of soft tinted plastic like a pill organiser, green-black ink, Schibsted Grotesk heads over Instrument Sans, and DM Mono for the time and the dose, set like a pharmacy label. One pharmacy green does every signal. It is trustworthy because it is exact and unhurried, and it lives in a kitchen, not a clinic. It is not a clinical blue portal, not a wellness pastel and not an alarm. + +## Tokens + +```css +:root { + --color-paper: oklch(97.6% 0.011 88); --color-paper-2: oklch(96.5% 0.02 160); --color-paper-3: oklch(93% 0.036 160); + --color-ink: oklch(21% 0.025 170); --color-ink-2: oklch(31% 0.02 170); --color-muted: oklch(49% 0.024 165); + --color-rule: oklch(86.5% 0.022 140); + --color-accent: oklch(50% 0.13 160); --color-accent-deep: oklch(42% 0.11 162); --color-accent-soft: oklch(88% 0.08 160); --color-accent-ink: oklch(99% 0.006 160); + --color-focus: oklch(45% 0.14 160); + --p-mon: oklch(85% 0.052 22); --p-tue: oklch(87.5% 0.058 64); --p-wed: oklch(91.5% 0.064 98); --p-thu: oklch(86.5% 0.075 160); + --p-fri: oklch(87% 0.048 210); --p-sat: oklch(84% 0.045 270); --p-sun: oklch(84% 0.048 322); + --light: oklch(99.4% 0.016 84); --glint: oklch(100% 0 0); + --font-display: "Schibsted Grotesk", ui-sans-serif, sans-serif; --font-body: "Instrument Sans", ui-sans-serif, sans-serif; + --font-outlier: "DM Mono", ui-monospace, monospace; + --radius-card: 14px; --radius-input: 10px; --radius-pill: 999px; --rule-hair: 1px; + --shadow-card: 0 1px 2px oklch(30% 0.03 165 / 0.08), 0 24px 48px -24px oklch(40% 0.08 165 / 0.35); + --shadow-lift: 0 1px 1px oklch(30% 0.03 165 / 0.10), 8px 18px 28px -14px oklch(36% 0.06 165 / 0.32), 18px 40px 60px -30px oklch(40% 0.08 165 / 0.30); + --tracking-display: -0.03em; --display-weight: 700; +} +``` + +Committed: the paper is warm, the green tints and the plastic carry the colour, mint (`--color-accent-soft`) marks what is checked, and the accent proper stays on controls, focus, a stamp and one figure. Grounds, stated in the stamp (`dose: white`): **white** (default, the tokens above), **green** (drenched `oklch(46% 0.12 160)` under white ink, surfaces white inside, mint on the ground), **night** (`oklch(13% 0.01 170)` under `oklch(96% 0.01 160)`, plastic at 40% light, mint with dark ink). + +## Type + +- **Display:** Schibsted Grotesk 700, `--tracking-display`, line-height 1.02, sentence case, lining tabular figures. +- **Body:** Instrument Sans 400 and 500, 16 to 18px, line-height 1.5. +- **Labels, captions, table heads:** Instrument Sans 500 a step smaller, sentence case. +- **Times, doses, pharmacy labels:** DM Mono 400 and 500 (`08:00`, `500 mg`), at text size inside a sentence, at title size where a timetable's first column is the time, and as the whole voice of a pharmacy label; never a tab, a table head or a display figure. Three weights a page: 400, 500, 700. + +## Surfaces + +- The ground is generated, never a picture: the paper takes a fractal-noise fibre grain (an `feTurbulence` data URI under the paper colour), and the hero takes window light, four blurred panes of `--light` skewed across the paper, drifting over 90 seconds. +- Plastic is the surface: a tint (`--p-*`, never a state) at about 62% alpha, a `--glint` line along the top edge, a deeper inner shade at the foot, and the coloured light it lets through pooled and blurred on the paper below. It makes bands, trays and compartments; CSS 3D may turn a set of them three-quarter on the paper. +- A label is paper on plastic: grained white, 10px radius, a tear-off stub on a dashed rule, DM Mono throughout, a confirmation as a double-ringed green stamp rotated 2 degrees naming the time and who; missed or due is the same in grey. +- Radii read as an app: 10px controls, 14px surfaces, 999 on tags, a phone screen at about 28px. White surfaces lift on `--shadow-lift`; one green-black ink band may carry a statement. +- Photographs: the home where a dose is given, hands and rooms in soft daylight, never a face to camera or a clinic; 14px radius, captions beneath. + +## Range + +- **A sequence as plastic bands:** each stage a full-width band in its own tint, the number in Schibsted at display size, two phone screens of the product on it, the minute each happened in DM Mono beside its line. +- **A record as labels:** the photograph beside two pharmacy labels, one stamped given in green, one missed in grey, each stating the dose, time and person. +- **Statement on the ink band:** one plain sentence in Schibsted 700 at `--text-display`, one line in mint beneath it. +- **A first step in a tray:** the form on a sunken plastic tray, choices as plastic keys, the product's screen beside it answering live. + +## Controls + +- Moulded plastic: a 52px control at 10px with a 1px rim, a 3px rim below, a bevel of `--glint` on top and a soft cast shadow; it sinks 3px on press. The primary is green plastic, the secondary clear. +- Choices are plastic keys, mint when checked. Links underline in green on hover. Inputs: 52px at 10px with a 1px `--color-muted` border. + +## Motion + +Light drifts over 90 seconds and pauses off screen. Once in view: a lid lifts, a label rises, its stamp lands and a tick ripples to whoever else sees it. Reduced motion or no script: the end state, light still. + +## Voice + +A pharmacist's plainness, spoken by a family: the name, the dose, the time, who gave it, in the words a son or daughter uses (Mum, your brother). Never a journey, never a warning in red. + +## Do-nots + +- Never red or amber for a missed or late state; it is grey. +- Never a plastic tint as a signal or a second brand colour; the green does every signal. +- Never clinical stock: spilled pills, blister packs in close-up, white coats. +- Never glossy toy plastic: tints stay pale, light is daylight, no gradients beyond the glint and the shade. + +## Build hint + +```html + +``` + +```css +h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: var(--tracking-display); line-height: 1.02; } +.btn { height: 52px; padding: 0 var(--space-lg); border: 0; border-radius: var(--radius-input); font: 500 var(--text-md) var(--font-body); box-shadow: inset 0 1px 0 var(--glint), 0 0 0 1px var(--color-rule), 0 3px 0 var(--color-rule); transition: transform var(--dur-micro) var(--ease-out); } +.btn--primary { background: linear-gradient(var(--color-accent), var(--color-accent-deep)); color: var(--color-accent-ink); box-shadow: 0 0 0 1px var(--color-accent-deep), 0 3px 0 var(--color-accent-deep); } +.btn:active { transform: translateY(3px); } +.plastic { --t: var(--p-thu); position: relative; border-radius: var(--radius-card); background: linear-gradient(color-mix(in oklab, var(--glint) 32%, transparent), transparent 18%), color-mix(in oklab, var(--t) 62%, transparent); box-shadow: inset 0 1.5px 0 var(--glint), inset 0 -24px 36px -28px color-mix(in oklab, var(--t) 45%, var(--color-ink)); } +.dose, .label { font-family: var(--font-outlier); font-variant-numeric: tabular-nums; } +.band--ink { background: var(--color-ink); color: var(--color-paper); } +``` diff --git a/skills/hallmark/references/themes/dusk.jpg b/skills/hallmark/references/themes/dusk.jpg new file mode 100644 index 0000000..ea64feb Binary files /dev/null and b/skills/hallmark/references/themes/dusk.jpg differ diff --git a/skills/hallmark/references/themes/dusk.md b/skills/hallmark/references/themes/dusk.md new file mode 100644 index 0000000..9a59843 --- /dev/null +++ b/skills/hallmark/references/themes/dusk.md @@ -0,0 +1,105 @@ +--- +name: Dusk +slug: dusk +genre: modern-minimal +paper: dark 17.5 268 +display: grotesk-sans Wix Madefor Display +accent: cool 274 +posture: committed +keywords: treasury, banking, fintech, payments, reconciliation, ledger, accounting, close, month end, audit, balance, cash management, payouts, settlement, compliance, controller, bookkeeping, finance team, invoicing, payroll, overnight, automation +material: a real landscape at the turn of the light behind the hero, slate below it, the product in smoked glass with a lit top edge, Wix Madefor Display at a quiet weight over Wix Madefor Text, bone wells for light surfaces, one periwinkle signal and one apricot +photo: natural con=4 vib=6 +pictured: Narrative Workflow, Stage hero +--- + +# Dusk + +Money software at the calm end of the day: a real photograph of land at dusk behind the hero, the head set dark on its palest part, the product beside it in smoked glass. Below, the page turns to slate and light surfaces are bone wells. It reads as expensive and unhurried, never a neon trading screen or a dashboard of tiles. + +## Tokens + +```css +:root { + --color-paper: oklch(17.5% 0.014 268); --color-paper-2: oklch(21% 0.016 268); --color-paper-3: oklch(25% 0.017 268); + --color-ink: oklch(96% 0.006 75); --color-ink-2: oklch(85% 0.010 262); --color-muted: oklch(70% 0.016 262); + --color-rule: oklch(30% 0.016 266); --color-light: oklch(100% 0 0); --color-shade: oklch(10% 0.022 268); + --color-accent: oklch(77% 0.10 274); --color-accent-ink: oklch(19% 0.035 274); --color-accent-hi: oklch(84% 0.085 274); + --color-accent-deep: oklch(44% 0.13 274); --color-accent-soft: oklch(91% 0.038 274); --color-focus: oklch(80% 0.10 274); + --color-accent-2: oklch(83% 0.095 62); --color-dusk: oklch(70% 0.12 330); + --color-day-ink: oklch(22% 0.022 268); --color-day-muted: oklch(38% 0.022 266); --color-fog: oklch(94% 0.012 70); + --color-well: oklch(95.5% 0.008 75); --color-well-2: oklch(92% 0.010 75); --color-well-ink: oklch(21% 0.016 268); --color-well-muted: oklch(47% 0.016 265); --color-well-rule: oklch(87.5% 0.009 75); --color-card: oklch(99.5% 0.003 75); + --glass: oklch(22% 0.018 268 / 0.58); --glass-blur: 22px; + --glass-hi: inset 0 1px 0 oklch(100% 0 0 / 0.10), inset 0 0 0 1px oklch(100% 0 0 / 0.06); + --shadow-card: 0 1px 0 oklch(100% 0 0 / 0.06) inset, 0 40px 80px -32px oklch(8% 0.02 268 / 0.7); + --font-display: "Wix Madefor Display", ui-sans-serif, system-ui, sans-serif; --font-body: "Wix Madefor Text", ui-sans-serif, system-ui, sans-serif; + --radius-card: 18px; --radius-inner: 10px; --radius-pill: 999px; --rule-hair: 1px; + --tracking-display: -0.022em; --display-weight: 500; +} +``` + +Three dials, each stated in the stamp (`dusk: fog/periwinkle-apricot/glass`); two Dusk pages in one run differ on two. + +| Dial | Options | +| --- | --- | +| **Hour** (the hero photograph) | `fog` (default): a valley of fog under an apricot sky. `shore`: water at dusk, boats or a quay. `ridge`: mountain ridges in haze at first light | +| **Signals** (matched, then open) | `periwinkle-apricot` (default). `sage-apricot`: `oklch(80% 0.07 160)` as the first signal | +| **Product surface** | `glass` (default): smoked glass on slate. `well`: bone wells carry the hero product too, glass only over photographs | + +## Type + +- **Display:** Wix Madefor Display 500, `--tracking-display`, line-height 1.02 to 1.1, sentence case. Heads stay modest; the photograph and the product are the loud parts. +- **Body:** Wix Madefor Text 400 and 500 at 17px, line-height 1.55; leads in `--color-ink-2` or `--color-muted`. +- **Figures:** the same faces, `tabular-nums`; cents in `--color-muted` at the same size, never raised. A figure set as a statement goes to Display 500 at 34 to 44px with its cents at 0.6em. +- **Labels, column heads, status:** Text 500 a step smaller, sentence case, `--color-muted`. Never mono, never tracked capitals. + +## Surfaces + +- **The hour:** a library photograph of land at the turn of the light fills the hero, the head in `--color-day-ink` on its palest part over a fog scrim (`--color-fog` at 40 to 78%, radial, behind the text only), the product in glass on its darker side, the foot fading to `--color-paper`. A second photograph of the same hour may close the page behind the form; two at most. +- **Glass:** the product's surface, `--glass` blurred, `--glass-hi` for the lit edge, `--shadow-card`. Rows inside split on `--color-light` at 7%; inner parts sit on it at 4 to 6% with `--radius-inner`. +- **Wells:** a light surface is a bone well at 5:4 holding one white `--color-card`; the caption sits under it, a title and one muted line. +- **Slate:** every band below the hero is `--color-paper`; the nav turns to slate glass once it leaves the photograph. + +## Range + +- **A run as an account list:** accounts with a round initial, line counts in muted, a status word with its icon, balances right-aligned with muted cents; the open item closes the list as an apricot strip with its action. +- **A tour as a list beside one pane:** four jobs in a ruled list, the chosen one marked by a periwinkle dot and opened to one line, one glass pane beside it that changes with it. +- **A month as a strip of nights:** one slim rounded bar a day in periwinkle, its height the work done, a flagged day marked by an apricot dot above its bar, the open day in apricot, days still to come hatched; a ruled tally of four figures under it. +- **A hand-off in a well:** the note or message the product sends, set as the real card on bone. + +## Controls + +- One periwinkle pill (`--color-accent` under `--color-accent-ink`, a light inset top edge); hover lifts to `--color-accent-hi` with a soft periwinkle ring. A ghost pill beside it in `--color-light` at 4%. +- An email field and its button share one pill: frosted fog over a photograph, smoked glass on slate. +- Tabs are a ruled list with a dot, never boxed segments. Switches are periwinkle when on. +- Two signals, two jobs: periwinkle is done, matched, on and focused; apricot is open, waiting or owed. Neither is ever a large fill. + +## Motion + +The hero photograph drifts 6% over 48 seconds; the product's rows rise in once, staggered; the open dot breathes; panes cross-fade; bars grow from their feet when seen. Reduced motion: all still. + +## Voice + +Calm and exact: what ran, when, what is left. + +## Do-nots + +- Never a drawn or generated sky, and never text on the busy part of a photograph. +- Never a gradient button, a third signal colour or a red debit. +- Never a grid of stat tiles; figures live in rows, lists and one ruled tally. +- Never glass on glass, never a glow behind glass, never glass without its lit edge. + +## Build hint + +```html + +``` + +```css +h1, h2, h3 { font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--tracking-display); } +.num { font-variant-numeric: tabular-nums; } .num .c { color: var(--color-muted); } +.glass { background: var(--glass); border-radius: var(--radius-card); -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.35); backdrop-filter: blur(var(--glass-blur)) saturate(1.35); box-shadow: var(--glass-hi), var(--shadow-card); } +.btn { min-height: 48px; padding: 0 var(--space-lg); border: 0; border-radius: var(--radius-pill); background: var(--color-accent); color: var(--color-accent-ink); font: 600 0.9375rem/1 var(--font-body); box-shadow: inset 0 1px 0 color-mix(in oklab, var(--color-light) 35%, transparent); } +.btn:hover { background: var(--color-accent-hi); } +.hero__photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; } +.hero__scrim { position: absolute; inset: 0; background: radial-gradient(ellipse 50% 58% at 20% 56%, color-mix(in oklab, var(--color-fog) 78%, transparent), transparent 78%), linear-gradient(to bottom, transparent 72%, var(--color-paper)); } +``` diff --git a/skills/hallmark/references/themes/editorial.jpg b/skills/hallmark/references/themes/editorial.jpg new file mode 100644 index 0000000..f25d823 Binary files /dev/null and b/skills/hallmark/references/themes/editorial.jpg differ diff --git a/skills/hallmark/references/themes/editorial.md b/skills/hallmark/references/themes/editorial.md new file mode 100644 index 0000000..643320e --- /dev/null +++ b/skills/hallmark/references/themes/editorial.md @@ -0,0 +1,97 @@ +--- +name: Editorial +slug: editorial +genre: editorial +paper: light 97 86 +display: display-condensed Bricolage Grotesque +accent: chromatic-green 152 +posture: restrained +keywords: magazine, editorial, feature, culture, fashion, design annual, interview, longform, publication, issue, contemporary, art direction, profile, lookbook, brand story, journal, considered, travel, city guide, guide +material: warm white uncoated stock, printed black ink with a cool tilt, Bricolage Grotesque condensed at 800 over Source Serif 4, square corners, a heavy ink rule over 1px hairlines, one printer's green +photo: natural sat=-10 con=4 +pictured: Marquee Hero, Stage hero +--- + +# Editorial + +A contemporary magazine voice: warm white uncoated stock, a printed black with a faint cool tilt that runs through the reading text too, Bricolage Grotesque at 800 squeezed to width 75 for every head, Source Serif 4 for reading and the standfirst, square corners, a heavy ink rule over 1px hairlines, one printer's green. The condensed head, the serif standfirst and the rule carry it, not ornament. It is not a serif literary journal, not cream with terracotta, and not a gallery of captioned photographs. + +## Tokens + +```css +:root { + --color-paper: oklch(97% 0.007 86); --color-paper-2: oklch(94% 0.010 86); --color-paper-3: oklch(91% 0.012 84); + --color-ink: oklch(16% 0.012 280); --color-ink-2: oklch(29% 0.011 280); --color-muted: oklch(48% 0.010 75); + --color-rule: oklch(85% 0.009 85); --color-rule-2: oklch(64% 0.010 80); + --color-accent: oklch(49% 0.130 152); --color-accent-ink: oklch(98% 0.005 88); --color-focus: oklch(52% 0.135 152); + --font-display: "Bricolage Grotesque", ui-sans-serif, sans-serif; --font-body: "Source Serif 4", ui-serif, Georgia, serif; + --radius-card: 0; --radius-pill: 0; --rule-hair: 1px; --rule-heavy: 4px; --shadow-card: none; + --tracking-display: -0.012em; --display-weight: 800; +} +``` + +## Type + +- **Display:** Bricolage Grotesque 800 with `"wdth" 75, "opsz" 96`, `--tracking-display`, sentence case, roman. Line-height 0.92 at hero size, 1.0 for heads. Condensed, it takes one step up: a section head may run at `--text-display-s`, a lone hero word at twice `--text-display`. One weight and one colour per head. +- **Body:** Source Serif 4 400 and its italic at 18px, optical size automatic, line-height 1.55, oldstyle figures in running text, in `--color-ink-2`. The standfirst (the line under a head, or a statement) is the same face at `--text-lead` up to `--text-display-s`, ink, line-height 1.2 at the large end. A quotation takes the italic; italic never enters a head. +- **Labels, captions, nav links, controls, table heads, bylines:** Bricolage Grotesque 500 at `"opsz" 12`, full width, a step smaller, sentence case, untracked; captions in `--color-muted`. Figures set in the display face take lining tabular numerals. No mono on the page. + +## Surfaces + +- Two rule weights: a `--rule-heavy` ink rule opens a section or a table, the head flush under it; 1px `--color-rule` hairlines part rows, columns and figures, `--color-rule-2` under a table head. Nothing is boxed, nothing casts a shadow. +- Radius 0 on everything: controls, tags, inputs, wells and photographs are sharp rectangles. +- Depth is a paper step: a well is `--color-paper-2` under a `--color-rule-2` hairline, never a raised card. +- Bands: a `--color-paper-2` well and one `--color-ink` band with `--color-paper` type, two a page at most; never a green band. +- Photographs: seen close: hands at work, an object on a bench, a room in daylight, printed pages. Soft window light, people from behind, never a face to the lens; a little quieter than life, square, an inset ink outline at 8%, full-bleed or cut to a column edge. A head crosses a photograph only as a cover line, once a page, over an ink scrim. Two or three big pictures below the first screen; the material carries the rest. +- No texture, no grain, no mesh. + +## Range + +- **Contents as rows:** under the heavy rule, three to six hairline rows, a title in the condensed head at about 40px on the left, its standfirst in the serif on the right, a page or date in the display face at the far edge. +- **The standfirst as a statement:** one or two sentences in Source Serif at `--text-display-s`, ink across ten columns under the heavy rule; the serif at size is as much this theme as the head. +- **Figures reversed out:** on the ink band, three or four of the prompt's numbers in the condensed head at `--text-display`, parted by hairlines, labels beneath. +- **The order as a spec sheet:** a form on the paper-2 well, its facts in a ruled table beside the fields, the total in the display face, updated as the quantity changes. + +## Controls + +- An ink-filled square block (`--color-paper` on `--color-ink`) beside a 1px ink-outlined block, both in the label face, 48px tall; a tag may be the one filled green rectangle. +- Links carry a hairline underline that turns green on hover; inputs and selects are square, 52px tall, with a 1px `--color-rule-2` border that turns ink on focus. +- Green stays under 5% of a screen: a hover, one tag, the focus ring. + +## Motion + +State only: a green underline grows under a link over `--dur-short` on `--ease-out`, a block darkens one step, a total changes in place. No reveal, nothing on scroll. + +## Voice + +Contemporary, lightly literary, exact. Name the issue, the page count, the date; a head reads like a cover line, a standfirst says the argument in one breath. + +## Do-nots + +- Never a serif head; Source Serif 4 sets reading text, standfirsts and quotations, never an `h1` to `h3`. +- Never Bricolage at its default width; without `"wdth" 75` the head loses the magazine proportion. +- Never a rounded corner, a pill, a shadow, or a rule in green. +- Never two picture sections in a row; follow each with rows, a standfirst or the figures. +- Never an all-caps shout; sentence case, tight, magazine-modern. + +## Build hint + +```html + +``` + +```css +body { color: var(--color-ink-2); font-optical-sizing: auto; font-variant-numeric: oldstyle-nums; } +h1, h2, h3 { font-weight: var(--display-weight); font-variation-settings: "wdth" 75, "opsz" 96; color: var(--color-ink); font-variant-numeric: lining-nums tabular-nums; } +small, figcaption, th, nav, label, .btn, .tag { font-family: var(--font-display); font-weight: 500; font-variation-settings: "opsz" 12; } +.standfirst { font: 400 var(--text-display-s)/1.2 var(--font-body); color: var(--color-ink); } +.opens { border-top: var(--rule-heavy) solid var(--color-ink); padding-top: var(--space-lg); } +.btn { border: var(--rule-hair) solid var(--color-ink); border-radius: 0; min-height: 48px; padding: 0 var(--space-lg); } +.btn--primary { background: var(--color-ink); color: var(--color-paper); } +.btn--secondary { background: none; color: var(--color-ink); } +.tag { background: var(--color-accent); color: var(--color-accent-ink); padding: var(--space-3xs) var(--space-xs); } +.well { background: var(--color-paper-2); border-top: var(--rule-hair) solid var(--color-rule-2); } +.photo > img { outline: 1px solid color-mix(in oklab, var(--color-ink) 8%, transparent); outline-offset: -1px; } +a { text-decoration-color: var(--color-rule-2); text-underline-offset: 0.2em; } a:hover { text-decoration-color: var(--color-accent); } +::selection { background: color-mix(in oklab, var(--color-accent) 22%, transparent); } +``` diff --git a/skills/hallmark/references/themes/formwork.jpg b/skills/hallmark/references/themes/formwork.jpg new file mode 100644 index 0000000..875e234 Binary files /dev/null and b/skills/hallmark/references/themes/formwork.jpg differ diff --git a/skills/hallmark/references/themes/formwork.md b/skills/hallmark/references/themes/formwork.md new file mode 100644 index 0000000..e93ec6b --- /dev/null +++ b/skills/hallmark/references/themes/formwork.md @@ -0,0 +1,107 @@ +--- +name: Formwork +slug: formwork +genre: editorial +paper: mid 74 80 +display: display-condensed Oswald +accent: warm 38 +posture: restrained +keywords: construction, concrete, skatepark, contractor, civil, landscape, foundry, industrial, fabrication, workshop, engineering, cast, welded, builders, hardware, tools, site, heavy +material: warm grey concrete paper with a speck grain, near-black ink, Oswald capitals over Archivo, square cast edges and hard shadows, hard black-and-white photographs of poured concrete, one safety orange signal +photo: natural sat=-100 con=35 exp=8 +pictured: Site Board, Poster hero +--- + +# Formwork + +A site-office voice: warm grey concrete for paper, near-black ink, Oswald 700 capitals over Archivo, square cast edges, hard shadows and one safety orange. It feels heavy and exact because the surface is poured, every edge is straight and the photographs show the concrete itself in black and white, so the orange is the only colour on the page. It is not a black-and-yellow hazard page and not a glossy architecture portfolio. + +## Tokens + +```css +:root { + --color-paper: oklch(74% 0.008 80); --color-paper-2: oklch(69% 0.009 80); --color-paper-3: oklch(64% 0.01 80); + --color-plate: oklch(82% 0.007 80); --color-plate-ink: oklch(95% 0.006 80); + --color-ink: oklch(18% 0.005 270); --color-ink-2: oklch(28% 0.006 80); --color-muted: oklch(31.5% 0.008 80); + --color-rule: oklch(64% 0.01 80); + --color-accent: oklch(66% 0.21 38); --color-accent-ink: oklch(18% 0.005 270); --color-focus: oklch(42% 0.15 38); + --color-accent-deep: oklch(48% 0.17 38); + --texture-opacity: 0.05; + --font-display: "Oswald", ui-sans-serif, sans-serif; --font-body: "Archivo", ui-sans-serif, sans-serif; + --font-outlier: "Archivo Narrow", ui-sans-serif, sans-serif; + --radius-card: 0; --radius-pill: 0; --rule-hair: 1px; --rule-bar: 3px; + --shadow-card: 6px 6px 0 var(--color-ink); + --tracking-display: -0.005em; --display-weight: 700; +} +``` + +Three pours, stated in the stamp (`formwork: cast`). Muted sits on paper and paper-2 only; on anything darker the text is ink. + +| Pour | Wall and ink | Orange | +| --- | --- | --- | +| **Cast** (default) | concrete `oklch(74% 0.008 80)` under near-black, grain multiplied across it | `oklch(66% 0.21 38)` | +| **Night pour** | `oklch(27% 0.006 270)` under `oklch(95% 0.006 80)`, grain screened | `oklch(70% 0.21 40)` | +| **Drawing** | tracing paper `oklch(95% 0.012 85)` under blue-black ink `oklch(22% 0.02 260)`, no grain | a red `oklch(58% 0.21 30)` | + +## Type + +- **Display:** Oswald 700, uppercase, `--tracking-display`, roman; line-height 1.0 to 1.05 (55a), 0.9 only on a line that cannot wrap. One colour per head. Condensed, a section head takes one step up (`--text-display-s` and up), and a lone figure may run to 20rem. +- **Body:** Archivo 400 and 500, 16 to 17px, line-height 1.5, in `--color-ink-2`. +- **Figures (the outlier):** Archivo Narrow 500, tabular, sentence case, for measurements and counts: a radius in millimetres, a depth, a week, a park's number. +- **Labels, captions, table heads, meta:** Archivo 500 a step smaller, sentence case, untracked. No mono on the page. + +## Surfaces + +- Rules: `--rule-bar` in ink across the top of a section or a table, `--rule-hair` in `--color-paper-3` between rows. +- Radius 0 on everything; concrete is cast against straight boards. +- Depth is cast, never soft: a plate is `--color-plate` with a `--rule-bar` ink border and the hard `--shadow-card` in ink, one or two a page; nothing is blurred. +- Bands: `--color-paper-2` (a darker pour) or one `--color-ink` band with `--color-paper` text; never an orange field. Two a page at most. +- Photographs: concrete close and at work in hard daylight: a bowl's transition from the deck, board-marked walls, coping and edges, the pour and the float, a skater from behind or far off. Hard black and white, the whites clean and the blacks deep (the `photo:` line), so a picture stands off the grey paper and the orange stays the only colour. Square in a 2px ink frame, no shadow; a caption beneath in the label style; type on a photograph only over an ink scrim from its edge. +- Texture, the grain: `texture.md` § 1 across the whole paper at `--texture-opacity` (0.05, so it may sit under running text), multiplied, screened on the night pour; it is what makes the paper read as cast. + +## Range + +- **A figure cast as a plate:** the prompt's one real count in Oswald at 14 to 20rem on a plate with the hard shadow, its unit and what it counts in Archivo beside it. +- **Steps as a pour sequence:** three or four stages across the twelve columns under a `--rule-bar`, each an Oswald numeral at `--text-display-s`, a one-word stage and one plain line, verticals in `--color-paper-3` between. +- **Comparison as two plates:** two audiences or two jobs side by side, each a plate with its rows on hairlines; orange only on the one action. +- **Statement on the ink band:** one line of Oswald capitals at display size in `--color-plate-ink` on `--color-ink`, grain screened. + +## Controls + +- The pair: an orange primary raised on a hard `0 3px 0` shadow in `--color-accent-deep` that presses down 3px on `:active`, beside a pressed-in secondary (`inset 0 2px 3px`, a 2px ink border). Both in Oswald 700 capitals, untracked, following the display; radio labels are labels, Archivo sentence case. +- Links are ink, underlined, orange on hover; inputs are pressed in like the secondary. +- Orange stays under 5% of a screen: the primary, one figure, the focus ring. + +## Motion + +Concrete does not move. A control presses in over `--dur-micro` on `--ease-out`; state lands at once. Nothing on scroll, nothing ambient. + +## Voice + +A foreman's plain talk: what was poured, where, for whom and when it opens. Short lines, every figure with its unit. + +## Do-nots + +- Never a rounded corner, a blurred shadow or a second accent; the hard shadow and the orange are the material. +- Never draw the concrete (board seams, tie holes, cracks, a hazard stripe); photograph it. +- Never a colour photograph beside the orange; pictures print in black and white. +- Never Oswald in lowercase or at a light weight; it is 700 capitals. + +## Build hint + +```html + +``` + +```css +h1, h2, h3 { font-weight: 700; text-transform: uppercase; } +.btn { border-radius: 0; padding: var(--space-sm) var(--space-xl); font: 700 var(--text-sm)/1.6 var(--font-display); text-transform: uppercase; } +.btn--primary { background: var(--color-accent); color: var(--color-accent-ink); box-shadow: 0 3px 0 var(--color-accent-deep); + transition: translate var(--dur-micro) var(--ease-out), box-shadow var(--dur-micro) var(--ease-out); } +.btn--primary:active { translate: 0 3px; box-shadow: 0 0 0 var(--color-accent-deep); } +.btn--secondary { background: var(--color-paper-2); color: var(--color-ink); border: 2px solid var(--color-ink); box-shadow: inset 0 2px 3px color-mix(in oklab, var(--color-ink) 30%, transparent); } +.card { background: var(--color-plate); border: var(--rule-bar) solid var(--color-ink); box-shadow: var(--shadow-card); } +.photo img { outline: 2px solid var(--color-ink); outline-offset: -2px; } +.band--cast { position: relative; isolation: isolate; background: var(--color-paper-2); } +::selection { background: color-mix(in oklab, var(--color-accent) 35%, transparent); } +``` diff --git a/skills/hallmark/references/themes/furrow.jpg b/skills/hallmark/references/themes/furrow.jpg new file mode 100644 index 0000000..a1dba51 Binary files /dev/null and b/skills/hallmark/references/themes/furrow.jpg differ diff --git a/skills/hallmark/references/themes/furrow.md b/skills/hallmark/references/themes/furrow.md new file mode 100644 index 0000000..41a5b40 --- /dev/null +++ b/skills/hallmark/references/themes/furrow.md @@ -0,0 +1,98 @@ +--- +name: Furrow +slug: furrow +genre: modern-minimal +paper: light 96 85 +display: grotesk-sans Red Hat Display +accent: warm 40 +posture: committed +keywords: farm, agriculture, land, field, livestock, sheep, cattle, crop, records, compliance, inspection, fleet, field service, rural, contractor, hectares, yard, outdoors, seasonal, working, units +material: warm manila paper, near-black ink in rules, a generated survey map in sienna contours and slate water, Red Hat Display 600 over Red Hat Text with Red Hat Mono figures, moulded 6px keys, a waterproof notebook card, one tangerine signal and a grass green for what is in date +photo: natural con=8 sat=-6 +pictured: Field Record, Map hero +--- + +# Furrow + +A working records voice drawn on the land itself: warm manila paper, near-black ink, and the place the work happens generated as a survey map (contours, hedges, walls, water, the holding edged in tangerine like a title plan) with the records pinned where they happened. Entries open as waterproof notebook pages; the rest is ruled lists, figures with their units and moulded keys. Tangerine is ear tag and baler twine; green is what is in date. It is not a pastoral lifestyle page, not a glossy dashboard and not a sat-nav. + +## Tokens + +```css +:root { + --color-paper: oklch(96% 0.011 85); --color-paper-2: oklch(99.5% 0.005 85); --color-paper-3: oklch(92% 0.016 85); + --color-ink: oklch(18% 0.006 60); --color-ink-2: oklch(28% 0.008 60); --color-muted: oklch(44% 0.012 60); --color-rule: oklch(88% 0.013 85); + --color-accent: oklch(70% 0.19 40); --color-accent-ink: oklch(18% 0.006 60); --color-accent-soft: oklch(91% 0.05 50); --color-focus: oklch(60% 0.19 40); + --color-green: oklch(48% 0.11 150); --color-green-soft: oklch(92% 0.04 150); + --color-contour: oklch(62% 0.07 58); --color-water: oklch(60% 0.05 232); --color-hedge: oklch(50% 0.1 150); + --color-grid: oklch(90% 0.014 85); --color-grid-strong: oklch(85% 0.018 85); --color-sheet: oklch(99.3% 0.004 85); + --font-display: "Red Hat Display", "Red Hat Text", ui-sans-serif, sans-serif; --font-body: "Red Hat Text", ui-sans-serif, system-ui, sans-serif; + --font-outlier: "Red Hat Mono", ui-monospace, monospace; + --radius-card: 10px; --radius-entry: 14px; --radius-pill: 6px; --rule-hair: 1px; + --shadow-card: 0 1px 2px oklch(18% 0.006 60 / 0.08), 0 14px 28px -16px oklch(18% 0.006 60 / 0.28); + --shadow-lift: 0 1px 1px oklch(18% 0.006 60 / 0.1), 0 2px 4px -1px oklch(18% 0.006 60 / 0.1), 0 24px 44px -20px oklch(18% 0.006 60 / 0.42); + --tracking-display: -0.035em; --display-weight: 600; +} +``` + +## Type + +- **Display:** Red Hat Display 600, `--tracking-display`, line-height 1.0, sentence case; a price that is the offer sets in it at display size; an entry's time in it at 44px, tabular. +- **Body:** Red Hat Text 400, line-height 1.55, `--color-muted`; 500 for a row's title. +- **Labels, chips, tabs:** Red Hat Text 500 a step smaller, sentence case, untracked. Never mono, never uppercase. +- **Figures (mono as material):** Red Hat Mono 400 and 500, tabular, a step smaller than the text beside them, only for what gets copied onto a form: dates, times, tag numbers, doses, batches, hectares. Place names on the map in Red Hat Text 500, sentence case, set along their field as a surveyor would. + +## Surfaces + +- The survey map, generated on a canvas on load and resize, never a picture: contours traced from noise by marching squares in `--color-contour`, every fifth heavier and labelled; hedges dotted in `--color-hedge`, walls solid ink, water in `--color-water`, buildings hatched, a lane and a gate; the holding edged in tangerine. Paper grain, fibre and two fold creases are drawn into the map only. A still frame of it is the no-script fallback. +- On the map: pins in three shapes (disc, diamond, triangle) for the kinds of record, an ink tag beside each with its time; the open one turns tangerine; a movement draws as a dashed route. A map loupe (1.9x, fine ring, reticle) rests on one landmark and glides to the pointer. +- The notebook card: `--color-paper-2` at `--radius-entry`, a 1px ink ring and `--shadow-lift`, an ink head with the kind and the time, then cells on an 8px `--color-grid` notebook grid parted by 1px ink lines, and 56px step keys at the foot. +- An exported record is a letter-folded sheet opened flat: `--color-sheet`, 3px corners, two creases lit from above. +- Rules: a 1px ink rule over a list, `--color-rule` hairlines between rows, a 2px ink rule over a total. Only the card and the white sheet lift. +- Photographs: the holding in ordinary weather at mid distance; natural, never golden hour; 10px radius, or full-bleed under an ink scrim. + +## Range + +- **The day on the map:** entries pinned where they happened, one open as a notebook card. +- **The book as an index:** a ruled table on the white sheet, a segmented filter of the logs above, chips for in date and in withdrawal. +- **One day by the hour:** logs as rows against the hours, each entry a pin with its tag. +- **The bill over the land:** the price as ruled lines on the tangerine field, a contour fragment with a hedge, a gate and one pin behind it. + +## Controls + +- Moulded keys at 6px, 48px tall: the primary tangerine with ink text, a lit inset top edge and a shaded inset bottom; the secondary white with a 1px `--color-rule` border and the same lit edge. Active sinks 1px. +- Fields hold their label inside the box, small and muted at the top left, the value beneath; white, 52px, a 1px `--color-muted` border; a figure field sets in mono. +- Tangerine is a fill with ink on it: the primary, the selected tab, the open pin, the holding's edge, the field band, the focus ring. + +## Motion + +Once, in view: pins land in time order, the route draws, the card opens, the loupe settles. Transforms and opacity, `--ease-out`, paused off screen. Reduced motion or no script: the pins down, one entry open. + +## Voice + +Plain and unit-bearing: 3.6 ha, 10 ml, 28 days, a pound sign on a price. Never a number without its unit, never a pastoral adjective. + +## Do-nots + +- Never tangerine as type; it is a fill with ink on it. +- Never a map tile, a satellite photograph or a pin-drop icon; the land is a generated survey. +- Never grain or creases outside the map. +- Never mono on a label, a chip or a head. + +## Build hint + +```html + +``` + +```css +h1, h2, h3 { font-weight: var(--display-weight); line-height: 1; } +.btn { min-height: 48px; border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-pill); padding: 0 var(--space-lg); font-weight: 500; background: var(--color-paper-2); color: var(--color-ink); box-shadow: inset 0 1px 0 var(--color-sheet), 0 1px 1px var(--color-rule); } +.btn--primary { background: var(--color-accent); color: var(--color-accent-ink); border-color: color-mix(in oklab, var(--color-accent) 78%, var(--color-ink)); box-shadow: inset 0 1px 0 color-mix(in oklab, var(--color-sheet) 32%, transparent), inset 0 -1px 0 color-mix(in oklab, var(--color-ink) 10%, transparent); } +.btn:active { transform: translateY(1px); } +.ruled { border-top: var(--rule-hair) solid var(--color-ink); } .ruled > * { border-bottom: var(--rule-hair) solid var(--color-rule); } +.entry { border-radius: var(--radius-entry); background: var(--color-paper-2); box-shadow: 0 0 0 1px var(--color-ink), var(--shadow-lift); overflow: hidden; } +.notebook { background: linear-gradient(var(--color-grid) 1px, transparent 1px) 0 0 / 8px 8px, linear-gradient(90deg, var(--color-grid) 1px, transparent 1px) 0 0 / 8px 8px, var(--color-paper-2); } +.field label { position: absolute; left: var(--space-md); top: var(--space-xs); font-size: 0.75rem; font-weight: 500; color: var(--color-muted); } +.num { font-family: var(--font-outlier); font-variant-numeric: tabular-nums; } +``` diff --git a/skills/hallmark/references/themes/garden.jpg b/skills/hallmark/references/themes/garden.jpg new file mode 100644 index 0000000..2051ae5 Binary files /dev/null and b/skills/hallmark/references/themes/garden.jpg differ diff --git a/skills/hallmark/references/themes/garden.md b/skills/hallmark/references/themes/garden.md new file mode 100644 index 0000000..192c137 --- /dev/null +++ b/skills/hallmark/references/themes/garden.md @@ -0,0 +1,97 @@ +--- +name: Garden +slug: garden +genre: editorial +paper: light 95.8 90 +display: roman-serif Vollkorn +accent: chromatic-green 140 +posture: committed +keywords: farm, apiary, honey, cidery, orchard, pick your own, apples, seed, nursery, herbalist, botanical, tea, preserves, single-origin, seasonal, harvest, small-maker, csa, provenance, grown, field, homestead +material: warm oat paper, deep green ink, Vollkorn 600 with old-style figures over Hanken Grotesk, hairlines and soft moss or clay tints, daylight photographs in true colour, one leaf-green signal +photo: natural con=6 sat=-6 +pictured: Field Guide, Stage hero +--- + +# Garden + +A grower's voice: warm oat paper, a near-black green ink, Vollkorn heads and old-style figures over Hanken Grotesk, hairlines, soft moss and clay tints, the place photographed in daylight, one leaf-green signal. It feels honest and seasonal because every neutral leans green, the fruit keeps its real colour and nothing is boxed, glossy or grey. It is not a sage-and-slate wellness page and not a cream bookshop with a terracotta accent. + +## Tokens + +```css +:root { + --color-paper: oklch(95.8% 0.024 90); --color-paper-2: oklch(92.6% 0.030 90); --color-paper-3: oklch(89% 0.034 90); + --color-ink: oklch(23% 0.050 152); --color-ink-2: oklch(33% 0.048 150); --color-muted: oklch(46% 0.034 142); + --color-rule: oklch(83% 0.024 112); --color-rule-2: oklch(68% 0.042 138); + --color-accent: oklch(46% 0.135 142); --color-accent-2: oklch(86% 0.075 128); --color-accent-ink: oklch(97% 0.015 95); + --color-focus: oklch(46% 0.135 142); --tint-moss: oklch(46% 0.135 142 / 0.11); --tint-clay: oklch(54% 0.140 46 / 0.10); + --font-display: "Vollkorn", ui-serif, Georgia, serif; --font-body: "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif; + --font-outlier: "Newsreader", ui-serif, Georgia, serif; + --radius-card: 4px; --radius-pill: 999px; --rule-hair: 1px; --shadow-card: none; + --tracking-display: -0.012em; --display-weight: 600; +} +``` + +## Type + +- **Display:** Vollkorn 600, roman, sentence case, `--tracking-display`, line-height 1.04; one weight for every head, never italic. Sturdy without the 700's thickness, so a 52px head reads as set, not shouted. Its old-style figures are the theme's best numbers: an acreage or a count in Vollkorn at 160px and over, descending below the line, needs no other picture. +- **Body:** Hanken Grotesk 400 and 500 with `oldstyle-nums`; tables take lining tabular numerals, display figures keep Vollkorn's old-style ones. +- **Captions under a photograph (the outlier):** Newsreader 400 at the label size, sentence case, in `--color-muted`, one fact a line, like a nursery's label. Vollkorn never runs as body. +- **Labels, table heads, meta, lot codes, dates:** Hanken Grotesk 500 a step smaller, sentence case, untracked, `--color-muted`. No mono on the page. + +## Surfaces + +- Rules: 1px `--color-rule` hairlines part rows and sections; `--color-rule-2` tops a table or outlines a control. Radius 4px on wells and photographs, pills on controls. +- Depth is flat paper: no shadow, no drop-shadowed box; a well is `--color-paper-2` or a tint, never a bordered card. +- Bands: a full-bleed `--tint-moss` or `--tint-clay` wash, `--color-paper-2`, or the green ink with oat text, where `--color-accent-2` (pale leaf) takes the accent's place; never a solid leaf-green field. Two a page at most. +- Photographs: the place in its season, in daylight and true colour: fruit on the bough at arm's length, the rows seen from the grass, hands and baskets at the work, crates in the barn; soft overcast or low sun, the fruit never pushed past its real colour. 4px radius, a 1px `--color-rule` hairline, no shadow. A head sits on a photograph only over an ink scrim at 40 to 60%. +- Every neutral carries a green or oat cast (hue 90 to 152), never a pure grey. No texture. + +## Range + +- **Figures in old-style numerals:** the prompt's acreage, varieties or jars in Vollkorn 600 at 160px and over, three across on hairlines, a Hanken line beneath each. +- **The season as a ruled strip:** the twelve months in one hairline row, the open ones on the moss tint with what happens in them, the rest left as paper; under it the hours and the place as two-column rows. +- **A price list or produce list:** hairline rows on paper-2 or the green ink, the name in Vollkorn at item size, a Newsreader note, the price in lining figures at the right edge; a missing fact stays a labelled placeholder. +- **A statement on green ink:** one sentence in Vollkorn at section size and over in oat, the action in pale leaf beneath. + +## Controls + +- One flat leaf-green pill with `--color-accent-ink` text beside a hairline-outlined pill in `--color-rule-2`. +- Links in ink, underlined, the line turning leaf green on hover; inputs at 4px with a 1px `--color-muted` border on oat. +- Leaf green stays under 5% of a screen: the primary, a link's hover, the focus ring, one figure. Clay lives in its tint band only, never on a control, a nav or a head. + +## Motion + +State only, `--dur-short` on `--ease-out`: a pill darkens one step, an underline grows under a link. No reveal, no stagger, no parallax. + +## Voice + +Warm, honest, seasonal, unhurried. Say the field, the variety, the month, the acreage, the number of jars, only as the prompt gives them; never artisanal, curated or small-batch as a hollow badge. + +## Do-nots + +- Never grey-sage or slate paper; the ground is warm oat, hue 92. +- Never a cool teal or corporate emerald; the green is chlorophyll, hue 140. +- Never italic or faux-bold Vollkorn; load the real 600, and never mix it with 700 on one page. +- Never clay on a control or a head, and never a gradient on the leaf-green pill. +- Never produce styled on white or a staged picnic; the place is a working one. + +## Build hint + +```html + +``` + +```css +body { font-variant-numeric: oldstyle-nums; color: var(--color-ink-2); } +table, .num { font-variant-numeric: lining-nums tabular-nums; } +h1, h2, h3 { font-weight: var(--display-weight); color: var(--color-ink); } +.figure { font: 600 clamp(6rem, 12vw, 11rem)/0.86 var(--font-display); font-variant-numeric: oldstyle-nums proportional-nums; color: var(--color-ink); } +.btn { border-radius: var(--radius-pill); border: var(--rule-hair) solid var(--color-rule-2); padding: var(--space-sm) var(--space-lg); font-weight: 500; color: var(--color-ink); } +.btn--primary { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); } +.band--moss { background: var(--tint-moss); } +.photo img { border-radius: var(--radius-card); outline: var(--rule-hair) solid var(--color-rule); outline-offset: -1px; } +.photo figcaption { font: 400 var(--text-sm)/1.4 var(--font-outlier); color: var(--color-muted); } +a:hover { text-decoration-color: var(--color-accent); } +::selection { background: color-mix(in oklab, var(--color-accent) 22%, transparent); } +``` diff --git a/skills/hallmark/references/themes/grid.jpg b/skills/hallmark/references/themes/grid.jpg new file mode 100644 index 0000000..7b6e052 Binary files /dev/null and b/skills/hallmark/references/themes/grid.jpg differ diff --git a/skills/hallmark/references/themes/grid.md b/skills/hallmark/references/themes/grid.md new file mode 100644 index 0000000..9a6e36c --- /dev/null +++ b/skills/hallmark/references/themes/grid.md @@ -0,0 +1,101 @@ +--- +name: Grid +slug: grid +genre: editorial +paper: light 97.5 90 +display: grotesk-sans Radio Canada Big +accent: cool 266 +posture: full-palette +keywords: identity, brand system, wayfinding, signage, design studio, type specimen, editorial grid, institution, museum, archive, index, directory, systems, modular, swiss, grotesque, manual, programme, poster, collection +material: white poster stock, blue-black ink, Radio Canada Big 700 in sentence case over Radio Canada, flat fields of ultramarine and one Swiss red mark, no strokes +pictured: Poster Sequence, Poster hero +photo: duotone ink paper-2 con=12 +--- + +# Grid + +Swiss international style as it is practised now: a white sheet, a blue-black ink, one neo-grotesque in two optical cuts, and two flat colours with separate jobs, an ultramarine that floods fields and a Swiss red that marks the one chosen thing. Structure comes from the column system itself: type hung from column lines, fields that start and stop on them, jumps of three or four steps in scale and white held on purpose. No strokes part the sections and nothing is boxed; a page reads as a run of composed sheets. It is not a nostalgic poster pastiche, not a red-and-black template and not a minimal product page. + +## Tokens + +```css +:root { + --color-paper: oklch(97.5% 0.005 90); --color-paper-2: oklch(94.2% 0.006 90); --color-paper-3: oklch(90.5% 0.008 90); + --color-ink: oklch(19% 0.022 266); --color-ink-2: oklch(31% 0.02 266); --color-muted: oklch(47% 0.016 266); + --color-rule: oklch(87.5% 0.008 90); + --color-accent: oklch(44% 0.2 266); --color-accent-ink: oklch(97.5% 0.005 90); --color-focus: oklch(46% 0.2 266); + --color-field: oklch(44% 0.2 266); --color-field-ink: oklch(97.5% 0.005 90); + --color-mark: oklch(57% 0.215 29); --color-mark-ink: oklch(97.5% 0.005 90); + --font-display: "Radio Canada Big", ui-sans-serif, system-ui, sans-serif; --font-body: "Radio Canada", ui-sans-serif, system-ui, sans-serif; + --font-outlier: var(--font-display); + --radius-card: 0; --radius-pill: 0; --rule-hair: 1px; --shadow-card: none; + --tracking-display: -0.035em; --display-weight: 700; +} +``` + +Three roles and the paper, one job each. **Field**, the ultramarine: the flood a sheet is printed on, full width or from a column line to the bleed. **Mark**, the Swiss red: what is chosen or current (a letter, a year, a hovered link) and at most one red field a page. **Ink**: type on paper and the primary control. Red never sits on the ultramarine, and two fields never touch. + +## Type + +- **Display:** Radio Canada Big 700, sentence case (a capital first letter and proper nouns, nothing else), `--tracking-display`, line-height 0.9 at poster size, 1.0 at section size. Lines start on a column line, flush left, ragged right; never centred. One weight and one colour a head; a head that crosses from paper onto a field switches to field-ink at the field's edge, as an overprint would, the only change it may carry. +- **Poster scale:** a poster head sizes with the screen, `clamp(4.5rem, 10.2vw, 10rem)`, tracking -0.045em, held at 1920. Figures and index letters take the display cut and may run larger than any head beside them; a statement takes the display at 400. +- **Body:** Radio Canada 400 at 17px, line-height 1.5. Labels, field names, captions and nav links are Radio Canada 500 a step smaller, sentence case, untracked, `--color-muted` on paper and field-ink on a field. No mono, no capitals in a label. +- **Wordmark:** the name in two lines at one size, the first word in the display at 700, the second at 400, leading 0.92; it may hang beside a square of the mark red exactly two lines tall. + +## Surfaces + +- No strokes: sections part by space, a change of paper or a field, never a rule. The only lines are 1px hairlines between table rows and under an input. +- Radius 0 and no shadow anywhere; depth is scale and colour. A well is `--color-paper-2` with no border. +- Fields: a page takes two or three, one of them may be the red; each runs edge to edge or from a column line off the page, and abuts white. +- Photographs: objective and frontal in even light, of print and its tools (type, presses, sheets, drawers), printing in the blue-black on `--color-paper-2` (the `photo:` duotone), so the frame is a step of tone, never a line. Square, both edges on column lines; never type over a picture. +- Texture: none. The white is the material. + +## Range + +- **The overprint sheet:** a head at poster scale hung from column 1 and running across a field that starts on a later column line, its letters turning field-ink where they cross, one real figure set large at the field's foot. +- **The index as a specimen:** letters, decades or names at display size as a ragged line of buttons, the chosen one in the mark red and repeated at full height beside the line as the figure. +- **A field that holds a control:** a range, a choice or a set of inputs on the ultramarine or the red, the value set at poster scale in field-ink and changing as it moves; inputs on a field are type at `--text-3xl` over a hairline. +- **A statement hung asymmetric:** one sentence at statement size from column 3 or 4, the columns to its left white, its key nouns as links. + +## Controls + +- Primary: a square block of ink with paper text, 52px tall, the same on paper and on either field. Secondary: text with a 1px underline that turns mark red on hover. +- Inputs: square, no box; a 1px line beneath in `--color-muted` on paper, field-ink at 60% on a field. The focus ring is 2px `--color-focus`, field-ink on the ultramarine and ink on the red. +- `::selection` is the mark red with paper text. Otherwise red marks only a chosen value, a hover and its one field. + +## Motion + +State only, `--dur-short` on `--ease-out`: a letter or link turns red, a value at poster scale swaps in place. No scroll reveals, no parallax. + +## Voice + +Exact and plain, sentence case: name the record, the field, the year and the press in the order a catalogue lists them, and leave the adjectives out. + +## Do-nots + +- Never a rule above a section, a black stroke round a control or a boxed card. +- Never red on the ultramarine, never two fields touching, never a second blue. +- Never a lowercase or an all-capitals head. +- Never a photograph in colour, toned in a field colour, framed, or under type. +- Never a centred head or a centred block of text. + +## Build hint + +```html + +``` + +```css +h1, h2, h3 { font-weight: var(--display-weight); line-height: 1; text-align: start; } +.btn { min-height: 52px; padding-inline: var(--space-lg); border: 0; border-radius: 0; font-weight: 500; transition: background-color var(--dur-short) var(--ease-out); } +.btn--primary { background: var(--color-ink); color: var(--color-paper); } +.btn--primary:hover { background: var(--color-ink-2); } +.btn--secondary { background: none; color: currentColor; text-decoration: underline var(--rule-hair); text-underline-offset: 0.32em; } +.btn--secondary:hover { color: var(--color-mark); } +.field { background: var(--color-field); color: var(--color-field-ink); --color-focus: var(--color-field-ink); } +.field--mark { background: var(--color-mark); color: var(--color-mark-ink); --color-focus: var(--color-ink); } +.overprint { color: var(--color-field-ink); clip-path: inset(0 0 0 calc(7 * (100% + var(--gap-columns)) / 12 - var(--gap-columns))); } +.wordmark { display: inline-grid; grid-template-columns: auto auto; column-gap: var(--space-sm); font: var(--display-weight) var(--text-md)/0.92 var(--font-display); } +.wordmark::before { content: ""; grid-row: span 2; aspect-ratio: 1; background: var(--color-mark); } +::selection { background: var(--color-mark); color: var(--color-mark-ink); } +``` diff --git a/skills/hallmark/references/themes/halftone.jpg b/skills/hallmark/references/themes/halftone.jpg new file mode 100644 index 0000000..5c3e984 Binary files /dev/null and b/skills/hallmark/references/themes/halftone.jpg differ diff --git a/skills/hallmark/references/themes/halftone.md b/skills/hallmark/references/themes/halftone.md new file mode 100644 index 0000000..023b3ff --- /dev/null +++ b/skills/hallmark/references/themes/halftone.md @@ -0,0 +1,106 @@ +--- +name: Halftone +slug: halftone +genre: playful +paper: light 96.2 94 +display: slab-serif Ultra +accent: warm 33 +posture: committed +keywords: drinks, soda, food brand, print shop, zine, magazine, record label, packaging, campaign, label, bottle, can, screen print, bold, one colour, retail, craft, loud, fruit, snack +material: butter-cream stock, brown-black ink, Ultra over Chivo, three-pixel ink rules and square wells, one vermilion printed solid and through a dot screen, photographs in full colour +photo: natural vib=25 sat=10 con=6 +pictured: Back of the Can, Settled hero +--- + +# Halftone + +A loud one-colour print voice: butter-cream stock, brown-black ink, a fat Ultra slab for heads, Chivo for everything else, 3px ink rules and one vermilion that prints solid on controls and as a dot screen on a band or a well. Photographs are the only full colour, close and bright like a label's product shot. It feels screen-printed because there is one ink and its dots fade from solid to nothing, not because anything is drawn. It is not a comic-book pop-art page and not a pastel snack brand. + +## Tokens + +```css +:root { + --color-paper: oklch(96.2% 0.032 94); --color-paper-2: oklch(92.6% 0.046 92); --color-paper-3: oklch(87.5% 0.058 90); + --color-ink: oklch(23% 0.040 38); --color-ink-2: oklch(33% 0.045 40); --color-muted: oklch(44% 0.048 44); + --color-rule: oklch(82% 0.042 82); + --color-accent: oklch(54.5% 0.215 33); --color-accent-deep: oklch(46% 0.19 31); --color-accent-ink: oklch(97% 0.022 94); --color-focus: oklch(46% 0.19 31); + --color-dot: var(--color-accent); --halftone-size: 12px; --halftone-dot: 3px; + --font-display: "Ultra", ui-serif, Georgia, serif; --font-body: "Chivo", ui-sans-serif, sans-serif; + --radius-card: 0; --radius-input: 3px; --radius-pill: 999px; --rule-hair: 1px; --rule-bar: 3px; + --shadow-card: none; + --tracking-display: 0.005em; --display-weight: 400; +} +``` + +Committed: the spot carries the screen, the controls and a field band. Three stocks, stated in the stamp (`halftone: cream`). + +| Stock | Paper and ink | The spot | +| --- | --- | --- | +| **Cream and vermilion** (default) | the tokens above | `oklch(54.5% 0.215 33)` | +| **Lemon on black** | `oklch(19% 0.01 60)` under `oklch(96% 0.02 90)` | yellow `oklch(88% 0.17 95)` with dark ink on it | +| **Blood orange** | the colour goes into the stock: `oklch(72% 0.17 45)` under plum `oklch(24% 0.06 25)` | the plum ink is also the spot, so the dots print dark | + +## Type + +- **Display:** Ultra 400, its only weight, roman, sentence case, line-height 1.08 (Ultra's descenders touch the next line any tighter), `--tracking-display`; one colour per head. Ultra's figures are its loudest letters: a number at 200px and over may print solid in the spot, tracked -0.02em, line-height 0.9 when it stands alone on its line. +- **Body:** Chivo 400, 17px, line-height 1.55, in `--color-ink-2`; Chivo 700 on controls and on the names in a label panel. +- **Labels, tags, table heads, captions:** Chivo 500 a step smaller, sentence case, untracked; the 3px rules give them authority. No mono. + +## Surfaces + +- Rules do the work of borders: `--rule-bar` in ink across the top of a section, a table or a list, `--rule-hair` in `--color-rule` between rows. +- A well is the one boxed surface: `--color-paper-2` inside a `--rule-bar` ink border, square, with nothing boxed inside it. No shadow anywhere. +- Radii: 3px on buttons and inputs, a full pill on a chip; wells, tags and photographs are square. +- Bands: `--color-paper-2`, a spot field with cream type knocked out of it, or `--color-ink` with cream text. Two a page at most. `--color-accent-deep` is the spot pressed: hover, the focus ring and any spot type under 24px. +- Photographs: the product and what goes into it, close and bright (a cut lemon, a knuckle of ginger, bubbles in a glass), hard daylight on a plain light ground. The page's only full colour; square, a 1px ink hairline, a caption beneath naming what is in it. The spot never tints a picture. +- The screen (`texture.md` § Halftone): a `--halftone-dot` dot on a `--halftone-size` cell in the spot, masked to fade from solid to nothing, on a band or a well; one screened field per section, never under or across type or a photograph. + +## Range + +- **A figure as a poster:** one real number (the calories, the size, the price) in Ultra at 240px and over, solid spot on the cream, its unit and its one line in Ultra ink at section size beside it. +- **The label as a panel:** a 3px ink rule over full-width rows, the name in Chivo 700, the value in Ultra at item size, hairlines between, the way a can's back reads; never shrunk into a box. +- **The order on the spot:** a spot band with a cream knockout head, a stepper and its running total in Ultra, the screen fading in from one edge behind the empty side. +- **A statement knocked out:** one blunt sentence in Ultra at display size, cream out of the ink or the spot, nothing else on the field but its links. + +## Controls + +- A spot-filled button in Chivo 700 at 3px beside a plain `--rule-bar` spot underline with no box. +- Links in ink with a spot underline; inputs at 3px, 1px ink border. +- The spot sits on controls, the screen, a field band and the focus ring; never on body type. + +## Motion + +State only, `--dur-short` on `--ease-out`: a button darkens one step. The screen never moves. + +## Voice + +The label: the fruit, the calories, the size of the can, the price of the box. Blunt, sweet and specific; never a lifestyle. + +## Do-nots + +- Never a second ink; one spot does dots, buttons and fields, and a blue link on the cream is a different printer. +- Never a gradient that is not dots; a fade is a screen from solid to nothing. +- Never dots under or across type or a photograph. +- Never a synthesised bold Ultra, a soft shadow or a rounded well. +- Never spot type smaller than a section head on the cream; it prints weak, so small spot type takes the deep spot. + +## Build hint + +```html + +``` + +```css +h1, h2, h3 { font-weight: var(--display-weight); line-height: 1.08; } +.poster { font: 400 clamp(10rem, 22vw, 20rem)/0.9 var(--font-display); letter-spacing: -0.02em; color: var(--color-accent); font-variant-numeric: tabular-nums; } +.btn { padding: var(--space-md) var(--space-lg); border-radius: var(--radius-input); font: 700 var(--text-sm) var(--font-body); background: var(--color-accent); color: var(--color-accent-ink); } +.btn--secondary { background: none; color: var(--color-ink); padding: var(--space-md) 0 var(--space-xs); border-radius: 0; border-bottom: var(--rule-bar) solid var(--color-accent); } +.well { border: var(--rule-bar) solid var(--color-ink); background: var(--color-paper-2); } +.ruled { border-top: var(--rule-bar) solid var(--color-ink); } .ruled > * { border-bottom: var(--rule-hair) solid var(--color-rule); } +.photo { outline: var(--rule-hair) solid var(--color-ink); outline-offset: calc(-1 * var(--rule-hair)); } +.halftone { position: relative; isolation: isolate; } +.halftone::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; + background: radial-gradient(var(--color-dot) var(--halftone-dot), transparent calc(var(--halftone-dot) + 0.5px)) 0 0 / var(--halftone-size) var(--halftone-size); + mask: linear-gradient(110deg, transparent 45%, var(--color-ink) 95%); } +::selection { background: color-mix(in oklab, var(--color-accent) 30%, transparent); } +``` diff --git a/skills/hallmark/references/themes/hedgerow.jpg b/skills/hallmark/references/themes/hedgerow.jpg new file mode 100644 index 0000000..29962fc Binary files /dev/null and b/skills/hallmark/references/themes/hedgerow.jpg differ diff --git a/skills/hallmark/references/themes/hedgerow.md b/skills/hallmark/references/themes/hedgerow.md new file mode 100644 index 0000000..d6de400 --- /dev/null +++ b/skills/hallmark/references/themes/hedgerow.md @@ -0,0 +1,104 @@ +--- +name: Hedgerow +slug: hedgerow +genre: editorial +paper: dark 24 158 +display: high-contrast-serif Prata +accent: chromatic-green 118 +posture: drenched +keywords: distillery, gin, brewery, forager, botanicals, nature reserve, walking, trail, seeds, plants, nursery, hedge, countryside, field guide, provenance, harvest, batch, seasonal, map, miles +material: deep leaf-green paper, cream ink, Prata heads over Manrope, low-key photographs in true colour, square flat surfaces with pill controls, one chartreuse signal with a moss strength for cream +photo: natural sat=-10 con=8 exp=-8 +pictured: Field Guide, Poster hero +--- + +# Hedgerow + +A dark page that reads as green, not night: a deep leaf-green ground, cream ink, Prata's sharp high-contrast names over a quiet Manrope, plants photographed close in shade, and one chartreuse that marks the controls and the few lines the page draws. It feels botanical, exact and fresh, like a field guide opened on a bench. It is not black luxury with a gold accent, and not a rustic kraft-paper page. + +## Tokens + +```css +:root { + --color-paper: oklch(24% 0.052 158); --color-paper-2: oklch(19.5% 0.045 158); --color-paper-3: oklch(29.5% 0.05 158); + --color-ink: oklch(93% 0.022 88); --color-ink-2: oklch(81% 0.035 150); --color-muted: oklch(69% 0.045 150); + --color-rule: oklch(35% 0.05 158); + --color-accent: oklch(87% 0.19 118); --color-accent-2: oklch(92% 0.13 118); --color-accent-deep: oklch(46% 0.12 128); --color-accent-ink: oklch(22% 0.05 158); --color-focus: oklch(92% 0.13 118); + --font-display: "Prata", Georgia, serif; --font-body: "Manrope", ui-sans-serif, system-ui, sans-serif; + --font-outlier: "IBM Plex Mono", ui-monospace, monospace; + --radius-card: 0; --radius-pill: 999px; --rule-hair: 1px; + --shadow-card: none; + --tracking-display: -0.005em; --display-weight: 400; +} +``` + +One dial, the colourway, stated in the stamp (`hedgerow: hedge`). `--color-accent-deep` is the moss strength of the signal: it takes the chartreuse's place on the cream band, where chartreuse vanishes. + +| Colourway | Ground | Ink | Accent | +| --- | --- | --- | --- | +| `hedge` (default) | oklch(24% 0.052 158) | cream oklch(93% 0.022 88) | chartreuse oklch(87% 0.19 118) | +| `sloe` | plum oklch(25% 0.06 320) | oklch(94% 0.02 80) | straw oklch(88% 0.15 95) | + +## Type + +- **Display:** Prata 400, its only weight, `font-synthesis: none`; line-height 1.08, sentence case, roman. Item titles take Prata too, never under 22px, where its hairlines thin out. Figures at statement size are Prata, lining. +- **Body:** Manrope 400 at 17px, line-height 1.6, in `--color-ink-2`; 500 for labels, 700 only on controls. +- **Labels, captions, table heads:** Manrope 500 a step smaller, sentence case, untracked, `--color-muted`. A plant's Latin name sits beside its common one in this style, roman. IBM Plex Mono only inside code. + +## Surfaces + +- 1px rules: `--color-rule` between rows, `--color-muted` where two sections part, a 1.5px chartreuse rule heading the one list that matters most. +- Square and flat: radius 0 on wells, photographs and inputs; no shadow, no blur, no gradient but a photograph's scrim. Depth is a paper step: a well in `--color-paper-3`, a band in `--color-paper-2`. +- Bands: a `--color-paper-2` band, and one cream band (`--color-ink` ground, `--color-paper` text, moss line work, hedge-green controls) for the densest section. Two a page at most. +- Photographs: plants as a forager meets them, close and low-key: one plant at arm's length in shade, a hedge along a lane, the land at first light, the still, a glass on a dark bench. Square, a 1px cream ring at 8%, colour kept true, never toned green. A caption names the plant under the frame; type on a photograph only over a hedge-green scrim at 45 to 70%. +- Line work only for a chart or a map of real places, 1.2px chartreuse strokes, unfilled. No texture. + +## Range + +- **Index as a field guide:** Rows with the common name in Prata at `--text-2xl` or larger, the Latin name in the label style, then one line, under the chartreuse rule; the plants carry a section with no picture. +- **Figures as a bottle label:** the batch, the count, the price, the distance in Prata at `--text-display-s` and up, parted by `--color-rule` verticals on a `--color-paper-2` band; one figure in chartreuse. +- **Statement in cream:** one Prata sentence at display size on the green, or the cream band holding a working control (a quantity and its running total in Prata) with moss rules. +- **Table as a still log:** batch, date bottled, count and price as ruled rows, numerals tabular, the current row's rule chartreuse. + +## Controls + +- The pair: a chartreuse pill in Manrope 700 with `--color-accent-ink` text beside a pill outlined in 1.5px chartreuse. The primary lightens to `--color-accent-2` on hover. On the cream band both turn hedge green. +- Links are cream with a 1px chartreuse underline; inputs are square, a 1px `--color-muted` border on `--color-paper-2`, the ring in `--color-focus`. + +## Motion + +Still. State only, over `--dur-short` on `--ease-out`: the primary lightens, an underline thickens, a row's rule turns chartreuse. No growth, no drift, no scroll reveal. + +## Voice + +A field guide's: the plant and where it grows, then how far and when, only where the prompt knows; never invent a distance or a month. Provenance as a sentence, never a badge. + +## Do-nots + +- Never a second accent; sold out is muted, not red. +- Never a black or blue-black ground; the dark is leaf green, or plum on `sloe`. +- Never a bright, high-key photograph: a berry on white or a sunny meadow reads as a hole in the green. +- Never chartreuse running text, a chartreuse band, or chartreuse on cream. + +## Build hint + +```html + +``` + +```css +h1, h2, h3 { font-weight: 400; line-height: 1.08; font-synthesis: none; } +.btn { border: 1.5px solid var(--color-accent); border-radius: var(--radius-pill); padding: var(--space-sm) var(--space-lg); font-size: var(--text-sm); font-weight: 700; transition: background-color var(--dur-short) var(--ease-out); } +.btn--primary { background: var(--color-accent); color: var(--color-accent-ink); } +.btn--primary:hover { background: var(--color-accent-2); border-color: var(--color-accent-2); } +.btn--secondary { background: transparent; color: var(--color-accent); } +.band--cream { background: var(--color-ink); color: var(--color-paper); --color-rule: color-mix(in oklab, var(--color-paper) 22%, var(--color-ink)); } +.band--cream .btn { border-color: var(--color-paper); color: var(--color-paper); } +.band--cream .btn--primary { background: var(--color-paper); color: var(--color-ink); } +.band--cream .figure { color: var(--color-accent-deep); } +.index { border-top: 1.5px solid var(--color-accent); } +.index > li { border-bottom: var(--rule-hair) solid var(--color-rule); } +.photo img { outline: var(--rule-hair) solid color-mix(in oklab, var(--color-ink) 8%, transparent); outline-offset: -1px; } +.figure { font-family: var(--font-display); font-variant-numeric: lining-nums tabular-nums; } +a { text-decoration-color: var(--color-accent); } +``` diff --git a/skills/hallmark/references/themes/hum.jpg b/skills/hallmark/references/themes/hum.jpg new file mode 100644 index 0000000..8dde379 Binary files /dev/null and b/skills/hallmark/references/themes/hum.jpg differ diff --git a/skills/hallmark/references/themes/hum.md b/skills/hallmark/references/themes/hum.md new file mode 100644 index 0000000..db8759b --- /dev/null +++ b/skills/hallmark/references/themes/hum.md @@ -0,0 +1,99 @@ +--- +name: Hum +slug: hum +genre: playful +paper: light 97 95 +display: rounded-sans Chillax +accent: chromatic-yellow 95 +posture: full-palette +keywords: daily, habit, streak, practice, learning, reading, curiosity, mood, energy, friendship, community, kids, family, parents, school, game, puzzle, creative, playful, alive +material: grained cream paper pulled toward pear-yellow, torn paper edges with a pale fibre core, card-stock controls that press down, blue-black ink, Chillax throughout, three accents that never blend and a mint for growth +photo: natural vib=12 exp=4 +pictured: Workbench, Settled hero +--- + +# Hum + +Cut paper made by hand, cheerful without turning childish: cream paper with a visible grain and fibre, sheets torn along their edges so a pale core shows, card stock you can press, all lit from the top left. Chillax runs from head to label (its single-storey a and g read like an early reader's page) in a blue-black ink. Three accents never blend: pear for the action, blue for links, coral for one loud moment; mint is growth. Not a pastel nursery template, not a rainbow page, not clip-art. + +## Tokens + +```css +:root { + --color-paper: oklch(97% 0.012 95); --color-paper-2: oklch(94.5% 0.018 95); --color-paper-3: oklch(91% 0.022 95); + --color-ink: oklch(20% 0.014 255); --color-ink-2: oklch(29% 0.014 255); --color-muted: oklch(47% 0.014 255); + --color-rule: oklch(87% 0.016 95); + --color-accent: oklch(87% 0.175 96); --color-accent-deep: oklch(72% 0.16 92); --color-accent-ink: oklch(20% 0.014 255); + --color-accent-2: oklch(50% 0.17 250); --color-accent-3: oklch(70% 0.2 22); + --color-mint: oklch(82% 0.15 152); --color-mint-deep: oklch(48% 0.12 155); --color-focus: oklch(50% 0.17 250); + --color-card: oklch(98.8% 0.007 95); --color-edge: oklch(83% 0.04 88); --color-fringe: oklch(99.2% 0.006 95); + --color-kraft: oklch(63% 0.085 62); --color-sand: oklch(77% 0.1 76); --color-sugar: oklch(89% 0.035 236); + --color-hill-1: oklch(94.5% 0.03 118); --color-hill-2: oklch(91.5% 0.045 135); --color-leaf: oklch(64% 0.15 150); + --font-display: "Chillax", ui-rounded, ui-sans-serif, sans-serif; --font-body: var(--font-display); + --font-outlier: "Geist Mono", ui-monospace, monospace; + --radius-card: 24px; --radius-stock: 16px; --radius-input: 14px; --radius-pill: 999px; --rule-hair: 1px; + --shadow-card: 0 1px 2px oklch(20% 0.014 255 / 0.06), 0 12px 28px -14px oklch(20% 0.014 255 / 0.22); + --shadow-paper: drop-shadow(0 0 0.6px oklch(20% 0.014 255 / 0.32)) drop-shadow(1.5px 2.5px 1.5px oklch(20% 0.014 255 / 0.1)) drop-shadow(6px 14px 16px oklch(20% 0.014 255 / 0.13)); + --tracking-display: -0.03em; --display-weight: 600; + --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1); --ease-snap: cubic-bezier(0.22, 1, 0.36, 1); +} +``` + +## Type + +- **Display:** Chillax 600, `--tracking-display`, line-height 1.02 to 1.05, sentence case. Figures at `--text-display` or larger, their unit at `--text-title`. +- **Body:** Chillax 500 at 17 to 19px, line-height 1.5; emphasis is a pear highlighter band behind the words, never inside a head. Two weights, 500 and 600. +- **Labels, captions, units:** Chillax 500 a step smaller, sentence case, `--color-muted`. Geist Mono only inside code. + +## Surfaces + +- The paper is generated, never a picture: two `feTurbulence` data URIs, a fine fractal grain (`--grain`) and a long turbulence fibre (`--fibre`), under every paper, card and accent fill. +- Torn edges: a band, a nav bar, a photograph or a sheet ends in a `clip-path` polygon from seeded value noise, its fibre twin (`--color-fringe`) standing a pixel proud beneath. Grounds may layer: far hills in `--color-hill-*`, soil in `--color-leaf`, a kraft strip, a blue sugar-paper mat. +- Light comes from the top left: stacked `--shadow-paper` drop shadows fall down and right on every cut sheet; a card may lift one corner in a page curl. +- Round everywhere: 24px surfaces (28 to 32px for children), 16px card stock, no square corner. +- Bands: paper-2, a torn ink sheet with paper text, or one pear field. Two a page at most. +- Photographs: bright daylight at a child's height, never a face to camera; torn on one edge, one or two a page. + +## Range + +- **The product as card stock:** the app's own moment built large, words as card-stock tiles on a torn kraft strip, each pressed one popping into its accent. +- **Growth set in type:** a bed of plants made of Chillax glyphs (stems of l, bracket leaves, letter heads) on torn soil, filling as the prompt's numbers say, shown in states a row of pills switches. +- **Figures on the pear field:** three or four of the prompt's numbers at display size in ink on one pear sheet, each unit beneath in 500. +- **A choice as card-stock pills:** a working control on the prompt's facts, the result a sentence with its key value in a pear highlighter band. + +## Controls + +- Card stock: 54px controls at `--radius-stock`, grain and fibre on the fill, an inset highlight on top and a solid 5px edge below (`--color-accent-deep` on the pear primary, `--color-edge` on the secondary card); hover raises the edge to 7px, active presses it to 1px. The spring runs on the primary only. +- Each accent owns a job: pear the primary and the one pear field; blue links and the focus ring; coral one loud fill; mint growth. A chosen pill is ink with paper type. One die-cut sticker may carry the offer. +- Inputs: 14px radius, 52px tall, a 1px `--color-muted` border, the blue focus ring. + +## Motion + +Spring posture declared (gate 12): `--ease-spring` on the primary control only; everything else on `--ease-snap`, never `scale()`. A word pops in its accent and its plant grows; a timer may tear off a scrap of paper as it runs, paused off screen. Reduced motion or no script: the end state. + +## Voice + +Warm, smart, casual, direct, written to the grown-up beside the child. Sentence case, verbs over nouns, honest numbers only. + +## Do-nots + +- Never a serif, never pure white paper, never a square corner. +- Never a clean vector edge on a cut sheet or a shadow that falls up or left. +- Never a gradient between two accents and never a rainbow ground. +- Never emoji, stock icons or a drawn character; type, paper and the product carry it. + +## Build hint + +```html + +``` + +```css +h1, h2, h3 { font-weight: var(--display-weight); } +.btn { --edge: 5px; border: 0; border-radius: var(--radius-stock); min-height: 54px; padding: 0 var(--space-lg); font-weight: 600; background: var(--grain), var(--fibre), var(--color-card); box-shadow: inset 0 0 0 1px var(--color-rule), 0 var(--edge) 0 0 var(--color-edge); transition: translate var(--dur-micro) var(--ease-snap), box-shadow var(--dur-micro) var(--ease-snap); } +.btn--primary { background: var(--grain), var(--fibre), var(--color-accent); color: var(--color-accent-ink); box-shadow: 0 var(--edge) 0 0 var(--color-accent-deep), 2px calc(var(--edge) + 4px) 10px -3px color-mix(in oklab, var(--color-ink) 32%, transparent); transition-timing-function: var(--ease-spring); } +.btn:hover { --edge: 7px; translate: 0 -2px; } .btn:active { --edge: 1px; translate: 0 4px; } +.sheet { position: absolute; filter: var(--shadow-paper); } .sheet > i { position: absolute; inset: 0; background: var(--grain), var(--fibre), var(--sheet-c, var(--color-paper-3)); } +mark { background: color-mix(in oklab, var(--color-accent) 55%, transparent); color: inherit; box-decoration-break: clone; } +a { color: var(--color-accent-2); } +``` diff --git a/skills/hallmark/references/themes/index.json b/skills/hallmark/references/themes/index.json new file mode 100644 index 0000000..e24a4e0 --- /dev/null +++ b/skills/hallmark/references/themes/index.json @@ -0,0 +1,2288 @@ +{ + "themes": [ + { + "name": "Almanac", + "slug": "almanac", + "genre": "editorial", + "posture": "restrained", + "paper": { + "band": "mid", + "L": 84, + "hue": 245 + }, + "display": { + "class": "grotesk-sans", + "face": "Hanken Grotesk" + }, + "accent": { + "band": "chromatic-magenta", + "hue": 350 + }, + "keywords": [ + "almanac", + "yearbook", + "field guide", + "reference", + "handbook", + "manual", + "index", + "catalogue", + "encyclopedia", + "data", + "figures", + "tables", + "statistics", + "research", + "dataset", + "records", + "directory", + "glossary", + "specifications" + ], + "material": "cool slate stock with a pale printed sheet, blue-black ink, Hanken Grotesk heads over Newsreader prose with mono figures, two rule weights and square corners, one chart magenta", + "file": "references/themes/almanac.md", + "photo": "muted", + "pictured": "Workbench, Stage hero", + "picture": "references/themes/almanac.jpg" + }, + { + "name": "Arcade", + "slug": "arcade", + "genre": "playful", + "posture": "full-palette", + "paper": { + "band": "dark", + "L": 14, + "hue": 312 + }, + "display": { + "class": "pixel", + "face": "Silkscreen and Bungee" + }, + "accent": { + "band": "chromatic-ember", + "hue": 40 + }, + "keywords": [ + "game", + "indie", + "game studio", + "launch party", + "demo night", + "hackathon", + "festival", + "meetup", + "retro", + "pixel", + "arcade", + "nostalgia", + "synth", + "lo-fi", + "toy", + "zine", + "club night", + "loud" + ], + "material": "aubergine CRT ground, lilac-white ink, Bungee capitals split in RGB over Chivo, Silkscreen figures, hard offset shadows, ember and acid signals", + "file": "references/themes/arcade.md", + "photo": "tint accent", + "pictured": "Marquee Hero, Stage hero", + "picture": "references/themes/arcade.jpg" + }, + { + "name": "Atelier", + "slug": "atelier", + "genre": "editorial", + "posture": "restrained", + "paper": { + "band": "light", + "L": 94.5, + "hue": 76 + }, + "display": { + "class": "roman-serif", + "face": "Sentient" + }, + "accent": { + "band": "cool", + "hue": 248 + }, + "keywords": [ + "fashion", + "atelier", + "couture", + "fragrance", + "gallery", + "exhibition", + "museum", + "ceramics", + "furniture", + "homeware", + "architecture", + "design studio", + "lookbook", + "collection", + "craft", + "small-batch", + "made by hand", + "brand story", + "luxury", + "object", + "hotel", + "boutique hotel", + "hospitality", + "stay" + ], + "material": "limewash paper under a slow luminous air, deep umber ink, Sentient light over Hanken Grotesk, cotton card stock with fibre and pressed type, hairlines, matted prints in warm daylight, one cool slate signal", + "file": "references/themes/atelier.md", + "photo": "warm con=-6 vib=-10", + "pictured": "Gallery Hang, Diffusion hero", + "picture": "references/themes/atelier.jpg" + }, + { + "name": "Bloom", + "slug": "bloom", + "genre": "atmospheric", + "posture": "committed", + "paper": { + "band": "light", + "L": 97, + "hue": 72 + }, + "display": { + "class": "grotesk-sans", + "face": "Ranade" + }, + "accent": { + "band": "warm", + "hue": 36 + }, + "keywords": [ + "generative", + "ai creative", + "music", + "song", + "video", + "image", + "voice", + "art", + "make", + "create", + "compose", + "render", + "imagine", + "prompt", + "creative studio", + "playground", + "expressive", + "warm", + "daylight", + "consumer creative", + "portrait", + "headshot", + "selfie", + "retouch" + ], + "material": "warm off-white paper with grain and a generated working grid, two quiet terracotta blooms, warm umber ink, Ranade with one roman Gambarino figure, rubber and cased parts lit from above, part tones on rounded clips", + "file": "references/themes/bloom.md", + "photo": "warm exp=4", + "pictured": "Workbench, Stage hero", + "picture": "references/themes/bloom.jpg" + }, + { + "name": "Blueprint", + "slug": "blueprint", + "genre": "modern-minimal", + "posture": "drenched", + "paper": { + "band": "mid", + "L": 35, + "hue": 256 + }, + "display": { + "class": "geometric-sans", + "face": "Chakra Petch" + }, + "accent": { + "band": "neutral", + "hue": 240 + }, + "keywords": [ + "architecture", + "architect", + "engineering", + "construction", + "structural", + "interiors", + "planning", + "surveying", + "cad", + "drafting", + "fabrication", + "prefab", + "developer", + "technical", + "spec", + "permit", + "renovation", + "build", + "drawings", + "architecture studio", + "timber" + ], + "material": "prussian-blue sheet, white line ink, Chakra Petch capitals over IBM Plex Sans with mono measurements, square double keylines and dimension strings, photographs printed as cyanotypes, the white line as the only signal", + "file": "references/themes/blueprint.md", + "photo": "duotone paper-3 ink con=30 exp=-10", + "pictured": "Bento Grid, Poster hero", + "picture": "references/themes/blueprint.jpg" + }, + { + "name": "Broadside", + "slug": "broadside", + "genre": "editorial", + "posture": "committed", + "paper": { + "band": "light", + "L": 92, + "hue": 88 + }, + "display": { + "class": "display-condensed", + "face": "Six Caps" + }, + "accent": { + "band": "warm", + "hue": 33 + }, + "keywords": [ + "auction", + "sale", + "market", + "fair", + "event", + "one night", + "announcement", + "town", + "notice", + "poster", + "bill", + "lots", + "machinery", + "tools", + "festival", + "fete", + "hammer", + "date", + "venue", + "tickets" + ], + "material": "grained buff stock, near-black ink, Six Caps and Bevan wood capitals over Archivo Narrow, ink rules at one point or five, one vermilion", + "file": "references/themes/broadside.md", + "photo": "duotone ink paper con=20", + "pictured": "Marquee Hero, Settled hero", + "picture": "references/themes/broadside.jpg" + }, + { + "name": "Brutal", + "slug": "brutal", + "genre": "editorial", + "posture": "committed", + "paper": { + "band": "light", + "L": 97.5, + "hue": 95 + }, + "display": { + "class": "grotesk-heavy", + "face": "Libre Franklin" + }, + "accent": { + "band": "chromatic-yellow", + "hue": 105 + }, + "keywords": [ + "brutalist", + "raw", + "bold", + "high-contrast", + "statement", + "agency", + "design studio", + "portfolio", + "streetwear", + "drop", + "zine", + "type-forward", + "graphic design", + "poster", + "festival", + "collective", + "no-nonsense", + "uncompromising" + ], + "material": "near-white poster stock, near-black ink as 3px rules, boxed cells and solid fills, uppercase Libre Franklin 900 over its 400, zero radius, one acid-yellow fill", + "file": "references/themes/brutal.md", + "photo": "duotone ink paper con=24", + "pictured": "Marquee Hero, Poster hero", + "picture": "references/themes/brutal.jpg" + }, + { + "name": "Carnival", + "slug": "carnival", + "genre": "editorial", + "posture": "full-palette", + "paper": { + "band": "light", + "L": 92, + "hue": 50 + }, + "display": { + "class": "display-heavy", + "face": "Big Shoulders Display" + }, + "accent": { + "band": "chromatic-yellow", + "hue": 95 + }, + "keywords": [ + "record label", + "podcast", + "comedy", + "indie", + "zine", + "poster", + "illustrator", + "games", + "hot sauce", + "merch", + "streetwear", + "cassette", + "vinyl", + "live show", + "festival", + "loud", + "maximalist", + "scrappy" + ], + "material": "tinted paper, deep warm ink, Big Shoulders Display 800 capitals set poster-large over Golos Text, 2px rules, a hard 4px ink shadow, two accents that compete as whole fields", + "file": "references/themes/carnival.md", + "photo": "natural vib=20 con=10", + "pictured": "Label and Ledger, Stage hero", + "picture": "references/themes/carnival.jpg" + }, + { + "name": "Cobalt", + "slug": "cobalt", + "genre": "modern-minimal", + "posture": "restrained", + "paper": { + "band": "light", + "L": 98.5, + "hue": 250 + }, + "display": { + "class": "grotesk-sans", + "face": "Familjen Grotesk" + }, + "accent": { + "band": "cool", + "hue": 256 + }, + "keywords": [ + "api", + "sdk", + "cli", + "dev tool", + "developer platform", + "docs", + "documentation", + "infrastructure", + "backend", + "database", + "observability", + "webhooks", + "events", + "type-safe", + "open source", + "ship", + "deploy", + "developer experience", + "technical" + ], + "material": "cool near-white paper, blue-grey ink and hairlines, Familjen Grotesk over IBM Plex Sans, a generated ASCII field on an 8 by 16 cell, keycaps and cut-corner panels, JetBrains Mono on graphite, one electric cobalt signal", + "file": "references/themes/cobalt.md", + "photo": "duotone graphite paper", + "pictured": "Feature Ledger, Field hero", + "picture": "references/themes/cobalt.jpg" + }, + { + "name": "Console", + "slug": "console", + "genre": "modern-minimal", + "posture": "restrained", + "paper": { + "band": "dark", + "L": 17, + "hue": 250 + }, + "display": { + "class": "grotesk-sans", + "face": "Host Grotesk" + }, + "accent": { + "band": "chromatic-amber", + "hue": 80 + }, + "keywords": [ + "lab", + "laboratory", + "protocol", + "experiment", + "notebook", + "science", + "research", + "observability", + "monitoring", + "version control", + "audit", + "compliance", + "instruments", + "data", + "devtools", + "engineering", + "telemetry", + "record", + "operations", + "dark", + "developer" + ], + "material": "graphite ground in three lightness steps, pale ink, hairline panels cut from one surface, Host Grotesk 500 for reading, Atkinson Hyperlegible Mono for what was measured, amber for a person and cool blue for an instrument", + "file": "references/themes/console.md", + "photo": "duotone paper-3 ink", + "pictured": "Audit Trail, Stage hero", + "picture": "references/themes/console.jpg" + }, + { + "name": "Coral", + "slug": "coral", + "genre": "modern-minimal", + "posture": "restrained", + "paper": { + "band": "light", + "L": 97, + "hue": 55 + }, + "display": { + "class": "grotesk-sans", + "face": "General Sans" + }, + "accent": { + "band": "warm", + "hue": 30 + }, + "keywords": [ + "saas", + "platform", + "billing", + "payments", + "invoicing", + "dashboard", + "b2b", + "startup", + "product", + "pricing", + "analytics", + "fintech", + "workflow", + "team", + "onboarding", + "trust", + "warm", + "human", + "calm" + ], + "material": "warm grey paper and a felt desk, cotton stationery lit from the left, General Sans throughout with Geist Mono figures, letterpress card controls, coral pressed into the stock for the one settled state", + "file": "references/themes/coral.md", + "photo": "muted sepia=8", + "pictured": "Conversational FAQ, Desk hero", + "picture": "references/themes/coral.jpg" + }, + { + "name": "Darkroom", + "slug": "darkroom", + "genre": "atmospheric", + "posture": "restrained", + "paper": { + "band": "dark", + "L": 12.5, + "hue": 55 + }, + "display": { + "class": "display-condensed", + "face": "Sofia Sans Extra Condensed" + }, + "accent": { + "band": "chromatic-amber", + "hue": 58 + }, + "keywords": [ + "photographer", + "photography", + "film", + "analogue", + "darkroom", + "prints", + "portfolio", + "exhibition", + "gallery", + "edition", + "commission", + "cinematographer", + "negative", + "archive", + "monochrome", + "lab", + "moody", + "black and white", + "night", + "print shop", + "travel", + "places", + "landscape", + "portrait", + "photo studio" + ], + "material": "warm print-black ground, a fine light grain, fibre-white ink, hairline Sofia Sans Extra Condensed capitals over Barlow, zero radius, black-and-white photographs printed deeper than the ground, one amber safelight", + "file": "references/themes/darkroom.md", + "photo": "mono high=-20 shad=-12", + "pictured": "Photographic, Poster hero", + "picture": "references/themes/darkroom.jpg" + }, + { + "name": "Dose", + "slug": "dose", + "genre": "modern-minimal", + "posture": "committed", + "paper": { + "band": "light", + "L": 97.6, + "hue": 88 + }, + "display": { + "class": "grotesk-sans", + "face": "Schibsted Grotesk" + }, + "accent": { + "band": "chromatic-green", + "hue": 160 + }, + "keywords": [ + "health", + "medication", + "pharmacy", + "care", + "carer", + "family", + "reminders", + "schedule", + "app", + "mobile", + "medicine", + "patients", + "clinic", + "prescription", + "tracking", + "calm", + "trust", + "routine", + "elderly", + "parents" + ], + "material": "warm morning paper with a fibre grain and window light, translucent tinted plastic, green-black ink, Schibsted Grotesk over Instrument Sans with DM Mono pharmacy labels, moulded controls, one pharmacy green", + "file": "references/themes/dose.md", + "photo": "natural sat=-15 con=-6", + "pictured": "Care Register, Organiser hero", + "picture": "references/themes/dose.jpg" + }, + { + "name": "Dusk", + "slug": "dusk", + "genre": "modern-minimal", + "posture": "committed", + "paper": { + "band": "dark", + "L": 17.5, + "hue": 268 + }, + "display": { + "class": "grotesk-sans", + "face": "Wix Madefor Display" + }, + "accent": { + "band": "cool", + "hue": 274 + }, + "keywords": [ + "treasury", + "banking", + "fintech", + "payments", + "reconciliation", + "ledger", + "accounting", + "close", + "month end", + "audit", + "balance", + "cash management", + "payouts", + "settlement", + "compliance", + "controller", + "bookkeeping", + "finance team", + "invoicing", + "payroll", + "overnight", + "automation" + ], + "material": "a real landscape at the turn of the light behind the hero, slate below it, the product in smoked glass with a lit top edge, Wix Madefor Display at a quiet weight over Wix Madefor Text, bone wells for light surfaces, one periwinkle signal and one apricot", + "file": "references/themes/dusk.md", + "photo": "natural con=4 vib=6", + "pictured": "Narrative Workflow, Stage hero", + "picture": "references/themes/dusk.jpg" + }, + { + "name": "Editorial", + "slug": "editorial", + "genre": "editorial", + "posture": "restrained", + "paper": { + "band": "light", + "L": 97, + "hue": 86 + }, + "display": { + "class": "display-condensed", + "face": "Bricolage Grotesque" + }, + "accent": { + "band": "chromatic-green", + "hue": 152 + }, + "keywords": [ + "magazine", + "editorial", + "feature", + "culture", + "fashion", + "design annual", + "interview", + "longform", + "publication", + "issue", + "contemporary", + "art direction", + "profile", + "lookbook", + "brand story", + "journal", + "considered", + "travel", + "city guide", + "guide" + ], + "material": "warm white uncoated stock, printed black ink with a cool tilt, Bricolage Grotesque condensed at 800 over Source Serif 4, square corners, a heavy ink rule over 1px hairlines, one printer's green", + "file": "references/themes/editorial.md", + "photo": "natural sat=-10 con=4", + "pictured": "Marquee Hero, Stage hero", + "picture": "references/themes/editorial.jpg" + }, + { + "name": "Formwork", + "slug": "formwork", + "genre": "editorial", + "posture": "restrained", + "paper": { + "band": "mid", + "L": 74, + "hue": 80 + }, + "display": { + "class": "display-condensed", + "face": "Oswald" + }, + "accent": { + "band": "warm", + "hue": 38 + }, + "keywords": [ + "construction", + "concrete", + "skatepark", + "contractor", + "civil", + "landscape", + "foundry", + "industrial", + "fabrication", + "workshop", + "engineering", + "cast", + "welded", + "builders", + "hardware", + "tools", + "site", + "heavy" + ], + "material": "warm grey concrete paper with a speck grain, near-black ink, Oswald capitals over Archivo, square cast edges and hard shadows, hard black-and-white photographs of poured concrete, one safety orange signal", + "file": "references/themes/formwork.md", + "photo": "natural sat=-100 con=35 exp=8", + "pictured": "Site Board, Poster hero", + "picture": "references/themes/formwork.jpg" + }, + { + "name": "Furrow", + "slug": "furrow", + "genre": "modern-minimal", + "posture": "committed", + "paper": { + "band": "light", + "L": 96, + "hue": 85 + }, + "display": { + "class": "grotesk-sans", + "face": "Red Hat Display" + }, + "accent": { + "band": "warm", + "hue": 40 + }, + "keywords": [ + "farm", + "agriculture", + "land", + "field", + "livestock", + "sheep", + "cattle", + "crop", + "records", + "compliance", + "inspection", + "fleet", + "field service", + "rural", + "contractor", + "hectares", + "yard", + "outdoors", + "seasonal", + "working", + "units" + ], + "material": "warm manila paper, near-black ink in rules, a generated survey map in sienna contours and slate water, Red Hat Display 600 over Red Hat Text with Red Hat Mono figures, moulded 6px keys, a waterproof notebook card, one tangerine signal and a grass green for what is in date", + "file": "references/themes/furrow.md", + "photo": "natural con=8 sat=-6", + "pictured": "Field Record, Map hero", + "picture": "references/themes/furrow.jpg" + }, + { + "name": "Garden", + "slug": "garden", + "genre": "editorial", + "posture": "committed", + "paper": { + "band": "light", + "L": 95.8, + "hue": 90 + }, + "display": { + "class": "roman-serif", + "face": "Vollkorn" + }, + "accent": { + "band": "chromatic-green", + "hue": 140 + }, + "keywords": [ + "farm", + "apiary", + "honey", + "cidery", + "orchard", + "pick your own", + "apples", + "seed", + "nursery", + "herbalist", + "botanical", + "tea", + "preserves", + "single-origin", + "seasonal", + "harvest", + "small-maker", + "csa", + "provenance", + "grown", + "field", + "homestead" + ], + "material": "warm oat paper, deep green ink, Vollkorn 600 with old-style figures over Hanken Grotesk, hairlines and soft moss or clay tints, daylight photographs in true colour, one leaf-green signal", + "file": "references/themes/garden.md", + "photo": "natural con=6 sat=-6", + "pictured": "Field Guide, Stage hero", + "picture": "references/themes/garden.jpg" + }, + { + "name": "Grid", + "slug": "grid", + "genre": "editorial", + "posture": "full-palette", + "paper": { + "band": "light", + "L": 97.5, + "hue": 90 + }, + "display": { + "class": "grotesk-sans", + "face": "Radio Canada Big" + }, + "accent": { + "band": "cool", + "hue": 266 + }, + "keywords": [ + "identity", + "brand system", + "wayfinding", + "signage", + "design studio", + "type specimen", + "editorial grid", + "institution", + "museum", + "archive", + "index", + "directory", + "systems", + "modular", + "swiss", + "grotesque", + "manual", + "programme", + "poster", + "collection" + ], + "material": "white poster stock, blue-black ink, Radio Canada Big 700 in sentence case over Radio Canada, flat fields of ultramarine and one Swiss red mark, no strokes", + "file": "references/themes/grid.md", + "photo": "duotone ink paper-2 con=12", + "pictured": "Poster Sequence, Poster hero", + "picture": "references/themes/grid.jpg" + }, + { + "name": "Halftone", + "slug": "halftone", + "genre": "playful", + "posture": "committed", + "paper": { + "band": "light", + "L": 96.2, + "hue": 94 + }, + "display": { + "class": "slab-serif", + "face": "Ultra" + }, + "accent": { + "band": "warm", + "hue": 33 + }, + "keywords": [ + "drinks", + "soda", + "food brand", + "print shop", + "zine", + "magazine", + "record label", + "packaging", + "campaign", + "label", + "bottle", + "can", + "screen print", + "bold", + "one colour", + "retail", + "craft", + "loud", + "fruit", + "snack" + ], + "material": "butter-cream stock, brown-black ink, Ultra over Chivo, three-pixel ink rules and square wells, one vermilion printed solid and through a dot screen, photographs in full colour", + "file": "references/themes/halftone.md", + "photo": "natural vib=25 sat=10 con=6", + "pictured": "Back of the Can, Settled hero", + "picture": "references/themes/halftone.jpg" + }, + { + "name": "Hedgerow", + "slug": "hedgerow", + "genre": "editorial", + "posture": "drenched", + "paper": { + "band": "dark", + "L": 24, + "hue": 158 + }, + "display": { + "class": "high-contrast-serif", + "face": "Prata" + }, + "accent": { + "band": "chromatic-green", + "hue": 118 + }, + "keywords": [ + "distillery", + "gin", + "brewery", + "forager", + "botanicals", + "nature reserve", + "walking", + "trail", + "seeds", + "plants", + "nursery", + "hedge", + "countryside", + "field guide", + "provenance", + "harvest", + "batch", + "seasonal", + "map", + "miles" + ], + "material": "deep leaf-green paper, cream ink, Prata heads over Manrope, low-key photographs in true colour, square flat surfaces with pill controls, one chartreuse signal with a moss strength for cream", + "file": "references/themes/hedgerow.md", + "photo": "natural sat=-10 con=8 exp=-8", + "pictured": "Field Guide, Poster hero", + "picture": "references/themes/hedgerow.jpg" + }, + { + "name": "Hum", + "slug": "hum", + "genre": "playful", + "posture": "full-palette", + "paper": { + "band": "light", + "L": 97, + "hue": 95 + }, + "display": { + "class": "rounded-sans", + "face": "Chillax" + }, + "accent": { + "band": "chromatic-yellow", + "hue": 95 + }, + "keywords": [ + "daily", + "habit", + "streak", + "practice", + "learning", + "reading", + "curiosity", + "mood", + "energy", + "friendship", + "community", + "kids", + "family", + "parents", + "school", + "game", + "puzzle", + "creative", + "playful", + "alive" + ], + "material": "grained cream paper pulled toward pear-yellow, torn paper edges with a pale fibre core, card-stock controls that press down, blue-black ink, Chillax throughout, three accents that never blend and a mint for growth", + "file": "references/themes/hum.md", + "photo": "natural vib=12 exp=4", + "pictured": "Workbench, Settled hero", + "picture": "references/themes/hum.jpg" + }, + { + "name": "Ink", + "slug": "ink", + "genre": "editorial", + "posture": "restrained", + "paper": { + "band": "light", + "L": 99.5, + "hue": 100 + }, + "display": { + "class": "grotesk-sans", + "face": "Epilogue" + }, + "accent": { + "band": "chromatic-teal", + "hue": 190 + }, + "keywords": [ + "library", + "lending", + "community", + "civic", + "notice board", + "catalogue", + "rota", + "volunteer", + "non-profit", + "neighbourhood", + "borrow", + "tools", + "repair", + "membership", + "events", + "local", + "competent", + "monochrome" + ], + "material": "white paper, a black with no hue, Epilogue 700 over Epilogue 400, hairline rules and state pills, one teal that means in", + "file": "references/themes/ink.md", + "photo": "muted", + "pictured": "Catalogue, Settled hero", + "picture": "references/themes/ink.jpg" + }, + { + "name": "Kiln", + "slug": "kiln", + "genre": "atmospheric", + "posture": "full-palette", + "paper": { + "band": "dark", + "L": 13, + "hue": 40 + }, + "display": { + "class": "high-contrast-serif", + "face": "Boska" + }, + "accent": { + "band": "warm", + "hue": 45 + }, + "keywords": [ + "kiln", + "ceramics", + "pottery", + "firing", + "glaze", + "heat", + "temperature", + "ceramics studio", + "craft", + "sensor", + "monitor", + "hardware", + "iot", + "warmth", + "dark", + "glow", + "schedule", + "workshop" + ], + "material": "near-black ground, cream ink, Boska over Geist, smoked wells, photographs lit by the work, a heat ramp that marks temperature, one ember signal", + "file": "references/themes/kiln.md", + "photo": "warm sepia=50 sat=-12 con=8 exp=-6", + "pictured": "Workbench, Stage hero", + "picture": "references/themes/kiln.jpg" + }, + { + "name": "Loom", + "slug": "loom", + "genre": "editorial", + "posture": "committed", + "paper": { + "band": "light", + "L": 95, + "hue": 85 + }, + "display": { + "class": "roman-serif", + "face": "Libre Caslon Display" + }, + "accent": { + "band": "cool", + "hue": 266 + }, + "keywords": [ + "weaving", + "textile", + "linen", + "wool", + "weaving studio", + "cloth", + "craft", + "atelier", + "handmade", + "natural", + "indigo", + "fabric", + "by the metre", + "workshop", + "maker", + "slow", + "commission", + "interiors", + "samples" + ], + "material": "ecru paper with sand steps, warm near-black ink, Libre Caslon Display heads and prices over Hanken Grotesk, thin rules and one ink rule, cloth photographed close in window light, one deep indigo", + "file": "references/themes/loom.md", + "photo": "natural sat=-12 con=-4", + "pictured": "Narrative Workflow, Poster hero", + "picture": "references/themes/loom.jpg" + }, + { + "name": "Lumen", + "slug": "lumen", + "genre": "atmospheric", + "posture": "restrained", + "paper": { + "band": "dark", + "L": 12.5, + "hue": 290 + }, + "display": { + "class": "roman-serif", + "face": "Instrument Serif" + }, + "accent": { + "band": "warm", + "hue": 62 + }, + "keywords": [ + "inference", + "model", + "llm", + "ai tool", + "agent", + "voice", + "synthesis", + "api", + "gpu", + "serverless", + "runtime", + "tokens", + "latency", + "open models", + "developer", + "research lab", + "ml platform", + "dev tools", + "premium" + ], + "material": "violet-black ground, near-white ink, lowercase Instrument Serif heads a step large over Geist and Geist Mono, hairline wells, a faint blueprint grid, one molten brass signal and one rose verb", + "file": "references/themes/lumen.md", + "photo": "duotone paper ink-2", + "pictured": "Map / Diagram, Settled hero", + "picture": "references/themes/lumen.jpg" + }, + { + "name": "Manifesto", + "slug": "manifesto", + "genre": "editorial", + "posture": "committed", + "paper": { + "band": "dark", + "L": 13, + "hue": 60 + }, + "display": { + "class": "display-condensed", + "face": "Anton" + }, + "accent": { + "band": "warm", + "hue": 28 + }, + "keywords": [ + "manifesto", + "statement", + "declaration", + "principles", + "beliefs", + "mission", + "movement", + "protest", + "cause", + "campaign", + "petition", + "activism", + "advocacy", + "rights", + "values", + "take a stand", + "bold launch", + "defiant", + "punk", + "record label" + ], + "material": "warm near-black ground, warm off-white ink, Anton capitals at poster size leaded tight over a quiet Public Sans body, hairlines, a heavy ink bar and square edges, one fighting red", + "file": "references/themes/manifesto.md", + "photo": "duotone paper ink con=24", + "pictured": "Manifesto, Ledge hero", + "picture": "references/themes/manifesto.jpg" + }, + { + "name": "Midnight", + "slug": "midnight", + "genre": "atmospheric", + "posture": "committed", + "paper": { + "band": "dark", + "L": 14, + "hue": 264 + }, + "display": { + "class": "grotesk-sans", + "face": "Mona Sans" + }, + "accent": { + "band": "cool", + "hue": 230 + }, + "keywords": [ + "render", + "3d", + "animation", + "vfx", + "film", + "video", + "frames", + "pipeline", + "generative", + "ai tool", + "model playground", + "dark mode", + "nocturnal", + "late-night", + "after-hours", + "overnight", + "moody", + "cinematic", + "cerebral", + "calm", + "technical", + "midnight" + ], + "material": "midnight-blue ground to every edge, cool white ink, Mona Sans expanded at 300 over its normal width, square-cut surfaces in lightness steps, photographs as moonlight, one azure signal", + "file": "references/themes/midnight.md", + "photo": "duotone paper ink-2", + "pictured": "Narrative Workflow, Settled hero", + "picture": "references/themes/midnight.jpg" + }, + { + "name": "Newsprint", + "slug": "newsprint", + "genre": "editorial", + "posture": "restrained", + "paper": { + "band": "light", + "L": 94, + "hue": 92 + }, + "display": { + "class": "slab-serif", + "face": "Zilla Slab" + }, + "accent": { + "band": "warm", + "hue": 32 + }, + "keywords": [ + "newspaper", + "broadsheet", + "journalism", + "publication", + "magazine", + "newsletter", + "local news", + "op-ed", + "opinion", + "essay", + "longform", + "column", + "reportage", + "press", + "gazette", + "review", + "dispatch", + "literary" + ], + "material": "pale newsprint stock, warm black ink, Zilla Slab heads over a Spectral body with Libre Franklin agate for listed figures, justified columns under hairline column rules, a double rule, one dried-brick signal", + "file": "references/themes/newsprint.md", + "photo": "mono", + "pictured": "Broadsheet Front, Stage hero", + "picture": "references/themes/newsprint.jpg" + }, + { + "name": "Overprint", + "slug": "overprint", + "genre": "playful", + "posture": "full-palette", + "paper": { + "band": "light", + "L": 91.5, + "hue": 92 + }, + "display": { + "class": "grotesk-heavy", + "face": "Anybody" + }, + "accent": { + "band": "cool", + "hue": 212 + }, + "keywords": [ + "venue", + "gigs", + "live music", + "festival", + "music", + "label", + "print studio", + "bar", + "club", + "poster", + "tickets", + "events", + "nightlife", + "two-colour", + "screenprint", + "punk", + "zine", + "loud", + "listings", + "door" + ], + "material": "grey newsprint stock, near-black ink, wide heavy Anybody capitals over Archivo, flat square fills, a teal pass and an orange pass that print moss where they cross, photographs pulled through one pass", + "file": "references/themes/overprint.md", + "photo": "mono con=30", + "pictured": "Marquee Hero, Poster hero", + "picture": "references/themes/overprint.jpg" + }, + { + "name": "Paste-up", + "slug": "pasteup", + "genre": "playful", + "posture": "committed", + "paper": { + "band": "mid", + "L": 73, + "hue": 70 + }, + "display": { + "class": "display-condensed", + "face": "League Gothic" + }, + "accent": { + "band": "chromatic-yellow", + "hue": 112 + }, + "keywords": [ + "zine", + "fair", + "market", + "festival", + "print fair", + "book fair", + "exhibitors", + "punk", + "diy", + "collective", + "gig", + "poster", + "workshop", + "night market", + "flea", + "indie", + "community", + "launch", + "loud", + "photocopy", + "flyer" + ], + "material": "kraft board, a fibre wash, near-black toner, League Gothic capitals over a Newsreader galley, white copy paper on paper lifts, hard ink offsets, one sheet of fluorescent yellow", + "file": "references/themes/pasteup.md", + "photo": "mono con=45", + "pictured": "Bento Grid, Stage hero", + "picture": "references/themes/pasteup.jpg" + }, + { + "name": "Piste", + "slug": "piste", + "genre": "playful", + "posture": "committed", + "paper": { + "band": "light", + "L": 98.5, + "hue": 260 + }, + "display": { + "class": "display-condensed", + "face": "Barlow Condensed" + }, + "accent": { + "band": "cool", + "hue": 265 + }, + "keywords": [ + "ski", + "mountain", + "resort", + "snow", + "winter", + "outdoor", + "sport", + "trail", + "lift", + "race", + "alpine", + "tickets", + "season pass", + "conditions", + "weather", + "club", + "active", + "bold" + ], + "material": "snow-white paper, cold near-black ink, Barlow Condensed 800 caps over Barlow, square edges on 2px ink rules, one cobalt for signal and field", + "file": "references/themes/piste.md", + "photo": "natural con=10 vib=15", + "pictured": "Morning Report, Poster hero", + "picture": "references/themes/piste.jpg" + }, + { + "name": "Refract", + "slug": "refract", + "genre": "atmospheric", + "posture": "restrained", + "paper": { + "band": "light", + "L": 98.2, + "hue": 95 + }, + "display": { + "class": "grotesk-sans", + "face": "Funnel Display" + }, + "accent": { + "band": "cool", + "hue": 232 + }, + "keywords": [ + "pool", + "lido", + "swim", + "spa", + "hotel", + "resort", + "water", + "skincare", + "sunscreen", + "eyewear", + "glass", + "optics", + "light", + "daylight", + "architecture", + "interiors", + "studio", + "wellness", + "bathhouse", + "summer", + "clean", + "calm", + "product launch", + "hardware" + ], + "material": "sunlit white plaster with real light falling across it, water caustics or prism dispersion rendered live, deep pool-blue ink, Funnel Display at a light weight over Funnel Sans, clear surfaces that cast tinted shadows, one water signal", + "file": "references/themes/refract.md", + "photo": "natural con=3 exp=4", + "pictured": "Timetable-led, Stage hero", + "picture": "references/themes/refract.jpg" + }, + { + "name": "Ribbon", + "slug": "ribbon", + "genre": "atmospheric", + "posture": "committed", + "paper": { + "band": "light", + "L": 98.5, + "hue": 85 + }, + "display": { + "class": "grotesk-sans", + "face": "Instrument Sans" + }, + "accent": { + "band": "chromatic-teal", + "hue": 190 + }, + "keywords": [ + "sleep", + "sound", + "soundscape", + "audio", + "night", + "rest", + "calm", + "wellness", + "meditation", + "white noise", + "ambient", + "listen", + "headphones", + "wind down", + "bedtime", + "quiet", + "breathing", + "app", + "subscription" + ], + "material": "warm off-white or blue-black night, Instrument Sans at a quiet weight over Figtree, machined parts lit from above, the hour drawn as light on a generated canvas, one signal", + "file": "references/themes/ribbon.md", + "photo": "muted sepia=14", + "pictured": "Night Notes, Stage hero, in the two-in-the-morning colourway", + "picture": "references/themes/ribbon.jpg" + }, + { + "name": "Rim", + "slug": "rim", + "genre": "modern-minimal", + "posture": "committed", + "paper": { + "band": "dark", + "L": 9, + "hue": 75 + }, + "display": { + "class": "grotesk-sans", + "face": "Switzer" + }, + "accent": { + "band": "warm", + "hue": 45 + }, + "keywords": [ + "space", + "satellite", + "earth observation", + "orbit", + "imagery", + "ground station", + "telemetry", + "hardware", + "schedule", + "utc", + "infrastructure", + "mission", + "sensor", + "monitoring", + "instrument", + "night", + "dark", + "measured" + ], + "material": "warm black paper, warm off-white ink, Switzer 500 with Geist Mono for every measurement, square hairline surfaces, the earth photographed straight down, an orange signal and a sky-blue second", + "file": "references/themes/rim.md", + "photo": "natural sat=-20 con=10", + "pictured": "Map / Diagram, Ledge hero", + "picture": "references/themes/rim.jpg" + }, + { + "name": "Riso", + "slug": "riso", + "genre": "editorial", + "posture": "committed", + "paper": { + "band": "light", + "L": 97, + "hue": 90 + }, + "display": { + "class": "grotesk-heavy", + "face": "Cabinet Grotesk" + }, + "accent": { + "band": "chromatic-pink", + "hue": 356 + }, + "keywords": [ + "risograph", + "riso", + "print studio", + "print fair", + "zine", + "small press", + "poster", + "art book", + "spot colour", + "two colour", + "indie press", + "diy", + "handmade", + "prints", + "open studio" + ], + "material": "bright uncoated stock and no black, a medium blue drum for every word, a fluorescent pink drum for the fills, purple where they cross, Cabinet Grotesk 800 over Literata, grain, one word a hair out of register", + "file": "references/themes/riso.md", + "photo": "duotone ink paper-2 con=14", + "pictured": "Job Sheet, Stage hero", + "picture": "references/themes/riso.jpg" + }, + { + "name": "Solstice", + "slug": "solstice", + "genre": "editorial", + "posture": "restrained", + "paper": { + "band": "light", + "L": 94, + "hue": 80 + }, + "display": { + "class": "high-contrast-serif", + "face": "Yeseva One" + }, + "accent": { + "band": "warm", + "hue": 24 + }, + "keywords": [ + "farm", + "orchard", + "cider", + "perry", + "winery", + "harvest", + "seasonal", + "food", + "almanac", + "produce", + "vineyard", + "calendar", + "market", + "craft drink", + "label", + "bottle", + "rural", + "slow", + "sun", + "midsummer" + ], + "material": "cream paper, warm brown ink, Yeseva One over Archivo and Archivo Narrow, gold hairlines and hard paper shadows, photographs in low warm light, one vermilion signal", + "file": "references/themes/solstice.md", + "photo": "warm high=-12", + "pictured": "Midsummer, Stage hero", + "picture": "references/themes/solstice.jpg" + }, + { + "name": "Specimen", + "slug": "specimen", + "genre": "editorial", + "posture": "restrained", + "paper": { + "band": "light", + "L": 96.5, + "hue": 82 + }, + "display": { + "class": "high-contrast-serif", + "face": "Bodoni Moda" + }, + "accent": { + "band": "cool", + "hue": 262 + }, + "keywords": [ + "typography", + "type specimen", + "foundry", + "letterform", + "portfolio", + "editorial", + "magazine", + "essay", + "type studio", + "agency", + "brand story", + "print", + "publication", + "craft", + "considered", + "literary" + ], + "material": "warm oat paper, warm near-black ink, razor-hairline Bodoni Moda over Geist, square 1px rules, one ink-blue signal that also draws the metric guides", + "file": "references/themes/specimen.md", + "photo": "duotone ink paper con=8", + "pictured": "Specimen Book, Poster hero", + "picture": "references/themes/specimen.jpg" + }, + { + "name": "Spore", + "slug": "spore", + "genre": "atmospheric", + "posture": "committed", + "paper": { + "band": "dark", + "L": 15, + "hue": 60 + }, + "display": { + "class": "roman-serif", + "face": "Young Serif" + }, + "accent": { + "band": "warm", + "hue": 30 + }, + "keywords": [ + "grower", + "mushroom", + "fungi", + "farm", + "food", + "producer", + "fermentation", + "wine", + "natural wine", + "wine bar", + "bottle shop", + "cellar", + "preserves", + "dark", + "culture", + "night market", + "harvest", + "subscription", + "small batch" + ], + "material": "coffee-ground black with a warm grain, parchment ink, Young Serif over Instrument Sans, soft pills and grained wells, photographs lit by lamps and candles, one oyster pink", + "file": "references/themes/spore.md", + "photo": "warm con=6 exp=-4", + "pictured": "Photographic, Stage hero", + "picture": "references/themes/spore.jpg" + }, + { + "name": "Sport", + "slug": "sport", + "genre": "editorial", + "posture": "restrained", + "paper": { + "band": "light", + "L": 98, + "hue": 250 + }, + "display": { + "class": "display-condensed", + "face": "Saira Condensed" + }, + "accent": { + "band": "chromatic-volt", + "hue": 120 + }, + "keywords": [ + "running", + "marathon", + "race", + "training", + "fitness", + "gym", + "team", + "league", + "fixtures", + "standings", + "scoreboard", + "athletics", + "performance", + "splits", + "sportswear", + "club", + "match", + "tournament" + ], + "material": "cool concrete paper, blue-black ink, uppercase Saira Condensed over Albert Sans, condensed figures and mono times, two-weight rules, one volt fill", + "file": "references/themes/sport.md", + "photo": "duotone ink paper con=20", + "pictured": "Stat-Led, Poster hero", + "picture": "references/themes/sport.jpg" + }, + { + "name": "Squeeze", + "slug": "squeeze", + "genre": "playful", + "posture": "drenched", + "paper": { + "band": "mid", + "L": 41, + "hue": 154 + }, + "display": { + "class": "geometric-sans", + "face": "Gabarito" + }, + "accent": { + "band": "warm", + "hue": 56 + }, + "keywords": [ + "fruit", + "food box", + "grocer", + "market", + "delivery", + "weekly", + "seasonal", + "farm shop", + "subscription", + "produce", + "veg box", + "cheerful", + "family", + "treats", + "stall", + "orchard", + "local", + "fresh" + ], + "material": "forest-green paper with real chroma, warm white ink, Gabarito 800 heads and figures over Manrope, soft rounded tiles a step lighter or deeper, fruit photographed bright and close, juicy peach controls", + "file": "references/themes/squeeze.md", + "photo": "natural vib=12 con=4", + "pictured": "Bento Grid, Stage hero", + "picture": "references/themes/squeeze.jpg" + }, + { + "name": "Sticker", + "slug": "sticker", + "genre": "playful", + "posture": "full-palette", + "paper": { + "band": "light", + "L": 95.7, + "hue": 82 + }, + "display": { + "class": "display-heavy", + "face": "Bowlby One SC" + }, + "accent": { + "band": "chromatic-magenta", + "hue": 2 + }, + "keywords": [ + "stickers", + "print", + "merch", + "shop", + "maker", + "creator", + "diy", + "craft", + "vinyl", + "packaging", + "labels", + "small business", + "ecommerce", + "fun", + "loud", + "pink", + "cut", + "ship", + "order" + ], + "material": "warm off-white paper, warm black ink, Bowlby One SC over Sofia Sans, white die-cut borders on hard offset shadows, hot pink, lime and ink fills set with type", + "file": "references/themes/sticker.md", + "photo": "natural vib=15 con=5", + "pictured": "Bento Grid, Stage hero", + "picture": "references/themes/sticker.jpg" + }, + { + "name": "Studio", + "slug": "studio", + "genre": "editorial", + "posture": "restrained", + "paper": { + "band": "light", + "L": 97.2, + "hue": 215 + }, + "display": { + "class": "roman-serif", + "face": "Hedvig Letters Serif" + }, + "accent": { + "band": "warm", + "hue": 52 + }, + "keywords": [ + "design studio", + "creative studio", + "branding", + "brand identity", + "art direction", + "agency", + "portfolio", + "case study", + "selected work", + "editorial design", + "typography", + "creative direction", + "graphic design", + "considered", + "curatorial" + ], + "material": "cool studio-white proof paper with an ink dot grid and grain, blue-black ink, Hedvig Letters Serif heads over Geist, crop marks on every printed piece, orange construction guides, the work photographed in true colour, one cadmium-orange signal", + "file": "references/themes/studio.md", + "photo": "natural", + "pictured": "Portfolio Index, Ledge hero", + "picture": "references/themes/studio.jpg" + }, + { + "name": "Terminal", + "slug": "terminal", + "genre": "atmospheric", + "posture": "committed", + "paper": { + "band": "dark", + "L": 12.5, + "hue": 150 + }, + "display": { + "class": "mono", + "face": "Martian Mono" + }, + "accent": { + "band": "chromatic-green", + "hue": 142 + }, + "keywords": [ + "cli", + "terminal", + "shell", + "command-line", + "tui", + "self-hosted", + "open-source", + "binary", + "ssh", + "sysadmin", + "devops", + "homelab", + "install script", + "package manager", + "repl", + "dotfiles", + "developer tool", + "phosphor" + ], + "material": "a near-black ground with a green cast in three lightness steps, pale phosphor ink and one bright phosphor signal with a dim wash of itself, every glyph Martian Mono with heads wide and text narrow, and pictures printed in the page's own glyphs: a photograph rendered as a grid of characters taken from the product's own text, dim cells small, bright cells full, stirred by the cursor", + "file": "references/themes/terminal.md", + "photo": "duotone paper accent con=20", + "pictured": "Session, Split hero", + "picture": "references/themes/terminal.jpg" + }, + { + "name": "Terrazzo", + "slug": "terrazzo", + "genre": "modern-minimal", + "posture": "restrained", + "paper": { + "band": "light", + "L": 96, + "hue": 82 + }, + "display": { + "class": "geometric-sans", + "face": "Syne" + }, + "accent": { + "band": "warm", + "hue": 38 + }, + "keywords": [ + "materials", + "library", + "architects", + "samples", + "catalogue", + "surfaces", + "stone", + "timber", + "terrazzo", + "ceramic", + "tile", + "interiors", + "interiors studio", + "showroom", + "specification", + "swatches", + "supplier", + "drawer", + "photography", + "tactile" + ], + "material": "off-white paper, white card surfaces ruled in ink over a hard offset, wide Syne heads over Onest, JetBrains Mono for codes and millimetres, surfaces photographed flat-on in true colour, rust the one signal", + "file": "references/themes/terrazzo.md", + "photo": "natural con=4", + "pictured": "Sample Drawer, Ledge hero", + "picture": "references/themes/terrazzo.jpg" + }, + { + "name": "Ultraviolet", + "slug": "ultraviolet", + "genre": "modern-minimal", + "posture": "committed", + "paper": { + "band": "light", + "L": 95, + "hue": 300 + }, + "display": { + "class": "geometric-sans", + "face": "Outfit" + }, + "accent": { + "band": "cool", + "hue": 290 + }, + "keywords": [ + "music", + "audio", + "stems", + "remix", + "dj", + "producer", + "player", + "streaming", + "tempo", + "playlist", + "creator", + "app", + "consumer", + "lowercase", + "violet", + "sound", + "beats", + "recording studio" + ], + "material": "lavender paper or a violet-black night, Outfit set lowercase over Onest, hairline pills, one saturated violet in two strengths, photographs pulled into the violet", + "file": "references/themes/ultraviolet.md", + "photo": "tint accent con=10", + "pictured": "Workbench, Stage hero, in the night colourway", + "picture": "references/themes/ultraviolet.jpg" + }, + { + "name": "Vantage", + "slug": "vantage", + "genre": "modern-minimal", + "posture": "restrained", + "paper": { + "band": "dark", + "L": 13.5, + "hue": 235 + }, + "display": { + "class": "grotesk-sans", + "face": "Geologica" + }, + "accent": { + "band": "chromatic-lime", + "hue": 126 + }, + "keywords": [ + "lidar", + "scan", + "survey", + "mapping", + "3d", + "spatial", + "point cloud", + "robotics", + "autonomy", + "drone", + "construction", + "digital twin", + "geospatial", + "measurement", + "sensor", + "inspection", + "engineering", + "heritage", + "digitisation", + "infrastructure", + "reality capture", + "terrain" + ], + "material": "blue-black ground, a live point cloud of the real thing as the hero's light, a sweep that lights it, pale steel ink, Geologica with sharpened corners at a light weight, hairline frames with corner ticks, one lime signal for what was found", + "file": "references/themes/vantage.md", + "photo": "muted con=6 sat=-20", + "pictured": "Feature Ledger, Stage hero", + "picture": "references/themes/vantage.jpg" + }, + { + "name": "Vellum", + "slug": "vellum", + "genre": "editorial", + "posture": "committed", + "paper": { + "band": "light", + "L": 94, + "hue": 82 + }, + "display": { + "class": "blackletter", + "face": "Grenze Gotisch" + }, + "accent": { + "band": "cool", + "hue": 268 + }, + "keywords": [ + "roastery", + "coffee", + "bakery", + "wine", + "cellar", + "apothecary", + "bookshop", + "press", + "letterpress", + "guild", + "heritage", + "artisan", + "manuscript", + "parchment", + "edition", + "tasting", + "vintage", + "craft", + "old world", + "slow" + ], + "material": "parchment paper, a long tan fibre wash on bands, umber ink, Grenze Gotisch heads over Hanken Grotesk with Grenze roman for statements, hairline and double rules, one ultramarine pigment", + "file": "references/themes/vellum.md", + "photo": "warm con=6", + "pictured": "Trade Ledger, Poster hero", + "picture": "references/themes/vellum.jpg" + }, + { + "name": "Wayfind", + "slug": "wayfind", + "genre": "modern-minimal", + "posture": "committed", + "paper": { + "band": "light", + "L": 95.5, + "hue": 250 + }, + "display": { + "class": "mono", + "face": "Chivo Mono" + }, + "accent": { + "band": "cool", + "hue": 264 + }, + "keywords": [ + "transit", + "metro", + "rail", + "station", + "wayfinding", + "departures", + "timetable", + "live", + "map", + "commute", + "city", + "platform", + "signage", + "logistics", + "status", + "operations", + "schedule", + "mobility", + "travel", + "trip", + "journey", + "itinerary", + "booking", + "flights", + "airport" + ], + "material": "cool grey paper, blue-black ink, Chivo Mono throughout, square 2px ink borders, ink plates, cobalt for what is live, amber for figures on ink", + "file": "references/themes/wayfind.md", + "photo": "natural sat=-12 con=10", + "pictured": "Station Sequence, Stage hero", + "picture": "references/themes/wayfind.jpg" + }, + { + "name": "Werkstatt", + "slug": "werkstatt", + "genre": "playful", + "posture": "full-palette", + "paper": { + "band": "mid", + "L": 84, + "hue": 82 + }, + "display": { + "class": "geometric-sans", + "face": "Jost" + }, + "accent": { + "band": "cool", + "hue": 264 + }, + "keywords": [ + "school", + "programme", + "workshop", + "maker", + "course", + "bootcamp", + "academy", + "apply", + "admissions", + "tuition", + "timetable", + "bauhaus", + "craft", + "design education", + "design school", + "residency", + "cohort", + "prospectus" + ], + "material": "warm putty ground with a lighter well, near-black ink, Jost 700 capitals and numerals over Karla, square 2px and 3px ink rules that box cells, flat ultramarine, vermilion and yellow primaries", + "file": "references/themes/werkstatt.md", + "photo": "mono", + "pictured": "Catalogue, Settled hero", + "picture": "references/themes/werkstatt.jpg" + } + ] +} diff --git a/skills/hallmark/references/themes/ink.jpg b/skills/hallmark/references/themes/ink.jpg new file mode 100644 index 0000000..64b6a59 Binary files /dev/null and b/skills/hallmark/references/themes/ink.jpg differ diff --git a/skills/hallmark/references/themes/ink.md b/skills/hallmark/references/themes/ink.md new file mode 100644 index 0000000..c26adaf --- /dev/null +++ b/skills/hallmark/references/themes/ink.md @@ -0,0 +1,106 @@ +--- +name: Ink +slug: ink +genre: editorial +paper: light 99.5 100 +display: grotesk-sans Epilogue +accent: chromatic-teal 190 +posture: restrained +keywords: library, lending, community, civic, notice board, catalogue, rota, volunteer, non-profit, neighbourhood, borrow, tools, repair, membership, events, local, competent, monochrome +material: white paper, a black with no hue, Epilogue 700 over Epilogue 400, hairline rules and state pills, one teal that means in +photo: muted +pictured: Catalogue, Settled hero +--- + +# Ink + +A notice printed in plain black: white paper, a black with no hue, Epilogue at 700 for the head and 400 for everything you read, hairline rules, and one teal that means in or open. Its photographs show the things on the shelves, in daylight with the colour turned down. It feels competent, local and kind, the way a well-run community desk does. It is not a cold corporate monochrome and not a warm cream editorial page. + +## Tokens + +```css +:root { + --color-paper: oklch(99.5% 0.003 100); --color-paper-2: oklch(97% 0.004 100); --color-paper-3: oklch(94% 0.006 100); + --color-ink: oklch(16% 0 0); --color-ink-2: oklch(28% 0 0); --color-muted: oklch(44% 0 0); + --color-rule: oklch(89% 0.004 100); --color-rule-2: oklch(93.5% 0.003 100); + --color-accent: oklch(50% 0.095 188); --color-accent-ink: oklch(99.5% 0.003 100); --color-accent-soft: oklch(93% 0.05 190); --color-accent-soft-ink: oklch(27% 0.045 190); + --color-focus: oklch(50% 0.095 188); + --font-display: "Epilogue", ui-sans-serif, system-ui, sans-serif; --font-body: var(--font-display); + --font-outlier: "IBM Plex Mono", ui-monospace, monospace; + --radius-card: 12px; --radius-pill: 999px; --rule-hair: 1px; + --shadow-card: 0 20px 40px oklch(20% 0 0 / 0.16); + --tracking-display: -0.04em; --display-weight: 700; +} +``` + +Two colourways, both light, stated in the stamp (`ink: paper` or `ink: board`). + +| Colourway | Ground and teal | +| --- | --- | +| `paper` (default) | the block above: white, hueless black, teal at 50% | +| `board` | notice-board yellow `oklch(93% 0.10 95)` with rules at `oklch(84% 0.10 92)`, ink `oklch(20% 0.02 80)`, teal deepened to `oklch(46% 0.078 190)`; wells and tags turn white | + +## Type + +- **Display:** Epilogue 700, `--tracking-display`, line-height 1.0 at hero size and 1.05 below, sentence case, roman; a figure (a count, a price, an hour) takes the same setting, a step larger than the head beside it. +- **Body:** Epilogue 400 at 16 to 17px, line-height 1.55, in `--color-ink-2` (muted greys tire on white); the name in a row, links and tags at 600. +- **Labels, captions, table heads, meta:** Epilogue 400 a step smaller, sentence case, untracked; never mono. +- **Outlier:** IBM Plex Mono only inside code and on figures that compare in a column (loan counts, a card number, times on a rota). Large figures and prices are Epilogue 700 in ink; the teal marks only what is in or open. + +## Surfaces + +- Rules: a list or a table opens on a 1px `--color-ink` rule and continues on `--color-rule` hairlines between its rows; `--color-rule-2` parts quieter rows. +- Radius 12px on wells and photographs, 10px on controls and inputs, pills on tags. +- Flat paper: a well is `--color-paper-2` with a 1px `--color-rule` edge; `--shadow-card` sits only under something that floats over the page (a menu, a dialog), never under a surface at rest. +- Bands: a `--color-paper-2` band or an ink band with paper text. Two a page at most; never a teal field. +- Photographs: the things and the street that shares them, in plain daylight at arm's length: a pegboard of tools, a ladder against a wall, a neighbour carrying something home, seen from behind; no face to the lens, no brand mark to the camera. The colour is turned down (the `photo:` muted) so the teal stays the one colour that means anything; 12px radius, a 1px `--color-rule` hairline, no shadow. A thing's name and its state tag sit under its picture, never on it. +- No texture. + +## Range + +- **The shelf as a ruled list:** every thing a row under the ink rule, its name at 600, one line on what it is, its state pill at the row's end, a filter field that narrows the rows as you type. +- **Steps as a notice:** how it works as three or four numbered stages across the columns, each numeral in Epilogue 700 at display size over a hairline, the stage that means in carrying the pale teal pill. +- **A timetable of opening days:** the next dates as rows, the hours in each, the next one inked; the dates come from the clock, never typed in. +- **Figures in plain black:** a count, a fee and the hours set large in Epilogue 700 on a `--color-paper-2` well, the one that means open in teal. + +## Controls + +- The pair: an ink-filled button with paper text beside a 1px `--color-rule` bordered button on `--color-paper-2`, both at 10px radius in Epilogue 600. +- Tags carry state and nothing else: in is pale teal (`--color-accent-soft`) with `--color-accent-soft-ink`, out is outlined in the rule colour, on is ink-filled. +- Teal means in or open: a tag, a large figure, a link's hover, the focus ring. Links are ink at 600, underlined, teal on hover. + +## Motion + +Nothing moves but state: a filter applies as you type, a tag changes state on click, an underline turns teal over `--dur-micro`. No marquee, no reveal, no counter. + +## Voice + +The desk volunteer's: what is in, when it is back, who is on Saturday. Short, kind, exact, never institutional. + +## Do-nots + +- Never a second colour: teal means in, and out is an outline, never red. +- Never a warm black. The ink has no hue, and the page says so: `waive 22 · ink and greys at zero chroma · a notice board is printed in plain black`. +- Never a teal field or teal running text; teal is a state, not a surface. +- Never a resting shadow; the paper stays flat. + +## Build hint + +```html + +``` + +```css +h1, h2, h3 { font-weight: var(--display-weight); line-height: 1.02; } +.btn { border: var(--rule-hair) solid var(--color-rule); border-radius: 10px; padding: var(--space-sm) var(--space-md); font-weight: 600; background: var(--color-paper-2); color: var(--color-ink); } +.btn--primary { background: var(--color-ink); border-color: var(--color-ink); color: var(--color-paper); } +.tag { display: inline-flex; padding: var(--space-2xs) var(--space-sm); border-radius: var(--radius-pill); font-size: var(--text-xs); font-weight: 600; background: var(--color-paper-3); } +.tag--in { background: var(--color-accent-soft); color: var(--color-accent-soft-ink); } +.tag--out { background: transparent; box-shadow: inset 0 0 0 var(--rule-hair) var(--color-rule); color: var(--color-muted); } +.tag--on { background: var(--color-ink); color: var(--color-paper); } +.ruled { border-top: var(--rule-hair) solid var(--color-ink); } .ruled > * { border-bottom: var(--rule-hair) solid var(--color-rule); } +.well { background: var(--color-paper-2); border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-card); } +.photo { border-radius: var(--radius-card); outline: var(--rule-hair) solid var(--color-rule); outline-offset: -1px; } +a { font-weight: 600; } a:hover { text-decoration-color: var(--color-accent); } +::selection { background: var(--color-accent-soft); color: var(--color-accent-soft-ink); } +``` diff --git a/skills/hallmark/references/themes/kiln.jpg b/skills/hallmark/references/themes/kiln.jpg new file mode 100644 index 0000000..49b12f2 Binary files /dev/null and b/skills/hallmark/references/themes/kiln.jpg differ diff --git a/skills/hallmark/references/themes/kiln.md b/skills/hallmark/references/themes/kiln.md new file mode 100644 index 0000000..6fc2bda --- /dev/null +++ b/skills/hallmark/references/themes/kiln.md @@ -0,0 +1,108 @@ +--- +name: Kiln +slug: kiln +genre: atmospheric +paper: dark 13 40 +display: high-contrast-serif Boska +accent: warm 45 +posture: full-palette +keywords: kiln, ceramics, pottery, firing, glaze, heat, temperature, ceramics studio, craft, sensor, monitor, hardware, iot, warmth, dark, glow, schedule, workshop +material: near-black ground, cream ink, Boska over Geist, smoked wells, photographs lit by the work, a heat ramp that marks temperature, one ember signal +photo: warm sepia=50 sat=-12 con=8 exp=-6 +pictured: Workbench, Stage hero +--- + +# Kiln + +A dark workshop with the kiln door open a crack: a near-black ground, cream ink, Boska's cut high-contrast serif over a plain Geist, and heat only where something is hot. The photographs carry the fire; a ramp from ash through oxblood, ember and amber to white heat colours a temperature as it climbs. Warm in one place, cold everywhere else. It is not a dark luxury page with an orange button, and not a glowing gradient poster. + +## Tokens + +```css +:root { + --color-paper: oklch(13% 0.012 40); --color-paper-2: oklch(17.5% 0.016 40); --color-paper-3: oklch(22% 0.018 40); + --color-ink: oklch(94% 0.02 80); --color-ink-2: oklch(84% 0.025 70); --color-muted: oklch(72% 0.03 60); + --color-rule: oklch(96% 0.01 80 / 0.12); + --color-accent: oklch(70% 0.2 45); --color-accent-ink: oklch(14% 0.02 40); --color-focus: oklch(76% 0.19 56); + --heat-0: oklch(12% 0.012 40); --heat-1: oklch(22% 0.07 22); --heat-2: oklch(40% 0.16 27); --heat-3: oklch(60% 0.21 36); + --heat-4: oklch(76% 0.19 56); --heat-5: oklch(89% 0.14 78); --heat-6: oklch(98% 0.04 95); + --font-display: "Boska", "Iowan Old Style", Georgia, serif; --font-body: "Geist", ui-sans-serif, system-ui, sans-serif; + --font-outlier: "Geist Mono", ui-monospace, monospace; + --radius-card: 28px; --radius-well: 16px; --radius-pill: 999px; --rule-hair: 1px; + --shadow-card: 0 50px 90px -30px oklch(8% 0.01 40 / 0.5); + --tracking-display: -0.02em; --display-weight: 500; +} +``` + +Three colourways, stated in the stamp (`kiln: ember`). + +| Colourway | Ground, ink, accent | +| --- | --- | +| `ember` (default) | the block above | +| `bisque` | ground `oklch(96.5% 0.014 80)`, ink `oklch(20% 0.02 40)`, accent `oklch(54% 0.17 62)` with the ground as its text; the ramp starts at `oklch(90% 0.035 75)`; wells turn bone | +| `reduction` | ground `oklch(21% 0.06 22)`, ink `oklch(95% 0.02 85)`, accent `oklch(84% 0.12 62)`; the ramp begins at the ground | + +## Type + +- **Display:** Boska 500, `--tracking-display`, line-height 1.04, sentence case, roman, one colour per head; a statement set in it may run to `--text-display` at line-height 1.0. +- **Figures:** a temperature, a firing time or the price that carries the story is Boska 500, lining and tabular, at -0.03em, its unit (°C, h, £) in the same face; a lone figure may run twice the hero head. +- **Body:** Geist 400 and 500 at 16 to 18px, line-height 1.55. +- **Labels, captions, axis ticks, table heads:** Geist 500 a step smaller, sentence case, untracked, in `--color-muted`. Geist Mono only inside code. + +## Surfaces + +- 1px `--color-rule` between rows, on a well's edge and on a chart's grid; no rule brighter than that. +- Radius 28px on photographs and built screens, scaled down with the viewport; `--radius-well` on wells and inputs; pills on controls. +- Wells are smoked: `--color-paper-2` a clear step above the ground, a 1px rule edge, no shadow, never blurred, never nested. `--shadow-card`, a deep low drop, only under a built screen standing on the ground or a photograph, never with a ring. +- Heat marks temperature and nothing else: the ramp colours a firing curve in steps, each band of degrees its own colour, oxblood low to white heat at the peak, and a range track (three stops). It never fills a box, a band, a slot or the ground, and no text sits on it. +- Bands: a `--color-paper-2` band, two a page at most. +- Photographs: the work, close and in low light: a kiln at temperature, a loaded kiln, glaze, pots on a shelf, hands in clay, lit by the kiln, a bench lamp or a window, shadows falling into the ground. A 28px frame with a 1px inset ring of cream at 8%; type on one sits only on its dark side, over a paper scrim at 40 to 65%. + +## Range + +- A firing schedule as rows: each segment's rate and target in Boska figures, keyed by a short bar of the ramp step its target reaches. +- A reading or a warning set as a statement: Boska at `--text-display` across ten columns, cream on the ground, the hour and the kiln beside it in Geist; nothing else on the screen. +- A log as a full-width table: date, firing and cone in Geist, the peak in Boska keyed to its ramp step, a sparkline of the whole curve per row in `--color-ink-2`. +- A price or a temperature as one figure on a smoked band, the action beside it. + +## Controls + +- The pair: an ember pill (`--color-accent` with `--color-accent-ink` text, Geist 500), 50px tall, beside a ghost pill with a 1px inset `--color-rule` ring and cream text. +- Inputs are smoked wells at 16px radius; a range input runs a 2px track filled along the ramp under a 28px ember thumb. +- Ember is only ever a fill: the primary, a thumb, the live point on a curve, the focus ring in `--color-focus`. Every letter stays cream. + +## Motion + +Slow and thermal: colour changes run `--dur-long` on `--ease-out`, controls answer over `--dur-short`. Nothing pulses, flickers or glows on hover. + +## Voice + +Calm and physical, in a potter's words: the cone, the degrees, the hour, the load. Name the firing, never the feeling. + +## Do-nots + +- Never the ramp as a fill: no heat gradient behind text, on the ground, in a slot or across a band. +- Never orange type; the ember is a fill, and every letter stays cream. +- Never a brown or warm-lit ground; it stays near-black so the heat has somewhere to rise from. +- Never a bright, flat-lit photograph or a pot on white seamless. +- Never a third hue beside the ramp. +- Never a photograph on every screen: the fire lives in the curve and the figures too. + +## Build hint + +```html + +``` + +```css +h1, h2, h3 { font-weight: var(--display-weight); line-height: 1.04; } +.btn { display: inline-flex; align-items: center; min-height: 50px; padding: 0 var(--space-lg); border-radius: var(--radius-pill); font-weight: 500; transition: background-color var(--dur-short) var(--ease-out); } +.btn--primary { background: var(--color-accent); color: var(--color-accent-ink); } +.btn--ghost { background: transparent; color: var(--color-ink); box-shadow: inset 0 0 0 var(--rule-hair) var(--color-rule); } +.well { background: var(--color-paper-2); border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-well); } +.figure { font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: -0.03em; font-variant-numeric: lining-nums tabular-nums; } +.photo { border-radius: min(2vw, var(--radius-card)); outline: var(--rule-hair) solid color-mix(in oklab, var(--color-ink) 8%, transparent); outline-offset: -1px; } +.scrim { background: linear-gradient(to top, color-mix(in oklab, var(--color-paper) 65%, transparent), transparent 55%); } +.range-track { background: linear-gradient(to right, var(--heat-2), var(--heat-4), var(--heat-6)); } +::selection { background: color-mix(in oklab, var(--color-accent) 35%, transparent); } +``` diff --git a/skills/hallmark/references/themes/loom.jpg b/skills/hallmark/references/themes/loom.jpg new file mode 100644 index 0000000..6b3060b Binary files /dev/null and b/skills/hallmark/references/themes/loom.jpg differ diff --git a/skills/hallmark/references/themes/loom.md b/skills/hallmark/references/themes/loom.md new file mode 100644 index 0000000..5440247 --- /dev/null +++ b/skills/hallmark/references/themes/loom.md @@ -0,0 +1,106 @@ +--- +name: Loom +slug: loom +genre: editorial +paper: light 95 85 +display: roman-serif Libre Caslon Display +accent: cool 266 +posture: committed +keywords: weaving, textile, linen, wool, weaving studio, cloth, craft, atelier, handmade, natural, indigo, fabric, by the metre, workshop, maker, slow, commission, interiors, samples +material: ecru paper with sand steps, warm near-black ink, Libre Caslon Display heads and prices over Hanken Grotesk, thin rules and one ink rule, cloth photographed close in window light, one deep indigo +photo: natural sat=-12 con=-4 +pictured: Narrative Workflow, Poster hero +--- + +# Loom + +A weaving studio speaking quietly: ecru paper, Caslon cut for display with a book's calm over a plain Hanken Grotesk, thin rules, and one deep indigo, the colour of dyed yarn, that arrives as a band or a button and never as a wash. The cloth is photographed close in window light; nothing is drawn to stand in for it. It reads crafted because the page is ruled like a pattern book. It is not a cream-and-terracotta craft page and not a linen photograph behind everything. + +## Tokens + +```css +:root { + --color-paper: oklch(95.5% 0.014 85); --color-paper-2: oklch(92% 0.022 84); --color-paper-3: oklch(85% 0.032 80); + --color-ink: oklch(21% 0.012 60); --color-ink-2: oklch(31% 0.012 60); --color-muted: oklch(46% 0.014 62); + --color-rule: oklch(83% 0.022 84); --color-rule-ink: oklch(21% 0.012 60); + --color-accent: oklch(34% 0.115 267); --color-accent-2: oklch(43% 0.125 267); --color-accent-ink: oklch(95.5% 0.014 85); --color-focus: oklch(43% 0.15 267); + --font-display: "Libre Caslon Display", "Libre Caslon Text", ui-serif, Georgia, serif; --font-body: "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif; + --font-outlier: "DM Mono", ui-monospace, monospace; + --radius-card: 0; --radius-pill: 0; --rule-hair: 1px; --rule-ink: 2px; + --shadow-card: none; + --tracking-display: -0.01em; --display-weight: 400; +} +``` + +Three colourways, stated in the stamp (`loom: ecru`). + +| Colourway | Paper, ink, indigo | +| --- | --- | +| `ecru` (default) | the block above | +| `indigo` | paper `oklch(34% 0.10 266)`, ink ecru `oklch(95% 0.015 85)`, rule `oklch(50% 0.09 266)`; the button turns ecru with indigo text | +| `oat` | paper `oklch(88% 0.04 80)`, ink `oklch(15% 0.01 60)`, rules in the ink at 1px, indigo `oklch(38% 0.10 266)` kept to a rule and a button | + +## Type + +- **Display:** Libre Caslon Display 400 for the h1, every h2 and any price or figure at 40px or more, `--tracking-display`, line-height 1.04 (1.0 on a hero head of two lines), sentence case, roman. The face has one weight and no italic; never synthesise either, and never set it under 32px, where its hairlines break up. +- **Item titles (h3):** Hanken Grotesk 500 at `--text-title`, line-height 1.25, the ink. +- **Body:** Hanken Grotesk 400 and 500 at 16 to 18px, line-height 1.5; the lead in `--color-muted`. +- **Labels, captions, tags, table heads:** Hanken Grotesk 500 a step smaller, sentence case, untracked, in `--color-muted`. DM Mono only for figures that compare in a row (widths in centimetres, grams per metre, metres on the beam) and for code. + +## Surfaces + +- 1px rules: `--color-rule` between rows; a `--rule-ink` line in the ink above a list's first row, under a table's head and under the nav; no borders on wells. +- Square everywhere: radius 0 on wells, photographs, inputs and controls. +- Flat: depth is a paper step, `--color-paper-2` as a band or well and sand (`--color-paper-3`) as a deeper well; nothing casts a shadow. +- Bands: a `--color-paper-2` band, or one indigo band (`--color-accent` ground, `--color-accent-ink` text). Two a page at most. +- Photographs: the cloth and the loom, close and in side light from a window: the weave filling the frame, warp on the beam, a folded length, yarn on cones; the studio wide once. Colour kept true and softened a little (the `photo:` line). Square, an inset outline of ink at 8%, no shadow; captions beneath in the label style carry a fact (the fibre, the price a metre); type sits on a photograph only over an ink scrim at its calmest edge. +- No texture: the photographs carry the weave. + +## Range + +- **The specification as ruled rows:** fibre, width, weight, lead time and price as a pattern-book sheet, the label on the left in Hanken, the value in Caslon at title size and up, the price row set largest; an ink rule above the first row. +- **The price as a figure:** the price a metre in Caslon at display size beside the sum worked out in rows (metres, rate, total), on a sand well or on the indigo band where the order is placed. +- **Time as a ruled scale:** a lead time drawn as weeks on a hairline scale in DM Mono, the span the cloth is on the loom as a sand bar and the window it lands in as an indigo line; a chart of the prompt's own weeks, never a drawn thread. +- **A comparison in two columns:** linen beside wool, parted by one ink rule, rows aligned. + +## Controls + +- The pair: an indigo-filled square button in Hanken Grotesk 500 with ecru text beside a text link with a 2px bottom border in the text colour. On indigo the button turns ecru with indigo text. +- Links lift their 2px underline into `--color-accent` on hover; inputs are square with a 1px `--color-rule` border and the indigo focus ring, ecru on the indigo band. +- Indigo is a fill or a line: the primary, one band, an underline on hover, the focus ring. + +## Motion + +Nothing moves except state: an underline turns indigo and the primary lightens to `--color-accent-2`, over `--dur-short` on `--ease-out`, once. + +## Voice + +The weaver speaking plainly at the loom: the fibre, the metre, the weeks, the room the cloth is for. Prices and times said once, nothing sold hard. + +## Do-nots + +- Never indigo as a page wash or a tint on the ecru colourway; it is a band, a line or a fill. +- Never a mono label voice; widths and weights earn the mono, the captions do not. +- Never a ruler, a warp or a thread pattern drawn on the page; the cloth is photographed and the metre priced in type. +- Never a warm accent (rust, clay, terracotta) next to the ecru; sand is a paper, not an accent. +- Never a radius, a shadow or a soft card; Loom is rules, squares and paper steps. + +## Build hint + +```html + +``` + +```css +h1, h2, h3 { font-weight: 400; line-height: 1.04; font-synthesis: none; } +.num { font-family: var(--font-outlier); font-variant-numeric: tabular-nums; } +.btn { display: inline-flex; align-items: center; padding: var(--space-md) var(--space-lg); font: 500 var(--text-sm)/1 var(--font-body); background: var(--color-accent); color: var(--color-accent-ink); transition: background-color var(--dur-short) var(--ease-out); } +.btn:hover { background: var(--color-accent-2); } +.link { font-weight: 500; padding-block: var(--space-2xs); border-bottom: 2px solid currentColor; text-decoration: none; transition: border-color var(--dur-short) var(--ease-out); } +.link:hover { border-color: var(--color-accent); } +.photo img { outline: 1px solid color-mix(in oklab, var(--color-ink) 8%, transparent); outline-offset: -1px; } +.photo figcaption { margin-top: var(--space-sm); font: 500 var(--text-sm)/1.4 var(--font-body); color: var(--color-muted); } +.band--indigo { background: var(--color-accent); color: var(--color-accent-ink); } +.band--indigo .btn { background: var(--color-paper); color: var(--color-accent); } +.band--indigo :focus-visible { outline-color: var(--color-accent-ink); } +``` diff --git a/skills/hallmark/references/themes/lumen.jpg b/skills/hallmark/references/themes/lumen.jpg new file mode 100644 index 0000000..78856d2 Binary files /dev/null and b/skills/hallmark/references/themes/lumen.jpg differ diff --git a/skills/hallmark/references/themes/lumen.md b/skills/hallmark/references/themes/lumen.md new file mode 100644 index 0000000..9d24907 --- /dev/null +++ b/skills/hallmark/references/themes/lumen.md @@ -0,0 +1,103 @@ +--- +name: Lumen +slug: lumen +genre: atmospheric +paper: dark 12.5 290 +display: roman-serif Instrument Serif +accent: warm 62 +posture: restrained +keywords: inference, model, llm, ai tool, agent, voice, synthesis, api, gpu, serverless, runtime, tokens, latency, open models, developer, research lab, ml platform, dev tools, premium +material: violet-black ground, near-white ink, lowercase Instrument Serif heads a step large over Geist and Geist Mono, hairline wells, a faint blueprint grid, one molten brass signal and one rose verb +photo: duotone paper ink-2 +pictured: Map / Diagram, Settled hero +--- + +# Lumen + +A night console with a literary voice: a violet-black ground, near-white ink, Instrument Serif set all in lowercase and a step large over Geist, hairline wells and one molten brass signal. Cool dark, warm light: the warmth is rationed to the brass and one rose verb, so the page reads engineered and quietly lit at once. The product is the picture. It is not a neon dark mode, an orb on black, a glowing object, a purple poster or a serif magazine. + +## Tokens + +```css +:root { + --color-paper: oklch(12.5% 0.027 290); --color-paper-2: oklch(16% 0.03 290); --color-paper-3: oklch(20% 0.032 290); + --color-ink: oklch(96% 0.01 300); --color-ink-2: oklch(85% 0.017 298); --color-muted: oklch(69% 0.026 295); + --color-rule: oklch(27% 0.034 290); --color-rule-2: oklch(36% 0.04 292); --rule-blueprint: oklch(96% 0.01 300 / 0.05); + --color-accent: oklch(80% 0.15 62); --color-accent-2: oklch(72% 0.15 12); --color-accent-ink: oklch(14% 0.028 290); + --color-live: oklch(80% 0.13 155); --color-focus: oklch(80% 0.15 62); + --font-display: "Instrument Serif", ui-serif, Georgia, serif; --font-body: "Geist", ui-sans-serif, system-ui, sans-serif; + --font-outlier: "Geist Mono", ui-monospace, monospace; + --radius-card: 10px; --radius-pill: 999px; --rule-hair: 1px; + --shadow-card: 0 28px 64px -30px oklch(4% 0.02 290 / 0.8); + --tracking-display: -0.015em; --display-weight: 400; +} +``` + +A second drop, `day`: bone `oklch(97% 0.008 290)` under `oklch(18% 0.02 290)`, an indigo `oklch(46% 0.24 268)` signal with bone text, the verb in `oklch(56% 0.16 18)`. The stamp states the drop (`lumen: night`). + +## Type + +- **Display:** Instrument Serif 400, roman, all lowercase, `--tracking-display`, line-height 0.95 to 1.02. The face is narrow and light, so it sets one step large: section heads at `--text-display-s`, the hero head at its cap and beyond. Lowercase is the register for heads, nav, controls and labels; prose keeps sentence case so a model name survives. +- **Body:** Geist 400 and 500, `tabular-nums` wherever a figure appears. +- **Labels, captions, table heads:** Geist 400 a step smaller, lowercase, untracked, `--color-muted`. +- **Readouts and code:** Geist Mono 400 at 13px, lowercase, untracked: a measured value with its unit, a status, a model id, code. The mono is the machine speaking, never a label voice. +- **The verb:** the one accented word on the page, in the hero head only, always a verb, in `--color-accent-2` with a 1px underline that draws in (stamp `waive 38iii`). + +## Surfaces + +- Hairlines contain: 1px `--color-rule` on wells, rows and inputs, `--color-rule-2` on a control's edge; 10px radius on surfaces, pills on controls and tags. +- Depth is a lightness step from paper to paper-3; a surface that must lift trades its hairline for `--shadow-card` in the ground's own dark. Never a glow, a halo or a coloured shadow. +- Bands: `--color-paper-2`, two a page at most; no accent field, and a night page never takes a bone band. +- Photographs: one at most, a 21:9 band of the machines the work runs on (an aisle of racks, cabling, a lit rack face), printed in the ground's violet, 10px radius and a 1px rule, a caption naming the hardware beneath; no head on it. +- Texture: the blueprint grid, 1px `--rule-blueprint` lines on a 48px pitch, inside one well or band and never under running text (stamp `waive 47c`). No glass, no blur, no generated object standing in for the product. + +## Range + +- **A path as a diagram:** a real system drawn in hairline nodes and connectors: the slow path in muted mono, the product's path ruled in brass, each node a step the request really takes. +- **The product's own surface:** a request beside its response in one well split by a hairline, lowercase tabs, the status beneath as Geist Mono readouts; or a console screen at full size with its live state in `--color-live`. +- **A chart in a well:** over the blueprint grid, the variable in `--color-ink-2` at half strength, the one thing the product holds fixed as a brass line, the axis in mono. +- **A figure or a rate card:** one measured value in Instrument Serif at display size with its unit in mono, or rates as hairline rows of tabular figures under a lowercase head. + +## Controls + +- The control pair: a solid brass pill with `--color-accent-ink` text beside a hairline pill in `--color-rule-2`, both lowercase, 44 to 48px. +- Links take a brass underline on hover; inputs sit on `--color-paper` inside a band, 1px `--color-rule-2`, 10px radius, the brass focus ring. +- The brass stays under 5% of a screen: the primary fill, the focus ring, a link's hover, one line or readout. The rose belongs to the verb; `--color-live` to a live state only. + +## Motion + +One reveal: the verb's underline draws in once over `--dur-long`. Otherwise state only: a hairline pill takes `--color-paper-2` on hover, a streamed answer types once. No ambient loop, no breathing light, no stagger. + +## Voice + +Engineered, plain, specific: the model, the state, the unit, the price. Lowercase heads read like a note in a lab book, never cute. No exclamation marks. + +## Do-nots + +- Never a drawn or generated light: no orb, lamp, ring, halo or glowing object behind or beside a head. +- Never let the violet climb: a violet field or a violet-to-blue gradient is the generated look. +- Never colour a noun, never a second accented word; one verb, in the hero. +- Never sentence-case heads, and never a head at the plain section size; this face reads thin there. +- Never a warm ground or a third warm colour; the brass and the rose verb carry all the warmth. + +## Build hint + +```html + +``` + +```css +body { font-variant-numeric: tabular-nums; } +h1, h2, h3, nav, label, th, figcaption, .btn { text-transform: lowercase; } +h1, h2, h3 { font-weight: 400; } h2 { font-size: var(--text-display-s); line-height: 0.98; } +.verb { display: inline-block; color: var(--color-accent-2); } +.verb::after { content: ""; display: block; height: var(--rule-hair); background: currentColor; transform-origin: left; animation: draw var(--dur-long) var(--ease-out) both; } +@keyframes draw { from { transform: scaleX(0); } } +.btn { border-radius: var(--radius-pill); padding: var(--space-sm) var(--space-lg); font-weight: 500; } +.btn--primary { background: var(--color-accent); color: var(--color-accent-ink); } +.btn--secondary { box-shadow: inset 0 0 0 var(--rule-hair) var(--color-rule-2); color: var(--color-ink); } +.btn--secondary:hover { background: var(--color-paper-2); } +.well { background: var(--color-paper-2); border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-card); } +.blueprint { background-image: linear-gradient(var(--rule-blueprint) 1px, transparent 1px), linear-gradient(90deg, var(--rule-blueprint) 1px, transparent 1px); background-size: 48px 48px; } +.readout { font: 400 0.8125rem/1.5 var(--font-outlier); color: var(--color-ink-2); } +``` diff --git a/skills/hallmark/references/themes/manifesto.jpg b/skills/hallmark/references/themes/manifesto.jpg new file mode 100644 index 0000000..312f380 Binary files /dev/null and b/skills/hallmark/references/themes/manifesto.jpg differ diff --git a/skills/hallmark/references/themes/manifesto.md b/skills/hallmark/references/themes/manifesto.md new file mode 100644 index 0000000..85c2e6a --- /dev/null +++ b/skills/hallmark/references/themes/manifesto.md @@ -0,0 +1,101 @@ +--- +name: Manifesto +slug: manifesto +genre: editorial +paper: dark 13 60 +display: display-condensed Anton +accent: warm 28 +posture: committed +keywords: manifesto, statement, declaration, principles, beliefs, mission, movement, protest, cause, campaign, petition, activism, advocacy, rights, values, take a stand, bold launch, defiant, punk, record label +material: warm near-black ground, warm off-white ink, Anton capitals at poster size leaded tight over a quiet Public Sans body, hairlines, a heavy ink bar and square edges, one fighting red +photo: duotone paper ink con=24 +pictured: Manifesto, Ledge hero +--- + +# Manifesto + +A declaration printed on a dark sheet: a warm near-black ground, warm off-white ink, Anton capitals set as big as the width allows and leaded tight, a small plain Public Sans body, hairlines, one heavy ink bar, square edges and one fighting red. The force is the contrast between poster-size caps and quiet body text, and red spent sparingly; photographs print in the off-white ink, hard and close, like a pasted-up flyer. Nothing is decorated. It is not a protest-poster pastiche of stickers and torn paper, and not a dark product page with a red button. + +## Tokens + +```css +:root { + --color-paper: oklch(13% 0.01 60); --color-paper-2: oklch(17% 0.011 60); --color-paper-3: oklch(22% 0.012 60); + --color-ink: oklch(95% 0.014 85); --color-ink-2: oklch(84% 0.012 80); --color-muted: oklch(64% 0.016 65); + --color-rule: oklch(31% 0.014 60); + --color-accent: oklch(56% 0.228 28); --color-accent-deep: oklch(49% 0.2 28); --color-accent-text: oklch(64% 0.22 28); --color-accent-ink: oklch(98.5% 0.004 90); + --color-focus: oklch(64% 0.22 28); + --font-display: "Anton", "Impact", sans-serif; --font-body: "Public Sans", ui-sans-serif, system-ui, sans-serif; + --font-outlier: var(--font-body); + --radius-card: 0; --radius-pill: 0; --rule-hair: 1px; --rule-bar: 4px; --shadow-card: none; + --tracking-display: 0.004em; --display-weight: 400; --lh-tight: 0.9; --text-display: clamp(4.5rem, 12vw, 13rem); +} +``` + +## Type + +- **Display:** Anton 400, one weight, uppercase only, `--tracking-display`. Condensed caps take a step up: a Ledge or Corridor hero head sets at the theme's own `--text-display` (to 13rem), a statement as large as its longest line allows across the twelve columns, other heads one step over the shared scale. A head whose lines each sit in their own element and never wrap (`white-space: nowrap`, sized in `cqi`, stamp `waive 55b`) leads at `--lh-tight`; any head that can wrap leads at 1.02 (55a). +- **The red word:** one word on the whole page, inside the hero head, in `--color-accent-text` (stamp `waive 38iii`). Every other head is one colour. +- **Body:** Public Sans 400 and 600, plain, in `--color-ink-2`; a lead at 21px is the loudest it gets. +- **Labels, captions, table heads, meta, dates:** Public Sans 500 a step smaller, sentence case, untracked, `--color-muted`. No mono. + +## Surfaces + +- Hairlines divide: `--rule-hair` in `--color-rule` between rows and under heads like a broadsheet; one `--rule-bar` in ink under the nav or over a record; a red rule once a page at most. +- Radius 0 and no shadow anywhere: no boxed cards, no lift. A well is a `--color-paper-2` field under a hairline. +- Bands: `--color-paper-2`, or the page's one red-inverted surface, a red field with `--color-accent-ink` type; two a page at most. +- Photographs: close and hard-lit, the thing the page argues for (a board, a tool, hands at a repair), sharp, no faces, cropped tight so the edges fall to dark. They print in the off-white ink (the `photo:` duotone), square, in a 1px `--color-rule` ring, full-bleed or not at all. A head crosses one only over its darkest third, on a `--color-paper` plate; red never touches a picture. +- Everything warm-tinted (hue 60 to 90), never neutral grey; no texture, no ornament. + +## Range + +- **The record:** demands, principles or clauses as full-width rows under hairlines, each numeral in Anton at section size in the muted ink, the clause in Anton at title size, its one plain line beside it. +- **The poster line:** one date, figure or slogan in Anton across all twelve columns, as big as the line allows, with Steps or a short line beneath; the size is the argument. +- **A stacked creed:** three short lines of Anton locked at `--lh-tight`, each its own nowrap line, flush left on the sheet with nothing else beside it. +- **The pledge:** a sentence in Anton with the name blank set inside it, on the one red field, the email and its button beneath. + +## Controls + +- Square, ruler-drawn controls: a flat red block with `--color-accent-ink` text (`--color-accent-deep` on hover) beside a hairline block in `--color-ink-2` that inverts to red on hover. On the red field the primary turns to the ground with ink text. +- Links are ink with a 1px underline that turns `--color-accent-text` on hover; inputs are square, hairline-bordered, on `--color-paper-2`. +- Outside the red field, red stays under 5% of a screen: the red word, the primary control, the focus ring, one red rule. + +## Motion + +One clip reveal: the hero head wipes upward once (`clip-path: inset()`, never a soft fade) over `--dur-long` on `--ease-out`. Nothing else moves; no bounce, no parallax, no red pulsing. + +## Voice + +Imperative, short, declarative: fighting words, verbs over adjectives, the demand in the reader's own nouns. No hedging; state it and stand behind it. + +## Do-nots + +- Never a second accent; red is the only colour. +- Never a red flood beyond the one inverted surface; red is a signal, not a background. +- Never a light ground; the sheet stays dark. +- Never ornament: no fleurons, stickers, torn edges, hard-offset shadows, or a photograph in colour or toned red. +- Never a serif, lowercase or title-case display, and never a timid head: if Anton sits under 64px at 1440 it has stopped shouting. + +## Build hint + +```html + +``` + +```css +body { color: var(--color-ink-2); } +h1, h2, h3 { font-weight: 400; text-transform: uppercase; line-height: 1.02; color: var(--color-ink); } +.display { line-height: var(--lh-tight); container-type: inline-size; } +.display > span { display: block; white-space: nowrap; } +.display .hot { color: var(--color-accent-text); } +.bar { border-bottom: var(--rule-bar) solid var(--color-ink); } +.btn { border: var(--rule-hair) solid transparent; background: none; border-radius: 0; padding: var(--space-sm) var(--space-lg); font-weight: 600; } +.btn--primary { background: var(--color-accent); color: var(--color-accent-ink); } +.btn--primary:hover { background: var(--color-accent-deep); } +.btn--secondary { border-color: var(--color-ink-2); color: var(--color-ink); } +.btn--secondary:hover { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); } +.band--red { background: var(--color-accent); color: var(--color-accent-ink); } +.reveal { animation: wipe var(--dur-long) var(--ease-out) both; } +@keyframes wipe { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0); } } +::selection { background: var(--color-accent); color: var(--color-accent-ink); } +``` diff --git a/skills/hallmark/references/themes/midnight.jpg b/skills/hallmark/references/themes/midnight.jpg new file mode 100644 index 0000000..756a43f Binary files /dev/null and b/skills/hallmark/references/themes/midnight.jpg differ diff --git a/skills/hallmark/references/themes/midnight.md b/skills/hallmark/references/themes/midnight.md new file mode 100644 index 0000000..6f159b3 --- /dev/null +++ b/skills/hallmark/references/themes/midnight.md @@ -0,0 +1,97 @@ +--- +name: Midnight +slug: midnight +genre: atmospheric +paper: dark 14 264 +display: grotesk-sans Mona Sans +accent: cool 230 +posture: committed +keywords: render, 3d, animation, vfx, film, video, frames, pipeline, generative, ai tool, model playground, dark mode, nocturnal, late-night, after-hours, overnight, moody, cinematic, cerebral, calm, technical, midnight +material: midnight-blue ground to every edge, cool white ink, Mona Sans expanded at 300 over its normal width, square-cut surfaces in lightness steps, photographs as moonlight, one azure signal +photo: duotone paper ink-2 +pictured: Narrative Workflow, Settled hero +--- + +# Midnight + +A cold, calm night instrument whose blue is the ground itself: deep midnight blue to every edge, cool white ink, Mona Sans at an expanded 300 for the heads like titles on a film, the same family at its normal width for reading, surfaces cut square in steps of lighter blue, one azure signal. Photographs arrive as moonlight, shadows in the ground's blue and highlights in the ink. It is not a neon dark mode, not frosted glass, and not a black page with a blue button. + +## Tokens + +```css +:root { + --color-paper: oklch(14% 0.048 264); --color-paper-2: oklch(18.5% 0.052 264); --color-paper-3: oklch(23% 0.055 264); + --color-ink: oklch(95% 0.016 250); --color-ink-2: oklch(88% 0.05 245); --color-muted: oklch(73% 0.04 256); + --color-rule: oklch(29% 0.058 264); --color-rule-2: oklch(40% 0.06 262); + --color-accent: oklch(80% 0.11 230); --color-accent-2: oklch(58% 0.1 236); --color-accent-ink: oklch(16% 0.05 264); --color-focus: oklch(84% 0.12 228); + --font-display: "Mona Sans", ui-sans-serif, system-ui, sans-serif; --font-body: var(--font-display); --font-outlier: var(--font-display); + --radius-card: 0; --radius-pill: 0; --rule-hair: 1px; + --shadow-card: 0 24px 48px -24px oklch(6% 0.04 264 / 0.7); + --tracking-display: -0.015em; --display-weight: 300; --display-stretch: 125%; +} +``` + +## Type + +- **Display:** Mona Sans 300 at the expanded width on `h1` and `h2`, `--tracking-display`, line-height 1.04, sentence case, roman. The wide light cut is the voice; a long head steps down to `--text-display-s` rather than closing up. Item titles take 500 at the normal width. +- **Figures that are the point:** the display cut at 300, tabular, from `--text-display` up to twice it, tracking -0.03em, the unit beside it at the normal width 400 in `--color-ink-2`. +- **Body:** Mona Sans 400 at the normal width, line-height 1.6. One family at two widths: the cold comes from the ground and the ink, never from a second face. +- **Labels, table heads, meta, status:** 500 a step smaller, sentence case, untracked, `--color-muted`. Tabular figures wherever numbers compare; no mono anywhere. + +## Surfaces + +- Depth is a step of lightness from paper to paper-2 to paper-3, cut square at radius 0 like a frame; a lifted surface takes `--shadow-card` in the ground's own dark. No outline around a surface; a 1px `--color-rule` parts rows in a table or a list and nothing else. +- Bands: `--color-paper-2` or `--color-paper-3`, two a page at most; never an azure field and never a light band. +- Photographs: low-key light after dark, architecture at night, a lit stairwell, a long corridor; one subject held still, cropped wide or tall. The duotone runs from paper to ink-2, so a daylight picture turns to a pale sheet: pick night. Square frames, a 1px inset outline of ink at 8%, a label-style caption giving the hour or the frame. +- No texture, no glass, no blur, no bloom. + +## Range + +- **A figure as the statement:** one real number in the display cut at up to twice `--text-display`, alone on the ground with its unit and one line; the wide light cut makes a price read like a title card. +- **The product from another angle:** a detail of the interface cropped large on a paper-2 well (a job sheet, a meter, a contact sheet), stepped in lightness, never framed in a drawn window. +- **Steps or a night log:** an `
      ` of stages or hours, each head in the expanded cut, figures tabular, the current one in ink and the rest in muted; the meter (a 2px `--color-rule-2` track, an `--color-accent-2` or azure fill) is the only line that moves. +- **Rows and forms on the ground:** hairline rows with expanded titles on the left and the normal width on the right; a calculator on a paper-2 band whose answer is a display-cut figure. + +## Controls + +- The pair: a solid azure rectangle with `--color-accent-ink` text beside a secondary outlined in `--color-rule-2`, both square, 500. A segmented choice is the same square, filled ink when chosen. +- Links take an azure underline on hover; inputs sit on the paper with a 1px `--color-muted` edge, square. +- The azure stays under 5%: the one primary control, a link's hover, one meter value or one figure. Never a field, a gradient or a second light. + +## Motion + +One settle: the hero's text fades from 0.6 to 1 over `--dur-long` on `--ease-out`, once, from a visible default. Hover steps a surface one lightness up. A value changes when its source does; nothing slides, loops or follows the cursor. + +## Voice + +Cool and spare, the night shift's register: the hour, the count, the cost. Short declaratives; a number always carries its unit or its time. Never hype. + +## Do-nots + +- Never a warm accent; the light here is cold. +- Never a heavy display weight or a head at the normal width; the expanded 300 is the face. +- Never a lamp: no radial glow, no halo, no lit edge on a card. +- Never a rounded corner or a light section; dark and square end to end. +- Never a photograph in its own colours beside the duotone, and never a daylight scene. + +## Build hint + +```html + +``` + +```css +h1, h2 { font-weight: var(--display-weight); font-stretch: var(--display-stretch); line-height: 1.04; } +h3 { font-weight: 500; } +.fig { font-weight: var(--display-weight); font-stretch: var(--display-stretch); letter-spacing: -0.03em; line-height: 0.9; font-variant-numeric: tabular-nums; } +.well { background: var(--color-paper-2); border-radius: var(--radius-card); } +.well--raised { background: var(--color-paper-3); box-shadow: var(--shadow-card); } +.btn { border: var(--rule-hair) solid transparent; background: none; border-radius: var(--radius-pill); padding: var(--space-sm) var(--space-lg); font-weight: 500; color: var(--color-ink); transition: background-color var(--dur-short) var(--ease-out); } +.btn--primary { background: var(--color-accent); color: var(--color-accent-ink); } +.btn--secondary { border-color: var(--color-rule-2); } +.btn--secondary:hover { background: var(--color-paper-2); } +.meter { height: 2px; background: var(--color-rule-2); } .meter > span { display: block; height: 100%; background: var(--color-accent); } +a:hover { text-decoration-color: var(--color-accent); } +.settle { animation: settle var(--dur-long) var(--ease-out) both; } +@keyframes settle { from { opacity: 0.6; } } +``` diff --git a/skills/hallmark/references/themes/newsprint.jpg b/skills/hallmark/references/themes/newsprint.jpg new file mode 100644 index 0000000..923c7fb Binary files /dev/null and b/skills/hallmark/references/themes/newsprint.jpg differ diff --git a/skills/hallmark/references/themes/newsprint.md b/skills/hallmark/references/themes/newsprint.md new file mode 100644 index 0000000..86ef15b --- /dev/null +++ b/skills/hallmark/references/themes/newsprint.md @@ -0,0 +1,102 @@ +--- +name: Newsprint +slug: newsprint +genre: editorial +paper: light 94 92 +display: slab-serif Zilla Slab +accent: warm 32 +posture: restrained +keywords: newspaper, broadsheet, journalism, publication, magazine, newsletter, local news, op-ed, opinion, essay, longform, column, reportage, press, gazette, review, dispatch, literary +material: pale newsprint stock, warm black ink, Zilla Slab heads over a Spectral body with Libre Franklin agate for listed figures, justified columns under hairline column rules, a double rule, one dried-brick signal +photo: mono +pictured: Broadsheet Front, Stage hero +--- + +# Newsprint + +A broadsheet in a browser: pale newsprint stock, warm black ink, a blunt Zilla Slab head over a calm Spectral book serif, hairlines and column rules for ordinary breaks, a double rule for the major ones, and a dried-brick signal that never fills anything. Photographs run in black and white with a caption, as a paper prints them. It reads reported and edited, not decorated. It is not a magazine of rounded cards, not a sans-serif blog, and not the cream editorial template with a terracotta button. + +## Tokens + +```css +:root { + --color-paper: oklch(94% 0.011 92); --color-paper-2: oklch(90.5% 0.015 88); --color-paper-3: oklch(87% 0.017 86); + --color-ink: oklch(17% 0.012 60); --color-ink-2: oklch(27% 0.012 58); --color-muted: oklch(46% 0.014 60); + --color-rule: oklch(68% 0.016 75); --color-rule-2: oklch(34% 0.012 60); + --color-accent: oklch(44% 0.13 32); --color-accent-ink: oklch(95% 0.012 90); --color-focus: oklch(48% 0.17 32); + --font-display: "Zilla Slab", ui-serif, Georgia, serif; --font-body: "Spectral", ui-serif, Georgia, serif; + --font-outlier: "Libre Franklin", ui-sans-serif, sans-serif; + --radius-card: 0; --radius-pill: 0; --rule-hair: 1px; + --shadow-card: none; + --tracking-display: -0.02em; --display-weight: 700; +} +``` + +## Type + +- **Display:** Zilla Slab 700, `--tracking-display`, line-height 1.05, sentence case, roman, for heads, decks and the masthead. Bracketed serifs at nearly stem weight: hold the one weight and let the shared scale make the hierarchy. +- **Body:** Spectral 400 and 500 at 1.0625rem, line-height 1.55. The blunt slab over the calm book serif is the voice; Spectral italic is emphasis in running text only. +- **Bylines, datelines, captions, table heads, meta:** Spectral 500 a step smaller, sentence case, untracked, `--color-muted`. +- **Agate, Libre Franklin 500:** the paper's listings face, only for figures in a ruled list or table (times, prices, counts, results), tabular and right-aligned, the size of the text beside it. Never a label, a head or running text. Three weights a page: 400, 500, 700. +- **Columns:** running text of more than one paragraph may set in two or three justified columns with `hyphens: auto` and a hairline column rule, each 28 to 40ch. +- **Drop cap:** may open one long passage, a Zilla Slab initial about three lines tall in ink or brick, once a page at most. + +## Surfaces + +- Hairlines in `--color-rule` carry ordinary breaks, and text set in columns takes a hairline column rule; the double rule, two 1px lines in `--color-rule-2` 2px apart, is the heaviest divider the theme owns and marks the major breaks. +- Rules, never boxes: radius 0 and no shadow anywhere. A well is a `--color-paper-2` field ruled top and bottom, never a bordered card. +- Bands: `--color-paper-2`, or one `--color-ink` band with paper type; two a page at most, never a brick field. +- Photographs: black-and-white documentary, the place and its people at a working distance or from behind, in available light, the tones running from paper white to ink; the lead picture wide, the rest cropped to the story. Square, a 1px `--color-rule` border, no shadow. Every picture takes a one-line caption beneath it in the byline voice, a fact; type never sits on a photograph. +- Texture, if any: the faintest fibre grain (`texture.md` § 1) on one band, off by default and never under running text. + +## Range + +- **Front page in columns:** one head at `--text-display-s` across the full measure over three justified columns of Spectral, a drop cap, a dateline in the byline voice; a 1px column rule between, a double rule above. +- **Listings as agate:** a week, a programme or a price list as ruled rows, the day or item in Zilla Slab at title size, the line in Spectral, the figure in Franklin agate at the right edge. +- **Figures as a box score:** the publication's own numbers in Zilla Slab at display size between two double rules, each over one Spectral line, parted by column rules. +- **The ink band:** a notice reversed in paper on `--color-ink` (a price, a call to subscribe) with its form; the brick becomes a hairline on it, never a fill. + +## Controls + +- The control pair: an ink-filled rectangle with paper type beside one ruled top and bottom in ink, both square, set in Zilla Slab 700 a step smaller. +- Links in brick with a 1px brick underline that thickens on hover; inputs are square with a 1px `--color-rule-2` border on `--color-paper-2`. +- The brick stays under 5%: links, the focus ring, a short tick on a rule; never a fill. + +## Motion + +State only: a link's underline thickens on hover. No reveal, no counter, nothing that types or scrolls itself. + +## Voice + +Specific and declarative, with a dry editorial wit: name the place, the day and the fact, and write heads a sub-editor would pass, in sentence case and full stops. + +## Do-nots + +- Never a sans-serif body or a sans label voice; Spectral does all the small work. +- Never a cool or bright accent; dried brick is furniture, not a shout. +- Never boxed cards, shadows or rounded corners; rules carry the structure. +- Never Zilla Slab under 700 or in italic; one blunt roman weight. +- Never a colour, toned or tinted photograph, and never one without its caption. + +## Build hint + +```html + +``` + +```css +h1, h2, h3 { font-weight: var(--display-weight); } +.rule--double { box-sizing: content-box; height: 2px; border: 0; border-block: var(--rule-hair) solid var(--color-rule-2); } +.cols { columns: 3 18rem; column-gap: var(--space-xl); column-rule: var(--rule-hair) solid var(--color-rule); text-align: justify; hyphens: auto; } +.agate { font: 500 1em/1 var(--font-outlier); font-variant-numeric: tabular-nums; } +.dropcap::first-letter { float: left; font: 700 3.4em/0.8 var(--font-display); padding-right: 0.06em; } +.btn { border: 0; background: none; border-radius: 0; padding: var(--space-md) var(--space-lg); font: 700 0.9375rem/1 var(--font-display); } +.btn--primary { background: var(--color-ink); color: var(--color-paper); } +.btn--secondary { border-block: var(--rule-hair) solid var(--color-ink); color: var(--color-ink); } +.well { background: var(--color-paper-2); border-block: var(--rule-hair) solid var(--color-rule); } +figure img { border: var(--rule-hair) solid var(--color-rule); } +figcaption { font: 500 var(--text-sm)/1.4 var(--font-body); color: var(--color-muted); padding-top: var(--space-xs); } +a { color: var(--color-accent); text-decoration-color: var(--color-accent); text-underline-offset: 0.16em; } +a:hover { text-decoration-thickness: 2px; } +::selection { background: color-mix(in oklab, var(--color-accent) 20%, transparent); } +``` diff --git a/skills/hallmark/references/themes/overprint.jpg b/skills/hallmark/references/themes/overprint.jpg new file mode 100644 index 0000000..0540301 Binary files /dev/null and b/skills/hallmark/references/themes/overprint.jpg differ diff --git a/skills/hallmark/references/themes/overprint.md b/skills/hallmark/references/themes/overprint.md new file mode 100644 index 0000000..41f5105 --- /dev/null +++ b/skills/hallmark/references/themes/overprint.md @@ -0,0 +1,101 @@ +--- +name: Overprint +slug: overprint +genre: playful +paper: light 91.5 92 +display: grotesk-heavy Anybody +accent: cool 212 +posture: full-palette +keywords: venue, gigs, live music, festival, music, label, print studio, bar, club, poster, tickets, events, nightlife, two-colour, screenprint, punk, zine, loud, listings, door +material: grey newsprint stock, near-black ink, wide heavy Anybody capitals over Archivo, flat square fills, a teal pass and an orange pass that print moss where they cross, photographs pulled through one pass +photo: mono con=30 +pictured: Marquee Hero, Poster hero +--- + +# Overprint + +A two-colour screenprint on cheap stock: grey newsprint, near-black ink, wide heavy Anybody capitals over a plain Archivo body, and two transparent flat inks, teal and orange, that print a deep moss where they cross. Photographs print hard through one pass, as a bill prints them. All in register, flat and square: the noise is scale and two inks, never effects. It is not a retro poster pastiche, a misregistered print or a neon flyer. + +## Tokens + +```css +:root { + --color-paper: oklch(91.5% 0.014 92); --color-paper-2: oklch(87.5% 0.018 90); --color-paper-3: oklch(83% 0.021 88); + --color-ink: oklch(17% 0.008 60); --color-ink-2: oklch(29% 0.01 60); --color-muted: oklch(42% 0.012 70); + --color-rule: oklch(78% 0.02 85); + --color-accent: oklch(65% 0.12 212); --color-accent-ink: oklch(17% 0.008 60); --color-focus: oklch(44% 0.1 220); + --color-accent-2: oklch(71% 0.19 50); --color-accent-2-ink: oklch(17% 0.008 60); + --color-mix: oklch(35.5% 0.121 142); + --blend: multiply; --texture-opacity: 0.06; + --font-display: "Anybody", ui-sans-serif, sans-serif; --font-body: "Archivo", ui-sans-serif, sans-serif; + --font-outlier: "Archivo Narrow", ui-sans-serif, sans-serif; + --radius-card: 0; --radius-pill: 0; --rule-hair: 1px; --rule-bar: 4px; + --shadow-card: none; + --tracking-display: -0.01em; --display-weight: 900; --display-stretch: 140%; +} +``` + +Both passes are fills under ink type, never type, and the moss is what the multiply prints where they cross, never painted. Two stocks, stated in the stamp (`overprint: newsprint`): newsprint, the tokens above; or black stock, `oklch(20% 0.01 280)` under `oklch(95% 0.01 90)`, the blend flipped to screen so the overlap goes pale, passes in yellow `oklch(88% 0.17 95)` and aqua `oklch(78% 0.13 200)`, focus in the aqua. + +## Type + +- **Display:** Anybody 900, set wide (`--display-stretch`, 130 to 150%), uppercase, line-height 1.0 to 1.02, `--tracking-display`. Figures, times and prices take it at 150% with `tabular-nums`. +- **Body:** Archivo 400 and 600, 16 to 17px, line-height 1.5, in ink. +- **Small print:** Archivo Narrow 600 a step smaller, sentence case, untracked, for days, hours and table heads: the label face. Captions are Archivo. No mono. + +## Surfaces + +- Two passes: everything coloured is pass 1 or pass 2, a flat fill at `mix-blend-mode: var(--blend)`, so where the two cross the stock prints `--color-mix`; type never sits on the moss. +- Rules: the 4px ink `--rule-bar` across the top of a list, a table, a figure row or the nav; `--rule-hair` in `--color-rule` between rows. +- Radius 0, no shadow, no gradient but a photograph's scrim: depth by overprint, never a lift. +- Bands: `--color-paper-2`, the ink with paper type, or one pass field with ink type; two a page. +- Photographs: the night, close or from behind, in the light it was played under (a crowd under one wash, hands on a fretboard, the bar at doors); never posed, never a face to the lens. Grey and hard, multiplied onto one pass field so lights print teal or orange and shadows ink; square, full-bleed or to a column edge, no frame. Type sits beside a picture, or knocks out to the stock over its darkest part on an ink scrim. +- Texture: grain (`texture.md` § 1) at `--texture-opacity` on a band, a pass field or a photograph, never under running text. + +## Range + +- **Figures as a bill:** the prompt's own times, capacity or price set at poster scale in wide Anybody, each figure on its own pass field; two fields cross by a column so the overlap prints moss, and no letter stands in it. +- **The listing as a ruled table:** under the 4px bar, heads in Archivo Narrow, the act in wide capitals at title size, nights and prices in tabular figures; an on-sale cell takes pass 1, a sold-out cell pass 2. +- **Steps as numbered bills:** a process as three or four cells under the bar, each numeral wide and heavy, each cell flooded in one pass, alternating. +- **A band of ink:** the black field with stock type and grain, holding one statement in wide capitals or a form with a pass-1 control. + +## Controls + +- The control pair: a pass-1 fill with `--color-accent-ink` type in Archivo Narrow 600 capitals, untracked (67 allows it under an uppercase display), beside a 2px inset ink outline (paper on the ink). +- Pass 1 takes the primary and an open state; pass 2 the closed state (sold out). Links are ink with a 2px pass-1 underline that turns ink on hover; inputs square in the 2px inset ink outline. + +## Motion + +The press does not tween: hover pulls the primary through the other pass (teal to orange) at once, press darkens it by an ink step, and nothing reveals, floats or loops. + +## Voice + +The bill on the wall: who plays, which night, doors, the price, and whether it has sold out. + +## Do-nots + +- Never a third ink; the moss is printed by the overlap, never mixed into a fill, a control or a letter. +- Never out of register or set apart: no echo, no offset copy, no recoloured word, no ghosted second head. +- Never a photograph in colour, or one printed through both passes. +- Never shapes drawn to show the overprint off; the passes print surfaces the page already has. +- Never lowercase or narrow display; the heavy grotesk is shouted and wide. + +## Build hint + +```html + +``` + +```css +h1, h2, h3 { font-weight: 900; font-stretch: var(--display-stretch); text-transform: uppercase; line-height: 1.02; } +.btn { border: 0; border-radius: 0; padding: var(--space-md) var(--space-lg); font: 600 var(--text-sm) var(--font-outlier); text-transform: uppercase; } +.btn--primary { background: var(--color-accent); color: var(--color-accent-ink); } .btn--primary:hover { background: var(--color-accent-2); } +.btn--secondary { box-shadow: inset 0 0 0 2px var(--color-ink); color: var(--color-ink); } +.pass-1 { background: var(--color-accent); color: var(--color-accent-ink); mix-blend-mode: var(--blend); } +.pass-2 { background: var(--color-accent-2); color: var(--color-accent-2-ink); mix-blend-mode: var(--blend); } +.pass-1 > img, .pass-2 > img { filter: grayscale(1) contrast(1.3); mix-blend-mode: var(--blend); } +.figure { font: 900 var(--text-display)/1 var(--font-display); font-stretch: 150%; font-variant-numeric: tabular-nums; } +.grain { position: relative; isolation: isolate; } +.grain::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: var(--texture-opacity); background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 -4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E") 0 0 / 200px; } +::selection { background: color-mix(in oklab, var(--color-accent-2) 40%, transparent); } +``` diff --git a/skills/hallmark/references/themes/pasteup.jpg b/skills/hallmark/references/themes/pasteup.jpg new file mode 100644 index 0000000..c48e5f6 Binary files /dev/null and b/skills/hallmark/references/themes/pasteup.jpg differ diff --git a/skills/hallmark/references/themes/pasteup.md b/skills/hallmark/references/themes/pasteup.md new file mode 100644 index 0000000..27c4dc5 --- /dev/null +++ b/skills/hallmark/references/themes/pasteup.md @@ -0,0 +1,100 @@ +--- +name: Paste-up +slug: pasteup +genre: playful +paper: mid 73 70 +display: display-condensed League Gothic +accent: chromatic-yellow 112 +posture: committed +keywords: zine, fair, market, festival, print fair, book fair, exhibitors, punk, diy, collective, gig, poster, workshop, night market, flea, indie, community, launch, loud, photocopy, flyer +material: kraft board, a fibre wash, near-black toner, League Gothic capitals over a Newsreader galley, white copy paper on paper lifts, hard ink offsets, one sheet of fluorescent yellow +photo: mono con=45 +pictured: Bento Grid, Stage hero +--- + +# Paste-up + +A hand-made flyer: kraft board, near-black toner, League Gothic capitals at poster size over a Newsreader galley, white copy paper on real paper shadows, controls on hard ink offsets, one sheet of fluorescent yellow. Photographs come off the copier, black and white, the greys crushed. The paste-up lives in the paper, the tilt and the lift, never in props. It is not a grunge texture pack, a scrapbook of stickers and tape, or a clean modern poster. + +## Tokens + +```css +:root { + --color-paper: oklch(73% 0.068 70); --color-paper-2: oklch(66% 0.072 68); --color-paper-3: oklch(97% 0.008 90); + --color-ink: oklch(17% 0.01 60); --color-ink-2: oklch(24% 0.014 60); --color-muted: oklch(28% 0.026 62); + --color-rule: oklch(50% 0.055 68); --color-rule-2: oklch(84% 0.012 85); + --color-accent: oklch(93% 0.2 112); --color-accent-ink: oklch(17% 0.01 60); --color-focus: oklch(17% 0.01 60); + --font-display: "League Gothic", Impact, sans-serif; --font-body: "Newsreader", Georgia, serif; + --radius-card: 0; --radius-pill: 999px; --rule-hair: 1px; + --shadow-card: 0 1px 0 oklch(18% 0.01 60 / 0.2), 0 4px 10px oklch(18% 0.01 60 / 0.12); + --shadow-sheet: 0 14px 30px oklch(18% 0.01 60 / 0.26), 0 2px 4px oklch(18% 0.01 60 / 0.14); + --tracking-display: 0.01em; --display-weight: 400; +} +``` + +The fluorescent is a paper, not an ink: it carries toner type and is never type itself. Three boards, stated in the stamp (`pasteup: kraft`): kraft, the tokens above, fibre at 0.5 multiply; black wall, ground `oklch(21% 0.012 60)`, toner `oklch(94% 0.012 90)`, muted `oklch(70% 0.015 80)`, fibre at 0.35 screen; sugar paper, ground `oklch(84% 0.035 150)`, toner `oklch(22% 0.02 160)`, muted `oklch(42% 0.03 160)`, fibre at 0.4 multiply. + +## Type + +- **Display:** League Gothic 400, uppercase, `--tracking-display`, never under 28px, so item titles (`h3`) set in Newsreader 500 instead. It is a poster face: a flyer head or a figure takes up to twice `--text-display` at line-height 0.92; a section head takes one step up from `--text-section` at 1.0. +- **Body:** Newsreader 400 and 500 at 18px, line-height 1.5; italic is emphasis in running text only. On a sheet, text sits on copy white; on the board it takes `--color-ink`, never `--color-muted`, under 18px. +- **Labels, captions, table heads, meta, controls:** Newsreader 500 a step smaller, sentence case, untracked. No mono. + +## Surfaces + +- Paper lifts, not boxes: a well is a sheet of copy paper (`--color-paper-3`) on `--shadow-card`, a raised sheet takes `--shadow-sheet`. Radius 0; hairlines in `--color-rule` part rows on the board, `--color-rule-2` on a sheet. +- Tilt is the paste: a sheet or a photograph may sit 0.5° to 2° off square, three tilted surfaces a screen at most; inputs, tables and long reading stay square. +- The fluorescent sheet fills the primary control and one sheet a screen, with toner type on it; never a band, a head or a word on the board. +- Bands: `--color-paper-2` (a deeper kraft) or the toner with board-coloured type; two a page at most. +- Photographs: zines, hands, copiers, staplers and fair tables, close and flat-lit, a crowd from behind at most; through the copier (the `photo:` line), hard black and white. Printed multiply on a copy sheet with a 10 to 16px margin and lifted, or straight onto the board so the kraft shows through the whites; never colour, never full-bleed. A caption sits on the sheet's foot. +- Texture: the fibre wash (`texture.md` § 1, a low-frequency tan tint) on a kraft band at the board's opacity and blend, never on a sheet or under running text. + +## Range + +- **The facts as a wall of flyers:** the prompt's date, count, price and deadline each on its own sheet in League Gothic at poster size, mixed spans and heights, overlapping by a few pixels, two or three tilted, one on the fluorescent; no photograph among them. +- **A typed sheet:** a timetable, a price list or the where-and-when as a ruled table on one copy sheet at a slight tilt, the left column in League Gothic, the rest in Newsreader. +- **The toner band:** one line in League Gothic at `--text-display` or larger, board-coloured on toner, across ten columns. +- **The form as a sheet:** fields on copy paper, square, on a hard offset, beside its head and the deadline set big on the board. + +## Controls + +- The control pair: a fluorescent primary with toner type on a hard `4px 4px 0` ink offset, beside a copy-paper secondary on the same offset, both Newsreader 500 at 15px. +- Links are toner with a 1px underline, thicker on hover; inputs are copy paper, square, a 1px ink border; the focus ring is toner. + +## Motion + +Paper physics only: a button drops 1px into its offset on hover and 4px on press over `--dur-micro`. Nothing floats, nothing reveals. + +## Voice + +Flyer voice: the date, the door, the price, the table number. + +## Do-nots + +- Never paste-up props: no tape, stickers, stamps or scrawled notes. +- Never a word set apart in a head: no cut-out word, no yellow word, no italic word. +- Never a soft shadow on a control; controls sit on a hard ink offset. +- Never a grunge overlay, a torn edge or a photograph in colour. + +## Build hint + +```html + +``` + +```css +h1, h2 { font-weight: 400; text-transform: uppercase; line-height: 1; } h1 { line-height: 0.92; } +h3 { font: 500 var(--text-title)/1.2 var(--font-body); } +.btn { border: 0; border-radius: 0; padding: var(--space-sm) var(--space-md); font: 500 15px/1.2 var(--font-body); color: var(--color-ink); box-shadow: 4px 4px 0 var(--color-ink); transition: translate var(--dur-micro) var(--ease-out), box-shadow var(--dur-micro) var(--ease-out); } +.btn:hover { translate: 1px 1px; box-shadow: 3px 3px 0 var(--color-ink); } +.btn:active { translate: 4px 4px; box-shadow: none; } +.btn--primary { background: var(--color-accent); color: var(--color-accent-ink); } +.btn--secondary { background: var(--color-paper-3); } +.sheet { background: var(--color-paper-3); box-shadow: var(--shadow-sheet); rotate: var(--r, 0deg); } +.sheet--fluoro { background: var(--color-accent); color: var(--color-accent-ink); } +.sheet img { mix-blend-mode: multiply; filter: grayscale(1) contrast(1.3); } +.fibre { position: relative; isolation: isolate; } +.fibre::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0.5; mix-blend-mode: multiply; pointer-events: none; + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.02 0.03' numOctaves='3' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0.55 0 0 0 0 0.45 0 0 0 0 0.3 0 0 0 0.28 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E"); } +::selection { background: color-mix(in oklab, var(--color-accent) 70%, transparent); color: var(--color-ink); } +``` diff --git a/skills/hallmark/references/themes/piste.jpg b/skills/hallmark/references/themes/piste.jpg new file mode 100644 index 0000000..d176a5d Binary files /dev/null and b/skills/hallmark/references/themes/piste.jpg differ diff --git a/skills/hallmark/references/themes/piste.md b/skills/hallmark/references/themes/piste.md new file mode 100644 index 0000000..68826cf --- /dev/null +++ b/skills/hallmark/references/themes/piste.md @@ -0,0 +1,99 @@ +--- +name: Piste +slug: piste +genre: playful +paper: light 98.5 260 +display: display-condensed Barlow Condensed +accent: cool 265 +posture: committed +keywords: ski, mountain, resort, snow, winter, outdoor, sport, trail, lift, race, alpine, tickets, season pass, conditions, weather, club, active, bold +material: snow-white paper, cold near-black ink, Barlow Condensed 800 caps over Barlow, square edges on 2px ink rules, one cobalt for signal and field +photo: natural con=10 vib=15 +pictured: Morning Report, Poster hero +--- + +# Piste + +A mountain morning in print: snow-white paper, cold near-black ink, Barlow Condensed 800 in capitals for every head and figure, square edges on 2px ink rules, and one cobalt doing all the colour work, from the primary control to a full field. Photographs bring the mountain in, crisp and in full colour, cut square, and the paper is the snow they open onto. It reads bold because the type is loud and the colour one cold blue; it is not a lens-flare resort brochure, a sporty gradient or a rounded app. + +## Tokens + +```css +:root { + --color-paper: oklch(98.5% 0.005 260); --color-paper-2: oklch(95.5% 0.008 260); --color-paper-3: oklch(91% 0.01 260); + --color-ink: oklch(16% 0.012 260); --color-ink-2: oklch(30% 0.014 260); --color-muted: oklch(48% 0.016 260); + --color-rule: oklch(88% 0.01 260); + --color-accent: oklch(52% 0.25 265); --color-accent-deep: oklch(40% 0.2 266); --color-accent-ink: oklch(98.5% 0.004 260); --color-focus: oklch(58% 0.22 28); + --color-field: var(--color-accent); + --font-display: "Barlow Condensed", ui-sans-serif, sans-serif; --font-body: "Barlow", ui-sans-serif, sans-serif; --font-outlier: var(--font-display); + --radius-card: 0; --radius-pill: 0; --rule-hair: 1px; --rule-bar: 2px; + --shadow-card: none; + --tracking-display: -0.005em; --display-weight: 800; +} +``` + +Committed: cobalt is `--color-field` and may fill a band; on controls and links it is the signal, `--color-accent-deep` its hover and pressed step. Three grounds, stated in the stamp (`piste: snow`): `snow` (the block above), `blue-run` (the page is the cobalt field under white ink; white takes the controls and focus) and `night-piste` (`oklch(14% 0.01 260)` under white ink, 2px white rules, cobalt at 56%, focus red at 60%). + +## Type + +- **Display:** Barlow Condensed 800, uppercase, roman, `--tracking-display`; line-height 1.0 on any head that can wrap, 0.9 only on a single line that cannot. Condensed, so it sets one step larger than the shared scale: a section head at `--text-display-s` and up, the hero head up to 8rem. +- **Figures:** the display face at 800, tabular, from `--text-display` to twice it; a figure on paper takes cobalt, a figure on the field takes paper. The label beneath is Barlow 500. +- **Body:** Barlow 400 and 500, 17 to 19px, line-height 1.5; it is read outdoors, so never lighter. +- **Buttons:** Barlow Condensed 800 in capitals at 18px, untracked (legal under 67 on an uppercase display). Nav links, table heads, captions: Barlow 500 a step smaller, sentence case. + +## Surfaces + +- Rules: `--rule-bar` ink above a list, a figure row or a table's head, and under a floating bar; `--rule-hair` in `--color-rule` between rows. Ruled, never boxed. +- Radius 0 on everything: wells, photographs, inputs, controls and tags are cut square. Depth is flat: a raised surface is a paper step or the cobalt field, never a shadow. +- Bands: the cobalt field with `--color-accent-ink` type, or `--color-paper-2` under a form or a dense table; two a page at most. +- Photographs: the mountain in daylight and colour: a group on a slope seen from behind, a line of children after an instructor, skis standing in fresh snow, a lift against the sky; crisp and high-key, never a dusk grade or a flare. Cut square with an inset ink hairline at 8%. Ink sits straight on bright snow; paper sits on sky only over a cold ink scrim. +- No texture, no gradient but a scrim, no blur. + +## Range + +- **A figure row as a lift board:** the prompt's numbers in the condensed face at up to twice `--text-display`, cobalt on snow, under a `--rule-bar` ink rule and parted by hairlines, each with one Barlow line. +- **Statement on the field:** one short line in condensed capitals at display size and beyond, paper on cobalt edge to edge, the line the morning report would shout. +- **Steps or a timetable:** an `
        ` with each numeral in the condensed face at `--text-display` in cobalt over a 2px ink rule, a capital title and one line; or a ruled table of times and groups with the head rule in ink. +- **Forms as a ticket desk:** square 52px inputs and ink steppers on paper-2, the cobalt primary the only colour on the band. + +## Controls + +- The pair: a cobalt fill with `--color-accent-ink` text beside a 2px inset ink outline, both square, in condensed capitals; on a scrim or the field the outline turns paper. Hover takes `--color-accent-deep`; active takes ink. +- Links are ink and underlined, cobalt on hover; inputs square, 52px, a 1px ink border; a stepper is two square ink-bordered buttons around a tabular count. +- Cobalt sits on the primary, a link's hover, a field band and figures; red is the focus ring and nothing else. + +## Motion + +Still. A control steps one shade on hover over `--dur-micro` on `--ease-out`; nothing draws in, loops or follows the scroll. + +## Voice + +The morning report: the hour, the group, the week booked, called across the snow. Never a slogan about freedom or powder. + +## Do-nots + +- Never lowercase display or a light condensed; Barlow Condensed at 800. +- Never a rounded corner, a pill or a soft card. +- Never a second accent hue, never cobalt on running text or as a card fill on snow paper. +- Never a sky gradient, a sunset grade, or a drawn mountain, snowflake or piste map. + +## Build hint + +```html + +``` + +```css +h1, h2, h3 { font-weight: 800; text-transform: uppercase; line-height: 1; } +h2 { font-size: var(--text-display-s); } +.fig { font: 800 var(--text-display)/0.9 var(--font-display); color: var(--color-accent); font-variant-numeric: tabular-nums; } +.btn { display: inline-flex; align-items: center; min-height: 52px; padding: 0 var(--space-lg); border: 0; font: 800 var(--text-lg)/1 var(--font-display); text-transform: uppercase; } +.btn--primary { background: var(--color-accent); color: var(--color-accent-ink); } +.btn--primary:hover { background: var(--color-accent-deep); } +.btn--secondary { background: none; box-shadow: inset 0 0 0 var(--rule-bar) var(--color-ink); color: var(--color-ink); } +.band--field { background: var(--color-field); color: var(--color-accent-ink); } +.photo { outline: 1px solid color-mix(in oklab, var(--color-ink) 8%, transparent); outline-offset: -1px; } +th { border-bottom: var(--rule-bar) solid var(--color-ink); font: 500 var(--text-sm) var(--font-body); text-align: left; } +td { border-bottom: var(--rule-hair) solid var(--color-rule); } +::selection { background: color-mix(in oklab, var(--color-accent) 30%, transparent); } +``` diff --git a/skills/hallmark/references/themes/refract.jpg b/skills/hallmark/references/themes/refract.jpg new file mode 100644 index 0000000..456da4a Binary files /dev/null and b/skills/hallmark/references/themes/refract.jpg differ diff --git a/skills/hallmark/references/themes/refract.md b/skills/hallmark/references/themes/refract.md new file mode 100644 index 0000000..e01f97d --- /dev/null +++ b/skills/hallmark/references/themes/refract.md @@ -0,0 +1,101 @@ +--- +name: Refract +slug: refract +genre: atmospheric +paper: light 98.2 95 +display: grotesk-sans Funnel Display +accent: cool 232 +posture: restrained +keywords: pool, lido, swim, spa, hotel, resort, water, skincare, sunscreen, eyewear, glass, optics, light, daylight, architecture, interiors, studio, wellness, bathhouse, summer, clean, calm, product launch, hardware +material: sunlit white plaster with real light falling across it, water caustics or prism dispersion rendered live, deep pool-blue ink, Funnel Display at a light weight over Funnel Sans, clear surfaces that cast tinted shadows, one water signal +pictured: Timetable-led, Stage hero +photo: natural con=3 exp=4 +--- + +# Refract + +White plaster in strong sun, with light doing the decorating: a net of water caustics moving across the ground, or a prism throwing a spectrum and its bright cusps over the page. Everything else is quiet: deep pool-blue ink, Funnel Display at a light weight, clear surfaces whose shadows carry a tint of the light that passed through them. It feels like a cool room on a hot afternoon. It is not a rainbow gradient, not frosted glass on a blur, not a blue tech landing page. + +## Tokens + +```css +:root { + --color-paper: oklch(98.2% 0.006 95); --color-paper-2: oklch(96.4% 0.006 95); --color-paper-3: oklch(93.6% 0.008 95); + --color-ink: oklch(23% 0.035 245); --color-ink-2: oklch(36% 0.035 245); --color-muted: oklch(50% 0.025 240); + --color-rule: oklch(89.5% 0.008 230); --color-rule-2: oklch(93.5% 0.006 230); + --color-accent: oklch(50% 0.12 234); --color-accent-hi: oklch(44% 0.12 236); --color-accent-ink: oklch(99% 0.003 95); --color-accent-soft: oklch(94% 0.025 220); --color-focus: oklch(56% 0.14 234); + --color-shade: oklch(86% 0.05 212); --color-shade-2: oklch(74% 0.07 220); --color-light: oklch(99.7% 0.004 95); + --spec-1: oklch(78% 0.15 32); --spec-2: oklch(90% 0.15 105); --spec-3: oklch(82% 0.13 175); --spec-4: oklch(66% 0.15 270); + --color-slot: oklch(86% 0.05 212); + --edge-light: inset 0 1px 0 oklch(100% 0 0 / 0.9), inset 0 0 0 1px oklch(100% 0 0 / 0.55); + --shadow-card: 18px 28px 48px -26px oklch(52% 0.09 220 / 0.38), 2px 3px 6px -2px oklch(40% 0.05 230 / 0.12); + --shadow-cast: 28px 40px 70px -30px oklch(60% 0.11 212 / 0.45); + --font-display: "Funnel Display", ui-sans-serif, system-ui, sans-serif; --font-body: "Funnel Sans", ui-sans-serif, system-ui, sans-serif; + --radius-card: 22px; --radius-inner: 12px; --radius-pill: 999px; --rule-hair: 1px; + --tracking-display: -0.032em; --display-weight: 400; +} +``` + +Two dials, stated in the stamp (`refract: water/pool`). Two Refract pages in one run differ on both. + +| Dial | Options | +| --- | --- | +| **Light** (the generated ground) | `water` (default): caustics from a surface of moving water, a bright net over an aqua shade. `glass`: sun through a glazed window, the pane edges split warm and cool and a prism's fan crossing the patch, falling over the product as well as the ground, slow as the sun | +| **Colourway** | `pool` (default) as above. `noon`: ink `oklch(20% 0.01 260)`, accent near-black, the spectrum the only colour | + +## Type + +- **Display:** Funnel Display 400 (300 for a figure set at statement size), `--tracking-display`, line-height 1.02, sentence case, one colour. Heads stay calm; the light is the loud part. +- **Body:** Funnel Sans 400 at 17px, line-height 1.6, `--color-ink-2`; leads a step up in `--color-muted`. +- **Labels, table heads, times:** Funnel Sans 500 a step smaller, sentence case, `tabular-nums` on every figure. Never mono, never tracked capitals. + +## Surfaces + +- **The light:** one generated canvas or shader, never a photograph of a texture and never a gradient blob. In `water` the shade is `--color-shade` with the net in `--color-light` and a faint split into `--spec-*` at the brightest seams; in `glass` the ground stays paper and bands of `--spec-*` fall at a low angle with a white cusp along one edge. The light lands on the side of the hero away from the head and fades to paper under the text, so the head always sits on plain paper. +- **Clear surfaces:** panels are white at 72 to 86% over the light with `--edge-light`, never blurred; their shadow falls down and right from one sun (`--shadow-card`), tinted by the water. A second, larger cast (`--shadow-cast`) only under the one lead object on a page. +- **Rules:** hairlines in `--color-rule`, horizontal only, in tables and lists. Radius `--radius-card` on panels, `--radius-inner` inside them, pills for controls. +- **Bands:** paper and paper-2; one band may take the light again (the close or a statement), never more than two lit grounds a page. +- **Photographs:** bright, sunlit, hard shadows, water or white architecture or the product in sun; no people posing. Square corners on full-bleed, `--radius-card` inside the container. No duotone. + +## Range + +- **Times to book as lanes:** when the visitor picks a session, the sessions as long ruled rows, the time in display figures, a status pill at the right edge, the next open row lit by a thin band of the light behind it. +- **A figure in sun:** one number at statement size in Funnel Display 300 with the light falling across the space beside it, its unit and source in one muted line. +- **The day as light:** a strip of hours as slim bars whose height is the light or the demand, the present hour marked by an accent dot, the rest in `--color-shade`. +- **The product on the table:** the product's real screen as a clear panel lying in the light, its cast shadow tinted, one working control that moves the light itself. + +## Controls + +- Primary pill: `--color-accent` under `--color-accent-ink`, a white inset top edge, 48px; hover darkens to `--color-accent-hi`. Secondary pill: white at 80% with `--edge-light` and a hairline. +- Inputs are white wells with a hairline and `--radius-inner`; focus ring in `--color-focus`. +- The accent sits on the primary, focus, the present marker and links on hover; the spectrum lives only in the light. + +## Motion + +Water moves at swimming-pool speed (a full pattern change in about 12 seconds); glass drifts as the sun does, a band crossing in 60 seconds. Panels lift 2px on hover with their shadow lengthening. Light pauses off screen. Reduced motion: one still frame of the light. + +## Voice + +Bright and plain, a little sensory: the temperature, the hour, what the light does. + +## Do-nots + +- Never a rainbow on type, a gradient button or a spectral border on more than one object. +- Never frosted glass or a backdrop blur; clear surfaces stay clear. +- Never the light under running text, and never two lit grounds in a row. +- Never a grey drop shadow; every shadow carries the light's tint and falls from one sun. + +## Build hint + +```html + +``` + +```css +h1, h2, h3 { font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--tracking-display); line-height: 1.02; } +.clear { background: color-mix(in oklab, var(--color-light) 80%, transparent); border-radius: var(--radius-card); box-shadow: var(--edge-light), var(--shadow-card); } +.btn { min-height: 48px; padding: 0 var(--space-lg); border: 0; border-radius: var(--radius-pill); background: var(--color-accent); color: var(--color-accent-ink); font: 500 var(--text-md)/1 var(--font-body); box-shadow: var(--shadow-card); transition: background var(--dur-short) var(--ease-out); } +.btn:hover { background: var(--color-accent-hi); } +.btn--clear { background: color-mix(in oklab, var(--color-light) 80%, transparent); color: var(--color-ink); box-shadow: var(--edge-light), var(--shadow-card); } +.light { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; -webkit-mask-image: linear-gradient(to right, transparent 30%, var(--color-ink) 62%); mask-image: linear-gradient(to right, transparent 30%, var(--color-ink) 62%); } +``` diff --git a/skills/hallmark/references/themes/ribbon.jpg b/skills/hallmark/references/themes/ribbon.jpg new file mode 100644 index 0000000..adde03b Binary files /dev/null and b/skills/hallmark/references/themes/ribbon.jpg differ diff --git a/skills/hallmark/references/themes/ribbon.md b/skills/hallmark/references/themes/ribbon.md new file mode 100644 index 0000000..8719224 --- /dev/null +++ b/skills/hallmark/references/themes/ribbon.md @@ -0,0 +1,106 @@ +--- +name: Ribbon +slug: ribbon +genre: atmospheric +paper: light 98.5 85 +display: grotesk-sans Instrument Sans +accent: chromatic-teal 190 +posture: committed +keywords: sleep, sound, soundscape, audio, night, rest, calm, wellness, meditation, white noise, ambient, listen, headphones, wind down, bedtime, quiet, breathing, app, subscription +material: warm off-white or blue-black night, Instrument Sans at a quiet weight over Figtree, machined parts lit from above, the hour drawn as light on a generated canvas, one signal +photo: muted sepia=14 +pictured: Night Notes, Stage hero, in the two-in-the-morning colourway +--- + +# Ribbon + +The hour before sleep, set quietly: Instrument Sans at 400, upright and tightly set, for every head, Figtree in a soft grey for reading, hairline rules instead of boxes, and the night itself drawn as slow light behind a machined instrument that really sets the levels. The calm comes from light type, slow light and well-made parts. It is not a glossy wellness app and not a sky of stars and moons. + +## Tokens + +```css +:root { + --color-paper: oklch(98.2% 0.008 82); --color-paper-2: oklch(95.8% 0.011 82); --color-paper-3: oklch(92.3% 0.014 82); + --color-ink: oklch(18% 0.006 80); --color-ink-2: oklch(30% 0.008 80); --color-muted: oklch(47% 0.012 80); + --color-rule: oklch(89.5% 0.011 82); --color-rule-2: oklch(93.5% 0.009 82); + --color-accent: oklch(44% 0.075 190); --color-accent-soft: oklch(92% 0.028 190); --color-accent-ink: oklch(98% 0.006 85); --color-focus: oklch(52% 0.09 190); + --color-band: oklch(26% 0.045 195); --color-band-ink: oklch(94% 0.012 85); + --color-slot: oklch(69% 0.07 80); + --metal-hi: oklch(97% 0.006 85); --metal-lo: oklch(85% 0.01 85); + --edge-light: inset 0 1px 0 oklch(100% 0 0 / 0.5); + --shadow-part: 0 1px 0 oklch(20% 0.01 80 / 0.25), 0 10px 18px -6px oklch(20% 0.01 80 / 0.3); + --shadow-panel: 0 1px 0 oklch(20% 0.01 80 / 0.2), 0 24px 48px -16px oklch(20% 0.02 80 / 0.35); + --font-display: "Instrument Sans", ui-sans-serif, system-ui, sans-serif; --font-body: "Figtree", ui-sans-serif, system-ui, sans-serif; + --font-outlier: "JetBrains Mono", ui-monospace, monospace; + --radius-card: 20px; --radius-part: 6px; --radius-pill: 999px; --rule-hair: 1px; + --shadow-card: none; + --tracking-display: -0.035em; --display-weight: 400; +} +``` + +One dial, the colourway, stated in the stamp (`ribbon: two-in-the-morning`). The accent is the one lit thing; `--color-slot` is the photo wash; `--color-accent-soft` is a fader's track or a pressed pill, never type. + +| Colourway | Paper | Ink | Accent, metal | +| --- | --- | --- | --- | +| `dawn` (default) | `oklch(98.2% 0.008 82)` | `oklch(18% 0.006 80)` | teal `oklch(44% 0.075 190)`; aluminium as above, the night drawn on `--color-band` | +| `two-in-the-morning` | blue-black `oklch(13.2% 0.022 258)`, paper-2 16.4%, rule 27% | `oklch(93.5% 0.012 85)`, muted `oklch(72% 0.02 255)` | a lit window, amber `oklch(82% 0.095 68)` with `oklch(20% 0.03 62)` text; metal `oklch(44% 0.012 255)` to `oklch(25% 0.014 255)`, shadows from black | +| `moss` | sage `oklch(89% 0.034 140)` | `oklch(22% 0.03 150)` | ochre `oklch(48% 0.115 70)`; wash deep teal `oklch(46% 0.07 195)` | + +## Type + +- **Display:** Instrument Sans 400, upright, `--tracking-display`, line-height 1.04, sentence case, one colour; 500 for small titles (a panel's name, the wordmark). Big figures and levels take the display face too, lining and tabular. +- **Body:** Figtree 400 at 17px, line-height 1.6, in `--color-muted`; Figtree 500 for a part's name and value. +- **Labels:** Figtree 500 a step smaller, sentence case, untracked, `--color-muted`, tabular figures on values. + +## Surfaces + +- The hero ground is the hour drawn as light on one generated canvas (in dawn, on `--color-band`): fine slow streaks for rain, long soft lines for wind, a far row of lit points on a low horizon, whatever the prompt's sounds are, over a CSS sky-to-land gradient. Never a photograph behind the head, never a star or a moon. +- Machined parts lit from above: panels in a top-to-bottom gradient with `--edge-light` and `--shadow-panel`; a recessed bed (inset shadow) holding vertical faders with knurled caps (`--metal-hi` to `--metal-lo`, fine striped grip, a lit accent index line), a sunk slot whose glow fills to the level, tick scales either side; a draggable curve for anything timed, with a metal handle. +- Texture is generated: a 160px canvas noise tile set as `--grain` by script, `soft-light` at 0.35 to 0.55, on the night and in panels only. +- Rules, not boxes, in reading sections: 1px `--color-rule` hairlines. Radius: controls pill, parts `--radius-part`, panels `--radius-card`. +- Photographs: the night held still and close (a window, a lamp, a far train); low light, no person. `--radius-card`, no border. + +## Range + +- **The instrument as the hero:** the product's controls built as a machined panel that really works, beside a one-line head, over the drawn night. +- **Rows as a list of levels:** each part's name in the display face on hairlines, its line in Figtree, its level as a display figure; the same panel in the app's frame beside it, synced. +- **Time as a drawn curve:** what changes over the night drawn as lines falling together across the width, columns marking the moments, levels in tabular Figtree beneath. +- **Price under the horizon:** the figure in the display face at 8 to 10rem over the same land and lit row, one Figtree line, the lit pill. + +## Controls + +- Machined pills, 52px: a top-to-bottom gradient with `--edge-light` and `--shadow-part`, a 1px border; the primary is the accent, lit from inside with an inset highlight. Active presses 1px down. A switch is a pill track with a metal knob that lights the accent when on. +- Faders and curves are real inputs (`role="slider"`, keyboard steps). Sound plays only after a press of Listen, and Stop or Esc ends it. +- The accent sits on the primary, the focus ring, fader glows, the index lines and one figure. + +## Motion + +Slow and breathing, `--dur-long` on `--ease-in-out`. One ambient canvas and one CSS loop at most, both paused off screen; levels ease, never jump. Reduced motion and no script: a still night, every part at its sample level. + +## Voice + +Calm and specific: the hour, the sound, how loud. Never a promise of perfect sleep. + +## Do-nots + +- Never an italic or a heavy head; the display stays upright at 400 and 500. +- Never a starfield, a moon, a navy-to-violet gradient or a stock sleeper. +- Never a plastic or flat control on the instrument; parts are machined, lit from above, one light. +- Never a drawn waveform or equaliser; levels live on faders and lines. + +## Build hint + +```html + +``` + +```css +h1, h2, h3 { font-weight: 400; font-synthesis: none; line-height: 1.04; } +.btn { min-height: 52px; padding: 0 var(--space-lg); border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-pill); background: linear-gradient(var(--color-paper-2), var(--color-paper-3)); box-shadow: var(--edge-light), var(--shadow-part); color: var(--color-ink); font: 500 var(--text-md)/1 var(--font-body); } +.btn--primary { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); } +.btn:active { transform: translateY(1px); } +.panel { border-radius: var(--radius-card); background: linear-gradient(var(--color-paper-2), var(--color-paper-3)); box-shadow: var(--edge-light), var(--shadow-panel); } +.cap { border-radius: var(--radius-part); background: linear-gradient(var(--metal-hi), var(--metal-lo)); box-shadow: var(--edge-light), var(--shadow-part); } +.grain { background-image: var(--grain); background-size: 160px; mix-blend-mode: soft-light; opacity: 0.4; } +a:hover { text-decoration-color: var(--color-accent); } +``` diff --git a/skills/hallmark/references/themes/rim.jpg b/skills/hallmark/references/themes/rim.jpg new file mode 100644 index 0000000..051ec6e Binary files /dev/null and b/skills/hallmark/references/themes/rim.jpg differ diff --git a/skills/hallmark/references/themes/rim.md b/skills/hallmark/references/themes/rim.md new file mode 100644 index 0000000..b0e7d64 --- /dev/null +++ b/skills/hallmark/references/themes/rim.md @@ -0,0 +1,96 @@ +--- +name: Rim +slug: rim +genre: modern-minimal +paper: dark 9 75 +display: grotesk-sans Switzer +accent: warm 45 +posture: committed +keywords: space, satellite, earth observation, orbit, imagery, ground station, telemetry, hardware, schedule, utc, infrastructure, mission, sensor, monitoring, instrument, night, dark, measured +material: warm black paper, warm off-white ink, Switzer 500 with Geist Mono for every measurement, square hairline surfaces, the earth photographed straight down, an orange signal and a sky-blue second +photo: natural sat=-20 con=10 +pictured: Map / Diagram, Ledge hero +--- + +# Rim + +An instrument at night: warm black paper, warm off-white ink, Switzer at a medium weight for every head, Geist Mono for every number that measures something, square surfaces parted by hairlines, an orange signal and a sky-blue second, and the earth shown the way an instrument sees it, from straight above. It reads as exact because every edge is hard and every time carries its zone. It is not a glowing sci-fi page of starfields and halos, and not a neon dashboard. + +## Tokens + +```css +:root { + --color-paper: oklch(9% 0.008 75); --color-paper-2: oklch(12.5% 0.009 75); --color-paper-3: oklch(6.5% 0.007 75); + --color-ink: oklch(94% 0.010 80); --color-ink-2: oklch(84% 0.011 80); --color-muted: oklch(68% 0.012 80); --color-muted-2: oklch(50% 0.010 80); + --color-rule: oklch(25% 0.010 78); --color-rule-2: oklch(16% 0.009 78); + --color-accent: oklch(72% 0.17 45); --color-accent-ink: oklch(10% 0.02 45); --color-accent-2: oklch(74% 0.12 250); --color-focus: oklch(78% 0.15 45); + --font-display: "Switzer", ui-sans-serif, system-ui, sans-serif; --font-body: var(--font-display); + --font-outlier: "Geist Mono", ui-monospace, monospace; + --radius-card: 0; --radius-pill: 0; --rule-hair: 1px; --shadow-card: none; + --tracking-display: -0.04em; --display-weight: 500; +} +``` + +Two colourways, both dark, stated in the stamp: `rim: night` (the block above) or `rim: station` (navy `oklch(19% 0.055 262)`, rules `oklch(32% 0.060 262)`, the signals swapped to ice `oklch(84% 0.10 200)` and amber `oklch(76% 0.14 55)`). + +## Type + +- **Display:** Switzer 500, `--tracking-display` on the hero head and -0.03em on section heads, line-height 1.02, sentence case, roman. Medium, never bold; one colour per head. +- **Body:** Switzer 400 at 16 to 17px, line-height 1.55, in `--color-ink-2`; labels, captions and table heads are 500 a step smaller in `--color-muted`, sentence case, untracked, never mono. +- **Measurements (mono as material):** Geist Mono 400, tabular, for every time, coordinate, area, price and duration. A time always carries its zone, UTC by default. A measurement that is the point sets at `--text-display-s` to `--text-display` at -0.03em, its unit or zone at half the size in `--color-muted`. Mono never sets a head, a label or a paragraph. + +## Surfaces + +- Hairlines do the dividing: 1px `--color-rule` above every section head, around wells and under a table's head; rows on `--color-rule-2`. +- Zero radius on everything; nothing on the page is round. Depth by lightness only: `--color-paper-2` lifts a well, `--color-paper-3` sinks one. No shadow, glass, blur or halo. +- A well or a photograph may drop its border for two 12px corner ticks, 1px L shapes in `--color-muted` at opposite corners, set just outside the frame. +- Bands: `--color-paper-2` or `--color-paper-3`, edged by hairlines; two a page at most, never a light band. +- Photographs: the earth straight down at the scale a capture delivers: a field, a coastline, roofs, a river mouth, sharp edge to edge, with no horizon, no sky and no planet. Square, a 1px inset ring of ink at 8%. Its measurements (the site, the pass, the delivery) ride on a strip of `--color-paper` at 78% along its foot, in Geist Mono with the zone. + +## Range + +- **Measurements as figures:** two to four real quantities in Geist Mono at display size across the twelve columns, parted by vertical hairlines, the unit half size in muted: a range, a window, a price. +- **A diagram of real time:** a horizontal UTC axis in hairlines with ticks, the window as a 10px sky-blue band and each event a 1px pin in its signal with its time in mono beside it; a chart of the system, never decoration. +- **The product built:** the order or the queue on a `--color-paper-2` well with corner ticks, fields in mono, the chosen row on `--color-paper-3` with an orange square. +- **Ruled rows and a form-first close:** hairline rows with a Switzer title on the left and the line on the right; a form on paper-2 whose values type in mono. + +## Controls + +- The pair: a square orange-filled primary with `--color-accent-ink` text beside a square secondary outlined in 1px `--color-rule`, both Switzer 500. +- Links are ink, underlined on hover; inputs square on `--color-paper` with a 1px `--color-muted` border, a value that measures typed in Geist Mono. +- Orange marks the action and the current state, sky-blue the second state or a window; nothing else is coloured. + +## Motion + +Steady and exact: a state changes over `--dur-short` on `--ease-out`; a live time ticks once a minute. Nothing pulses, loops or reveals. + +## Voice + +Measured and exact: the site, the pass, the time in UTC, the area in square kilometres. No wonder, no frontier. + +## Do-nots + +- Never anything round: no pill, no avatar circle, no rounded button or frame. +- Never a bare time; `09:30` without a zone is the theme lying. +- Never bold display; Switzer 500 is the ceiling and the black does the weight. +- Never the planet from space, a starfield, a glow or an orbit traced round a globe. + +## Build hint + +```html + +``` + +```css +h1, h2, h3 { font-weight: var(--display-weight); line-height: 1.02; } +h2 { letter-spacing: -0.03em; } +.measure { font-family: var(--font-outlier); font-variant-numeric: tabular-nums; } +.btn { border-radius: 0; padding: var(--space-sm) var(--space-md); border: var(--rule-hair) solid var(--color-rule); background: none; color: var(--color-ink); font-weight: 500; } +.btn--primary { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); } +.well { position: relative; background: var(--color-paper-2); } +.photo { outline: var(--rule-hair) solid color-mix(in oklab, var(--color-ink) 8%, transparent); outline-offset: -1px; } +.ticks::before, .ticks::after { content: ""; position: absolute; width: 12px; height: 12px; border: 0 solid var(--color-muted); pointer-events: none; z-index: var(--z-raised); } +.ticks::before { top: calc(-1 * var(--space-xs)); left: calc(-1 * var(--space-xs)); border-width: 1px 0 0 1px; } +.ticks::after { right: calc(-1 * var(--space-xs)); bottom: calc(-1 * var(--space-xs)); border-width: 0 1px 1px 0; } +::selection { background: color-mix(in oklab, var(--color-accent) 35%, transparent); color: var(--color-ink); } +``` diff --git a/skills/hallmark/references/themes/riso.jpg b/skills/hallmark/references/themes/riso.jpg new file mode 100644 index 0000000..025e122 Binary files /dev/null and b/skills/hallmark/references/themes/riso.jpg differ diff --git a/skills/hallmark/references/themes/riso.md b/skills/hallmark/references/themes/riso.md new file mode 100644 index 0000000..57a43a3 --- /dev/null +++ b/skills/hallmark/references/themes/riso.md @@ -0,0 +1,98 @@ +--- +name: Riso +slug: riso +genre: editorial +paper: light 97 90 +display: grotesk-heavy Cabinet Grotesk +accent: chromatic-pink 356 +posture: committed +keywords: risograph, riso, print studio, print fair, zine, small press, poster, art book, spot colour, two colour, indie press, diy, handmade, prints, open studio +material: bright uncoated stock and no black, a medium blue drum for every word, a fluorescent pink drum for the fills, purple where they cross, Cabinet Grotesk 800 over Literata, grain, one word a hair out of register +photo: duotone ink paper-2 con=14 +pictured: Job Sheet, Stage hero +--- + +# Riso + +A small-press run from two drums and nothing else: bright uncoated stock, a medium blue drum that sets every word and a fluorescent pink drum for the fills, crossing in a purple nobody mixed. Cabinet Grotesk 800 heads over a Literata body, grain where the ink skips, one word a hair out of register. It reads handmade because the imperfection is in the ink, not in tape and scribbles. It is not clean vector flatness, not a neon zine, and never black. + +## Tokens + +```css +:root { + --color-paper: oklch(97% 0.011 90); --color-paper-2: oklch(93.5% 0.034 356); --color-paper-3: oklch(84% 0.11 356); + --color-ink: oklch(40% 0.165 265); --color-ink-2: oklch(45% 0.15 265); --color-muted: oklch(50% 0.115 265); + --color-rule: oklch(85% 0.045 265); + --color-accent: oklch(68% 0.235 356); --color-accent-ink: oklch(27% 0.13 265); --color-focus: oklch(44% 0.2 265); + --font-display: "Cabinet Grotesk", ui-sans-serif, sans-serif; --font-body: "Literata", ui-serif, Georgia, serif; + --radius-card: 2px; --radius-pill: 2px; --rule-hair: 1px; + --shadow-card: none; --texture-opacity: 0.08; + --tracking-display: -0.025em; --display-weight: 800; +} +``` + +## Type + +- **Display:** Cabinet Grotesk 800, `--tracking-display`, sentence case, in the blue; `h1` leads 0.92, `h2` 0.98. A head is one weight and one colour. Figures that are the offer set in it, tabular. +- **The misregistered word** (stamp `waive 38iii`): one focal word in the hero head prints in both drums, a pink copy behind the blue nudged 2 to 3px down and right, so only its fringe shows (`texture.md` § 3). Once a page. +- **Body and lede:** Literata 400, opsz following size, in the blue. +- **Labels, captions, table heads, nav:** Literata 500 a step smaller, sentence case, `--color-muted` or the blue. No mono: figures take Literata's tabular numerals. + +## Surfaces + +- No black: every word, rule and icon prints in the blue drum, every fill in the pink; where pink overprints blue (`mix-blend-mode: multiply`) the purple shows, and nobody paints it. +- Screens of the pink drum are the papers: `--color-paper-2` (a light screen) under any text, `--color-paper-3` (half strength) under display type only, the solid pink with `--color-accent-ink`. The blue drum may print solid, with type knocked out to the stock. Two bands a page. +- Hairlines in `--color-rule`, 1.5px blue where a rule frames a figure, 2px radius, no shadow; depth is overprint. +- Photographs: the work and the room in even light, cropped close, with real tonal range. Each prints in both drums, blue shadows into a light pink screen (the `photo:` duotone), 2px radius, grain over it, captions beneath in Literata. +- Grain, declared: paper specks where the ink skips (`texture.md` § 1, light specks) on fills, bands and photographs at `--texture-opacity`, never under running text; grain and misregistration are one drum's family. + +## Range + +- **Figures** set as a two-ink overprint: the number in blue Cabinet 800 at display size, a solid pink shape multiplied across part of it, so the purple prints only where the drums cross. A price or a date carries a screen this way. +- **Steps** as separations: the same artwork shown as the blue layer alone, the pink layer alone, then the sheet with both, three plates on the stock in hairline frames; the process is the picture. +- **Rows and forms** on the light pink screen: a price list or an order as blue hairline rows in Literata tabular figures, a live total in the display face, the chosen row on the half screen. +- **Bands** in one drum at full strength: the solid blue with a statement knocked out to the stock and the pink primary on it, or the solid pink with deep blue type; a statement at display size is the loudest thing this material makes. + +## Controls + +- The pair: a pink-filled rectangle with `--color-accent-ink` type beside one outlined 1.5px in the blue, both at 2px radius in Cabinet Grotesk 800 at 15px; pressed, a control drops 1px down and right, the way a sheet lands. +- Links underline in pink, thicker on hover; inputs 48px tall at 2px radius with a 1.5px blue border on the stock, the value in Cabinet 800. +- Pink sits on the primary, link underlines and one fill a screen; the focus ring is blue. + +## Motion + +One reveal: the pink drum settles into its offset once on load over `--dur-long` on `--ease-out`, and never loops. Controls change colour over `--dur-short`; nothing else moves. + +## Voice + +Specific and hand-set: name the ink, the sheet, the drum and the price; verbs over adjectives. Imperfect on purpose. + +## Do-nots + +- Never black ink or a grey; the only third colour is the purple the drums make. +- Never a registered, ungrained flat gradient; that is vector, not riso. +- Never pink as type on the stock; the pink drum fills, the blue one writes. +- Never the misregistration on a second head; one word, then rest. +- Never a page of duotone photographs back to back; the drums need a page of their own between pulls. + +## Build hint + +```html + +``` + +```css +h1, h2, h3 { font-weight: var(--display-weight); } h1 { line-height: 0.92; } h2 { line-height: 0.98; } +.misreg { position: relative; display: inline-block; isolation: isolate; } +.misreg::after { content: attr(data-text); position: absolute; inset: 0; z-index: -1; white-space: nowrap; pointer-events: none; color: var(--color-accent); transform: translate(2px, 3px); } +.overprint { background: var(--color-accent); mix-blend-mode: multiply; } +a { text-decoration-color: var(--color-accent); text-decoration-thickness: 2px; } a:hover { text-decoration-thickness: 4px; } +.btn { display: inline-flex; align-items: center; min-height: 48px; padding: 0 var(--space-lg); border: 1.5px solid transparent; border-radius: var(--radius-card); font: var(--display-weight) 0.9375rem/1 var(--font-display); transition: background-color var(--dur-short) var(--ease-out), transform var(--dur-micro) var(--ease-out); } +.btn:active { transform: translate(1px, 1px); } +.btn--primary { background: var(--color-accent); color: var(--color-accent-ink); } +.btn--secondary { border-color: var(--color-ink); color: var(--color-ink); } +.band--solid { background: var(--color-ink); color: var(--color-paper); } +.grained { position: relative; isolation: isolate; } +.grained::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: var(--texture-opacity); background-size: 200px 200px; + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 9 -4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E"); } +``` diff --git a/skills/hallmark/references/themes/solstice.jpg b/skills/hallmark/references/themes/solstice.jpg new file mode 100644 index 0000000..4d610a5 Binary files /dev/null and b/skills/hallmark/references/themes/solstice.jpg differ diff --git a/skills/hallmark/references/themes/solstice.md b/skills/hallmark/references/themes/solstice.md new file mode 100644 index 0000000..4fbff7a --- /dev/null +++ b/skills/hallmark/references/themes/solstice.md @@ -0,0 +1,104 @@ +--- +name: Solstice +slug: solstice +genre: editorial +paper: light 94 80 +display: high-contrast-serif Yeseva One +accent: warm 24 +posture: restrained +keywords: farm, orchard, cider, perry, winery, harvest, seasonal, food, almanac, produce, vineyard, calendar, market, craft drink, label, bottle, rural, slow, sun, midsummer +material: cream paper, warm brown ink, Yeseva One over Archivo and Archivo Narrow, gold hairlines and hard paper shadows, photographs in low warm light, one vermilion signal +photo: warm high=-12 +pictured: Midsummer, Stage hero +--- + +# Solstice + +An almanac's warmth: cream paper, warm brown ink, Yeseva One heads, Archivo for the reading and Archivo Narrow for the small print, gold hairlines doing the ruling, square surfaces on hard paper shadows, photographs taken in low late light, and one vermilion signal. It reads as seasonal and rural through the ink, the gold, a fat serif and the light in its pictures, never through drawings of produce. It is not a farmhouse script page and not a terracotta-on-cream template. + +## Tokens + +```css +:root { + --color-paper: oklch(94% 0.03 80); --color-paper-2: oklch(97% 0.02 85); --color-paper-3: oklch(89% 0.05 80); + --color-ink: oklch(27% 0.05 50); --color-ink-2: oklch(36% 0.05 50); --color-muted: oklch(48% 0.06 55); + --color-rule: oklch(84% 0.06 78); + --color-accent: oklch(54% 0.20 24); --color-accent-ink: oklch(97% 0.02 85); --color-focus: oklch(54% 0.20 24); + --color-gold: oklch(74% 0.14 75); --color-gold-2: oklch(84% 0.11 80); --color-slot: var(--color-gold); + --font-display: "Yeseva One", ui-serif, Georgia, serif; --font-body: "Archivo", ui-sans-serif, sans-serif; + --font-outlier: "Archivo Narrow", ui-sans-serif, sans-serif; + --radius-card: 0; --radius-pill: 999px; --rule-hair: 1px; --rule-bar: 2px; + --shadow-card: 10px 10px 0 var(--color-paper-3); + --tracking-display: -0.005em; --display-weight: 400; +} +``` + +The signal is vermilion at hue 24, a red with warmth in it that sits with the gold and the brown, never clay; the gold rules and never fills. Three lights, stated in the stamp (`solstice: long-light`). + +| Light | Paper and ink | Signal and gold | +| --- | --- | --- | +| `long-light` (default) | cream `oklch(94% 0.03 80)` under brown `oklch(27% 0.05 50)` | vermilion `oklch(54% 0.20 24)`, gold `oklch(74% 0.14 75)` | +| `dusk` | plum brown `oklch(27% 0.05 40)` under cream ink; raised wells stay cream | vermilion keeps `oklch(54% 0.20 24)` with cream text, gold `oklch(78% 0.14 80)` | +| `midwinter` | frost `oklch(95% 0.012 230)` under cold brown `oklch(28% 0.03 260)` | vermilion keeps its hue, gold goes pale `oklch(80% 0.06 230)` | + +## Type + +- **Display:** Yeseva One 400, roman, line-height 1.0, `--tracking-display`, one colour per head; big figures take it too. +- **Body:** Archivo 400 and 500, 16 to 17px, line-height 1.55, in `--color-ink-2`. +- **Small print:** Archivo Narrow 600 at 12.5 to 13.5px, sentence case, untracked, the outlier, for dates, months, captions under a photograph and axis labels. Meta and table heads: Archivo 500 a step smaller, sentence case. No mono. + +## Surfaces + +- Rules: `--rule-bar` ink across the top of a section, `--rule-hair` in `--color-rule` between rows, a gold hairline under a head inside a well. +- Square everywhere but the control pair: no radius on a well, a photograph or an input; the buttons and the stepper take `--radius-pill`. +- Depth: a raised well takes a `--rule-bar` ink border, a 1px gold rule inset 6px and the hard `--shadow-card`, an offset in paper-3 with no blur; never a soft shadow. +- Bands: a `--color-paper-2` band, or one warm brown ink band with cream text; two a page at most, never a vermilion field. +- Photographs: the season in low, late light: fruit on the branch, long grass, a glass or a bottle on a table outside, the orchard at evening; warm, a little hazy, shadows long. Square, a 1px ink hairline at 10%, no shadow. A caption sits under the frame in the small print, one fact (the place, the month, the bottle); type on a photograph sits on its shaded side over a brown scrim at 40 to 60%. +- No texture: the cream stays clean. + +## Range + +- **The product built, standing in the light:** the bottle cut out at full height with its label set in live type (the name in Yeseva, the kind in vermilion small print, a gold hairline, the run), on a sky that grades from the cream down through dusk into a dark field, a low warm glow behind it. +- **The label as a ruled list:** a paper-2 well inset with a gold hairline, its facts as rows (style, bottle, run, price, release), small-print labels left and Yeseva values right, dotted gold rules between them. +- **The year on one line:** the seasons from blossom to bottle as stops on a hairline across the brown band, the months in gold small print, the stages in cream Yeseva, the present one marked in the sun's colour. +- **An order that counts:** a pill stepper beside the one vermilion button whose label carries the running total, under a statement head at display size on a cream to dusk ground. + +## Controls + +- The pair: a vermilion-filled pill in Archivo Narrow 600 with `--color-accent-ink` text, beside a plain one in ink over a 2px ink underline, no box. +- Links underline in ink and turn vermilion on hover; inputs square on `--color-paper-2` with a 1px ink border. +- Restrained: vermilion sits on the primary, the focus ring and one figure, under 5% of a screen; gold never colours text. + +## Motion + +Quiet: a tab swaps its panel and a row lights on hover, over `--dur-short` on `--ease-out`. No reveal, no counter, no loop. + +## Voice + +The almanac: the hour of light, the pressing day, the orchard by name. Never a toast to the good life. + +## Do-nots + +- Never a second warm colour; a second orange makes a fruit stand. +- Never a neutral ink; a grey-black kills the cream. +- Never a rounded card or a soft shadow; a raised well is square, ruled and hard-shadowed. +- Never a cold or flat-lit photograph: a blue noon sky or a flash turns the cream sickly. +- Never clay or terracotta in place of vermilion; past hue 28 the theme becomes the cream, serif and clay page every generator makes. + +## Build hint + +```html + +``` + +```css +h1, h2, h3 { font-weight: 400; line-height: 1; } +.small, figcaption { font: 600 12.5px var(--font-outlier); color: var(--color-muted); } +.btn { display: inline-flex; padding: var(--space-md) var(--space-xl); border: 0; font: 600 var(--text-sm)/1 var(--font-outlier); background: var(--color-accent); color: var(--color-accent-ink); } +.btn--secondary { background: none; color: var(--color-ink); padding: var(--space-lg) 0 var(--space-xs); border-bottom: var(--rule-bar) solid var(--color-ink); } +.well { background: var(--color-paper-2); border: var(--rule-bar) solid var(--color-ink); outline: var(--rule-hair) solid var(--color-gold); outline-offset: -7px; box-shadow: var(--shadow-card); } +.band--ink { background: var(--color-ink); color: var(--color-paper); } +.photo img { outline: var(--rule-hair) solid color-mix(in oklab, var(--color-ink) 10%, transparent); outline-offset: -1px; } +a:hover { text-decoration-color: var(--color-accent); } +::selection { background: color-mix(in oklab, var(--color-gold) 40%, transparent); } +``` diff --git a/skills/hallmark/references/themes/specimen.jpg b/skills/hallmark/references/themes/specimen.jpg new file mode 100644 index 0000000..cc5a1b0 Binary files /dev/null and b/skills/hallmark/references/themes/specimen.jpg differ diff --git a/skills/hallmark/references/themes/specimen.md b/skills/hallmark/references/themes/specimen.md new file mode 100644 index 0000000..84bca58 --- /dev/null +++ b/skills/hallmark/references/themes/specimen.md @@ -0,0 +1,100 @@ +--- +name: Specimen +slug: specimen +genre: editorial +paper: light 96.5 82 +display: high-contrast-serif Bodoni Moda +accent: cool 262 +posture: restrained +keywords: typography, type specimen, foundry, letterform, portfolio, editorial, magazine, essay, type studio, agency, brand story, print, publication, craft, considered, literary +material: warm oat paper, warm near-black ink, razor-hairline Bodoni Moda over Geist, square 1px rules, one ink-blue signal that also draws the metric guides +photo: duotone ink paper con=8 +pictured: Specimen Book, Poster hero +--- + +# Specimen + +A foundry's material: warm oat paper, warm near-black ink, Bodoni Moda 400 pinned at its highest optical size so the hairlines thin to a razor against the stems, a Geist body beneath it, square 1px rules and one ink-blue signal. It reads as hand-set and exact because all the contrast lives inside the letters, none in colour or depth. It is not a cream luxury page with a terracotta accent, and not a fashion masthead in bold Didone. + +## Tokens + +```css +:root { + --color-paper: oklch(96.5% 0.016 82); --color-paper-2: oklch(93.5% 0.02 80); --color-paper-3: oklch(89% 0.024 78); + --color-ink: oklch(17% 0.012 60); --color-ink-2: oklch(28% 0.014 60); --color-muted: oklch(49% 0.014 65); + --color-rule: oklch(80% 0.018 75); --color-rule-2: oklch(66% 0.02 72); + --color-accent: oklch(45% 0.18 262); --color-accent-ink: oklch(97% 0.012 82); --color-focus: oklch(50% 0.18 262); + --color-guide: oklch(55% 0.16 262 / 0.5); + --font-display: "Bodoni Moda", ui-serif, Georgia, serif; --font-body: "Geist", ui-sans-serif, system-ui, sans-serif; + --font-outlier: "Geist Mono", ui-monospace, monospace; + --radius-card: 0; --radius-pill: 0; --rule-hair: 1px; + --shadow-card: none; + --tracking-display: -0.02em; --display-weight: 400; --display-optical: 96; +} +``` + +`--color-guide` is the blue's second strength: a translucent hairline for a metric guide (cap height, x-height, baseline) drawn under a word, never a fill. `--color-rule-2` is the darker hairline for a control's track or a table's head. + +## Type + +- **Display:** Bodoni Moda 400, `--tracking-display`, line-height 1.02, sentence case, roman. `h1` and `h2` take `"opsz" 96`, where the hairline nearly vanishes against the stem and that contrast is the graphic; an `h3` lets the axis follow its size, since a razor hairline breaks at 25px. A word set as a poster may run to 20vw. +- **Body:** Geist 400 at 17px, line-height 1.55; the plain sans under the Didone is the tension. Bodoni Moda italic stays inside running text or a sample, never a head. +- **Labels, captions, table heads:** Geist 500 a step smaller, sentence case, `--color-muted`. Geist Mono only on figures that compare (a size, a weight, a code point), tabular. + +## Surfaces + +- 1px `--color-rule` hairlines on divisions, table rows and between cells; a 3px `double` rule heads the one table that matters, once a page. +- No depth: nothing lifts, nothing casts a shadow, nothing is rounded. A well is a paper step (`--color-paper-2`) inside a hairline. +- Bands: a `--color-paper-2` band, or one `--color-ink` band with oat type, where the Didone reads sharpest; two a page at most, never a blue one. +- Photographs: one at most, the face's world: a reading room, a book open on a desk, metal sorts in a case; it prints in ink on oat (the duotone) as a plate, square, inside a hairline, eight columns or the full container. Its caption names the setting beneath it; type never sits on it. +- No texture, no mesh, no gradient behind type: the oat is a colour, not a paper scan. + +## Range + +- **Statement with guides:** one word or line at poster size with `--color-guide` hairlines at its real cap height, x-height and baseline, each named in the label style. +- **Rows as a waterfall:** one line falling through sizes, each row its size in Geist Mono at left, hairlines between, every line cut to fit its row. +- **Grid as a character set:** hairline cells across twelve columns, one lead cell four wide holding a glyph at display size; the current cell fills ink. +- **Comparison and price list:** roman beside italic on the ink band, one passage each at reading size; the licence as a ruled table under the double rule, the price in Didone at `--text-display-s`. + +## Controls + +- The pair: an ink-filled rectangle with oat text beside a 1px ink-outlined one, both square, Geist 500, 48px tall. +- A range is a 1px `--color-rule-2` track with a square ink thumb; a toggle is two square cells inside one ink hairline, the pressed one paper with a 2px ink rule beneath, so the ink fill stays the primary's. Inputs are square with the `--color-focus` ring. +- Links carry a 1px ink-blue underline at 0.18em that thickens on hover. The blue stays under 5% of a screen: a link, the focus ring, the guides, one figure. + +## Motion + +Nothing moves except state: an underline thickens, a cell fills, a sample takes the size and weight it was given. No reveal, no loop, nothing on arrival. + +## Voice + +Editorial, hand-set, lightly literary. Verbs over adjectives; name the face, the size, the number. + +## Do-nots + +- Never a heavy display head; bold turns the Didone into a fashion masthead. Heavier weights appear only as samples of a family. +- Never an optical size under 72 on an `h1` or `h2`; fat hairlines are this theme's most common failure. +- Never a warm accent, never cool paper: the signal is ink blue, the warmth comes from the oat. +- Never a drawn book, page or device to show text; set the text itself at its size. + +## Build hint + +```html + +``` + +```css +h1, h2, h3 { font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--tracking-display); line-height: 1.02; } +h1, h2 { font-variation-settings: "opsz" var(--display-optical); } +h3 { font-optical-sizing: auto; line-height: 1.15; } +.btn { min-height: 48px; border: var(--rule-hair) solid var(--color-ink); border-radius: var(--radius-card); padding: 0 var(--space-lg); font-weight: 500; } +.btn--primary { background: var(--color-ink); color: var(--color-paper); } +.btn--secondary { background: transparent; color: var(--color-ink); } +.guide { border-top: var(--rule-hair) solid var(--color-guide); } +.rule--double { border: 0; border-top: 3px double var(--color-rule-2); } +input[type="range"] { appearance: none; height: 1px; background: var(--color-rule-2); } +input[type="range"]::-webkit-slider-thumb { appearance: none; width: 16px; height: 16px; background: var(--color-ink); border-radius: 0; } +.photo > img { outline: var(--rule-hair) solid var(--color-rule); outline-offset: -1px; } +a { text-decoration-color: var(--color-accent); text-underline-offset: 0.18em; } +a:hover { text-decoration-thickness: 2px; } +``` diff --git a/skills/hallmark/references/themes/spore.jpg b/skills/hallmark/references/themes/spore.jpg new file mode 100644 index 0000000..c59e0b4 Binary files /dev/null and b/skills/hallmark/references/themes/spore.jpg differ diff --git a/skills/hallmark/references/themes/spore.md b/skills/hallmark/references/themes/spore.md new file mode 100644 index 0000000..fe951ac --- /dev/null +++ b/skills/hallmark/references/themes/spore.md @@ -0,0 +1,104 @@ +--- +name: Spore +slug: spore +genre: atmospheric +paper: dark 15 60 +display: roman-serif Young Serif +accent: warm 30 +posture: committed +keywords: grower, mushroom, fungi, farm, food, producer, fermentation, wine, natural wine, wine bar, bottle shop, cellar, preserves, dark, culture, night market, harvest, subscription, small batch +material: coffee-ground black with a warm grain, parchment ink, Young Serif over Instrument Sans, soft pills and grained wells, photographs lit by lamps and candles, one oyster pink +photo: warm con=6 exp=-4 +pictured: Photographic, Stage hero +--- + +# Spore + +A cellar at night: coffee-ground black warmed toward brown, a warm grain on its wells, parchment Young Serif over Instrument Sans, soft pills, photographs lit only by lamps and candles, and one oyster-mushroom pink. It feels close and handmade because the warmth sits in the ground, the grain, the figures and one soft colour, never in drawn light. It is not a dark-mode template with a glow, nor a wellness label. + +## Tokens + +```css +:root { + --color-paper: oklch(15% 0.012 60); --color-paper-2: oklch(19% 0.014 58); --color-paper-3: oklch(24% 0.02 50); + --color-ink: oklch(93% 0.022 85); --color-ink-2: oklch(84% 0.022 78); --color-muted: oklch(67% 0.02 70); + --color-rule: oklch(31% 0.016 60); + --color-accent: oklch(77% 0.09 30); --color-accent-2: oklch(86% 0.06 30); --color-accent-ink: oklch(15% 0.012 60); --color-focus: oklch(86% 0.06 30); + --font-display: "Young Serif", Georgia, serif; --font-body: "Instrument Sans", ui-sans-serif, system-ui, sans-serif; + --font-outlier: "Instrument Sans", ui-sans-serif, system-ui, sans-serif; + --radius-card: 14px; --radius-pill: 999px; --rule-hair: 1px; + --shadow-card: 0 16px 40px oklch(8% 0.01 60 / 0.4); + --tracking-display: -0.012em; + --grain: 0.15; --display-weight: 400; +} +``` + +One dial, the colourway, stated in the stamp (`spore: cellar`). + +| Colourway | Ground | Ink | Accent | +| --- | --- | --- | --- | +| `cellar` (default) | `oklch(15% 0.012 60)`, grain screened at 15% | parchment `oklch(93% 0.022 85)` | pink `oklch(77% 0.09 30)` | +| `lab` | cream `oklch(94% 0.02 85)`, grain multiplied at 6% | `oklch(17% 0.015 60)` | pink `oklch(62% 0.13 30)` | +| `head-torch` | `oklch(12% 0.008 60)`, grain at 15% | `oklch(93% 0.03 85)` | ochre `oklch(74% 0.13 80)` | + +## Type + +- **Display:** Young Serif 400, `--tracking-display`, line-height 1.02, sentence case, roman, one colour per head. Its one weight is the voice: hierarchy comes from size, never from bolding. +- **Figures:** prices, days, hours and counts are Young Serif, lining, and may run past `--text-display` when one number is the section's reason; a price is the one figure that takes pink. +- **Body:** Instrument Sans 400 and 500, line-height 1.55, in `--color-ink-2`. A second name after a product's (a grape, a vintage, a Latin name) is Instrument Sans italic, the outlier and the only italic. +- **Labels, captions, table heads:** Instrument Sans 500 a step smaller, sentence case, `--color-muted`. + +## Surfaces + +- 1px `--color-rule` between rows; a 1.5px `--color-ink-2` edge on fields. Nothing else has a border. +- Radii: pills on controls and chips, `--radius-card` on wells and photographs; inputs square. +- Depth is the ground's three steps: paper, a grained `--color-paper-2` well, a `--color-paper-3` band. A state that is live now (tonight, the chosen row) lifts one step and takes a pink chip. `--shadow-card` only under a well that overlaps a photograph. +- Photographs: the place after dark, close: racks, a pour, a candlelit counter, a glass; low warm light into shadow, never flash or daylight. `--radius-card` with a 1px ink ring at 8%; type on one sits on its dark side over a paper scrim at 45 to 65%. +- Grain: the speck grain of `texture.md` § 1, screened at `--grain`, on wells and bands only; never under running text in a column or over a photograph. + +## Range + +- **One figure as the section:** a count or a price in Young Serif at two to four times `--text-display` on a grained well, its plain label beneath, beside two or three hairline rows that say what the number means. +- **The week as a timetable:** Rows of day names in Young Serif at `--text-title`, the hours beside them, closed days dropped to muted, tonight's row lifted to paper-3 with its pink chip; a head block on columns 1 to 4 beside them. +- **A list or price list:** ruled rows with the name in Young Serif, the second name in italic, the price flush right in pink; set three or five columns deep and it reads as the shelf. +- **A grained band that holds a form:** paper-3 with the speck grain, the price large in pink beside square fields and the pink pill; or a statement in Young Serif at `--text-display` across ten columns. + +## Controls + +- The pair: a pink-filled pill with `--color-accent-ink` text, lightening to `--color-accent-2` on hover, beside a pill outlined in 1.5px `--color-ink-2`. Chips are pills; the chosen one fills pink. +- Links are parchment with an underline that turns pink on hover; inputs are square with the 1.5px edge and the `--color-focus` ring. + +## Motion + +State only, in one frame: a chip selects, a row lifts, a pill lightens. Nothing reveals, nothing grows, nothing loops. + +## Voice + +A maker's log: the name, the day, the hour, the vintage, the price. No wellness, no mystique, no "curated". + +## Do-nots + +- Never a second hue; a green for "in stock" makes a garden centre. +- Never drawn light as the mood (a beam, a pool, a glow behind a head); the light lives in the photographs. +- Never a neutral or blue-black ground; every dark step tints toward hue 60. +- Never pink running text or a pink outline; pink is a fill, a price or the focus. +- Never photograph after photograph; between two pictures a figure, a timetable or a list in Young Serif. + +## Build hint + +```html + +``` + +```css +h1, h2, h3 { font-family: var(--font-display); font-weight: 400; letter-spacing: var(--tracking-display); line-height: 1.02; } +.btn { border-radius: var(--radius-pill); padding: var(--space-sm) var(--space-lg); font-weight: 600; transition: background-color var(--dur-micro) var(--ease-out); } +.btn--primary { background: var(--color-accent); color: var(--color-accent-ink); } +.btn--primary:hover { background: var(--color-accent-2); } +.btn--secondary { background: transparent; color: var(--color-ink); box-shadow: inset 0 0 0 1.5px var(--color-ink-2); } +.well { background: var(--color-paper-2); border-radius: var(--radius-card); } +.figure { font-family: var(--font-display); font-variant-numeric: lining-nums; line-height: 0.86; } +.grained { position: relative; isolation: isolate; } +.grained::after { content: ""; position: absolute; inset: 0; z-index: var(--z-base); border-radius: inherit; pointer-events: none; opacity: var(--grain); mix-blend-mode: screen; + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.6 0 0 0 0 0.55 0 0 0 0 0.45 0 0 0 0.35 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E"); } +``` diff --git a/skills/hallmark/references/themes/sport.jpg b/skills/hallmark/references/themes/sport.jpg new file mode 100644 index 0000000..0de3130 Binary files /dev/null and b/skills/hallmark/references/themes/sport.jpg differ diff --git a/skills/hallmark/references/themes/sport.md b/skills/hallmark/references/themes/sport.md new file mode 100644 index 0000000..92c1b40 --- /dev/null +++ b/skills/hallmark/references/themes/sport.md @@ -0,0 +1,101 @@ +--- +name: Sport +slug: sport +genre: editorial +paper: light 98 250 +display: display-condensed Saira Condensed +accent: chromatic-volt 120 +posture: restrained +keywords: running, marathon, race, training, fitness, gym, team, league, fixtures, standings, scoreboard, athletics, performance, splits, sportswear, club, match, tournament +material: cool concrete paper, blue-black ink, uppercase Saira Condensed over Albert Sans, condensed figures and mono times, two-weight rules, one volt fill +photo: duotone ink paper con=20 +pictured: Stat-Led, Poster hero +--- + +# Sport + +A results-sheet material: cool concrete paper, blue-black ink, Saira Condensed 800 in capitals over an Albert Sans body, big condensed figures and JetBrains Mono times, hairlines and one heavier bar rule, and volt as the only colour. Volt is a fill: ink sits on it, and it never sets a letter on paper. Photographs print in the ink, like a race programme. It reads fast because of the condensed caps, the numbers and the action, never a slant or a gradient; it is not a sportswear advert and not a neon gaming page. + +## Tokens + +```css +:root { + --color-paper: oklch(98% 0.005 250); --color-paper-2: oklch(95% 0.006 250); --color-paper-3: oklch(91.5% 0.007 250); + --color-ink: oklch(16% 0.080 260); --color-ink-2: oklch(22% 0.060 258); --color-muted: oklch(50% 0.020 250); + --color-rule: oklch(78% 0.008 250); --color-rule-2: oklch(36% 0.060 255); + --color-accent: oklch(88% 0.200 120); --color-accent-ink: oklch(16% 0.080 260); --color-accent-deep: oklch(58% 0.145 125); + --color-focus: oklch(58% 0.145 125); --color-slot: oklch(76% 0.07 258); + --font-display: "Saira Condensed", sans-serif; --font-body: "Albert Sans", ui-sans-serif, sans-serif; + --font-outlier: "JetBrains Mono", ui-monospace, monospace; + --radius-card: 4px; --radius-pill: 4px; --rule-hair: 1px; --rule-bar: 2px; + --shadow-card: none; + --tracking-display: -0.015em; --display-weight: 800; +} +``` + +## Type + +- **Display:** Saira Condensed 800, uppercase, `--tracking-display`, line-height 1.02, upright, roman. A true condensed design, so the caps stack without crowding, even at poster scale over a photograph; the speed is in the caps, never a slant. +- **Body:** Albert Sans 400 and 500, sentence case. +- **Figures:** at statement size (a distance, a field size, a price, a date) Saira Condensed 800 with `tabular-nums`, from `--text-display-s` up, the label in Albert Sans beneath. In columns and live data (times, splits, bibs) JetBrains Mono 500, a step or more larger than its label. Mono is a stopwatch, never a label or a head. +- **Labels, captions, table heads, units:** Albert Sans 500 a step smaller, sentence case, untracked, `--color-muted`; on a volt fill every word is the ink. + +## Surfaces + +- Two rule weights, never boxed cards: `--rule-hair` in `--color-rule` rules rows and grids; the `--rule-bar` in `--color-rule-2` opens and closes a table and breaks a section. +- Radius 4px on controls, inputs and photographs; no pills. +- Depth from rules and paper steps, never shadows: a well is `--color-paper-2` under a bar rule. +- Bands: a `--color-paper-2` band, or one `--color-ink` band with paper type; two a page at most, never a volt band. +- Photographs: race photography at the runner's eye or lower: a pack mid-stride, legs and shoes on tarmac, a road climbing a valley side, a number being pinned on; hard daylight, the motion sharp, cropped tight, nobody posing. Printed in the ink on the paper (the `photo:` duotone), 4px radius, an inset ink hairline at 8%. Type on a photograph is paper over an ink scrim from its edge; a volt figure may hold a frame's corner with a fact (the mile, the time). +- No texture, no gradient but a photograph's scrim, no hard-offset shadow. + +## Range + +- **The race in figures:** three or four of the prompt's numbers in condensed caps at display size under the bar rule, parted by hairlines, one at most sitting on a volt fill. +- **A working control on the race's facts:** a pace or time planner on the ink band, the chosen time in mono at display size, every mile in a ruled grid that changes in place, the finish cell in volt. +- **Results as a sheet:** the bar rule opening and closing a table of bibs and times in mono, the followed runner's row lifted a paper step and its latest split in volt. +- **The course as stages:** start to finish as numbered stages on one bar rule, a condensed-cap title and one line each, the live stage on volt. + +## Controls + +- The control pair: a volt-filled block with ink text beside one bordered 2px in ink, both 4px, set in the display face's capitals with no added tracking; on a photograph the second takes paper. +- Links grow a `--color-accent-deep` underline on hover (3:1 on paper); inputs are 4px with a 1px `--color-rule` border and the `--color-focus` ring. +- The volt is always a fill under ink and under 5% of a screen: the primary control, an active row, one highlighted figure. + +## Motion + +Nothing moves except state and live data: a deep-volt underline grows under a link on hover, a row lifts one paper step, a live split changes in place, never counting up. No reveal, no parallax. + +## Voice + +Race-briefing plain: the distance, the time, the place, as a marshal calls them. Imperative heads in capitals, sentence case below, numerals over words, verbs over adjectives. + +## Do-nots + +- Never slant or italicise the display; the upright condensed cap is the speed. +- Never loosen the display tracking past zero, or tighten it until two capitals touch. +- Never warm paper; the ground is cool concrete, hue 250. +- Never volt type, a volt hairline on paper or a second accent; photographs print in the ink, never in their own colour. +- Never a medal, trophy, podium or jersey texture, drawn or photographed; the race is the road and the runners. + +## Build hint + +```html + +``` + +```css +h1, h2, h3 { font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--tracking-display); text-transform: uppercase; line-height: 1.02; } +.figure { font: var(--display-weight) var(--text-display)/0.9 var(--font-display); font-variant-numeric: tabular-nums; } +.time { font: 500 var(--text-2xl)/1 var(--font-outlier); font-variant-numeric: tabular-nums; } +.btn { border: var(--rule-bar) solid transparent; border-radius: var(--radius-card); padding: var(--space-sm) var(--space-lg); font: var(--display-weight) var(--text-md)/1.25 var(--font-display); text-transform: uppercase; } +.btn--primary { background: var(--color-accent); color: var(--color-accent-ink); } +.btn--secondary { border-color: var(--color-ink); color: var(--color-ink); } +.well { background: var(--color-paper-2); border-top: var(--rule-bar) solid var(--color-rule-2); } +.rule { border-top: var(--rule-bar) solid var(--color-rule-2); } +th, td { border-top: var(--rule-hair) solid var(--color-rule); } +.photo { border-radius: var(--radius-card); outline: 1px solid color-mix(in oklab, var(--color-ink) 8%, transparent); outline-offset: -1px; } +.scrim { background: linear-gradient(to top, color-mix(in oklab, var(--color-ink) 70%, transparent), transparent 60%); color: var(--color-paper); } +a:hover { text-decoration-color: var(--color-accent-deep); } +::selection { background: var(--color-accent); color: var(--color-ink); } +``` diff --git a/skills/hallmark/references/themes/squeeze.jpg b/skills/hallmark/references/themes/squeeze.jpg new file mode 100644 index 0000000..66c3374 Binary files /dev/null and b/skills/hallmark/references/themes/squeeze.jpg differ diff --git a/skills/hallmark/references/themes/squeeze.md b/skills/hallmark/references/themes/squeeze.md new file mode 100644 index 0000000..32a6488 --- /dev/null +++ b/skills/hallmark/references/themes/squeeze.md @@ -0,0 +1,99 @@ +--- +name: Squeeze +slug: squeeze +genre: playful +paper: mid 41 154 +display: geometric-sans Gabarito +accent: warm 56 +posture: drenched +keywords: fruit, food box, grocer, market, delivery, weekly, seasonal, farm shop, subscription, produce, veg box, cheerful, family, treats, stall, orchard, local, fresh +material: forest-green paper with real chroma, warm white ink, Gabarito 800 heads and figures over Manrope, soft rounded tiles a step lighter or deeper, fruit photographed bright and close, juicy peach controls +photo: natural vib=12 con=4 +pictured: Bento Grid, Stage hero +--- + +# Squeeze + +A market stall in colour: a forest-green ground with real chroma, warm white ink, Gabarito's round, heavy heads and figures over a sturdy Manrope, soft tiles a step lighter or deeper, fruit photographed bright and close, juicy peach controls and one warm-white card. It is cheerful because the green is the whole surface and the fruit is the colour on it; a price or a day set huge in Gabarito is as much the material as a crate of fruit. It is not a neutral grocery template with a green button, and not an organic label in serif and kraft. + +## Tokens + +```css +:root { + --color-paper: oklch(41% 0.100 154); --color-paper-2: oklch(47% 0.105 154); --color-paper-3: oklch(34% 0.090 156); + --color-ink: oklch(99% 0.005 90); --color-ink-2: oklch(94% 0.020 120); --color-muted: oklch(90% 0.030 150); --color-rule: oklch(55% 0.100 154); + --color-accent: oklch(83% 0.115 56); --color-accent-2: oklch(74% 0.150 46); --color-accent-ink: oklch(30% 0.070 40); --color-focus: oklch(88% 0.14 85); + --color-card: oklch(97% 0.012 85); --color-card-ink: oklch(24% 0.05 160); + --font-display: "Gabarito", ui-sans-serif, system-ui, sans-serif; --font-body: "Manrope", ui-sans-serif, system-ui, sans-serif; + --font-outlier: var(--font-display); + --radius-card: 24px; --radius-control: 16px; --radius-pill: 999px; --rule-hair: 1px; --rule-bar: 2px; + --shadow-card: 0 14px 32px -16px oklch(22% 0.05 160 / 0.5); + --tracking-display: -0.025em; --display-weight: 800; +} +``` + +## Type + +- **Display:** Gabarito 800, `--tracking-display`, line-height 1.0, sentence case, one colour per head. Round, compact and heavy, so it takes the shared display scale without a cap; never under 700. +- **Figures:** prices, dates and days in Gabarito 800 with tabular, lining numerals; a single figure may run three to four times the section head, tracked to -0.04em, with its unit at the same weight. +- **Body:** Manrope 500, line-height 1.55, in `--color-muted`; links and row titles at 700. Three weights in all: 800, 700, 500. +- **Labels, captions, table heads, meta:** Manrope 700 a step smaller, sentence case, untracked. Never mono, never uppercase. + +## Surfaces + +- Tiles, not cards: a tile is the ground one step lighter (`--color-paper-2`) at `--radius-card`, no border, no shadow; a sunk well takes `--color-paper-3`. A tile a visitor can choose sinks to `--color-paper-3` when chosen and takes a 3px `--color-accent` ring. +- The one raised surface is the warm-white card (`--color-card`, `--color-card-ink` type, `--shadow-card`), once a page, for the thing a visitor pays for; inside it the focus ring takes `--color-card-ink`. +- Rules at `--rule-bar` in `--color-rule`; only a rule between list rows is `--rule-hair`. +- Bands: the page is green, so a band is the lighter or the deeper green (`--color-paper-2`, `--color-paper-3`); two a page at most, never a white, grey or peach band. +- Photographs: fruit close in daylight, a crate from above, fruit held out, a heap on a stall; bright, the fruit filling the frame. `--radius-card`, no ring, no shadow; captions under in the label style; type on a photograph sits over a `--color-paper-3` scrim at 45 to 65%. +- No texture: the green is a flat colour. + +## Range + +- A price, a size or a day set as one figure at statement size: Gabarito 800 in ink straight on the green, its unit at full weight, the head and one line beside it on the remaining columns. The green and the figure carry the screen alone. +- A timetable of real dates as tiles or full-width rows: each date big in Gabarito, the weekday in the label style, the chosen one sunk to `--color-paper-3` and ringed in peach; a stall's chalkboard that works as a control. +- A promise set as a statement on the deeper green band, Gabarito at display size across ten columns, one action under it. +- Questions or plain terms as rows: Gabarito titles on the left, Manrope answers on the right, hair rules in `--color-rule` between. + +## Controls + +- The control pair: a peach-filled primary with `--color-accent-ink` text beside a 2px ink-outlined secondary, both at `--radius-control`, Manrope 700. Tags and chips are pills; nav links may be `--color-paper-2` pills. +- Links are ink at 700, the underline turning peach on hover; inputs take a 2px `--color-rule` border at `--radius-control` and the `--color-focus` ring. +- Peach stays on controls: the primary, a chosen chip or tile ring, a link's hover; `--color-accent-2` is the primary's pressed and hover step only. Never peach type and never a peach field. + +## Motion + +Cheerful and quick, state only: a control presses 1px down at `--dur-micro`, a chosen tile rings at `--dur-short` on `--ease-out`, a choosable tile steps a green lighter on hover. No reveal, no parallax, no loop; nothing that cannot be pressed reacts. + +## Voice + +The stall-holder's, out loud on a Thursday morning: the fruit, the day it comes, what ripe feels like in the hand. Short, warm sentences with the price said plainly; never gourmet, never a wellness pitch. + +## Do-nots + +- Never a neutral ground. White is for the one card; grey does not exist. The page is green. +- Never a dull or greyed green; the ground keeps its chroma, or it turns to army surplus. +- Never a weight under 500, a serif, or a mono figure: numbers are Gabarito. +- Never a hairline border; a 1px rule lives only between list rows. +- Never a dim photograph, and never one on every screen: the fruit is brightest when the green and the type get screens of their own. + +## Build hint + +```html + +``` + +```css +h1, h2, h3 { font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--tracking-display); } +h1, h2 { line-height: 1; } +.figure { font: var(--display-weight) clamp(7rem, 16vw, 15rem)/0.85 var(--font-display); letter-spacing: -0.04em; font-variant-numeric: lining-nums tabular-nums; } +.tile { background: var(--color-paper-2); border-radius: var(--radius-card); } +.tile:has(:checked) { background: var(--color-paper-3); box-shadow: inset 0 0 0 3px var(--color-accent); } +.card { background: var(--color-card); color: var(--color-card-ink); border-radius: var(--radius-card); box-shadow: var(--shadow-card); } +.btn { border: var(--rule-bar) solid var(--color-ink); border-radius: var(--radius-control); padding: var(--space-sm) var(--space-lg); font: 700 var(--text-md)/1.25 var(--font-body); color: var(--color-ink); transition: translate var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out); } +.btn--primary { background: var(--color-accent); color: var(--color-accent-ink); border-color: var(--color-accent); } +.btn--primary:hover { background: var(--color-accent-2); border-color: var(--color-accent-2); } +.btn:active { translate: 0 1px; } +.photo img { border-radius: var(--radius-card); } +::selection { background: color-mix(in oklab, var(--color-accent) 45%, transparent); color: var(--color-card-ink); } +``` diff --git a/skills/hallmark/references/themes/sticker.jpg b/skills/hallmark/references/themes/sticker.jpg new file mode 100644 index 0000000..9fbc20d Binary files /dev/null and b/skills/hallmark/references/themes/sticker.jpg differ diff --git a/skills/hallmark/references/themes/sticker.md b/skills/hallmark/references/themes/sticker.md new file mode 100644 index 0000000..dc6ea86 --- /dev/null +++ b/skills/hallmark/references/themes/sticker.md @@ -0,0 +1,106 @@ +--- +name: Sticker +slug: sticker +genre: playful +paper: light 95.7 82 +display: display-heavy Bowlby One SC +accent: chromatic-magenta 2 +posture: full-palette +keywords: stickers, print, merch, shop, maker, creator, diy, craft, vinyl, packaging, labels, small business, ecommerce, fun, loud, pink, cut, ship, order +material: warm off-white paper, warm black ink, Bowlby One SC over Sofia Sans, white die-cut borders on hard offset shadows, hot pink, lime and ink fills set with type +photo: natural vib=15 con=5 +pictured: Bento Grid, Stage hero +--- + +# Sticker + +A print shop's material: a warm off-white sheet, warm black ink, Bowlby One SC capitals over Sofia Sans, hot pink and lime fills, every raised surface edged in a thick white die-cut on a hard offset shadow. It feels loud and handmade because the depth is printed and the colours are fills, never tints. It is not a soft pastel shop with blurred shadows, and not a cartoon toy page. + +## Tokens + +```css +:root { + --color-paper: oklch(95.7% 0.013 82); --color-paper-2: oklch(92.8% 0.021 79); --color-paper-3: oklch(99.4% 0.007 89); + --color-ink: oklch(21% 0.011 81); --color-ink-2: oklch(30% 0.013 78); --color-muted: oklch(50% 0.017 64); + --color-rule: oklch(89.7% 0.02 80); --color-white: oklch(99.5% 0.003 82); + --color-accent: oklch(56% 0.225 2); --color-accent-deep: oklch(49% 0.205 2); --color-accent-2: oklch(87.6% 0.179 119); --color-slot: oklch(95% 0.021 355); + --color-accent-ink: oklch(99.5% 0.003 82); --color-focus: oklch(56% 0.225 2); + --font-display: "Bowlby One SC", "Arial Black", sans-serif; --font-body: "Sofia Sans", ui-sans-serif, system-ui, sans-serif; + --font-outlier: "Sofia Sans", ui-sans-serif, system-ui, sans-serif; + --radius-card: 18px; --radius-pill: 999px; --rule-hair: 1px; --rule-bar: 2px; + --shadow-card: 5px 6px 0 var(--color-ink); --shadow-press: 1px 1px 0 var(--color-ink); + --tracking-display: 0.005em; --display-weight: 400; +} +``` + +Two colourways, stated in the stamp (`sticker: sheet`). + +| Colourway | Paper, ink, fills | +| --- | --- | +| `sheet` (default) | the block above | +| `vinyl` | ground `oklch(21% 0.011 81)`, cards `oklch(25.5% 0.013 72)`, ink `oklch(95.7% 0.013 82)`, rule `oklch(33% 0.016 75)`; pink and lime unchanged, the borders still white | + +## Type + +- **Display:** Bowlby One SC 400, capitals only by design, `--tracking-display`, line-height 1.02. It is wide and heavy, so the `h1` caps at 4.5rem and section heads at 3.25rem. Never a paragraph. +- **Figures:** prices, counts and step numbers set in Bowlby, and a lone figure on a fill may run to 12rem; it is the loudest thing the theme owns, so one a screen. +- **Body:** Sofia Sans 400 and 600, line-height 1.5, `tabular-nums`. +- **Labels, tags, captions, table heads:** Sofia Sans 700 a step smaller, sentence case, untracked, `--color-muted`. No third face: the outlier token is Sofia Sans. + +## Surfaces + +- The die-cut: a raised surface (a card, a fill that holds a fact, a tag, a photograph, the primary control) carries a 6px `--color-white` border and `--shadow-card`, a hard offset with no blur. Surfaces that are the sheet itself (a table, a band) stay borderless, parted by the dashed rule. +- A raised surface may tilt between -6 and 6 degrees, never all one way; tables and inputs stay square. +- Radii: `--radius-card` on cards, 22px on photographs, pills on controls and tags; a `--rule-bar` dashed `--color-rule` is the divider and the edge of a drop zone. +- Bands: a `--color-paper-2` band, a `--color-ink` band with paper type, or one lime field with ink type; two a page at most. +- Photographs: the product in use or held to the lens, close, colour kept loud; 22px radius inside the white die-cut, one a screen tilted 3 degrees or less. A tag may overlap a corner with a fact; type never sits on a picture. +- No texture, no gradient behind type: depth is the hard offset alone. + +## Range + +- **Facts as die-cut fills:** a Bento whose tiles are pink, lime, ink and white fills, each one fact in Bowlby with one Sofia line, edged white on the hard shadow and tilted a degree or two in alternate directions; the lead tile carries the lone figure. +- **Steps as stuck-down cards:** three or four `
          ` cards in a row, the numeral in Bowlby on a lime disc, the cards tilted against each other and overlapping the dashed rule they sit on. +- **A working control on the lime field:** a stepper, a running total in Bowlby and a bar that fills toward a threshold the prompt gave, on a white die-cut card beside a dashed price ladder. +- **A statement in Bowlby on the ink band**, ten columns wide, with one pink or lime tag stuck across its corner carrying the fact it argues. + +## Controls + +- The control pair: a pink pill with a 5px white ring and `--shadow-card`, beside a ghost pill with an inset 2px ink border. Chips are pills with a 2px inset rule, the chosen one ink-filled. +- Links are ink with a pink underline on hover; inputs take a 2px ink edge at `--radius-card`. +- Colour in thirds: pink for the fills that act (the primary, a price), lime for the fills that mark (a tag, a count, a highlight), ink for the type. + +## Motion + +Sticker physics: a hover lifts a clickable raised surface 2px and turns it a degree; a press pushes it onto its shadow. `--dur-micro` on `--ease-out`, nothing on scroll. + +## Voice + +Cheerful and exact: the price, the quantity, the size, the ship day. It sounds like the person at the cutter. + +## Do-nots + +- Never a soft blurred drop under a raised surface; the shadow is a hard offset or there is no shadow. +- Never a die-cut border thinner than 4px, or in any colour but white. +- Never pink text on the paper; pink is a fill with white on it. +- Never a drawn sticker, mascot or doodle; the die-cut edges a real surface, a fact or a photograph, never a shape drawn to stand for a design. +- Never a photograph that only stands near the subject (a bottle, a stapler, a pencil pot); without the product's own pictures, the fills carry the page. + +## Build hint + +```html + +``` + +```css +h1, h2, h3 { font-family: var(--font-display); font-weight: 400; letter-spacing: var(--tracking-display); line-height: 1.02; } +h1 { font-size: min(var(--text-display), 4.5rem); } h2 { font-size: min(var(--text-section), 3.25rem); } +.diecut { border: 6px solid var(--color-white); border-radius: var(--radius-card); box-shadow: var(--shadow-card); } +.diecut--photo { border-radius: 22px; overflow: hidden; background: var(--color-slot); } +.btn { display: inline-flex; align-items: center; height: 52px; padding: 0 var(--space-lg); border-radius: var(--radius-pill); font-weight: 700; font-size: var(--text-md); color: var(--color-ink); box-shadow: inset 0 0 0 2px var(--color-ink); } +.btn--primary { background: var(--color-accent); color: var(--color-accent-ink); box-shadow: 0 0 0 5px var(--color-white), 5px 6px 0 var(--color-ink); transition: translate var(--dur-micro) var(--ease-out), box-shadow var(--dur-micro) var(--ease-out); } +.btn--primary:hover { background: var(--color-accent-deep); } +.btn--primary:active { translate: 4px 5px; box-shadow: 0 0 0 5px var(--color-white), var(--shadow-press); } +.fill { border: 6px solid var(--color-white); border-radius: var(--radius-card); box-shadow: var(--shadow-card); background: var(--color-accent); color: var(--color-accent-ink); } +.rule { border-top: var(--rule-bar) dashed var(--color-rule); } +::selection { background: var(--color-accent-2); color: var(--color-ink); } +``` diff --git a/skills/hallmark/references/themes/studio.jpg b/skills/hallmark/references/themes/studio.jpg new file mode 100644 index 0000000..5c22eb4 Binary files /dev/null and b/skills/hallmark/references/themes/studio.jpg differ diff --git a/skills/hallmark/references/themes/studio.md b/skills/hallmark/references/themes/studio.md new file mode 100644 index 0000000..0b2e82e --- /dev/null +++ b/skills/hallmark/references/themes/studio.md @@ -0,0 +1,99 @@ +--- +name: Studio +slug: studio +genre: editorial +paper: light 97.2 215 +display: roman-serif Hedvig Letters Serif +accent: warm 52 +posture: restrained +keywords: design studio, creative studio, branding, brand identity, art direction, agency, portfolio, case study, selected work, editorial design, typography, creative direction, graphic design, considered, curatorial +material: cool studio-white proof paper with an ink dot grid and grain, blue-black ink, Hedvig Letters Serif heads over Geist, crop marks on every printed piece, orange construction guides, the work photographed in true colour, one cadmium-orange signal +photo: natural +pictured: Portfolio Index, Ledge hero +--- + +# Studio + +A design studio's proof sheet, caught mid-build: cool studio-white paper with an ink dot grid and a fine grain, blue-black ink, Hedvig Letters Serif for the heads (a contemporary serif with a calligraphic hand in its joins), a clean Geist body, crop marks at the corners of every printed piece, and one cadmium orange that both fills the action and draws the construction: metric guides, clear-space boxes, redlines. It reads as considered because the type is shown being measured. It is not a warm cream portfolio with a terracotta accent, and not a grey minimal template. + +## Tokens + +```css +:root { + --color-paper: oklch(97.2% 0.006 215); --color-paper-2: oklch(94% 0.009 215); --color-paper-3: oklch(90.5% 0.011 215); --color-paper-hi: oklch(99% 0.004 215); + --color-ink: oklch(16% 0.032 250); --color-ink-2: oklch(34% 0.022 245); --color-muted: oklch(49% 0.018 240); + --color-rule: oklch(84% 0.010 225); + --color-accent: oklch(68% 0.172 50); --color-accent-ink: oklch(16% 0.032 250); --color-focus: oklch(52% 0.15 48); + --color-dot: color-mix(in oklab, var(--color-ink) 20%, transparent); --color-mark: color-mix(in oklab, var(--color-ink) 72%, transparent); + --font-display: "Hedvig Letters Serif", ui-serif, Georgia, serif; --font-body: "Geist", ui-sans-serif, system-ui, sans-serif; + --font-outlier: "Sofia Sans Extra Condensed", "Arial Narrow", ui-sans-serif, sans-serif; + --radius-card: 3px; --radius-pill: 3px; --rule-hair: 1px; + --shadow-card: none; + --shadow-sheet: 1px 2px 0 color-mix(in oklab, var(--color-ink) 7%, transparent), 10px 18px 36px -14px color-mix(in oklab, var(--color-ink) 32%, transparent); + --tracking-display: -0.022em; --display-weight: 400; +} +``` + +## Type + +- **Display:** Hedvig Letters Serif 400, its one weight, `--tracking-display`, line-height 0.98 to 1.04, sentence case, `font-optical-sizing: auto`. The hand holds from a 200px wordmark down to a 25px item title (tracking -0.005em there). Heads, figures and the wordmark only. +- **Body:** Geist 400 and 500, line-height 1.55, ink-2 for running text. +- **Labels, captions, guide readouts:** Geist 500 a step smaller, sentence case, `--color-muted`, tabular figures for any measurement. No mono. +- **Specimen face:** Sofia Sans Extra Condensed 500, only inside a specimen that shows an alternative system; never a head or label of the page itself. + +## Surfaces + +- The ground is a generated proof, never a picture: a 24px radial-gradient dot grid in `--color-dot` under an `feTurbulence` grain (`--grain`), on the hero, nav and footer, masked to fade before the next section; the rest of the page is clean paper. +- Crop marks on every printed piece (a sheet, a photograph, a card, a control, a focused field): eight 1px `--color-mark` ticks drawn with background gradients on a `::before`, set off the corners by a small gap, larger on a sheet. Registration targets may sit at a sheet's sides. +- Orange draws construction: 1px `--color-accent` guides at the font's real ascender, cap height, x-height, baseline and descender with their readouts in the label voice, a clear-space box in x units, redlines with dimensions. Rules only, never orange type. +- Two rules: 1px `--color-rule` between rows; 1px `--color-ink` opening a set. Radius 3px. +- One shadow, for paper objects only (a card, a sheet), lit from the top left: `--shadow-sheet`. Everything else lies flat. +- Bands: paper-2, or one ink band with paper type; never an orange field. +- Photographs: the work where it is used, level, daylight, verticals straight, true colour, crop-marked, a ratio redline beside it; never a mockup. + +## Range + +- **A wordmark under construction:** the name set huge in Hedvig with its metric guides, clear-space box and readouts on the dot grid; the pointer measures a letter's advance in font units. +- **Systems as specimen cards:** two or three alternatives as crop-marked cards (face line, `Aa Gg Rr 0123456789`, hex swatches) that switch one board set by type, colour or grid. +- **An index that opens:** rows under an ink rule, Hedvig at item size, each opening into a case with its photograph held at a stated ratio. +- **A size test:** one line at falling sizes (banner, poster, ticket), each on its own orange guides with its live size beside it. + +## Controls + +- Printed controls: a 1px ink border at 2px radius, a second rule inset 2px inside it, crop marks at the corners that open slightly on hover; the primary is filled orange with ink text. Geist 500, 48px. +- Fields: 3px, a 1px `--color-muted` border, crop marks appear on focus. Links take an orange underline on hover. +- Orange fill stays on the one action; orange lines are construction and may be many but thin. + +## Motion + +Guides draw in once along their length. A set of systems may turn every few seconds while in view and stops on any choice. State changes at `--dur-short` on `--ease-out`. Reduced motion: the full construction, still. + +## Voice + +Spare and exact, a little literary. Verbs over adjectives; name the work, the institution, the surface it lives on, the measurement. Never "creative solutions" or "brands brought to life". + +## Do-nots + +- Never Hedvig in running text, never the specimen face outside a specimen. +- Never an orange flood, orange type or a second warm colour. +- Never warm paper; the ground is cool, hue 215. +- Never a guide that is not true to the font's metrics or a dimension that is not the real one. +- Never the dot grid behind a whole page or running text. + +## Build hint + +```html + +``` + +```css +h1, h2, h3 { font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--tracking-display); color: var(--color-ink); font-optical-sizing: auto; line-height: 1.0; } +.proof { background-image: var(--grain), radial-gradient(circle at 1px 1px, var(--color-dot) 1px, transparent 1.4px); background-size: 160px 160px, 24px 24px; } +.crop { position: relative; --l: 8px; --o: 12px; } +.crop::before { content: ""; position: absolute; inset: calc(-1 * var(--o)); pointer-events: none; background: linear-gradient(var(--color-mark), var(--color-mark)) 0 var(--o) / var(--l) 1px no-repeat, linear-gradient(var(--color-mark), var(--color-mark)) var(--o) 0 / 1px var(--l) no-repeat; } +.btn { border: var(--rule-hair) solid var(--color-ink); border-radius: 2px; min-height: 48px; padding: 0 var(--space-lg); font-weight: 500; color: var(--color-ink); } +.btn::after { content: ""; position: absolute; inset: 2px; border: var(--rule-hair) solid var(--color-mark); } +.btn--primary { background: var(--color-accent); color: var(--color-accent-ink); } +.guide { height: var(--rule-hair); background: var(--color-accent); } +.set { border-top: var(--rule-hair) solid var(--color-ink); } .set > * { border-bottom: var(--rule-hair) solid var(--color-rule); } +``` diff --git a/skills/hallmark/references/themes/terminal.jpg b/skills/hallmark/references/themes/terminal.jpg new file mode 100644 index 0000000..2983a3d Binary files /dev/null and b/skills/hallmark/references/themes/terminal.jpg differ diff --git a/skills/hallmark/references/themes/terminal.md b/skills/hallmark/references/themes/terminal.md new file mode 100644 index 0000000..c7ebe75 --- /dev/null +++ b/skills/hallmark/references/themes/terminal.md @@ -0,0 +1,96 @@ +--- +name: Terminal +slug: terminal +genre: atmospheric +paper: dark 12.5 150 +display: mono Martian Mono +accent: chromatic-green 142 +posture: committed +keywords: cli, terminal, shell, command-line, tui, self-hosted, open-source, binary, ssh, sysadmin, devops, homelab, install script, package manager, repl, dotfiles, developer tool, phosphor +material: a near-black ground with a green cast in three lightness steps, pale phosphor ink and one bright phosphor signal with a dim wash of itself, every glyph Martian Mono with heads wide and text narrow, and pictures printed in the page's own glyphs: a photograph rendered as a grid of characters taken from the product's own text, dim cells small, bright cells full, stirred by the cursor +photo: duotone paper accent con=20 +pictured: Session, Split hero +--- + +# Terminal + +The page is the terminal surface, and its pictures are printed in type. A near-black ground with a green cast, pale phosphor ink, one bright phosphor green and a dim wash of it for what is added or selected, and Martian Mono for every glyph: heads wide, text narrow. A picture is printed as a grid of characters from the product's own text. It reads as a tool made by people who live in a shell. It is not the CRT costume and not a dark product page holding a screenshot of a terminal. + +## Tokens + +```css +:root { + --color-paper: oklch(12.5% 0.012 150); --color-paper-2: oklch(16% 0.016 150); --color-paper-3: oklch(20.5% 0.022 150); + --color-ink: oklch(94% 0.03 140); --color-ink-2: oklch(82% 0.05 142); --color-muted: oklch(64% 0.06 145); + --color-rule: oklch(27% 0.028 148); --color-rule-2: oklch(38% 0.045 146); + --color-accent: oklch(87% 0.2 142); --color-accent-ink: oklch(14% 0.02 150); --color-focus: oklch(87% 0.2 142); + --color-accent-wash: oklch(23% 0.06 145); + --glyph-0: oklch(30% 0.06 146); --glyph-1: oklch(38% 0.08 145); --glyph-2: oklch(47% 0.11 144); --glyph-3: oklch(57% 0.14 143); + --glyph-4: oklch(67% 0.17 142); --glyph-5: oklch(77% 0.19 142); --glyph-6: oklch(86% 0.2 141); --glyph-7: oklch(94% 0.12 138); + --font-display: "Martian Mono", ui-monospace, monospace; --font-body: var(--font-display); --font-outlier: var(--font-display); + --radius-card: 0; --radius-pill: 0; --rule-hair: 1px; --shadow-card: none; + --tracking-display: -0.02em; --display-weight: 500; --stretch-display: 112.5%; --stretch-body: 87.5%; +} +``` + +## Type + +- **Every glyph is Martian Mono,** in three weights at most: 400, 500, 700. Display 500 at `--stretch-display`, line-height 1.12, `h1` at most 3.75rem in two or three lines. Body 400 at `--stretch-body`, 15 to 16px, line-height 1.65. Labels and meta a step smaller in `--color-muted`, sentence case, untracked. +- **Figures** set wide and light against the narrow text: 400 at `--stretch-display` from `--text-display-s` up, tabular, the unit or a `#` comment beneath in `--color-muted`. +- Prompt glyphs (`$`, `~ $`) in `--color-muted` mark real commands and only those; arguments in a reference take the accent. +- Martian Mono has no box-drawing or block glyphs. Diagrams are typed in `+ - |` and wordmarks printed as glyph pictures, so no fallback face slips into a line. + +## Surfaces + +- One hue, a ramp of lightness: ground, `--color-paper-2` for a session or an install well, `--color-paper-3` for hover and selection. Raised surfaces take a 1px `--color-rule` border, square, never a shadow; `--color-rule-2` is the firmer line under a table head or a diff's file header. +- Rules: 1px `--color-rule` between sections, rows and tabs. +- **Pictures as glyphs:** a picture with a strong silhouette on black, reduced to a grid of brightness levels (about 130 columns, cells 1.85 times as tall as wide) and drawn on a canvas, each lit cell one character of the product's text in `--glyph-0` to `--glyph-7`, dim cells at 62% size; a static `
          ` stands in without script. One or two a page, big.
          +- When a glyph grid cannot be made, one photograph stands in, in the `photo:` duotone with a 1px `--color-rule` border: the machines themselves, never a screen showing an interface.
          +- No scanline, glow, bezel, title bar or traffic lights.
          +
          +## Range
          +
          +- **A comparison as a diff:** a unified diff across ten or twelve columns, a `--- a/` and `+++ b/` header over a `--color-rule-2` line, removed lines in `--color-muted` behind `-`, added lines in ink on `--color-accent-wash` behind a green `+`, a gutter of line numbers in `--color-rule-2`.
          +- **Figures as a tool's output:** three or four of the prompt's numbers at display size, wide and light, parted by vertical rules, each labelled by a `# comment` beneath, as `wc` or `du` would print them.
          +- **The session at size:** a session in a `--color-paper-2` well across eight columns or more, typed once, its output lighting a `+ - |` diagram beside it.
          +- **A reference as rows:** a command per row at `--text-title`, wide, its arguments in the accent, its line on the right, like a man page's synopsis; or a table of hosts, flags or exit codes.
          +
          +## Controls
          +
          +- Primary: an accent block with `--color-accent-ink` text, square. Secondary: a 1px `--color-ink-2` border. Hover and state switch in `steps(1)`.
          +- Install lines: a `--color-paper-2` well with tabs (brew, cargo, curl) underlined in the accent, the command at `--text-lg`, and a 16px copy icon at the right that turns into a tick in the accent for 1.4s.
          +- Links in `--color-ink-2`, underlined dotted, accent on hover; a selected row or tab takes `--color-accent-wash`.
          +
          +## Motion
          +
          +Stepped where it is state, alive where it is a picture: a glyph picture resolves row by row from noise over about 1.5s, once, and under the cursor its cells flare to the accent, then settle. A session types itself once when it enters the view. A caret blinks five times and holds. Reduced motion shows every final state.
          +
          +## Voice
          +
          +Commands, flags, paths and exit codes. Declarative and short: name the command, never the adjective.
          +
          +## Do-nots
          +
          +- Never a proportional face, and never a box-drawing glyph from a fallback font.
          +- Never a second hue: no amber, no cyan, no red for a removed line.
          +- Never a rounded corner, a pill or a soft card, and never a light section.
          +- Never more than one photograph, and only where glyphs cannot be made.
          +
          +## Build hint
          +
          +```html
          +
          +```
          +
          +```css
          +body { font-stretch: var(--stretch-body); font-variant-numeric: tabular-nums; }
          +h1, h2, h3 { font-weight: var(--display-weight); font-stretch: var(--stretch-display); letter-spacing: var(--tracking-display); line-height: 1.12; }
          +.figure { font-weight: 400; font-stretch: var(--stretch-display); font-size: var(--text-display); line-height: 1; }
          +.art { position: relative; } .art canvas { position: absolute; inset: 0; }
          +.btn--primary { background: var(--color-accent); color: var(--color-accent-ink); border-radius: 0; transition: background-color var(--dur-micro) steps(1); }
          +.well { background: var(--color-paper-2); border: var(--rule-hair) solid var(--color-rule); }
          +.diff .add { background: var(--color-accent-wash); color: var(--color-ink); } .diff .add::before { content: "+"; color: var(--color-accent); }
          +.diff .del { color: var(--color-muted); } .diff .del::before { content: "-"; }
          +```
          +
          +To make a glyph picture: crop the subject, autocontrast, resize to `cols` by `round(cols * h / w / 1.85)`, quantise brightness to levels 0 to 8 (0 is blank), and ship the rows as strings; the canvas sets each lit cell's glyph from the product text in order and its colour from `--glyph-(level - 1)`.
          diff --git a/skills/hallmark/references/themes/terrazzo.jpg b/skills/hallmark/references/themes/terrazzo.jpg
          new file mode 100644
          index 0000000..ce0fd35
          Binary files /dev/null and b/skills/hallmark/references/themes/terrazzo.jpg differ
          diff --git a/skills/hallmark/references/themes/terrazzo.md b/skills/hallmark/references/themes/terrazzo.md
          new file mode 100644
          index 0000000..769ab66
          --- /dev/null
          +++ b/skills/hallmark/references/themes/terrazzo.md
          @@ -0,0 +1,106 @@
          +---
          +name: Terrazzo
          +slug: terrazzo
          +genre: modern-minimal
          +paper: light 96 82
          +display: geometric-sans Syne
          +accent: warm 38
          +posture: restrained
          +keywords: materials, library, architects, samples, catalogue, surfaces, stone, timber, terrazzo, ceramic, tile, interiors, interiors studio, showroom, specification, swatches, supplier, drawer, photography, tactile
          +material: off-white paper, white card surfaces ruled in ink over a hard offset, wide Syne heads over Onest, JetBrains Mono for codes and millimetres, surfaces photographed flat-on in true colour, rust the one signal
          +photo: natural con=4
          +pictured: Sample Drawer, Ledge hero
          +---
          +
          +# Terrazzo
          +
          +A materials library's specification voice: off-white paper, near-black ink, wide Syne heads over a plain Onest body, JetBrains Mono for the codes and the millimetres, and white card surfaces ruled in 2px ink over a hard offset, holding the surfaces themselves photographed flat-on and close. Controls are ink; colour arrives only in aggregate, in the stone, timber, terrazzo and glaze the photographs show, with rust as the one signal. It is organised like a sample drawer and reads like a spec sheet. It is not a pastel lifestyle page and not confetti.
          +
          +## Tokens
          +
          +```css
          +:root {
          +  --color-paper: oklch(96% 0.009 82); --color-paper-2: oklch(92% 0.012 82); --color-paper-3: oklch(87.5% 0.014 80);
          +  --color-plate: oklch(99.5% 0.003 82);
          +  --color-ink: oklch(16% 0.006 60); --color-ink-2: oklch(27% 0.006 60); --color-muted: oklch(46% 0.01 60);
          +  --color-rule: oklch(81% 0.012 80);
          +  --color-accent: oklch(53% 0.15 38); --color-accent-soft: oklch(91% 0.035 45); --color-accent-ink: oklch(99.5% 0.003 82); --color-focus: oklch(50% 0.16 38);
          +  --font-display: "Syne", ui-sans-serif, sans-serif; --font-body: "Onest", ui-sans-serif, sans-serif;
          +  --font-outlier: "JetBrains Mono", ui-monospace, monospace;
          +  --radius-card: 0; --radius-pill: 0; --rule-hair: 1px; --rule-bar: 2px;
          +  --shadow-card: 14px 14px 0 var(--color-paper-3); --shadow-card-hover: 14px 14px 0 var(--color-ink);
          +  --tracking-display: -0.025em; --display-weight: 700;
          +}
          +```
          +
          +Three colourways, stated in the stamp (`terrazzo: off-white`).
          +
          +| Colourway | Paper and ink | Signal and controls |
          +| --- | --- | --- |
          +| **Off-white** (default) | the tokens above | rust; ink controls |
          +| **Black** | `oklch(14% 0.005 60)` under bone ink `oklch(96% 0.01 80)`; cards stay white | rust lifted to `oklch(68% 0.14 40)`; bone controls with ink text |
          +| **Stone** | warm grey `oklch(85% 0.012 80)` under the same ink | rust; ink controls |
          +
          +## Type
          +
          +- **Display:** Syne 700, `--tracking-display`, line-height 1.0, sentence case. The face sets wide, so heads stay short rather than drop a step; 800 turns clumsy and is never used. A figure at display size takes -0.04em.
          +- **Body:** Onest 400 and 500, line-height 1.5. Three weights a page: 400, 500, 700.
          +- **Labels, captions, table heads:** Onest 500 a step smaller, sentence case, untracked.
          +- **Codes and measures:** JetBrains Mono 500 for a sample code (`ST-0412`), a size in millimetres, a count in a table; the size of the text beside it, never a label or a head.
          +
          +## Surfaces
          +
          +- Rules: `--rule-bar` ink on the top of a table, along a band's edge and around a card; `--rule-hair` in `--color-rule` between rows. Radius 0 everywhere.
          +- Cards: `--color-plate` inside a `--rule-bar` ink border over the hard `--shadow-card` (paper-3, no blur), the page's one container; nothing else casts. A linked card swaps its offset to ink on hover.
          +- Bands: a `--color-ink` band with paper text, or a `--color-paper-2` band; never a coloured field, two a page at most.
          +- Photographs: the surface itself, flat-on and close in even daylight, so grain, chips, veins and joints read near one to one; a set of four runs as a true set at one ratio. True colour, a little sharpened. Each sits in a card, edge to edge with its caption beneath naming the family and the finish; type never sits on a photograph.
          +- No texture and nothing drawn on the paper: the surfaces in the photographs are the pattern.
          +
          +## Range
          +
          +- **Specification table:** the stock as a full-width table under a `--rule-bar` ink rule: the code and the size in mono, the surface's name in Onest 500 at title size, family and finish in muted; a hovered or selected row takes `--color-accent-soft` and a rust code.
          +- **Figure on the ink band:** the library's one big number in Syne at twice `--text-display`, paper on ink, with the families or the terms set beside it as a short ruled list.
          +- **Steps on rules:** a real ordered list hung from hairlines, each numeral in Syne at section size, the stage in Onest 500 and one line beside it.
          +- **Form as a request card:** the booking on a white card with its hard offset, inputs square on the plate colour, choices as square cells joined edge to edge, the checked cell ink with paper text.
          +
          +## Controls
          +
          +- An ink-filled primary with paper text beside a `--rule-bar` inset ink outline, both square, Onest 500. On the ink band the primary turns plate with ink text.
          +- Links are ink with a hairline underline that turns rust on hover; inputs are square on `--color-plate` with a 1px ink border.
          +- Rust reaches a code, a selected row or chip, a hover underline and the focus ring; colour otherwise comes only from the photographs.
          +
          +## Motion
          +
          +Still. A linked card swaps its offset from paper-3 to ink over `--dur-micro`; a filtered row leaves without animation.
          +
          +## Voice
          +
          +A catalogue's plainness: the family, the finish, the code, the size at one to one. Never sells the feeling of stone.
          +
          +## Do-nots
          +
          +- Never a drawn chip, speck or confetti; a surface's colour comes from its photograph.
          +- Never a photograph as a background or under type; it lives in a card.
          +- Never a coloured primary on off-white paper; controls are ink.
          +- Never a rounded corner, on a card, a control or a photograph.
          +
          +## Build hint
          +
          +```html
          +
          +```
          +
          +```css
          +h1, h2, h3 { font-weight: 700; line-height: 1; }
          +.btn { border-radius: 0; padding: var(--space-md) var(--space-lg); font-weight: 500; color: inherit; }
          +.btn--primary { background: var(--color-ink); color: var(--color-paper); }
          +.btn--secondary { box-shadow: inset 0 0 0 var(--rule-bar) currentColor; }
          +.card { background: var(--color-plate); border: var(--rule-bar) solid var(--color-ink); box-shadow: var(--shadow-card); }
          +a.card { transition: box-shadow var(--dur-micro) var(--ease-out); }
          +a.card:hover { box-shadow: var(--shadow-card-hover); }
          +.band--ink { background: var(--color-ink); color: var(--color-paper); }
          +.band--ink .btn--primary { background: var(--color-plate); color: var(--color-ink); }
          +.spec { border-top: var(--rule-bar) solid var(--color-ink); } .spec tr:hover { background: var(--color-accent-soft); }
          +.code { font-family: var(--font-outlier); font-weight: 500; font-variant-numeric: tabular-nums; }
          +::selection { background: color-mix(in oklab, var(--color-accent) 25%, transparent); }
          +```
          diff --git a/skills/hallmark/references/themes/ultraviolet.jpg b/skills/hallmark/references/themes/ultraviolet.jpg
          new file mode 100644
          index 0000000..b397a2c
          Binary files /dev/null and b/skills/hallmark/references/themes/ultraviolet.jpg differ
          diff --git a/skills/hallmark/references/themes/ultraviolet.md b/skills/hallmark/references/themes/ultraviolet.md
          new file mode 100644
          index 0000000..7b44a71
          --- /dev/null
          +++ b/skills/hallmark/references/themes/ultraviolet.md
          @@ -0,0 +1,106 @@
          +---
          +name: Ultraviolet
          +slug: ultraviolet
          +genre: modern-minimal
          +paper: light 95 300
          +display: geometric-sans Outfit
          +accent: cool 290
          +posture: committed
          +keywords: music, audio, stems, remix, dj, producer, player, streaming, tempo, playlist, creator, app, consumer, lowercase, violet, sound, beats, recording studio
          +material: lavender paper or a violet-black night, Outfit set lowercase over Onest, hairline pills, one saturated violet in two strengths, photographs pulled into the violet
          +photo: tint accent con=10
          +pictured: Workbench, Stage hero, in the night colourway
          +---
          +
          +# Ultraviolet
          +
          +A producer's tool in one pigment: a paper tinted the same hue as the ink, one saturated violet in two strengths, Outfit set lowercase on every head and control, pills throughout, depth held to a hairline, photographs pulled into the violet. It reads quick, exact and young without raising its voice. It is not a purple-gradient startup page and not a neon club flyer.
          +
          +## Tokens
          +
          +```css
          +:root {
          +  --color-paper: oklch(95% 0.02 300); --color-paper-2: oklch(92% 0.03 300); --color-paper-3: oklch(89% 0.035 300);
          +  --color-ink: oklch(18% 0.02 300); --color-ink-2: oklch(28% 0.03 300); --color-muted: oklch(46% 0.05 300);
          +  --color-rule: oklch(84% 0.04 300); --color-rule-2: oklch(70% 0.08 295);
          +  --color-accent: oklch(50% 0.25 290); --color-accent-deep: oklch(43% 0.22 290); --color-accent-soft: oklch(86% 0.08 295);
          +  --color-accent-ink: oklch(97% 0.01 300); --color-focus: oklch(50% 0.25 290);
          +  --font-display: "Outfit", ui-sans-serif, system-ui, sans-serif; --font-body: "Onest", ui-sans-serif, sans-serif;
          +  --font-outlier: "JetBrains Mono", ui-monospace, monospace;
          +  --radius-card: 16px; --radius-pill: 999px; --rule-hair: 1px;
          +  --shadow-card: 0 1px 2px oklch(18% 0.02 300 / 0.06);
          +  --tracking-display: -0.03em; --display-weight: 500;
          +}
          +```
          +
          +Three colourways, set once per page and stated in the stamp (`ultraviolet: lavender`). A nocturnal prompt takes `night`, which may carry one band in the `record` colours.
          +
          +| Colourway | Paper, ink, accent |
          +| --- | --- |
          +| `lavender` (default) | the block above |
          +| `record` | ground `oklch(50% 0.25 290)`, ink `oklch(95% 0.02 300)`, the accent turns white `oklch(99% 0.005 300)` with violet text on it, rule `oklch(72% 0.14 292)` |
          +| `night` | ground `oklch(14% 0.02 290)`, paper-2 `17.5% 0.025 290`, paper-3 `21% 0.03 290`, ink `92% 0.04 300`, ink-2 `80% 0.05 300`, muted `68% 0.06 300`, rule `28% 0.04 290`, rule-2 `44% 0.07 292`, accent `55% 0.25 290`, deep `48% 0.24 290`, soft `36% 0.09 293`, focus `62% 0.22 290` |
          +
          +## Type
          +
          +- **Display:** Outfit 500, lowercase, `--tracking-display`, line-height 1. Lowercase is the material: heads, nav links, buttons and pills never carry a capital.
          +- **Figures:** Outfit 300 at `--text-display` and over, lowercase units beside them in the label voice, tabular; the thin geometric numeral is the one place the display goes light.
          +- **Body:** Onest 400, sentence case, line-height 1.55. Prose is the one place a capital appears.
          +- **Labels, captions, table heads:** Outfit 500 a step smaller, lowercase, untracked, in `--color-muted`. Mono only inside code.
          +
          +## Surfaces
          +
          +- Hairlines: 1px `--color-rule` between rows; pills and outlined controls carry 1.5px of `--color-rule-2`. No borders on cards; a surface is a step to `--color-paper-2`.
          +- Radius: `--radius-pill` on every control and tag, 16px on surfaces, screens and photographs; nothing square.
          +- Depth: none on paper, the whisper `--shadow-card` under a raised surface. No blur, no glow, no gradient.
          +- Bands: a `--color-paper-2` band, an ink band, or one violet field in the `record` colours; two a page at most.
          +- The product sits plain on `--color-paper-2` or bleeds off its edge, never in a bezel; a waveform is real line work, its played part in the violet, its rest in `--color-accent-soft`.
          +- Photographs: the night around the music (hands on a mixer, a booth, a crowd lit from the stage seen from behind), tinted violet, 16px radius, a 1px inset ring of ink at 8%; type over one only on an ink scrim. Faces never lead. No texture.
          +
          +## Range
          +
          +- **Lanes as the picture:** the product's own waveforms across ten or twelve columns, one stem to a row under hairlines, a bar ruler above in the label voice; the played part violet, the rest soft. It carries a section with no photograph and no frame.
          +- **Figures in light Outfit:** the prompt's real numbers at display size in the 300, parted by hairlines, one of them in the violet, each unit lowercase beside it.
          +- **A table of uses:** a full-width Table in lowercase, the use at title size, the stems it takes as small pills, one line of what you hear; a price list takes the same rows.
          +- **The record field:** one band in the violet holding a working drop zone or a form, the white pill its only fill.
          +
          +## Controls
          +
          +- A violet-filled pill (`--color-accent-ink` on `--color-accent`, `--color-accent-deep` on hover) beside an inset-outlined one (1.5px of `--color-ink`), both Outfit 500 lowercase; inside a violet field the filled pill turns white with violet text.
          +- Links underline in violet on hover; inputs are pills with a 1.5px `--color-rule-2` inset ring that turns ink on focus. Toggles (solo, mute) are small pills that fill violet when pressed.
          +- The violet is one pigment: one filled control, the focus ring, a link's hover, a progress fill, a played waveform, one figure.
          +
          +## Motion
          +
          +Quick and dry: `--dur-micro` colour transitions on pills over `--ease-out`, a lane that dims or lights as a toggle moves, and at most one settle on load over `--dur-long` from an already-visible default. Nothing spins or loops.
          +
          +## Voice
          +
          +Lowercase, short, exact: the stem, the bar, the minute, the track count. It talks like a producer, not a label.
          +
          +## Do-nots
          +
          +- Never a capital in a head, a nav link or a button.
          +- Never a second chromatic colour, in a photograph either; the violet is the only one.
          +- Never a purple-to-pink gradient, a mesh behind text or a glow.
          +- Never square controls or 4px radii; Ultraviolet is round.
          +
          +## Build hint
          +
          +```html
          +
          +```
          +
          +```css
          +h1, h2, h3 { font-weight: 500; line-height: 1; text-transform: lowercase; letter-spacing: var(--tracking-display); }
          +.figure { font: 300 var(--text-display)/0.9 var(--font-display); font-variant-numeric: tabular-nums; }
          +.btn, .pill { display: inline-flex; align-items: center; border-radius: var(--radius-pill); font: 500 var(--text-sm)/1 var(--font-display); text-transform: lowercase; transition: background-color var(--dur-micro) var(--ease-out); }
          +.btn { min-height: 48px; padding: 0 var(--space-lg); } .pill { padding: var(--space-xs) var(--space-md); box-shadow: inset 0 0 0 1.5px var(--color-rule-2); }
          +.btn--primary { background: var(--color-accent); color: var(--color-accent-ink); }
          +.btn--primary:hover { background: var(--color-accent-deep); }
          +.btn--secondary { box-shadow: inset 0 0 0 1.5px currentColor; color: inherit; }
          +.well { background: var(--color-paper-2); border-radius: var(--radius-card); }
          +.band--violet { background: var(--color-accent); color: var(--color-accent-ink); }
          +.wave__rest { fill: var(--color-accent-soft); } .wave__played { fill: var(--color-accent); }
          +::selection { background: color-mix(in oklab, var(--color-accent) 25%, transparent); }
          +```
          diff --git a/skills/hallmark/references/themes/vantage.jpg b/skills/hallmark/references/themes/vantage.jpg
          new file mode 100644
          index 0000000..2548f6e
          Binary files /dev/null and b/skills/hallmark/references/themes/vantage.jpg differ
          diff --git a/skills/hallmark/references/themes/vantage.md b/skills/hallmark/references/themes/vantage.md
          new file mode 100644
          index 0000000..dfa1c3d
          --- /dev/null
          +++ b/skills/hallmark/references/themes/vantage.md
          @@ -0,0 +1,99 @@
          +---
          +name: Vantage
          +slug: vantage
          +genre: modern-minimal
          +paper: dark 13.5 235
          +display: grotesk-sans Geologica
          +accent: chromatic-lime 126
          +posture: restrained
          +keywords: lidar, scan, survey, mapping, 3d, spatial, point cloud, robotics, autonomy, drone, construction, digital twin, geospatial, measurement, sensor, inspection, engineering, heritage, digitisation, infrastructure, reality capture, terrain
          +material: blue-black ground, a live point cloud of the real thing as the hero's light, a sweep that lights it, pale steel ink, Geologica with sharpened corners at a light weight, hairline frames with corner ticks, one lime signal for what was found
          +pictured: Feature Ledger, Stage hero
          +photo: muted con=6 sat=-20
          +---
          +
          +# Vantage
          +
          +Reality capture at night: the thing itself, a site, a ridge, an object, rendered as tens of thousands of measured points on a blue-black ground, turning slowly while a sweep passes through and lights them. Around it the page is instrument-quiet: Geologica with its corners sharpened, steel-grey ink, hairline frames that only mark their corners, figures with their units. One lime signal means found, measured, live. It is not a particle network, not a neon cyber page, not a dashboard of glowing tiles.
          +
          +## Tokens
          +
          +```css
          +:root {
          +  --color-paper: oklch(13.5% 0.012 235); --color-paper-2: oklch(17% 0.014 235); --color-paper-3: oklch(21% 0.016 235);
          +  --color-ink: oklch(95% 0.006 230); --color-ink-2: oklch(82% 0.012 230); --color-muted: oklch(66% 0.016 230);
          +  --color-rule: oklch(27% 0.014 235); --color-rule-2: oklch(34% 0.016 235);
          +  --color-accent: oklch(89% 0.19 126); --color-accent-hi: oklch(93% 0.17 126); --color-accent-ink: oklch(19% 0.04 126); --color-focus: oklch(89% 0.19 126);
          +  --point-lo: oklch(42% 0.04 245); --point-mid: oklch(70% 0.04 232); --point-hi: oklch(96% 0.02 215);
          +  --color-slot: oklch(21% 0.016 235);
          +  --font-display: "Geologica", ui-sans-serif, system-ui, sans-serif; --font-body: "Geologica", ui-sans-serif, system-ui, sans-serif;
          +  --radius-card: 4px; --radius-pill: 999px; --rule-hair: 1px; --tick: 10px;
          +  --shadow-card: none;
          +  --tracking-display: -0.035em; --display-weight: 300;
          +}
          +```
          +
          +Two dials, stated in the stamp (`vantage: terrain/steel`). Two Vantage pages in one run differ on both.
          +
          +| Dial | Options |
          +| --- | --- |
          +| **Subject** (what the cloud is) | `terrain` (default): ground, structures and canopy from above at an oblique angle. `object`: one thing scanned whole, turning on its axis. `interior`: a room or tunnel seen from inside |
          +| **Colourway** | `steel` (default) as above. `sodium`: ground `oklch(13% 0.012 55)`, points from `oklch(40% 0.05 50)` to `oklch(95% 0.03 80)`, ink warm, the lime kept as the signal |
          +
          +## Type
          +
          +- **Display:** Geologica 300 with `"SHRP" 100` (its sharpened corners), `--tracking-display`, line-height 1.0, sentence case; 400 for small titles. Heads are short and sit on plain ground, never on dense points.
          +- **Body:** Geologica 300 at 17px with `"SHRP" 0`, line-height 1.6, `--color-ink-2`.
          +- **Measurements:** Geologica 400, `tabular-nums`, the unit a step smaller in `--color-muted` after a thin space; a figure at statement size takes 200. Labels Geologica 400 a step smaller, sentence case. Never mono, never tracked capitals.
          +
          +## Surfaces
          +
          +- **The cloud:** one generated canvas or WebGL scene of points only, no lines between them, no glow: size by distance, colour by height from `--point-lo` to `--point-hi`, a soft depth fade. A sweep plane passes every few seconds and lifts the points it touches toward white; anything found is lime. It fills the hero beside or behind the head and fades to paper at the edges.
          +- **Frames:** hairline `--color-rule` boxes are drawn only at their corners (`--tick` long ticks), around a measured thing or a panel; full hairline boxes only for inputs. Radius `--radius-card` at most.
          +- **Callouts:** a measured point carries a leader (a hairline with a 3px dot at the point) to its figure and unit; two at most on a screen.
          +- **Bands:** paper, and paper-2 for one quiet band; no lit or tinted bands. Flat depth, no shadows.
          +- **Photographs:** the real site or object in flat daylight, muted, `--radius-card`; never a sci-fi render.
          +
          +## Range
          +
          +- **A section cut:** one thin slice through the cloud set across the full width as a profile of points, with two or three heights called out by leader and figure.
          +- **A scan log as a table:** rows of captures with their date, area, points and accuracy in tabular figures, the live row marked by a lime dot.
          +- **Layers as working toggles:** ground, structures, canopy and found items as a ruled list of switches that really recolour or hide the cloud beside them.
          +- **A figure measured:** one number at statement size inside corner ticks, its tolerance under it in muted.
          +
          +## Controls
          +
          +- Primary pill: `--color-accent` under `--color-accent-ink`, 48px, Geologica 400; hover `--color-accent-hi`. Secondary: a hairline pill in `--color-rule-2`, ink text.
          +- Inputs: `--color-paper-2` wells with a hairline frame, lime caret and focus. Switches lime when on.
          +- Lime marks only what is found, live or primary; never a heading, never a fill larger than a pill.
          +
          +## Motion
          +
          +The cloud turns slowly (a revolution in two minutes, an object in seventy seconds), the sweep passes every six to eight seconds on an ease-in-out, the pointer tilts the view a few degrees. Panels and rows fade up once. Canvas pauses off screen. Reduced motion: one still frame with the sweep stopped mid-scene.
          +
          +## Voice
          +
          +Measured and exact: what was scanned, how big, how accurate, how soon.
          +
          +## Do-nots
          +
          +- Never lines joining points, never a glow or bloom, never a grid floor receding to a horizon.
          +- Never more than one hue on the points besides lime for found.
          +- Never the cloud under running text or behind a form.
          +- Never a monospace label; figures are tabular Geologica.
          +
          +## Build hint
          +
          +```html
          +
          +```
          +
          +```css
          +h1, h2, h3 { font-family: var(--font-display); font-weight: var(--display-weight); font-variation-settings: "SHRP" 100; letter-spacing: var(--tracking-display); line-height: 1; }
          +body { font-weight: 300; font-variation-settings: "SHRP" 0; }
          +.num { font-variant-numeric: tabular-nums; font-weight: 400; } .num .u { color: var(--color-muted); font-size: 0.75em; }
          +.ticks { position: relative; } .ticks::before, .ticks::after { content: ""; position: absolute; inset: 0; pointer-events: none; border: var(--rule-hair) solid var(--color-rule-2); -webkit-mask: conic-gradient(at var(--tick) var(--tick), transparent 75%, var(--color-ink) 0) 0 0 / calc(100% - var(--tick)) calc(100% - var(--tick)); mask: conic-gradient(at var(--tick) var(--tick), transparent 75%, var(--color-ink) 0) 0 0 / calc(100% - var(--tick)) calc(100% - var(--tick)); }
          +.btn { min-height: 48px; padding: 0 var(--space-lg); border: 0; border-radius: var(--radius-pill); background: var(--color-accent); color: var(--color-accent-ink); font: 400 var(--text-md)/1 var(--font-body); transition: background var(--dur-short) var(--ease-out); }
          +.btn:hover { background: var(--color-accent-hi); }
          +.btn--line { background: transparent; color: var(--color-ink); box-shadow: inset 0 0 0 var(--rule-hair) var(--color-rule-2); }
          +```
          diff --git a/skills/hallmark/references/themes/vellum.jpg b/skills/hallmark/references/themes/vellum.jpg
          new file mode 100644
          index 0000000..d1515bf
          Binary files /dev/null and b/skills/hallmark/references/themes/vellum.jpg differ
          diff --git a/skills/hallmark/references/themes/vellum.md b/skills/hallmark/references/themes/vellum.md
          new file mode 100644
          index 0000000..68ec337
          --- /dev/null
          +++ b/skills/hallmark/references/themes/vellum.md
          @@ -0,0 +1,105 @@
          +---
          +name: Vellum
          +slug: vellum
          +genre: editorial
          +paper: light 94 82
          +display: blackletter Grenze Gotisch
          +accent: cool 268
          +posture: committed
          +keywords: roastery, coffee, bakery, wine, cellar, apothecary, bookshop, press, letterpress, guild, heritage, artisan, manuscript, parchment, edition, tasting, vintage, craft, old world, slow
          +material: parchment paper, a long tan fibre wash on bands, umber ink, Grenze Gotisch heads over Hanken Grotesk with Grenze roman for statements, hairline and double rules, one ultramarine pigment
          +photo: warm con=6
          +pictured: Trade Ledger, Poster hero
          +---
          +
          +# Vellum
          +
          +An old printing house: a parchment ground, umber ink, Grenze Gotisch for the heads, its roman sibling Grenze for a sentence set large, a plain Hanken Grotesk for everything read, hairlines and double rules, and ultramarine as the one pigment. The gothic face carries the age, so nothing else is ornamented: no tavern, no distressed pastiche, no cream-and-serif editorial page.
          +
          +## Tokens
          +
          +```css
          +:root {
          +  --color-paper: oklch(94% 0.024 82); --color-paper-2: oklch(90% 0.032 80); --color-paper-3: oklch(86% 0.036 78);
          +  --color-ink: oklch(23% 0.025 55); --color-ink-2: oklch(31% 0.024 58); --color-muted: oklch(46% 0.024 64);
          +  --color-rule: oklch(75% 0.035 72);
          +  --color-accent: oklch(43% 0.17 268); --color-accent-deep: oklch(35% 0.15 268); --color-accent-soft: oklch(89% 0.035 268); --color-accent-ink: oklch(95% 0.02 82);
          +  --color-focus: oklch(50% 0.18 268); --color-field: var(--color-accent);
          +  --font-display: "Grenze Gotisch", ui-serif, Georgia, serif; --font-body: "Hanken Grotesk", ui-sans-serif, sans-serif;
          +  --font-outlier: "Grenze", ui-serif, Georgia, serif;
          +  --radius-card: 2px; --radius-pill: 2px; --rule-hair: 1px; --rule-double: 4px; --shadow-card: none;
          +  --tracking-display: -0.01em; --display-weight: 600; --fibre: 0.5;
          +}
          +```
          +
          +Three colourways, stated in the stamp (`vellum: parchment`).
          +
          +| Colourway | Ground, ink, pigment |
          +| --- | --- |
          +| **parchment** (default) | the tokens above |
          +| **oxblood, reversed** | ground `oklch(27% 0.09 20)`, ink `oklch(94% 0.02 80)`, pigment gold `oklch(84% 0.11 85)` texted in the ground, rule `oklch(44% 0.08 20)`, fibre at 0.25 |
          +| **indigo, the ledger** | ground `oklch(93% 0.012 240)`, ink `oklch(24% 0.035 265)`, the same ultramarine, rule `oklch(76% 0.02 250)`, fibre at 0.14 |
          +
          +## Type
          +
          +- **Display:** Grenze Gotisch 600 for `h1` and `h2`, line-height 0.92, `--tracking-display`, sentence case. It closes up below 30px, so `h3` and smaller set in Hanken Grotesk 600.
          +- **Outlier, Grenze 400:** the roman sibling, for one sentence set at `--text-display-s` and for figures at display size, line-height 1.02. Never for running text.
          +- **Body:** Hanken Grotesk 400 and 500, line-height 1.55; nav links at 600. Three weights a page at most: 400, 500, 600.
          +- **Labels, captions, table heads, meta:** Hanken Grotesk 500 a step smaller, sentence case, untracked. Figures that a table compares (weights, lots, dates) take Hanken's tabular figures, right-aligned.
          +
          +## Surfaces
          +
          +- Rules: 1px `--color-rule` hairlines between rows, 1px ink along a section's top, and a `--rule-double` double ink rule where a printer would double one: over a table's head, under the masthead, along the top of a band.
          +- Radius 2px everywhere, no pills, no shadows: the page is printed flat.
          +- Bands: a `--color-paper-2` band carrying the fibre wash, and one ultramarine `--color-field`; two a page at most, never touching.
          +- Photographs: the trade in its own light (the drum, the cooling tray, sacks, the counter, hands at the bench), close, no face to the lens; warmed, 2px radius, a 1px `--color-rule` edge. Captions beneath carry a fact; a head sits on one only over an umber scrim.
          +- Texture, the fibre wash: long tan fibres of SVG turbulence, stitched so they never tile, multiplied at `--fibre` (`texture.md`, the low-frequency wash), on a band or a well only.
          +
          +## Range
          +
          +- **Table as a day book:** the week's list as a full-width ruled table under a double rule, pigment numerals indexing the rows, the name in Hanken 600 at title size, values in tabular figures; a hovered row takes `--color-accent-soft`.
          +- **Statement with figures:** one sentence of the prompt in Grenze 400 across nine or ten columns on the fibre band, and beneath it, parted by a hairline, the prompt's own numbers in Grenze Gotisch at display size in pigment with a plain label under each.
          +- **Form on the field:** the ultramarine band holding a working choice (a size, a frequency) as square cells joined edge to edge, the running answer in Grenze Gotisch at section size.
          +- **Rows as an index:** three to five ruled rows, the title in Grenze Gotisch at section size, one line of Hanken beside it: terms, visits, ways to buy.
          +
          +## Controls
          +
          +- A pigment-filled primary (`--color-accent-ink` on `--color-accent`) that deepens to `--color-accent-deep` on hover, beside a ghost with a 1px ink border, both 2px radius, Hanken Grotesk 500.
          +- Links underline in pigment on hover; inputs take 2px radius and a 1px ink border.
          +- Ultramarine is the one pigment: the primary, a link's hover, the focus ring, the numerals that index a list, the figures, one band.
          +
          +## Motion
          +
          +Still. A hover underline in pigment, a row's soft wash and the primary deepening over `--dur-micro`; no reveal, no parallax.
          +
          +## Voice
          +
          +Ledger-plain and dated: the item, the weight, the year, the town, as a clerk would enter them. Never *artisanal*, *curated*, or a story the prompt did not give.
          +
          +## Do-nots
          +
          +- Never clay, terracotta or oxblood as the pigment on parchment; oxblood is a ground only.
          +- Never Grenze Gotisch below 30px, at paragraph length, or opening a head on a capital I, which reads as J.
          +- Never a deckled edge, a vignette, a coffee ring, a burn or a second texture.
          +- Never the founding year alone as the hero's head; it sits in a sentence, a row or a figure with its label.
          +
          +## Build hint
          +
          +```html
          +
          +```
          +
          +```css
          +h1, h2 { font-weight: 600; line-height: 0.92; }
          +h3 { font-family: var(--font-body); font-weight: 600; }
          +.statement { font: 400 var(--text-display-s)/1.02 var(--font-outlier); }
          +.btn { border: var(--rule-hair) solid currentColor; border-radius: var(--radius-card); padding: var(--space-sm) var(--space-lg); font-weight: 500; color: inherit; background: transparent; transition: background-color var(--dur-micro) var(--ease-out); }
          +.btn--primary { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); }
          +.btn--primary:hover { background: var(--color-accent-deep); border-color: var(--color-accent-deep); }
          +.band--pigment { background: var(--color-field); color: var(--color-accent-ink); }
          +.rule-double { border-top: var(--rule-double) double var(--color-ink); }
          +.ledger tbody tr:hover { background: var(--color-accent-soft); }
          +.fibre { position: relative; isolation: isolate; }
          +.fibre::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: var(--fibre); mix-blend-mode: multiply; pointer-events: none;
          +  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='p' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.004 0.02' numOctaves='4' seed='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.62 0 0 0 0 0.52 0 0 0 0 0.36 0 0 0 0.3 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E"); }
          +```
          diff --git a/skills/hallmark/references/themes/wayfind.jpg b/skills/hallmark/references/themes/wayfind.jpg
          new file mode 100644
          index 0000000..59e7fd8
          Binary files /dev/null and b/skills/hallmark/references/themes/wayfind.jpg differ
          diff --git a/skills/hallmark/references/themes/wayfind.md b/skills/hallmark/references/themes/wayfind.md
          new file mode 100644
          index 0000000..a77e148
          --- /dev/null
          +++ b/skills/hallmark/references/themes/wayfind.md
          @@ -0,0 +1,105 @@
          +---
          +name: Wayfind
          +slug: wayfind
          +genre: modern-minimal
          +paper: light 95.5 250
          +display: mono Chivo Mono
          +accent: cool 264
          +posture: committed
          +keywords: transit, metro, rail, station, wayfinding, departures, timetable, live, map, commute, city, platform, signage, logistics, status, operations, schedule, mobility, travel, trip, journey, itinerary, booking, flights, airport
          +material: cool grey paper, blue-black ink, Chivo Mono throughout, square 2px ink borders, ink plates, cobalt for what is live, amber for figures on ink
          +photo: natural sat=-12 con=10
          +pictured: Station Sequence, Stage hero
          +---
          +
          +# Wayfind
          +
          +Public signage set as a page: cool grey paper, blue-black ink, every glyph in Chivo Mono (a sober grotesk cut to the fixed cell of a departure board), square 2px ink borders, ink plates that carry a sign, cobalt for what is live and amber for figures. The mono is the board's face and the borders mark the way. It reads in daylight, at a glance, from three metres; it is not a developer tool, not a dark terminal and not a retro departures pastiche.
          +
          +## Tokens
          +
          +```css
          +:root {
          +  --color-paper: oklch(95.5% 0.006 250); --color-paper-2: oklch(91% 0.009 250); --color-paper-3: oklch(99.5% 0.005 250);
          +  --color-ink: oklch(16% 0.014 262); --color-ink-2: oklch(29% 0.014 262); --color-muted: oklch(47% 0.016 260);
          +  --color-rule: oklch(80% 0.011 250); --color-ink-rule: oklch(34% 0.014 262);
          +  --color-accent: oklch(51% 0.22 264); --color-accent-2: oklch(81% 0.16 82); --color-accent-ink: oklch(99.5% 0.003 250); --color-focus: oklch(51% 0.22 264);
          +  --font-display: "Chivo Mono", ui-monospace, monospace; --font-body: var(--font-display); --font-outlier: var(--font-body);
          +  --radius-card: 0; --radius-pill: 999px; --rule-hair: 1px; --rule-bar: 2px;
          +  --shadow-card: 0 24px 40px -24px oklch(8% 0.01 260 / 0.6);
          +  --tracking-display: -0.03em; --display-weight: 800;
          +}
          +```
          +
          +Three colourways, set once per page and stated in the stamp (`wayfind: platform`).
          +
          +| Colourway | Paper, ink, rule |
          +| --- | --- |
          +| `platform` (default) | the block above |
          +| `night` | paper `oklch(15% 0.012 262)`, ink `oklch(96% 0.005 250)`, rule `oklch(31% 0.014 262)`, cobalt lifts to `oklch(62% 0.2 264)` |
          +| `signal` | paper `oklch(51% 0.22 264)` cobalt, ink white, rule `oklch(75% 0.12 264)`; the cobalt button becomes the ink one |
          +
          +## Type
          +
          +- **Display:** Chivo Mono 800, `--tracking-display`, line-height 0.98, sentence case. A mono line runs wide, so `h1` caps at 4.75rem and a head stays short enough to read in one look.
          +- **Body:** Chivo Mono 400, line-height 1.55, `tabular-nums` on everything. Mono is the material here (waive 64): the board's face sets the whole page. Three weights: 400, 500 and 800.
          +- **Figures:** minutes, platforms and exits in 800, at `--text-display-s` or larger when a figure is the section's reason; amber on ink, ink on paper.
          +- **Labels, table heads, pills, buttons:** Chivo Mono 500 a step smaller (buttons 800), sentence case, untracked; the signage reads through the mono and the borders, never through capitals.
          +
          +## Surfaces
          +
          +- Rules: `--rule-bar` ink borders on every surface (wells, plates, buttons, the underside of a nav, a table's head rule); row dividers `--rule-hair` in `--color-rule`, or `--color-ink-rule` on ink.
          +- Radius 0 everywhere except pills. Depth is borders; `--shadow-card` only under a surface that floats over another.
          +- The plate: a square field of ink (or amber under ink text) inside a 2px border, holding one instruction and its figure, the way a sign holds a platform number.
          +- Bands: `--color-paper-2`, an `--color-ink` band where figures turn amber, or one cobalt field in the `signal` colours; two bands a page at most.
          +- Photographs: the network at eye level: platforms, tiled walls, a train in, stairs up to daylight; people only from behind and moving. Square, inside the 2px ink border; type never sits on the picture, only on a plate inside the frame. Captions name the station or the line. A phone screen built from the product takes a 9:19.5 frame in that border, never a drawn bezel.
          +- No texture, no gradient.
          +
          +## Range
          +
          +- **A departure board as a Table** on the ink band: destination in 500, the line as a small square in the network's own colour, minutes in 800 amber at title size or larger, a late row as an amber fill under ink text, a 2px paper head rule.
          +- **A route as Steps:** the way out as three or four plates in a row, each a 2px bordered square holding one instruction (carriage, stairs, exit) and its figure, joined by a 2px ink rule like a corridor sign.
          +- **Status as Rows:** each line or service a full-width row, its swatch, its name in 800, its ends in 400, its state at the right edge; one cobalt live dot on the row that just changed.
          +- **A figure as a sign:** one number in 800 at display size inside a bordered plate, its unit beside it, and a station picker of square cells joined edge to edge that changes it.
          +
          +## Controls
          +
          +- A cobalt-filled button beside a transparent one with a `--rule-bar` ink border, both square, Chivo Mono 800, sentence case, 48 to 52px.
          +- A choice set is square cells sharing 2px borders; the chosen cell fills ink with paper text. Links are ink, underlined, cobalt on hover; inputs are square, 2px ink border on `--color-paper-3`.
          +- Cobalt is for what is live (the current stop, a clock, the primary action); amber colours figures only on ink or as a fill under ink text.
          +
          +## Motion
          +
          +Departure-board stiff: `--dur-micro` colour changes in `steps(1)`, rows updating in place, no reveal on scroll. A live dot blinks once when a row updates; it never loops.
          +
          +## Voice
          +
          +Signage: the platform, the exit, the minute, the carriage. Imperative and short; a head reads in one look.
          +
          +## Do-nots
          +
          +- Never a proportional face anywhere, not even for prose.
          +- Never amber as a text colour on the paper; it belongs on ink or under ink text.
          +- Never a third bright colour, except a network's own line colours as small squares beside their names.
          +- Never rounded cards or soft shadows on cards; Wayfind is bordered.
          +- Never a drawn platform, train or carriage row standing in for the place; photograph the station, build the screen.
          +
          +## Build hint
          +
          +```html
          +
          +```
          +
          +```css
          +body { font-variant-numeric: tabular-nums; }
          +h1, h2, h3 { font-weight: 800; line-height: 0.98; }
          +h1 { font-size: min(var(--text-display), 4.75rem); }
          +small, th, figcaption { font-weight: 500; color: var(--color-muted); }
          +.btn { display: inline-flex; align-items: center; gap: var(--space-xs); padding: var(--space-md) var(--space-lg); border: var(--rule-bar) solid currentColor; font: 800 var(--text-sm)/1 var(--font-body); color: inherit; transition: background-color var(--dur-micro) steps(1); }
          +.btn--primary { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); }
          +.plate { border: var(--rule-bar) solid var(--color-ink); background: var(--color-ink); color: var(--color-paper); }
          +.plate .figure { font-weight: 800; color: var(--color-accent-2); }
          +.band--ink { background: var(--color-ink); color: var(--color-paper); }
          +th { border-bottom: var(--rule-bar) solid currentColor; } td { border-bottom: var(--rule-hair) solid var(--color-rule); }
          +::selection { background: var(--color-accent-2); color: var(--color-ink); }
          +```
          diff --git a/skills/hallmark/references/themes/werkstatt.jpg b/skills/hallmark/references/themes/werkstatt.jpg
          new file mode 100644
          index 0000000..4b277c5
          Binary files /dev/null and b/skills/hallmark/references/themes/werkstatt.jpg differ
          diff --git a/skills/hallmark/references/themes/werkstatt.md b/skills/hallmark/references/themes/werkstatt.md
          new file mode 100644
          index 0000000..7258a1b
          --- /dev/null
          +++ b/skills/hallmark/references/themes/werkstatt.md
          @@ -0,0 +1,105 @@
          +---
          +name: Werkstatt
          +slug: werkstatt
          +genre: playful
          +paper: mid 84 82
          +display: geometric-sans Jost
          +accent: cool 264
          +posture: full-palette
          +keywords: school, programme, workshop, maker, course, bootcamp, academy, apply, admissions, tuition, timetable, bauhaus, craft, design education, design school, residency, cohort, prospectus
          +material: warm putty ground with a lighter well, near-black ink, Jost 700 capitals and numerals over Karla, square 2px and 3px ink rules that box cells, flat ultramarine, vermilion and yellow primaries
          +photo: mono
          +pictured: Catalogue, Settled hero
          +---
          +
          +# Werkstatt
          +
          +A design school's printed prospectus: a warm putty ground, near-black ink, heavy Jost capitals over a plain Karla body, square 2px and 3px ink rules, and three flat primaries, blue, red and yellow, each with one job. Its photographs are black and white records of the shops at work. It reads taught and sure of itself, like a programme pinned to a workshop wall: facts boxed in ruled cells, dates and numbers set as large as heads. It is not a toy-box palette and not a pattern of confetti shapes.
          +
          +## Tokens
          +
          +```css
          +:root {
          +  --color-paper: oklch(84% 0.024 82); --color-paper-2: oklch(79.5% 0.028 80); --color-paper-3: oklch(89.5% 0.018 84);
          +  --color-ink: oklch(18% 0.008 60); --color-ink-2: oklch(27% 0.01 60); --color-muted: oklch(39% 0.014 62);
          +  --color-rule: oklch(58% 0.022 72);
          +  --color-accent: oklch(46% 0.2 264); --color-accent-2: oklch(58% 0.205 33); --color-accent-2-deep: oklch(50% 0.19 31); --color-accent-3: oklch(85% 0.165 92);
          +  --color-accent-ink: oklch(96% 0.012 82); --color-focus: oklch(46% 0.2 264);
          +  --font-display: "Jost", "Futura", sans-serif; --font-body: "Karla", ui-sans-serif, system-ui, sans-serif;
          +  --font-outlier: "JetBrains Mono", ui-monospace, monospace;
          +  --radius-card: 0; --radius-pill: 0; --rule-hair: 1px; --rule-bar: 2px; --rule-box: 3px;
          +  --shadow-card: none;
          +  --tracking-display: -0.005em; --display-weight: 700;
          +}
          +```
          +
          +Three colourways, set once per page and stated in the stamp (`werkstatt: putty`).
          +
          +| Colourway | Ground, ink, primaries |
          +| --- | --- |
          +| `putty` (default) | the block above |
          +| `blackboard` | ground `oklch(17% 0.005 60)`, ink `oklch(90% 0.015 80)`, rule `oklch(38% 0.01 60)`, primaries a step brighter; putty returns as a well colour |
          +| `blue` | ground `oklch(50% 0.22 265)`, ink `oklch(93% 0.02 85)`, rule `oklch(64% 0.14 265)`; the yellow does the accent's work |
          +
          +## Type
          +
          +- **Display:** Jost 700, uppercase, `--tracking-display`, line-height 1.02, at the shared steps. Capitals are the material: every head is set in them. Numerals and dates take the same face at display size and up, tabular, inside their cell.
          +- **Body:** Karla 400, line-height 1.5.
          +- **Labels, captions, tags, table heads:** Karla 600 a step smaller, sentence case, untracked, in `--color-muted`. Small figures and prices in Karla with `tabular-nums`; mono only inside code.
          +- **Controls:** Karla 600 in capitals, following the display (the case gate 67 allows on an uppercase page), untracked.
          +
          +## Surfaces
          +
          +- Rules: `--rule-box` ink lines box and cross a grid, `--rule-bar` ink runs under a nav and over every table, `--rule-hair` in `--color-rule` between rows. No card has a background; a cell is what the rules enclose.
          +- Zero radius and zero shadow everywhere.
          +- Bands: a `--color-paper-2` band, an `--color-ink` band with paper text in the `blackboard` colours, or one blue field with `--color-accent-ink` text; two bands a page at most. `--color-paper-3` is a well inside a ruled cell, never a band.
          +- Photographs: the shops at work, documentary and plain, at bench height or from just above: a bench and its tools, hands at a plane, a press or a wheel, wood, type and clay close enough to read the grain; daylight, nobody facing the lens. Printed black and white (the `photo:` mono) so the primaries stay the only colour; square, in a `--rule-bar` ink border, flush with the cells around them. A shop's primary runs as the flat cell or bar beside or under its picture and carries the caption; it never tints the photograph, and type never sits on one.
          +- No texture, and no gradient anywhere.
          +
          +## Range
          +
          +- **Figures in boxed cells:** the prompt's real numbers in Jost 700 at display size, each in its own `--rule-box` cell across the twelve columns, the label in Karla beneath; no primary, since a set of one kind takes no colour.
          +- **Dates as a ruled schedule:** the deadline and the term set as rows of capitals as large as a section head, the day left, what happens right, a `--rule-bar` over the first row.
          +- **The categories as a coded grid:** each shop, track or room in its primary cell, flush with its neighbours, with a black and white photograph or a list of what it covers above the fill.
          +- **Forms as a ruled sheet:** fields boxed in a grid of cells like an entry form, the category choice in its primaries, the submit an ink block at the foot.
          +
          +## Controls
          +
          +- A transparent `--rule-bar` ink-bordered button beside an ink-filled one, both square; on an ink band the pair inverts: the filled one turns putty with ink type, never a primary, since the primaries code categories.
          +- Links carry a 2px ink underline that thickens to 3px on hover; inputs are square with a `--rule-bar` ink border.
          +- The primaries are flat fills, never type and never tints. Each codes one category, the same one wherever it appears (a cell, a tag, a band, a nav link), and a set of one kind takes no colour. Blue and red fills take `--color-accent-ink`, the red deepened to `--color-accent-2-deep`; a yellow fill takes ink. Blue also rings focus.
          +
          +## Motion
          +
          +Static, like a printed prospectus: a link's underline thickens on hover, and nothing else moves, reveals or loops.
          +
          +## Voice
          +
          +Plain school prose: the shop, the week, the tuition, the deadline, each said once and plainly.
          +
          +## Do-nots
          +
          +- Never a fourth colour, a tint of a primary, a primary used as type, or a photograph in colour.
          +- Never a radius on a container, a button or an image; Werkstatt is square.
          +- Never mixed-case display; Jost here is capitals.
          +- Never the primaries as confetti or a pattern; each fill means a category.
          +
          +## Build hint
          +
          +```html
          +
          +```
          +
          +```css
          +h1, h2, h3 { font-weight: 700; line-height: 1.02; text-transform: uppercase; }
          +small, th, figcaption { font-weight: 600; color: var(--color-muted); }
          +.btn { display: inline-flex; align-items: center; gap: var(--space-xs); padding: var(--space-md) var(--space-lg); border: var(--rule-bar) solid currentColor; font: 600 var(--text-sm)/1 var(--font-body); text-transform: uppercase; color: inherit; background: transparent; }
          +.btn--primary { background: var(--color-ink); border-color: var(--color-ink); color: var(--color-paper); }
          +.band--ink { background: var(--color-ink); color: var(--color-paper); }
          +.band--ink .btn--primary { background: var(--color-paper); border-color: var(--color-paper); color: var(--color-ink); }
          +.ruled { border-block: var(--rule-box) solid var(--color-ink); }
          +.photo { border: var(--rule-bar) solid var(--color-ink); border-radius: 0; }
          +table { border-top: var(--rule-bar) solid var(--color-ink); } td { border-bottom: var(--rule-hair) solid var(--color-rule); }
          +a { text-decoration-thickness: 2px; } a:hover { text-decoration-thickness: 3px; }
          +::selection { background: var(--color-accent-3); color: var(--color-ink); }
          +```
          diff --git a/skills/hallmark/scripts/capture.mjs b/skills/hallmark/scripts/capture.mjs
          new file mode 100644
          index 0000000..6155d95
          --- /dev/null
          +++ b/skills/hallmark/scripts/capture.mjs
          @@ -0,0 +1,130 @@
          +#!/usr/bin/env node
          +// Screenshots of the real product, for the page that sells it (imagery.md § 4).
          +//
          +//   node capture.mjs  [--out ] [--name ] [--routes /,/pricing]
          +//                    [--sizes desktop,phone] [--full] [--selector ""] [--wait ]
          +//                    [--dark] [--scale <1|2>]
          +//   node capture.mjs --cdp  [--target ""] [--selector ""] [--out ] [--name ]
          +//
          +// --cdp attaches to a desktop app already running with a DevTools port (an Electron app started with
          +// --remote-debugging-port=, a WebView2 or CEF app) and captures its window as it is.
          +//
          +// Opens each route at 1440 x 900 (desktop) and 390 x 844 (phone), waits for fonts and images,
          +// and writes PNGs into --out (default ./images/screens). It prints, for each file, its size and a
          +// ready  for a data-slot. --selector captures one element (a panel, a chart, a dialog) instead
          +// of the viewport; --full captures the whole scroll height. It never draws a browser bar or a device
          +// frame: the page frames the picture in the theme's material.
          +import { mkdirSync, existsSync, writeFileSync } from 'node:fs';
          +import { join, dirname, resolve, relative } from 'node:path';
          +import { fileURLToPath, pathToFileURL } from 'node:url';
          +import { createRequire } from 'node:module';
          +
          +const HERE = dirname(fileURLToPath(import.meta.url));
          +const argv = process.argv.slice(2);
          +const flag = (k, d) => { const i = argv.indexOf(`--${k}`); return i >= 0 && argv[i + 1] && !argv[i + 1].startsWith('--') ? argv[i + 1] : d; };
          +const has = (k) => argv.includes(`--${k}`);
          +const VALUED = new Set(['--out', '--name', '--routes', '--sizes', '--selector', '--wait', '--scale', '--cdp', '--target']);
          +const target = argv.find((a, i) => !a.startsWith('--') && !VALUED.has(argv[i - 1]));
          +if (!target && !has('cdp')) {
          +  console.error('usage: node capture.mjs  [--out ] [--name ] [--routes /,/pricing] [--sizes desktop,phone] [--full] [--selector ""] [--wait ] [--dark] [--scale 2]');
          +  process.exit(2);
          +}
          +const out = resolve(flag('out', 'images/screens'));
          +const name = flag('name', 'screen').replace(/[^\w.-]+/g, '-').replace(/^\.+/, '') || 'screen';
          +const routes = flag('routes', '/').split(',').map((r) => r.trim()).filter(Boolean);
          +const sizes = flag('sizes', 'desktop,phone').split(',').map((s) => s.trim());
          +const wait = Number(flag('wait', '600'));
          +const scale = Number(flag('scale', '2'));
          +const selector = flag('selector', '');
          +const SIZES = { desktop: [1440, 900, false], laptop: [1280, 800, false], tablet: [834, 1112, true], phone: [390, 844, true] };
          +
          +let puppeteer = null;
          +const roots = [process.env.HALLMARK_PUPPETEER, process.cwd(), HERE].filter(Boolean);
          +const globalRoot = async () => { try { const { execSync } = await import('node:child_process'); return dirname(execSync('npm root -g', { encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] }).trim()); } catch { return null; } };
          +for (const root of roots) {
          +  for (const n of ['puppeteer-core', 'puppeteer']) {
          +    try { puppeteer = (await import(pathToFileURL(createRequire(join(root, 'noop.js')).resolve(n)).href)).default; } catch {}
          +    if (puppeteer) break;
          +  }
          +  if (puppeteer) break;
          +}
          +if (!puppeteer) { const g = await globalRoot(); for (const n of ['puppeteer-core', 'puppeteer']) { if (puppeteer || !g) break; try { puppeteer = (await import(pathToFileURL(createRequire(join(g, 'noop.js')).resolve(n)).href)).default; } catch {} } }
          +if (!puppeteer) { console.error('capture.mjs needs puppeteer-core or puppeteer (local, global or HALLMARK_PUPPETEER). Without it, take the screenshots with the harness or the OS (imagery.md § 4).'); process.exit(1); }
          +const CHROMES = [process.env.CHROME_PATH, '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome', '/Applications/Chromium.app/Contents/MacOS/Chromium', '/usr/bin/google-chrome', '/usr/bin/google-chrome-stable', '/usr/bin/chromium', '/usr/bin/chromium-browser', '/snap/bin/chromium', 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe', 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe'];
          +const findChrome = () => { const c = CHROMES.find((x) => x && existsSync(x)); if (c) return c; try { const b = typeof puppeteer.executablePath === 'function' ? puppeteer.executablePath() : null; if (typeof b === 'string' && existsSync(b)) return b; } catch {} return null; };
          +const chrome = findChrome();
          +if (has('cdp')) {
          +  const port = Number(flag('cdp', ''));
          +  if (!Number.isInteger(port) || port < 1 || port > 65535) { console.error('--cdp takes the app\'s DevTools port, for example --cdp 9222'); process.exit(2); }
          +  const want = flag('target', '').toLowerCase();
          +  const app = await puppeteer.connect({ browserURL: `http://127.0.0.1:${port}`, defaultViewport: null }).catch((e) => { console.error(`no DevTools endpoint on port ${port}: ${e.message}`); process.exit(1); });
          +  let page = null;
          +  for (const pg of await app.pages()) { const t = (await pg.title().catch(() => '')).toLowerCase(); if (!want || t.includes(want)) { page = pg; break; } }
          +  if (!page) { console.error(`no window${want ? ` titled like "${want}"` : ''} on port ${port}`); await app.disconnect(); process.exit(1); }
          +  mkdirSync(out, { recursive: true });
          +  const file = join(out, `${name}-app${selector ? '-part' : ''}.png`);
          +  const el = selector ? await page.$(selector) : null;
          +  if (selector && !el) { console.error(`no element matches ${selector}`); await app.disconnect(); process.exit(1); }
          +  await (el || page).screenshot({ path: file });
          +  const box = el ? await el.boundingBox() : await page.evaluate(() => ({ width: innerWidth, height: innerHeight }));
          +  const dpr = await page.evaluate(() => devicePixelRatio).catch(() => 1);
          +  const rel = relative(process.cwd(), file);
          +  console.log(`${rel}  ${Math.round(box.width * dpr)} x ${Math.round(box.height * dpr)}  (app window)`);
          +  console.log(`  `);
          +  await app.disconnect();
          +  process.exit(0);
          +}
          +if (!chrome) { console.error('no Chrome or Chromium found; set CHROME_PATH'); process.exit(1); }
          +
          +const isUrl = /^https?:\/\//i.test(target);
          +const urlFor = (route) => {
          +  if (!isUrl) return pathToFileURL(resolve(target)).href;
          +  const u = new URL(target);
          +  if (route === '/') return u.href;
          +  const r = new URL(route, u.origin);
          +  return r.origin === u.origin ? r.href : null;
          +};
          +mkdirSync(out, { recursive: true });
          +const browser = await puppeteer.launch({ executablePath: chrome, headless: true });
          +const made = [];
          +try {
          +  for (const route of isUrl ? routes : ['/']) {
          +    for (const size of sizes) {
          +      const [w, h, mobile] = SIZES[size] || SIZES.desktop;
          +      const p = await browser.newPage();
          +      if (has('dark')) await p.emulateMediaFeatures([{ name: 'prefers-color-scheme', value: 'dark' }]);
          +      await p.setViewport({ width: w, height: h, deviceScaleFactor: scale, isMobile: mobile, hasTouch: mobile });
          +      const to = urlFor(route);
          +      if (!to) { console.log(`skip ${route}: not on ${new URL(target).origin}`); await p.close(); continue; }
          +      const res = await p.goto(to, { waitUntil: 'networkidle2', timeout: 45000 }).catch((e) => ({ err: e.message }));
          +      if (res && res.err) { console.log(`skip ${route} at ${size}: ${res.err}`); await p.close(); continue; }
          +      if (isUrl && res && !res.ok() && res.status() !== 304) {
          +        console.log(`skip ${route} at ${size}: HTTP ${res.status()} from ${res.url()}`);
          +        await p.close();
          +        continue;
          +      }
          +      await p.evaluate(async () => { if (document.fonts) await document.fonts.ready; for (const i of document.querySelectorAll('img[loading="lazy"]')) i.loading = 'eager'; await Promise.race([Promise.all([...document.images].filter((i) => !i.complete).map((i) => new Promise((r) => { i.onload = i.onerror = r; }))), new Promise((r) => setTimeout(r, 6000))]); }).catch(() => {});
          +      await new Promise((r) => setTimeout(r, wait));
          +      await p.bringToFront();
          +      const slug = route === '/' ? 'home' : route.replace(/^\/|\/$/g, '').replace(/[^\w-]+/g, '-');
          +      const file = join(out, `${name}-${slug}-${size}${selector ? '-part' : ''}.png`);
          +      let shot;
          +      if (selector) {
          +        const el = await p.$(selector);
          +        if (!el) { console.log(`skip ${route} at ${size}: no element matches ${selector}`); await p.close(); continue; }
          +        shot = await el.screenshot({ path: file });
          +      } else shot = await p.screenshot({ path: file, fullPage: has('full') });
          +      const dims = await p.evaluate((full) => [innerWidth, full ? document.documentElement.scrollHeight : innerHeight], has('full'));
          +      const box = selector ? await (await p.$(selector)).boundingBox() : { width: dims[0], height: dims[1] };
          +      made.push({ file, w: Math.round(box.width * scale), h: Math.round(box.height * scale), route, size });
          +      await p.close();
          +    }
          +  }
          +} finally { await browser.close(); }
          +for (const m of made) {
          +  const rel = relative(process.cwd(), m.file);
          +  console.log(`${rel}  ${m.w} x ${m.h}  (${m.route}, ${m.size})`);
          +  console.log(`  `);
          +}
          +if (!made.length) process.exitCode = 1;
          +else console.log(`\n${made.length} screenshot${made.length > 1 ? 's' : ''}. Look at each one before placing it: sample data only, nothing personal (names, emails, tokens), the screen in the state that tells the page's story.`);
          diff --git a/skills/hallmark/scripts/capture.test.mjs b/skills/hallmark/scripts/capture.test.mjs
          new file mode 100644
          index 0000000..6defea2
          --- /dev/null
          +++ b/skills/hallmark/scripts/capture.test.mjs
          @@ -0,0 +1,63 @@
          +import assert from 'node:assert/strict';
          +import { spawn } from 'node:child_process';
          +import { mkdtempSync, readdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
          +import { createServer } from 'node:http';
          +import { tmpdir } from 'node:os';
          +import { join } from 'node:path';
          +import { fileURLToPath } from 'node:url';
          +import test from 'node:test';
          +
          +const skip = !process.env.HALLMARK_PUPPETEER || !process.env.CHROME_PATH ? 'set HALLMARK_PUPPETEER and CHROME_PATH for real-browser regressions' : false;
          +const script = fileURLToPath(new URL('./capture.mjs', import.meta.url));
          +async function capture(routes, prepare, check) {
          +  const dir = mkdtempSync(join(tmpdir(), 'hallmark-capture-'));
          +  const server = createServer((req, res) => {
          +    if (req.url === '/redirect') { res.writeHead(302, { Location: '/ok' }); res.end(); return; }
          +    const status = req.url === '/ok' ? 200 : req.url === '/missing' ? 404 : 500;
          +    res.writeHead(status, { 'Content-Type': 'text/html' });
          +    res.end(`${status}

          ${status === 200 ? 'Owned product fixture' : 'Error document'}

          `); + }); + await new Promise((r) => server.listen(0, '127.0.0.1', r)); + try { + prepare?.(dir); + const result = await new Promise((resolve, reject) => { + const p = spawn(process.execPath, [script, `http://127.0.0.1:${server.address().port}`, '--routes', routes, '--sizes', 'desktop', '--wait', '0', '--scale', '1', '--out', dir], { env: process.env }); + let stdout = '', stderr = ''; + p.stdout.on('data', (s) => { stdout += s; }); + p.stderr.on('data', (s) => { stderr += s; }); + p.on('error', reject); + p.on('close', (status) => resolve({ status, stdout, stderr })); + }); + await check(dir, result); + } finally { + await new Promise((r) => server.close(r)); + rmSync(dir, { recursive: true, force: true }); + } +} +for (const [route, status] of [['/missing', 404], ['/failed', 500]]) { + test(`capture rejects HTTP ${status} without replacing an existing screenshot`, { skip }, async () => { + const file = `screen-${route.slice(1)}-desktop.png`; + await capture(route, (dir) => writeFileSync(join(dir, file), 'prior screenshot'), (dir, result) => { + assert.equal(result.status, 1, result.stdout + result.stderr); + assert.equal(readFileSync(join(dir, file), 'utf8'), 'prior screenshot'); + assert.doesNotMatch(result.stdout, / { + await capture('/missing,/ok', null, (dir, result) => { + assert.equal(result.status, 0, result.stderr); + assert.deepEqual(readdirSync(dir), ['screen-ok-desktop.png']); + assert.equal((result.stdout.match(/ { + await capture('/redirect', null, (dir, result) => { + assert.equal(result.status, 0, result.stderr); + assert.deepEqual(readdirSync(dir), ['screen-redirect-desktop.png']); + assert.match(result.stdout, / + + + + +Night Cellar: natural wine after five, Thursday to Sunday + + + + + + + + + + + + +
          +
          +
          +
          +

          Natural wine after five.

          +

          A shop and bar with 140 bottles on the list.

          + +
          +
          + Wine poured from a bottle into a glass decanter in low light +
          +
          +
          + +
          +
          +
          + A long cellar aisle between racks of bottles laid neck down +
          +
          +

          Every bottle here is natural.

          +

          The full list: link to come.

          +
          +
          +
          + +
          +
          +

          Four nights a week, Thursday to Sunday.

          +
            +
          1. MondayClosed
          2. +
          3. TuesdayClosed
          4. +
          5. WednesdayClosed
          6. +
          7. ThursdayFrom 5pm
          8. +
          9. FridayFrom 5pm
          10. +
          11. SaturdayFrom 5pm
          12. +
          13. SundayFrom 5pm
          14. +
          +
          +
          +

          The bar

          +

          Open a bottle and stay.

          +
          +
          +

          The shop

          +

          Take one home.

          +
          +
          +
          +
          + +
          +
          +
          +

          A tasting, once a month.

          +

          £25 a place

          +

          The next date is to be announced.

          + +
          +
          + A taste of red wine poured into a glass held by its stem +
          +
          +
          +
          + + + + + + + diff --git a/skills/hallmark/scripts/fixtures/exemplars/editorial.html b/skills/hallmark/scripts/fixtures/exemplars/editorial.html new file mode 100644 index 0000000..5a782ae --- /dev/null +++ b/skills/hallmark/scripts/fixtures/exemplars/editorial.html @@ -0,0 +1,363 @@ + + + + + +Fenwick and Daughters, coffee roasted in York since 1921 + + + + + + + + + + +
          + +
          + +
          +
          +
          + A fresh roast swept round the cooling tray by its paddle arm +
          +
          +
          +

          Roasted in York
          since 1921

          +

          Six coffees a week, sold by the bag or by subscription.

          + +
          +
          +
          + +
          +
          +
          +

          Written in the day book

          +

          Five lines the roastery keeps to.

          +
          +
          + + + + + + + + + + + +
          No.EntryKept
          1Coffees roasted each week6
          2Weight of each bag250 g
          3Ways to buyBy the bag, or by subscription
          4RoasteryYork
          5Roasting since1921
          +
          +
          +
          + +
          +
          +
          +

          From a York drum to your kettle

          +

          Fenwick and Daughters roasts the coffee. The cup is yours to make.

          +
          +
          +
          +
          + A drum coffee roaster above its copper cooling tray in a roastery +
          +
          Six coffees a week
          +
          +
          +
          + Espresso streaming from a chrome machine into two glass cups +
          +
          Sold in 250 g bags
          +
          +
          +
          +
          + +
          +
          +
          +
          +

          250 g bags, or a subscription

          +

          Tell the roastery which you would like, and where to reach you.

          +
          + How would you like it? + + +
          +
          +
          +
          + + +
          +
          + + +
          + +

          +
          +
          +
          +
          +
          + + + + + + diff --git a/skills/hallmark/scripts/fixtures/exemplars/modern-minimal.html b/skills/hallmark/scripts/fixtures/exemplars/modern-minimal.html new file mode 100644 index 0000000..6a595e4 --- /dev/null +++ b/skills/hallmark/scripts/fixtures/exemplars/modern-minimal.html @@ -0,0 +1,527 @@ + + + + + +Tilly, invoicing that chases late payments for you + + + + + + + + + + + +
          +
          + Tilly + +
          +
          + +
          +
          +
          +
          +

          Never write
          “following up”
          again.

          +

          Invoicing for freelancers that sends reminders, logs replies and marks invoices paid.

          + +
          + + +
          +
          + +
          +
          +
          +

          Do I still have to chase?

          +

          No. Tilly writes to the client while you get on with the work.

          +
          +
          + Hands gathering green stems into a bouquet at a flower shop counter +
          +
          +
          + +
          +
          +
          +

          What does my client receive?

          +

          A short, polite reminder, with the invoice one click away.

          +
          +
          + +
          Reminder 2 for invoice 0042, as Example Kitchen receives it.
          +
          +
          +
          + +
          +
          + +
          +

          What if they write back?

          +

          Tilly files the reply with the invoice it answers, beside every reminder that went out.

          +
          +
          +
          + + + +
          +
          +
          +

          What does it cost?

          +

          £8 a month.

          +

          Start with your next invoice.

          +
          + +
          +
          +
          + + + + + + diff --git a/skills/hallmark/scripts/fixtures/exemplars/playful.html b/skills/hallmark/scripts/fixtures/exemplars/playful.html new file mode 100644 index 0000000..08b8ef9 --- /dev/null +++ b/skills/hallmark/scripts/fixtures/exemplars/playful.html @@ -0,0 +1,353 @@ + + + + + +The Boiler Room, Hull: this month’s gigs and tickets + + + + + + + + + +
          + +
          + +
          +
          +
          + Two guitarists in silhouette on a small stage, lit through smoke +
          + +
          +

          Doors 7pm.
          First band 8pm.

          +

          A 200-capacity music venue in Hull, with this month’s gigs below.

          + +
          +
          + +
          +
          +
          +

          This month

          +

          Every gig goes up here with its night, its price and a link to its tickets.

          + + + + + + + + +
          Gigs at the Boiler Room this month
          NightBandPriceTickets
          This month’s line-up to be announced
          + Hear when tickets go on sale +
          +
          +
          + A long-haired guitarist playing under the stage lights in haze +
          +
          +
          +
          + +
          +
          +

          Room for two hundred

          +
          +
          + The shadows of a band, horns and all, thrown on a lit screen behind the stage +
          +
          +
          +
          + A weathered hand picking the strings of a resonator guitar +
          +
          Doors open at 7pm.
          +
          +
          +
          + A bass player and a keyboard player on stage under the lights +
          +
          The first band is on at 8pm.
          +
          +
          +
          + +
          +
          +
          + A dim bar with lit shelves of bottles and a bartender at work +
          +
          +

          Find us in Hull

          +
          +
          Where
          Hull, street address to be announced
          +
          Room
          200 capacity
          +
          Tickets
          Sold on this page, gig by gig
          +
          +
          +
          +
          + +
          +
          +
          +

          Tickets, gig by gig

          +

          They go on sale here as each night is booked. Leave an email to hear first.

          +
          +
          + +
          + + +
          +

          +
          +
          +
          +
          + + + + + + diff --git a/skills/hallmark/scripts/fixtures/eyebrow-fail/index.html b/skills/hallmark/scripts/fixtures/eyebrow-fail/index.html new file mode 100644 index 0000000..80a56f6 --- /dev/null +++ b/skills/hallmark/scripts/fixtures/eyebrow-fail/index.html @@ -0,0 +1,118 @@ + + + + + + +Gate 54 eyebrow fixture (must fail) + + + + + +
          +
          +

          01 · The tour

          +

          Everything in one pass

          +
          +

          Body copy.

          +
          + + +
          +
          +

          Weather and tides

          +

          Read the water before you launch

          +
          +

          Body copy.

          +
          + + +
          +
          + 02 / Features +

          What it does

          +
          +

          Body copy.

          +
          + + +
          +
          + Chapter three +

          The long crossing

          +
          +

          Body copy.

          +
          + + +
          +
          + Introducing +

          A quieter way to ship

          +
          +

          Body copy.

          +
          + + +
          +
          +

          Pricing

          +

          Pay for what you send

          +
          +

          Body copy.

          +
          + + + diff --git a/skills/hallmark/scripts/fixtures/eyebrow-pass/index.html b/skills/hallmark/scripts/fixtures/eyebrow-pass/index.html new file mode 100644 index 0000000..3c8a194 --- /dev/null +++ b/skills/hallmark/scripts/fixtures/eyebrow-pass/index.html @@ -0,0 +1,137 @@ + + + + + + +Gate 54 carve-out fixture (must pass) + + + + + + +
          +
          Plate 4 · letterpress proof
          +

          Off the grid

          +
          + + + + + +
          WeightOptical size
          24014 pt
          + + +
          +
          + +

          Where should the proofs go?

          + +
          +
          + + + + + +
          +

          · Marta Silveira

          +

          Notes from the second crossing

          +
          + + +
          +
          +

          42B

          +

          events metered

          +
          +

          Throughput

          +
          + + +
          +
          + server.ts +

          Wire the handler

          +
          +
          export default handler;
          +
          + + +
          +
          + Read the launch post +

          Ship the whole crossing

          +
          +
          + + +
          +
          +

          Live · 2,318 watching the drop

          +

          Winter capsule, one hour left

          +
          +
          + + +
            +
          1. + Tue +

            Arrive

            +

            Collect the key from the harbour office.

            +
          2. +
          3. + Wed +

            Cross

            +

            Six hours under sail, weather permitting.

            +
          4. +
          + + + diff --git a/skills/hallmark/scripts/fixtures/imagegen/imagegen.test.mjs b/skills/hallmark/scripts/fixtures/imagegen/imagegen.test.mjs new file mode 100644 index 0000000..f0416f0 --- /dev/null +++ b/skills/hallmark/scripts/fixtures/imagegen/imagegen.test.mjs @@ -0,0 +1,134 @@ +import { test } from 'node:test'; +import assert from 'node:assert/strict'; +import { createHash } from 'node:crypto'; +import { mkdtempSync, mkdirSync, writeFileSync, rmSync, realpathSync, readFileSync } from 'node:fs'; +import { tmpdir } from 'node:os'; +import { join, dirname } from 'node:path'; +import { fileURLToPath, pathToFileURL } from 'node:url'; +import { spawnSync } from 'node:child_process'; + +const script = fileURLToPath(new URL('../../imagegen.mjs', import.meta.url)); +const model = 'black-forest-labs/FLUX.1.1-pro'; +const prompt = 'Rye loaves on a flour-dusted counter'; +const png = Buffer.from('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+jUioAAAAASUVORK5CYII=', 'base64'); + +function withCache(n, explicit, check) { + const dir = mkdtempSync(join(tmpdir(), 'hallmark-image-cache-')); + try { + const hash = createHash('sha256').update([model, prompt, '1024x1024', 4, n].join('|')).digest('hex').slice(0, 16); + const output = explicit ? join(dir, 'chosen.png') : join(dir, '.hallmark', 'img-cache', hash + '.png'); + mkdirSync(dirname(output), { recursive: true }); + const stem = output.replace(/\.png$/, ''); + const paths = Array.from({ length: n }, (_, i) => n === 1 ? output : stem + '-' + (i + 1) + '.png'); + for (const path of paths) writeFileSync(path, png); + writeFileSync(stem + '.json', JSON.stringify({ hash, files: paths.map((path) => path.split(/[\\/]/).pop()) })); + const args = [prompt, '--n', String(n), '--json', ...(explicit ? ['--out', output] : [])]; + const run = (extra = []) => { + const env = { ...process.env }; + delete env.TOGETHER_API_KEY; + const result = spawnSync(process.execPath, [script, ...args, ...extra], { cwd: dir, env, encoding: 'utf8' }); + assert.equal(result.error, undefined); + return { code: result.status, report: JSON.parse(result.stdout) }; + }; + check({ run, paths, metadata: stem + '.json' }); + } finally { rmSync(dir, { recursive: true, force: true }); } +} + +for (const explicit of [false, true]) { + test('reuse all cached batch images' + (explicit ? ' at explicit output' : ' in default cache'), () => { + withCache(2, explicit, ({ run, paths }) => { + const { code, report } = run(); + assert.equal(code, 0); + assert.equal(report.cached, true); + assert.equal(realpathSync(report.path), realpathSync(paths[0])); + assert.deepEqual(report.paths.map(resolvePath), paths.map(resolvePath)); + for (const path of report.paths) assert.deepEqual(readFileSync(path), png); + }); + }); +} +const resolvePath = (path) => realpathSync(path); + +for (const [label, response] of [ + ['partial batch', [{ b64_json: png.toString('base64') }]], + ['missing payload', [{ b64_json: png.toString('base64') }, {}]], + ['excess batch', Array.from({ length: 3 }, () => ({ b64_json: png.toString('base64') }))], +]) { + test('reject ' + label + ' before overwriting output', () => { + withCache(2, true, ({ paths, metadata }) => { + const before = [metadata, ...paths].map((file) => readFileSync(file)); + const preload = join(dirname(metadata), 'response.mjs'); + writeFileSync(preload, `globalThis.fetch = async () => ({ ok: true, json: async () => (${JSON.stringify({ data: response })}) });`); + const result = spawnSync(process.execPath, ['--import', pathToFileURL(preload).href, script, prompt, '--n', '2', '--force', '--out', join(dirname(metadata), 'chosen.png'), '--json'], { + cwd: dirname(metadata), env: { ...process.env, TOGETHER_API_KEY: 'offline-test-key' }, encoding: 'utf8', timeout: 5000, + }); + assert.equal(result.error, undefined); + assert.equal(result.status, 1, result.stdout); + assert.equal(JSON.parse(result.stdout).error, 'image-count'); + assert.deepEqual([metadata, ...paths].map((file) => readFileSync(file)), before); + }); + }); +} + +test('complete generated batch writes every requested image', () => { + withCache(2, true, ({ paths, metadata }) => { + const preload = join(dirname(metadata), 'response.mjs'); + const generated = Buffer.from('offline image bytes'); + writeFileSync(preload, `globalThis.fetch = async () => ({ ok: true, json: async () => ({ data: Array.from({ length: 2 }, () => ({ b64_json: '${generated.toString('base64')}' })) }) });`); + const result = spawnSync(process.execPath, ['--import', pathToFileURL(preload).href, script, prompt, '--n', '2', '--force', '--out', join(dirname(metadata), 'chosen.png'), '--json'], { + cwd: dirname(metadata), env: { ...process.env, TOGETHER_API_KEY: 'offline-test-key' }, encoding: 'utf8', timeout: 5000, + }); + assert.equal(result.error, undefined); + assert.equal(result.status, 0, result.stderr); + const report = JSON.parse(result.stdout); + assert.equal(report.cached, false); + assert.equal(report.paths.length, 2); + for (const file of paths) assert.deepEqual(readFileSync(file), generated); + assert.equal(JSON.parse(readFileSync(metadata, 'utf8')).files.length, 2); + }); +}); + +test('single-image cache continues to use unnumbered output', () => { + withCache(1, true, ({ run, paths }) => { + const { code, report } = run(); + assert.equal(code, 0); + assert.equal(report.cached, true); + assert.equal(realpathSync(report.path), realpathSync(paths[0])); + }); +}); + +test('missing middle image and force bypass do not report cache hits', () => { + withCache(3, true, ({ run, paths }) => { + const forced = run(['--force']); + assert.equal(forced.code, 3); + assert.equal(forced.report.error, 'no-key'); + rmSync(paths[1]); + const { code, report } = run(); + assert.equal(code, 3); + assert.equal(report.error, 'no-key'); + }); +}); + +test('explicit output from a different request is not reused', () => { + withCache(2, true, ({ run, metadata }) => { + writeFileSync(metadata, JSON.stringify({ hash: 'another-request' })); + const { code, report } = run(); + assert.equal(code, 3); + assert.equal(report.error, 'no-key'); + }); +}); + +test('large image count with no cache remains a bounded no-key miss', () => { + const dir = mkdtempSync(join(tmpdir(), 'hallmark-image-count-')); + try { + const env = { ...process.env }; + delete env.TOGETHER_API_KEY; + const started = performance.now(); + const result = spawnSync(process.execPath, ['--max-old-space-size=32', script, prompt, '--n', '1000000000', '--json'], { + cwd: dir, env, encoding: 'utf8', timeout: 5000, + }); + assert.equal(result.error, undefined); + assert.equal(result.status, 3, result.stderr); + assert.equal(JSON.parse(result.stdout).error, 'no-key'); + assert.ok(performance.now() - started < 5000); + } finally { rmSync(dir, { recursive: true, force: true }); } +}); diff --git a/skills/hallmark/scripts/fixtures/kept/after.html b/skills/hallmark/scripts/fixtures/kept/after.html new file mode 100644 index 0000000..a0b1edb --- /dev/null +++ b/skills/hallmark/scripts/fixtures/kept/after.html @@ -0,0 +1,27 @@ + + + + + +Kept fixture, the page after + + + + + +

          Rooms by the harbour

          +

          What it costs

          +

          From $120 a night. Breakfast until 10:30.

          +
          + + +
          + + + diff --git a/skills/hallmark/scripts/fixtures/kept/before.html b/skills/hallmark/scripts/fixtures/kept/before.html new file mode 100644 index 0000000..68afe6b --- /dev/null +++ b/skills/hallmark/scripts/fixtures/kept/before.html @@ -0,0 +1,26 @@ + + + + + +Kept fixture, the page before + + + + + +

          Rooms by the harbour

          +

          Rates

          +

          From $120 a night. Breakfast until 10:30.

          +
          + + + +
          + + + diff --git a/skills/hallmark/scripts/fixtures/slopped.html b/skills/hallmark/scripts/fixtures/slopped.html new file mode 100644 index 0000000..df939aa --- /dev/null +++ b/skills/hallmark/scripts/fixtures/slopped.html @@ -0,0 +1,145 @@ + + + + + + +Nexus - Unleash Seamless Workflows + + + + + +
          +
          +

          Unleash hyperproductivity-supercharged workflows

          +

          Trusted by 50,000+ teams shipping 10x faster.

          + + + +
          + +
          + 01 / FEATURES +

          Everything, seamlessly

          +
          + +
          +
          +
          ✨
          +

          Magic sync

          +
          +

          A card inside a card, as the template gods intended.

          +
          +
          +
          +
          + + + +
          +
          "It changed everything for our team."
          +

          Jane Doe, Head of Operations

          +
          +
          + + diff --git a/skills/hallmark/scripts/fixtures/tailwind-fail/Feature.vue b/skills/hallmark/scripts/fixtures/tailwind-fail/Feature.vue new file mode 100644 index 0000000..a6ef98c --- /dev/null +++ b/skills/hallmark/scripts/fixtures/tailwind-fail/Feature.vue @@ -0,0 +1,14 @@ + + + diff --git a/skills/hallmark/scripts/fixtures/tailwind-fail/Hero.tsx b/skills/hallmark/scripts/fixtures/tailwind-fail/Hero.tsx new file mode 100644 index 0000000..554ac6b --- /dev/null +++ b/skills/hallmark/scripts/fixtures/tailwind-fail/Hero.tsx @@ -0,0 +1,33 @@ +import Link from "next/link"; +import { cva } from "class-variance-authority"; +import { cn } from "./cn"; + +const badge = cva("rounded-full px-2 py-1 text-xs uppercase tracking-widest", { + variants: { tone: { loud: "font-semibold", calm: "font-normal" } }, +}); + +type HeroProps = { active: boolean; items: Array<{ id: string; label: string }> }; + +export function Hero({ active, items }: HeroProps) { + const count = items.length; + if (count < 1) return null; + return ( +
          +

          Release notes

          +

          + Logs that sail with you +

          + Kept by the crew + + Read the docs + + New +
          + ); +} diff --git a/skills/hallmark/scripts/fixtures/tailwind-fail/index.html b/skills/hallmark/scripts/fixtures/tailwind-fail/index.html new file mode 100644 index 0000000..d30a04c --- /dev/null +++ b/skills/hallmark/scripts/fixtures/tailwind-fail/index.html @@ -0,0 +1,74 @@ + + + + + + +Tailwind fail fixture + + + + + + + + + + +
          + + + +

          Fewer handoffs

          +

          + + Field notes for crews at sea +

          + +

          Updated weekly by the crew

          + + Start a log + + + + +
          + + + + +
          +

          What the crew gets

          + +
          +
          +
          +

          Tide tables

          +

          Every reading lands on the same chart.

          +
          +
          +
          +

          Crew logs

          +

          One log per watch, signed by whoever kept it.

          +
          +
          +
          +

          Weather

          +

          Forecasts pinned to the hour you sail.

          +
          +
          +
          + +
          + + The harbour at dawn + +

          Logs stay on the boat until you sync them.

          +
          + + + diff --git a/skills/hallmark/scripts/fixtures/tailwind-fail/style.css b/skills/hallmark/scripts/fixtures/tailwind-fail/style.css new file mode 100644 index 0000000..dddf7d1 --- /dev/null +++ b/skills/hallmark/scripts/fixtures/tailwind-fail/style.css @@ -0,0 +1,6 @@ +/* Hallmark · fixture: tailwind-fail · every utility tell, one per element */ +:root { + --color-paper: oklch(18% 0.02 270); + --color-ink: oklch(95% 0.01 270); + --color-glow: oklch(62% 0.25 300 / 0.6); +} diff --git a/skills/hallmark/scripts/fixtures/tailwind-pass/Hero.tsx b/skills/hallmark/scripts/fixtures/tailwind-pass/Hero.tsx new file mode 100644 index 0000000..bde3a2d --- /dev/null +++ b/skills/hallmark/scripts/fixtures/tailwind-pass/Hero.tsx @@ -0,0 +1,33 @@ +import { useState } from "react"; + +type HeroProps = { onStart?: () => void; readings: Array<{ id: string; label: string }> }; + +export function Hero({ onStart, readings }: HeroProps) { + const [sent, setSent] = useState(false); + const start = () => { + setSent(true); + if (onStart && readings.length > 0) onStart(); + }; + return ( +
          +
          +

          Logbooks your crew will keep

          +

          Write a reading once and the whole crew sees it.

          + +
            + {readings.map((r) => ( +
          • {r.label}
          • + ))} +
          +
          +
          +
          + ); +} diff --git a/skills/hallmark/scripts/fixtures/tailwind-pass/index.html b/skills/hallmark/scripts/fixtures/tailwind-pass/index.html new file mode 100644 index 0000000..20fd0f2 --- /dev/null +++ b/skills/hallmark/scripts/fixtures/tailwind-pass/index.html @@ -0,0 +1,57 @@ + + + + + + +Tailwind pass fixture + + + + + + +
          + Fieldnote + +
          + +
          +
          +
          +

          Logbooks your crew will keep

          +

          Write a reading once and the whole crew sees it.

          +
          + + + +
          +
          +
          +
          Your product screenshot
          +
          +
          + +
          +

          One log per watch

          +

          Each watch signs its own page, and the next watch reads it first.

          +
            +
          • +

            Readings

            +

            Wind, swell and heading, in the units your boat uses.

            +
          • +
          • +

            Handover notes

            +

            What changed since the last watch, in plain sentences.

            +
          • +
          + Take the tour +
          +
          + + + + diff --git a/skills/hallmark/scripts/fixtures/tailwind-pass/style.css b/skills/hallmark/scripts/fixtures/tailwind-pass/style.css new file mode 100644 index 0000000..3497b65 --- /dev/null +++ b/skills/hallmark/scripts/fixtures/tailwind-pass/style.css @@ -0,0 +1,15 @@ +/* Hallmark · fixture: tailwind-pass · theme: fixture (by request) · posture: restrained · nav: N1 · footer: none · hero: Settled */ +@import "tailwindcss"; + +@theme { + --color-paper: oklch(97.5% 0.006 240); + --color-well: oklch(93% 0.012 240); + --color-line: oklch(86% 0.015 240); + --color-ink: oklch(22% 0.025 250); + --color-muted: oklch(46% 0.02 250); + --color-accent: oklch(48% 0.15 255); + --color-accent-strong: oklch(42% 0.15 255); + --color-accent-ink: oklch(98.5% 0.005 255); + --font-display: "Fraunces", serif; + --font-body: "Public Sans", sans-serif; +} diff --git a/skills/hallmark/scripts/fixtures/waiver/index.html b/skills/hallmark/scripts/fixtures/waiver/index.html new file mode 100644 index 0000000..b8f081b --- /dev/null +++ b/skills/hallmark/scripts/fixtures/waiver/index.html @@ -0,0 +1,54 @@ + + + + + + +Waiver fixture + + + +

          A manifesto printed on a black stage

          +

          The manifesto sets long declarative lines and lets the paper do the shouting.

          + + diff --git a/skills/hallmark/scripts/imagegen.mjs b/skills/hallmark/scripts/imagegen.mjs new file mode 100644 index 0000000..a8effb4 --- /dev/null +++ b/skills/hallmark/scripts/imagegen.mjs @@ -0,0 +1,94 @@ +#!/usr/bin/env node +import { createHash } from "node:crypto"; +import { mkdirSync, existsSync, writeFileSync, readFileSync } from "node:fs"; +import { join, dirname, basename } from "node:path"; + +const ENDPOINT = "https://api.together.xyz/v1/images/generations"; +const DEFAULT_MODEL = "black-forest-labs/FLUX.1.1-pro"; + +function parseArgs(argv) { + const a = { _: [] }; + for (let i = 0; i < argv.length; i++) { + const t = argv[i]; + if (t.startsWith("--")) { + const k = t.slice(2); + if (k === "force" || k === "json") a[k] = true; + else a[k] = argv[++i]; + } else a._.push(t); + } + return a; +} + +function out(obj, code = 0) { + if (args.json) process.stdout.write(JSON.stringify(obj) + "\n"); + else if (obj.path) console.log(obj.path); + else if (obj.message || obj.error) console.error(obj.message || obj.error); + process.exit(code); +} + +const args = parseArgs(process.argv.slice(2)); +const prompt = args._.join(" ").trim(); +if (!prompt) out({ error: 'usage: node imagegen.mjs "" [--model ...] [--size WxH] [--out path]' }, 2); + +const model = args.model ?? DEFAULT_MODEL; +const size = args.size ?? "1024x1024"; +const [w, h] = size.split("x").map((n) => parseInt(n, 10)); +if (!w || !h) out({ error: `bad --size ${size} (want WxH, e.g. 1536x1024)` }, 2); +const steps = parseInt(args.steps ?? "4", 10); + +const n = Math.max(1, parseInt(args.n ?? "1", 10) || 1); +const hash = createHash("sha256").update([model, prompt, size, steps, n].join("|")).digest("hex").slice(0, 16); +const cacheDir = args.out ? dirname(args.out) : join(process.cwd(), ".hallmark", "img-cache"); +const cachePath = args.out ?? join(cacheDir, `${hash}.png`); +const stem = cachePath.replace(/\.png$/, ""); +const metaPath = stem + ".json"; +const pathFor = (i) => (n === 1 ? cachePath : `${stem}-${i + 1}.png`); + +const sameRequest = () => { if (!args.out) return true; try { return JSON.parse(readFileSync(metaPath, "utf8")).hash === hash; } catch { return false; } }; +if (!args.force && sameRequest()) { + const cachedPaths = []; + for (let i = 0; i < n; i++) { + const path = pathFor(i); + if (!existsSync(path)) break; + cachedPaths.push(path); + } + if (cachedPaths.length === n) { + out({ path: cachedPaths[0], paths: cachedPaths, cached: true, model, prompt }); + } +} + +const key = process.env.TOGETHER_API_KEY; +if (!key) { + out({ + error: "no-key", + message: + "TOGETHER_API_KEY not set. Image generation is opt-in; falling back to CSS-art / a labelled placeholder. " + + "Set TOGETHER_API_KEY to generate real imagery, or keep the typography-only / placeholder path.", + }, 3); +} + +try { + const res = await fetch(ENDPOINT, { + method: "POST", + headers: { "content-type": "application/json", authorization: `Bearer ${key}` }, + body: JSON.stringify({ model, prompt, width: w, height: h, steps, n, response_format: "b64_json" }), + signal: AbortSignal.timeout(180000), + }); + if (!res.ok) { + const detail = (await res.text()).slice(0, 300); + out({ error: `together ${res.status}`, message: `image API ${res.status}: ${detail}` }, 1); + } + const data = await res.json(); + const images = (data?.data ?? []).map((d) => d?.b64_json).filter(Boolean); + if (!images.length) out({ error: "no-image", message: "image API returned no b64_json payload" }, 1); + if (images.length !== n) out({ error: "image-count", message: `image API returned ${images.length} images; requested ${n}. No files were written.` }, 1); + + mkdirSync(cacheDir, { recursive: true }); + const paths = []; + images.forEach((b64, i) => { const p = pathFor(i); writeFileSync(p, Buffer.from(b64, "base64")); paths.push(p); }); + const provenance = { model, prompt, size, steps, n, hash, files: paths.map((p) => basename(p)), generatedVia: "together", note: "generated asset; post-process before shipping; verify licensing", at: new Date().toISOString().slice(0, 10) }; + writeFileSync(metaPath, JSON.stringify(provenance, null, 2) + "\n"); + out({ path: paths[0], paths, cached: false, model, prompt, provenance }); +} catch (e) { + out({ error: "fetch-failed", message: `image generation failed: ${String(e?.message ?? e)}. Falling back to placeholder.` }, 1); +} diff --git a/skills/hallmark/scripts/install-hook.mjs b/skills/hallmark/scripts/install-hook.mjs new file mode 100644 index 0000000..4b0a6cf --- /dev/null +++ b/skills/hallmark/scripts/install-hook.mjs @@ -0,0 +1,70 @@ +#!/usr/bin/env node +import { readFileSync, writeFileSync, mkdirSync, existsSync, renameSync, realpathSync } from "node:fs"; +import { fileURLToPath } from "node:url"; +import { dirname, join } from "node:path"; +import { homedir } from "node:os"; + +const HERE = dirname(fileURLToPath(import.meta.url)); +const HOOK_CMD = `node "${join(HERE, "lint-hook.mjs")}"`; +const MATCHER = "Write|Edit|MultiEdit"; + +const args = process.argv.slice(2); +const has = (f) => args.includes(f); + +const settingsPath = has("--global") + ? join(homedir(), ".claude", "settings.json") + : join(process.cwd(), ".claude", "settings.json"); + +const hookEntry = { + matcher: MATCHER, + hooks: [{ type: "command", command: HOOK_CMD, timeout: 10 }], +}; + +function readSettings() { + if (!existsSync(settingsPath)) return {}; + try { return JSON.parse(readFileSync(settingsPath, "utf8")); } catch { + console.error(`refusing to overwrite unparseable ${settingsPath}; fix or delete it first.`); + process.exit(1); + } +} + +const ourHook = (h) => typeof h?.command === "string" && /hallmark[\\/]scripts[\\/]lint-hook\.mjs/.test(h.command); +const withoutOurs = (list) => list.flatMap((e) => { + if (!Array.isArray(e?.hooks) || !e.hooks.some(ourHook)) return [e]; + const rest = e.hooks.filter((h) => !ourHook(h)); + return rest.length ? [{ ...e, hooks: rest }] : []; +}); + +if (has("--print")) { + console.log(`# add to ${settingsPath} :`); + console.log(JSON.stringify({ hooks: { PostToolUse: [hookEntry] } }, null, 2)); + process.exit(0); +} + +if (has("--remove") && !existsSync(settingsPath)) { + console.log(`no ${settingsPath}; nothing to remove`); + process.exit(0); +} + +const settings = readSettings(); +if (!settings || typeof settings !== "object" || Array.isArray(settings)) { console.error(`refusing to rewrite ${settingsPath}: it is not a JSON object`); process.exit(1); } +settings.hooks ??= {}; +settings.hooks.PostToolUse ??= []; +if (!Array.isArray(settings.hooks.PostToolUse)) { console.error(`refusing to rewrite ${settingsPath}: hooks.PostToolUse is not a list`); process.exit(1); } +// Write beside the file and rename over it, so a crash never leaves settings.json half written. +// A symlinked settings.json (a dotfiles repo) keeps its link: the write lands on the file it points at. +const save = () => { const dest = existsSync(settingsPath) ? realpathSync(settingsPath) : settingsPath; const tmp = `${dest}.hallmark-tmp`; writeFileSync(tmp, JSON.stringify(settings, null, 2) + "\n"); renameSync(tmp, dest); }; + +settings.hooks.PostToolUse = withoutOurs(settings.hooks.PostToolUse); + +if (has("--remove")) { + save(); + console.log(`removed the Hallmark lint hook from ${settingsPath}`); + process.exit(0); +} + +settings.hooks.PostToolUse.push(hookEntry); +mkdirSync(dirname(settingsPath), { recursive: true }); +save(); +console.log(`installed the Hallmark edit-time lint hook into ${settingsPath}`); +console.log(`it lints Hallmark .html and .css files, and .jsx, .tsx, .vue, .svelte and .astro files inside a project with a .hallmark folder, on write; it advises and never blocks. Remove with --remove.`); diff --git a/skills/hallmark/scripts/install.mjs b/skills/hallmark/scripts/install.mjs new file mode 100644 index 0000000..c06a5fc --- /dev/null +++ b/skills/hallmark/scripts/install.mjs @@ -0,0 +1,141 @@ +#!/usr/bin/env node +import fs from "node:fs"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import { homedir } from "node:os"; + +const HERE = path.dirname(fileURLToPath(import.meta.url)); +const SKILL_ROOT = path.dirname(HERE); +const HOME = homedir(); + +const PAYLOAD = ["SKILL.md", "LICENSE", "references", "scripts", "agents"]; + +const TARGETS = { + claude: { + label: "Claude Code", + dir: path.join(HOME, ".claude", "skills", "hallmark"), + detect: () => fs.existsSync(path.join(HOME, ".claude")), + }, + codex: { + label: "Codex CLI and Cursor", + dir: path.join(HOME, ".agents", "skills", "hallmark"), + detect: () => [".codex", ".agents", ".cursor"].some((d) => fs.existsSync(path.join(HOME, d))), + legacy: path.join(HOME, ".codex", "skills", "hallmark"), + }, + opencode: { + label: "OpenCode", + dir: path.join(HOME, ".config", "opencode", "skills", "hallmark"), + detect: () => fs.existsSync(path.join(HOME, ".config", "opencode")) || fs.existsSync(path.join(HOME, ".opencode")), + }, +}; + +const args = process.argv.slice(2); +const has = (f) => args.includes(f); +const FLAGS = ["--claude", "--codex", "--opencode", "--cursor", "--copy", "--dry-run", "--force", "--remove", "--help", "-h"]; +const unknown = args.filter((a) => !FLAGS.includes(a)); +if (has("--help") || has("-h") || unknown.length) { + if (unknown.length) console.log(`Unknown option: ${unknown.join(" ")}\n`); + console.log(`node install.mjs [--claude] [--codex] [--cursor] [--opencode] [--copy] [--dry-run] [--force] [--remove] + + Installs Hallmark for every harness it finds (or only the ones named), after checking every theme and reference. + --dry-run print what would be copied and change nothing + --copy give OpenCode its own copy instead of reading the Claude Code or Codex one + --force install even if the checks find a problem + --remove delete every installed copy`); + process.exit(unknown.length ? 2 : 0); +} +const DRY = has("--dry-run"); + +function copyDir(src, dest) { + fs.mkdirSync(dest, { recursive: true }); + for (const entry of fs.readdirSync(src, { withFileTypes: true })) { + if (entry.name === ".DS_Store" || entry.name === ".hallmark" || entry.name === "node_modules" || entry.name === "fixtures") continue; + if (entry.isSymbolicLink()) continue; // never follow a link out of the skill into the install + const s = path.join(src, entry.name); + const d = path.join(dest, entry.name); + if (entry.isDirectory()) copyDir(s, d); + else fs.copyFileSync(s, d); + } +} + +function installTo(dir) { + if (DRY) return console.log(` would install -> ${dir}`); + const tmp = dir + ".tmp-install"; + fs.rmSync(tmp, { recursive: true, force: true }); + fs.mkdirSync(tmp, { recursive: true }); + for (const item of PAYLOAD) { + const src = path.join(SKILL_ROOT, item); + if (!fs.existsSync(src)) continue; + const dest = path.join(tmp, item); + if (fs.statSync(src).isDirectory()) copyDir(src, dest); + else { fs.mkdirSync(path.dirname(dest), { recursive: true }); fs.copyFileSync(src, dest); } + } + fs.rmSync(dir, { recursive: true, force: true }); + fs.mkdirSync(path.dirname(dir), { recursive: true }); + fs.renameSync(tmp, dir); + console.log(` installed -> ${dir}`); +} + +function removeAt(dir) { + if (!fs.existsSync(dir)) return; + if (DRY) return console.log(` would remove ${dir}`); + fs.rmSync(dir, { recursive: true, force: true }); + console.log(` removed ${dir}`); +} + +if (has("--remove")) { + console.log("Removing Hallmark from every known install location:"); + for (const t of Object.values(TARGETS)) removeAt(t.dir); + removeAt(TARGETS.codex.legacy); + process.exit(0); +} + +const explicit = ["claude", "codex", "opencode"].filter((k) => has("--" + k) || (k === "codex" && has("--cursor"))); +const picked = explicit.length ? explicit : Object.keys(TARGETS).filter((k) => TARGETS[k].detect()); + +if (!picked.length) { + console.log("No harness detected (~/.claude, ~/.codex, ~/.agents, ~/.cursor, ~/.config/opencode all absent)."); + console.log("Pick explicitly: node install.mjs --claude --codex --opencode"); + process.exit(1); +} + +const { execFileSync } = await import("node:child_process"); +try { + if (!DRY) execFileSync(process.execPath, [path.join(HERE, "theme.mjs"), "index"], { stdio: "inherit" }); +} catch { + console.log(" (theme index not rebuilt; run node scripts/theme.mjs index)"); +} +const gate = (label, argv) => { + try { execFileSync(process.execPath, argv, { stdio: "pipe" }); return true; } + catch (e) { console.log(`\n${label} failed:\n${String(e.stdout || "").trim()}`); return false; } +}; +const themeFiles = fs.readdirSync(path.join(SKILL_ROOT, "references", "themes")).filter((f) => f.endsWith(".md")).map((f) => path.join(SKILL_ROOT, "references", "themes", f)); +const clean = gate("refcheck", [path.join(HERE, "refcheck.mjs"), "--errors"]) & gate("theme validate", [path.join(HERE, "theme.mjs"), "validate", ...themeFiles]); +if (!clean && !has("--force")) { + console.log("\nNothing installed. Fix the findings above, or pass --force to install anyway."); + process.exit(1); +} +console.log(`Hallmark installer${DRY ? " (dry run)" : ""} · payload: ${PAYLOAD.join(", ")}`); + +for (const key of picked) { + const t = TARGETS[key]; + console.log(`\n${t.label}:`); + + if (key === "opencode" && !has("--copy")) { + const willHaveCompat = picked.includes("claude") || picked.includes("codex") || + fs.existsSync(TARGETS.claude.dir) || fs.existsSync(TARGETS.codex.dir); + if (willHaveCompat) { + console.log(` skipped: OpenCode auto-discovers the Claude Code / Codex copy via its compatibility paths.`); + console.log(` (force an explicit copy with: node install.mjs --opencode --copy)`); + continue; + } + } + + installTo(t.dir); + + if (key === "codex" && fs.existsSync(t.legacy)) { + console.log(` an older copy sits at ${t.legacy}; Codex may list Hallmark twice. Remove it with: node install.mjs --remove, then install again.`); + } +} + +console.log(`\nDone. Invoke as: /hallmark (Claude Code) · $hallmark (Codex) · /hallmark (Cursor, OpenCode).`); diff --git a/skills/hallmark/scripts/lint-hook.mjs b/skills/hallmark/scripts/lint-hook.mjs new file mode 100644 index 0000000..dff2260 --- /dev/null +++ b/skills/hallmark/scripts/lint-hook.mjs @@ -0,0 +1,49 @@ +#!/usr/bin/env node +import { readFileSync, existsSync } from "node:fs"; +import { execFileSync } from "node:child_process"; +import { fileURLToPath } from "node:url"; +import { dirname, join } from "node:path"; + +const OK = (obj = {}) => { process.stdout.write(JSON.stringify(obj)); process.exit(0); }; + +function main() { + let raw = ""; + try { raw = readFileSync(0, "utf8"); } catch { return OK(); } + let payload; + try { payload = JSON.parse(raw); } catch { return OK(); } + const filePath = payload?.tool_input?.file_path; + if (typeof filePath !== "string" || !filePath) return OK(); + const lower = filePath.toLowerCase(); + const markup = /\.(html|css)$/.test(lower); + const component = /\.(jsx|tsx|vue|svelte|astro)$/.test(lower); + if (!markup && !component) return OK(); + let src = ""; + try { src = readFileSync(filePath, "utf8"); } catch { return OK(); } + if (src.length === 0) return OK(); + const inHallmarkProject = () => { let d = dirname(filePath); for (let i = 0; i < 8; i++) { if (existsSync(join(d, ".hallmark"))) return true; const up = dirname(d); if (up === d) break; d = up; } return false; }; + const looksHallmark = markup ? /\/\*\s*Hallmark/.test(src) : inHallmarkProject(); + if (!looksHallmark) return OK(); + const gm = src.match(/genre:\s*(editorial|modern-minimal|atmospheric|playful)/i); + const args = [filePath, "--json", "--tier", "floor"]; + if (gm) args.push("--genre", gm[1].toLowerCase()); + if (/·\s*component:/i.test(src) || lower.endsWith(".preview.html")) args.push("--scope", "component"); + const sloplint = join(dirname(fileURLToPath(import.meta.url)), "sloplint.mjs"); + let out = ""; + try { + out = execFileSync(process.execPath, [sloplint, ...args], { encoding: "utf8", timeout: 4000, stdio: ["ignore", "pipe", "ignore"] }); + } catch (e) { + out = e?.stdout?.toString?.() ?? ""; + } + if (!out) return OK(); + let report; + try { report = JSON.parse(out); } catch { return OK(); } + const fails = (report?.findings ?? []).filter((f) => f.grade === "FAIL"); + if (fails.length === 0) return OK(); + const name = filePath.split("/").pop(); + const lines = fails.slice(0, 10).map((f) => `- gate ${f.gate} (line ${f.line}): ${f.evidence} -> ${f.fix}`); + const more = fails.length > 10 ? `\n (+${fails.length - 10} more)` : ""; + const ctx = `Hallmark Floor check on ${name}: ${fails.length} FAIL${fails.length === 1 ? "" : "s"}.\n${lines.join("\n")}${more}\nFix these now; the Reflex and Finish tiers run at Step 7.`; + return OK({ hookSpecificOutput: { hookEventName: "PostToolUse", additionalContext: ctx } }); +} + +try { main(); } catch { OK(); } diff --git a/skills/hallmark/scripts/photos.json b/skills/hallmark/scripts/photos.json new file mode 100644 index 0000000..b9406f9 --- /dev/null +++ b/skills/hallmark/scripts/photos.json @@ -0,0 +1 @@ +{"source":"Wikimedia Commons; every file CC0, public domain, CC BY or CC BY-SA. Credit each photo used: author, licence, link to its page. Files re-uploaded from stock sites (Unsplash, Pexels, Pixabay) are excluded.","built":"2026-10-13","count":755,"photos":[{"id":"Gyedong-gil street with climbing plants at golden hour in Seoul South Korea.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/23/Gyedong-gil_street_with_climbing_plants_at_golden_hour_in_Seoul_South_Korea.jpg","page":"https://commons.wikimedia.org/wiki/File:Gyedong-gil_street_with_climbing_plants_at_golden_hour_in_Seoul_South_Korea.jpg","w":6631,"h":3949,"color":"#6b6b53","license":"CC BY-SA 4.0","author":"Basile Morin","subject":"quiet Seoul street at golden hour lined with climbing plants and low shopfronts","tags":["street","city","seoul","korea","golden hour","plants","shops","neighbourhood","travel","walking"],"cat":"city","tone":"light","temp":"warm","people":"none","q":3},{"id":"Alley in Gamla Stan, Stockholm.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/1/17/Alley_in_Gamla_Stan%2C_Stockholm.jpg","page":"https://commons.wikimedia.org/wiki/File:Alley_in_Gamla_Stan,_Stockholm.jpg","w":4000,"h":6000,"color":"#8f7965","license":"CC BY 4.0","author":"OleNeitzel","subject":"narrow cobbled alley between tall ochre houses in old Stockholm, portrait","tags":["alley","street","cobblestones","old town","stockholm","europe","travel","city break","walking tour"],"cat":"city","tone":"mid","temp":"warm","people":"none","q":3},{"id":"Crosswalk of Market at Third, San Francisco.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/b3/Crosswalk_of_Market_at_Third%2C_San_Francisco.jpg","page":"https://commons.wikimedia.org/wiki/File:Crosswalk_of_Market_at_Third,_San_Francisco.jpg","w":7241,"h":4538,"color":"#6c6468","license":"CC BY-SA 4.0","author":"Dllu","subject":"zebra crossing and painted road markings seen from directly above, yellow taxi","tags":["crosswalk","street","aerial","city","road","traffic","urban","transport","mobility","graphic"],"cat":"city","tone":"mid","temp":"neutral","people":"none","q":3,"fp":[0.55,0.5]},{"id":"Steam stacks at Broadway and Dey (91441).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/77/Steam_stacks_at_Broadway_and_Dey_%2891441%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Steam_stacks_at_Broadway_and_Dey_(91441).jpg","w":4188,"h":3196,"color":"#5f5c65","license":"CC BY-SA 4.0","author":"Rhododendrites","subject":"steam rising from a striped vent stack on a New York street with pedestrians","tags":["new york","street","steam","city","urban","pedestrians","manhattan","downtown","winter"],"cat":"city","tone":"light","temp":"cool","people":"figure","q":3,"fp":[0.25,0.5]},{"id":"Münster, Prinzipalmarkt, Arkaden -- 2021 -- 8931-3.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/91/M%C3%BCnster%2C_Prinzipalmarkt%2C_Arkaden_--_2021_--_8931-3.jpg","page":"https://commons.wikimedia.org/wiki/File:M%C3%BCnster,_Prinzipalmarkt,_Arkaden_--_2021_--_8931-3.jpg","w":4466,"h":5955,"color":"#704f2f","license":"CC BY-SA 4.0","author":"Dietmar Rabich","subject":"vaulted stone arcade with hanging lamps receding into the distance, portrait","tags":["arcade","colonnade","street","old town","lamps","architecture","shopping street","germany","perspective"],"cat":"architecture","tone":"mid","temp":"warm","people":"none","q":3},{"id":"Esztergom by night 01 - Simor János utca.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/a/ab/Esztergom_by_night_01_-_Simor_J%C3%A1nos_utca.jpg","page":"https://commons.wikimedia.org/wiki/File:Esztergom_by_night_01_-_Simor_J%C3%A1nos_utca.jpg","w":3387,"h":2294,"color":"#482e24","license":"CC BY-SA 4.0","author":"Pudelek","subject":"empty old town street at blue hour with warm street lamps and lit facades","tags":["night","street","blue hour","street lamps","old town","europe","evening","quiet","city"],"cat":"city","tone":"dark","temp":"warm","people":"none","q":3},{"id":"1 Mercado do Bolhão.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/3/3f/1_Mercado_do_Bolh%C3%A3o.jpg","page":"https://commons.wikimedia.org/wiki/File:1_Mercado_do_Bolh%C3%A3o.jpg","w":6135,"h":4090,"color":"#9c9c9c","license":"CC BY-SA 4.0","author":"Afsalgado","subject":"market hall interior with stairs and galleries, black and white","tags":["market hall","covered market","porto","interior","stairs","architecture","black and white","food market"],"cat":"architecture","tone":"light","temp":"neutral","people":"none","q":3},{"id":"Mercado Central, Valencia, España, 2014-06-30, DD 116.JPG","file":"https://upload.wikimedia.org/wikipedia/commons/9/9b/Mercado_Central%2C_Valencia%2C_Espa%C3%B1a%2C_2014-06-30%2C_DD_116.JPG","page":"https://commons.wikimedia.org/wiki/File:Mercado_Central,_Valencia,_Espa%C3%B1a,_2014-06-30,_DD_116.JPG","w":5488,"h":3544,"color":"#7a706a","license":"CC BY-SA 4.0","author":"Diego Delso","subject":"patterned dome and iron roof of a covered market seen from below","tags":["covered market","dome","valencia","roof","ironwork","architecture","pattern","food market","ceiling"],"cat":"architecture","tone":"mid","temp":"warm","people":"none","q":3},{"id":"Mercado de Colón, Valencia, España, 2014-06-29, DD 07.JPG","file":"https://upload.wikimedia.org/wikipedia/commons/a/ab/Mercado_de_Col%C3%B3n%2C_Valencia%2C_Espa%C3%B1a%2C_2014-06-29%2C_DD_07.JPG","page":"https://commons.wikimedia.org/wiki/File:Mercado_de_Col%C3%B3n,_Valencia,_Espa%C3%B1a,_2014-06-29,_DD_07.JPG","w":3707,"h":3304,"color":"#727372","license":"CC BY-SA 3.0","author":"Diego Delso","subject":"iron and glass market hall with a long vaulted roof and patterned ends","tags":["market hall","iron","glass roof","valencia","covered market","architecture","perspective","food hall"],"cat":"architecture","tone":"light","temp":"cool","people":"none","q":3},{"id":"Shopping in the spotlight (Cairo).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/3/33/Shopping_in_the_spotlight_%28Cairo%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Shopping_in_the_spotlight_(Cairo).jpg","w":4060,"h":2856,"color":"#342822","license":"CC BY-SA 3.0","author":"Frank Schulenburg","subject":"shaft of sunlight falling on a fabric stall and shoppers in a dark market hall","tags":["market","stall","sunlight","shadows","cairo","bazaar","textiles","trade","light"],"cat":"city","tone":"dark","temp":"warm","people":"figure","q":3,"fp":[0.45,0.4]},{"id":"Matin ensoleillé au marché de la Terrasse.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/2f/Matin_ensoleill%C3%A9_au_march%C3%A9_de_la_Terrasse.jpg","page":"https://commons.wikimedia.org/wiki/File:Matin_ensoleill%C3%A9_au_march%C3%A9_de_la_Terrasse.jpg","w":4746,"h":3565,"color":"#585d5e","license":"CC BY-SA 4.0","author":"Touam (Hervé Agnoux)","subject":"shoppers at an outdoor vegetable stall under green awnings","tags":["market","vegetables","stall","farmers market","produce","shopping","france","outdoor","local food"],"cat":"city","tone":"light","temp":"warm","people":"figure","q":3},{"id":"Ostuni - Borgo Antico Bistrot - 2.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/5/57/Ostuni_-_Borgo_Antico_Bistrot_-_2.jpg","page":"https://commons.wikimedia.org/wiki/File:Ostuni_-_Borgo_Antico_Bistrot_-_2.jpg","w":4328,"h":6486,"color":"#737a7e","license":"CC BY-SA 4.0","author":"Benjamin Smith","subject":"whitewashed stepped lane with cafe tables in an old Puglia town, portrait","tags":["cafe terrace","whitewashed","steps","ostuni","italy","mediterranean","restaurant","travel","summer"],"cat":"travel","tone":"light","temp":"warm","people":"none","q":2},{"id":"Newlyn old harbour pier July 2026 01.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/1/17/Newlyn_old_harbour_pier_July_2026_01.jpg","page":"https://commons.wikimedia.org/wiki/File:Newlyn_old_harbour_pier_July_2026_01.jpg","w":7891,"h":5918,"color":"#8c8273","license":"CC BY-SA 4.0","author":"ArildV","subject":"Cornish fishing harbour with its old pier and town in soft evening light","tags":["harbour","cornwall","fishing","pier","england","british","coast","evening","town"],"cat":"travel","tone":"mid","temp":"warm","people":"none","q":3},{"id":"Ada Bridge pylon (Sava river, Belgrade).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/d/de/Ada_Bridge_pylon_%28Sava_river%2C_Belgrade%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Ada_Bridge_pylon_(Sava_river,_Belgrade).jpg","w":4608,"h":3456,"color":"#3c3c3c","license":"CC BY-SA 4.0","author":"Petar Milošević","subject":"concrete bridge pylon with fanned cables against a black night sky","tags":["bridge","pylon","cables","night","engineering","architecture","symmetry","infrastructure","abstract"],"cat":"architecture","tone":"dark","temp":"neutral","people":"none","q":3},{"id":"University of North Texas September 2015 40 (pedestrian bridge).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/7e/University_of_North_Texas_September_2015_40_%28pedestrian_bridge%29.jpg","page":"https://commons.wikimedia.org/wiki/File:University_of_North_Texas_September_2015_40_(pedestrian_bridge).jpg","w":5888,"h":3872,"color":"#686c72","license":"CC BY-SA 4.0","author":"Michael Barera","subject":"covered footbridge with striped shadows from a slatted roof","tags":["footbridge","bridge","shadows","stripes","perspective","campus","architecture","walkway","pattern"],"cat":"architecture","tone":"mid","temp":"neutral","people":"none","q":3},{"id":"Re 460 058-1 + IC 2000 St. Gallen, 2014 (1).JPG","file":"https://upload.wikimedia.org/wikipedia/commons/1/10/Re_460_058-1_%2B_IC_2000_St._Gallen%2C_2014_%281%29.JPG","page":"https://commons.wikimedia.org/wiki/File:Re_460_058-1_%2B_IC_2000_St._Gallen,_2014_(1).JPG","w":3776,"h":2520,"color":"#575f72","license":"CC BY-SA 4.0","author":"Bahnfrend","subject":"red train at a rainy station platform at blue hour","tags":["train","platform","railway station","rain","blue hour","switzerland","rail","commute","travel"],"cat":"travel","tone":"dark","temp":"cool","people":"none","q":3},{"id":"Jacobite on Glenfinnan Viaduct 2 20211024.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/1/11/Jacobite_on_Glenfinnan_Viaduct_2_20211024.jpg","page":"https://commons.wikimedia.org/wiki/File:Jacobite_on_Glenfinnan_Viaduct_2_20211024.jpg","w":4632,"h":3464,"color":"#746e56","license":"CC BY-SA 3.0","author":"Daniel Kraft","subject":"steam train trailing white smoke across a stone viaduct in the hills","tags":["steam train","viaduct","scotland","highlands","railway","heritage","travel","smoke","autumn"],"cat":"travel","tone":"mid","temp":"warm","people":"none","q":3,"fp":[0.55,0.55]},{"id":"Steam locomotive gear (JŽ 06-018; Slovenia).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/e5/Steam_locomotive_gear_%28J%C5%BD_06-018%3B_Slovenia%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Steam_locomotive_gear_(J%C5%BD_06-018;_Slovenia).jpg","w":2556,"h":1746,"color":"#615959","license":"CC BY-SA 4.0","author":"Petar Milošević","subject":"steam locomotive driving wheels and rods at a platform, black and white","tags":["steam locomotive","wheels","railway","platform","machinery","heritage","engineering","black and white"],"cat":"travel","tone":"mid","temp":"neutral","people":"none","q":3,"fp":[0.35,0.6]},{"id":"Akalla metro station August 2014 01.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/3/31/Akalla_metro_station_August_2014_01.jpg","page":"https://commons.wikimedia.org/wiki/File:Akalla_metro_station_August_2014_01.jpg","w":4831,"h":3200,"color":"#6a5f3c","license":"CC BY-SA 4.0","author":"Arild Vågen","subject":"blue metro train in a yellow rock cave station with a polished floor","tags":["metro","subway","station","stockholm","train","cave","underground","commute","platform"],"cat":"city","tone":"mid","temp":"warm","people":"none","q":3},{"id":"Munich subway station Westfriedhof.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/22/Munich_subway_station_Westfriedhof.jpg","page":"https://commons.wikimedia.org/wiki/File:Munich_subway_station_Westfriedhof.jpg","w":3940,"h":1737,"color":"#413c53","license":"CC BY-SA 3.0","author":"Martin Falbisoner","subject":"metro platform under giant domed lamps with blue walls and a blurred train","tags":["metro","subway","platform","munich","lamps","underground","commute","train","design"],"cat":"city","tone":"dark","temp":"cool","people":"none","q":3},{"id":"Rådhuset underground metro station Stockholm 2016 01b.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/0/01/R%C3%A5dhuset_underground_metro_station_Stockholm_2016_01b.jpg","page":"https://commons.wikimedia.org/wiki/File:R%C3%A5dhuset_underground_metro_station_Stockholm_2016_01b.jpg","w":8192,"h":3594,"color":"#834f3f","license":"CC BY 4.0","author":"Julian Herzog (Website)","subject":"metro platform carved into raw red rock with escalators beyond","tags":["metro","subway","station","stockholm","underground","rock","escalator","architecture","commute"],"cat":"city","tone":"mid","temp":"warm","people":"none","q":3},{"id":"T-Centralen central underground metro station Stockholm 2016 01.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/5/5c/T-Centralen_central_underground_metro_station_Stockholm_2016_01.jpg","page":"https://commons.wikimedia.org/wiki/File:T-Centralen_central_underground_metro_station_Stockholm_2016_01.jpg","w":4096,"h":2607,"color":"#455a77","license":"CC BY 4.0","author":"Julian Herzog (Website)","subject":"metro train blurring past blue painted cave walls","tags":["metro","subway","train","motion blur","stockholm","underground","commute","platform","blue"],"cat":"city","tone":"mid","temp":"cool","people":"none","q":3},{"id":"Man at Dundas subway station, Toronto, 2008-05-06.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/e0/Man_at_Dundas_subway_station%2C_Toronto%2C_2008-05-06.jpg","page":"https://commons.wikimedia.org/wiki/File:Man_at_Dundas_subway_station,_Toronto,_2008-05-06.jpg","w":1452,"h":1927,"color":"#999999","license":"CC BY-SA 4.0","author":"Radomianin","subject":"lone man in a long coat on a metro platform as a train blurs past, black and white","tags":["metro","subway","platform","commuter","motion blur","underground","black and white","city","train"],"cat":"city","tone":"mid","temp":"neutral","people":"figure","q":3,"fp":[0.68,0.55]},{"id":"Tram in Kärntner Ring, at twilight (Vienna, Austria).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/f8/Tram_in_K%C3%A4rntner_Ring%2C_at_twilight_%28Vienna%2C_Austria%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Tram_in_K%C3%A4rntner_Ring,_at_twilight_(Vienna,_Austria).jpg","w":3716,"h":5635,"color":"#423233","license":"CC BY-SA 4.0","author":"Jules Verne Times Two","subject":"tram approaching on wet rails at twilight under an orange sky, portrait","tags":["tram","twilight","vienna","rails","street","city","commute","evening","public transport"],"cat":"city","tone":"dark","temp":"warm","people":"none","q":3},{"id":"Tram 28 at Largo de Santa Luzia in Lisbon, 20250606 1958 0419.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/a/ae/Tram_28_at_Largo_de_Santa_Luzia_in_Lisbon%2C_20250606_1958_0419.jpg","page":"https://commons.wikimedia.org/wiki/File:Tram_28_at_Largo_de_Santa_Luzia_in_Lisbon,_20250606_1958_0419.jpg","w":2391,"h":3583,"color":"#8c807d","license":"CC BY 4.0","author":"Jakub Hałun","subject":"yellow vintage tram climbing a cobbled Lisbon street, portrait","tags":["tram","lisbon","portugal","yellow","cobblestones","street","travel","vintage","city break"],"cat":"travel","tone":"mid","temp":"warm","people":"figure","q":3},{"id":"Omotesando Avenue at sunset from pedestrian bridge, Jingumae, Shibuya, Tokyo.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/c/cc/Omotesando_Avenue_at_sunset_from_pedestrian_bridge%2C_Jingumae%2C_Shibuya%2C_Tokyo.jpg","page":"https://commons.wikimedia.org/wiki/File:Omotesando_Avenue_at_sunset_from_pedestrian_bridge,_Jingumae,_Shibuya,_Tokyo.jpg","w":6240,"h":4160,"color":"#37383b","license":"CC BY 4.0","author":"gog.creator","subject":"tree-lined avenue packed with traffic at sunset seen from a footbridge","tags":["traffic","avenue","tokyo","sunset","cars","city","commute","rush hour","trees"],"cat":"city","tone":"mid","temp":"warm","people":"none","q":3},{"id":"Kowloon Waterfront, Hong Kong, 2013-08-09, DD 05.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/c/ca/Kowloon_Waterfront%2C_Hong_Kong%2C_2013-08-09%2C_DD_05.jpg","page":"https://commons.wikimedia.org/wiki/File:Kowloon_Waterfront,_Hong_Kong,_2013-08-09,_DD_05.jpg","w":5261,"h":3446,"color":"#6e7485","license":"CC BY-SA 3.0","author":"Diego Delso","subject":"rank of red taxis waiting in front of Hong Kong towers","tags":["taxi","hong kong","traffic","city","skyline","transport","street","red","travel"],"cat":"city","tone":"light","temp":"cool","people":"none","q":2},{"id":"Cycling Amsterdam 03.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/0/04/Cycling_Amsterdam_03.jpg","page":"https://commons.wikimedia.org/wiki/File:Cycling_Amsterdam_03.jpg","w":2265,"h":1500,"color":"#7f7f7f","license":"CC BY-SA 4.0","author":"Alfredo Borba","subject":"woman cycling past a brick facade, black and white","tags":["cyclist","bicycle","amsterdam","street","city","commute","black and white","urban","mobility"],"cat":"city","tone":"mid","temp":"neutral","people":"figure","q":3},{"id":"วัดพระศรีรัตนศาสดาราม 8 (edited).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/d/d3/%E0%B8%A7%E0%B8%B1%E0%B8%94%E0%B8%9E%E0%B8%A3%E0%B8%B0%E0%B8%A8%E0%B8%A3%E0%B8%B5%E0%B8%A3%E0%B8%B1%E0%B8%95%E0%B8%99%E0%B8%A8%E0%B8%B2%E0%B8%AA%E0%B8%94%E0%B8%B2%E0%B8%A3%E0%B8%B2%E0%B8%A1_8_%28edited%29.jpg","page":"https://commons.wikimedia.org/wiki/File:%E0%B8%A7%E0%B8%B1%E0%B8%94%E0%B8%9E%E0%B8%A3%E0%B8%B0%E0%B8%A8%E0%B8%A3%E0%B8%B5%E0%B8%A3%E0%B8%B1%E0%B8%95%E0%B8%99%E0%B8%A8%E0%B8%B2%E0%B8%AA%E0%B8%94%E0%B8%B2%E0%B8%A3%E0%B8%B2%E0%B8%A1_8_(edited).jpg","w":3133,"h":4034,"color":"#c0c0b5","license":"CC BY-SA 4.0","author":"Kriengsak Jirasirirojanakorn","subject":"cyclist riding below a long white temple wall and gilded spires, portrait","tags":["cyclist","bicycle","bangkok","temple","street","travel","thailand","city","wall"],"cat":"travel","tone":"light","temp":"warm","people":"figure","q":3,"fp":[0.45,0.85]},{"id":"Holmens Kanal Cyclists (15325678721).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/6/68/Holmens_Kanal_Cyclists_%2815325678721%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Holmens_Kanal_Cyclists_(15325678721).jpg","w":5760,"h":3718,"color":"#918e8d","license":"CC BY 2.0","author":"Tony Webster from Portland, Oregon, United States","subject":"commuters cycling across a wide city junction with a blue bike lane","tags":["cyclists","bike lane","copenhagen","commute","city","junction","mobility","urban","street"],"cat":"city","tone":"light","temp":"cool","people":"figure","q":3},{"id":"Cyclist Edinburgh.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/2c/Cyclist_Edinburgh.jpg","page":"https://commons.wikimedia.org/wiki/File:Cyclist_Edinburgh.jpg","w":2592,"h":1944,"color":"#8b7e7a","license":"CC BY 2.0","author":"John Wigham","subject":"cyclist with a backpack riding past blurred city traffic","tags":["cyclist","bicycle","commute","motion blur","traffic","city","urban","mobility","street"],"cat":"city","tone":"mid","temp":"neutral","people":"figure","q":3},{"id":"Havneholmen winter cycling Cykelslangen 2.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/90/Havneholmen_winter_cycling_Cykelslangen_2.jpg","page":"https://commons.wikimedia.org/wiki/File:Havneholmen_winter_cycling_Cykelslangen_2.jpg","w":5000,"h":3320,"color":"#8d8286","license":"CC BY-SA 4.0","author":"kallerna","subject":"cyclists crossing a curved bike bridge above a harbour at dusk","tags":["cyclists","bike bridge","copenhagen","harbour","dusk","commute","city","waterfront","mobility"],"cat":"city","tone":"mid","temp":"warm","people":"figure","q":3,"fp":[0.3,0.45]},{"id":"Christiania Winter - Cycling in Winter in Copenhagen (3296897865).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/c/cb/Christiania_Winter_-_Cycling_in_Winter_in_Copenhagen_%283296897865%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Christiania_Winter_-_Cycling_in_Winter_in_Copenhagen_(3296897865).jpg","w":2945,"h":1875,"color":"#7a7a7d","license":"CC0","author":"Mikael Colville-Andersen from Copenhagen, Denmark","subject":"parent riding a cargo bike with a child along a snowy street","tags":["cargo bike","cyclist","family","snow","winter","city","commute","copenhagen","street"],"cat":"city","tone":"light","temp":"cool","people":"figure","q":2,"fp":[0.4,0.6]},{"id":"KeizersgrachtReguliersgrachtAmsterdam.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/be/KeizersgrachtReguliersgrachtAmsterdam.jpg","page":"https://commons.wikimedia.org/wiki/File:KeizersgrachtReguliersgrachtAmsterdam.jpg","w":3456,"h":2304,"color":"#504140","license":"CC BY-SA 3.0","author":"Massimo Catarinella","subject":"canal bridges outlined with lights at dusk in Amsterdam","tags":["canal","bridges","amsterdam","dusk","lights","netherlands","evening","city break","reflection"],"cat":"city","tone":"dark","temp":"warm","people":"none","q":3},{"id":"Prague skyline at dawn.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/2c/Prague_skyline_at_dawn.jpg","page":"https://commons.wikimedia.org/wiki/File:Prague_skyline_at_dawn.jpg","w":4326,"h":2618,"color":"#3f2e2a","license":"CC BY-SA 4.0","author":"Petar Milošević","subject":"silhouetted spires and street lamps of Prague against an orange dawn sky","tags":["prague","skyline","silhouette","dawn","spires","city","europe","travel","lamps"],"cat":"city","tone":"dark","temp":"warm","people":"none","q":3},{"id":"Midtown Manhattan from Jersey City September 2020 HDR.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/77/Midtown_Manhattan_from_Jersey_City_September_2020_HDR.jpg","page":"https://commons.wikimedia.org/wiki/File:Midtown_Manhattan_from_Jersey_City_September_2020_HDR.jpg","w":4000,"h":6000,"color":"#53525d","license":"CC BY-SA 4.0","author":"King of Hearts","subject":"Empire State Building lit in fog above a pier at night, portrait","tags":["new york","skyline","empire state","fog","night","pier","city","manhattan","moody"],"cat":"city","tone":"dark","temp":"cool","people":"none","q":3},{"id":"Rooftops in Phra Nakhon.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/7b/Rooftops_in_Phra_Nakhon.jpg","page":"https://commons.wikimedia.org/wiki/File:Rooftops_in_Phra_Nakhon.jpg","w":7952,"h":5304,"color":"#726051","license":"CC BY-SA 4.0","author":"Satdeep Gill","subject":"terracotta temple roofs and trees seen from above in Bangkok","tags":["rooftops","bangkok","thailand","roofs","temple","aerial","city","travel","terracotta"],"cat":"city","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Paris - Rooftops in Paris - 3052.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/d/d9/Paris_-_Rooftops_in_Paris_-_3052.jpg","page":"https://commons.wikimedia.org/wiki/File:Paris_-_Rooftops_in_Paris_-_3052.jpg","w":4368,"h":2602,"color":"#626b79","license":"CC BY-SA 3.0","author":"Jorge Royan","subject":"Paris dormer window and chimney pots against a deep blue sky","tags":["rooftops","paris","chimney pots","dormer","zinc roof","france","architecture","city","sky"],"cat":"architecture","tone":"mid","temp":"cool","people":"none","q":2},{"id":"Washington Dulles International Airport at Dusk.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/92/Washington_Dulles_International_Airport_at_Dusk.jpg","page":"https://commons.wikimedia.org/wiki/File:Washington_Dulles_International_Airport_at_Dusk.jpg","w":2750,"h":1633,"color":"#344b7b","license":"CC BY-SA 3.0","author":"Joe Ravi","subject":"airport terminal with a swooping roof and control tower at dusk, light trails","tags":["airport","terminal","dusk","control tower","light trails","travel","aviation","architecture"],"cat":"travel","tone":"dark","temp":"cool","people":"none","q":3},{"id":"Tocumen International Airport alt.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/40/Tocumen_International_Airport_alt.jpg","page":"https://commons.wikimedia.org/wiki/File:Tocumen_International_Airport_alt.jpg","w":3070,"h":4011,"color":"#525252","license":"CC0","author":"Wilfredor","subject":"traveller with a suitcase walking down a jet bridge, black and white, portrait","tags":["airport","jet bridge","traveller","suitcase","travel","boarding","black and white","departure"],"cat":"travel","tone":"mid","temp":"neutral","people":"figure","q":3,"fp":[0.55,0.55]},{"id":"Embraer 190 - Wing and winglet at sunset.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/8/8c/Embraer_190_-_Wing_and_winglet_at_sunset.jpg","page":"https://commons.wikimedia.org/wiki/File:Embraer_190_-_Wing_and_winglet_at_sunset.jpg","w":5184,"h":3456,"color":"#77736d","license":"CC BY-SA 3.0","author":"PierreSelim","subject":"aeroplane wing over farmland in hazy golden evening light","tags":["plane window","wing","flight","travel","aviation","sunset","landscape","holiday","aerial"],"cat":"travel","tone":"mid","temp":"warm","people":"none","q":3},{"id":"Cumulus clouds as seen from an airplane.JPG","file":"https://upload.wikimedia.org/wikipedia/commons/3/3f/Cumulus_clouds_as_seen_from_an_airplane.JPG","page":"https://commons.wikimedia.org/wiki/File:Cumulus_clouds_as_seen_from_an_airplane.JPG","w":2256,"h":1504,"color":"#8595a5","license":"CC BY-SA 3.0","author":"Jakec","subject":"sea of clouds and blue horizon seen from an aeroplane","tags":["clouds","flight","plane window","sky","travel","horizon","aviation","calm","aerial"],"cat":"travel","tone":"light","temp":"cool","people":"none","q":2},{"id":"Utah State Route 24, Near Mile 92 view in Direction North-West 110814 2.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/3/37/Utah_State_Route_24%2C_Near_Mile_92_view_in_Direction_North-West_110814_2.jpg","page":"https://commons.wikimedia.org/wiki/File:Utah_State_Route_24,_Near_Mile_92_view_in_Direction_North-West_110814_2.jpg","w":3199,"h":2125,"color":"#9c998c","license":"CC BY-SA 3.0","author":"DXR","subject":"empty highway curving through desert cliffs and scrub","tags":["road trip","highway","desert","utah","road","usa","travel","open road","adventure"],"cat":"landscape","tone":"light","temp":"neutral","people":"none","q":3},{"id":"מכתש רמון - גלישת עננים (cropped).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/0/03/%D7%9E%D7%9B%D7%AA%D7%A9_%D7%A8%D7%9E%D7%95%D7%9F_-_%D7%92%D7%9C%D7%99%D7%A9%D7%AA_%D7%A2%D7%A0%D7%A0%D7%99%D7%9D_%28cropped%29.jpg","page":"https://commons.wikimedia.org/wiki/File:%D7%9E%D7%9B%D7%AA%D7%A9_%D7%A8%D7%9E%D7%95%D7%9F_-_%D7%92%D7%9C%D7%99%D7%A9%D7%AA_%D7%A2%D7%A0%D7%A0%D7%99%D7%9D_(cropped).jpg","w":3604,"h":2240,"color":"#726a60","license":"CC BY-SA 4.0","author":"ZeevStein","subject":"serpentine road climbing a crater cliff with clouds spilling over","tags":["road","serpentine","desert","clouds","aerial","road trip","adventure","mountains","travel"],"cat":"landscape","tone":"mid","temp":"neutral","people":"none","q":3},{"id":"Sunset Agta Beach Resort - Biliran Philippines.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/9a/Sunset_Agta_Beach_Resort_-_Biliran_Philippines.jpg","page":"https://commons.wikimedia.org/wiki/File:Sunset_Agta_Beach_Resort_-_Biliran_Philippines.jpg","w":2030,"h":1523,"color":"#7e573a","license":"CC BY-SA 3.0","author":"Leodb","subject":"figures wading on a tidal flat silhouetted against an orange sunset","tags":["beach","sunset","silhouette","seaside","tide","philippines","holiday","travel","calm"],"cat":"travel","tone":"dark","temp":"warm","people":"figure","q":3,"fp":[0.45,0.7]},{"id":"Cabines de bain Berck.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/41/Cabines_de_bain_Berck.jpg","page":"https://commons.wikimedia.org/wiki/File:Cabines_de_bain_Berck.jpg","w":4844,"h":3175,"color":"#97a9af","license":"CC BY-SA 3.0","author":"Gzzz","subject":"pastel beach huts half buried in sand under a blue sky","tags":["beach huts","seaside","beach","france","pastel","summer","holiday","sand","coast"],"cat":"travel","tone":"light","temp":"cool","people":"none","q":3},{"id":"Beach huts at Wells-next-the-Sea.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/3/3c/Beach_huts_at_Wells-next-the-Sea.jpg","page":"https://commons.wikimedia.org/wiki/File:Beach_huts_at_Wells-next-the-Sea.jpg","w":4776,"h":2978,"color":"#696d65","license":"CC BY-SA 4.0","author":"DeFacto","subject":"three painted beach huts on stilts against green pines","tags":["beach huts","seaside","norfolk","england","british","holiday","summer","coast","colourful"],"cat":"travel","tone":"light","temp":"cool","people":"none","q":3},{"id":"Beach-Please-2022-crowd-stage-lights-night-performance.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/8/85/Beach-Please-2022-crowd-stage-lights-night-performance.jpg","page":"https://commons.wikimedia.org/wiki/File:Beach-Please-2022-crowd-stage-lights-night-performance.jpg","w":6016,"h":4016,"color":"#875caf","license":"CC BY-SA 4.0","author":"PinkBeachPlanet","subject":"festival stage light beams over a big crowd at night","tags":["concert","festival","stage lights","crowd","night","music","live music","lasers","event"],"cat":"event","tone":"dark","temp":"cool","people":"figure","q":3},{"id":"Ansambel SkaMeika´.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/2f/Ansambel_SkaMeika%C2%B4.jpg","page":"https://commons.wikimedia.org/wiki/File:Ansambel_SkaMeika%C2%B4.jpg","w":5760,"h":2880,"color":"#614c39","license":"CC BY-SA 4.0","author":"Enel Lepik","subject":"shadows of a band and horn players projected on a lit screen","tags":["band","brass","shadows","silhouette","music","stage","concert","live music","event"],"cat":"event","tone":"dark","temp":"warm","people":"figure","q":3},{"id":"Kratzen at Puch Open Air 2024 02.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/4f/Kratzen_at_Puch_Open_Air_2024_02.jpg","page":"https://commons.wikimedia.org/wiki/File:Kratzen_at_Puch_Open_Air_2024_02.jpg","w":5472,"h":3648,"color":"#174b73","license":"CC BY-SA 4.0","author":"Kritzolina","subject":"bassist and keyboard player performing under blue stage lights","tags":["band","stage","bass guitar","concert","blue lights","live music","festival","musician"],"cat":"event","tone":"dark","temp":"cool","people":"face","q":2},{"id":"Brown campsite, Reading Festival 2017 - geograph.org.uk - 7428069.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/70/Brown_campsite%2C_Reading_Festival_2017_-_geograph.org.uk_-_7428069.jpg","page":"https://commons.wikimedia.org/wiki/File:Brown_campsite,_Reading_Festival_2017_-_geograph.org.uk_-_7428069.jpg","w":4032,"h":3024,"color":"#787263","license":"CC BY-SA 2.0","author":"Bryn Holmes","subject":"sun rising over a dense field of festival tents","tags":["festival","campsite","tents","sunrise","field","summer","camping","music festival","crowd"],"cat":"event","tone":"mid","temp":"warm","people":"none","q":3,"fp":[0.6,0.3]},{"id":"Don Quijote in Teatro Teresa Carreño.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/e9/Don_Quijote_in_Teatro_Teresa_Carre%C3%B1o.jpg","page":"https://commons.wikimedia.org/wiki/File:Don_Quijote_in_Teatro_Teresa_Carre%C3%B1o.jpg","w":2500,"h":1639,"color":"#171332","license":"CC0","author":"Wilfredor","subject":"ballet dancer leaping on stage with the corps de ballet and painted set","tags":["ballet","theatre","stage","dancer","performance","arts","culture","dance","show"],"cat":"event","tone":"dark","temp":"cool","people":"figure","q":3},{"id":"783 3 (+ 3) dancers performing on stage V-P.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/b5/783_3_%28%2B_3%29_dancers_performing_on_stage_V-P.jpg","page":"https://commons.wikimedia.org/wiki/File:783_3_(%2B_3)_dancers_performing_on_stage_V-P.jpg","w":6280,"h":4187,"color":"#68263d","license":"CC BY-SA 4.0","author":"Virtual-Pano","subject":"dancers silhouetted against red, blue and yellow light circles on stage","tags":["dance","stage","silhouettes","theatre","performance","lights","show","colour","arts"],"cat":"event","tone":"dark","temp":"warm","people":"figure","q":3},{"id":"En attendant Godot, Festival d'Avignon, 1978 f22.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/2b/En_attendant_Godot%2C_Festival_d%27Avignon%2C_1978_f22.jpg","page":"https://commons.wikimedia.org/wiki/File:En_attendant_Godot,_Festival_d%27Avignon,_1978_f22.jpg","w":4504,"h":3283,"color":"#100c0a","license":"CC0","author":"Fernand Michaud","subject":"two actors in dark costume on a black stage, black and white","tags":["theatre","actors","stage","drama","performance","black and white","play","culture","festival"],"cat":"event","tone":"dark","temp":"neutral","people":"face","q":3},{"id":"Tianjin Grand Theater Concert Hall.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/d/df/Tianjin_Grand_Theater_Concert_Hall.jpg","page":"https://commons.wikimedia.org/wiki/File:Tianjin_Grand_Theater_Concert_Hall.jpg","w":3533,"h":2199,"color":"#534739","license":"CC BY-SA 3.0","author":"北京驱动文化传媒有限公司","subject":"modern concert hall with tiered wooden seating in a curved auditorium","tags":["auditorium","concert hall","conference","seating","wood","interior","architecture","venue"],"cat":"interior","tone":"mid","temp":"warm","people":"none","q":3},{"id":"Auditorio de Tenerife, Santa Cruz de Tenerife, España, 2012-12-15, DD 24.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/f2/Auditorio_de_Tenerife%2C_Santa_Cruz_de_Tenerife%2C_Espa%C3%B1a%2C_2012-12-15%2C_DD_24.jpg","page":"https://commons.wikimedia.org/wiki/File:Auditorio_de_Tenerife,_Santa_Cruz_de_Tenerife,_Espa%C3%B1a,_2012-12-15,_DD_24.jpg","w":4529,"h":2677,"color":"#2e2b29","license":"CC BY-SA 3.0","author":"Diego Delso","subject":"white curved concert hall roof lit at night beside the sea","tags":["concert hall","auditorium","tenerife","night","architecture","venue","modern","culture"],"cat":"architecture","tone":"dark","temp":"cool","people":"none","q":3},{"id":"Visitors of Louvre and Nike of Samothrace.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/f2/Visitors_of_Louvre_and_Nike_of_Samothrace.jpg","page":"https://commons.wikimedia.org/wiki/File:Visitors_of_Louvre_and_Nike_of_Samothrace.jpg","w":8681,"h":8813,"color":"#595440","license":"CC0","author":"Wilfredor","subject":"grand museum staircase with a winged statue and visitors, portrait","tags":["museum","louvre","paris","staircase","statue","gallery","visitors","art","culture"],"cat":"interior","tone":"mid","temp":"warm","people":"figure","q":3},{"id":"001 2011 10 02 Einsamkeit.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/4d/001_2011_10_02_Einsamkeit.jpg","page":"https://commons.wikimedia.org/wiki/File:001_2011_10_02_Einsamkeit.jpg","w":3149,"h":1905,"color":"#9f9787","license":"CC BY-SA 4.0","author":"Friedrich Haag","subject":"white gallery room with framed photographs and a lone visitor","tags":["gallery","exhibition","museum","white walls","photographs","art","visitor","culture","interior"],"cat":"interior","tone":"light","temp":"neutral","people":"figure","q":3,"fp":[0.08,0.75]},{"id":"Football ultras.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/ee/Football_ultras.jpg","page":"https://commons.wikimedia.org/wiki/File:Football_ultras.jpg","w":3888,"h":2592,"color":"#727372","license":"CC BY 4.0","author":"Biso","subject":"football ultras silhouetted in flare smoke","tags":["football","fans","ultras","smoke","flares","crowd","sports","stadium","atmosphere"],"cat":"sport","tone":"mid","temp":"neutral","people":"figure","q":3},{"id":"Stage 20 Tour de France 2024 Col de la Couillole 40.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/79/Stage_20_Tour_de_France_2024_Col_de_la_Couillole_40.jpg","page":"https://commons.wikimedia.org/wiki/File:Stage_20_Tour_de_France_2024_Col_de_la_Couillole_40.jpg","w":4600,"h":3425,"color":"#817370","license":"CC BY-SA 4.0","author":"kallerna","subject":"racing cyclists passing a cheering roadside crowd in the mountains","tags":["cycling","race","tour de france","crowd","fans","sports","mountains","road","event"],"cat":"sport","tone":"mid","temp":"warm","people":"figure","q":2},{"id":"Oriental hanging lanterns. Souk Haddadine, Marrakech Medina, Morocco.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/d/d0/Oriental_hanging_lanterns._Souk_Haddadine%2C_Marrakech_Medina%2C_Morocco.jpg","page":"https://commons.wikimedia.org/wiki/File:Oriental_hanging_lanterns._Souk_Haddadine,_Marrakech_Medina,_Morocco.jpg","w":3331,"h":4665,"color":"#5a381b","license":"CC BY-SA 4.0","author":"Petar Milošević","subject":"metal lanterns glowing in a dark souk, portrait","tags":["lanterns","souk","marrakech","morocco","market","night","crafts","travel","glow"],"cat":"travel","tone":"dark","temp":"warm","people":"none","q":3},{"id":"Fireworks over Ponte Vecchio.JPG","file":"https://upload.wikimedia.org/wikipedia/commons/1/1d/Fireworks_over_Ponte_Vecchio.JPG","page":"https://commons.wikimedia.org/wiki/File:Fireworks_over_Ponte_Vecchio.JPG","w":4719,"h":3122,"color":"#3a2d20","license":"CC BY-SA 3.0","author":"Martin Falbisoner","subject":"fireworks above the Ponte Vecchio reflected in the Arno at night","tags":["fireworks","florence","bridge","night","reflection","celebration","river","italy","festival"],"cat":"event","tone":"dark","temp":"warm","people":"none","q":3},{"id":"Fireworks lugano 2011-2.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/1/17/Fireworks_lugano_2011-2.jpg","page":"https://commons.wikimedia.org/wiki/File:Fireworks_lugano_2011-2.jpg","w":2494,"h":3740,"color":"#883249","license":"CC BY-SA 4.0","author":"Philippe Moret","subject":"pink fireworks over a lake with a magenta reflection, portrait","tags":["fireworks","lake","night","celebration","pink","reflection","festival","new year"],"cat":"event","tone":"dark","temp":"warm","people":"none","q":3},{"id":"Grnčarska radionica.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/8/84/Grn%C4%8Darska_radionica.jpg","page":"https://commons.wikimedia.org/wiki/File:Grn%C4%8Darska_radionica.jpg","w":3209,"h":2222,"color":"#353535","license":"CC BY-SA 4.0","author":"Maja1407","subject":"old potter shaping a clay pot by hand in a cluttered workshop, black and white","tags":["potter","pottery","clay","ceramics","workshop","handmade","studio","craft","black and white","artisan"],"cat":"craft","tone":"dark","temp":"neutral","people":"figure","q":3,"fp":[0.55,0.4]},{"id":"Haltern am See, Sythen, Quarzwerke, Werkzeug in der Werkzeughalle -- 2014 -- 4059.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/92/Haltern_am_See%2C_Sythen%2C_Quarzwerke%2C_Werkzeug_in_der_Werkzeughalle_--_2014_--_4059.jpg","page":"https://commons.wikimedia.org/wiki/File:Haltern_am_See,_Sythen,_Quarzwerke,_Werkzeug_in_der_Werkzeughalle_--_2014_--_4059.jpg","w":5181,"h":2875,"color":"#53483c","license":"CC BY-SA 4.0","author":"Dietmar Rabich","subject":"steel lathe centres and tool bits piled in a worn metal tray against a rusted wall","tags":["tools","machine shop","lathe","steel","metalwork","workshop","industrial","engineering","texture","tray"],"cat":"object","tone":"mid","temp":"warm","people":"none","q":2,"fp":[0.45,0.5]},{"id":"Haltern am See, Sythen, Werkzeughalle der Quarzwerke -- 2015 -- 01117.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/8/83/Haltern_am_See%2C_Sythen%2C_Werkzeughalle_der_Quarzwerke_--_2015_--_01117.jpg","page":"https://commons.wikimedia.org/wiki/File:Haltern_am_See,_Sythen,_Werkzeughalle_der_Quarzwerke_--_2015_--_01117.jpg","w":4420,"h":2915,"color":"#666359","license":"CC BY-SA 4.0","author":"Dietmar Rabich","subject":"four worn grinding wheels hanging on hooks from a steel rail in a workshop","tags":["grinding wheels","workshop","tools","metalwork","industrial","steel","hooks","machine shop","engineering","rust"],"cat":"object","tone":"mid","temp":"neutral","people":"none","q":2},{"id":"Carpenter-tools Beveled-edge-chisel-two-angle-gauges-and-carpenters-pencil-01.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/28/Carpenter-tools_Beveled-edge-chisel-two-angle-gauges-and-carpenters-pencil-01.jpg","page":"https://commons.wikimedia.org/wiki/File:Carpenter-tools_Beveled-edge-chisel-two-angle-gauges-and-carpenters-pencil-01.jpg","w":5621,"h":3753,"color":"#c6bab2","license":"CC BY-SA 3.0","author":"CEphoto, Uwe Aranas","subject":"wooden chisel, two try squares and a red carpenter's pencil on a pale grey surface","tags":["carpentry","chisel","try square","pencil","woodworking","hand tools","joinery","still life","joiner","tools"],"cat":"object","tone":"light","temp":"neutral","people":"none","q":2},{"id":"Hallstadt Bahnhof ABS Nürnberg-Ebensfeld-20210328-RM-111554.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/46/Hallstadt_Bahnhof_ABS_N%C3%BCrnberg-Ebensfeld-20210328-RM-111554.jpg","page":"https://commons.wikimedia.org/wiki/File:Hallstadt_Bahnhof_ABS_N%C3%BCrnberg-Ebensfeld-20210328-RM-111554.jpg","w":5184,"h":3888,"color":"#6d5c4d","license":"CC BY-SA 4.0","author":"Ermell","subject":"yellow excavator breaker hammering a concrete block in a dusty construction pit","tags":["construction","excavator","demolition","concrete","building site","builders","machinery","civil engineering","dust","infrastructure"],"cat":"work","tone":"mid","temp":"warm","people":"none","q":2,"fp":[0.5,0.6]},{"id":"Brooklyn Glass (32606)a.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/9c/Brooklyn_Glass_%2832606%29a.jpg","page":"https://commons.wikimedia.org/wiki/File:Brooklyn_Glass_(32606)a.jpg","w":3567,"h":2516,"color":"#53453c","license":"CC BY-SA 4.0","author":"Rhododendrites","subject":"glassblower seated at his bench turning a glowing gather beside two open furnaces","tags":["glassblowing","glass studio","furnace","hot glass","artisan","workshop","craft","glassmaker","fire","studio"],"cat":"craft","tone":"dark","temp":"warm","people":"figure","q":3,"fp":[0.35,0.5]},{"id":"Práce s navlhčeným svalákem (002).JPG","file":"https://upload.wikimedia.org/wikipedia/commons/3/32/Pr%C3%A1ce_s_navlh%C4%8Den%C3%BDm_sval%C3%A1kem_%28002%29.JPG","page":"https://commons.wikimedia.org/wiki/File:Pr%C3%A1ce_s_navlh%C4%8Den%C3%BDm_sval%C3%A1kem_(002).JPG","w":4416,"h":3312,"color":"#6d574b","license":"CC BY-SA 3.0","author":"Juan de Vojníkov","subject":"hands holding a blowpipe with a glowing orange glass gather over a wet wooden block","tags":["glassblowing","hot glass","blowpipe","hands","glowing","glassmaker","studio","craft","fire","artisan"],"cat":"craft","tone":"mid","temp":"warm","people":"hands","q":3,"fp":[0.4,0.6]},{"id":"Rainbow yarn for knitting, display in front of a needlework shop in Graz, Austria, GW23-100.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/42/Rainbow_yarn_for_knitting%2C_display_in_front_of_a_needlework_shop_in_Graz%2C_Austria%2C_GW23-100.jpg","page":"https://commons.wikimedia.org/wiki/File:Rainbow_yarn_for_knitting,_display_in_front_of_a_needlework_shop_in_Graz,_Austria,_GW23-100.jpg","w":5472,"h":3648,"color":"#633549","license":"CC BY-SA 4.0","author":"Lusi Lindwurm","subject":"tightly packed cakes of rainbow gradient yarn seen from the front","tags":["yarn","wool","knitting","colourful","rainbow","haberdashery","craft shop","texture","textiles","pattern"],"cat":"craft","tone":"mid","temp":"warm","people":"none","q":3},{"id":"Oma strickt Strümpfe.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/0/02/Oma_strickt_Str%C3%BCmpfe.jpg","page":"https://commons.wikimedia.org/wiki/File:Oma_strickt_Str%C3%BCmpfe.jpg","w":3000,"h":2000,"color":"#6e5d54","license":"CC BY-SA 4.0","author":"Sadarama","subject":"close-up of weathered hands knitting a teal sock on four steel needles","tags":["knitting","hands","wool","yarn","needles","sock","handmade","craft","elderly","cosy"],"cat":"craft","tone":"mid","temp":"warm","people":"hands","q":3,"fp":[0.5,0.45]},{"id":"Bobines fil Rouffignac.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/8/81/Bobines_fil_Rouffignac.jpg","page":"https://commons.wikimedia.org/wiki/File:Bobines_fil_Rouffignac.jpg","w":4427,"h":3056,"color":"#7e4d46","license":"CC0","author":"Jebulon","subject":"balls of bright cotton thread in orange, purple, pink and blue packed together","tags":["thread","cotton","yarn","colourful","crochet","haberdashery","craft","textiles","pattern","embroidery"],"cat":"craft","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Red thread (yarn).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/93/Red_thread_%28yarn%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Red_thread_(yarn).jpg","w":3500,"h":2400,"color":"#a97770","license":"CC BY 4.0","author":"多多123","subject":"single spool of deep red thread on a pale cream background","tags":["thread","spool","red","sewing","tailor","haberdashery","still life","minimal","textiles","craft"],"cat":"object","tone":"light","temp":"warm","people":"none","q":2},{"id":"Bhura Singh, Tailor from Rampura Jawaharwala, Punjab, India 01.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/d/d5/Bhura_Singh%2C_Tailor_from_Rampura_Jawaharwala%2C_Punjab%2C_India_01.jpg","page":"https://commons.wikimedia.org/wiki/File:Bhura_Singh,_Tailor_from_Rampura_Jawaharwala,_Punjab,_India_01.jpg","w":3981,"h":3981,"color":"#a69074","license":"CC BY-SA 4.0","author":"Gurdeepdali","subject":"tailor in a turban at a treadle sewing machine before yellow and orange curtains","tags":["tailor","sewing machine","treadle","fabric","punjab","workshop","artisan","clothing","portrait","craft"],"cat":"craft","tone":"mid","temp":"warm","people":"face","q":3,"fp":[0.5,0.45]},{"id":"Woman sewing a face mask with a Singer machine 14.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/5/5f/Woman_sewing_a_face_mask_with_a_Singer_machine_14.jpg","page":"https://commons.wikimedia.org/wiki/File:Woman_sewing_a_face_mask_with_a_Singer_machine_14.jpg","w":5616,"h":3744,"color":"#382316","license":"CC BY-SA 4.0","author":"Tadeáš Bednarz","subject":"hands guiding white cotton under a sewing machine needle in a pool of warm lamp light","tags":["sewing","sewing machine","hands","fabric","tailor","dressmaker","studio","textiles","handmade","atelier"],"cat":"craft","tone":"dark","temp":"warm","people":"hands","q":3,"fp":[0.5,0.55]},{"id":"Confection d'une ceinture en cuir avec des pochette pour \"Baye Fall\" par un artisan au village artisanal de Thiès. 4.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/c/c5/Confection_d%27une_ceinture_en_cuir_avec_des_pochette_pour_%22Baye_Fall%22_par_un_artisan_au_village_artisanal_de_Thi%C3%A8s._4.jpg","page":"https://commons.wikimedia.org/wiki/File:Confection_d%27une_ceinture_en_cuir_avec_des_pochette_pour_%22Baye_Fall%22_par_un_artisan_au_village_artisanal_de_Thi%C3%A8s._4.jpg","w":2448,"h":1620,"color":"#8e7e76","license":"CC BY-SA 4.0","author":"Thiam Babel Design","subject":"craftsman's hands cutting a strip of tan leather with a knife on a stone floor","tags":["leatherwork","leather","hands","cutting","knife","artisan","workshop","senegal","craft","handmade"],"cat":"craft","tone":"mid","temp":"warm","people":"hands","q":3,"fp":[0.45,0.5]},{"id":"Leather working tools (DSC08329).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/4b/Leather_working_tools_%28DSC08329%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Leather_working_tools_(DSC08329).jpg","w":6032,"h":4004,"color":"#9c7658","license":"CC BY 4.0","author":"Trougnouf (Benoit Brummer), Les cuirs d'Agathe","subject":"leather knife, mallet, shears, awl, buckle and thread spools laid on a wooden block","tags":["leatherwork","tools","mallet","round knife","awl","thread","saddlery","workshop","flat lay","craft"],"cat":"craft","tone":"mid","temp":"warm","people":"none","q":3},{"id":"Münster, Freilichtmuseum Mühlenhof, Schmiede -- 2018 -- 2170.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/22/M%C3%BCnster%2C_Freilichtmuseum_M%C3%BChlenhof%2C_Schmiede_--_2018_--_2170.jpg","page":"https://commons.wikimedia.org/wiki/File:M%C3%BCnster,_Freilichtmuseum_M%C3%BChlenhof,_Schmiede_--_2018_--_2170.jpg","w":6720,"h":4480,"color":"#777562","license":"CC BY-SA 4.0","author":"Dietmar Rabich","subject":"macro of a rusty cast iron gear wheel with moss in its teeth against soft green","tags":["gear","cog","iron","rust","machinery","mill","engineering","macro","metalwork","texture"],"cat":"texture","tone":"mid","temp":"warm","people":"none","q":2,"fp":[0.6,0.4]},{"id":"Erntezeit auf dem Dänischen Wohld.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/3/38/Erntezeit_auf_dem_D%C3%A4nischen_Wohld.jpg","page":"https://commons.wikimedia.org/wiki/File:Erntezeit_auf_dem_D%C3%A4nischen_Wohld.jpg","w":5341,"h":3000,"color":"#929281","license":"CC BY-SA 4.0","author":"Jörg Braukmann","subject":"golden harvested wheat field rolling down to a blue sea with a tractor far off","tags":["harvest","wheat","field","farm","farming","agriculture","stubble","coast","summer","countryside"],"cat":"landscape","tone":"light","temp":"warm","people":"none","q":3},{"id":"Fränkische Schweiz Getreideernte-20210821-RM-154445.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/b7/Fr%C3%A4nkische_Schweiz_Getreideernte-20210821-RM-154445.jpg","page":"https://commons.wikimedia.org/wiki/File:Fr%C3%A4nkische_Schweiz_Getreideernte-20210821-RM-154445.jpg","w":5184,"h":3888,"color":"#857a6a","license":"CC BY-SA 4.0","author":"Ermell","subject":"combine harvester unloading grain into a tractor trailer in a cloud of dust","tags":["harvest","combine harvester","tractor","grain","wheat","farming","agriculture","dust","field","summer"],"cat":"work","tone":"mid","temp":"warm","people":"none","q":3,"fp":[0.55,0.55]},{"id":"Fishing Boat Nets Sholayar Valparai Feb26 A7CR 10156.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/5/53/Fishing_Boat_Nets_Sholayar_Valparai_Feb26_A7CR_10156.jpg","page":"https://commons.wikimedia.org/wiki/File:Fishing_Boat_Nets_Sholayar_Valparai_Feb26_A7CR_10156.jpg","w":8358,"h":5224,"color":"#464947","license":"CC BY-SA 4.0","author":"This Photo was taken by Timothy A. Gonsalves. Feel free to use my photos, but pl","subject":"narrow wooden boat heaped with bright nets reflected on still dark water","tags":["fishing","boat","nets","lake","reflection","calm","colourful","river","fisherman","dark"],"cat":"travel","tone":"dark","temp":"cool","people":"none","q":3,"fp":[0.45,0.55]},{"id":"Fishermen at Kavarathi, Lakshadweep, India (edit).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/6/60/Fishermen_at_Kavarathi%2C_Lakshadweep%2C_India_%28edit%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Fishermen_at_Kavarathi,_Lakshadweep,_India_(edit).jpg","w":4889,"h":3212,"color":"#a4b3ca","license":"CC BY-SA 4.0","author":"Shafeeq Thamarassery","subject":"two fishermen hauling a fine net across white sand by a turquoise lagoon","tags":["fishing","fishermen","nets","beach","lagoon","tropical","island","sea","work","coast"],"cat":"work","tone":"light","temp":"cool","people":"figure","q":3,"fp":[0.65,0.55]},{"id":"Fishing net 2 Heraklion.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/8/8e/Fishing_net_2_Heraklion.jpg","page":"https://commons.wikimedia.org/wiki/File:Fishing_net_2_Heraklion.jpg","w":4055,"h":2904,"color":"#aa9c23","license":"CC0","author":"Jebulon","subject":"tangle of yellow fishing net with teal rope and red floats filling the frame","tags":["fishing net","nets","yellow","texture","harbour","floats","rope","pattern","sea","fishing"],"cat":"texture","tone":"light","temp":"warm","people":"none","q":3},{"id":"Washing net at Patenga (03).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/3/31/Washing_net_at_Patenga_%2803%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Washing_net_at_Patenga_(03).jpg","w":6016,"h":4000,"color":"#b8c8dc","license":"CC BY-SA 4.0","author":"Moheen Reeyad","subject":"man in the shallows holding up a tall white push net on a pole above breaking surf","tags":["fishing","net","fisherman","surf","beach","sea","shallows","work","coast","morning"],"cat":"work","tone":"light","temp":"cool","people":"figure","q":3},{"id":"Un pecheur prépare son filet à kerkennah - tunisie.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/98/Un_pecheur_pr%C3%A9pare_son_filet_%C3%A0_kerkennah_-_tunisie.jpg","page":"https://commons.wikimedia.org/wiki/File:Un_pecheur_pr%C3%A9pare_son_filet_%C3%A0_kerkennah_-_tunisie.jpg","w":4118,"h":2745,"color":"#849fb5","license":"CC BY-SA 4.0","author":"Skander zarrad","subject":"fisherman standing in a small wooden boat pulling green nets on calm blue sea","tags":["fishing","fisherman","boat","nets","sea","mediterranean","tunisia","work","coast","calm"],"cat":"work","tone":"light","temp":"cool","people":"figure","q":3,"fp":[0.4,0.55]},{"id":"FishinginSarıyer3.JPG","file":"https://upload.wikimedia.org/wikipedia/commons/3/37/FishinginSar%C4%B1yer3.JPG","page":"https://commons.wikimedia.org/wiki/File:FishinginSar%C4%B1yer3.JPG","w":2424,"h":1627,"color":"#6b757a","license":"CC BY-SA 3.0","author":"Ankara","subject":"two fishermen in a blue rowing boat drawing a net in choppy grey water","tags":["fishing","fishermen","rowing boat","nets","sea","bosphorus","istanbul","work","water","boat"],"cat":"work","tone":"mid","temp":"cool","people":"figure","q":2,"fp":[0.45,0.5]},{"id":"Traslado de una colmena de abejas melíponas, de la trampa a su lugar definitivo-denoise.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/6/64/Traslado_de_una_colmena_de_abejas_mel%C3%ADponas%2C_de_la_trampa_a_su_lugar_definitivo-denoise.jpg","page":"https://commons.wikimedia.org/wiki/File:Traslado_de_una_colmena_de_abejas_mel%C3%ADponas,_de_la_trampa_a_su_lugar_definitivo-denoise.jpg","w":5838,"h":3892,"color":"#464526","license":"CC BY-SA 4.0","author":"D4NN0BUK0","subject":"beekeeper in a veiled hat lifting a bottle hive among green banana leaves","tags":["beekeeper","beekeeping","bees","hive","honey","apiary","veil","garden","farming","nature"],"cat":"work","tone":"mid","temp":"warm","people":"figure","q":3,"fp":[0.45,0.45]},{"id":"Flowerman.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/c/c9/Flowerman.jpg","page":"https://commons.wikimedia.org/wiki/File:Flowerman.jpg","w":2233,"h":3208,"color":"#7c7c75","license":"CC BY-SA 4.0","author":"Sanjoykumar99","subject":"flower seller riding a bicycle with baskets of potted flowers down a misty road","tags":["florist","flowers","flower seller","bicycle","market","street","plants","delivery","india","morning"],"cat":"work","tone":"mid","temp":"warm","people":"face","q":3,"fp":[0.5,0.45]},{"id":"Construction workers in Mexico.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/c/c8/Construction_workers_in_Mexico.jpg","page":"https://commons.wikimedia.org/wiki/File:Construction_workers_in_Mexico.jpg","w":5999,"h":3262,"color":"#999999","license":"CC BY-SA 4.0","author":"Tomascastelazo","subject":"silhouettes of four construction workers climbing a steel rebar grid against white sky","tags":["construction","builders","workers","rebar","silhouette","building site","steel","high contrast","civil engineering","teamwork"],"cat":"work","tone":"dark","temp":"neutral","people":"figure","q":3},{"id":"Griffe à molette.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/fc/Griffe_%C3%A0_molette.jpg","page":"https://commons.wikimedia.org/wiki/File:Griffe_%C3%A0_molette.jpg","w":5184,"h":3456,"color":"#0a0705","license":"CC BY-SA 4.0","author":"Édouard Hue (User:EdouardHue)","subject":"saddler's stitch-marking wheel with a rosewood handle and brass knob on black","tags":["leatherwork","saddlery","hand tool","stitching wheel","rosewood","brass","craft","still life","tools","leather"],"cat":"object","tone":"dark","temp":"warm","people":"none","q":2},{"id":"Zimmermann nagelt Verschalung-20160531-RM-110839.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/b3/Zimmermann_nagelt_Verschalung-20160531-RM-110839.jpg","page":"https://commons.wikimedia.org/wiki/File:Zimmermann_nagelt_Verschalung-20160531-RM-110839.jpg","w":4574,"h":3430,"color":"#917b6b","license":"CC BY-SA 4.0","author":"Reinhold Möller Ermell","subject":"carpenter in a hard hat nailing timber formwork, seen from above against gravel","tags":["carpenter","construction","formwork","timber","builders","hammer","building site","framing","trades","work"],"cat":"work","tone":"mid","temp":"warm","people":"figure","q":3,"fp":[0.5,0.45]},{"id":"Pottery workshop at Odisha Crafts Museum 02.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/d/db/Pottery_workshop_at_Odisha_Crafts_Museum_02.jpg","page":"https://commons.wikimedia.org/wiki/File:Pottery_workshop_at_Odisha_Crafts_Museum_02.jpg","w":3888,"h":2592,"color":"#73756d","license":"CC BY-SA 4.0","author":"Kritzolina","subject":"potter's hands closing a clay cone on a fast spinning wheel blurred with motion","tags":["pottery","potter's wheel","hands","clay","throwing","motion","ceramics","workshop","craft","handmade"],"cat":"craft","tone":"mid","temp":"neutral","people":"hands","q":2,"fp":[0.45,0.45]},{"id":"Nabburg Freilandmuseum Kolbeckhof Webstuhl-20190823-RM-115330.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/25/Nabburg_Freilandmuseum_Kolbeckhof_Webstuhl-20190823-RM-115330.jpg","page":"https://commons.wikimedia.org/wiki/File:Nabburg_Freilandmuseum_Kolbeckhof_Webstuhl-20190823-RM-115330.jpg","w":5184,"h":3888,"color":"#a16d3f","license":"CC BY-SA 4.0","author":"Ermell","subject":"close view of a wooden warp beam wound with linen threads on an old loom","tags":["loom","weaving","linen","thread","warp","wood","textiles","heritage","handwoven","craft"],"cat":"craft","tone":"mid","temp":"warm","people":"none","q":2,"fp":[0.5,0.6]},{"id":"China-Beijing-pancakemaker-1230619.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/3/3a/China-Beijing-pancakemaker-1230619.jpg","page":"https://commons.wikimedia.org/wiki/File:China-Beijing-pancakemaker-1230619.jpg","w":3427,"h":2570,"color":"#5e5a5a","license":"CC BY-SA 4.0","author":"ermell","subject":"cook in a white cap spreading batter across a steaming griddle against a dark wall","tags":["street food","pancake","griddle","cook","batter","steam","food stall","beijing","kitchen","craft"],"cat":"food","tone":"mid","temp":"neutral","people":"face","q":3,"fp":[0.5,0.45]},{"id":"Apples in basket 2018 G1.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/3/30/Apples_in_basket_2018_G1.jpg","page":"https://commons.wikimedia.org/wiki/File:Apples_in_basket_2018_G1.jpg","w":4600,"h":4000,"color":"#755c3a","license":"Public domain","author":"George Chernilevsky","subject":"wicker basket heaped with red apples standing in green grass","tags":["apples","harvest","basket","orchard","cider","fruit","autumn","farm","picking","farmers market"],"cat":"food","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Äpfel P1260372.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/0/03/%C3%84pfel_P1260372.jpg","page":"https://commons.wikimedia.org/wiki/File:%C3%84pfel_P1260372.jpg","w":2307,"h":3076,"color":"#87775d","license":"CC BY-SA 4.0","author":"Fischer.H","subject":"row of trellised apple trees loaded with red fruit under a pale sky, vertical frame","tags":["apple orchard","apples","orchard","harvest","cider","fruit trees","farm","autumn","agriculture","rows"],"cat":"landscape","tone":"mid","temp":"warm","people":"none","q":2,"fp":[0.35,0.5]},{"id":"Carpenter working on an item 4.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/5/56/Carpenter_working_on_an_item_4.jpg","page":"https://commons.wikimedia.org/wiki/File:Carpenter_working_on_an_item_4.jpg","w":6000,"h":4000,"color":"#857169","license":"CC BY-SA 4.0","author":"Kambai Akau","subject":"carpenter in a cap marking a dark plank with a red pencil and square on his bench","tags":["carpenter","woodworking","marking","pencil","bench","joinery","workshop","timber","hands","craft"],"cat":"craft","tone":"mid","temp":"warm","people":"figure","q":2,"fp":[0.5,0.55]},{"id":"Germany Plane-with-wood-shavings-01.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/b3/Germany_Plane-with-wood-shavings-01.jpg","page":"https://commons.wikimedia.org/wiki/File:Germany_Plane-with-wood-shavings-01.jpg","w":4787,"h":3419,"color":"#c5bcaf","license":"CC BY-SA 3.0","author":"CEphoto, Uwe Aranas","subject":"old wooden jack plane surrounded by curled pale shavings on a grey ground","tags":["hand plane","wood shavings","carpentry","joinery","woodworking","tools","still life","timber","joiner","craft"],"cat":"object","tone":"light","temp":"warm","people":"none","q":2},{"id":"Japanese handplane (kanna) with wood shavings.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/3/35/Japanese_handplane_%28kanna%29_with_wood_shavings.jpg","page":"https://commons.wikimedia.org/wiki/File:Japanese_handplane_(kanna)_with_wood_shavings.jpg","w":2236,"h":2236,"color":"#b0a398","license":"CC BY-SA 4.0","author":"Terasaface","subject":"japanese wooden hand plane resting on a pale board among curled dark shavings","tags":["kanna","hand plane","wood shavings","japanese","joinery","woodworking","carpentry","tools","minimal","craft"],"cat":"object","tone":"light","temp":"warm","people":"none","q":2,"fp":[0.55,0.35]},{"id":"Woodturning Indonesia.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/3/3a/Woodturning_Indonesia.jpg","page":"https://commons.wikimedia.org/wiki/File:Woodturning_Indonesia.jpg","w":4368,"h":2912,"color":"#775f47","license":"CC BY 2.0","author":"Bertrand from Paris, France","subject":"hands steadying a gouge against a spinning lathe blank as curled shavings fly","tags":["woodturning","lathe","hands","wood shavings","gouge","carpentry","workshop","timber","artisan","craft"],"cat":"craft","tone":"mid","temp":"warm","people":"hands","q":3,"fp":[0.4,0.45]},{"id":"Stacking kiln for bulk firing of one pattern.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/0/0f/Stacking_kiln_for_bulk_firing_of_one_pattern.jpg","page":"https://commons.wikimedia.org/wiki/File:Stacking_kiln_for_bulk_firing_of_one_pattern.jpg","w":4608,"h":3072,"color":"#81706a","license":"CC BY-SA 3.0","author":"Dschag","subject":"open kiln stacked with blue and terracotta patterned tiles on refractory shelves","tags":["kiln","tiles","ceramics","firing","pottery","glaze","pattern","workshop","handmade","studio"],"cat":"craft","tone":"mid","temp":"warm","people":"none","q":3},{"id":"0 Le maître verrier Werner Garcia (1).JPG","file":"https://upload.wikimedia.org/wikipedia/commons/d/d6/0_Le_ma%C3%AEtre_verrier_Werner_Garcia_%281%29.JPG","page":"https://commons.wikimedia.org/wiki/File:0_Le_ma%C3%AEtre_verrier_Werner_Garcia_(1).JPG","w":3892,"h":2680,"color":"#606567","license":"CC BY 3.0","author":"Jean-Pol GRANDMONT","subject":"glassblower seated at his bench rolling a long blowpipe, black and white","tags":["glassblowing","glassblower","blowpipe","glass studio","workshop","artisan","black and white","hot glass","craft","factory"],"cat":"craft","tone":"mid","temp":"neutral","people":"figure","q":3,"fp":[0.55,0.45]},{"id":"Glassblower in Florida.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/70/Glassblower_in_Florida.jpg","page":"https://commons.wikimedia.org/wiki/File:Glassblower_in_Florida.jpg","w":1584,"h":2048,"color":"#372225","license":"CC BY-SA 4.0","author":"Rileynevil","subject":"glassworker in goggles shaping glass in a torch flame in a dark cluttered studio","tags":["glassblowing","lampwork","torch","flame","glass studio","artisan","workshop","hot glass","craft","maker"],"cat":"craft","tone":"dark","temp":"warm","people":"figure","q":2,"fp":[0.5,0.45]},{"id":"Tailor's scissors - Macedonian tailoring craft.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/6/61/Tailor%27s_scissors_-_Macedonian_tailoring_craft.jpg","page":"https://commons.wikimedia.org/wiki/File:Tailor%27s_scissors_-_Macedonian_tailoring_craft.jpg","w":5184,"h":3456,"color":"#ad846b","license":"CC BY-SA 4.0","author":"Orce Wiki","subject":"two old black iron tailor's scissors lying on creased brown kraft paper","tags":["scissors","tailor","shears","dressmaker","sewing","pattern paper","vintage","still life","atelier","craft"],"cat":"object","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Tailor´s shop - Werkstatt 2.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/c/c3/Tailor%C2%B4s_shop_-_Werkstatt_2.jpg","page":"https://commons.wikimedia.org/wiki/File:Tailor%C2%B4s_shop_-_Werkstatt_2.jpg","w":2560,"h":1712,"color":"#736c61","license":"CC BY-SA 3.0","author":"Wolfgang Sauber","subject":"tailor's shears, a tape measure and chalk on a worn wooden cutting table with cloth","tags":["tailor","cutting table","shears","tape measure","dressmaker","atelier","bespoke","fabric","sewing","workshop"],"cat":"craft","tone":"mid","temp":"warm","people":"none","q":3,"fp":[0.45,0.55]},{"id":"Inside a Leather Workshop.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/93/Inside_a_Leather_Workshop.jpg","page":"https://commons.wikimedia.org/wiki/File:Inside_a_Leather_Workshop.jpg","w":5184,"h":3456,"color":"#554c50","license":"CC BY-SA 4.0","author":"AmiraAdel93","subject":"leatherworker stitching at a small bench under walls hung with leather bags","tags":["leatherwork","leather bags","workshop","artisan","stitching","saddlery","shop","handmade","craftsman","accessories"],"cat":"craft","tone":"mid","temp":"warm","people":"figure","q":2,"fp":[0.35,0.6]},{"id":"Leather tanneries (10).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/5/5f/Leather_tanneries_%2810%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Leather_tanneries_(10).jpg","w":5304,"h":3548,"color":"#757168","license":"CC BY-SA 4.0","author":"Myousry6666","subject":"tannery worker lifting a heavy hide among piles of skins in a stone yard","tags":["tannery","leather","hides","worker","fes","morocco","craft","industry","workshop","raw material"],"cat":"work","tone":"mid","temp":"neutral","people":"figure","q":2,"fp":[0.6,0.4]},{"id":"Spinning wheel - Sopot.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/7d/Spinning_wheel_-_Sopot.jpg","page":"https://commons.wikimedia.org/wiki/File:Spinning_wheel_-_Sopot.jpg","w":2870,"h":1836,"color":"#a88a80","license":"CC BY-SA 3.0","author":"MrPanyGoff","subject":"carved wooden spinning wheel standing on a striped woven rug","tags":["spinning wheel","wool","yarn","folk craft","wood","rug","textiles","heritage","handmade","spinning"],"cat":"craft","tone":"mid","temp":"warm","people":"none","q":2},{"id":"St-Albans-Psalter-Faksimile-Bucheinband-Schliessen-Handarbeit.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/1/1f/St-Albans-Psalter-Faksimile-Bucheinband-Schliessen-Handarbeit.jpg","page":"https://commons.wikimedia.org/wiki/File:St-Albans-Psalter-Faksimile-Bucheinband-Schliessen-Handarbeit.jpg","w":4096,"h":2720,"color":"#84706e","license":"CC BY 4.0","author":"Charlotte Kramer","subject":"bookbinder's hand setting brass clasps on a leather cover beside a stack of bound books","tags":["bookbinding","bookbinder","leather","brass","hands","handmade books","workshop","bindery","craft","publishing"],"cat":"craft","tone":"light","temp":"warm","people":"hands","q":2,"fp":[0.3,0.55]},{"id":"Screen printing demonstration at TEDxUTM.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/4a/Screen_printing_demonstration_at_TEDxUTM.jpg","page":"https://commons.wikimedia.org/wiki/File:Screen_printing_demonstration_at_TEDxUTM.jpg","w":6240,"h":4160,"color":"#85503a","license":"CC0","author":"Ahmad Ali Karim","subject":"hands pulling a wooden squeegee across a red-inked silkscreen frame","tags":["screen printing","silkscreen","squeegee","ink","hands","print studio","poster","t-shirt printing","workshop","craft"],"cat":"craft","tone":"mid","temp":"warm","people":"hands","q":2,"fp":[0.45,0.45]},{"id":"Blacksmith At Work 02.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/1/14/Blacksmith_At_Work_02.jpg","page":"https://commons.wikimedia.org/wiki/File:Blacksmith_At_Work_02.jpg","w":5616,"h":3744,"color":"#613725","license":"CC BY-SA 4.0","author":"OJjnr","subject":"blacksmith seated on the ground beside a glowing charcoal fire in an earthen forge","tags":["blacksmith","forge","charcoal","fire","ironwork","artisan","metalwork","village","workshop","craft"],"cat":"craft","tone":"dark","temp":"warm","people":"figure","q":3,"fp":[0.55,0.45]},{"id":"Anvil, 5 kg in a jewellery workshop.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/a/a8/Anvil%2C_5_kg_in_a_jewellery_workshop.jpg","page":"https://commons.wikimedia.org/wiki/File:Anvil,_5_kg_in_a_jewellery_workshop.jpg","w":2592,"h":1728,"color":"#aa9188","license":"CC BY-SA 4.0","author":"W.carter","subject":"small black steel anvil standing on a wooden bench against a white wall","tags":["anvil","jewellery","goldsmith","metalwork","blacksmith","tools","workshop","still life","steel","craft"],"cat":"object","tone":"light","temp":"neutral","people":"none","q":2},{"id":"Tools in Sophies Silver jewellery workshop 3.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/8/8b/Tools_in_Sophies_Silver_jewellery_workshop_3.jpg","page":"https://commons.wikimedia.org/wiki/File:Tools_in_Sophies_Silver_jewellery_workshop_3.jpg","w":3766,"h":2511,"color":"#9a7a4e","license":"CC BY-SA 4.0","author":"W.carter","subject":"wooden block holding rows of polishing burrs, brushes and files on a pine bench","tags":["jewellery","silversmith","tools","burrs","polishing","workshop","goldsmith","bench","maker","craft"],"cat":"craft","tone":"mid","temp":"warm","people":"none","q":2,"fp":[0.45,0.45]},{"id":"Jewellery Workshop, University for the Creative Arts (Farnham Campus), Surrey - September 2025 - 01.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/78/Jewellery_Workshop%2C_University_for_the_Creative_Arts_%28Farnham_Campus%29%2C_Surrey_-_September_2025_-_01.jpg","page":"https://commons.wikimedia.org/wiki/File:Jewellery_Workshop,_University_for_the_Creative_Arts_(Farnham_Campus),_Surrey_-_September_2025_-_01.jpg","w":2492,"h":1869,"color":"#6f6e6b","license":"CC0","author":"Mertbiol","subject":"row of jeweller's benches with lamps and extraction hoses under big windows","tags":["jewellery","jeweller's bench","workshop","studio","goldsmith","silversmith","school","makerspace","workbench","craft"],"cat":"interior","tone":"light","temp":"neutral","people":"none","q":2},{"id":"Sourdough bread.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/3/3c/Sourdough_bread.jpg","page":"https://commons.wikimedia.org/wiki/File:Sourdough_bread.jpg","w":4032,"h":3024,"color":"#9d805b","license":"CC BY-SA 4.0","author":"Anasuyas","subject":"round sourdough loaf with a dark crust and leaf-shaped scoring on a wooden board","tags":["sourdough","bread","loaf","bakery","artisan bread","crust","baker","rustic","food","board"],"cat":"food","tone":"mid","temp":"warm","people":"none","q":3},{"id":"Home made sourdough cob.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/fc/Home_made_sourdough_cob.jpg","page":"https://commons.wikimedia.org/wiki/File:Home_made_sourdough_cob.jpg","w":2996,"h":2528,"color":"#957964","license":"CC BY-SA 4.0","author":"Fæ","subject":"crosshatch scored sourdough cob with floured crust on crumpled baking paper","tags":["sourdough","bread","cob","bakery","homemade","baker","flour","crust","artisan bread","food"],"cat":"food","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Sourdough.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/0/0a/Sourdough.jpg","page":"https://commons.wikimedia.org/wiki/File:Sourdough.jpg","w":2362,"h":3215,"color":"#6c6355","license":"CC BY 4.0","author":"Janus Sandsgaard","subject":"glass jar of bubbling sourdough starter with a spoon in it, dark background","tags":["sourdough","starter","fermentation","bakery","jar","baking","levain","bread","kitchen","food"],"cat":"food","tone":"dark","temp":"neutral","people":"none","q":2},{"id":"Kneading bread by hand.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/75/Kneading_bread_by_hand.jpg","page":"https://commons.wikimedia.org/wiki/File:Kneading_bread_by_hand.jpg","w":4291,"h":3715,"color":"#a38f85","license":"CC BY 4.0","author":"Anna.Massini","subject":"hands kneading a ball of dough on a floured pine board beside a bench scraper","tags":["kneading","dough","hands","bread","bakery","baking","flour","baker","kitchen","artisan"],"cat":"food","tone":"light","temp":"warm","people":"hands","q":3,"fp":[0.4,0.4]},{"id":"Kneading (18-366) (24399440891).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/3/30/Kneading_%2818-366%29_%2824399440891%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Kneading_(18-366)_(24399440891).jpg","w":3064,"h":3064,"color":"#aa8e81","license":"CC BY-SA 2.0","author":"Tim Sackton from Somerville, MA","subject":"top-down view of two hands pressing a slab of wholemeal dough on a wooden board","tags":["kneading","dough","hands","wholemeal","bread","baking","bakery","flour","kitchen","homemade"],"cat":"food","tone":"mid","temp":"warm","people":"hands","q":2},{"id":"Wheels of Beaufort cheese, France (1).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/0/0a/Wheels_of_Beaufort_cheese%2C_France_%281%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Wheels_of_Beaufort_cheese,_France_(1).jpg","w":4896,"h":2752,"color":"#7a6c4f","license":"CC BY-SA 4.0","author":"Ibex73","subject":"single wheel of beaufort cheese on a spruce board with stacked wheels behind","tags":["cheese","beaufort","cheese cellar","affinage","cheesemaker","dairy","alpine","wheel","aging","food"],"cat":"food","tone":"mid","temp":"warm","people":"none","q":3,"fp":[0.45,0.55]},{"id":"Sheep cheese production.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/8/8d/Sheep_cheese_production.jpg","page":"https://commons.wikimedia.org/wiki/File:Sheep_cheese_production.jpg","w":3296,"h":2472,"color":"#8f8057","license":"CC BY-SA 3.0","author":"Emil76","subject":"wooden shelves of yellow cheese wheels receding into a bright ripening room","tags":["cheese","cheesemaker","ripening room","dairy","shelves","wheels","aging","farm","food production","sheep cheese"],"cat":"food","tone":"light","temp":"warm","people":"none","q":2},{"id":"Kirkwall - Highland Park Distillery, copper stills - geograph.org.uk - 6446379.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/0/09/Kirkwall_-_Highland_Park_Distillery%2C_copper_stills_-_geograph.org.uk_-_6446379.jpg","page":"https://commons.wikimedia.org/wiki/File:Kirkwall_-_Highland_Park_Distillery,_copper_stills_-_geograph.org.uk_-_6446379.jpg","w":1802,"h":1201,"color":"#67625e","license":"CC BY-SA 2.0","author":"Colin Park","subject":"row of gleaming copper pot stills beside blue steel stairs in a bright still house","tags":["distillery","copper stills","whisky","still house","spirits","gin","industrial","production","copper","scotland"],"cat":"interior","tone":"mid","temp":"warm","people":"none","q":3,"fp":[0.65,0.5]},{"id":"Copper Stills .jpg","file":"https://upload.wikimedia.org/wikipedia/commons/5/57/Copper_Stills_.jpg","page":"https://commons.wikimedia.org/wiki/File:Copper_Stills_.jpg","w":3500,"h":2336,"color":"#786659","license":"CC BY-SA 4.0","author":"DehraSw","subject":"copper stills lined up along a glass wall looking out to a sunny street","tags":["distillery","copper stills","whisky","gin","spirits","glass wall","still house","copper","production","craft distillery"],"cat":"interior","tone":"mid","temp":"warm","people":"none","q":2,"fp":[0.3,0.5]},{"id":"Cider apples at Westons Cider Mills - geograph.org.uk - 7654933.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/5/53/Cider_apples_at_Westons_Cider_Mills_-_geograph.org.uk_-_7654933.jpg","page":"https://commons.wikimedia.org/wiki/File:Cider_apples_at_Westons_Cider_Mills_-_geograph.org.uk_-_7654933.jpg","w":1600,"h":1069,"color":"#937054","license":"CC BY-SA 2.0","author":"Philip Halling","subject":"frame filled edge to edge with red and yellow cider apples","tags":["cider apples","apples","harvest","texture","orchard","cider","fruit","autumn","pattern","farm"],"cat":"texture","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Mixed Apples for Cider Pressing.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/70/Mixed_Apples_for_Cider_Pressing.jpg","page":"https://commons.wikimedia.org/wiki/File:Mixed_Apples_for_Cider_Pressing.jpg","w":1920,"h":1280,"color":"#7f6329","license":"CC BY-SA 4.0","author":"Anne Dirkse","subject":"close view of green and red russet apples piled in a wooden crate","tags":["apples","cider","crate","harvest","orchard","fruit","autumn","pressing","farm shop","rustic"],"cat":"food","tone":"mid","temp":"warm","people":"none","q":2,"fp":[0.55,0.45]},{"id":"Honey comb frame 2017.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/2e/Honey_comb_frame_2017.jpg","page":"https://commons.wikimedia.org/wiki/File:Honey_comb_frame_2017.jpg","w":5472,"h":3648,"color":"#927c6c","license":"CC BY-SA 4.0","author":"Øyvind Holmstad","subject":"hands holding up a wooden hive frame crawling with honeybees on the comb","tags":["beekeeping","bees","honeycomb","hive frame","honey","apiary","hands","beekeeper","nature","farm"],"cat":"work","tone":"mid","temp":"warm","people":"hands","q":3,"fp":[0.45,0.5]},{"id":"Beekeeper Tending to Bees.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/42/Beekeeper_Tending_to_Bees.jpg","page":"https://commons.wikimedia.org/wiki/File:Beekeeper_Tending_to_Bees.jpg","w":5407,"h":3605,"color":"#8ba080","license":"Public domain","author":"U.S. Department of Agriculture","subject":"beekeeper in a white suit and veil lifting a frame from a hive on green grass","tags":["beekeeper","beekeeping","hive","bees","honey","apiary","protective suit","garden","farm","summer"],"cat":"work","tone":"light","temp":"cool","people":"figure","q":2,"fp":[0.5,0.55]},{"id":"Beekeeper 2017 Honeybee Conservancy, College of DuPage.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/49/Beekeeper_2017_Honeybee_Conservancy%2C_College_of_DuPage.jpg","page":"https://commons.wikimedia.org/wiki/File:Beekeeper_2017_Honeybee_Conservancy,_College_of_DuPage.jpg","w":3000,"h":2000,"color":"#6d7055","license":"CC BY 2.0","author":"COD Newsroom","subject":"beekeeper in a veil shaking bees from a box into a white hive among trees","tags":["beekeeper","beekeeping","bees","hive","swarm","apiary","woodland","honey","conservation","nature"],"cat":"work","tone":"mid","temp":"neutral","people":"figure","q":2,"fp":[0.4,0.5]},{"id":"Uncapping honeycomb.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/3/37/Uncapping_honeycomb.jpg","page":"https://commons.wikimedia.org/wiki/File:Uncapping_honeycomb.jpg","w":2448,"h":3264,"color":"#83745c","license":"CC BY-SA 4.0","author":"Wyatt Tyrone Smith","subject":"uncapping fork scraping wax caps off a golden honeycomb frame","tags":["honey","honeycomb","uncapping","beekeeping","wax","harvest","apiary","golden","food","close-up"],"cat":"food","tone":"light","temp":"warm","people":"hands","q":2,"fp":[0.5,0.6]},{"id":"Florist working on a bouquet of flowers.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/c/c1/Florist_working_on_a_bouquet_of_flowers.jpg","page":"https://commons.wikimedia.org/wiki/File:Florist_working_on_a_bouquet_of_flowers.jpg","w":6240,"h":4160,"color":"#95887c","license":"CC BY 2.0","author":"direct2Florist","subject":"florist seen over the shoulder holding a wrapped bouquet of lilies and orchids","tags":["florist","bouquet","flowers","flower shop","lilies","orchids","arranging","gift","wedding flowers","retail"],"cat":"work","tone":"mid","temp":"warm","people":"figure","q":3,"fp":[0.4,0.5]},{"id":"Florist working.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/5/5c/Florist_working.jpg","page":"https://commons.wikimedia.org/wiki/File:Florist_working.jpg","w":6240,"h":4160,"color":"#6b6049","license":"CC BY 2.0","author":"direct2Florist","subject":"hands gathering green stems into a bouquet over a cluttered flower shop counter","tags":["florist","hands","bouquet","flowers","flower shop","arranging","stems","greenery","studio","workshop"],"cat":"work","tone":"mid","temp":"warm","people":"hands","q":2,"fp":[0.65,0.4]},{"id":"Dülmen, Heilig-Kreuz-Kirche, Uhrwerk -- 2019 -- 3056.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/a/a3/D%C3%BClmen%2C_Heilig-Kreuz-Kirche%2C_Uhrwerk_--_2019_--_3056.jpg","page":"https://commons.wikimedia.org/wiki/File:D%C3%BClmen,_Heilig-Kreuz-Kirche,_Uhrwerk_--_2019_--_3056.jpg","w":6548,"h":4365,"color":"#53402c","license":"CC BY-SA 4.0","author":"Dietmar Rabich","subject":"iron and brass tower clock mechanism with gear wheels in a timber clock room","tags":["clockwork","clock","gears","horology","mechanism","brass","engineering","clockmaker","heritage","machinery"],"cat":"object","tone":"dark","temp":"warm","people":"none","q":3},{"id":"Buren 1000 watch movement.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/c/cc/Buren_1000_watch_movement.jpg","page":"https://commons.wikimedia.org/wiki/File:Buren_1000_watch_movement.jpg","w":6000,"h":4000,"color":"#a6958b","license":"CC BY-SA 4.0","author":"Raminagrobis","subject":"gold watch with its back open showing the movement, on a tan leather strap","tags":["watch","watch movement","watchmaker","horology","gears","gold","leather strap","repair","mechanism","still life"],"cat":"object","tone":"light","temp":"warm","people":"none","q":2},{"id":"Old brickwork. Red brick.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/8/85/Old_brickwork._Red_brick.jpg","page":"https://commons.wikimedia.org/wiki/File:Old_brickwork._Red_brick.jpg","w":3610,"h":2400,"color":"#624336","license":"CC BY-SA 3.0","author":"Dmitry Makeev","subject":"close view of rough weathered red bricks in thick lime mortar","tags":["brick","brickwork","wall","texture","masonry","builders","construction","red","weathered","background"],"cat":"texture","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Paint brushes (30804).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/9c/Paint_brushes_%2830804%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Paint_brushes_(30804).jpg","w":2113,"h":2503,"color":"#687669","license":"CC BY-SA 4.0","author":"Rhododendrites","subject":"close-up of worn bristle paint brushes standing upright against soft blue light","tags":["paint brushes","painter","art studio","artist","bristles","atelier","art supplies","painting","close-up","craft"],"cat":"craft","tone":"mid","temp":"cool","people":"none","q":3,"fp":[0.45,0.4]},{"id":"Brushes 2.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/6/68/Brushes_2.jpg","page":"https://commons.wikimedia.org/wiki/File:Brushes_2.jpg","w":2585,"h":2585,"color":"#c3bcb3","license":"CC BY-SA 3.0","author":"Hans Bernhard (Schnobby)","subject":"row of artist's paint brushes of different sizes laid out on a white ground","tags":["paint brushes","artist","art supplies","painter","watercolour","studio","flat lay","minimal","art school","craft"],"cat":"object","tone":"light","temp":"neutral","people":"none","q":2},{"id":"Chris OMoore painting at easel 2023.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/5/50/Chris_OMoore_painting_at_easel_2023.jpg","page":"https://commons.wikimedia.org/wiki/File:Chris_OMoore_painting_at_easel_2023.jpg","w":3025,"h":3024,"color":"#50504f","license":"CC BY 4.0","author":"Comoore","subject":"painter at a tall easel working on a canvas in a pale studio, black and white","tags":["painter","artist","easel","studio","painting","atelier","art","canvas","black and white","craft"],"cat":"craft","tone":"light","temp":"neutral","people":"figure","q":2,"fp":[0.6,0.45]},{"id":"Foldable table easel in Tuntorp 1.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/ef/Foldable_table_easel_in_Tuntorp_1.jpg","page":"https://commons.wikimedia.org/wiki/File:Foldable_table_easel_in_Tuntorp_1.jpg","w":2570,"h":3525,"color":"#ae998b","license":"CC BY 4.0","author":"W.carter","subject":"wooden table easel standing on a teak desk against a pale grey wall","tags":["easel","artist","painter","studio","wood","art supplies","atelier","still life","minimal","painting"],"cat":"object","tone":"light","temp":"warm","people":"none","q":2},{"id":"Architectural Masterplan Model of Lieb Tang Rodfai Villas.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/e6/Architectural_Masterplan_Model_of_Lieb_Tang_Rodfai_Villas.jpg","page":"https://commons.wikimedia.org/wiki/File:Architectural_Masterplan_Model_of_Lieb_Tang_Rodfai_Villas.jpg","w":6000,"h":3428,"color":"#3d3b3b","license":"CC BY-SA 4.0","author":"Designer Mario Kleff","subject":"wooden architectural massing model of low courtyard buildings on a dark ground","tags":["architecture","architectural model","architect","masterplan","model making","design studio","housing","wood","urban design","planning"],"cat":"object","tone":"dark","temp":"warm","people":"none","q":2,"fp":[0.4,0.5]},{"id":"A section of an architectural model on Durham.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/8/88/A_section_of_an_architectural_model_on_Durham.jpg","page":"https://commons.wikimedia.org/wiki/File:A_section_of_an_architectural_model_on_Durham.jpg","w":2048,"h":1536,"color":"#aba28d","license":"CC0","author":"Robert-brook","subject":"close view of a white city model with rows of buildings and tan sponge trees","tags":["architectural model","architect","city model","urban planning","model making","design","white","miniature","architecture","studio"],"cat":"object","tone":"light","temp":"warm","people":"none","q":2},{"id":"Bike repair is taking place in a workshop with focus on fixing handlebars and adjusting components.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/42/Bike_repair_is_taking_place_in_a_workshop_with_focus_on_fixing_handlebars_and_adjusting_components.jpg","page":"https://commons.wikimedia.org/wiki/File:Bike_repair_is_taking_place_in_a_workshop_with_focus_on_fixing_handlebars_and_adjusting_components.jpg","w":6048,"h":4024,"color":"#55403b","license":"CC BY 2.0","author":"Shixart1985","subject":"hands opening the fuel cap of a red moped below its handlebars","tags":["moped","motorbike repair","mechanic","hands","handlebars","garage","workshop","tools","service","repair"],"cat":"work","tone":"dark","temp":"warm","people":"hands","q":3,"fp":[0.55,0.45]},{"id":"\"Tibattant\" Desk MET DP291946.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/28/%22Tibattant%22_Desk_MET_DP291946.jpg","page":"https://commons.wikimedia.org/wiki/File:%22Tibattant%22_Desk_MET_DP291946.jpg","w":2911,"h":3880,"color":"#978d8c","license":"CC0","author":"Jacques-Émile Ruhlmann","subject":"slender rosewood writing desk with a red-lined fall front on a grey studio ground","tags":["cabinetmaking","furniture","desk","rosewood","art deco","joinery","woodworking","design","product","interior"],"cat":"object","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Pizza baker woman stone oven 2.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/4f/Pizza_baker_woman_stone_oven_2.jpg","page":"https://commons.wikimedia.org/wiki/File:Pizza_baker_woman_stone_oven_2.jpg","w":4927,"h":3285,"color":"#4c3220","license":"CC BY-SA 4.0","author":"Øyvind Holmstad","subject":"baker sliding a pizza on a long peel into the mouth of a brick wood-fired oven","tags":["bakery","wood-fired oven","pizza","baker","brick oven","peel","pizzeria","restaurant","baking","kitchen"],"cat":"food","tone":"mid","temp":"warm","people":"figure","q":2,"fp":[0.55,0.5]},{"id":"Traditional Kashmiri Baker's Oven.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/4d/Traditional_Kashmiri_Baker%27s_Oven.jpg","page":"https://commons.wikimedia.org/wiki/File:Traditional_Kashmiri_Baker%27s_Oven.jpg","w":4000,"h":3000,"color":"#534c42","license":"CC BY-SA 4.0","author":"TheAutumnal","subject":"looking down into a clay tandoor oven with flatbreads pressed round its walls over embers","tags":["bakery","tandoor","clay oven","flatbread","baker","bread","embers","traditional","street food","kashmir"],"cat":"food","tone":"dark","temp":"warm","people":"none","q":3},{"id":"Pulteney Distillery - Whisky Mash.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/43/Pulteney_Distillery_-_Whisky_Mash.jpg","page":"https://commons.wikimedia.org/wiki/File:Pulteney_Distillery_-_Whisky_Mash.jpg","w":3888,"h":2592,"color":"#653f24","license":"CC BY 2.0","author":"Erik Charlton from Menlo Park, USA","subject":"inside a mash tun, steel rakes turning wet malted grain under warm light","tags":["mash tun","brewery","distillery","malt","grain","brewing","whisky","production","copper","industrial"],"cat":"work","tone":"dark","temp":"warm","people":"none","q":3,"fp":[0.55,0.55]},{"id":"Traditional goldsmith engraving a ring, Goa, India.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/8/8f/Traditional_goldsmith_engraving_a_ring%2C_Goa%2C_India.jpg","page":"https://commons.wikimedia.org/wiki/File:Traditional_goldsmith_engraving_a_ring,_Goa,_India.jpg","w":4032,"h":2268,"color":"#836556","license":"CC0","author":"SerChevalerie","subject":"goldsmith's weathered hands engraving a ring on a worn wooden bench","tags":["goldsmith","jewellery","hands","engraving","ring","jeweller's bench","artisan","gold","workshop","craft"],"cat":"craft","tone":"mid","temp":"warm","people":"hands","q":3,"fp":[0.5,0.4]},{"id":"Tools of a traditional goldsmith, Goa, India.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/c/c9/Tools_of_a_traditional_goldsmith%2C_Goa%2C_India.jpg","page":"https://commons.wikimedia.org/wiki/File:Tools_of_a_traditional_goldsmith,_Goa,_India.jpg","w":4032,"h":2268,"color":"#655d54","license":"CC0","author":"SerChevalerie","subject":"open wooden drawer crammed with a goldsmith's punches, mallets and brushes","tags":["goldsmith","jewellery","tools","punches","drawer","workshop","jeweller","hand tools","artisan","craft"],"cat":"craft","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Home made sour dough bread.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/3/3b/Home_made_sour_dough_bread.jpg","page":"https://commons.wikimedia.org/wiki/File:Home_made_sour_dough_bread.jpg","w":8688,"h":5607,"color":"#89675b","license":"CC BY-SA 4.0","author":"Tomascastelazo","subject":"rustic bread rolls dusted with flour heaped in a striped linen cloth","tags":["bread","rolls","bakery","artisan","flour","linen","basket","rustic","boulangerie","food"],"cat":"food","tone":"mid","temp":"warm","people":"none","q":2},{"id":"6312 sourdough bread.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/ba/6312_sourdough_bread.jpg","page":"https://commons.wikimedia.org/wiki/File:6312_sourdough_bread.jpg","w":6400,"h":4269,"color":"#888581","license":"CC BY-SA 4.0","author":"Virtual-Pano","subject":"round sourdough loaf with a dark scored crust on a pale wooden board","tags":["sourdough","bread","loaf","crust","bakery","artisan","board","baker","food"],"cat":"food","tone":"mid","temp":"neutral","people":"none","q":2},{"id":"Bread shared at the Augsburger Hohes Friedensfest 2023 as a sign of peace 02.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/6/64/Bread_shared_at_the_Augsburger_Hohes_Friedensfest_2023_as_a_sign_of_peace_02.jpg","page":"https://commons.wikimedia.org/wiki/File:Bread_shared_at_the_Augsburger_Hohes_Friedensfest_2023_as_a_sign_of_peace_02.jpg","w":5472,"h":3648,"color":"#7f787d","license":"CC BY-SA 4.0","author":"Kritzolina","subject":"woman in a blue apron slicing a large rye loaf on a checked cloth outdoors","tags":["bread","rye","slicing","baker","apron","market","festival","knife","bakery"],"cat":"food","tone":"mid","temp":"cool","people":"figure","q":2,"fp":[0.55,0.5]},{"id":"Cardamom buns.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/72/Cardamom_buns.jpg","page":"https://commons.wikimedia.org/wiki/File:Cardamom_buns.jpg","w":4124,"h":2840,"color":"#ac7146","license":"CC0","author":"W.carter","subject":"twisted cardamom buns in a bowl on a red and white checked cloth","tags":["cardamom buns","pastry","bakery","scandinavian","cafe","buns","fika","baking"],"cat":"food","tone":"light","temp":"warm","people":"none","q":2,"fp":[0.55,0.45]},{"id":"Almond croissant - Workshop Coffee Lab 2025-06-27.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/0/0f/Almond_croissant_-_Workshop_Coffee_Lab_2025-06-27.jpg","page":"https://commons.wikimedia.org/wiki/File:Almond_croissant_-_Workshop_Coffee_Lab_2025-06-27.jpg","w":8160,"h":6144,"color":"#978272","license":"CC0","author":"Andy Li","subject":"almond croissant dusted with sugar on a plate on a wooden cafe table","tags":["croissant","almond","pastry","cafe","bakery","breakfast","coffee shop","brunch"],"cat":"food","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Apple cake with vanilla ice cream 2.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/a/a6/Apple_cake_with_vanilla_ice_cream_2.jpg","page":"https://commons.wikimedia.org/wiki/File:Apple_cake_with_vanilla_ice_cream_2.jpg","w":4333,"h":2888,"color":"#a89684","license":"CC0","author":"W.carter","subject":"slice of apple cake with vanilla ice cream on a blue gingham cloth","tags":["apple cake","dessert","ice cream","baking","cafe","gingham","homemade","pie"],"cat":"food","tone":"light","temp":"warm","people":"none","q":2},{"id":"Gâteau sur un plateau au Bénin 01.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/fc/G%C3%A2teau_sur_un_plateau_au_B%C3%A9nin_01.jpg","page":"https://commons.wikimedia.org/wiki/File:G%C3%A2teau_sur_un_plateau_au_B%C3%A9nin_01.jpg","w":4496,"h":3000,"color":"#7e4a2c","license":"CC BY-SA 4.0","author":"Adoscam","subject":"rows of marbled sponge cakes seen from above on a dark tray","tags":["cakes","baking","sponge","marble cake","bakery","tray","texture","pastry"],"cat":"food","tone":"mid","temp":"warm","people":"none","q":2},{"id":"2018-12-20-Turkish pastry with cream filling-1253.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/e8/2018-12-20-Turkish_pastry_with_cream_filling-1253.jpg","page":"https://commons.wikimedia.org/wiki/File:2018-12-20-Turkish_pastry_with_cream_filling-1253.jpg","w":5531,"h":3687,"color":"#4e483f","license":"CC BY-SA 4.0","author":"Superbass","subject":"two striped cream-filled pastry rolls coated in coconut on dark slate","tags":["pastry","cream roll","patisserie","dessert","slate","bakery","confectionery"],"cat":"food","tone":"dark","temp":"neutral","people":"none","q":2},{"id":"Arc-en-ciel comestible.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/2f/Arc-en-ciel_comestible.jpg","page":"https://commons.wikimedia.org/wiki/File:Arc-en-ciel_comestible.jpg","w":4272,"h":2848,"color":"#a25638","license":"CC BY-SA 2.0","author":"Sunny Ripert","subject":"rows of colourful macarons packed tightly in a box, close up","tags":["macarons","patisserie","pastry","confectionery","dessert","colour","bakery","gift"],"cat":"food","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Tokio Obsttorte Modell-20091020-RM-101223.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/a/ae/Tokio_Obsttorte_Modell-20091020-RM-101223.jpg","page":"https://commons.wikimedia.org/wiki/File:Tokio_Obsttorte_Modell-20091020-RM-101223.jpg","w":3553,"h":1857,"color":"#9e9059","license":"CC BY-SA 4.0","author":"Ermell","subject":"tart covered in halved green grapes on a white stand in a shop window","tags":["tart","grapes","patisserie","pastry","dessert","fruit tart","bakery","cake shop"],"cat":"food","tone":"mid","temp":"neutral","people":"none","q":2},{"id":"تمغضال، طبق أمازیغی.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/a/a1/%D8%AA%D9%85%D8%BA%D8%B6%D8%A7%D9%84%D8%8C_%D8%B7%D8%A8%D9%82_%D8%A3%D9%85%D8%A7%D8%B2%DB%8C%D8%BA%DB%8C.jpg","page":"https://commons.wikimedia.org/wiki/File:%D8%AA%D9%85%D8%BA%D8%B6%D8%A7%D9%84%D8%8C_%D8%B7%D8%A8%D9%82_%D8%A3%D9%85%D8%A7%D8%B2%DB%8C%D8%BA%DB%8C.jpg","w":6000,"h":4000,"color":"#795f4a","license":"CC BY-SA 4.0","author":"Ahmed Sh Dridi","subject":"Amazigh stew with eggs, flatbread and dates styled on a rustic table","tags":["stew","moroccan","flatbread","dates","restaurant","rustic","table","north african","food"],"cat":"food","tone":"mid","temp":"warm","people":"none","q":3},{"id":"White tablecloth on restaurant table at Amantaka luxury Resort & Hotel in Luang Prabang Laos.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/d/dd/White_tablecloth_on_restaurant_table_at_Amantaka_luxury_Resort_%26_Hotel_in_Luang_Prabang_Laos.jpg","page":"https://commons.wikimedia.org/wiki/File:White_tablecloth_on_restaurant_table_at_Amantaka_luxury_Resort_%26_Hotel_in_Luang_Prabang_Laos.jpg","w":4189,"h":4189,"color":"#9e968c","license":"CC BY-SA 4.0","author":"Basile Morin","subject":"round restaurant table laid with a white cloth beneath an arched window","tags":["restaurant","dining room","table","tablecloth","hotel","fine dining","interior"],"cat":"interior","tone":"light","temp":"warm","people":"none","q":2},{"id":"Aldea dessert plating.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/0/06/Aldea_dessert_plating.jpg","page":"https://commons.wikimedia.org/wiki/File:Aldea_dessert_plating.jpg","w":6000,"h":4000,"color":"#766454","license":"CC BY-SA 2.0","author":"Edsel Little","subject":"dark chocolate dome and a madeleine on a slate tile in soft light","tags":["dessert","petit fours","madeleine","fine dining","slate","restaurant","pastry"],"cat":"food","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Puesto de frutos en el Zoco -- 2014 -- Marrakech, Marruecos.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/7e/Puesto_de_frutos_en_el_Zoco_--_2014_--_Marrakech%2C_Marruecos.jpg","page":"https://commons.wikimedia.org/wiki/File:Puesto_de_frutos_en_el_Zoco_--_2014_--_Marrakech,_Marruecos.jpg","w":2100,"h":1391,"color":"#87684a","license":"CC BY-SA 3.0","author":"J. Ligero Loarte","subject":"lit spice and dried fruit stall in a souk with the seller leaning in","tags":["souk","market","stall","dried fruit","spices","marrakech","vendor","morocco","lamps"],"cat":"food","tone":"mid","temp":"warm","people":"figure","q":2},{"id":"Bumbu dan Rempah - rempah.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/fc/Bumbu_dan_Rempah_-_rempah.jpg","page":"https://commons.wikimedia.org/wiki/File:Bumbu_dan_Rempah_-_rempah.jpg","w":5483,"h":3655,"color":"#685131","license":"CC BY-SA 4.0","author":"Galeri ega","subject":"chillies, ginger, garlic, turmeric and peppercorns arranged on black","tags":["spices","chilli","ginger","garlic","turmeric","pepper","ingredients","kitchen","flat lay"],"cat":"food","tone":"dark","temp":"warm","people":"none","q":3},{"id":"Capsicum baccatum in Saúde flea market, São Paulo, Brazil.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/8/8a/Capsicum_baccatum_in_Sa%C3%BAde_flea_market%2C_S%C3%A3o_Paulo%2C_Brazil.jpg","page":"https://commons.wikimedia.org/wiki/File:Capsicum_baccatum_in_Sa%C3%BAde_flea_market,_S%C3%A3o_Paulo,_Brazil.jpg","w":6212,"h":4928,"color":"#7c6540","license":"CC BY-SA 4.0","author":"Wilfredor","subject":"colourful bowls of fresh chilli peppers seen from above at a market","tags":["chilli","peppers","market","bowls","produce","spicy","colour","vegetables","stall"],"cat":"food","tone":"mid","temp":"warm","people":"none","q":3},{"id":"Safran-Weinviertel Niederreiter 2 Gramm 8285.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/1/1c/Safran-Weinviertel_Niederreiter_2_Gramm_8285.jpg","page":"https://commons.wikimedia.org/wiki/File:Safran-Weinviertel_Niederreiter_2_Gramm_8285.jpg","w":3520,"h":2356,"color":"#d2b8b2","license":"CC BY-SA 4.0","author":"Hubertl","subject":"pile of dried saffron threads on a white background","tags":["saffron","spice","threads","ingredient","product","kitchen","persian","cooking"],"cat":"food","tone":"light","temp":"warm","people":"none","q":2},{"id":"Saffronfarm-860808.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/ee/Saffronfarm-860808.jpg","page":"https://commons.wikimedia.org/wiki/File:Saffronfarm-860808.jpg","w":2100,"h":1400,"color":"#99775e","license":"CC BY-SA 3.0","author":"Safa.daneshvar","subject":"workers in straw hats picking purple saffron crocus flowers into baskets","tags":["saffron","harvest","crocus","farm","field","workers","baskets","agriculture","spice"],"cat":"food","tone":"mid","temp":"warm","people":"figure","q":3},{"id":"Gewuerze 004 2024 08 10.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/28/Gewuerze_004_2024_08_10.jpg","page":"https://commons.wikimedia.org/wiki/File:Gewuerze_004_2024_08_10.jpg","w":4732,"h":3191,"color":"#e3d7cc","license":"CC BY-SA 4.0","author":"Friedrich Haag","subject":"star anise, cinnamon sticks and cloves scattered on white","tags":["spices","cinnamon","star anise","cloves","baking","kitchen","ingredients","flat lay"],"cat":"food","tone":"light","temp":"warm","people":"none","q":2},{"id":"20160807 spice merchant Nyaung Shwe Myanmar 8916 DxO.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/f6/20160807_spice_merchant_Nyaung_Shwe_Myanmar_8916_DxO.jpg","page":"https://commons.wikimedia.org/wiki/File:20160807_spice_merchant_Nyaung_Shwe_Myanmar_8916_DxO.jpg","w":2641,"h":3987,"color":"#865b58","license":"CC BY-SA 4.0","author":"Jakub Hałun","subject":"spice seller in a headscarf sitting among her goods at a market","tags":["spices","market","seller","myanmar","stall","vendor","produce","portrait"],"cat":"food","tone":"mid","temp":"warm","people":"face","q":2,"fp":[0.45,0.45]},{"id":"Soubois, WikiCheese Lausanne, 10-2016.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/2d/Soubois%2C_WikiCheese_Lausanne%2C_10-2016.jpg","page":"https://commons.wikimedia.org/wiki/File:Soubois,_WikiCheese_Lausanne,_10-2016.jpg","w":4483,"h":2760,"color":"#999999","license":"CC BY-SA 4.0","author":"Yann Forget","subject":"soft white mould-rind cheese on a round slate board","tags":["cheese","soft cheese","slate","cheesemonger","deli","fromagerie","artisan","dairy"],"cat":"food","tone":"light","temp":"neutral","people":"none","q":2},{"id":"Coulommiers lait cru.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/d/dc/Coulommiers_lait_cru.jpg","page":"https://commons.wikimedia.org/wiki/File:Coulommiers_lait_cru.jpg","w":3411,"h":2265,"color":"#96837a","license":"CC BY-SA 3.0","author":"Myrabella","subject":"ripe soft cheese with a wedge cut out on a wooden board","tags":["cheese","brie","camembert","board","deli","fromagerie","wine bar","dairy","food"],"cat":"food","tone":"mid","temp":"warm","people":"none","q":3},{"id":"Meule du Plateau cheese wheels in the ripening cellar, Terre de fromages, Herve, 2025.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/74/Meule_du_Plateau_cheese_wheels_in_the_ripening_cellar%2C_Terre_de_fromages%2C_Herve%2C_2025.jpg","page":"https://commons.wikimedia.org/wiki/File:Meule_du_Plateau_cheese_wheels_in_the_ripening_cellar,_Terre_de_fromages,_Herve,_2025.jpg","w":3563,"h":5344,"color":"#7c5f42","license":"CC0","author":"DimiTalen","subject":"wheels of cheese ripening on wooden shelves","tags":["cheese","wheels","aging","cellar","dairy","cheesemaker","affinage","shelves"],"cat":"food","tone":"light","temp":"warm","people":"none","q":2},{"id":"Affinage de Saint-Nectaire (fromage).JPG","file":"https://upload.wikimedia.org/wikipedia/commons/6/6e/Affinage_de_Saint-Nectaire_%28fromage%29.JPG","page":"https://commons.wikimedia.org/wiki/File:Affinage_de_Saint-Nectaire_(fromage).JPG","w":4000,"h":3000,"color":"#503e2c","license":"CC BY-SA 3.0","author":"Daieuxetdailleurs","subject":"rows of small cheeses ripening on straw in a dark rock cellar","tags":["cheese","cellar","aging","saint-nectaire","cave","dairy","straw","affinage"],"cat":"food","tone":"dark","temp":"warm","people":"none","q":2},{"id":"Comté Cheese.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/2b/Comt%C3%A9_Cheese.jpg","page":"https://commons.wikimedia.org/wiki/File:Comt%C3%A9_Cheese.jpg","w":3000,"h":4000,"color":"#6c694a","license":"CC BY-SA 4.0","author":"Orr10","subject":"long aisle of tall shelves stacked with golden cheese wheels","tags":["cheese","warehouse","aging","wheels","parmesan","dairy","shelves","cheesemaker"],"cat":"food","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Ensenada fish market 2.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/0/0e/Ensenada_fish_market_2.jpg","page":"https://commons.wikimedia.org/wiki/File:Ensenada_fish_market_2.jpg","w":4243,"h":2912,"color":"#715d51","license":"CC BY-SA 3.0","author":"Tomascastelazo","subject":"fresh whole fish hanging in a dense row at a market","tags":["fish","market","seafood","fishmonger","catch","fresh","ensenada","harbour"],"cat":"food","tone":"mid","temp":"cool","people":"none","q":3},{"id":"Oweston sting fish for sale at Tsukiji Fishmarket, Tokyo-30.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/6/6e/Oweston_sting_fish_for_sale_at_Tsukiji_Fishmarket%2C_Tokyo-30.jpg","page":"https://commons.wikimedia.org/wiki/File:Oweston_sting_fish_for_sale_at_Tsukiji_Fishmarket,_Tokyo-30.jpg","w":2017,"h":3025,"color":"#9d7b67","license":"CC BY-SA 3.0","author":"MichaelMaggs","subject":"red-eyed red fish lined up on ice at a fish market","tags":["fish","seafood","market","tsukiji","fresh","fishmonger","ice","catch"],"cat":"food","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Fish market in Nouakchott - Mauritania.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/70/Fish_market_in_Nouakchott_-_Mauritania.jpg","page":"https://commons.wikimedia.org/wiki/File:Fish_market_in_Nouakchott_-_Mauritania.jpg","w":3888,"h":2592,"color":"#b4997b","license":"CC BY-SA 4.0","author":"Uzabiaga","subject":"women selling fish on mats along a sandy beach in warm light","tags":["fish market","beach","seafood","sellers","africa","coast","fishing","mauritania"],"cat":"travel","tone":"light","temp":"warm","people":"figure","q":2},{"id":"Cooking a paella.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/d/d5/Cooking_a_paella.jpg","page":"https://commons.wikimedia.org/wiki/File:Cooking_a_paella.jpg","w":3344,"h":2224,"color":"#755a3b","license":"CC0","author":"Jebulon","subject":"paella with mussels and shrimp cooking over a fire, a hand stirring","tags":["paella","seafood","mussels","cooking","fire","pan","spanish","outdoor","rice"],"cat":"food","tone":"mid","temp":"warm","people":"hands","q":3},{"id":"Oysters for sale at Mercat de la Boqueria.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/0/0e/Oysters_for_sale_at_Mercat_de_la_Boqueria.jpg","page":"https://commons.wikimedia.org/wiki/File:Oysters_for_sale_at_Mercat_de_la_Boqueria.jpg","w":5360,"h":3545,"color":"#947347","license":"CC BY-SA 4.0","author":"Kritzolina","subject":"fresh oysters laid out on crushed ice at a market stall","tags":["oysters","seafood","market","ice","raw bar","shellfish","fishmonger","fresh"],"cat":"food","tone":"mid","temp":"cool","people":"none","q":2},{"id":"Shrimp fisherman.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/ee/Shrimp_fisherman.jpg","page":"https://commons.wikimedia.org/wiki/File:Shrimp_fisherman.jpg","w":4707,"h":3138,"color":"#798a8d","license":"CC BY-SA 3.0","author":"Tomas Castelazo","subject":"fisherman wading in a lagoon casting a net among mangroves","tags":["fisherman","net","shrimp","fishing","lagoon","water","work","seafood"],"cat":"travel","tone":"light","temp":"cool","people":"figure","q":2,"fp":[0.55,0.7]},{"id":"Bangladeshi Prawn Curry.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/3/3f/Bangladeshi_Prawn_Curry.jpg","page":"https://commons.wikimedia.org/wiki/File:Bangladeshi_Prawn_Curry.jpg","w":5184,"h":3456,"color":"#ac9f89","license":"CC BY-SA 4.0","author":"Jubair1985","subject":"prawn curry in a long white dish on indigo tie-dyed cloth","tags":["prawn curry","shrimp","curry","bangladeshi","seafood","dish","restaurant","indian"],"cat":"food","tone":"mid","temp":"cool","people":"none","q":2},{"id":"Making of chinese noodles 5166105.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/46/Making_of_chinese_noodles_5166105.jpg","page":"https://commons.wikimedia.org/wiki/File:Making_of_chinese_noodles_5166105.jpg","w":4608,"h":3456,"color":"#665e54","license":"CC0","author":"Ermell","subject":"two cooks from behind rolling noodle dough in a small kitchen","tags":["noodles","kitchen","cooks","dough","restaurant","chef","work","asian","noodle bar"],"cat":"work","tone":"mid","temp":"warm","people":"figure","q":2},{"id":"Dalian Liaoning China Noodlemaker-01.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/b5/Dalian_Liaoning_China_Noodlemaker-01.jpg","page":"https://commons.wikimedia.org/wiki/File:Dalian_Liaoning_China_Noodlemaker-01.jpg","w":2506,"h":3759,"color":"#757681","license":"CC BY-SA 4.0","author":"CEphoto, Uwe Aranas","subject":"noodle maker in a white cap stretching hand-pulled noodles","tags":["noodles","hand-pulled","chef","cook","chinese","noodle bar","dough","craft"],"cat":"work","tone":"mid","temp":"cool","people":"face","q":2},{"id":"20171115 Noodle Village Phonsavan 2599 DxO.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/49/20171115_Noodle_Village_Phonsavan_2599_DxO.jpg","page":"https://commons.wikimedia.org/wiki/File:20171115_Noodle_Village_Phonsavan_2599_DxO.jpg","w":4472,"h":2962,"color":"#72706c","license":"CC BY-SA 4.0","author":"Jakub Hałun","subject":"rice noodle sheets drying on bamboo racks in a Laotian village","tags":["rice noodles","drying","village","laos","bamboo","food production","asian","travel"],"cat":"food","tone":"light","temp":"warm","people":"none","q":2},{"id":"Steelport 6-Inch Chef Knife (2026)-104A6580.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/5/5c/Steelport_6-Inch_Chef_Knife_%282026%29-104A6580.jpg","page":"https://commons.wikimedia.org/wiki/File:Steelport_6-Inch_Chef_Knife_(2026)-104A6580.jpg","w":5147,"h":3676,"color":"#59443b","license":"CC BY-SA 4.0","author":"Frank Schulenburg","subject":"chef's knife on a wooden board with shallots, chilli and rosemary on marble","tags":["knife","chef","kitchen","cutting board","cooking","shallots","rosemary","cookware"],"cat":"food","tone":"dark","temp":"neutral","people":"none","q":2},{"id":"Eighth Army Chef of the Year competition (9182185).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/c/c6/Eighth_Army_Chef_of_the_Year_competition_%289182185%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Eighth_Army_Chef_of_the_Year_competition_(9182185).jpg","w":6237,"h":4158,"color":"#756f62","license":"Public domain","author":"U.S. Army photo by Cpl. Hyung Ju Lee","subject":"cook's hands arranging omelettes on plates at a steel kitchen counter","tags":["chef","hands","plating","kitchen","omelette","restaurant","cook","service"],"cat":"work","tone":"light","temp":"cool","people":"hands","q":2,"fp":[0.55,0.35]},{"id":"Kneading Chapati Dough 04.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/a/ad/Kneading_Chapati_Dough_04.jpg","page":"https://commons.wikimedia.org/wiki/File:Kneading_Chapati_Dough_04.jpg","w":5772,"h":4341,"color":"#8d7777","license":"CC BY-SA 4.0","author":"Ssemmanda will","subject":"hands rolling flatbread dough with a wooden pin on a floured board","tags":["dough","rolling","flatbread","chapati","baking","hands","flour","cooking","kitchen"],"cat":"food","tone":"mid","temp":"warm","people":"hands","q":3},{"id":"Baker woman's hands kneading bread dough.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/5/5c/Baker_woman%27s_hands_kneading_bread_dough.jpg","page":"https://commons.wikimedia.org/wiki/File:Baker_woman%27s_hands_kneading_bread_dough.jpg","w":5154,"h":3441,"color":"#55483f","license":"CC BY 2.0","author":"Shixart1985","subject":"hands kneading bread dough on a floured table","tags":["dough","kneading","baker","hands","bread","flour","baking","bakery","home"],"cat":"food","tone":"mid","temp":"warm","people":"hands","q":3},{"id":"Espresso coffee pouring from retro espresso machine.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/5/52/Espresso_coffee_pouring_from_retro_espresso_machine.jpg","page":"https://commons.wikimedia.org/wiki/File:Espresso_coffee_pouring_from_retro_espresso_machine.jpg","w":4016,"h":6016,"color":"#6f6f6e","license":"CC BY 2.0","author":"Shixart1985","subject":"espresso streaming from a chrome machine into two glass cups","tags":["espresso","coffee machine","pouring","cafe","barista","coffee shop","chrome"],"cat":"drink","tone":"mid","temp":"neutral","people":"none","q":3},{"id":"Espresso Coffee 01.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/24/Espresso_Coffee_01.jpg","page":"https://commons.wikimedia.org/wiki/File:Espresso_Coffee_01.jpg","w":6720,"h":4480,"color":"#c9c7c4","license":"CC0","author":"Jubair1985","subject":"cup of espresso with crema on a black saucer on white, from above","tags":["espresso","coffee","cup","cafe","minimal","crema","coffee shop","top view"],"cat":"drink","tone":"light","temp":"neutral","people":"none","q":2},{"id":"Gray espresso cup with amaretto 1.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/99/Gray_espresso_cup_with_amaretto_1.jpg","page":"https://commons.wikimedia.org/wiki/File:Gray_espresso_cup_with_amaretto_1.jpg","w":4417,"h":4163,"color":"#7d7c7c","license":"CC BY-SA 4.0","author":"Friedrich Haag","subject":"grey espresso cup with an amaretto biscuit and spoon on a saucer","tags":["espresso","coffee","cup","amaretti","cafe","product","coffee shop"],"cat":"drink","tone":"light","temp":"neutral","people":"none","q":2},{"id":"A cup of coffee in Mohk.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/3/35/A_cup_of_coffee_in_Mohk.jpg","page":"https://commons.wikimedia.org/wiki/File:A_cup_of_coffee_in_Mohk.jpg","w":4000,"h":3000,"color":"#9a7647","license":"CC BY-SA 4.0","author":"Peachyeung316","subject":"cappuccino dusted with cocoa beside a biscuit on a marble table","tags":["cappuccino","coffee","cafe","foam","cocoa","biscuit","coffee shop","table"],"cat":"drink","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Roasted coffee beans on the surface. 01.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/3/38/Roasted_coffee_beans_on_the_surface._01.jpg","page":"https://commons.wikimedia.org/wiki/File:Roasted_coffee_beans_on_the_surface._01.jpg","w":4898,"h":3265,"color":"#2a2d2a","license":"CC BY-SA 4.0","author":"A S M Jobaer","subject":"roasted coffee beans scattered on black with shallow focus","tags":["coffee beans","roastery","coffee","dark","beans","roasting","cafe","texture"],"cat":"drink","tone":"dark","temp":"warm","people":"none","q":3},{"id":"Japan tea ceremony 1165.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/c/cd/Japan_tea_ceremony_1165.jpg","page":"https://commons.wikimedia.org/wiki/File:Japan_tea_ceremony_1165.jpg","w":3914,"h":2936,"color":"#674a29","license":"CC BY-SA 4.0","author":"Ermell","subject":"woman in kimono kneeling at an outdoor tea ceremony under a red parasol","tags":["tea ceremony","japanese","matcha","garden","parasol","kimono","tea house","ritual"],"cat":"drink","tone":"mid","temp":"warm","people":"figure","q":2,"fp":[0.35,0.55]},{"id":"Matcha tea latte with rosetta latte art.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/1/1f/Matcha_tea_latte_with_rosetta_latte_art.jpg","page":"https://commons.wikimedia.org/wiki/File:Matcha_tea_latte_with_rosetta_latte_art.jpg","w":4032,"h":2268,"color":"#997148","license":"CC BY-SA 4.0","author":"Irvan Ary Maulana","subject":"matcha latte with a rosetta in a black cup on a wooden table, from above","tags":["matcha","latte art","tea","cafe","green tea","cup","coffee shop","top view"],"cat":"drink","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Castella 002.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/d/df/Castella_002.jpg","page":"https://commons.wikimedia.org/wiki/File:Castella_002.jpg","w":4288,"h":2848,"color":"#877e73","license":"CC0","author":"Ocdp","subject":"slices of castella sponge cake beside a glass of tea on a dark table","tags":["castella","cake","tea","japanese","dessert","cafe","tea house","afternoon tea"],"cat":"food","tone":"dark","temp":"neutral","people":"none","q":2},{"id":"Tea garden at Nagri in the Kangra Valley of Himachal Pradesh, India.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/e0/Tea_garden_at_Nagri_in_the_Kangra_Valley_of_Himachal_Pradesh%2C_India.jpg","page":"https://commons.wikimedia.org/wiki/File:Tea_garden_at_Nagri_in_the_Kangra_Valley_of_Himachal_Pradesh,_India.jpg","w":4931,"h":3287,"color":"#79815a","license":"CC BY-SA 4.0","author":"UnpetitproleX","subject":"rows of clipped tea bushes under a flowering tree with mountains behind","tags":["tea plantation","tea garden","kangra","himalaya","landscape","estate","farm"],"cat":"landscape","tone":"mid","temp":"neutral","people":"none","q":2},{"id":"Cameron Bharat Tea Plantation, Cameron Highlands, Malaysia, 20250829 1535 4120.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/7e/Cameron_Bharat_Tea_Plantation%2C_Cameron_Highlands%2C_Malaysia%2C_20250829_1535_4120.jpg","page":"https://commons.wikimedia.org/wiki/File:Cameron_Bharat_Tea_Plantation,_Cameron_Highlands,_Malaysia,_20250829_1535_4120.jpg","w":5439,"h":3631,"color":"#7e8777","license":"CC BY 4.0","author":"Jakub Hałun","subject":"path winding through terraced tea plantation hills under cloud","tags":["tea plantation","cameron highlands","malaysia","hills","estate","farm","landscape"],"cat":"landscape","tone":"light","temp":"neutral","people":"none","q":2},{"id":"Wine being poured into a glass.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/e3/Wine_being_poured_into_a_glass.jpg","page":"https://commons.wikimedia.org/wiki/File:Wine_being_poured_into_a_glass.jpg","w":1955,"h":1300,"color":"#968168","license":"CC BY 2.0","author":"Fabio Ingrosso","subject":"hands pouring red wine from a dark bottle into a glass","tags":["wine","pouring","hands","red wine","bottle","wine bar","tasting","sommelier"],"cat":"drink","tone":"mid","temp":"neutral","people":"hands","q":2},{"id":"Pouring wine into a decanter.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/b1/Pouring_wine_into_a_decanter.jpg","page":"https://commons.wikimedia.org/wiki/File:Pouring_wine_into_a_decanter.jpg","w":3872,"h":2592,"color":"#291a11","license":"CC BY 2.0","author":"suksim","subject":"red wine poured from a bottle into a decanter in low warm light","tags":["wine","decanter","pouring","red wine","wine bar","restaurant","sommelier","dark"],"cat":"drink","tone":"dark","temp":"warm","people":"hands","q":3,"fp":[0.45,0.5]},{"id":"Close-up of red wine being poured into a glass with a blurred outdoor backdrop.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/f2/Close-up_of_red_wine_being_poured_into_a_glass_with_a_blurred_outdoor_backdrop.jpg","page":"https://commons.wikimedia.org/wiki/File:Close-up_of_red_wine_being_poured_into_a_glass_with_a_blurred_outdoor_backdrop.jpg","w":2832,"h":4256,"color":"#98a09d","license":"CC BY-SA 4.0","author":"Bhullargraphic","subject":"red wine pouring into a glass held against a soft green background","tags":["wine","red wine","pouring","glass","wine bar","tasting","outdoor","hands"],"cat":"drink","tone":"mid","temp":"neutral","people":"hands","q":2},{"id":"Rutherford Hill Wine Cave-1369.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/b3/Rutherford_Hill_Wine_Cave-1369.jpg","page":"https://commons.wikimedia.org/wiki/File:Rutherford_Hill_Wine_Cave-1369.jpg","w":3948,"h":3948,"color":"#312115","license":"CC BY-SA 4.0","author":"Frank Schulenburg","subject":"oak wine barrels stacked on racks in a dark cave lit from above","tags":["wine barrels","cellar","winery","oak","cave","aging","vineyard","dark"],"cat":"drink","tone":"dark","temp":"warm","people":"none","q":3},{"id":"Schramsberg Vineyards, July 2019-7579+7580.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/9e/Schramsberg_Vineyards%2C_July_2019-7579%2B7580.jpg","page":"https://commons.wikimedia.org/wiki/File:Schramsberg_Vineyards,_July_2019-7579%2B7580.jpg","w":6244,"h":3903,"color":"#644a2f","license":"CC BY-SA 4.0","author":"Frank Schulenburg","subject":"long cellar aisle lined with sparkling wine riddling racks","tags":["wine cellar","champagne","riddling racks","winery","cave","sparkling wine","bottles"],"cat":"drink","tone":"dark","temp":"warm","people":"none","q":3},{"id":"Rutherford Hill Wine Cave-1351.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/d/da/Rutherford_Hill_Wine_Cave-1351.jpg","page":"https://commons.wikimedia.org/wiki/File:Rutherford_Hill_Wine_Cave-1351.jpg","w":4266,"h":5972,"color":"#7d5b43","license":"CC BY-SA 4.0","author":"Frank Schulenburg","subject":"vaulted wine cave tasting room with a long table and chandeliers","tags":["wine cave","tasting room","winery","cellar","table","napa","interior","wine"],"cat":"interior","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Yerevan, Brandy barrels, Armenia.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/77/Yerevan%2C_Brandy_barrels%2C_Armenia.jpg","page":"https://commons.wikimedia.org/wiki/File:Yerevan,_Brandy_barrels,_Armenia.jpg","w":4912,"h":3264,"color":"#864b0d","license":"CC BY 4.0","author":"Vyacheslav Argenberg","subject":"numbered oak barrels stacked in rows in a warmly lit cellar","tags":["barrels","brandy","cellar","distillery","oak","aging","winery","warm"],"cat":"drink","tone":"dark","temp":"warm","people":"none","q":2},{"id":"Javier shows part of the grape harvest in his Lysekil vineyard 1 - cropped.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/c/ca/Javier_shows_part_of_the_grape_harvest_in_his_Lysekil_vineyard_1_-_cropped.jpg","page":"https://commons.wikimedia.org/wiki/File:Javier_shows_part_of_the_grape_harvest_in_his_Lysekil_vineyard_1_-_cropped.jpg","w":3948,"h":2534,"color":"#7c7e3d","license":"CC0","author":"W.carter","subject":"two hands holding freshly cut bunches of green grapes in a vineyard","tags":["grapes","harvest","vineyard","hands","winery","white wine","picking","vines"],"cat":"drink","tone":"mid","temp":"warm","people":"hands","q":3},{"id":"Grape worker.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/f8/Grape_worker.jpg","page":"https://commons.wikimedia.org/wiki/File:Grape_worker.jpg","w":2240,"h":1680,"color":"#715f4e","license":"CC BY 3.0","author":"Tomas Castelazo","subject":"smiling grape worker in a cap standing among vineyard rows at dusk","tags":["vineyard","grape harvest","worker","winery","farm","portrait","vines","hills"],"cat":"work","tone":"mid","temp":"warm","people":"face","q":2},{"id":"Ripe Zinfandel grapes in Dry Creek Valley-8958.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/6/6e/Ripe_Zinfandel_grapes_in_Dry_Creek_Valley-8958.jpg","page":"https://commons.wikimedia.org/wiki/File:Ripe_Zinfandel_grapes_in_Dry_Creek_Valley-8958.jpg","w":4034,"h":5648,"color":"#7c6851","license":"CC BY-SA 4.0","author":"Frank Schulenburg","subject":"ripe zinfandel grapes hanging under red autumn vine leaves","tags":["grapes","zinfandel","vineyard","harvest","winery","red wine","vine","autumn"],"cat":"nature","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Hop garden Mšec TK 2021-05-28 1.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/0/01/Hop_garden_M%C5%A1ec_TK_2021-05-28_1.jpg","page":"https://commons.wikimedia.org/wiki/File:Hop_garden_M%C5%A1ec_TK_2021-05-28_1.jpg","w":6067,"h":4044,"color":"#8d8c7d","license":"CC BY-SA 4.0","author":"T. Kebert","subject":"rows of tall poles and wires in a young hop garden","tags":["hops","hop garden","brewery","farm","beer","agriculture","field","poles"],"cat":"landscape","tone":"light","temp":"neutral","people":"none","q":2},{"id":"2009-03-21 Beer brewing bubbles.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/8/83/2009-03-21_Beer_brewing_bubbles.jpg","page":"https://commons.wikimedia.org/wiki/File:2009-03-21_Beer_brewing_bubbles.jpg","w":3888,"h":2592,"color":"#cec09d","license":"CC BY-SA 4.0","author":"Ildar Sagdejev (Specious)","subject":"close texture of creamy foam bubbles on fermenting beer","tags":["beer","foam","brewing","fermentation","bubbles","texture","brewery","craft beer"],"cat":"texture","tone":"light","temp":"warm","people":"none","q":2},{"id":"Budweiser Budvar brewery, tanks 03.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/c/cb/Budweiser_Budvar_brewery%2C_tanks_03.jpg","page":"https://commons.wikimedia.org/wiki/File:Budweiser_Budvar_brewery,_tanks_03.jpg","w":4672,"h":4032,"color":"#7d7a74","license":"CC BY-SA 4.0","author":"Czeva","subject":"aisle between large white lagering tanks in a brewery cellar","tags":["brewery","tanks","lager","cellar","beer","industrial","fermentation","brewhouse"],"cat":"interior","tone":"light","temp":"neutral","people":"none","q":2},{"id":"Hoila-Cider from Zingerle, Bolzano, South Tyrol 0633.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/6/65/Hoila-Cider_from_Zingerle%2C_Bolzano%2C_South_Tyrol_0633.jpg","page":"https://commons.wikimedia.org/wiki/File:Hoila-Cider_from_Zingerle,_Bolzano,_South_Tyrol_0633.jpg","w":1744,"h":2997,"color":"#3e423d","license":"CC BY-SA 4.0","author":"Hubertl","subject":"glass of golden cider in a tulip glass on a dark background","tags":["cider","glass","drink","apple","tasting","still life","orchard","bar"],"cat":"drink","tone":"dark","temp":"warm","people":"none","q":2},{"id":"15-09-26-RalfR-WLC-0059.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/b3/15-09-26-RalfR-WLC-0059.jpg","page":"https://commons.wikimedia.org/wiki/File:15-09-26-RalfR-WLC-0059.jpg","w":2206,"h":3821,"color":"#98988d","license":"CC BY-SA 3.0","author":"Ralf Roletschek","subject":"wine glass of spritz with ice and fresh mint leaves on grey","tags":["cocktail","spritz","mint","glass","summer","bar","aperitif","drink"],"cat":"drink","tone":"light","temp":"neutral","people":"none","q":2},{"id":"15-09-26-RalfR-WLC-0056.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/5/5d/15-09-26-RalfR-WLC-0056.jpg","page":"https://commons.wikimedia.org/wiki/File:15-09-26-RalfR-WLC-0056.jpg","w":1995,"h":2992,"color":"#a18878","license":"CC BY-SA 3.0","author":"Ralf Roletschek","subject":"highball of iced dark cocktail with lime in a cut glass on grey","tags":["cocktail","highball","ice","lime","bar","drink","glass","rum"],"cat":"drink","tone":"light","temp":"warm","people":"none","q":2},{"id":"Wiki Loves Cocktails at WikiCon 2017, 2017 (1Y7A1492).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/8/8f/Wiki_Loves_Cocktails_at_WikiCon_2017%2C_2017_%281Y7A1492%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Wiki_Loves_Cocktails_at_WikiCon_2017,_2017_(1Y7A1492).jpg","w":3467,"h":4622,"color":"#aa8871","license":"CC BY-SA 4.0","author":"Matti Blume","subject":"hand holding a negroni with an orange slice in a crystal tumbler","tags":["cocktail","negroni","hand","bar","aperitif","orange","glass","drink"],"cat":"drink","tone":"light","temp":"warm","people":"hands","q":2},{"id":"Cóctel de café en copa martini 2.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/c/cd/C%C3%B3ctel_de_caf%C3%A9_en_copa_martini_2.jpg","page":"https://commons.wikimedia.org/wiki/File:C%C3%B3ctel_de_caf%C3%A9_en_copa_martini_2.jpg","w":4601,"h":4547,"color":"#70462d","license":"CC BY-SA 4.0","author":"Rjcastillo","subject":"espresso martini in a coupe glass on a brown background","tags":["cocktail","espresso martini","coffee","bar","glass","drink","lounge"],"cat":"drink","tone":"dark","temp":"warm","people":"none","q":3},{"id":"Fresh Mojito Premium.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/1/13/Fresh_Mojito_Premium.jpg","page":"https://commons.wikimedia.org/wiki/File:Fresh_Mojito_Premium.jpg","w":4494,"h":6741,"color":"#846142","license":"CC BY-SA 4.0","author":"Rjcastillo","subject":"mojito with mint and an orange slice before a flickering flame","tags":["cocktail","mojito","mint","bar","drink","flame","lounge","night"],"cat":"drink","tone":"dark","temp":"warm","people":"none","q":2},{"id":"Tireuses à bière Aux Amis Réunis à Tournai, BE (DSCF8335).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/90/Tireuses_%C3%A0_bi%C3%A8re_Aux_Amis_R%C3%A9unis_%C3%A0_Tournai%2C_BE_%28DSCF8335%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Tireuses_%C3%A0_bi%C3%A8re_Aux_Amis_R%C3%A9unis_%C3%A0_Tournai,_BE_(DSCF8335).jpg","w":4546,"h":3133,"color":"#644d36","license":"CC BY 4.0","author":"Trougnouf","subject":"three ornate ceramic beer taps on a wooden bar counter","tags":["beer taps","bar","counter","pub","beer","brasserie","belgium","interior"],"cat":"interior","tone":"dark","temp":"warm","people":"none","q":2},{"id":"Barhocker (fcm).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/5/51/Barhocker_%28fcm%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Barhocker_(fcm).jpg","w":1465,"h":1865,"color":"#69564f","license":"CC BY-SA 4.0","author":"Photograph: Frank C. Müller, Baden-Baden","subject":"row of bentwood bar stools along a counter on a tiled floor","tags":["bar stools","bar","counter","cafe","bistro","interior","wood","seating"],"cat":"interior","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Breakfast in Île d'Orléans 072.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/a/a1/Breakfast_in_%C3%8Ele_d%27Orl%C3%A9ans_072.jpg","page":"https://commons.wikimedia.org/wiki/File:Breakfast_in_%C3%8Ele_d%27Orl%C3%A9ans_072.jpg","w":5109,"h":5788,"color":"#62512c","license":"CC0","author":"Wilfredor","subject":"breakfast table set by a tall window looking onto a green garden","tags":["breakfast","table","window","inn","bed and breakfast","hotel","interior","morning"],"cat":"interior","tone":"dark","temp":"warm","people":"none","q":2},{"id":"2023 Pralinki Jeżyki Coolki (2).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/90/2023_Pralinki_Je%C5%BCyki_Coolki_%282%29.jpg","page":"https://commons.wikimedia.org/wiki/File:2023_Pralinki_Je%C5%BCyki_Coolki_(2).jpg","w":4044,"h":2226,"color":"#dcd4cb","license":"CC BY-SA 4.0","author":"Jacek Halicki","subject":"three hazelnut-studded chocolate pralines in a row on white","tags":["pralines","chocolate","truffles","chocolatier","hazelnut","confectionery"],"cat":"food","tone":"light","temp":"warm","people":"none","q":2},{"id":"\" 13 ITALY Chocolate melted - italian premium chocolate top quality.JPG","file":"https://upload.wikimedia.org/wikipedia/commons/4/43/%22_13_ITALY_Chocolate_melted_-_italian_premium_chocolate_top_quality.JPG","page":"https://commons.wikimedia.org/wiki/File:%22_13_ITALY_Chocolate_melted_-_italian_premium_chocolate_top_quality.JPG","w":4000,"h":3000,"color":"#7e7675","license":"CC BY-SA 3.0 it","author":"Andrea Pavanello","subject":"wooden spoon coated in melted dark chocolate over a bowl","tags":["chocolate","melted","baking","spoon","chocolatier","dessert","kitchen","cocoa"],"cat":"food","tone":"mid","temp":"warm","people":"none","q":2},{"id":"20260317 Theobroma cacao 01.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/b2/20260317_Theobroma_cacao_01.jpg","page":"https://commons.wikimedia.org/wiki/File:20260317_Theobroma_cacao_01.jpg","w":2496,"h":3739,"color":"#79753f","license":"CC BY 4.0","author":"Flocci Nivis","subject":"yellow cacao pod hanging from a tree trunk in a dark forest","tags":["cacao","cocoa pod","tree","plantation","chocolate","bean to bar","tropical"],"cat":"nature","tone":"dark","temp":"warm","people":"none","q":2},{"id":"ComputerHotline - Apis mellifera (by) (1).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/b9/ComputerHotline_-_Apis_mellifera_%28by%29_%281%29.jpg","page":"https://commons.wikimedia.org/wiki/File:ComputerHotline_-_Apis_mellifera_(by)_(1).jpg","w":4288,"h":2848,"color":"#92552d","license":"CC BY 2.0","author":"Thomas Bresson","subject":"honeybee on the edge of golden honeycomb cells, close up","tags":["honeycomb","bee","honey","apiary","beekeeping","macro","wax","nature"],"cat":"nature","tone":"mid","temp":"warm","people":"none","q":2,"fp":[0.35,0.4]},{"id":"Un apiculteur manipule un plancher d'une ruche.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/f0/Un_apiculteur_manipule_un_plancher_d%27une_ruche.jpg","page":"https://commons.wikimedia.org/wiki/File:Un_apiculteur_manipule_un_plancher_d%27une_ruche.jpg","w":6000,"h":4000,"color":"#907951","license":"CC BY-SA 4.0","author":"Skander zarrad","subject":"gloved hands lifting a honeycomb frame covered with bees","tags":["beekeeper","honeycomb","frame","bees","hands","apiary","honey","beekeeping"],"cat":"work","tone":"mid","temp":"warm","people":"hands","q":3},{"id":"Un apiculteur prépare son enfumoir.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/f6/Un_apiculteur_pr%C3%A9pare_son_enfumoir.jpg","page":"https://commons.wikimedia.org/wiki/File:Un_apiculteur_pr%C3%A9pare_son_enfumoir.jpg","w":6000,"h":4000,"color":"#b3a998","license":"CC BY-SA 4.0","author":"Skander zarrad","subject":"beekeeper's bee smoker puffing white smoke in soft light","tags":["beekeeper","smoker","bees","apiary","honey","beekeeping","smoke","work"],"cat":"work","tone":"light","temp":"warm","people":"hands","q":3},{"id":"Tradizioni familiari Raccolta olive wlk olive in cassetta.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/e0/Tradizioni_familiari_Raccolta_olive_wlk_olive_in_cassetta.jpg","page":"https://commons.wikimedia.org/wiki/File:Tradizioni_familiari_Raccolta_olive_wlk_olive_in_cassetta.jpg","w":4624,"h":3468,"color":"#888a89","license":"CC BY-SA 4.0","author":"Anna.Massini","subject":"hands sorting black olives from leaves on a harvest net","tags":["olives","harvest","hands","olive oil","net","farm","tuscany","crates"],"cat":"food","tone":"mid","temp":"neutral","people":"hands","q":2},{"id":"Lobby lounge of Amantaka Suite Amantaka luxury Resort & Hotel Luang Prabang Laos.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/b1/Lobby_lounge_of_Amantaka_Suite_Amantaka_luxury_Resort_%26_Hotel_Luang_Prabang_Laos.jpg","page":"https://commons.wikimedia.org/wiki/File:Lobby_lounge_of_Amantaka_Suite_Amantaka_luxury_Resort_%26_Hotel_Luang_Prabang_Laos.jpg","w":5859,"h":3906,"color":"#8e8175","license":"CC BY-SA 4.0","author":"Basile Morin","subject":"hotel lounge with teak daybed, cane armchair and tall green shuttered doors","tags":["living room","lounge","hotel","teak","daybed","armchair","shutters","tiles","colonial","calm"],"cat":"interior","tone":"light","temp":"warm","people":"none","q":2},{"id":"Croix villa cavrois chambre parents fused.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/5/56/Croix_villa_cavrois_chambre_parents_fused.jpg","page":"https://commons.wikimedia.org/wiki/File:Croix_villa_cavrois_chambre_parents_fused.jpg","w":4531,"h":3050,"color":"#83796c","license":"CC BY-SA 4.0","author":"Velvet","subject":"modernist bedroom with a white bed, desk and sunlight across a grey carpet","tags":["bedroom","modernist","bed","desk","sunlight","minimal","hotel","design"],"cat":"interior","tone":"light","temp":"neutral","people":"none","q":2},{"id":"Canopy bed of Khan Pool Suite in Amantaka luxury Resort & Hotel in Luang Prabang Laos.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/9e/Canopy_bed_of_Khan_Pool_Suite_in_Amantaka_luxury_Resort_%26_Hotel_in_Luang_Prabang_Laos.jpg","page":"https://commons.wikimedia.org/wiki/File:Canopy_bed_of_Khan_Pool_Suite_in_Amantaka_luxury_Resort_%26_Hotel_in_Luang_Prabang_Laos.jpg","w":6390,"h":4260,"color":"#887971","license":"CC BY-SA 4.0","author":"Basile Morin","subject":"four-poster bed with white drapes in a hotel suite with tall shuttered doors","tags":["bedroom","four-poster","canopy bed","hotel room","suite","linen","luxury","resort"],"cat":"interior","tone":"light","temp":"warm","people":"none","q":2},{"id":"Heiligengrabe, Kloster Stift zum Heiligengrabe, Abtei, Appartement im Dormitorium -- 2017 -- 7261-7.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/ff/Heiligengrabe%2C_Kloster_Stift_zum_Heiligengrabe%2C_Abtei%2C_Appartement_im_Dormitorium_--_2017_--_7261-7.jpg","page":"https://commons.wikimedia.org/wiki/File:Heiligengrabe,_Kloster_Stift_zum_Heiligengrabe,_Abtei,_Appartement_im_Dormitorium_--_2017_--_7261-7.jpg","w":5538,"h":3693,"color":"#9c9a83","license":"CC BY-SA 4.0","author":"Dietmar Rabich","subject":"pale green bedroom with two plain birch beds on a wooden floor","tags":["bedroom","green walls","beds","minimal","guesthouse","calm","timber floor","hostel"],"cat":"interior","tone":"light","temp":"cool","people":"none","q":2},{"id":"Vault Café Central Vienna Wien.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/90/Vault_Caf%C3%A9_Central_Vienna_Wien.jpg","page":"https://commons.wikimedia.org/wiki/File:Vault_Caf%C3%A9_Central_Vienna_Wien.jpg","w":3007,"h":2028,"color":"#90744f","license":"CC0","author":"Jebulon","subject":"vaulted cafe ceiling with painted ribs and globe lamps hanging low","tags":["cafe","coffeehouse","vault","ceiling","lamps","vienna","historic","arches"],"cat":"interior","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Window in a cafe in San Gimignano (02182)2.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/90/Window_in_a_cafe_in_San_Gimignano_%2802182%292.jpg","page":"https://commons.wikimedia.org/wiki/File:Window_in_a_cafe_in_San_Gimignano_(02182)2.jpg","w":3167,"h":3892,"color":"#696967","license":"CC BY-SA 4.0","author":"Rhododendrites","subject":"open window in a thick wall framing hills, potted plants on the sill","tags":["window","view","hills","tuscany","plants","window light","cafe","calm","travel"],"cat":"interior","tone":"mid","temp":"neutral","people":"none","q":3},{"id":"Restaurant in Place D'Youville, Quebec City.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/f9/Restaurant_in_Place_D%27Youville%2C_Quebec_City.jpg","page":"https://commons.wikimedia.org/wiki/File:Restaurant_in_Place_D%27Youville,_Quebec_City.jpg","w":7438,"h":5040,"color":"#51514f","license":"CC0","author":"Wilfredor","subject":"blue restaurant with paper lantern pendants, sculpted ceiling and a bar","tags":["restaurant","dining room","pendant lamps","blue","bar","tables","modern","bistro"],"cat":"interior","tone":"mid","temp":"cool","people":"none","q":3},{"id":"Restaurant room of Amantaka luxury Resort & Hotel in Luang Prabang Laos.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/f3/Restaurant_room_of_Amantaka_luxury_Resort_%26_Hotel_in_Luang_Prabang_Laos.jpg","page":"https://commons.wikimedia.org/wiki/File:Restaurant_room_of_Amantaka_luxury_Resort_%26_Hotel_in_Luang_Prabang_Laos.jpg","w":6585,"h":4390,"color":"#9d958d","license":"CC BY-SA 4.0","author":"Basile Morin","subject":"white dining room with round tables in linen and rattan chairs","tags":["restaurant","dining room","tablecloth","rattan chairs","hotel","fine dining","white","colonial"],"cat":"interior","tone":"light","temp":"warm","people":"none","q":2},{"id":"Restaurant Näsinneula.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/ef/Restaurant_N%C3%A4sinneula.jpg","page":"https://commons.wikimedia.org/wiki/File:Restaurant_N%C3%A4sinneula.jpg","w":3700,"h":2730,"color":"#736357","license":"CC BY-SA 4.0","author":"kallerna","subject":"tower restaurant with laid tables and a sunset view over a city","tags":["restaurant","view","sunset","tables","windows","fine dining","city","evening"],"cat":"interior","tone":"mid","temp":"warm","people":"none","q":3},{"id":"Taipei Taiwan Jiaozi-Restaurant-14th-avenue-01.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/eb/Taipei_Taiwan_Jiaozi-Restaurant-14th-avenue-01.jpg","page":"https://commons.wikimedia.org/wiki/File:Taipei_Taiwan_Jiaozi-Restaurant-14th-avenue-01.jpg","w":5268,"h":3514,"color":"#553b2a","license":"CC BY-SA 3.0","author":"CEphoto, Uwe Aranas","subject":"two cooks in red aprons folding dumplings in a small restaurant","tags":["restaurant","dumplings","cooks","kitchen","aprons","chinese food","street food","family business"],"cat":"food","tone":"mid","temp":"warm","people":"face","q":2},{"id":"Cocktail-Bar (Kleines Phi) in Hamburg.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/d/dc/Cocktail-Bar_%28Kleines_Phi%29_in_Hamburg.jpg","page":"https://commons.wikimedia.org/wiki/File:Cocktail-Bar_(Kleines_Phi)_in_Hamburg.jpg","w":4971,"h":4000,"color":"#684e3e","license":"CC BY-SA 4.0","author":"Achim Schleuning","subject":"cocktail bar with a copper-topped counter, pendant lamps and shelves of bottles","tags":["bar","cocktail bar","counter","copper","bottles","pendant lamps","night","drinks"],"cat":"interior","tone":"dark","temp":"warm","people":"none","q":2},{"id":"Cure cocktail bar New Orleans 2011.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/5/51/Cure_cocktail_bar_New_Orleans_2011.jpg","page":"https://commons.wikimedia.org/wiki/File:Cure_cocktail_bar_New_Orleans_2011.jpg","w":4752,"h":3168,"color":"#49290e","license":"CC BY 2.0","author":"Chelsea Marie Hicks","subject":"dim cocktail bar with lit bottle shelves up to the ceiling and a bartender","tags":["bar","cocktail bar","bottles","shelves","bartender","night","dark","speakeasy"],"cat":"interior","tone":"dark","temp":"warm","people":"figure","q":2,"fp":[0.3,0.5]},{"id":"Sabor Espana shop interior Cala Millor.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/6/6f/Sabor_Espana_shop_interior_Cala_Millor.jpg","page":"https://commons.wikimedia.org/wiki/File:Sabor_Espana_shop_interior_Cala_Millor.jpg","w":4080,"h":3060,"color":"#95795b","license":"CC BY-SA 4.0","author":"Steffen Mokosch","subject":"shop with wooden crate shelving, marble counter and track lighting","tags":["shop","retail","shelving","wood","counter","deli","store","display"],"cat":"interior","tone":"light","temp":"warm","people":"none","q":2},{"id":"Rome (Italy), Shop -- 2013 -- 3802.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/97/Rome_%28Italy%29%2C_Shop_--_2013_--_3802.jpg","page":"https://commons.wikimedia.org/wiki/File:Rome_(Italy),_Shop_--_2013_--_3802.jpg","w":3456,"h":5184,"color":"#594e50","license":"CC BY-SA 4.0","author":"Dietmar Rabich","subject":"tall green bookcase packed with red and gilt book spines","tags":["bookcase","books","bookshop","library","shelves","antiquarian","reading","spines"],"cat":"interior","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Interior of the Paperback Bookshop May 2023.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/f9/Interior_of_the_Paperback_Bookshop_May_2023.jpg","page":"https://commons.wikimedia.org/wiki/File:Interior_of_the_Paperback_Bookshop_May_2023.jpg","w":3024,"h":4032,"color":"#796558","license":"CC BY-SA 4.0","author":"Nick-D","subject":"bookshop corner with shelves to the ceiling, stacked books and a stool","tags":["bookshop","books","shelves","second-hand","stacks","reading","cosy","store"],"cat":"interior","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Interior of Cantys Bookshop July 2022.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/3/33/Interior_of_Cantys_Bookshop_July_2022.jpg","page":"https://commons.wikimedia.org/wiki/File:Interior_of_Cantys_Bookshop_July_2022.jpg","w":4032,"h":3024,"color":"#766e64","license":"CC BY-SA 4.0","author":"Nick-D","subject":"narrow aisle between tall book shelves with a patterned rug","tags":["bookshop","books","aisle","shelves","rug","reading","library","store"],"cat":"interior","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Suzzallo Reading Room University of Washington restoration Seattle Washington 2026.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/6/63/Suzzallo_Reading_Room_University_of_Washington_restoration_Seattle_Washington_2026.jpg","page":"https://commons.wikimedia.org/wiki/File:Suzzallo_Reading_Room_University_of_Washington_restoration_Seattle_Washington_2026.jpg","w":11648,"h":8736,"color":"#3f3327","license":"CC BY 4.0","author":"Guywelch2000","subject":"gothic reading room with long tables, chandeliers and a stained glass window","tags":["library","reading room","gothic","chandeliers","tables","university","study","books"],"cat":"interior","tone":"dark","temp":"warm","people":"none","q":3},{"id":"Statsbiblioteket læsesalen-2.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/6/60/Statsbiblioteket_l%C3%A6sesalen-2.jpg","page":"https://commons.wikimedia.org/wiki/File:Statsbiblioteket_l%C3%A6sesalen-2.jpg","w":5165,"h":3820,"color":"#8d775d","license":"CC BY-SA 4.0","author":"Villy Fink Isaksen","subject":"two-storey reading room with wooden galleries and rows of desks","tags":["library","reading room","galleries","desks","study","university","modern","students"],"cat":"interior","tone":"light","temp":"warm","people":"figure","q":2},{"id":"Salle de lecture Bibliotheque Sainte-Genevieve n03.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/7c/Salle_de_lecture_Bibliotheque_Sainte-Genevieve_n03.jpg","page":"https://commons.wikimedia.org/wiki/File:Salle_de_lecture_Bibliotheque_Sainte-Genevieve_n03.jpg","w":4288,"h":2848,"color":"#8a5d39","license":"CC BY 2.0 fr","author":"Marie-Lan Nguyen","subject":"iron-vaulted reading room with long tables and green lamps","tags":["library","reading room","iron vault","arches","tables","lamps","paris","study"],"cat":"interior","tone":"mid","temp":"warm","people":"none","q":3},{"id":"George-peabody-library.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/c/c1/George-peabody-library.jpg","page":"https://commons.wikimedia.org/wiki/File:George-peabody-library.jpg","w":3000,"h":2250,"color":"#7e644c","license":"CC BY-SA 3.0","author":"Matthew Petroff","subject":"five-tier cast-iron library atrium beneath a skylight","tags":["library","atrium","cast iron","balconies","skylight","books","grand","study"],"cat":"interior","tone":"mid","temp":"warm","people":"none","q":3},{"id":"Interior of Camille Pissarro s studio at Éragny-sur-Epte - 2026.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/2a/Interior_of_Camille_Pissarro_s_studio_at_%C3%89ragny-sur-Epte_-_2026.jpg","page":"https://commons.wikimedia.org/wiki/File:Interior_of_Camille_Pissarro_s_studio_at_%C3%89ragny-sur-Epte_-_2026.jpg","w":4032,"h":2268,"color":"#6f7463","license":"CC0","author":"AlexDS05","subject":"empty attic studio with an arched window, timber beam and sunlit floor","tags":["studio","attic","window","empty room","window light","artist studio","loft","calm"],"cat":"interior","tone":"light","temp":"neutral","people":"none","q":2},{"id":"Ceramics studio, Epworth Studios, Liskeard, Cornwall - September 2026 (2).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/9a/Ceramics_studio%2C_Epworth_Studios%2C_Liskeard%2C_Cornwall_-_September_2026_%282%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Ceramics_studio,_Epworth_Studios,_Liskeard,_Cornwall_-_September_2026_(2).jpg","w":3566,"h":3024,"color":"#867b71","license":"CC BY 4.0","author":"Mutney","subject":"ceramics studio table with white and grey stoneware vases","tags":["ceramics","pottery","studio","vases","table","craft","maker","stoneware"],"cat":"craft","tone":"light","temp":"neutral","people":"none","q":2},{"id":"Flookan community ceramics studio, Market House, St Austell, Cornwall - October 2024 (5).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/8/8a/Flookan_community_ceramics_studio%2C_Market_House%2C_St_Austell%2C_Cornwall_-_October_2024_%285%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Flookan_community_ceramics_studio,_Market_House,_St_Austell,_Cornwall_-_October_2024_(5).jpg","w":4032,"h":3024,"color":"#7d766f","license":"CC BY 4.0","author":"Mutney","subject":"pottery studio with shelves of bisque ware, glazes and a workbench","tags":["pottery","ceramics","studio","shelves","bisque","glaze","craft","workshop"],"cat":"craft","tone":"light","temp":"neutral","people":"none","q":2},{"id":"Studio Andrea Marescalchi.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/1/1f/Studio_Andrea_Marescalchi.jpg","page":"https://commons.wikimedia.org/wiki/File:Studio_Andrea_Marescalchi.jpg","w":4554,"h":3036,"color":"#574b39","license":"CC BY-SA 4.0","author":"Andrea Marescalchi","subject":"whitewashed studio with large drawings of animals pinned to the walls","tags":["studio","artist","drawings","whitewash","loft","gallery","dark","atelier"],"cat":"interior","tone":"dark","temp":"neutral","people":"none","q":2},{"id":"Railway workshop museum exhibition in Ljubljana, Slovenia.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/78/Railway_workshop_museum_exhibition_in_Ljubljana%2C_Slovenia.jpg","page":"https://commons.wikimedia.org/wiki/File:Railway_workshop_museum_exhibition_in_Ljubljana,_Slovenia.jpg","w":4317,"h":3152,"color":"#4e4948","license":"CC BY-SA 4.0","author":"Petar Milošević","subject":"workbench covered with spanners and tools beneath a window","tags":["workshop","workbench","tools","spanners","mechanic","industrial","garage","repair"],"cat":"work","tone":"dark","temp":"cool","people":"none","q":3},{"id":"Blacksmith working 3.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/6/69/Blacksmith_working_3.jpg","page":"https://commons.wikimedia.org/wiki/File:Blacksmith_working_3.jpg","w":4016,"h":4016,"color":"#6a625f","license":"CC BY-SA 4.0","author":"Gurdeepdali","subject":"blacksmith hammering hot iron at a small forge","tags":["blacksmith","forge","iron","hammer","fire","craft","metalwork","maker"],"cat":"craft","tone":"mid","temp":"warm","people":"face","q":2},{"id":"Crafting precision in woodworking at a workshop with a bandsaw during daylight hours.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/8/80/Crafting_precision_in_woodworking_at_a_workshop_with_a_bandsaw_during_daylight_hours.jpg","page":"https://commons.wikimedia.org/wiki/File:Crafting_precision_in_woodworking_at_a_workshop_with_a_bandsaw_during_daylight_hours.jpg","w":6016,"h":4016,"color":"#695543","license":"CC BY 2.0","author":"Shixart1985","subject":"hand guiding a pale plank through a band saw","tags":["woodworking","band saw","hands","carpentry","workshop","maker","craft","joinery"],"cat":"craft","tone":"mid","temp":"neutral","people":"hands","q":2,"fp":[0.4,0.6]},{"id":"Beilstein - Billensbach - Stocksberger Str. 14 - Werkstatt - Fenster mit Hopfenranken (1).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/1/1b/Beilstein_-_Billensbach_-_Stocksberger_Str._14_-_Werkstatt_-_Fenster_mit_Hopfenranken_%281%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Beilstein_-_Billensbach_-_Stocksberger_Str._14_-_Werkstatt_-_Fenster_mit_Hopfenranken_(1).jpg","w":6136,"h":6212,"color":"#8b816f","license":"CC BY-SA 4.0","author":"Roman Eisele","subject":"old workshop window with dried hop vines across the panes","tags":["window","vines","workshop","window light","rustic","autumn","glass","texture"],"cat":"interior","tone":"mid","temp":"warm","people":"none","q":3},{"id":"Nokia Networks Munich Office, April 2017 -02.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/3/3a/Nokia_Networks_Munich_Office%2C_April_2017_-02.jpg","page":"https://commons.wikimedia.org/wiki/File:Nokia_Networks_Munich_Office,_April_2017_-02.jpg","w":5147,"h":3866,"color":"#6e788b","license":"CC BY-SA 4.0","author":"Martin Falbisoner","subject":"looking up a round courtyard of scattered windows to a cloudy sky","tags":["architecture","courtyard","office","windows","sky","modern","round","geometry"],"cat":"architecture","tone":"mid","temp":"cool","people":"none","q":3},{"id":"Interior of Entrepôt Royal (DSCF1176).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/3/39/Interior_of_Entrep%C3%B4t_Royal_%28DSCF1176%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Interior_of_Entrep%C3%B4t_Royal_(DSCF1176).jpg","w":2405,"h":4818,"color":"#837f6a","license":"CC BY 4.0","author":"Trougnouf (Benoit Brummer)","subject":"office atrium with a glass roof and walkways on every floor","tags":["office","atrium","glass roof","walkways","corporate","modern","light","workplace"],"cat":"interior","tone":"light","temp":"neutral","people":"none","q":2},{"id":"CM Deep Ellum 12122018-28 (1).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/3/3a/CM_Deep_Ellum_12122018-28_%281%29.jpg","page":"https://commons.wikimedia.org/wiki/File:CM_Deep_Ellum_12122018-28_(1).jpg","w":5472,"h":3648,"color":"#61584d","license":"CC BY-SA 4.0","author":"Thecommondesk","subject":"coworking space with people at laptops by a big window and plants","tags":["coworking","office","laptops","startup","workspace","plants","people","shared desk"],"cat":"work","tone":"mid","temp":"warm","people":"figure","q":2},{"id":"Cowork Videmonte.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/4b/Cowork_Videmonte.jpg","page":"https://commons.wikimedia.org/wiki/File:Cowork_Videmonte.jpg","w":4000,"h":3000,"color":"#877b6e","license":"CC BY-SA 4.0","author":"Hipersyl","subject":"coworking room with long timber tables, office chairs and a window bench","tags":["coworking","office","desks","timber","workspace","chairs","startup","calm"],"cat":"interior","tone":"light","temp":"warm","people":"none","q":2},{"id":"Münster, LVM, Bürogebäude -- 2013 -- 5149-51.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/3/3a/M%C3%BCnster%2C_LVM%2C_B%C3%BCrogeb%C3%A4ude_--_2013_--_5149-51.jpg","page":"https://commons.wikimedia.org/wiki/File:M%C3%BCnster,_LVM,_B%C3%BCrogeb%C3%A4ude_--_2013_--_5149-51.jpg","w":4111,"h":2741,"color":"#5e7ca0","license":"CC BY-SA 4.0","author":"Dietmar Rabich","subject":"glass office building at blue hour with light trails on the street","tags":["office","building","glass","modern","blue hour","corporate","city","facade"],"cat":"architecture","tone":"mid","temp":"cool","people":"none","q":2},{"id":"Entrance lobby of Amantaka luxury Resort & Hotel at blue hour in Luang Prabang Laos.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/1/1f/Entrance_lobby_of_Amantaka_luxury_Resort_%26_Hotel_at_blue_hour_in_Luang_Prabang_Laos.jpg","page":"https://commons.wikimedia.org/wiki/File:Entrance_lobby_of_Amantaka_luxury_Resort_%26_Hotel_at_blue_hour_in_Luang_Prabang_Laos.jpg","w":6113,"h":3860,"color":"#5c585e","license":"CC BY-SA 4.0","author":"Basile Morin","subject":"hotel entrance at blue hour, a lit doorway framed by blue columns and candles","tags":["hotel","lobby","entrance","blue hour","colonial","resort","candles","evening","luxury"],"cat":"interior","tone":"dark","temp":"cool","people":"none","q":3},{"id":"Escalator, Public Hotel New York (2024)-L1005609.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/a/a0/Escalator%2C_Public_Hotel_New_York_%282024%29-L1005609.jpg","page":"https://commons.wikimedia.org/wiki/File:Escalator,_Public_Hotel_New_York_(2024)-L1005609.jpg","w":6328,"h":9528,"color":"#764423","license":"CC BY-SA 4.0","author":"Frank Schulenburg","subject":"escalator lined with warm gold light, seen from the bottom","tags":["escalator","hotel","gold","light","lobby","nightlife","modern","symmetry"],"cat":"interior","tone":"dark","temp":"warm","people":"none","q":3},{"id":"Symmetric view of the staircase at The Fullerton Hotel Singapore.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/c/c5/Symmetric_view_of_the_staircase_at_The_Fullerton_Hotel_Singapore.jpg","page":"https://commons.wikimedia.org/wiki/File:Symmetric_view_of_the_staircase_at_The_Fullerton_Hotel_Singapore.jpg","w":5692,"h":3202,"color":"#856954","license":"CC BY-SA 4.0","author":"Basile Morin","subject":"hotel lobby with a grand double staircase, orchids and marble","tags":["hotel","lobby","staircase","marble","orchids","luxury","symmetry","grand"],"cat":"interior","tone":"mid","temp":"warm","people":"none","q":2},{"id":"1 Hotel Miami Beach May 2015 (41).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/7b/1_Hotel_Miami_Beach_May_2015_%2841%29.jpg","page":"https://commons.wikimedia.org/wiki/File:1_Hotel_Miami_Beach_May_2015_(41).jpg","w":7216,"h":5412,"color":"#8f857b","license":"CC BY-SA 4.0","author":"Clairecato321","subject":"hotel lobby with white sofas, a driftwood sculpture and a timber ceiling","tags":["hotel","lobby","lounge","sofas","driftwood","resort","beach","calm"],"cat":"interior","tone":"light","temp":"warm","people":"none","q":2},{"id":"Spiral stairs (Art Deco, Nebotičnik, Ljubljana).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/20/Spiral_stairs_%28Art_Deco%2C_Neboti%C4%8Dnik%2C_Ljubljana%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Spiral_stairs_(Art_Deco,_Neboti%C4%8Dnik,_Ljubljana).jpg","w":3031,"h":2815,"color":"#70706f","license":"CC BY-SA 4.0","author":"Petar Milošević","subject":"spiral staircase seen from below in black and white","tags":["staircase","spiral","black and white","stairwell","art deco","geometry","architecture","abstract"],"cat":"architecture","tone":"light","temp":"neutral","people":"none","q":3},{"id":"Staircase of the BGK Building (26620981474).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/95/Staircase_of_the_BGK_Building_%2826620981474%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Staircase_of_the_BGK_Building_(26620981474).jpg","w":3840,"h":2160,"color":"#65625e","license":"CC0","author":"Bart Lumber","subject":"white stair edges in a dark stairwell beside a round glowing wall lamp","tags":["staircase","stairwell","lamp","minimal","modern","dark","geometry","light"],"cat":"interior","tone":"dark","temp":"warm","people":"none","q":3,"fp":[0.75,0.5]},{"id":"Lamp with a lampshade illuminated by sunlight.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/2f/Lamp_with_a_lampshade_illuminated_by_sunlight.jpg","page":"https://commons.wikimedia.org/wiki/File:Lamp_with_a_lampshade_illuminated_by_sunlight.jpg","w":3877,"h":5323,"color":"#998d77","license":"CC BY-SA 4.0","author":"LoMit","subject":"table lamp caught in hard sunlight with its shadow on a wall","tags":["lamp","sunlight","shadow","window light","wall","minimal","home","calm"],"cat":"interior","tone":"light","temp":"warm","people":"none","q":3},{"id":"Heiligengrabe, Kloster Stift zum Heiligengrabe, Abtei, Kreuzgang, Kapelle -- 2017 -- 7218-24.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/d/d8/Heiligengrabe%2C_Kloster_Stift_zum_Heiligengrabe%2C_Abtei%2C_Kreuzgang%2C_Kapelle_--_2017_--_7218-24.jpg","page":"https://commons.wikimedia.org/wiki/File:Heiligengrabe,_Kloster_Stift_zum_Heiligengrabe,_Abtei,_Kreuzgang,_Kapelle_--_2017_--_7218-24.jpg","w":3111,"h":4667,"color":"#86745a","license":"CC BY-SA 4.0","author":"Dietmar Rabich","subject":"deep stone window with leaded glass set in a pale cloister wall","tags":["window","stone","leaded glass","cloister","window light","calm","monastery","niche"],"cat":"interior","tone":"mid","temp":"warm","people":"none","q":3},{"id":"La Fenice Opera House from the stage.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/e2/La_Fenice_Opera_House_from_the_stage.jpg","page":"https://commons.wikimedia.org/wiki/File:La_Fenice_Opera_House_from_the_stage.jpg","w":3724,"h":2960,"color":"#875f4f","license":"CC BY-SA 4.0","author":"Pietro Tessarin","subject":"opera house auditorium from the stage, gilded boxes and red seats","tags":["theatre","opera house","auditorium","boxes","gilded","red seats","venice","performance"],"cat":"interior","tone":"mid","temp":"warm","people":"none","q":3},{"id":"Jinan Grand Theater-20150520-RM-170343.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/1/17/Jinan_Grand_Theater-20150520-RM-170343.jpg","page":"https://commons.wikimedia.org/wiki/File:Jinan_Grand_Theater-20150520-RM-170343.jpg","w":4418,"h":3314,"color":"#977a5d","license":"CC BY-SA 4.0","author":"Ermell","subject":"theatre foyer with timber-ribbed walls rising to a long skylight","tags":["theatre","foyer","timber","skylight","modern","architecture","concert hall","curves"],"cat":"interior","tone":"mid","temp":"warm","people":"none","q":3},{"id":"Shenzhen Concert Hall Foyer-20110101-RM-231522.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/3/32/Shenzhen_Concert_Hall_Foyer-20110101-RM-231522.jpg","page":"https://commons.wikimedia.org/wiki/File:Shenzhen_Concert_Hall_Foyer-20110101-RM-231522.jpg","w":3000,"h":4000,"color":"#51524c","license":"CC BY-SA 4.0","author":"Ermell","subject":"concert hall foyer with a glass lattice wall and timber columns","tags":["concert hall","foyer","glass","lattice","timber","modern","architecture","stairs"],"cat":"interior","tone":"mid","temp":"cool","people":"none","q":2},{"id":"Pinacoteca de São Paulo 6.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/2e/Pinacoteca_de_S%C3%A3o_Paulo_6.jpg","page":"https://commons.wikimedia.org/wiki/File:Pinacoteca_de_S%C3%A3o_Paulo_6.jpg","w":6000,"h":4000,"color":"#745b4a","license":"CC0","author":"Wilfredor","subject":"gallery with brick walls, hanging glass lamps and rocking chairs on a rug","tags":["gallery","museum","installation","lamps","rocking chairs","brick","art","exhibition"],"cat":"interior","tone":"mid","temp":"warm","people":"none","q":3},{"id":"Pinacoteca de Sao Paulo.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/fe/Pinacoteca_de_Sao_Paulo.jpg","page":"https://commons.wikimedia.org/wiki/File:Pinacoteca_de_Sao_Paulo.jpg","w":4869,"h":3307,"color":"#4f4f4f","license":"CC0","author":"Wilfredor","subject":"black and white gallery corridor with a seated statue in a shaft of sun","tags":["gallery","museum","sculpture","corridor","black and white","sunlight","art","columns"],"cat":"interior","tone":"dark","temp":"neutral","people":"none","q":3},{"id":"Christchurch art gallery interior 002.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/1/1c/Christchurch_art_gallery_interior_002.jpg","page":"https://commons.wikimedia.org/wiki/File:Christchurch_art_gallery_interior_002.jpg","w":4592,"h":3064,"color":"#cca47b","license":"CC BY-SA 4.0","author":"Sgerbic","subject":"gallery room with grey walls, framed paintings and a bench on timber floor","tags":["gallery","museum","paintings","art","exhibition","bench","timber floor","white cube"],"cat":"interior","tone":"light","temp":"warm","people":"none","q":2},{"id":"Solomon R. Guggenheim Museum skylight.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/5/5a/Solomon_R._Guggenheim_Museum_skylight.jpg","page":"https://commons.wikimedia.org/wiki/File:Solomon_R._Guggenheim_Museum_skylight.jpg","w":7215,"h":4815,"color":"#7c7c7c","license":"CC BY-SA 4.0","author":"T meltzer","subject":"spiral museum skylight seen from below in black and white","tags":["museum","skylight","spiral","guggenheim","ceiling","architecture","abstract","gallery"],"cat":"architecture","tone":"light","temp":"neutral","people":"none","q":3},{"id":"Exterior view of the illuminated facade of Maison Hermès, Ginza, Tokyo, Japan.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/e5/Exterior_view_of_the_illuminated_facade_of_Maison_Herm%C3%A8s%2C_Ginza%2C_Tokyo%2C_Japan.jpg","page":"https://commons.wikimedia.org/wiki/File:Exterior_view_of_the_illuminated_facade_of_Maison_Herm%C3%A8s,_Ginza,_Tokyo,_Japan.jpg","w":5396,"h":3597,"color":"#604d38","license":"CC BY-SA 4.0","author":"Basile Morin","subject":"glass block facade glowing warm at night","tags":["facade","glass block","night","modern","architecture","luxury","retail","glow"],"cat":"architecture","tone":"dark","temp":"warm","people":"none","q":3},{"id":"Fragment of 160 Front Street West, Toronto.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/a/a6/Fragment_of_160_Front_Street_West%2C_Toronto.jpg","page":"https://commons.wikimedia.org/wiki/File:Fragment_of_160_Front_Street_West,_Toronto.jpg","w":9504,"h":6336,"color":"#324f6e","license":"CC BY-SA 4.0","author":"Maksim Sokolov","subject":"curved blue glass facade in diagonal panels","tags":["facade","glass","curve","modern","architecture","blue","abstract","office"],"cat":"architecture","tone":"mid","temp":"cool","people":"none","q":3},{"id":"Münster, Westdeutsche Lotterie -- 2018 -- 0417.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/b4/M%C3%BCnster%2C_Westdeutsche_Lotterie_--_2018_--_0417.jpg","page":"https://commons.wikimedia.org/wiki/File:M%C3%BCnster,_Westdeutsche_Lotterie_--_2018_--_0417.jpg","w":6467,"h":4311,"color":"#494647","license":"CC BY-SA 4.0","author":"Dietmar Rabich","subject":"dark facade with rows of reflective windows","tags":["facade","dark","windows","reflections","modern","architecture","office","grid"],"cat":"architecture","tone":"dark","temp":"neutral","people":"none","q":2},{"id":"Pörtschach 10.-Oktober-Straße 27 Telekommunikationsgebäude Sichtbeton 30012022 2068.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/91/P%C3%B6rtschach_10.-Oktober-Stra%C3%9Fe_27_Telekommunikationsgeb%C3%A4ude_Sichtbeton_30012022_2068.jpg","page":"https://commons.wikimedia.org/wiki/File:P%C3%B6rtschach_10.-Oktober-Stra%C3%9Fe_27_Telekommunikationsgeb%C3%A4ude_Sichtbeton_30012022_2068.jpg","w":7360,"h":4912,"color":"#898a95","license":"CC BY-SA 4.0","author":"Johann Jaritz","subject":"board-marked vertical concrete wall in soft light","tags":["concrete","brutalist","texture","wall","board-marked","raw","grey","architecture"],"cat":"texture","tone":"light","temp":"neutral","people":"none","q":2},{"id":"Vitoria - Adurza - Iturritxu -BT- 03.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/29/Vitoria_-_Adurza_-_Iturritxu_-BT-_03.jpg","page":"https://commons.wikimedia.org/wiki/File:Vitoria_-_Adurza_-_Iturritxu_-BT-_03.jpg","w":4506,"h":2580,"color":"#a29894","license":"CC BY-SA 4.0","author":"Basotxerri","subject":"two shuttered windows in a rough pebbled concrete wall","tags":["concrete","windows","shutters","facade","brutalist","texture","housing","grey"],"cat":"architecture","tone":"mid","temp":"neutral","people":"none","q":2},{"id":"Rauman vesitorni 4.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/a/aa/Rauman_vesitorni_4.jpg","page":"https://commons.wikimedia.org/wiki/File:Rauman_vesitorni_4.jpg","w":2000,"h":3000,"color":"#6d7780","license":"CC BY-SA 3.0","author":"kallerna","subject":"concrete water tower piers rising against a deep blue sky","tags":["concrete","brutalist","water tower","piers","sky","architecture","modernist","geometry"],"cat":"architecture","tone":"mid","temp":"cool","people":"none","q":3},{"id":"Overpass at Bowen Place, Canberra ACT.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/b8/Overpass_at_Bowen_Place%2C_Canberra_ACT.jpg","page":"https://commons.wikimedia.org/wiki/File:Overpass_at_Bowen_Place,_Canberra_ACT.jpg","w":4895,"h":3671,"color":"#79706f","license":"CC BY-SA 4.0","author":"Thennicke","subject":"underpass with a rusted steel wall under a concrete canopy","tags":["concrete","corten","underpass","brutalist","steel","path","urban","architecture"],"cat":"architecture","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Chaumière Saint-Philbert2.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/c/cf/Chaumi%C3%A8re_Saint-Philbert2.jpg","page":"https://commons.wikimedia.org/wiki/File:Chaumi%C3%A8re_Saint-Philbert2.jpg","w":5999,"h":3120,"color":"#5e6a58","license":"CC0","author":"Jebulon","subject":"thatched half-timbered cottage on a green lawn among trees","tags":["cottage","thatched roof","half-timbered","normandy","lawn","country","rural","holiday home"],"cat":"architecture","tone":"light","temp":"warm","people":"none","q":2},{"id":"Farmhouse at Kelvin A. Lewis farm in Creeds 7.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/29/Farmhouse_at_Kelvin_A._Lewis_farm_in_Creeds_7.jpg","page":"https://commons.wikimedia.org/wiki/File:Farmhouse_at_Kelvin_A._Lewis_farm_in_Creeds_7.jpg","w":8025,"h":5350,"color":"#674d3b","license":"CC BY-SA 3.0","author":"PumpkinSky","subject":"farmhouse with a long porch lit by low golden evening sun","tags":["farmhouse","porch","golden hour","rural","america","country","evening","home"],"cat":"architecture","tone":"mid","temp":"warm","people":"none","q":3},{"id":"Window and unfinished thatch roof Normandy.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/40/Window_and_unfinished_thatch_roof_Normandy.jpg","page":"https://commons.wikimedia.org/wiki/File:Window_and_unfinished_thatch_roof_Normandy.jpg","w":6064,"h":4000,"color":"#6f7377","license":"CC0","author":"Jebulon","subject":"dormer window set in a thick thatched roof under a blue sky","tags":["thatch","roof","dormer","window","cottage","craft","texture","rural"],"cat":"architecture","tone":"mid","temp":"warm","people":"none","q":2},{"id":"At Chiltern Open Air Museum 2024 010.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/73/At_Chiltern_Open_Air_Museum_2024_010.jpg","page":"https://commons.wikimedia.org/wiki/File:At_Chiltern_Open_Air_Museum_2024_010.jpg","w":6099,"h":4640,"color":"#a58772","license":"CC BY-SA 4.0","author":"Mike Peel","subject":"timber frame barn wall with braces over old brick infill","tags":["barn","timber frame","brick","wall","texture","rustic","farm","carpentry"],"cat":"texture","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Red Barn Ontario (2231)-Relic38.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/0/07/Red_Barn_Ontario_%282231%29-Relic38.jpg","page":"https://commons.wikimedia.org/wiki/File:Red_Barn_Ontario_(2231)-Relic38.jpg","w":3888,"h":2592,"color":"#84795f","license":"CC BY-SA 3.0","author":"Darren Swim","subject":"red barn behind a field of round hay bales at golden hour","tags":["barn","red barn","hay bales","field","farm","golden hour","ontario","countryside"],"cat":"landscape","tone":"mid","temp":"warm","people":"none","q":3,"fp":[0.6,0.45]},{"id":"Matsalu onn.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/c/c7/Matsalu_onn.jpg","page":"https://commons.wikimedia.org/wiki/File:Matsalu_onn.jpg","w":6687,"h":4463,"color":"#76705e","license":"CC BY-SA 3.0","author":"Abrget47j","subject":"wooden hut at the end of a plank walkway through reeds and trees","tags":["hut","barn","wooden","walkway","reeds","forest","rustic","calm"],"cat":"landscape","tone":"mid","temp":"neutral","people":"none","q":3},{"id":"Zwischenahn Scheune Museum 1250847.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/8/8a/Zwischenahn_Scheune_Museum_1250847.jpg","page":"https://commons.wikimedia.org/wiki/File:Zwischenahn_Scheune_Museum_1250847.jpg","w":4000,"h":3000,"color":"#7b775c","license":"CC BY-SA 4.0","author":"Ermell","subject":"moss-covered thatched barn with timber and wattle walls","tags":["barn","thatch","moss","timber","wattle","farm","heritage","rustic"],"cat":"architecture","tone":"mid","temp":"warm","people":"none","q":2},{"id":"342 East Church Street Frederick MD1.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/fb/342_East_Church_Street_Frederick_MD1.jpg","page":"https://commons.wikimedia.org/wiki/File:342_East_Church_Street_Frederick_MD1.jpg","w":5874,"h":5807,"color":"#a3a19d","license":"CC BY-SA 4.0","author":"Acroterion","subject":"pale painted brick townhouse with green shutters and a small front yard","tags":["townhouse","house","brick","shutters","facade","street","residential","home"],"cat":"architecture","tone":"light","temp":"cool","people":"none","q":2},{"id":"Small greenhouse with grapevines escaping.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/b1/Small_greenhouse_with_grapevines_escaping.jpg","page":"https://commons.wikimedia.org/wiki/File:Small_greenhouse_with_grapevines_escaping.jpg","w":8972,"h":5645,"color":"#797e4d","license":"CC0","author":"W.carter","subject":"small glass greenhouse with vines escaping through the roof","tags":["greenhouse","glasshouse","vines","garden","allotment","grow","plants","gardening"],"cat":"architecture","tone":"light","temp":"cool","people":"none","q":2},{"id":"Greenhouse-like gallery, left wing of the Royal Castle, Laeken, 2026.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/1/1c/Greenhouse-like_gallery%2C_left_wing_of_the_Royal_Castle%2C_Laeken%2C_2026.jpg","page":"https://commons.wikimedia.org/wiki/File:Greenhouse-like_gallery,_left_wing_of_the_Royal_Castle,_Laeken,_2026.jpg","w":5568,"h":3712,"color":"#61666a","license":"CC0","author":"DimiTalen","subject":"curved iron and glass conservatory wall with stone base","tags":["greenhouse","conservatory","glass","iron","victorian","architecture","palm house","detail"],"cat":"architecture","tone":"mid","temp":"cool","people":"none","q":2},{"id":"Walbrzych Palm House greenhouse interior 2019.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/78/Walbrzych_Palm_House_greenhouse_interior_2019.jpg","page":"https://commons.wikimedia.org/wiki/File:Walbrzych_Palm_House_greenhouse_interior_2019.jpg","w":4836,"h":3224,"color":"#565d4b","license":"CC BY-SA 4.0","author":"Adrian Tync","subject":"long glasshouse path between clipped hedges under a glass roof","tags":["greenhouse","glasshouse","path","hedges","plants","garden","botanical","green"],"cat":"interior","tone":"mid","temp":"cool","people":"none","q":2},{"id":"Palm House, Royal Botanic Garden Edinburgh.JPG","file":"https://upload.wikimedia.org/wikipedia/commons/f/f8/Palm_House%2C_Royal_Botanic_Garden_Edinburgh.JPG","page":"https://commons.wikimedia.org/wiki/File:Palm_House,_Royal_Botanic_Garden_Edinburgh.JPG","w":4288,"h":3216,"color":"#757f7e","license":"CC BY-SA 3.0","author":"Ham","subject":"victorian palm house with a stone base and palms on a lawn","tags":["greenhouse","palm house","victorian","glass dome","botanical garden","edinburgh","lawn","palms"],"cat":"architecture","tone":"light","temp":"cool","people":"none","q":2},{"id":"York Minster Nave 2, Nth Yorkshire, UK - Diliff.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/8/8e/York_Minster_Nave_2%2C_Nth_Yorkshire%2C_UK_-_Diliff.jpg","page":"https://commons.wikimedia.org/wiki/File:York_Minster_Nave_2,_Nth_Yorkshire,_UK_-_Diliff.jpg","w":10000,"h":7059,"color":"#7e6748","license":"CC BY-SA 3.0","author":"Diliff","subject":"cathedral nave with stained glass windows and rows of chairs","tags":["cathedral","nave","church","stained glass","gothic","chairs","york","heritage"],"cat":"interior","tone":"mid","temp":"warm","people":"none","q":3},{"id":"Dülmen, Heilig-Kreuz-Kirche, Innenansicht -- 2019 -- 3022-6.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/20/D%C3%BClmen%2C_Heilig-Kreuz-Kirche%2C_Innenansicht_--_2019_--_3022-6.jpg","page":"https://commons.wikimedia.org/wiki/File:D%C3%BClmen,_Heilig-Kreuz-Kirche,_Innenansicht_--_2019_--_3022-6.jpg","w":6183,"h":4123,"color":"#867b72","license":"CC BY-SA 4.0","author":"Dietmar Rabich","subject":"minimal white church with grid ceiling and pendant lights reflected in floor","tags":["church","minimal","modern","white","pendant lights","reflection","chapel","calm"],"cat":"interior","tone":"light","temp":"neutral","people":"none","q":3},{"id":"Canterbury Cathedral Tower Ceiling.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/23/Canterbury_Cathedral_Tower_Ceiling.jpg","page":"https://commons.wikimedia.org/wiki/File:Canterbury_Cathedral_Tower_Ceiling.jpg","w":5634,"h":5628,"color":"#a78c70","license":"CC0","author":"Michael D Beckwith","subject":"fan-vaulted stone tower ceiling seen straight up","tags":["cathedral","ceiling","fan vault","gothic","stone","symmetry","abstract","church"],"cat":"architecture","tone":"mid","temp":"warm","people":"none","q":3},{"id":"Prague Main Railway Station Ceiling Lights.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/70/Prague_Main_Railway_Station_Ceiling_Lights.jpg","page":"https://commons.wikimedia.org/wiki/File:Prague_Main_Railway_Station_Ceiling_Lights.jpg","w":6795,"h":4530,"color":"#763a2d","license":"CC0","author":"AVDLCZ","subject":"red ceiling lights in a station hall seen from below","tags":["station","ceiling","lights","red","retro","railway","abstract","pattern"],"cat":"interior","tone":"dark","temp":"warm","people":"none","q":3},{"id":"Great Hall, Washington Union Station (2024)-L1005585.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/99/Great_Hall%2C_Washington_Union_Station_%282024%29-L1005585.jpg","page":"https://commons.wikimedia.org/wiki/File:Great_Hall,_Washington_Union_Station_(2024)-L1005585.jpg","w":7916,"h":6859,"color":"#b39779","license":"CC BY-SA 4.0","author":"Frank Schulenburg","subject":"vaulted station hall with coffered ceiling and arched windows","tags":["station","hall","vault","coffered ceiling","arches","grand","railway","travel"],"cat":"interior","tone":"light","temp":"warm","people":"figure","q":3},{"id":"Kings Cross Western Concourse (geograph 2863932).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/8/88/Kings_Cross_Western_Concourse_%28geograph_2863932%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Kings_Cross_Western_Concourse_(geograph_2863932).jpg","w":3581,"h":2383,"color":"#524849","license":"CC BY-SA 2.0","author":"Peter Trimming","subject":"lattice roof of a station concourse lit purple","tags":["station","roof","lattice","concourse","purple","modern","railway","architecture"],"cat":"architecture","tone":"dark","temp":"cool","people":"none","q":2},{"id":"The Concourse of TAIYUANNANZHAN Station in Taiyuan 2025 (edited).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/a/a7/The_Concourse_of_TAIYUANNANZHAN_Station_in_Taiyuan_2025_%28edited%29.jpg","page":"https://commons.wikimedia.org/wiki/File:The_Concourse_of_TAIYUANNANZHAN_Station_in_Taiyuan_2025_(edited).jpg","w":5553,"h":4232,"color":"#605f5c","license":"CC BY-SA 4.0","author":"Kmchang28","subject":"station concourse with glowing arches reflected in a polished floor","tags":["station","concourse","arches","futuristic","reflection","modern","railway","travel"],"cat":"interior","tone":"light","temp":"cool","people":"none","q":3},{"id":"Pumori, Nepal, Asia.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/3/3c/Pumori%2C_Nepal%2C_Asia.jpg","page":"https://commons.wikimedia.org/wiki/File:Pumori,_Nepal,_Asia.jpg","w":3815,"h":2688,"color":"#4b5766","license":"CC BY 4.0","author":"Vyacheslav Argenberg","subject":"sunlit snow and rock pyramid peak against a deep blue sky","tags":["mountain","peak","snow","himalaya","summit","expedition","outdoor","climbing","adventure","blue sky"],"cat":"landscape","tone":"mid","temp":"cool","people":"none","q":3,"fp":[0.55,0.4]},{"id":"Winter in Tatry Mountains - Poland.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/4e/Winter_in_Tatry_Mountains_-_Poland.jpg","page":"https://commons.wikimedia.org/wiki/File:Winter_in_Tatry_Mountains_-_Poland.jpg","w":7952,"h":4473,"color":"#8891a3","license":"CC BY 4.0","author":"Radek Kucharski","subject":"wind sculpted snowy mountain ridge in soft cloud light","tags":["mountain","ridge","snow","winter","alpine","clouds","outdoor","calm","white","cold"],"cat":"landscape","tone":"light","temp":"cool","people":"none","q":3},{"id":"Mountain Peak, Alaska (1999).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/e8/Mountain_Peak%2C_Alaska_%281999%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Mountain_Peak,_Alaska_(1999).jpg","w":4065,"h":2615,"color":"#777777","license":"CC BY-SA 4.0","author":"Godot13","subject":"black and white rocky peak with glacier snow beneath a heavy sky","tags":["mountain","peak","black and white","glacier","rock","dramatic","monochrome","outdoor","editorial"],"cat":"landscape","tone":"dark","temp":"neutral","people":"none","q":2,"fp":[0.4,0.4]},{"id":"Groomed skirun from Seceda Val Gardena.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/d/da/Groomed_skirun_from_Seceda_Val_Gardena.jpg","page":"https://commons.wikimedia.org/wiki/File:Groomed_skirun_from_Seceda_Val_Gardena.jpg","w":7360,"h":4912,"color":"#738798","license":"CC BY-SA 3.0","author":"This Photo was taken by Wolfgang Moroder. Feel free to use my photos, but please","subject":"groomed ski run with tracks below a rocky dolomite peak on a clear day","tags":["ski","slope","piste","snow","dolomites","resort","winter","mountain","skiing","holiday"],"cat":"sport","tone":"light","temp":"cool","people":"figure","q":3},{"id":"Ski lift Derby crosses Bosses slope, Peisey-Vallandry, 2020.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/9c/Ski_lift_Derby_crosses_Bosses_slope%2C_Peisey-Vallandry%2C_2020.jpg","page":"https://commons.wikimedia.org/wiki/File:Ski_lift_Derby_crosses_Bosses_slope,_Peisey-Vallandry,_2020.jpg","w":5893,"h":3918,"color":"#969ca7","license":"CC0","author":"DimiTalen","subject":"chairlift over a snowy run between larch trees toward white peaks","tags":["chairlift","ski","lift","snow","resort","winter","mountain","larch","skiing","holiday"],"cat":"sport","tone":"light","temp":"cool","people":"none","q":2,"fp":[0.3,0.4]},{"id":"Lukmanierpass, Passo del Lucomagno. 20-09-2022. (actm.) 26.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/ef/Lukmanierpass%2C_Passo_del_Lucomagno._20-09-2022._%28actm.%29_26.jpg","page":"https://commons.wikimedia.org/wiki/File:Lukmanierpass,_Passo_del_Lucomagno._20-09-2022._(actm.)_26.jpg","w":4608,"h":2998,"color":"#878977","license":"CC BY-SA 4.0","author":"Agnes Monkelbaan","subject":"old dry stone alpine hut with slate roof on a green pasture below peaks","tags":["alpine hut","stone","hut","mountain","pasture","rustic","refuge","cabin","hiking","farm"],"cat":"architecture","tone":"mid","temp":"warm","people":"none","q":3,"fp":[0.55,0.55]},{"id":"Mountain hut Ciadinat Sëlva.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/0/05/Mountain_hut_Ciadinat_S%C3%ABlva.jpg","page":"https://commons.wikimedia.org/wiki/File:Mountain_hut_Ciadinat_S%C3%ABlva.jpg","w":7360,"h":4912,"color":"#747b83","license":"CC BY-SA 3.0","author":"This Photo was taken by Wolfgang Moroder. Feel free to use my photos, but please","subject":"wooden mountain hut with green shutters in snow below a limestone cliff","tags":["mountain hut","chalet","wood","snow","winter","dolomites","refuge","hospitality","cabin","alpine"],"cat":"architecture","tone":"light","temp":"cool","people":"none","q":3,"fp":[0.4,0.6]},{"id":"Malga alla Colma di Toceno - Val Vigezzo, Toceno VCO, Piedmont, Italy 2020-09-12.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/44/Malga_alla_Colma_di_Toceno_-_Val_Vigezzo%2C_Toceno_VCO%2C_Piedmont%2C_Italy_2020-09-12.jpg","page":"https://commons.wikimedia.org/wiki/File:Malga_alla_Colma_di_Toceno_-_Val_Vigezzo,_Toceno_VCO,_Piedmont,_Italy_2020-09-12.jpg","w":3794,"h":2846,"color":"#6f787d","license":"CC BY-SA 4.0","author":"Mænsard vokser","subject":"pair of grey stone huts on a grassy slope with fir trees and blue sky","tags":["stone hut","alpine","farm","rustic","mountain","pasture","malga","cabin","rural","heritage"],"cat":"architecture","tone":"mid","temp":"cool","people":"none","q":2},{"id":"Olkhon Island, Capes, cliffs at sunset, Lake Baikal, Russia.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/47/Olkhon_Island%2C_Capes%2C_cliffs_at_sunset%2C_Lake_Baikal%2C_Russia.jpg","page":"https://commons.wikimedia.org/wiki/File:Olkhon_Island,_Capes,_cliffs_at_sunset,_Lake_Baikal,_Russia.jpg","w":4912,"h":3264,"color":"#92806c","license":"CC BY 4.0","author":"Vyacheslav Argenberg","subject":"golden limestone cliffs glowing at sunset over a calm wide lake","tags":["cliffs","coast","sunset","golden hour","headland","shore","water","travel","dramatic","rock"],"cat":"landscape","tone":"mid","temp":"warm","people":"none","q":3,"fp":[0.6,0.6]},{"id":"Dover White Cliffs 1.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/6/66/Dover_White_Cliffs_1.jpg","page":"https://commons.wikimedia.org/wiki/File:Dover_White_Cliffs_1.jpg","w":4580,"h":5000,"color":"#778285","license":"CC BY-SA 4.0","author":"kallerna","subject":"white chalk cliff face dropping to the sea in low warm light","tags":["chalk cliffs","coast","sea","white cliffs","england","shore","dover","portrait","headland","walking"],"cat":"landscape","tone":"mid","temp":"warm","people":"none","q":3},{"id":"Sea caves Cape Greco 2.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/c/c1/Sea_caves_Cape_Greco_2.jpg","page":"https://commons.wikimedia.org/wiki/File:Sea_caves_Cape_Greco_2.jpg","w":5000,"h":3260,"color":"#7e7468","license":"CC BY-SA 4.0","author":"kallerna","subject":"rock arch of a sea cave framing waves and a cliff line","tags":["sea cave","rock arch","coast","waves","cyprus","limestone","sea","travel","mediterranean","rugged"],"cat":"landscape","tone":"mid","temp":"warm","people":"none","q":3,"fp":[0.35,0.6]},{"id":"Rügen, Beach at Sellin -- 2009 -- 1173.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/0/0a/R%C3%BCgen%2C_Beach_at_Sellin_--_2009_--_1173.jpg","page":"https://commons.wikimedia.org/wiki/File:R%C3%BCgen,_Beach_at_Sellin_--_2009_--_1173.jpg","w":4000,"h":3000,"color":"#8d8c85","license":"CC BY-SA 4.0","author":"Dietmar Rabich","subject":"rows of white hooded wicker beach chairs on pale sand seen from above","tags":["beach","beach chairs","strandkorb","sand","baltic","holiday","pattern","seaside","summer","resort"],"cat":"travel","tone":"light","temp":"neutral","people":"figure","q":2},{"id":"Parasols, Evening, Beach, Rincon de la Victoria, Andalusia, Spain.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/98/Parasols%2C_Evening%2C_Beach%2C_Rincon_de_la_Victoria%2C_Andalusia%2C_Spain.jpg","page":"https://commons.wikimedia.org/wiki/File:Parasols,_Evening,_Beach,_Rincon_de_la_Victoria,_Andalusia,_Spain.jpg","w":4592,"h":3056,"color":"#918874","license":"CC0","author":"Jebulon","subject":"straw parasols and folded sunbeds on an empty beach at evening, waves behind","tags":["beach","parasols","sand","sea","resort","holiday","evening","summer","spain","hotel"],"cat":"travel","tone":"mid","temp":"warm","people":"none","q":3,"fp":[0.5,0.6]},{"id":"Mystic Beach, Vancouver Island, Canada 10.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/b9/Mystic_Beach%2C_Vancouver_Island%2C_Canada_10.jpg","page":"https://commons.wikimedia.org/wiki/File:Mystic_Beach,_Vancouver_Island,_Canada_10.jpg","w":5199,"h":2629,"color":"#757878","license":"CC BY-SA 4.0","author":"Michal Klajban","subject":"smooth wet sand reflecting a forested sandstone headland at dusk","tags":["beach","headland","dusk","sand","pacific","forest","coast","calm","long exposure","reflection"],"cat":"landscape","tone":"mid","temp":"cool","people":"none","q":3,"fp":[0.3,0.4]},{"id":"Peterborough (AU), Port Campbell National Park, Worm Bay -- 2019 -- 0863.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/e2/Peterborough_%28AU%29%2C_Port_Campbell_National_Park%2C_Worm_Bay_--_2019_--_0863.jpg","page":"https://commons.wikimedia.org/wiki/File:Peterborough_(AU),_Port_Campbell_National_Park,_Worm_Bay_--_2019_--_0863.jpg","w":6718,"h":4479,"color":"#a99a88","license":"CC BY-SA 4.0","author":"Dietmar Rabich","subject":"silky waves washing over golden sand below orange sandstone rocks","tags":["beach","sand","rocks","long exposure","waves","coast","golden","australia","sea","calm"],"cat":"landscape","tone":"mid","temp":"warm","people":"none","q":3,"fp":[0.35,0.4]},{"id":"2010 mavericks competition edit1.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/d/d1/2010_mavericks_competition_edit1.jpg","page":"https://commons.wikimedia.org/wiki/File:2010_mavericks_competition_edit1.jpg","w":3600,"h":2380,"color":"#848b96","license":"CC BY-SA 2.0","author":"Shalom Jacobovitz","subject":"surfer dropping down the face of a huge curling wave","tags":["surf","wave","surfer","ocean","big wave","sport","adventure","action","sea","spray"],"cat":"sport","tone":"mid","temp":"cool","people":"figure","q":3,"fp":[0.3,0.4]},{"id":"Porto Covo July 2011-6.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/44/Porto_Covo_July_2011-6.jpg","page":"https://commons.wikimedia.org/wiki/File:Porto_Covo_July_2011-6.jpg","w":3134,"h":1846,"color":"#587e77","license":"CC BY-SA 3.0","author":"Alvesgaspar","subject":"aerial view of green surf lines breaking over a sandbar with one swimmer","tags":["sea","waves","aerial","surf","green water","swimmer","coast","pattern","summer","drone"],"cat":"landscape","tone":"mid","temp":"cool","people":"figure","q":2,"fp":[0.8,0.5]},{"id":"Lake Kinney mit Mount Whitehorn.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/5/53/Lake_Kinney_mit_Mount_Whitehorn.jpg","page":"https://commons.wikimedia.org/wiki/File:Lake_Kinney_mit_Mount_Whitehorn.jpg","w":4928,"h":3264,"color":"#6a7273","license":"CC BY 3.0","author":"Florian Fuchs","subject":"glassy lake reflecting forest slopes and grey mountains","tags":["lake","reflection","mountains","calm","canada","forest","still water","wilderness","morning","travel"],"cat":"landscape","tone":"mid","temp":"cool","people":"none","q":3},{"id":"Herbert Lake beim Icefields Parkway.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/3/3e/Herbert_Lake_beim_Icefields_Parkway.jpg","page":"https://commons.wikimedia.org/wiki/File:Herbert_Lake_beim_Icefields_Parkway.jpg","w":3239,"h":2160,"color":"#7f8585","license":"CC BY 3.0","author":"Florian Fuchs","subject":"morning mist on a still lake reflecting pines and snowy peaks","tags":["lake","mist","reflection","pine forest","mountains","morning","calm","canada","still water","wilderness"],"cat":"landscape","tone":"mid","temp":"cool","people":"none","q":3},{"id":"Mountain lake, Mylgval mountain cirque before sunset, Caucasus Mountains.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/8/8d/Mountain_lake%2C_Mylgval_mountain_cirque_before_sunset%2C_Caucasus_Mountains.jpg","page":"https://commons.wikimedia.org/wiki/File:Mountain_lake,_Mylgval_mountain_cirque_before_sunset,_Caucasus_Mountains.jpg","w":4912,"h":3264,"color":"#7e7e6c","license":"CC BY 4.0","author":"Vyacheslav Argenberg","subject":"dark cirque lake in a green rocky bowl with evening light on the peaks","tags":["lake","cirque","mountains","evening","caucasus","hiking","alpine","green","rocks","wilderness"],"cat":"landscape","tone":"mid","temp":"warm","people":"none","q":3,"fp":[0.5,0.65]},{"id":"Low tide in Rivedoux, Ré island, august 2015.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/c/c6/Low_tide_in_Rivedoux%2C_R%C3%A9_island%2C_august_2015.jpg","page":"https://commons.wikimedia.org/wiki/File:Low_tide_in_Rivedoux,_R%C3%A9_island,_august_2015.jpg","w":4458,"h":2967,"color":"#888885","license":"CC0","author":"Jebulon","subject":"small motorboat stranded on wet sand flats at low tide","tags":["low tide","boat","tidal flats","sand","shore","sea","harbour","calm","coast","stranded"],"cat":"landscape","tone":"light","temp":"neutral","people":"none","q":3,"fp":[0.5,0.65]},{"id":"Sunset at Acheloos river delta 01.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/90/Sunset_at_Acheloos_river_delta_01.jpg","page":"https://commons.wikimedia.org/wiki/File:Sunset_at_Acheloos_river_delta_01.jpg","w":5374,"h":3583,"color":"#7c7c79","license":"CC BY-SA 4.0","author":"Dimitrios Tzortzis","subject":"old wooden jetty in still delta water reflecting a sunset sky","tags":["estuary","delta","jetty","sunset","dusk","reflection","calm","wetland","water","boardwalk"],"cat":"landscape","tone":"mid","temp":"warm","people":"none","q":3,"fp":[0.75,0.7]},{"id":"A boat rests unused near the Acheloos river delta.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/0/04/A_boat_rests_unused_near_the_Acheloos_river_delta.jpg","page":"https://commons.wikimedia.org/wiki/File:A_boat_rests_unused_near_the_Acheloos_river_delta.jpg","w":5472,"h":3648,"color":"#6d767e","license":"CC BY-SA 4.0","author":"Dimitrios Tzortzis","subject":"small red rowing boat on a mirror calm lagoon under evening clouds","tags":["estuary","lagoon","boat","evening","reflection","calm","delta","fishing","quiet","water"],"cat":"landscape","tone":"mid","temp":"cool","people":"none","q":3,"fp":[0.5,0.55]},{"id":"Estuary mouth.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/9e/Estuary_mouth.jpg","page":"https://commons.wikimedia.org/wiki/File:Estuary_mouth.jpg","w":2024,"h":1323,"color":"#9ba3a4","license":"CC BY 3.0","author":"Bidgee","subject":"calm estuary channel beside a sand spit and a line of pine trees","tags":["estuary","river mouth","sand","pine","calm","shore","tide","coast","evening","quiet"],"cat":"landscape","tone":"light","temp":"cool","people":"none","q":3},{"id":"Fisherman at Gullmarsvik mudflats.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/45/Fisherman_at_Gullmarsvik_mudflats.jpg","page":"https://commons.wikimedia.org/wiki/File:Fisherman_at_Gullmarsvik_mudflats.jpg","w":4192,"h":2358,"color":"#8c9598","license":"CC0","author":"W.carter","subject":"lone fisherman wading beyond dark mudflats in silver water","tags":["mudflats","estuary","fisherman","tide","shore","silver","calm","minimal","coast","low tide"],"cat":"landscape","tone":"light","temp":"cool","people":"figure","q":3,"fp":[0.1,0.15]},{"id":"Beech Forest (AU), Great Otway National Park, Beauchamp Falls -- 2019 -- 1271.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/4e/Beech_Forest_%28AU%29%2C_Great_Otway_National_Park%2C_Beauchamp_Falls_--_2019_--_1271.jpg","page":"https://commons.wikimedia.org/wiki/File:Beech_Forest_(AU),_Great_Otway_National_Park,_Beauchamp_Falls_--_2019_--_1271.jpg","w":6508,"h":4339,"color":"#595a46","license":"CC BY-SA 4.0","author":"Dietmar Rabich","subject":"waterfall in a lush fern and beech rainforest over mossy rocks","tags":["waterfall","forest","rainforest","ferns","moss","stream","nature","green","wilderness","australia"],"cat":"nature","tone":"mid","temp":"cool","people":"none","q":3,"fp":[0.62,0.45]},{"id":"Slezské Beskydy - Rytířská stezka (cesta Nýdek - Velká Čantoryje).JPG","file":"https://upload.wikimedia.org/wikipedia/commons/9/91/Slezsk%C3%A9_Beskydy_-_Ryt%C3%AD%C5%99sk%C3%A1_stezka_%28cesta_N%C3%BDdek_-_Velk%C3%A1_%C4%8Cantoryje%29.JPG","page":"https://commons.wikimedia.org/wiki/File:Slezsk%C3%A9_Beskydy_-_Ryt%C3%AD%C5%99sk%C3%A1_stezka_(cesta_N%C3%BDdek_-_Velk%C3%A1_%C4%8Cantoryje).JPG","w":3000,"h":2000,"color":"#5b5238","license":"CC BY-SA 4.0","author":"Pudelek (Marcin Szala)","subject":"forest track covered in red leaves with sun rays through tall beeches","tags":["forest","path","sun rays","autumn","beech","woodland","walking","trail","morning","leaves"],"cat":"landscape","tone":"mid","temp":"warm","people":"none","q":3},{"id":"Wooden staircase steps in the forest of Hallasan Park Eorimok Trail at dusk on Jeju Island in South Korea.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/5/56/Wooden_staircase_steps_in_the_forest_of_Hallasan_Park_Eorimok_Trail_at_dusk_on_Jeju_Island_in_South_Korea.jpg","page":"https://commons.wikimedia.org/wiki/File:Wooden_staircase_steps_in_the_forest_of_Hallasan_Park_Eorimok_Trail_at_dusk_on_Jeju_Island_in_South_Korea.jpg","w":6392,"h":4319,"color":"#4c5f3f","license":"CC BY-SA 4.0","author":"Basile Morin","subject":"wooden steps climbing through a misty green forest","tags":["forest","steps","trail","mist","hiking","green","woodland","path","jeju","calm"],"cat":"landscape","tone":"mid","temp":"cool","people":"none","q":3,"fp":[0.45,0.6]},{"id":"Dülmen, Göversheide -- 2015 -- 7718-22.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/3/36/D%C3%BClmen%2C_G%C3%B6versheide_--_2015_--_7718-22.jpg","page":"https://commons.wikimedia.org/wiki/File:D%C3%BClmen,_G%C3%B6versheide_--_2015_--_7718-22.jpg","w":3098,"h":4130,"color":"#4d5022","license":"CC BY-SA 4.0","author":"Dietmar Rabich","subject":"sunlight breaking through a dense summer forest onto ferns","tags":["forest","sunlight","woodland","ferns","green","summer","portrait","nature","calm","trees"],"cat":"nature","tone":"mid","temp":"warm","people":"none","q":2,"fp":[0.55,0.3]},{"id":"Fanal (Madeira, Portugal), Lorbeerwald -- 2025 -- 1546.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/2b/Fanal_%28Madeira%2C_Portugal%29%2C_Lorbeerwald_--_2025_--_1546.jpg","page":"https://commons.wikimedia.org/wiki/File:Fanal_(Madeira,_Portugal),_Lorbeerwald_--_2025_--_1546.jpg","w":6720,"h":4480,"color":"#808267","license":"CC BY-SA 4.0","author":"Dietmar Rabich","subject":"moss covered laurel tree trunk in fog with twisted branches","tags":["forest","fog","moss","laurel","madeira","ancient tree","mist","green","mystery","nature"],"cat":"nature","tone":"mid","temp":"cool","people":"none","q":3,"fp":[0.65,0.5]},{"id":"Männikjärve raba tornist.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/75/M%C3%A4nnikj%C3%A4rve_raba_tornist.jpg","page":"https://commons.wikimedia.org/wiki/File:M%C3%A4nnikj%C3%A4rve_raba_tornist.jpg","w":7000,"h":4667,"color":"#a79782","license":"CC BY-SA 3.0","author":"Abrget47j","subject":"boardwalk crossing a raised bog of pools and red moss islands","tags":["bog","moorland","boardwalk","wetland","estonia","pools","walking","nature reserve","autumn","heath"],"cat":"landscape","tone":"mid","temp":"neutral","people":"none","q":3},{"id":"2014 Track on Fremington Edge.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/b1/2014_Track_on_Fremington_Edge.jpg","page":"https://commons.wikimedia.org/wiki/File:2014_Track_on_Fremington_Edge.jpg","w":4608,"h":3456,"color":"#888f8b","license":"CC BY-SA 3.0","author":"Kreuzschnabel","subject":"sandy track across purple heather moor past a lone wind bent tree","tags":["moorland","heather","track","lone tree","yorkshire","walking","purple","upland","hiking","wild"],"cat":"landscape","tone":"mid","temp":"warm","people":"none","q":3,"fp":[0.3,0.4]},{"id":"Haltern am See, Westruper Heide -- 2015 -- 8306-10.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/fe/Haltern_am_See%2C_Westruper_Heide_--_2015_--_8306-10.jpg","page":"https://commons.wikimedia.org/wiki/File:Haltern_am_See,_Westruper_Heide_--_2015_--_8306-10.jpg","w":4570,"h":3061,"color":"#85705d","license":"CC BY-SA 4.0","author":"Dietmar Rabich","subject":"low sun behind a tree over flowering heather heath at dawn","tags":["heath","heather","sunrise","moorland","purple","dawn","golden hour","nature reserve","tree","calm"],"cat":"landscape","tone":"mid","temp":"warm","people":"none","q":3,"fp":[0.55,0.5]},{"id":"Haltern am See, Westruper Heide -- 2015 -- 7965-9.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/3/3c/Haltern_am_See%2C_Westruper_Heide_--_2015_--_7965-9.jpg","page":"https://commons.wikimedia.org/wiki/File:Haltern_am_See,_Westruper_Heide_--_2015_--_7965-9.jpg","w":5462,"h":3647,"color":"#77726e","license":"CC BY-SA 4.0","author":"Dietmar Rabich","subject":"single pine on a heath of flowering heather under a soft sky","tags":["heath","heather","pine","moorland","purple","lone tree","nature","summer","calm","wild"],"cat":"landscape","tone":"mid","temp":"cool","people":"none","q":3,"fp":[0.55,0.5]},{"id":"PalouseFromSteptoeButteMay2023-2.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/d/d0/PalouseFromSteptoeButteMay2023-2.jpg","page":"https://commons.wikimedia.org/wiki/File:PalouseFromSteptoeButteMay2023-2.jpg","w":7996,"h":5331,"color":"#707c67","license":"CC BY 4.0","author":"Caleb Riston","subject":"soft green rolling wheat hills seen from above in morning light","tags":["rolling hills","farmland","fields","palouse","wheat","agriculture","green","rural","aerial","pattern"],"cat":"landscape","tone":"mid","temp":"warm","people":"none","q":3},{"id":"PalouseFromSteptoeButteMay2023-1.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/f1/PalouseFromSteptoeButteMay2023-1.jpg","page":"https://commons.wikimedia.org/wiki/File:PalouseFromSteptoeButteMay2023-1.jpg","w":9068,"h":6045,"color":"#948051","license":"CC0","author":"Caleb Riston","subject":"golden haze over rolling farm hills at sunrise","tags":["rolling hills","farmland","sunrise","golden","fields","haze","agriculture","palouse","rural","calm"],"cat":"landscape","tone":"mid","temp":"warm","people":"none","q":3},{"id":"2014 Fields Swaledale Gunnerside.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/f9/2014_Fields_Swaledale_Gunnerside.jpg","page":"https://commons.wikimedia.org/wiki/File:2014_Fields_Swaledale_Gunnerside.jpg","w":4608,"h":3456,"color":"#6e7d3e","license":"CC BY-SA 3.0","author":"Kreuzschnabel","subject":"stone field barns among drystone walls on green dale meadows","tags":["farmland","drystone walls","field barns","yorkshire dales","meadows","rural","england","green","countryside","stone"],"cat":"landscape","tone":"mid","temp":"warm","people":"none","q":3},{"id":"Wheat and chamomille, Kalkense Meersen, Wetteren, 2026.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/b4/Wheat_and_chamomille%2C_Kalkense_Meersen%2C_Wetteren%2C_2026.jpg","page":"https://commons.wikimedia.org/wiki/File:Wheat_and_chamomille,_Kalkense_Meersen,_Wetteren,_2026.jpg","w":5568,"h":3712,"color":"#7c805a","license":"CC0","author":"DimiTalen","subject":"green wheat ears and white chamomile against a blue sky","tags":["wheat","chamomile","field","grain","summer","farm","flowers","blue sky","agriculture","bakery"],"cat":"nature","tone":"light","temp":"warm","people":"none","q":3},{"id":"Woman harvesting wheat, Raisen district, Madhya Pradesh, India ggia version.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/5/59/Woman_harvesting_wheat%2C_Raisen_district%2C_Madhya_Pradesh%2C_India_ggia_version.jpg","page":"https://commons.wikimedia.org/wiki/File:Woman_harvesting_wheat,_Raisen_district,_Madhya_Pradesh,_India_ggia_version.jpg","w":3532,"h":2472,"color":"#897d65","license":"CC BY-SA 3.0","author":"Yann Forget","subject":"woman in a sari carrying cut wheat sheaves across a harvested field","tags":["wheat","harvest","farmer","field","sheaves","india","agriculture","rural","grain","work"],"cat":"work","tone":"mid","temp":"warm","people":"figure","q":2,"fp":[0.25,0.55]},{"id":"Round hay bales on a field, with hawkweed in the foreground, near Durnal, Yvoir, 2025.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/b8/Round_hay_bales_on_a_field%2C_with_hawkweed_in_the_foreground%2C_near_Durnal%2C_Yvoir%2C_2025.jpg","page":"https://commons.wikimedia.org/wiki/File:Round_hay_bales_on_a_field,_with_hawkweed_in_the_foreground,_near_Durnal,_Yvoir,_2025.jpg","w":5568,"h":3712,"color":"#8b7856","license":"CC0","author":"DimiTalen","subject":"round straw bales scattered over a harvested field with yellow flowers","tags":["straw bales","harvest","field","farm","summer","agriculture","hay","rural","stubble","grain"],"cat":"landscape","tone":"mid","temp":"warm","people":"none","q":3},{"id":"Aerial View - Landschaft Markgräflerland1.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/6/6b/Aerial_View_-_Landschaft_Markgr%C3%A4flerland1.jpg","page":"https://commons.wikimedia.org/wiki/File:Aerial_View_-_Landschaft_Markgr%C3%A4flerland1.jpg","w":3252,"h":2154,"color":"#818535","license":"CC BY 3.0","author":"Taxiarchos228","subject":"curving rows of vines on terraced hills seen from above","tags":["vineyard","vines","terraces","wine","winery","aerial","pattern","green","agriculture","countryside"],"cat":"landscape","tone":"mid","temp":"warm","people":"none","q":3},{"id":"Vineyard in Cabrerolles.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/8/8b/Vineyard_in_Cabrerolles.jpg","page":"https://commons.wikimedia.org/wiki/File:Vineyard_in_Cabrerolles.jpg","w":7013,"h":3945,"color":"#888062","license":"CC BY 4.0","author":"Christian Ferrer","subject":"autumn vines in yellow rows with a single cypress beyond","tags":["vineyard","vines","autumn","wine","winery","cypress","harvest","yellow","mediterranean","rows"],"cat":"landscape","tone":"mid","temp":"warm","people":"none","q":3,"fp":[0.38,0.35]},{"id":"Östringen - Tiefenbach - Kreuzbergkapelle - Situationsansicht von Osten bei Sonnenuntergang.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/5/53/%C3%96stringen_-_Tiefenbach_-_Kreuzbergkapelle_-_Situationsansicht_von_Osten_bei_Sonnenuntergang.jpg","page":"https://commons.wikimedia.org/wiki/File:%C3%96stringen_-_Tiefenbach_-_Kreuzbergkapelle_-_Situationsansicht_von_Osten_bei_Sonnenuntergang.jpg","w":7717,"h":4812,"color":"#846d50","license":"CC BY-SA 4.0","author":"Roman Eisele","subject":"vine rows on a slope toward a small chapel at sunset","tags":["vineyard","sunset","vines","chapel","wine","winery","golden hour","hillside","rows","evening"],"cat":"landscape","tone":"dark","temp":"warm","people":"none","q":2,"fp":[0.45,0.5]},{"id":"Mazet in vineyards, Mèze cf02.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/42/Mazet_in_vineyards%2C_M%C3%A8ze_cf02.jpg","page":"https://commons.wikimedia.org/wiki/File:Mazet_in_vineyards,_M%C3%A8ze_cf02.jpg","w":7360,"h":4140,"color":"#8b9aa1","license":"CC BY 4.0","author":"Christian Ferrer","subject":"small stone farmhouse and two bare trees among winter vines","tags":["vineyard","farmhouse","winter","vines","wine","stone","winery","rural","languedoc","pruned"],"cat":"landscape","tone":"light","temp":"cool","people":"none","q":2,"fp":[0.3,0.5]},{"id":"Flooded walnut orchard in Butte County, California-L1001234.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/6/68/Flooded_walnut_orchard_in_Butte_County%2C_California-L1001234.jpg","page":"https://commons.wikimedia.org/wiki/File:Flooded_walnut_orchard_in_Butte_County,_California-L1001234.jpg","w":8450,"h":5281,"color":"#8e8b8e","license":"CC BY-SA 4.0","author":"Frank Schulenburg","subject":"bare walnut orchard rows standing in flood water","tags":["orchard","walnut","trees","flood","rows","winter","reflection","agriculture","california","farm"],"cat":"landscape","tone":"light","temp":"cool","people":"none","q":3},{"id":"Apple-tree blossoms 2017 G3.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/8/86/Apple-tree_blossoms_2017_G3.jpg","page":"https://commons.wikimedia.org/wiki/File:Apple-tree_blossoms_2017_G3.jpg","w":5500,"h":4000,"color":"#838765","license":"Public domain","author":"George Chernilevsky","subject":"pink and white apple blossom on a branch against a blue sky","tags":["apple blossom","orchard","spring","blossom","pink","flowers","fruit tree","garden","cider","fresh"],"cat":"nature","tone":"light","temp":"warm","people":"none","q":3,"fp":[0.55,0.4]},{"id":"Sweet cherries in basket 2018 G1.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/a/a5/Sweet_cherries_in_basket_2018_G1.jpg","page":"https://commons.wikimedia.org/wiki/File:Sweet_cherries_in_basket_2018_G1.jpg","w":4100,"h":3850,"color":"#626041","license":"Public domain","author":"George Chernilevsky","subject":"wicker basket full of dark sweet cherries on green grass","tags":["cherries","basket","harvest","orchard","fruit","summer","wicker","farm shop","picking","grass"],"cat":"food","tone":"mid","temp":"warm","people":"none","q":3},{"id":"Hitchin lavender fields.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/43/Hitchin_lavender_fields.jpg","page":"https://commons.wikimedia.org/wiki/File:Hitchin_lavender_fields.jpg","w":3438,"h":2016,"color":"#827a8a","license":"CC BY-SA 4.0","author":"DeFacto","subject":"dense rows of flowering lavender running toward the horizon","tags":["lavender","rows","field","purple","provence","flowers","farm","pattern","summer","perfume"],"cat":"landscape","tone":"mid","temp":"cool","people":"none","q":3},{"id":"Snowshil-Lavender.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/a/ad/Snowshil-Lavender.jpg","page":"https://commons.wikimedia.org/wiki/File:Snowshil-Lavender.jpg","w":2757,"h":2206,"color":"#606854","license":"CC BY-SA 3.0","author":"Saffron Blaze","subject":"bands of purple and white lavender below a stone cottage and green field","tags":["lavender","farm","cotswolds","cottage","purple","rows","flowers","england","summer","hedge"],"cat":"landscape","tone":"mid","temp":"cool","people":"none","q":2,"fp":[0.5,0.6]},{"id":"Wooden gate with open double door leading to the garden of Isshinin Buddhist temple in the compounds of Chion-in Kyoto Japan.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/71/Wooden_gate_with_open_double_door_leading_to_the_garden_of_Isshinin_Buddhist_temple_in_the_compounds_of_Chion-in_Kyoto_Japan.jpg","page":"https://commons.wikimedia.org/wiki/File:Wooden_gate_with_open_double_door_leading_to_the_garden_of_Isshinin_Buddhist_temple_in_the_compounds_of_Chion-in_Kyoto_Japan.jpg","w":5973,"h":4480,"color":"#6d6455","license":"CC BY-SA 4.0","author":"Basile Morin","subject":"heavy wooden temple gate open onto a raked stone garden path","tags":["garden","gate","japanese garden","temple","doorway","kyoto","path","wood","calm","entrance"],"cat":"architecture","tone":"mid","temp":"warm","people":"none","q":3},{"id":"Traditional floating vegetable garden 34.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/3/37/Traditional_floating_vegetable_garden_34.jpg","page":"https://commons.wikimedia.org/wiki/File:Traditional_floating_vegetable_garden_34.jpg","w":4366,"h":2909,"color":"#625c45","license":"CC BY-SA 4.0","author":"Azimronnie","subject":"aerial view of floating vegetable beds and a canoe with a gardener","tags":["vegetable garden","floating garden","aerial","boat","farmer","beds","water","agriculture","green","drone"],"cat":"work","tone":"mid","temp":"cool","people":"figure","q":3,"fp":[0.6,0.7]},{"id":"Dülmen, Brachliegendes Feld mit Wildblumen -- 2021 -- 9756.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/e9/D%C3%BClmen%2C_Brachliegendes_Feld_mit_Wildblumen_--_2021_--_9756.jpg","page":"https://commons.wikimedia.org/wiki/File:D%C3%BClmen,_Brachliegendes_Feld_mit_Wildblumen_--_2021_--_9756.jpg","w":6066,"h":3412,"color":"#927035","license":"CC BY-SA 4.0","author":"Dietmar Rabich","subject":"red poppies and white daisies in a sunlit wildflower meadow","tags":["poppies","wildflowers","meadow","red","summer","flowers","field","nature","daisies","bright"],"cat":"nature","tone":"mid","temp":"warm","people":"none","q":3},{"id":"Dülmen, Brachliegendes Feld mit Wildblumen -- 2021 -- 9787.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/0/07/D%C3%BClmen%2C_Brachliegendes_Feld_mit_Wildblumen_--_2021_--_9787.jpg","page":"https://commons.wikimedia.org/wiki/File:D%C3%BClmen,_Brachliegendes_Feld_mit_Wildblumen_--_2021_--_9787.jpg","w":6720,"h":4480,"color":"#98561f","license":"CC BY-SA 4.0","author":"Dietmar Rabich","subject":"two open red poppies among chamomile in close up","tags":["poppies","wildflowers","red","close up","chamomile","meadow","summer","flowers","bright","nature"],"cat":"nature","tone":"mid","temp":"warm","people":"none","q":3},{"id":"Dülmen, Brachliegendes Feld mit Wildblumen -- 2021 -- 9775.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/4f/D%C3%BClmen%2C_Brachliegendes_Feld_mit_Wildblumen_--_2021_--_9775.jpg","page":"https://commons.wikimedia.org/wiki/File:D%C3%BClmen,_Brachliegendes_Feld_mit_Wildblumen_--_2021_--_9775.jpg","w":5973,"h":4480,"color":"#8e7841","license":"CC BY-SA 4.0","author":"Dietmar Rabich","subject":"purple thistle flower in a soft meadow of poppies and grasses","tags":["thistle","wildflowers","meadow","purple","summer","flowers","bees","nature","field","close up"],"cat":"nature","tone":"mid","temp":"warm","people":"none","q":2,"fp":[0.4,0.4]},{"id":"Digitalis purpurea - Panoramic trail - Northern Black Forest 01.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/7b/Digitalis_purpurea_-_Panoramic_trail_-_Northern_Black_Forest_01.jpg","page":"https://commons.wikimedia.org/wiki/File:Digitalis_purpurea_-_Panoramic_trail_-_Northern_Black_Forest_01.jpg","w":3110,"h":6000,"color":"#7a6644","license":"CC BY-SA 3.0","author":"H. Zell","subject":"tall pink foxglove spike against a soft green background","tags":["foxglove","wildflower","pink","forest","flower","summer","portrait","botanical","nature","woodland"],"cat":"nature","tone":"mid","temp":"cool","people":"none","q":2,"fp":[0.55,0.45]},{"id":"Autumn Oak - Broadhall Way - Stevenage.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/d/d5/Autumn_Oak_-_Broadhall_Way_-_Stevenage.jpg","page":"https://commons.wikimedia.org/wiki/File:Autumn_Oak_-_Broadhall_Way_-_Stevenage.jpg","w":10887,"h":7044,"color":"#6a757f","license":"CC BY-SA 3.0","author":"Colin","subject":"broad autumn oak beside a golden hedge under a clear blue sky","tags":["autumn","oak","tree","hedge","fall","golden","blue sky","park","seasons","walking"],"cat":"landscape","tone":"mid","temp":"warm","people":"figure","q":3,"fp":[0.3,0.45]},{"id":"Common lime during an autumn sunset, Christchurch, New Zealand.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/21/Common_lime_during_an_autumn_sunset%2C_Christchurch%2C_New_Zealand.jpg","page":"https://commons.wikimedia.org/wiki/File:Common_lime_during_an_autumn_sunset,_Christchurch,_New_Zealand.jpg","w":5052,"h":2842,"color":"#9d8956","license":"CC BY-SA 4.0","author":"Michal Klajban","subject":"looking straight up a trunk into a canopy of yellow autumn leaves","tags":["autumn","tree","canopy","yellow leaves","fall","looking up","branches","golden","seasons","forest"],"cat":"nature","tone":"mid","temp":"warm","people":"none","q":3},{"id":"Vallee-brouillard.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/46/Vallee-brouillard.jpg","page":"https://commons.wikimedia.org/wiki/File:Vallee-brouillard.jpg","w":4210,"h":2750,"color":"#8c7a6f","license":"CC BY 3.0","author":"Thomas Bresson","subject":"sea of fog filling a valley below dark hills at sunset","tags":["fog","sea of clouds","valley","sunset","hills","mist","calm","peach sky","inversion","dawn"],"cat":"landscape","tone":"mid","temp":"warm","people":"none","q":3},{"id":"Blassenstein Erlauftal mit Nebel 02 Panorama.JPG","file":"https://upload.wikimedia.org/wikipedia/commons/2/25/Blassenstein_Erlauftal_mit_Nebel_02_Panorama.JPG","page":"https://commons.wikimedia.org/wiki/File:Blassenstein_Erlauftal_mit_Nebel_02_Panorama.JPG","w":5958,"h":2979,"color":"#81827b","license":"CC BY-SA 3.0","author":"Uoaei1","subject":"morning fog flowing through a valley below a lookout and hills","tags":["fog","valley","morning","mist","hills","inversion","sunrise","austria","clouds","calm"],"cat":"landscape","tone":"mid","temp":"cool","people":"none","q":3},{"id":"Fanal (Madeira, Portugal), Lorbeerwald -- 2025 -- 1532.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/6/65/Fanal_%28Madeira%2C_Portugal%29%2C_Lorbeerwald_--_2025_--_1532.jpg","page":"https://commons.wikimedia.org/wiki/File:Fanal_(Madeira,_Portugal),_Lorbeerwald_--_2025_--_1532.jpg","w":6610,"h":4407,"color":"#a2acaa","license":"CC BY-SA 4.0","author":"Dietmar Rabich","subject":"three twisted trees on a grassy slope in thick white fog","tags":["fog","trees","mist","minimal","madeira","grass","mystery","calm","white","quiet"],"cat":"landscape","tone":"light","temp":"neutral","people":"none","q":3},{"id":"Desna river Vinn meadow 2016 G9.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/c/c9/Desna_river_Vinn_meadow_2016_G9.jpg","page":"https://commons.wikimedia.org/wiki/File:Desna_river_Vinn_meadow_2016_G9.jpg","w":6000,"h":3850,"color":"#82807f","license":"Public domain","author":"George Chernilevsky","subject":"river in morning fog with reeds and soft trees along the bank","tags":["fog","river","mist","morning","reeds","calm","quiet","soft","nature","dawn"],"cat":"landscape","tone":"light","temp":"neutral","people":"none","q":3},{"id":"Dülmen, Umland -- 2014 -- 7056.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/76/D%C3%BClmen%2C_Umland_--_2014_--_7056.jpg","page":"https://commons.wikimedia.org/wiki/File:D%C3%BClmen,_Umland_--_2014_--_7056.jpg","w":5184,"h":3456,"color":"#7a6e5e","license":"CC BY-SA 4.0","author":"Dietmar Rabich","subject":"group of bare trees silhouetted against a misty sunrise","tags":["trees","silhouette","sunrise","mist","dawn","fog","golden","field","calm","winter"],"cat":"landscape","tone":"dark","temp":"warm","people":"none","q":3,"fp":[0.5,0.45]},{"id":"036 Milky Way during Perseids seen from Oeschinensee with water reflections Photo by Giles Laurent.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/2f/036_Milky_Way_during_Perseids_seen_from_Oeschinensee_with_water_reflections_Photo_by_Giles_Laurent.jpg","page":"https://commons.wikimedia.org/wiki/File:036_Milky_Way_during_Perseids_seen_from_Oeschinensee_with_water_reflections_Photo_by_Giles_Laurent.jpg","w":7457,"h":13630,"color":"#2c4352","license":"CC BY-SA 4.0","author":"Giles Laurent","subject":"milky way arching over a mountain lake with star reflections","tags":["night sky","milky way","stars","lake","mountains","reflection","astronomy","camping","dark","portrait"],"cat":"landscape","tone":"dark","temp":"cool","people":"none","q":3,"fp":[0.5,0.3]},{"id":"Milky way in Elbrus.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/5/55/Milky_way_in_Elbrus.jpg","page":"https://commons.wikimedia.org/wiki/File:Milky_way_in_Elbrus.jpg","w":3648,"h":5472,"color":"#282830","license":"CC BY 4.0","author":"oliwok","subject":"milky way above a glowing tent below mountain ridges","tags":["night sky","milky way","tent","camping","stars","mountains","adventure","outdoor","astronomy","dark"],"cat":"landscape","tone":"dark","temp":"cool","people":"none","q":3,"fp":[0.4,0.85]},{"id":"018 Human looking at the stars during Perseids with the Milky Way in the background Photo by Giles Laurent.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/23/018_Human_looking_at_the_stars_during_Perseids_with_the_Milky_Way_in_the_background_Photo_by_Giles_Laurent.jpg","page":"https://commons.wikimedia.org/wiki/File:018_Human_looking_at_the_stars_during_Perseids_with_the_Milky_Way_in_the_background_Photo_by_Giles_Laurent.jpg","w":7612,"h":5075,"color":"#35453e","license":"CC BY-SA 4.0","author":"Giles Laurent","subject":"small figure on a ridge beneath the milky way beside a tree","tags":["night sky","milky way","stargazing","stars","silhouette","mountain","astronomy","wonder","dark","hiking"],"cat":"landscape","tone":"dark","temp":"cool","people":"figure","q":3,"fp":[0.6,0.6]},{"id":"Kométa C-2020 F3 (NEOWISE).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/6/60/Kom%C3%A9ta_C-2020_F3_%28NEOWISE%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Kom%C3%A9ta_C-2020_F3_(NEOWISE).jpg","w":6000,"h":4432,"color":"#3d4657","license":"CC BY-SA 4.0","author":"Palonitor","subject":"person at a telescope under a bright comet in a starry sky","tags":["night sky","comet","telescope","astronomy","stars","silhouette","observatory","science","dark","wonder"],"cat":"science","tone":"dark","temp":"cool","people":"figure","q":3,"fp":[0.3,0.65]},{"id":"2017-04 Circumpolar trails sunset at La Hague lighthouse.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/6/6d/2017-04_Circumpolar_trails_sunset_at_La_Hague_lighthouse.jpg","page":"https://commons.wikimedia.org/wiki/File:2017-04_Circumpolar_trails_sunset_at_La_Hague_lighthouse.jpg","w":5944,"h":3344,"color":"#172338","license":"CC BY-SA 4.0","author":"Antoine Lamielle","subject":"star trails over the sea with a lighthouse and a blue horizon glow","tags":["star trails","night sky","lighthouse","sea","stars","long exposure","astronomy","coast","dark","blue"],"cat":"landscape","tone":"dark","temp":"cool","people":"none","q":3,"fp":[0.7,0.7]},{"id":"Utah Dunes Landscape - West Desert District.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/c/cb/Utah_Dunes_Landscape_-_West_Desert_District.jpg","page":"https://commons.wikimedia.org/wiki/File:Utah_Dunes_Landscape_-_West_Desert_District.jpg","w":4000,"h":2628,"color":"#98878f","license":"Public domain","author":"Bureau of Land Management - Utah/Bob Wick","subject":"pale sand dunes below pink lit desert mountains at dusk","tags":["desert","dunes","sand","mountains","dusk","utah","pink","pastel","calm","wilderness"],"cat":"landscape","tone":"light","temp":"warm","people":"none","q":3},{"id":"Namib-Naukluft Sand Dunes (2011).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/8/89/Namib-Naukluft_Sand_Dunes_%282011%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Namib-Naukluft_Sand_Dunes_(2011).jpg","w":4000,"h":1819,"color":"#925241","license":"CC BY-SA 3.0","author":"Yathin S Krishnappa","subject":"layered red dunes with a strip of light and tiny trees below","tags":["desert","dunes","namibia","red","sand","sossusvlei","dramatic","shadow","travel","wilderness"],"cat":"landscape","tone":"dark","temp":"warm","people":"none","q":3},{"id":"006 Dune 45 in Sossusvlei at sunrise Photo by Giles Laurent.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/2e/006_Dune_45_in_Sossusvlei_at_sunrise_Photo_by_Giles_Laurent.jpg","page":"https://commons.wikimedia.org/wiki/File:006_Dune_45_in_Sossusvlei_at_sunrise_Photo_by_Giles_Laurent.jpg","w":5385,"h":3590,"color":"#997f77","license":"CC BY-SA 4.0","author":"Giles Laurent","subject":"tall orange dune split into sun and shadow against a blue sky","tags":["desert","dune","namibia","orange","sand","shadow","minimal","travel","sossusvlei","safari"],"cat":"landscape","tone":"mid","temp":"warm","people":"none","q":3,"fp":[0.55,0.45]},{"id":"Un groupe de dromadaire dans le desert tunisien.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/a/a1/Un_groupe_de_dromadaire_dans_le_desert_tunisien.jpg","page":"https://commons.wikimedia.org/wiki/File:Un_groupe_de_dromadaire_dans_le_desert_tunisien.jpg","w":6000,"h":4000,"color":"#efd5b9","license":"CC BY-SA 4.0","author":"Skander zarrad","subject":"small camel caravan with riders crossing pale rippled sand","tags":["desert","camels","caravan","sand","dunes","sahara","tunisia","travel","adventure","nomad"],"cat":"travel","tone":"light","temp":"warm","people":"figure","q":3,"fp":[0.5,0.6]},{"id":"Swaledale Sheep, Lake District, England - June 2009.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/f5/Swaledale_Sheep%2C_Lake_District%2C_England_-_June_2009.jpg","page":"https://commons.wikimedia.org/wiki/File:Swaledale_Sheep,_Lake_District,_England_-_June_2009.jpg","w":3413,"h":2809,"color":"#8f8e6f","license":"CC BY-SA 3.0","author":"User:Diliff","subject":"horned black faced sheep with shaggy fleece on a green fell","tags":["sheep","swaledale","wool","fell","farm","lake district","horns","pasture","livestock","countryside"],"cat":"animal","tone":"mid","temp":"warm","people":"none","q":3,"fp":[0.5,0.45]},{"id":"Ascain - Oveja -BT- 02.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/c/c1/Ascain_-_Oveja_-BT-_02.jpg","page":"https://commons.wikimedia.org/wiki/File:Ascain_-_Oveja_-BT-_02.jpg","w":3085,"h":2017,"color":"#707070","license":"CC BY-SA 4.0","author":"Basotxerri","subject":"single woolly sheep on a horizon line under a grey sky in black and white","tags":["sheep","black and white","minimal","horizon","wool","farm","monochrome","field","calm","editorial"],"cat":"animal","tone":"mid","temp":"neutral","people":"none","q":3,"fp":[0.48,0.75]},{"id":"Cow on Pupers.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/43/Cow_on_Pupers.jpg","page":"https://commons.wikimedia.org/wiki/File:Cow_on_Pupers.jpg","w":3464,"h":2528,"color":"#a27e56","license":"CC BY-SA 3.0","author":"Nilfanion","subject":"shaggy ginger highland cow with long horns in golden grass","tags":["highland cow","cattle","cow","horns","scotland","farm","grass","golden","livestock","beef"],"cat":"animal","tone":"mid","temp":"warm","people":"none","q":3},{"id":"Water reflection of a boy feeding hay to a cow in a paddy field at golden hour in Laos.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/d/dc/Water_reflection_of_a_boy_feeding_hay_to_a_cow_in_a_paddy_field_at_golden_hour_in_Laos.jpg","page":"https://commons.wikimedia.org/wiki/File:Water_reflection_of_a_boy_feeding_hay_to_a_cow_in_a_paddy_field_at_golden_hour_in_Laos.jpg","w":5613,"h":3742,"color":"#96957b","license":"CC BY-SA 4.0","author":"Basile Morin","subject":"boy feeding hay to a cow in a flooded paddy with mirror reflections","tags":["cow","boy","paddy","reflection","farm","rural","golden hour","laos","feeding","water"],"cat":"animal","tone":"mid","temp":"warm","people":"figure","q":3,"fp":[0.35,0.35]},{"id":"Mud Cow Racing - Pacu Jawi - West Sumatra, Indonesia.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/3/37/Mud_Cow_Racing_-_Pacu_Jawi_-_West_Sumatra%2C_Indonesia.jpg","page":"https://commons.wikimedia.org/wiki/File:Mud_Cow_Racing_-_Pacu_Jawi_-_West_Sumatra,_Indonesia.jpg","w":5309,"h":3543,"color":"#7b6356","license":"CC BY 2.0","author":"Rodney Ee","subject":"man racing two muddy bulls through a flooded field, mud flying","tags":["bulls","cattle","race","mud","festival","sumatra","action","tradition","farm","sport"],"cat":"event","tone":"dark","temp":"warm","people":"face","q":3},{"id":"Domestic horse at Suryachaur and the mountains in the back1.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/be/Domestic_horse_at_Suryachaur_and_the_mountains_in_the_back1.jpg","page":"https://commons.wikimedia.org/wiki/File:Domestic_horse_at_Suryachaur_and_the_mountains_in_the_back1.jpg","w":6000,"h":4000,"color":"#748090","license":"CC BY-SA 4.0","author":"Shadow Ayush","subject":"grey horse walking along a ridge with snowy mountains behind","tags":["horse","white horse","ridge","mountains","nepal","blue sky","equestrian","freedom","travel","grazing"],"cat":"animal","tone":"mid","temp":"cool","people":"none","q":3,"fp":[0.5,0.55]},{"id":"Parco Naturale Tre Cime horses 3.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/76/Parco_Naturale_Tre_Cime_horses_3.jpg","page":"https://commons.wikimedia.org/wiki/File:Parco_Naturale_Tre_Cime_horses_3.jpg","w":4200,"h":2800,"color":"#676964","license":"CC BY-SA 4.0","author":"kallerna","subject":"small herd grazing a high meadow below jagged dolomite peaks","tags":["horses","herd","meadow","dolomites","mountains","grazing","alpine","pasture","wild","travel"],"cat":"landscape","tone":"mid","temp":"warm","people":"none","q":3,"fp":[0.5,0.75]},{"id":"IcelandicHorseInWinter.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/e6/IcelandicHorseInWinter.jpg","page":"https://commons.wikimedia.org/wiki/File:IcelandicHorseInWinter.jpg","w":2980,"h":1987,"color":"#847171","license":"CC BY-SA 3.0","author":"Andreas Tille","subject":"chestnut icelandic horse with thick mane standing in snow","tags":["horse","icelandic horse","winter","snow","mane","equestrian","iceland","cold","pony","farm"],"cat":"animal","tone":"mid","temp":"warm","people":"none","q":3,"fp":[0.45,0.5]},{"id":"Liver yellow dog in the water looking at viewer at golden hour in Don Det Laos.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/3/37/Liver_yellow_dog_in_the_water_looking_at_viewer_at_golden_hour_in_Don_Det_Laos.jpg","page":"https://commons.wikimedia.org/wiki/File:Liver_yellow_dog_in_the_water_looking_at_viewer_at_golden_hour_in_Don_Det_Laos.jpg","w":5237,"h":3928,"color":"#785d4d","license":"CC BY-SA 4.0","author":"Basile Morin","subject":"ginger dog swimming in dark water and looking at the camera","tags":["dog","swimming","water","pet","golden hour","reflection","portrait","river","summer","companion"],"cat":"animal","tone":"dark","temp":"warm","people":"none","q":3,"fp":[0.6,0.45]},{"id":"Human\u2013canine friendship - girl hugging her dog tightly at golden hour in Laos.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/99/Human%E2%80%93canine_friendship_-_girl_hugging_her_dog_tightly_at_golden_hour_in_Laos.jpg","page":"https://commons.wikimedia.org/wiki/File:Human%E2%80%93canine_friendship_-_girl_hugging_her_dog_tightly_at_golden_hour_in_Laos.jpg","w":3831,"h":5746,"color":"#8b7668","license":"CC BY-SA 4.0","author":"Basile Morin","subject":"laughing girl hugging her tan dog in a dry field at golden hour","tags":["dog","girl","hug","pet","friendship","golden hour","child","joy","companion","family"],"cat":"family","tone":"mid","temp":"warm","people":"face","q":3,"fp":[0.5,0.4]},{"id":"Felis catus-cat on snow.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/b6/Felis_catus-cat_on_snow.jpg","page":"https://commons.wikimedia.org/wiki/File:Felis_catus-cat_on_snow.jpg","w":3000,"h":2000,"color":"#9ea1a4","license":"CC BY-SA 3.0","author":"Von.grzanka","subject":"tabby cat with raised tail looking back across white snow","tags":["cat","tabby","snow","winter","pet","portrait","white","animal","cute","outdoor"],"cat":"animal","tone":"light","temp":"neutral","people":"none","q":3,"fp":[0.4,0.5]},{"id":"Cat November 2010-1a.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/4d/Cat_November_2010-1a.jpg","page":"https://commons.wikimedia.org/wiki/File:Cat_November_2010-1a.jpg","w":1795,"h":2397,"color":"#9e958f","license":"CC BY-SA 3.0","author":"Alvesgaspar","subject":"tabby cat sitting upright on a wall against a pale sky","tags":["cat","tabby","sitting","pet","portrait","outdoor","calm","wall","animal","vet"],"cat":"animal","tone":"light","temp":"cool","people":"none","q":2},{"id":"Swallow-tailed bee-eater (Merops hirundineus chrysolaimus).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/97/Swallow-tailed_bee-eater_%28Merops_hirundineus_chrysolaimus%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Swallow-tailed_bee-eater_(Merops_hirundineus_chrysolaimus).jpg","w":1853,"h":1853,"color":"#857957","license":"CC BY-SA 4.0","author":"Charles J. Sharp","subject":"green and yellow bee eater perched on a bare twig","tags":["bird","bee eater","perched","colourful","green","wildlife","nature","birdwatching","branch","africa"],"cat":"animal","tone":"mid","temp":"warm","people":"none","q":3,"fp":[0.5,0.4]},{"id":"Green heron in PP (14296).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/d/d7/Green_heron_in_PP_%2814296%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Green_heron_in_PP_(14296).jpg","w":3298,"h":3368,"color":"#787a55","license":"CC BY-SA 4.0","author":"Rhododendrites","subject":"green heron on a log mirrored in calm green water","tags":["bird","heron","reflection","water","wildlife","pond","nature","birdwatching","calm","green"],"cat":"animal","tone":"mid","temp":"cool","people":"none","q":3},{"id":"Oregon Junco in Kelowna, BC.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/bf/Oregon_Junco_in_Kelowna%2C_BC.jpg","page":"https://commons.wikimedia.org/wiki/File:Oregon_Junco_in_Kelowna,_BC.jpg","w":3550,"h":2439,"color":"#b4aca5","license":"CC BY-SA 3.0","author":"Blalonde","subject":"grey junco on a bare branch with soft pink background","tags":["bird","junco","branch","songbird","winter","wildlife","garden","birdwatching","soft","pastel"],"cat":"animal","tone":"light","temp":"cool","people":"none","q":3,"fp":[0.6,0.4]},{"id":"Apis mellifera scutellata 1355021.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/a/ac/Apis_mellifera_scutellata_1355021.jpg","page":"https://commons.wikimedia.org/wiki/File:Apis_mellifera_scutellata_1355021.jpg","w":2047,"h":3072,"color":"#5f5348","license":"Public domain","author":"Scott Bauer, USDA Agricultural Research Service","subject":"honey bees crowding a comb around a marked queen","tags":["bees","honey bee","queen","comb","beekeeping","hive","honey","apiary","colony","close up"],"cat":"animal","tone":"dark","temp":"warm","people":"none","q":3},{"id":"Apis mellifera - Brassica napus - Valingu.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/70/Apis_mellifera_-_Brassica_napus_-_Valingu.jpg","page":"https://commons.wikimedia.org/wiki/File:Apis_mellifera_-_Brassica_napus_-_Valingu.jpg","w":3000,"h":2250,"color":"#8c8a1b","license":"CC BY-SA 4.0","author":"Ivar Leidus","subject":"honey bee gathering pollen on a yellow rapeseed flower","tags":["bee","honey bee","pollen","flower","yellow","macro","honey","pollination","spring","nature"],"cat":"animal","tone":"mid","temp":"warm","people":"none","q":3},{"id":"Apis mellifera - Prunus padus - Keila.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/75/Apis_mellifera_-_Prunus_padus_-_Keila.jpg","page":"https://commons.wikimedia.org/wiki/File:Apis_mellifera_-_Prunus_padus_-_Keila.jpg","w":3118,"h":2339,"color":"#969985","license":"CC BY-SA 4.0","author":"Ivar Leidus","subject":"honey bee hovering at white blossom against a blue sky","tags":["bee","honey bee","blossom","spring","flying","pollination","macro","honey","orchard","nature"],"cat":"animal","tone":"light","temp":"cool","people":"none","q":3,"fp":[0.45,0.4]},{"id":"Tongerense Heide, (Veluwe). 30-08-2021. (actm.) 21.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/8/8e/Tongerense_Heide%2C_%28Veluwe%29._30-08-2021._%28actm.%29_21.jpg","page":"https://commons.wikimedia.org/wiki/File:Tongerense_Heide,_(Veluwe)._30-08-2021._(actm.)_21.jpg","w":4593,"h":2584,"color":"#9e9a9b","license":"CC BY-SA 4.0","author":"Agnes Monkelbaan","subject":"row of beehives at the edge of a flowering heather heath with pines","tags":["beehives","heather","heath","apiary","beekeeping","honey","pines","summer","purple","rural"],"cat":"landscape","tone":"mid","temp":"cool","people":"none","q":3,"fp":[0.2,0.75]},{"id":"Gallus gallus domesticus (Parque Quevedo).006 - Leon.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/b6/Gallus_gallus_domesticus_%28Parque_Quevedo%29.006_-_Leon.jpg","page":"https://commons.wikimedia.org/wiki/File:Gallus_gallus_domesticus_(Parque_Quevedo).006_-_Leon.jpg","w":3864,"h":5152,"color":"#908666","license":"CC BY-SA 4.0","author":"Fernando Losada Rodríguez","subject":"rooster with red comb and bronze hackles in close portrait","tags":["rooster","chicken","cockerel","comb","poultry","farm","portrait","feathers","free range","eggs"],"cat":"animal","tone":"mid","temp":"warm","people":"none","q":3,"fp":[0.5,0.3]},{"id":"G. gallus domesticus, Neuss (DE) -- 2023 -- 0062.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/2d/G._gallus_domesticus%2C_Neuss_%28DE%29_--_2023_--_0062.jpg","page":"https://commons.wikimedia.org/wiki/File:G._gallus_domesticus,_Neuss_(DE)_--_2023_--_0062.jpg","w":4326,"h":2884,"color":"#537f3a","license":"CC BY-SA 4.0","author":"Anil Öztas","subject":"white hen walking through long grass and buttercups","tags":["hen","chicken","free range","grass","poultry","farm","eggs","green","meadow","organic"],"cat":"animal","tone":"mid","temp":"warm","people":"none","q":2,"fp":[0.4,0.5]},{"id":"Gallus gallus domesticus - Vogelpark Steinen 03.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/c/c1/Gallus_gallus_domesticus_-_Vogelpark_Steinen_03.jpg","page":"https://commons.wikimedia.org/wiki/File:Gallus_gallus_domesticus_-_Vogelpark_Steinen_03.jpg","w":3876,"h":3288,"color":"#97816c","license":"CC BY-SA 3.0","author":"H. Zell","subject":"fluffy white chick standing on golden straw","tags":["chick","chicken","straw","baby","poultry","farm","spring","eggs","cute","easter"],"cat":"animal","tone":"mid","temp":"warm","people":"none","q":2,"fp":[0.55,0.5]},{"id":"Rob Bourdon HQ.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/1/14/Rob_Bourdon_HQ.jpg","page":"https://commons.wikimedia.org/wiki/File:Rob_Bourdon_HQ.jpg","w":3888,"h":2588,"color":"#212127","license":"CC BY-SA 3.0","author":"Rickard Laurin","subject":"a drum kit on a dark stage lit from behind, haze and light beams over the drummer","tags":["drum kit","drums","concert","stage","gig","music venue","band","spotlight","night","live music"],"cat":"event","tone":"dark","temp":"cool","people":"figure","q":2,"fp":[0.5,0.45]},{"id":"BlackInkBottle.JPG","file":"https://upload.wikimedia.org/wikipedia/commons/c/c0/BlackInkBottle.JPG","page":"https://commons.wikimedia.org/wiki/File:BlackInkBottle.JPG","w":3310,"h":2216,"color":"#89929c","license":"CC BY-SA 4.0","author":"Eric Magnan","subject":"an open glass bottle of black ink beside its cap on a pale blue ground","tags":["ink","ink bottle","printing","print shop","stationery","studio","writing","calligraphy","still life"],"cat":"object","tone":"light","temp":"cool","people":"none","q":2,"fp":[0.55,0.5]},{"id":"Basingstoke Canal Centre.JPG","file":"https://upload.wikimedia.org/wikipedia/commons/b/b6/Basingstoke_Canal_Centre.JPG","page":"https://commons.wikimedia.org/wiki/File:Basingstoke_Canal_Centre.JPG","w":3008,"h":2000,"color":"#414434","license":"CC BY-SA 3.0","author":"Zixi","subject":"two narrowboats moored on a calm canal under trees, reflected in green water","tags":["narrowboat","canal","boats","waterway","england","reflection","trees","summer","travel","holiday"],"cat":"travel","tone":"mid","temp":"warm","people":"none","q":2,"fp":[0.4,0.5]},{"id":"Soldering a 0805.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/f8/Soldering_a_0805.jpg","page":"https://commons.wikimedia.org/wiki/File:Soldering_a_0805.jpg","w":4064,"h":2704,"color":"#556f54","license":"CC BY-SA 3.0","author":"Aisart","subject":"fingers holding tweezers to place a tiny part on a green circuit board, close up","tags":["soldering","circuit board","electronics","repair","tweezers","hands","pcb","hardware","engineering","repair shop"],"cat":"tech","tone":"mid","temp":"cool","people":"hands","q":2,"fp":[0.45,0.45]},{"id":"Brüssel Skater Schattenriss-20081108-RM-164748.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/d/d4/Br%C3%BCssel_Skater_Schattenriss-20081108-RM-164748.jpg","page":"https://commons.wikimedia.org/wiki/File:Br%C3%BCssel_Skater_Schattenriss-20081108-RM-164748.jpg","w":3648,"h":2736,"color":"#615f5d","license":"CC BY-SA 4.0","author":"Ermell","subject":"silhouettes of young skaters standing behind a mesh fence against a pale sky","tags":["skateboarding","skaters","silhouette","skate park","youth","street","fence","urban","crew","streetwear"],"cat":"sport","tone":"dark","temp":"neutral","people":"figure","q":3,"fp":[0.55,0.55]},{"id":"Gloucester Docks at Night.jpeg","file":"https://upload.wikimedia.org/wikipedia/commons/7/71/Gloucester_Docks_at_Night.jpeg","page":"https://commons.wikimedia.org/wiki/File:Gloucester_Docks_at_Night.jpeg","w":4208,"h":2243,"color":"#514f57","license":"CC BY-SA 3.0","author":"Saffron Blaze","subject":"brick dock warehouses and moored ships reflected in still water at blue dusk","tags":["docks","port town","night","dusk","harbour","warehouses","reflection","england","waterfront","gloucester"],"cat":"city","tone":"dark","temp":"cool","people":"none","q":3},{"id":"Texas Instruments Longines Symphonette Calculator 1st version.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/e5/Texas_Instruments_Longines_Symphonette_Calculator_1st_version.jpg","page":"https://commons.wikimedia.org/wiki/File:Texas_Instruments_Longines_Symphonette_Calculator_1st_version.jpg","w":2977,"h":2845,"color":"#d6cfc0","license":"CC BY-SA 4.0","author":"Mister rf","subject":"a cream vintage pocket calculator with grey keys and an orange key on white","tags":["calculator","vintage","accounting","finance","bookkeeping","office","retro","numbers","product"],"cat":"object","tone":"light","temp":"warm","people":"none","q":2},{"id":"Kings Cross Subway Tunnel \"Pipette\".jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/4d/Kings_Cross_Subway_Tunnel_%22Pipette%22.jpg","page":"https://commons.wikimedia.org/wiki/File:Kings_Cross_Subway_Tunnel_%22Pipette%22.jpg","w":5935,"h":3319,"color":"#877e8c","license":"CC BY-SA 4.0","author":"Colin","subject":"an empty curved white pedestrian tunnel lit by a wall of soft violet light","tags":["tunnel","hallway","corridor","empty","light","modern","underground","london","station","architecture"],"cat":"architecture","tone":"light","temp":"cool","people":"none","q":3,"fp":[0.55,0.5]},{"id":"Potter and his wife.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/1/11/Potter_and_his_wife.jpg","page":"https://commons.wikimedia.org/wiki/File:Potter_and_his_wife.jpg","w":2465,"h":3575,"color":"#82786a","license":"CC BY-SA 4.0","author":"Yann (talk)","subject":"a potter throwing a small pot on a wide clay wheel, rows of pots drying behind","tags":["potter","pottery wheel","clay","throwing","ceramics","pots","workshop","handmade","craft","studio"],"cat":"craft","tone":"mid","temp":"warm","people":"figure","q":2,"fp":[0.5,0.6]},{"id":"Man playing an acoustic brazilian guitar (Violão) on Marco Zero Square, Refice, Pernambuco, Brazil.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/e0/Man_playing_an_acoustic_brazilian_guitar_%28Viol%C3%A3o%29_on_Marco_Zero_Square%2C_Refice%2C_Pernambuco%2C_Brazil.jpg","page":"https://commons.wikimedia.org/wiki/File:Man_playing_an_acoustic_brazilian_guitar_(Viol%C3%A3o)_on_Marco_Zero_Square,_Refice,_Pernambuco,_Brazil.jpg","w":6000,"h":4000,"color":"#7a7a7a","license":"CC0","author":"Wilfredor","subject":"a weathered hand picking the strings of a resonator guitar, black and white close up","tags":["guitar","hands","guitarist","strings","music","black and white","musician","acoustic","resonator","close up"],"cat":"event","tone":"mid","temp":"neutral","people":"hands","q":2,"fp":[0.45,0.45]},{"id":"Backlit keyboard.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/c/c4/Backlit_keyboard.jpg","page":"https://commons.wikimedia.org/wiki/File:Backlit_keyboard.jpg","w":4357,"h":2451,"color":"#101318","license":"CC BY-SA 4.0","author":"Colin","subject":"fingers resting on a backlit laptop keyboard in the dark, keys glowing white","tags":["keyboard","laptop","night","typing","hands","dark","backlit","coding","studio","producer"],"cat":"tech","tone":"dark","temp":"cool","people":"hands","q":2,"fp":[0.5,0.6]},{"id":"Acer Swift 3 rear-right edge.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/25/Acer_Swift_3_rear-right_edge.jpg","page":"https://commons.wikimedia.org/wiki/File:Acer_Swift_3_rear-right_edge.jpg","w":3825,"h":2550,"color":"#756d64","license":"CC BY-SA 4.0","author":"Bobulous","subject":"the thin edge of a silver laptop with ports on a wooden desk, shallow focus","tags":["laptop","desk","ports","usb","tech","workspace","computer","minimal","home office","wood"],"cat":"tech","tone":"mid","temp":"warm","people":"none","q":2,"fp":[0.6,0.5]},{"id":"50ml Falcon tubes-02.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/5/52/50ml_Falcon_tubes-02.jpg","page":"https://commons.wikimedia.org/wiki/File:50ml_Falcon_tubes-02.jpg","w":3520,"h":2492,"color":"#baa9ad","license":"CC BY-SA 3.0","author":"Lilly_M","subject":"four clear graduated lab tubes with orange caps standing in a row on white","tags":["test tubes","laboratory","lab","science","samples","biotech","research","tubes","product"],"cat":"science","tone":"light","temp":"neutral","people":"none","q":2},{"id":"Fishing Harbour Beach.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/e6/Fishing_Harbour_Beach.jpg","page":"https://commons.wikimedia.org/wiki/File:Fishing_Harbour_Beach.jpg","w":4000,"h":2667,"color":"#9ea99d","license":"CC BY-SA 4.0","author":"Amdadphoto","subject":"a long sand beach seen from the air with small fishing boats and a river lagoon","tags":["aerial","coastline","beach","from above","fishing boats","drone","sea","coast","lagoon","travel"],"cat":"landscape","tone":"light","temp":"cool","people":"none","q":2,"fp":[0.4,0.6]},{"id":"Aerial View, Sanshan Island, Hailing Island, Jiangcheng District, Yangjiang City.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/c/c6/Aerial_View%2C_Sanshan_Island%2C_Hailing_Island%2C_Jiangcheng_District%2C_Yangjiang_City.jpg","page":"https://commons.wikimedia.org/wiki/File:Aerial_View,_Sanshan_Island,_Hailing_Island,_Jiangcheng_District,_Yangjiang_City.jpg","w":3934,"h":2951,"color":"#647f8e","license":"CC BY-SA 4.0","author":"YikyuenG","subject":"a small rocky green island in deep blue sea seen from above","tags":["aerial","island","sea","from above","drone","coast","ocean","blue","travel","nature"],"cat":"landscape","tone":"mid","temp":"cool","people":"none","q":2},{"id":"Munich subway station Candidplatz - exit.JPG","file":"https://upload.wikimedia.org/wikipedia/commons/4/42/Munich_subway_station_Candidplatz_-_exit.JPG","page":"https://commons.wikimedia.org/wiki/File:Munich_subway_station_Candidplatz_-_exit.JPG","w":4681,"h":3795,"color":"#5c5349","license":"CC BY-SA 3.0","author":"Martin Falbisoner","subject":"a long grey concrete exit passage lit by wall slits and hanging lamps","tags":["exit","passage","underground","metro","corridor","concrete","lights","wayfinding","station","architecture"],"cat":"architecture","tone":"mid","temp":"neutral","people":"none","q":3},{"id":"Globen metro station May 2016.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/5/5c/Globen_metro_station_May_2016.jpg","page":"https://commons.wikimedia.org/wiki/File:Globen_metro_station_May_2016.jpg","w":5009,"h":3344,"color":"#293b54","license":"CC BY-SA 4.0","author":"Arild Vågen","subject":"a raised metro station at blue hour with light trails of a passing train","tags":["train","night","light trails","station","blue hour","city","railway","commute","long exposure"],"cat":"city","tone":"dark","temp":"cool","people":"none","q":2},{"id":"Open Book b&w.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/29/Open_Book_b%26w.jpg","page":"https://commons.wikimedia.org/wiki/File:Open_Book_b%26w.jpg","w":2256,"h":1504,"color":"#5c5451","license":"CC BY-SA 4.0","author":"Bibliothek Wissenschaftspark Albert Einstein","subject":"the fanned pages of an open book in shallow focus, black and white","tags":["book","open book","pages","reading","print","zine","publishing","black and white","paper","library"],"cat":"object","tone":"mid","temp":"neutral","people":"none","q":2,"fp":[0.5,0.6]},{"id":"Spiralbinderücken -- 2022 -- 9722.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/d/d5/Spiralbinder%C3%BCcken_--_2022_--_9722.jpg","page":"https://commons.wikimedia.org/wiki/File:Spiralbinder%C3%BCcken_--_2022_--_9722.jpg","w":6576,"h":4384,"color":"#b6b6b7","license":"CC BY-SA 4.0","author":"Dietmar Rabich","subject":"the silver wire spiral of an open grid notebook in close up, shallow focus","tags":["notebook","spiral","stationery","paper","grid","desk","studio","sketchbook","writing","close up"],"cat":"object","tone":"light","temp":"neutral","people":"none","q":2},{"id":"Row of white silage bales in Brastad.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/c/cd/Row_of_white_silage_bales_in_Brastad.jpg","page":"https://commons.wikimedia.org/wiki/File:Row_of_white_silage_bales_in_Brastad.jpg","w":4261,"h":3561,"color":"#959f95","license":"CC0","author":"W.carter","subject":"a long row of white wrapped silage bales running across a green field","tags":["silage bales","farm","field","row","agriculture","harvest","countryside","perspective","rural"],"cat":"landscape","tone":"light","temp":"cool","people":"none","q":2,"fp":[0.5,0.6]},{"id":"Aerial View, A coastline of Hailing Island, Yangjiang City.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/0/0b/Aerial_View%2C_A_coastline_of_Hailing_Island%2C_Yangjiang_City.jpg","page":"https://commons.wikimedia.org/wiki/File:Aerial_View,_A_coastline_of_Hailing_Island,_Yangjiang_City.jpg","w":4013,"h":3010,"color":"#577364","license":"CC BY-SA 4.0","author":"YikyuenG","subject":"a rocky coastline seen straight down, green forest meeting turquoise sea","tags":["aerial","coastline","from above","top down","drone","sea","rocks","forest","coast","nature"],"cat":"landscape","tone":"mid","temp":"cool","people":"none","q":3,"fp":[0.45,0.5]},{"id":"Mackenzie River Outflow.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/6/62/Mackenzie_River_Outflow.jpg","page":"https://commons.wikimedia.org/wiki/File:Mackenzie_River_Outflow.jpg","w":7600,"h":6800,"color":"#4e6a69","license":"Public domain","author":"Operational Land Imager on the Landsat 8 satellite","subject":"a river delta pouring silt into a green sea, seen from orbit in swirling patterns","tags":["river delta","aerial","from above","satellite","earth","water","pattern","abstract","nature","sediment"],"cat":"nature","tone":"mid","temp":"cool","people":"none","q":2},{"id":"Raspberry Pi 4 Model B - Side.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/f1/Raspberry_Pi_4_Model_B_-_Side.jpg","page":"https://commons.wikimedia.org/wiki/File:Raspberry_Pi_4_Model_B_-_Side.jpg","w":4187,"h":2464,"color":"#9b9f96","license":"CC BY-SA 4.0","author":"Laserlicht","subject":"a small green single-board computer with ports and pins on a white ground","tags":["raspberry pi","single board computer","electronics","maker","hardware","computer","product","diy","coding"],"cat":"tech","tone":"light","temp":"neutral","people":"none","q":2},{"id":"RailroadSwitch 20200801 014921.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/4f/RailroadSwitch_20200801_014921.jpg","page":"https://commons.wikimedia.org/wiki/File:RailroadSwitch_20200801_014921.jpg","w":4608,"h":2592,"color":"#181814","license":"CC BY-SA 4.0","author":"Ka23 13","subject":"rail workers in hi-vis vests repairing a track switch at night, seen from above","tags":["railway","track work","night","switch","workers","maintenance","rails","infrastructure","logistics","from above"],"cat":"work","tone":"dark","temp":"warm","people":"figure","q":2},{"id":"Boat on Pill Foreshore - DSC 0175.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/e6/Boat_on_Pill_Foreshore_-_DSC_0175.jpg","page":"https://commons.wikimedia.org/wiki/File:Boat_on_Pill_Foreshore_-_DSC_0175.jpg","w":5952,"h":3968,"color":"#9a9891","license":"CC BY-SA 4.0","author":"Tadeusz Hare","subject":"an old wooden boat beached in grass on an estuary shore in soft evening light","tags":["estuary","boat","shore","river","evening","dusk","port town","england","quiet","coast"],"cat":"landscape","tone":"light","temp":"warm","people":"none","q":2,"fp":[0.5,0.65]},{"id":"Pill MMB 09 Harbour.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/a/a1/Pill_MMB_09_Harbour.jpg","page":"https://commons.wikimedia.org/wiki/File:Pill_MMB_09_Harbour.jpg","w":1600,"h":2400,"color":"#756e66","license":"CC BY-SA 3.0","author":"mattbuck (category)","subject":"sailing boats moored in a small tidal harbour under a grey sky, masts reflected","tags":["harbour","sailing boats","port town","estuary","england","masts","reflection","grey sky","coast","village"],"cat":"travel","tone":"mid","temp":"cool","people":"none","q":2},{"id":"Tea in action.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/2f/Tea_in_action.jpg","page":"https://commons.wikimedia.org/wiki/File:Tea_in_action.jpg","w":5472,"h":3648,"color":"#22232a","license":"CC BY-SA 4.0","author":"Tesla Delacroix","subject":"milk splashing out of a striped mug on a saucer against a black background","tags":["tea","mug","splash","milk","drink","dark","morning","kitchen","cafe","warm drink"],"cat":"drink","tone":"dark","temp":"warm","people":"none","q":2},{"id":"Dülmen, Börnste, Tropfen am Gatter -- 2020 -- 3592.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/a/a8/D%C3%BClmen%2C_B%C3%B6rnste%2C_Tropfen_am_Gatter_--_2020_--_3592.jpg","page":"https://commons.wikimedia.org/wiki/File:D%C3%BClmen,_B%C3%B6rnste,_Tropfen_am_Gatter_--_2020_--_3592.jpg","w":6627,"h":4418,"color":"#5f6344","license":"CC BY-SA 4.0","author":"Dietmar Rabich","subject":"raindrops hanging from the green painted bar of a farm gate, field blurred behind","tags":["farm gate","rain","raindrops","wet","farm","gate","weather","macro","green","countryside"],"cat":"nature","tone":"mid","temp":"cool","people":"none","q":3,"fp":[0.5,0.4]},{"id":"Lamb on a farm in Rust, Burgenland, Austria, 20220425 1349 5111.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/e0/Lamb_on_a_farm_in_Rust%2C_Burgenland%2C_Austria%2C_20220425_1349_5111.jpg","page":"https://commons.wikimedia.org/wiki/File:Lamb_on_a_farm_in_Rust,_Burgenland,_Austria,_20220425_1349_5111.jpg","w":4147,"h":2768,"color":"#6c815f","license":"CC BY-SA 4.0","author":"Jakub Hałun","subject":"a woolly lamb grazing in long green grass beside a tree trunk","tags":["lamb","sheep","lambing","spring","farm","grazing","grass","livestock","pasture"],"cat":"animal","tone":"mid","temp":"neutral","people":"none","q":2,"fp":[0.55,0.55]},{"id":"Adenium Seedling 18day Uthandi Aug21 D72 20806.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/21/Adenium_Seedling_18day_Uthandi_Aug21_D72_20806.jpg","page":"https://commons.wikimedia.org/wiki/File:Adenium_Seedling_18day_Uthandi_Aug21_D72_20806.jpg","w":3200,"h":4000,"color":"#706c3f","license":"CC BY-SA 4.0","author":"This Photo was taken by Timothy A. Gonsalves. Feel free to use my photos, but pl","subject":"a young seedling with fresh green leaves rising from gravel in a terracotta pot","tags":["seedling","sprout","plant","pot","growing","garden","spring","home","nursery","green"],"cat":"nature","tone":"mid","temp":"warm","people":"none","q":2,"fp":[0.5,0.55]},{"id":"Rain on a window.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/42/Rain_on_a_window.jpg","page":"https://commons.wikimedia.org/wiki/File:Rain_on_a_window.jpg","w":3728,"h":3000,"color":"#72797d","license":"CC BY-SA 4.0","author":"W.carter","subject":"rain running down a window pane with a blurred wall and rooftop behind","tags":["rain","window","raindrops","glass","weather","mood","grey","home","quiet","autumn"],"cat":"texture","tone":"mid","temp":"cool","people":"none","q":2},{"id":"Carteles en riso.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/8/8e/Carteles_en_riso.jpg","page":"https://commons.wikimedia.org/wiki/File:Carteles_en_riso.jpg","w":3024,"h":4032,"color":"#9a9f9b","license":"CC BY-SA 4.0","author":"Alequihdez","subject":"teal riso printed posters of hands laid out in rows on a dark floor","tags":["risograph","posters","prints","print shop","studio","art print","riso","zine","paper","drying"],"cat":"craft","tone":"mid","temp":"cool","people":"none","q":2},{"id":"Everyday joy zine making.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/d/d4/Everyday_joy_zine_making.jpg","page":"https://commons.wikimedia.org/wiki/File:Everyday_joy_zine_making.jpg","w":5208,"h":3472,"color":"#85827d","license":"CC BY 4.0","author":"Fhwatson","subject":"an open handmade booklet with a mountain photo spread lying on patterned papers","tags":["zine","booklet","open","print","handmade","paper","publishing","riso","pattern","small press"],"cat":"craft","tone":"light","temp":"cool","people":"none","q":2,"fp":[0.45,0.5]},{"id":"Conwy Estuary at dusk - geograph.org.uk - 4556293.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/1/1f/Conwy_Estuary_at_dusk_-_geograph.org.uk_-_4556293.jpg","page":"https://commons.wikimedia.org/wiki/File:Conwy_Estuary_at_dusk_-_geograph.org.uk_-_4556293.jpg","w":5472,"h":3648,"color":"#7e6a49","license":"CC BY-SA 2.0","author":"Matt Harrop","subject":"a calm estuary at dusk under an amber sky with moored boats and dark hills","tags":["estuary","dusk","boats","harbour","sunset","wales","port town","reflection","calm","evening"],"cat":"landscape","tone":"dark","temp":"warm","people":"none","q":3},{"id":"A green stapler.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/a/a4/A_green_stapler.jpg","page":"https://commons.wikimedia.org/wiki/File:A_green_stapler.jpg","w":4160,"h":3120,"color":"#8b9568","license":"CC0","author":"Jiafei Slay Queen","subject":"a lime green stapler on a pale grey desk with a soft shadow","tags":["stapler","stationery","office","desk","zine","green","diy","binding","object"],"cat":"object","tone":"light","temp":"cool","people":"none","q":2},{"id":"Hebden Bridge - 53190059068.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/3/3e/Hebden_Bridge_-_53190059068.jpg","page":"https://commons.wikimedia.org/wiki/File:Hebden_Bridge_-_53190059068.jpg","w":2407,"h":3009,"color":"#707f7f","license":"CC BY 2.0","author":"Tim Green","subject":"a navy narrowboat moored on a canal beside a tall stone mill building","tags":["narrowboat","canal","stone mill","hebden bridge","yorkshire","pennines","towpath","mill town","northern england"],"cat":"travel","tone":"mid","temp":"cool","people":"none","q":2,"fp":[0.5,0.55]},{"id":"Metro Lisboa January 2015-2a.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/5/59/Metro_Lisboa_January_2015-2a.jpg","page":"https://commons.wikimedia.org/wiki/File:Metro_Lisboa_January_2015-2a.jpg","w":6286,"h":4420,"color":"#4b4b4b","license":"CC BY-SA 4.0","author":"Alvesgaspar","subject":"a wide metro stair and escalator rising beside a square pillar, black and white","tags":["metro","escalator","stairs","lisbon","station","underground","black and white","transit","wayfinding","commute"],"cat":"architecture","tone":"mid","temp":"neutral","people":"none","q":2},{"id":"Jules and Gabriel at the Metro entrance, Alameda Dom Afonso Henriques, Lisbon, Portugal julesvernex2.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/7a/Jules_and_Gabriel_at_the_Metro_entrance%2C_Alameda_Dom_Afonso_Henriques%2C_Lisbon%2C_Portugal_julesvernex2.jpg","page":"https://commons.wikimedia.org/wiki/File:Jules_and_Gabriel_at_the_Metro_entrance,_Alameda_Dom_Afonso_Henriques,_Lisbon,_Portugal_julesvernex2.jpg","w":6457,"h":4417,"color":"#938b88","license":"CC BY-SA 4.0","author":"Jules Verne Times Two","subject":"a woman and child seen from behind walking down concrete steps into a metro","tags":["metro entrance","stairs","going down","lisbon","commute","family","from behind","station","city","wayfinding"],"cat":"city","tone":"light","temp":"neutral","people":"figure","q":3,"fp":[0.6,0.55]},{"id":"Travessa Couto Fernandes 60 Centro São Luís 2025-6016 (pcorr, crop).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/b9/Travessa_Couto_Fernandes_60_Centro_S%C3%A3o_Lu%C3%ADs_2025-6016_%28pcorr%2C_crop%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Travessa_Couto_Fernandes_60_Centro_S%C3%A3o_Lu%C3%ADs_2025-6016_(pcorr,_crop).jpg","w":3881,"h":3878,"color":"#7b89cf","license":"CC BY 4.0","author":"Prburley","subject":"blue and white azulejo tiles with a repeating floral pattern, flat on","tags":["azulejo","tiles","blue","pattern","portugal","ceramic","texture","lisbon","decorative"],"cat":"texture","tone":"mid","temp":"cool","people":"none","q":2},{"id":"Copenhagen Metro escalators.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/42/Copenhagen_Metro_escalators.jpg","page":"https://commons.wikimedia.org/wiki/File:Copenhagen_Metro_escalators.jpg","w":3486,"h":2269,"color":"#51514a","license":"CC BY 2.0","author":"Stig Nygaard from Copenhagen, Denmark","subject":"three long escalators descending between steel walls in a metro shaft","tags":["escalator","metro","going down","underground","symmetry","station","steel","transit","wayfinding","copenhagen"],"cat":"architecture","tone":"mid","temp":"cool","people":"none","q":3},{"id":"Ana rosa metro station, São Paulo, Brazil.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/ff/Ana_rosa_metro_station%2C_S%C3%A3o_Paulo%2C_Brazil.jpg","page":"https://commons.wikimedia.org/wiki/File:Ana_rosa_metro_station,_S%C3%A3o_Paulo,_Brazil.jpg","w":3988,"h":2650,"color":"#525252","license":"CC BY-SA 4.0","author":"Wilfredor","subject":"a woman seen from behind descending station stairs toward the platform, black and white","tags":["stairs","metro","station","going down","from behind","commute","black and white","transit","city","wayfinding"],"cat":"city","tone":"mid","temp":"neutral","people":"figure","q":3,"fp":[0.6,0.6]},{"id":"Escalators at Auber RER station in Paris, recently renovated, with clean and modern underground architecture.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/c/ca/Escalators_at_Auber_RER_station_in_Paris%2C_recently_renovated%2C_with_clean_and_modern_underground_architecture.jpg","page":"https://commons.wikimedia.org/wiki/File:Escalators_at_Auber_RER_station_in_Paris,_recently_renovated,_with_clean_and_modern_underground_architecture.jpg","w":7322,"h":4127,"color":"#787779","license":"CC0","author":"Wilfredor","subject":"twin escalators rising under a pale vaulted ceiling in a clean underground station","tags":["escalator","station","underground","rer","paris","modern","symmetry","transit","wayfinding"],"cat":"architecture","tone":"light","temp":"cool","people":"none","q":2},{"id":"Porte Marguerite-de-Navarre (Paris).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/2d/Porte_Marguerite-de-Navarre_%28Paris%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Porte_Marguerite-de-Navarre_(Paris).jpg","w":8256,"h":5504,"color":"#574d42","license":"CC0","author":"Wilfredor","subject":"escalators climbing toward a tall oval opening of slatted daylight underground","tags":["escalator","exit","daylight","underground","station","paris","architecture","going up","wayfinding","transit"],"cat":"architecture","tone":"mid","temp":"warm","people":"figure","q":3,"fp":[0.55,0.55]},{"id":"Condensation Zoomed In.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/79/Condensation_Zoomed_In.jpg","page":"https://commons.wikimedia.org/wiki/File:Condensation_Zoomed_In.jpg","w":4160,"h":3120,"color":"#716e72","license":"CC0","author":"Doggo19292","subject":"close up of condensation beads running down a cold glass surface","tags":["condensation","droplets","cold","glass","texture","chilled","drink","water","macro"],"cat":"texture","tone":"mid","temp":"cool","people":"none","q":2},{"id":"Lemon - whole and split.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/f7/Lemon_-_whole_and_split.jpg","page":"https://commons.wikimedia.org/wiki/File:Lemon_-_whole_and_split.jpg","w":6000,"h":4000,"color":"#65571d","license":"CC BY-SA 4.0","author":"Ivar Leidus","subject":"a whole lemon beside a halved lemon on a black background in hard light","tags":["lemons","halved lemon","citrus","fruit","yellow","black background","lemonade","soda","fresh","food"],"cat":"food","tone":"dark","temp":"warm","people":"none","q":2},{"id":"Ice Cube (22699287466).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/e4/Ice_Cube_%2822699287466%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Ice_Cube_(22699287466).jpg","w":5364,"h":3018,"color":"#443e3c","license":"CC BY 2.0","author":"Helen Penjam","subject":"a single clear ice cube on a black surface lit from the side","tags":["ice","ice cube","cold","clear","black","drinks","bar","cocktail","minimal","chilled"],"cat":"drink","tone":"dark","temp":"cool","people":"none","q":2},{"id":"Narrowboat on Mill Avon - geograph.org.uk - 6861104.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/6/60/Narrowboat_on_Mill_Avon_-_geograph.org.uk_-_6861104.jpg","page":"https://commons.wikimedia.org/wiki/File:Narrowboat_on_Mill_Avon_-_geograph.org.uk_-_6861104.jpg","w":1600,"h":1200,"color":"#6f7457","license":"CC BY-SA 2.0","author":"Philip Halling","subject":"a narrowboat gliding past weeping willows toward a brick mill and footbridge","tags":["narrowboat","river","mill","willows","canal","england","boat trip","summer","waterway","heritage"],"cat":"travel","tone":"mid","temp":"warm","people":"figure","q":2,"fp":[0.45,0.55]},{"id":"Narrowboat passing under Fisher's Mill Bridge - geograph.org.uk - 7269359.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/95/Narrowboat_passing_under_Fisher%27s_Mill_Bridge_-_geograph.org.uk_-_7269359.jpg","page":"https://commons.wikimedia.org/wiki/File:Narrowboat_passing_under_Fisher%27s_Mill_Bridge_-_geograph.org.uk_-_7269359.jpg","w":6000,"h":4000,"color":"#6a6e4d","license":"CC BY-SA 2.0","author":"Bill Boaden","subject":"a narrowboat passing under an old stone canal bridge beside a grassy towpath","tags":["narrowboat","canal","stone bridge","towpath","england","waterway","countryside","walking","heritage"],"cat":"travel","tone":"mid","temp":"cool","people":"none","q":2,"fp":[0.6,0.4]},{"id":"Crest kitchenette motel stairwell.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/4b/Crest_kitchenette_motel_stairwell.jpg","page":"https://commons.wikimedia.org/wiki/File:Crest_kitchenette_motel_stairwell.jpg","w":2276,"h":3264,"color":"#484743","license":"CC BY-SA 4.0","author":"Sarah Clark","subject":"a lit concrete stairwell glowing inside a dark building at night, upright frame","tags":["stairwell","staircase","night","lit","concrete","building","dark","motel","mood","architecture"],"cat":"architecture","tone":"dark","temp":"neutral","people":"none","q":3,"fp":[0.55,0.5]},{"id":"Stair well (14161202236).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/6/69/Stair_well_%2814161202236%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Stair_well_(14161202236).jpg","w":3744,"h":5616,"color":"#171717","license":"CC BY 2.0","author":"George N from Chengdu, China","subject":"fire escape stairs climbing a narrow dark courtyard at night, black and white","tags":["stairwell","fire escape","night","alley","black and white","city","dark","mood","stairs"],"cat":"city","tone":"dark","temp":"neutral","people":"none","q":2},{"id":"Hallway to Nowhere (3098664168).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/bd/Hallway_to_Nowhere_%283098664168%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Hallway_to_Nowhere_(3098664168).jpg","w":2560,"h":1920,"color":"#6b6c68","license":"CC BY-SA 2.0","author":"Steve Harris from Toronto, Canada","subject":"an empty tiled underground corridor lit by a row of ceiling strip lights","tags":["corridor","hallway","empty","tiles","fluorescent","night","underground","perspective","mood","passage"],"cat":"architecture","tone":"mid","temp":"cool","people":"none","q":2},{"id":"NOIRLab HQ Server Racks (6V6A0395-CC).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/f0/NOIRLab_HQ_Server_Racks_%286V6A0395-CC%29.jpg","page":"https://commons.wikimedia.org/wiki/File:NOIRLab_HQ_Server_Racks_(6V6A0395-CC).jpg","w":5167,"h":3445,"color":"#1e2128","license":"CC BY 4.0","author":"NOIRLab/NSF/AURA/T. Slovinský","subject":"dark server racks glowing with rows of blue, red and green status lights","tags":["servers","server racks","data centre","lights","dark","cloud","hosting","network","infrastructure","tech"],"cat":"tech","tone":"dark","temp":"cool","people":"none","q":3},{"id":"Pottery oven in Nová budova Národního muzea Prague.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/e1/Pottery_oven_in_Nov%C3%A1_budova_N%C3%A1rodn%C3%ADho_muzea_Prague.jpg","page":"https://commons.wikimedia.org/wiki/File:Pottery_oven_in_Nov%C3%A1_budova_N%C3%A1rodn%C3%ADho_muzea_Prague.jpg","w":2592,"h":4608,"color":"#4d3f39","license":"CC BY-SA 4.0","author":"Geertivp","subject":"a small domed clay kiln stacked with pale pots, glowing in a dark room","tags":["kiln","pottery","firing","clay","pots","traditional","ceramics","dark","heritage","oven"],"cat":"craft","tone":"dark","temp":"warm","people":"none","q":2,"fp":[0.5,0.4]},{"id":"Firing kiln furniture di kilang Claytan.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/a/ad/Firing_kiln_furniture_di_kilang_Claytan.jpg","page":"https://commons.wikimedia.org/wiki/File:Firing_kiln_furniture_di_kilang_Claytan.jpg","w":3968,"h":2976,"color":"#968a81","license":"CC BY-SA 4.0","author":"Encik Tekateki","subject":"a kiln car stacked high with glazed plates and bowls on refractory shelves","tags":["kiln","kiln shelf","glazed","plates","ceramics","pottery","factory","firing","stacked","tableware"],"cat":"craft","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Home recording controller closeup. (51294794826).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/0/03/Home_recording_controller_closeup._%2851294794826%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Home_recording_controller_closeup._(51294794826).jpg","w":6016,"h":4016,"color":"#343a39","license":"CC BY 2.0","author":"Nenad Stojkovic","subject":"a small audio interface glowing in the dark on a producer's desk, keyboard beside","tags":["home studio","audio interface","producer","desk","night","music","recording","dark","knobs","tech"],"cat":"tech","tone":"dark","temp":"cool","people":"none","q":2},{"id":"San Joaquin Delta Aerial 2.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/f8/San_Joaquin_Delta_Aerial_2.jpg","page":"https://commons.wikimedia.org/wiki/File:San_Joaquin_Delta_Aerial_2.jpg","w":3600,"h":2400,"color":"#5c6567","license":"CC BY-SA 2.0","author":"formulanone","subject":"a river delta of winding channels between patchwork farm islands, from the air","tags":["river delta","aerial","farmland","from above","fields","channels","patchwork","agriculture","water","landscape"],"cat":"landscape","tone":"mid","temp":"warm","people":"none","q":3},{"id":"Po River Delta aerial 2.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/0/0e/Po_River_Delta_aerial_2.jpg","page":"https://commons.wikimedia.org/wiki/File:Po_River_Delta_aerial_2.jpg","w":5590,"h":3968,"color":"#93a19c","license":"CC BY-SA 4.0","author":"kallerna","subject":"a wide river curving through a flat patchwork of fields seen from a plane","tags":["river","aerial","farmland","from above","fields","delta","patchwork","landscape","clouds","italy"],"cat":"landscape","tone":"mid","temp":"cool","people":"none","q":2},{"id":"Monteregie farmland aerial 1 2025.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/0/09/Monteregie_farmland_aerial_1_2025.jpg","page":"https://commons.wikimedia.org/wiki/File:Monteregie_farmland_aerial_1_2025.jpg","w":4000,"h":3000,"color":"#5e7b78","license":"CC BY 4.0","author":"Hayden Soloviev","subject":"long strips of green crop fields running to a flat horizon under blue sky, from above","tags":["farmland","aerial","fields","crop rows","from above","drone","agriculture","green","patchwork","summer"],"cat":"landscape","tone":"mid","temp":"cool","people":"none","q":2},{"id":"Wood Type close-up.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/8/8f/Wood_Type_close-up.jpg","page":"https://commons.wikimedia.org/wiki/File:Wood_Type_close-up.jpg","w":4714,"h":3143,"color":"#9c9890","license":"CC BY-SA 2.0","author":"Adam Lusch","subject":"a block of old wooden letterpress type set in reverse on a pale ground","tags":["wood type","letterpress","printing","type","print shop","typography","craft","vintage","studio"],"cat":"craft","tone":"light","temp":"warm","people":"none","q":2,"fp":[0.5,0.45]},{"id":"Onta Pottery drying in the sun.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/71/Onta_Pottery_drying_in_the_sun.jpg","page":"https://commons.wikimedia.org/wiki/File:Onta_Pottery_drying_in_the_sun.jpg","w":2592,"h":1944,"color":"#7b7363","license":"CC BY-SA 3.0","author":"STA3816","subject":"rows of unfired clay pots drying in the sun on long wooden racks","tags":["pottery","drying","clay","pots","racks","ceramics","workshop","rows","handmade","japan"],"cat":"craft","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Clay Pottery Drying.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/8/84/Clay_Pottery_Drying.jpg","page":"https://commons.wikimedia.org/wiki/File:Clay_Pottery_Drying.jpg","w":7903,"h":5927,"color":"#9a8f84","license":"CC BY-SA 4.0","author":"Muhammad Amdad Hossain","subject":"a potter among hundreds of clay pots drying on the ground, seen from above","tags":["pottery","clay","pots","drying","from above","potter","workshop","ceramics","pattern","handmade"],"cat":"craft","tone":"mid","temp":"neutral","people":"figure","q":3,"fp":[0.52,0.45]},{"id":"Street of terraced housing.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/e7/Street_of_terraced_housing.jpg","page":"https://commons.wikimedia.org/wiki/File:Street_of_terraced_housing.jpg","w":1617,"h":1062,"color":"#858180","license":"CC BY-SA 3.0","author":"User Duncharris on en.wikipedia","subject":"two rows of brick terraced houses and their roofs either side of a street, from above","tags":["roofs","terraced houses","from above","street","brick","chimneys","housing","england","town","rows"],"cat":"city","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Vienna U-Bahn - U4 metro line-Type V arriving far ar 16to10 PNr°1177.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/f0/Vienna_U-Bahn_-_U4_metro_line-Type_V_arriving_far_ar_16to10_PNr%C2%B01177.jpg","page":"https://commons.wikimedia.org/wiki/File:Vienna_U-Bahn_-_U4_metro_line-Type_V_arriving_far_ar_16to10_PNr%C2%B01177.jpg","w":6406,"h":4004,"color":"#4e3427","license":"CC BY-SA 4.0","author":"D-Kuru","subject":"curving rails glowing in sunset light as a train approaches from far off","tags":["rails","tracks","converging","sunset","train","railway","switches","golden hour","transport","logistics"],"cat":"city","tone":"dark","temp":"warm","people":"none","q":3,"fp":[0.55,0.5]},{"id":"Virginia Tech - data center.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/d/d5/Virginia_Tech_-_data_center.jpg","page":"https://commons.wikimedia.org/wiki/File:Virginia_Tech_-_data_center.jpg","w":3264,"h":2448,"color":"#656867","license":"CC BY-SA 2.0","author":"Christopher Bowns","subject":"a long aisle between black server racks under a white ceiling in a data centre","tags":["data centre","server aisle","server racks","servers","cloud","hosting","infrastructure","perspective","tech"],"cat":"tech","tone":"mid","temp":"cool","people":"none","q":3},{"id":"Young businesswoman holding her smartphone in the home office.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/2e/Young_businesswoman_holding_her_smartphone_in_the_home_office.jpg","page":"https://commons.wikimedia.org/wiki/File:Young_businesswoman_holding_her_smartphone_in_the_home_office.jpg","w":6016,"h":4016,"color":"#8d8a85","license":"CC BY 2.0","author":"Shixart1985","subject":"a hand holding a phone over an open notebook and laptop on a home desk","tags":["phone","hands","desk","notebook","laptop","home office","app","table","morning","work"],"cat":"work","tone":"light","temp":"neutral","people":"hands","q":2,"fp":[0.6,0.45]},{"id":"Larry Crane mixing on Rupert Neve Designs 5088 console, Jackpot! Recording Studio (Portland, Oregon).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/8/8e/Larry_Crane_mixing_on_Rupert_Neve_Designs_5088_console%2C_Jackpot%21_Recording_Studio_%28Portland%2C_Oregon%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Larry_Crane_mixing_on_Rupert_Neve_Designs_5088_console,_Jackpot!_Recording_Studio_(Portland,_Oregon).jpg","w":2288,"h":1712,"color":"#67564d","license":"CC BY-SA 2.0","author":"VACANT FEVER","subject":"a hand moving faders across a long studio mixing console, shallow focus","tags":["mixing","faders","hands","console","recording studio","producer","music","sound","studio"],"cat":"tech","tone":"mid","temp":"warm","people":"hands","q":2,"fp":[0.45,0.35]},{"id":"Behringer X32 Digital Mixer in operation - angled (2017-07-21 17.23.52 @pxhere 174508).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/0/0e/Behringer_X32_Digital_Mixer_in_operation_-_angled_%282017-07-21_17.23.52_%40pxhere_174508%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Behringer_X32_Digital_Mixer_in_operation_-_angled_(2017-07-21_17.23.52_@pxhere_174508).jpg","w":5760,"h":3840,"color":"#29262c","license":"CC0","author":"Unknown authorUnknown author","subject":"hands working a glowing digital mixing desk in a dark booth","tags":["mixer","hands","dj","booth","night","dark","faders","sound","club","live music"],"cat":"tech","tone":"dark","temp":"cool","people":"hands","q":3,"fp":[0.4,0.6]},{"id":"Audio mixer close up.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/f3/Audio_mixer_close_up.jpg","page":"https://commons.wikimedia.org/wiki/File:Audio_mixer_close_up.jpg","w":6000,"h":4000,"color":"#1f2654","license":"CC BY-SA 4.0","author":"Lchader","subject":"rows of mixer faders and lit buttons glowing blue in the dark, close up","tags":["mixer","faders","blue light","dark","sound","dj","studio","music","club","close up"],"cat":"tech","tone":"dark","temp":"cool","people":"none","q":2},{"id":"Test tubes in rack.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/3/3c/Test_tubes_in_rack.jpg","page":"https://commons.wikimedia.org/wiki/File:Test_tubes_in_rack.jpg","w":6000,"h":4000,"color":"#807e7a","license":"CC BY-SA 4.0","author":"J.N. Eskra","subject":"a row of clear glass test tubes in a steel rack, shallow focus","tags":["test tubes","laboratory","rack","glass","science","research","lab bench","steel","clinical"],"cat":"science","tone":"mid","temp":"cool","people":"none","q":2},{"id":"Holding my grandmother's hand when she was 87 and I was 27.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/6/6b/Holding_my_grandmother%27s_hand_when_she_was_87_and_I_was_27.jpg","page":"https://commons.wikimedia.org/wiki/File:Holding_my_grandmother%27s_hand_when_she_was_87_and_I_was_27.jpg","w":6016,"h":4000,"color":"#5a565b","license":"CC BY-SA 4.0","author":"Levi Clancy","subject":"an older woman's ringed hand clasping a younger hand against a blue background","tags":["older hands","holding hands","care","family","grandmother","wrinkles","rings","love","elderly"],"cat":"family","tone":"mid","temp":"cool","people":"hands","q":3},{"id":"Wrinkled Time.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/8/8d/Wrinkled_Time.jpg","page":"https://commons.wikimedia.org/wiki/File:Wrinkled_Time.jpg","w":3600,"h":2391,"color":"#6d443f","license":"CC BY-SA 4.0","author":"Jumphoto2000","subject":"an old woman's weathered hands resting on a striped red woven skirt","tags":["older hands","wrinkled","elderly","hands","textile","age","care","rest","portrait"],"cat":"family","tone":"mid","temp":"warm","people":"hands","q":2},{"id":"Zitronenscheiben -- 2025 -- 7302.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/42/Zitronenscheiben_--_2025_--_7302.jpg","page":"https://commons.wikimedia.org/wiki/File:Zitronenscheiben_--_2025_--_7302.jpg","w":6301,"h":4201,"color":"#d6b675","license":"CC BY-SA 4.0","author":"Dietmar Rabich","subject":"two thin lemon slices backlit on white, seeds and segments glowing","tags":["lemon slices","citrus","backlit","yellow","fresh","lemonade","soda","drink garnish","fruit","texture"],"cat":"food","tone":"light","temp":"warm","people":"none","q":3},{"id":"Ginger Root.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/fa/Ginger_Root.jpg","page":"https://commons.wikimedia.org/wiki/File:Ginger_Root.jpg","w":5646,"h":3753,"color":"#e8cfb2","license":"CC BY-SA 4.0","author":"Sanjay Acharya","subject":"a knobbly hand of fresh ginger root on a white background","tags":["ginger","ginger root","spice","ingredient","ginger beer","fresh","root","product","kitchen"],"cat":"food","tone":"light","temp":"warm","people":"none","q":2},{"id":"Gasbläschen -- 2022 -- 9759.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/46/Gasbl%C3%A4schen_--_2022_--_9759.jpg","page":"https://commons.wikimedia.org/wiki/File:Gasbl%C3%A4schen_--_2022_--_9759.jpg","w":6720,"h":4480,"color":"#ed0f0d","license":"CC BY-SA 4.0","author":"Dietmar Rabich","subject":"bubbles rising through bright red soda in close up","tags":["bubbles","fizz","soda","carbonated","red","drink","texture","sparkling","macro","abstract"],"cat":"abstract","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Blue glass with carbonated water.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/d/de/Blue_glass_with_carbonated_water.jpg","page":"https://commons.wikimedia.org/wiki/File:Blue_glass_with_carbonated_water.jpg","w":3474,"h":3474,"color":"#89a5c7","license":"CC0","author":"W.carter","subject":"a blue glass of sparkling water seen from above, fine bubbles at the bottom","tags":["sparkling water","glass","bubbles","from above","blue","drink","fizz","soda","refreshment","minimal"],"cat":"drink","tone":"light","temp":"cool","people":"none","q":2},{"id":"Dülmen, Alte Brennerei Löhning -- 2015 -- 8602-6.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/47/D%C3%BClmen%2C_Alte_Brennerei_L%C3%B6hning_--_2015_--_8602-6.jpg","page":"https://commons.wikimedia.org/wiki/File:D%C3%BClmen,_Alte_Brennerei_L%C3%B6hning_--_2015_--_8602-6.jpg","w":3149,"h":4728,"color":"#9c8371","license":"CC BY-SA 4.0","author":"Dietmar Rabich","subject":"an empty white attic room with a brick chimney and one arched window at its end","tags":["empty room","window","attic","minimal","white","interior","quiet","light","home","architecture"],"cat":"interior","tone":"light","temp":"neutral","people":"none","q":2,"fp":[0.55,0.45]},{"id":"Buntstifte -- 2021 -- 9148.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/7c/Buntstifte_--_2021_--_9148.jpg","page":"https://commons.wikimedia.org/wiki/File:Buntstifte_--_2021_--_9148.jpg","w":6720,"h":3780,"color":"#643e24","license":"CC BY-SA 4.0","author":"Dietmar Rabich","subject":"a fan of coloured pencils lying on a dark surface, tips in focus","tags":["coloured pencils","pencils","drawing","art supplies","sketching","studio","illustration","colour","stationery"],"cat":"object","tone":"dark","temp":"warm","people":"none","q":2,"fp":[0.3,0.6]},{"id":"CSIRO ScienceImage 11401 CSIRO researcher with pipette.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/bc/CSIRO_ScienceImage_11401_CSIRO_researcher_with_pipette.jpg","page":"https://commons.wikimedia.org/wiki/File:CSIRO_ScienceImage_11401_CSIRO_researcher_with_pipette.jpg","w":1771,"h":2657,"color":"#69635b","license":"CC BY 3.0","author":"Morgan Brown, CSIRO","subject":"a gloved hand gripping a pipette in a dim lab, tip pointing down, upright frame","tags":["pipette","gloves","laboratory","hand","lab bench","science","research","biotech","testing","close up"],"cat":"science","tone":"dark","temp":"cool","people":"hands","q":2,"fp":[0.5,0.4]},{"id":"US Navy 040427-N-0000W-028 Using protective gloves under a protective hood, civilian technician Erlin Listiyaningsih of the NAMRU-2 Laboratory, Jakarta, Indonesia, conducts specialized testing to identify a deadly pneumonia str.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/d/d7/US_Navy_040427-N-0000W-028_Using_protective_gloves_under_a_protective_hood%2C_civilian_technician_Erlin_Listiyaningsih_of_the_NAMRU-2_Laboratory%2C_Jakarta%2C_Indonesia%2C_conducts_specialized_testing_to_identify_a_deadly_pneumonia_str.jpg","page":"https://commons.wikimedia.org/wiki/File:US_Navy_040427-N-0000W-028_Using_protective_gloves_under_a_protective_hood,_civilian_technician_Erlin_Listiyaningsih_of_the_NAMRU-2_Laboratory,_Jakarta,_Indonesia,_conducts_specialized_testing_to_identify_a_deadly_pneumonia_str.jpg","w":2100,"h":1378,"color":"#a2b4b9","license":"Public domain","author":"U.S. Navy photo by Tom Watanabe","subject":"gloved hands working with a sample tube inside a clear lab hood beside a tube rack","tags":["laboratory","gloves","hands","samples","tubes","testing","lab bench","science","biotech","research"],"cat":"science","tone":"light","temp":"cool","people":"hands","q":2,"fp":[0.55,0.45]},{"id":"Kenlon on the sofa.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/b2/Kenlon_on_the_sofa.jpg","page":"https://commons.wikimedia.org/wiki/File:Kenlon_on_the_sofa.jpg","w":5184,"h":3456,"color":"#625b5f","license":"CC BY-SA 4.0","author":"Kenlonofficial","subject":"a teenager on a dark sofa playing an electric guitar by a bright window, side on","tags":["guitar","sofa","playing","living room","teen","practice","music","home","window light","lessons"],"cat":"family","tone":"mid","temp":"cool","people":"figure","q":2,"fp":[0.45,0.5]},{"id":"Eko Rio Bravo 12 - closeup of Eko acoustic guitar on couch. (2021-08-29 11.30.31 by Nenad Stojkovic).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/3/3e/Eko_Rio_Bravo_12_-_closeup_of_Eko_acoustic_guitar_on_couch._%282021-08-29_11.30.31_by_Nenad_Stojkovic%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Eko_Rio_Bravo_12_-_closeup_of_Eko_acoustic_guitar_on_couch._(2021-08-29_11.30.31_by_Nenad_Stojkovic).jpg","w":4016,"h":6016,"color":"#54474a","license":"CC BY 2.0","author":"Nenad Stojkovic","subject":"an acoustic guitar lying on a dark couch, sound hole and neck in soft light","tags":["acoustic guitar","couch","sofa","guitar","home","music","songwriting","dark","still life"],"cat":"object","tone":"dark","temp":"warm","people":"none","q":2,"fp":[0.5,0.4]},{"id":"Brač played in the tamburica ensemble (2019-04-20 16.52.09 by Marko Milivojevic @PIXNIO 2592516).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/d/df/Bra%C4%8D_played_in_the_tamburica_ensemble_%282019-04-20_16.52.09_by_Marko_Milivojevic_%40PIXNIO_2592516%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Bra%C4%8D_played_in_the_tamburica_ensemble_(2019-04-20_16.52.09_by_Marko_Milivojevic_@PIXNIO_2592516).jpg","w":4739,"h":3159,"color":"#2e2520","license":"CC0","author":"Marko Milivojevic (milim84)","subject":"a hand fretting chords on a small string instrument with a dark blurred background","tags":["guitar","hands","strings","fretboard","playing","music","chords","practice","lessons","close up"],"cat":"object","tone":"dark","temp":"warm","people":"hands","q":2,"fp":[0.6,0.4]},{"id":"A young boy sits on a couch, strumming his acoustic guitar.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/2b/A_young_boy_sits_on_a_couch%2C_strumming_his_acoustic_guitar.jpg","page":"https://commons.wikimedia.org/wiki/File:A_young_boy_sits_on_a_couch,_strumming_his_acoustic_guitar.jpg","w":4024,"h":6048,"color":"#221e21","license":"CC BY 2.0","author":"Shixart1985","subject":"a young man in a dark room playing an acoustic guitar beside a small side table","tags":["guitar","acoustic","playing","dark room","home","music","practice","mood","lamp","songwriting"],"cat":"family","tone":"dark","temp":"warm","people":"figure","q":2,"fp":[0.45,0.6]},{"id":"A boy lies on a comfortable sofa, focused on playing with a smartphone.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/41/A_boy_lies_on_a_comfortable_sofa%2C_focused_on_playing_with_a_smartphone.jpg","page":"https://commons.wikimedia.org/wiki/File:A_boy_lies_on_a_comfortable_sofa,_focused_on_playing_with_a_smartphone.jpg","w":6048,"h":4024,"color":"#867c74","license":"CC BY 2.0","author":"Shixart1985","subject":"a boy lying on a grey sofa looking at a phone, guitar beside him, window behind","tags":["phone","sofa","living room","child","home","guitar","app","relaxing","window light","family"],"cat":"family","tone":"light","temp":"neutral","people":"figure","q":2,"fp":[0.55,0.55]},{"id":"Night Rain mode.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/b8/Night_Rain_mode.jpg","page":"https://commons.wikimedia.org/wiki/File:Night_Rain_mode.jpg","w":3456,"h":4608,"color":"#2f3132","license":"CC BY-SA 4.0","author":"Nadinviki","subject":"rain beaded on a car window at night, a wing mirror glowing with city lights","tags":["rain","night","window","raindrops","bokeh","city lights","mood","journey","dark","weather"],"cat":"texture","tone":"dark","temp":"warm","people":"none","q":2,"fp":[0.55,0.55]},{"id":"Bokeh raindrops on a window 1.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/0/01/Bokeh_raindrops_on_a_window_1.jpg","page":"https://commons.wikimedia.org/wiki/File:Bokeh_raindrops_on_a_window_1.jpg","w":3283,"h":4385,"color":"#3d342d","license":"CC0","author":"W.carter","subject":"out of focus raindrops on a window glowing with warm night lights","tags":["rain","bokeh","night","window","lights","dark","mood","raindrops","abstract","weather"],"cat":"abstract","tone":"dark","temp":"warm","people":"none","q":2},{"id":"Scope soldering iron (early model).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/f9/Scope_soldering_iron_%28early_model%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Scope_soldering_iron_(early_model).jpg","w":4452,"h":2968,"color":"#7c5b42","license":"CC BY-SA 4.0","author":"Doug butler","subject":"a hand holding an old soldering iron over a wooden bench with pliers and parts","tags":["soldering iron","hand","repair","workbench","electronics","tools","fix","maker","wood","right to repair"],"cat":"work","tone":"mid","temp":"warm","people":"hands","q":2,"fp":[0.6,0.4]},{"id":"OSCAL 2017 silkscreen printed materials 29.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/c/c4/OSCAL_2017_silkscreen_printed_materials_29.jpg","page":"https://commons.wikimedia.org/wiki/File:OSCAL_2017_silkscreen_printed_materials_29.jpg","w":2400,"h":1600,"color":"#705655","license":"CC BY 4.0","author":"Manolis Angelakis","subject":"a silkscreen frame lifted from a fresh red print on a hinged press in a busy studio","tags":["screen printing","silkscreen","press","red ink","print studio","posters","printing","workshop","prints"],"cat":"craft","tone":"mid","temp":"warm","people":"none","q":2,"fp":[0.4,0.5]},{"id":"Abziehen der Rückseite eines geschlitzten Stickers.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/96/Abziehen_der_R%C3%BCckseite_eines_geschlitzten_Stickers.jpg","page":"https://commons.wikimedia.org/wiki/File:Abziehen_der_R%C3%BCckseite_eines_geschlitzten_Stickers.jpg","w":4000,"h":3000,"color":"#b6929c","license":"CC0","author":"viviwords","subject":"two hands with dark nails peeling the backing off a white sticker on a pale ground","tags":["sticker","peeling","hands","backing","label","diy","packaging","print","merch","close up"],"cat":"object","tone":"light","temp":"neutral","people":"hands","q":2,"fp":[0.45,0.45]},{"id":"Energetic guitarist performs on stage during a lively music festival at night, surrounded by vibrant lights and excited fans.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/f6/Energetic_guitarist_performs_on_stage_during_a_lively_music_festival_at_night%2C_surrounded_by_vibrant_lights_and_excited_fans.jpg","page":"https://commons.wikimedia.org/wiki/File:Energetic_guitarist_performs_on_stage_during_a_lively_music_festival_at_night,_surrounded_by_vibrant_lights_and_excited_fans.jpg","w":2300,"h":1530,"color":"#42141a","license":"CC BY 2.0","author":"Shixart1985","subject":"a long-haired guitarist playing in red stage light and haze, lamps glowing behind","tags":["guitarist","guitar","stage light","gig","concert","red","haze","live music","band","night"],"cat":"event","tone":"dark","temp":"warm","people":"figure","q":2,"fp":[0.45,0.55]},{"id":"Lights (2011-04-24 by Ian T. McFarland).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/d/d1/Lights_%282011-04-24_by_Ian_T._McFarland%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Lights_(2011-04-24_by_Ian_T._McFarland).jpg","w":3198,"h":2555,"color":"#b52706","license":"CC BY-SA 2.0","author":"Ian T. McFarland from Los Angeles, USA","subject":"two guitarists silhouetted on a small stage flooded with red light and smoke","tags":["band","stage","red light","gig","small venue","guitarists","silhouette","smoke","live music","night"],"cat":"event","tone":"dark","temp":"warm","people":"figure","q":3,"fp":[0.55,0.55]},{"id":"Kintsugi on broken Kyūsu lid-bottom oblique PNr°1260.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/6/68/Kintsugi_on_broken_Ky%C5%ABsu_lid-bottom_oblique_PNr%C2%B01260.jpg","page":"https://commons.wikimedia.org/wiki/File:Kintsugi_on_broken_Ky%C5%ABsu_lid-bottom_oblique_PNr%C2%B01260.jpg","w":6472,"h":4373,"color":"#96897d","license":"CC BY-SA 4.0","author":"D-Kuru","subject":"a stoneware lid mended with gold kintsugi seams, seen at an angle on white","tags":["kintsugi","repair","ceramics","gold","pottery","mending","craft","japanese","studio","product"],"cat":"craft","tone":"light","temp":"warm","people":"none","q":2},{"id":"ZAPATA II a 50' Classic Yacht built by CALKINS - AMERICAN MARINE and delivered in 1964 in the 2013 Ahmanson Cup Regatta photo Don Ramey Logan.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/79/ZAPATA_II_a_50%27_Classic_Yacht_built_by_CALKINS_-_AMERICAN_MARINE_and_delivered_in_1964_in_the_2013_Ahmanson_Cup_Regatta_photo_Don_Ramey_Logan.jpg","page":"https://commons.wikimedia.org/wiki/File:ZAPATA_II_a_50%27_Classic_Yacht_built_by_CALKINS_-_AMERICAN_MARINE_and_delivered_in_1964_in_the_2013_Ahmanson_Cup_Regatta_photo_Don_Ramey_Logan.jpg","w":2736,"h":4500,"color":"#a3afc7","license":"CC BY-SA 3.0","author":"Don Ramey Logan","subject":"a classic sailing yacht heeling under a full white sail on a blue sea","tags":["yacht","sailing","sail","sea","boat","regatta","ocean","coast","marine","summer"],"cat":"sport","tone":"light","temp":"cool","people":"none","q":2},{"id":"San Francisco Bay Bridge Western Span at night.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/d/d7/San_Francisco_Bay_Bridge_Western_Span_at_night.jpg","page":"https://commons.wikimedia.org/wiki/File:San_Francisco_Bay_Bridge_Western_Span_at_night.jpg","w":6999,"h":3937,"color":"#3d4e63","license":"CC BY-SA 4.0","author":"Dllu","subject":"a long suspension bridge lit at night with its reflection on still water","tags":["bridge","night","river","bay","lights","city","reflection","infrastructure","water","long exposure"],"cat":"city","tone":"dark","temp":"cool","people":"none","q":2,"fp":[0.6,0.4]},{"id":"Dülmen, Alte Brennerei Löhning -- 2015 -- 8677-81.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/9a/D%C3%BClmen%2C_Alte_Brennerei_L%C3%B6hning_--_2015_--_8677-81.jpg","page":"https://commons.wikimedia.org/wiki/File:D%C3%BClmen,_Alte_Brennerei_L%C3%B6hning_--_2015_--_8677-81.jpg","w":5139,"h":3431,"color":"#6a6445","license":"CC BY-SA 4.0","author":"Dietmar Rabich","subject":"a row of green glass bottles on a brick windowsill in soft daylight","tags":["bottles","glass","green","window","still life","perfumery","apothecary","studio","interior","windowsill"],"cat":"object","tone":"mid","temp":"warm","people":"none","q":2,"fp":[0.4,0.5]},{"id":"Photographic printing BW 645.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/0/0c/Photographic_printing_BW_645.jpg","page":"https://commons.wikimedia.org/wiki/File:Photographic_printing_BW_645.jpg","w":4032,"h":3024,"color":"#949088","license":"CC BY-SA 4.0","author":"ArildV","subject":"a black and white print lying in a white developer tray with tongs","tags":["darkroom","photography","print","developer tray","film","analog","lab","black and white","studio","photo"],"cat":"craft","tone":"light","temp":"neutral","people":"none","q":2},{"id":"ISR-2016-Makhtesh Ramon-Cracked earth 02.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/77/ISR-2016-Makhtesh_Ramon-Cracked_earth_02.jpg","page":"https://commons.wikimedia.org/wiki/File:ISR-2016-Makhtesh_Ramon-Cracked_earth_02.jpg","w":4379,"h":3000,"color":"#b18d76","license":"CC BY-SA 4.0","author":"Godot13","subject":"deep cracked mud plates of a dried riverbed in warm light, close up","tags":["cracked earth","drought","mud","dry riverbed","texture","ground","clay","desert","climate","soil"],"cat":"texture","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Yesa - Embalse - Sequía 01.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/91/Yesa_-_Embalse_-_Sequ%C3%ADa_01.jpg","page":"https://commons.wikimedia.org/wiki/File:Yesa_-_Embalse_-_Sequ%C3%ADa_01.jpg","w":4592,"h":3448,"color":"#a9a7a6","license":"CC BY-SA 4.0","author":"Basotxerri","subject":"a dried lakebed of cracked white mud running to distant water","tags":["dry lake","drought","cracked earth","riverbed","low water","landscape","climate","reservoir","shore"],"cat":"landscape","tone":"light","temp":"cool","people":"none","q":2,"fp":[0.5,0.6]},{"id":"Bristol MMB «D8 River Trym.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/f2/Bristol_MMB_%C2%ABD8_River_Trym.jpg","page":"https://commons.wikimedia.org/wiki/File:Bristol_MMB_%C2%ABD8_River_Trym.jpg","w":2344,"h":3660,"color":"#828384","license":"CC BY-SA 3.0","author":"mattbuck (category)","subject":"a small sailing boat sitting on a mud bank in a tidal river at low water","tags":["boat","mud","low tide","estuary","river","sailing boat","aground","harbour","almanac","tide"],"cat":"landscape","tone":"mid","temp":"neutral","people":"none","q":2,"fp":[0.5,0.75]},{"id":"Dülmen, Privatrösterei Schröer, Kaffeebohnen -- 2018 -- 0547.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/6/66/D%C3%BClmen%2C_Privatr%C3%B6sterei_Schr%C3%B6er%2C_Kaffeebohnen_--_2018_--_0547.jpg","page":"https://commons.wikimedia.org/wiki/File:D%C3%BClmen,_Privatr%C3%B6sterei_Schr%C3%B6er,_Kaffeebohnen_--_2018_--_0547.jpg","w":6720,"h":4480,"color":"#955632","license":"CC BY-SA 4.0","author":"Dietmar Rabich","subject":"a full frame of medium roast coffee beans, close up","tags":["coffee","beans","roasted","roastery","cafe","texture","brown","close up","espresso","food"],"cat":"drink","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Dülmen, Privatrösterei Schröer -- 2018 -- 0553.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/0/0e/D%C3%BClmen%2C_Privatr%C3%B6sterei_Schr%C3%B6er_--_2018_--_0553.jpg","page":"https://commons.wikimedia.org/wiki/File:D%C3%BClmen,_Privatr%C3%B6sterei_Schr%C3%B6er_--_2018_--_0553.jpg","w":6720,"h":4480,"color":"#856137","license":"CC BY-SA 4.0","author":"Dietmar Rabich","subject":"rows of brass scoop bins of coffee beans in a roastery shop wall","tags":["coffee","roastery","brass","bins","shop","beans","retail","cafe","interior","vintage"],"cat":"interior","tone":"mid","temp":"warm","people":"none","q":2,"fp":[0.45,0.5]},{"id":"Wooden chairs in workshop awaiting restoration and repair in a rustic setting.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/a/ab/Wooden_chairs_in_workshop_awaiting_restoration_and_repair_in_a_rustic_setting.jpg","page":"https://commons.wikimedia.org/wiki/File:Wooden_chairs_in_workshop_awaiting_restoration_and_repair_in_a_rustic_setting.jpg","w":4016,"h":6016,"color":"#776a57","license":"CC BY 2.0","author":"Shixart1985","subject":"wooden chairs mid restoration stacked on benches in a furniture workshop","tags":["chair repair","furniture restoration","workshop","chairs","woodwork","repair","craft","mending","joinery","studio"],"cat":"craft","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Biidermeiertooli restaureerimine. 2005. aasta.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/b1/Biidermeiertooli_restaureerimine._2005._aasta.jpg","page":"https://commons.wikimedia.org/wiki/File:Biidermeiertooli_restaureerimine._2005._aasta.jpg","w":1536,"h":2048,"color":"#8d6a68","license":"CC BY-SA 4.0","author":"Sillerkiil","subject":"a wooden chair held together by orange bar clamps while the glue sets","tags":["chair repair","clamps","furniture restoration","workshop","glue","woodwork","mending","repair","joinery","craft"],"cat":"craft","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Coffee roasting machine, The Roastery, Coaltown Coffee, Ammanford, Wales.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/2d/Coffee_roasting_machine%2C_The_Roastery%2C_Coaltown_Coffee%2C_Ammanford%2C_Wales.jpg","page":"https://commons.wikimedia.org/wiki/File:Coffee_roasting_machine,_The_Roastery,_Coaltown_Coffee,_Ammanford,_Wales.jpg","w":3024,"h":4032,"color":"#68625c","license":"CC BY-SA 4.0","author":"Vouliagmeni","subject":"a drum coffee roaster with a copper cooling tray in an industrial roastery","tags":["coffee roaster","roastery","machine","cooling tray","copper","coffee","industrial","cafe","production","specialty"],"cat":"work","tone":"mid","temp":"neutral","people":"none","q":2},{"id":"Cooling time for coffee.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/3/3b/Cooling_time_for_coffee.jpg","page":"https://commons.wikimedia.org/wiki/File:Cooling_time_for_coffee.jpg","w":5699,"h":4000,"color":"#885334","license":"CC BY-SA 4.0","author":"Jameswasswa","subject":"roasted coffee beans swept round a steel cooling tray by its paddle arm","tags":["coffee","roasting","cooling tray","beans","roastery","steel","machine","specialty","cafe","production"],"cat":"drink","tone":"mid","temp":"warm","people":"none","q":3},{"id":"Green Coffee Beans (4075921494).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/1/10/Green_Coffee_Beans_%284075921494%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Green_Coffee_Beans_(4075921494).jpg","w":3648,"h":2736,"color":"#8d887f","license":"CC BY-SA 2.0","author":"Michael Allen Smith","subject":"pale green unroasted coffee beans filling the frame, close up","tags":["green coffee","coffee beans","raw","unroasted","texture","roastery","import","trade","specialty","close up"],"cat":"drink","tone":"light","temp":"neutral","people":"none","q":2},{"id":"Green Bean Coffee.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/c/c5/Green_Bean_Coffee.jpg","page":"https://commons.wikimedia.org/wiki/File:Green_Bean_Coffee.jpg","w":3456,"h":2298,"color":"#a69683","license":"CC BY-SA 2.0","author":"DeaPeaJay","subject":"a burlap sack spilling green coffee beans across a pale wooden table","tags":["green coffee","burlap","sack","coffee beans","roastery","import","trade","jute","specialty","origin"],"cat":"drink","tone":"light","temp":"warm","people":"none","q":2,"fp":[0.55,0.6]},{"id":"When and If yacht, stern view.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/5/52/When_and_If_yacht%2C_stern_view.jpg","page":"https://commons.wikimedia.org/wiki/File:When_and_If_yacht,_stern_view.jpg","w":3024,"h":4032,"color":"#517cb0","license":"CC BY-SA 4.0","author":"Luciano Ramalho","subject":"a wooden sailing boat with a tall mast seen from astern under a deep blue sky","tags":["yacht","sailing","stern","boat","sea","mast","classic boat","ocean","summer","almanac"],"cat":"sport","tone":"mid","temp":"cool","people":"none","q":2,"fp":[0.5,0.6]},{"id":"Swimmer at Leigh-on-Sea - geograph.org.uk - 6672247.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/d/db/Swimmer_at_Leigh-on-Sea_-_geograph.org.uk_-_6672247.jpg","page":"https://commons.wikimedia.org/wiki/File:Swimmer_at_Leigh-on-Sea_-_geograph.org.uk_-_6672247.jpg","w":3360,"h":2240,"color":"#888888","license":"CC BY-SA 2.0","author":"Christine Matthews","subject":"a swimmer in a wetsuit and blue cap wading out into a grey sea, from behind","tags":["sea swimming","open water","swimmer","wetsuit","cold water","sea","figure","training","coast","wild swimming"],"cat":"sport","tone":"mid","temp":"cool","people":"figure","q":2,"fp":[0.4,0.45]},{"id":"Brighton, Sea Swimmer (31766505456).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/a/aa/Brighton%2C_Sea_Swimmer_%2831766505456%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Brighton,_Sea_Swimmer_(31766505456).jpg","w":4000,"h":6000,"color":"#b7b3ad","license":"CC BY 2.0","author":"Martin Pettitt from Bury St Edmunds, UK","subject":"a lone bather standing at the edge of a calm pale sea on a pebble beach","tags":["sea swimming","bather","beach","shore","sea","figure","solitude","coast","pebbles","summer"],"cat":"landscape","tone":"light","temp":"cool","people":"figure","q":2,"fp":[0.5,0.65]},{"id":"Shipwreck Point Reyes, Inverness.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/ea/Shipwreck_Point_Reyes%2C_Inverness.jpg","page":"https://commons.wikimedia.org/wiki/File:Shipwreck_Point_Reyes,_Inverness.jpg","w":6720,"h":4480,"color":"#808587","license":"CC BY-SA 4.0","author":"Frank Schulenburg","subject":"an old wooden fishing boat lying wrecked on a mud bank beside a bay","tags":["boat","wreck","mud bank","shore","bay","abandoned","fishing boat","low water","coast","weathered"],"cat":"landscape","tone":"light","temp":"warm","people":"none","q":2,"fp":[0.55,0.55]},{"id":"Langweerderwielen (Langwarder Wielen) in de mist. 01-04-2026. (d.j.b.) 08.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/74/Langweerderwielen_%28Langwarder_Wielen%29_in_de_mist._01-04-2026._%28d.j.b.%29_08.jpg","page":"https://commons.wikimedia.org/wiki/File:Langweerderwielen_(Langwarder_Wielen)_in_de_mist._01-04-2026._(d.j.b.)_08.jpg","w":4229,"h":3172,"color":"#c8c4b9","license":"CC BY-SA 4.0","author":"Dominicus Johannes Bergsma","subject":"a clump of golden reeds reflected in still pale water under a misty sky","tags":["reeds","water","lake","mist","minimal","calm","reflection","wetland","river","quiet"],"cat":"nature","tone":"light","temp":"neutral","people":"none","q":3,"fp":[0.3,0.5]},{"id":"Appartment building from Banner Street 2024-01-11.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/5/53/Appartment_building_from_Banner_Street_2024-01-11.jpg","page":"https://commons.wikimedia.org/wiki/File:Appartment_building_from_Banner_Street_2024-01-11.jpg","w":7952,"h":5304,"color":"#211d19","license":"CC BY-SA 2.0","author":"Tom Page","subject":"a brick housing block at night with lit blue doors reflected in a puddle","tags":["night","apartment","housing","doorway","lit windows","city","puddle","reflection","urban","estate"],"cat":"city","tone":"dark","temp":"cool","people":"none","q":2,"fp":[0.5,0.45]},{"id":"Rosemary Oil in a bottle and rosemary herb.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/b8/Rosemary_Oil_in_a_bottle_and_rosemary_herb.jpg","page":"https://commons.wikimedia.org/wiki/File:Rosemary_Oil_in_a_bottle_and_rosemary_herb.jpg","w":4000,"h":2667,"color":"#dacdb5","license":"CC BY 2.0","author":"formulatehealth","subject":"an unlabelled amber dropper bottle among rosemary sprigs on a wooden table","tags":["bottle","amber glass","dropper","essential oil","perfume","apothecary","herbs","unlabelled","skincare","botanical"],"cat":"object","tone":"light","temp":"warm","people":"none","q":2},{"id":"Taking rosemary oil from a bottle.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/6/6c/Taking_rosemary_oil_from_a_bottle.jpg","page":"https://commons.wikimedia.org/wiki/File:Taking_rosemary_oil_from_a_bottle.jpg","w":4000,"h":2667,"color":"#8d7760","license":"CC BY 2.0","author":"formulatehealth","subject":"a hand drawing oil into a glass dropper over an amber bottle and rosemary","tags":["dropper","essential oil","amber bottle","hand","perfumer","apothecary","herbal","skincare","botanical","atelier"],"cat":"object","tone":"mid","temp":"warm","people":"hands","q":2,"fp":[0.4,0.45]},{"id":"Eucalypt oils 1.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/a/a4/Eucalypt_oils_1.jpg","page":"https://commons.wikimedia.org/wiki/File:Eucalypt_oils_1.jpg","w":4096,"h":3072,"color":"#7c6b5a","license":"CC0","author":"Mx. Granger","subject":"tall glass cylinders of amber and gold liquids standing in rows on white","tags":["glass","amber liquid","cylinders","perfumery","laboratory","rows","whisky","colour","samples","atelier"],"cat":"object","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Drying the cotton silk fabric.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/d/d0/Drying_the_cotton_silk_fabric.jpg","page":"https://commons.wikimedia.org/wiki/File:Drying_the_cotton_silk_fabric.jpg","w":3600,"h":2400,"color":"#533d2b","license":"CC BY-SA 4.0","author":"Sopyaylynn","subject":"a woman in a straw hat hanging rows of jewel-coloured dyed yarn to dry, from above","tags":["dyed yarn","silk","textile","dyeing","colour","drying","craft","artisan","fabric","figure"],"cat":"craft","tone":"mid","temp":"warm","people":"figure","q":3,"fp":[0.7,0.5]},{"id":"Indian-dupioni-silk-fabrics.JPG","file":"https://upload.wikimedia.org/wikipedia/commons/6/61/Indian-dupioni-silk-fabrics.JPG","page":"https://commons.wikimedia.org/wiki/File:Indian-dupioni-silk-fabrics.JPG","w":2592,"h":1936,"color":"#803249","license":"CC BY 3.0","author":"Smriti tripathi","subject":"stacked bolts of raw silk in jewel colours: violet, red, orange, blue and green","tags":["silk","fabric bolts","textile","jewel tones","colour","dressmaking","cloth","fashion","boutique","saffron"],"cat":"texture","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Embroidery by Hand Sample with Design From Instagram Influencer.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/fd/Embroidery_by_Hand_Sample_with_Design_From_Instagram_Influencer.jpg","page":"https://commons.wikimedia.org/wiki/File:Embroidery_by_Hand_Sample_with_Design_From_Instagram_Influencer.jpg","w":3024,"h":4032,"color":"#856a5e","license":"CC BY-SA 4.0","author":"Rbreidbrown","subject":"a hand holding a wooden hoop of crewel embroidery with red and green flowers","tags":["embroidery","hoop","hand","needlework","flowers","thread","craft","textile","sewing","folk"],"cat":"craft","tone":"mid","temp":"warm","people":"hands","q":2,"fp":[0.5,0.45]},{"id":"Worsted rug yarn on cones.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/c/c6/Worsted_rug_yarn_on_cones.jpg","page":"https://commons.wikimedia.org/wiki/File:Worsted_rug_yarn_on_cones.jpg","w":4032,"h":3024,"color":"#6f6a5c","license":"CC BY-SA 4.0","author":"Emilymaayy","subject":"cones of yarn in soft pinks, blues, ochre and black on a green cloth","tags":["yarn","cones","wool","weaving","knitting","colour","textile","studio","thread","mill"],"cat":"craft","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Yarn 2015-365-24 (16172648689).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/a/ac/Yarn_2015-365-24_%2816172648689%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Yarn_2015-365-24_(16172648689).jpg","w":1774,"h":1774,"color":"#82665f","license":"CC BY-SA 2.0","author":"Sally Wilson","subject":"curtains of red and white warp threads hanging above rows of yarn cones","tags":["yarn","cones","warp","threads","weaving","textile","mill","loom","colour","studio"],"cat":"craft","tone":"mid","temp":"warm","people":"none","q":2,"fp":[0.5,0.4]},{"id":"Hands and threads.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/4b/Hands_and_threads.jpg","page":"https://commons.wikimedia.org/wiki/File:Hands_and_threads.jpg","w":5184,"h":3456,"color":"#7a3f33","license":"CC BY-SA 4.0","author":"Alberto Buscató Vázquez","subject":"weathered hands drawing taut red threads across the fingers at a loom","tags":["hands","weaving","loom","red thread","warp","textile","craft","artisan","backstrap","handmade"],"cat":"craft","tone":"mid","temp":"warm","people":"hands","q":3,"fp":[0.6,0.5]},{"id":"Cloth-roll.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/6/62/Cloth-roll.jpg","page":"https://commons.wikimedia.org/wiki/File:Cloth-roll.jpg","w":4032,"h":3024,"color":"#99888a","license":"CC BY-SA 4.0","author":"Samanthafara","subject":"rolls of handwoven striped and checked cotton stacked side by side, close up","tags":["cloth","fabric roll","handwoven","stripes","check","textile","cotton","weaving","shop","colour"],"cat":"texture","tone":"mid","temp":"cool","people":"none","q":2,"fp":[0.45,0.55]},{"id":"Marble blocks pattern texture.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/9e/Marble_blocks_pattern_texture.jpg","page":"https://commons.wikimedia.org/wiki/File:Marble_blocks_pattern_texture.jpg","w":3488,"h":2616,"color":"#b9b9af","license":"Public domain","author":"Titus Tscharntke","subject":"a polished pale marble slab with faint ochre veins, filling the frame","tags":["marble","stone","texture","veins","surface","interiors","material","kitchen","bathroom","samples"],"cat":"texture","tone":"light","temp":"neutral","people":"none","q":2},{"id":"Marble Top.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/8/8e/Marble_Top.jpg","page":"https://commons.wikimedia.org/wiki/File:Marble_Top.jpg","w":3120,"h":4160,"color":"#bdb9b0","license":"CC0","author":"Ambadyanands","subject":"white marble with soft grey and gold veining running diagonally, portrait","tags":["marble","stone","veining","texture","white","material","interiors","luxury","surface","samples"],"cat":"texture","tone":"light","temp":"neutral","people":"none","q":2},{"id":"Marble Kymi Euboea Greece.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/ee/Marble_Kymi_Euboea_Greece.jpg","page":"https://commons.wikimedia.org/wiki/File:Marble_Kymi_Euboea_Greece.jpg","w":6000,"h":4000,"color":"#ccc8c5","license":"CC0","author":"Jebulon","subject":"a rough split face of pale grey and white stone with layered texture","tags":["limestone","marble","stone","texture","rock","material","surface","quarry","natural","samples"],"cat":"texture","tone":"light","temp":"cool","people":"none","q":2},{"id":"Polygonal sandstone and limestone wall.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/d/dd/Polygonal_sandstone_and_limestone_wall.jpg","page":"https://commons.wikimedia.org/wiki/File:Polygonal_sandstone_and_limestone_wall.jpg","w":12000,"h":8000,"color":"#bba38e","license":"CC0","author":"Joselodos","subject":"a dry laid wall of pale limestone blocks filling the frame in flat light","tags":["limestone","stone wall","masonry","texture","dry stone","building","material","mediterranean","pattern","architecture"],"cat":"texture","tone":"light","temp":"warm","people":"none","q":2},{"id":"Roof hafez tomb.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/6/60/Roof_hafez_tomb.jpg","page":"https://commons.wikimedia.org/wiki/File:Roof_hafez_tomb.jpg","w":3648,"h":2736,"color":"#878f86","license":"CC BY 3.0","author":"Pentocelo","subject":"a ceiling of blue and gold zellige tiles radiating in a geometric star","tags":["zellige","glazed tiles","tilework","pattern","moroccan","ceiling","geometric","ceramics","blue","architecture"],"cat":"texture","tone":"mid","temp":"cool","people":"none","q":2},{"id":"Zellige loose tile shapes.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/2b/Zellige_loose_tile_shapes.jpg","page":"https://commons.wikimedia.org/wiki/File:Zellige_loose_tile_shapes.jpg","w":3872,"h":2592,"color":"#86786d","license":"CC BY-SA 4.0","author":"Jadcooper","subject":"a heap of cut terracotta and glazed zellige tile offcuts in a workshop","tags":["zellige","tiles","offcuts","ceramics","terracotta","glazed","workshop","moroccan","material","samples"],"cat":"craft","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Julianasluis - (2026-09-21) - 2.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/2c/Julianasluis_-_%282026-09-21%29_-_2.jpg","page":"https://commons.wikimedia.org/wiki/File:Julianasluis_-_(2026-09-21)_-_2.jpg","w":4000,"h":2250,"color":"#5d6352","license":"CC0","author":"Wvdp","subject":"a skatepark set among trees and a canal, seen straight down from above","tags":["skatepark","aerial","concrete","canal","park","skateboarding","town","drone","urban","plaza"],"cat":"city","tone":"mid","temp":"cool","people":"none","q":2},{"id":"Part of ramp at Brastad SK8, the new skatepark in Lysekil Municipality.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/d/d3/Part_of_ramp_at_Brastad_SK8%2C_the_new_skatepark_in_Lysekil_Municipality.jpg","page":"https://commons.wikimedia.org/wiki/File:Part_of_ramp_at_Brastad_SK8,_the_new_skatepark_in_Lysekil_Municipality.jpg","w":4925,"h":3010,"color":"#acb5b5","license":"CC BY-SA 4.0","author":"W.carter","subject":"a smooth concrete skate ramp casting a sharp diagonal shadow, close in","tags":["concrete","skatepark","ramp","shadow","abstract","coping","skateboarding","minimal","surface","curve"],"cat":"abstract","tone":"light","temp":"cool","people":"none","q":3,"fp":[0.45,0.5]},{"id":"A bunch of rebar up close.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/5/59/A_bunch_of_rebar_up_close.jpg","page":"https://commons.wikimedia.org/wiki/File:A_bunch_of_rebar_up_close.jpg","w":3171,"h":1953,"color":"#564940","license":"CC BY-SA 4.0","author":"W.carter","subject":"a tight bundle of ribbed steel rebar with rusted ends in warm light","tags":["rebar","steel","construction","reinforcement","texture","building site","rust","concrete","industrial","material"],"cat":"texture","tone":"mid","temp":"warm","people":"none","q":2},{"id":"In-situ concrete pouring.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/6/64/In-situ_concrete_pouring.jpg","page":"https://commons.wikimedia.org/wiki/File:In-situ_concrete_pouring.jpg","w":3000,"h":4000,"color":"#84888d","license":"CC BY-SA 4.0","author":"Bernardobenzecry","subject":"a concrete pump boom silhouetted against a low sun and broken clouds","tags":["concrete pour","pump","boom","construction","silhouette","sunset","building site","crane","contractor","engineering"],"cat":"work","tone":"mid","temp":"cool","people":"none","q":2,"fp":[0.45,0.4]},{"id":"Fichte Dreischichtplatte 2009.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/d/db/Fichte_Dreischichtplatte_2009.jpg","page":"https://commons.wikimedia.org/wiki/File:Fichte_Dreischichtplatte_2009.jpg","w":3000,"h":1737,"color":"#655d52","license":"CC BY-SA 3.0","author":"Elke Wetzig (elya)","subject":"a cut sample of cross laminated timber showing its layers on black","tags":["clt","cross laminated timber","engineered wood","timber","sample","material","layers","construction","product","architecture"],"cat":"object","tone":"dark","temp":"warm","people":"none","q":2},{"id":"Brettsperrholzkonstruktion.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/9f/Brettsperrholzkonstruktion.jpg","page":"https://commons.wikimedia.org/wiki/File:Brettsperrholzkonstruktion.jpg","w":3597,"h":2697,"color":"#a26b35","license":"CC0","author":"RoterRolf","subject":"a bright interior of bare cross laminated timber walls with small high windows","tags":["clt","cross laminated timber","timber interior","wood","architecture","engineered wood","construction","walls","daylight","housing"],"cat":"interior","tone":"light","temp":"warm","people":"none","q":2,"fp":[0.6,0.45]},{"id":"Saxon style timber roof structure inside St Aidan's Church in Bamburgh.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/75/Saxon_style_timber_roof_structure_inside_St_Aidan%27s_Church_in_Bamburgh.jpg","page":"https://commons.wikimedia.org/wiki/File:Saxon_style_timber_roof_structure_inside_St_Aidan%27s_Church_in_Bamburgh.jpg","w":2056,"h":3088,"color":"#c26d33","license":"CC BY-SA 4.0","author":"Stephencdickson","subject":"a warm lit timber roof of rafters and braces seen from directly below","tags":["timber roof","rafters","roof structure","beams","wood","interior","carpentry","architecture","ceiling","warm"],"cat":"architecture","tone":"mid","temp":"warm","people":"none","q":2,"fp":[0.5,0.4]},{"id":"Closeup of blackthorn aka sloe aka prunus spinosa sweden 20050924.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/7f/Closeup_of_blackthorn_aka_sloe_aka_prunus_spinosa_sweden_20050924.jpg","page":"https://commons.wikimedia.org/wiki/File:Closeup_of_blackthorn_aka_sloe_aka_prunus_spinosa_sweden_20050924.jpg","w":2592,"h":1944,"color":"#657e5a","license":"CC BY-SA 3.0","author":"Martin Olsson","subject":"dusty blue sloe berries clustered on a blackthorn twig among green leaves","tags":["sloes","blackthorn","berries","hedgerow","foraging","autumn","sloe gin","wild fruit","countryside","botanical"],"cat":"nature","tone":"mid","temp":"cool","people":"none","q":2},{"id":"Sambucus nigra 2004 c.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/b6/Sambucus_nigra_2004_c.jpg","page":"https://commons.wikimedia.org/wiki/File:Sambucus_nigra_2004_c.jpg","w":1601,"h":1067,"color":"#717c6b","license":"CC BY-SA 1.0","author":"JeLuF","subject":"flat creamy elderflower heads against a blue summer sky","tags":["elderflower","elder","hedgerow","flowers","foraging","cordial","summer","botanical","wild","countryside"],"cat":"nature","tone":"light","temp":"cool","people":"none","q":2,"fp":[0.6,0.4]},{"id":"Elderflower cordial in bottles.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/a/ad/Elderflower_cordial_in_bottles.jpg","page":"https://commons.wikimedia.org/wiki/File:Elderflower_cordial_in_bottles.jpg","w":2700,"h":2048,"color":"#805807","license":"CC BY-SA 2.0","author":"Jim Champion from Southampton, UK","subject":"five swing-top bottles of golden homemade cordial in a row","tags":["cordial","bottles","elderflower","homemade","swing top","drinks","hedgerow","preserves","golden","kitchen"],"cat":"drink","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Gorse at Howth Head cliffs.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/3/33/Gorse_at_Howth_Head_cliffs.jpg","page":"https://commons.wikimedia.org/wiki/File:Gorse_at_Howth_Head_cliffs.jpg","w":4032,"h":3024,"color":"#6c6f65","license":"CC BY-SA 4.0","author":"Jonathan","subject":"yellow gorse in full flower on a clifftop above a calm grey sea","tags":["gorse","cliff","coast","sea","heath","yellow flowers","spring","headland","landscape","wild"],"cat":"landscape","tone":"mid","temp":"cool","people":"none","q":2,"fp":[0.6,0.7]},{"id":"Rosa canina focus stacked-20220522-RM-123334.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/5/58/Rosa_canina_focus_stacked-20220522-RM-123334.jpg","page":"https://commons.wikimedia.org/wiki/File:Rosa_canina_focus_stacked-20220522-RM-123334.jpg","w":5182,"h":3886,"color":"#4e4b39","license":"CC BY-SA 4.0","author":"Ermell","subject":"a single pale pink dog rose with gold stamens against a dark green ground","tags":["dog rose","wild rose","flower","hedgerow","pink","summer","botanical","countryside","petals","wild"],"cat":"nature","tone":"dark","temp":"warm","people":"none","q":3},{"id":"Scot's Church Doorway by Night, Melbourne Australia (4562382457).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/8/88/Scot%27s_Church_Doorway_by_Night%2C_Melbourne_Australia_%284562382457%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Scot%27s_Church_Doorway_by_Night,_Melbourne_Australia_(4562382457).jpg","w":1200,"h":1800,"color":"#3f362e","license":"CC BY-SA 2.0","author":"Rexness","subject":"a gothic stone doorway lit by a single lamp on a dark night street","tags":["doorway","night","lamp","lit entrance","stone","gothic","dark","street","arch","evening"],"cat":"architecture","tone":"dark","temp":"warm","people":"none","q":2,"fp":[0.5,0.45]},{"id":"Cherves-Richemont 16 Poirier 2014.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/c/c7/Cherves-Richemont_16_Poirier_2014.jpg","page":"https://commons.wikimedia.org/wiki/File:Cherves-Richemont_16_Poirier_2014.jpg","w":3264,"h":4328,"color":"#838c7c","license":"CC BY-SA 3.0","author":"JLPC","subject":"a lone old pear tree in full summer leaf in a meadow under a cloudy sky","tags":["pear tree","orchard","meadow","summer","perry","countryside","tree","farm","cider","landscape"],"cat":"landscape","tone":"light","temp":"cool","people":"none","q":2,"fp":[0.5,0.45]},{"id":"Pyrus pyrifolia fruit on tree PS 2z LR.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/49/Pyrus_pyrifolia_fruit_on_tree_PS_2z_LR.jpg","page":"https://commons.wikimedia.org/wiki/File:Pyrus_pyrifolia_fruit_on_tree_PS_2z_LR.jpg","w":4080,"h":3480,"color":"#726222","license":"CC BY-SA 4.0","author":"PumpkinSky","subject":"a cluster of ripe russet pears hanging among glossy leaves on the tree","tags":["pears","fruit","tree","orchard","harvest","perry","summer","leaves","farm","fruit growing"],"cat":"food","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Pear DS.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/5/5d/Pear_DS.jpg","page":"https://commons.wikimedia.org/wiki/File:Pear_DS.jpg","w":3750,"h":2500,"color":"#dedfc9","license":"CC BY-SA 3.0","author":"Augustus Binu : flickr","subject":"a speckled green pear beside its cut half on a white ground","tags":["pear","fruit","cut","halved","still life","product","perry","food","green","orchard"],"cat":"food","tone":"light","temp":"neutral","people":"none","q":2},{"id":"Apple Malus domestica Zoete Peppel. (actm).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/78/Apple_Malus_domestica_Zoete_Peppel._%28actm%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Apple_Malus_domestica_Zoete_Peppel._(actm).jpg","w":3456,"h":5184,"color":"#735428","license":"CC BY-SA 4.0","author":"Agnes Monkelbaan","subject":"a single red and gold apple hanging on the bough among yellowing autumn leaves","tags":["apple","tree","orchard","autumn","harvest","cider","fruit","bough","garden","farm"],"cat":"food","tone":"mid","temp":"warm","people":"none","q":2,"fp":[0.45,0.4]},{"id":"Apple picker Grythengen Toten Norway.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/3/3d/Apple_picker_Grythengen_Toten_Norway.jpg","page":"https://commons.wikimedia.org/wiki/File:Apple_picker_Grythengen_Toten_Norway.jpg","w":4864,"h":3647,"color":"#646e43","license":"CC BY-SA 4.0","author":"Øyvind Holmstad","subject":"a grey haired figure reaching into an apple tree in an old orchard, from behind","tags":["apple picking","orchard","harvest","tree","figure","autumn","garden","fruit","cider","countryside"],"cat":"nature","tone":"mid","temp":"warm","people":"figure","q":2,"fp":[0.75,0.55]},{"id":"Crates of peaches in the orchard, Delta County, Colo. LCCN2017877605.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/49/Crates_of_peaches_in_the_orchard%2C_Delta_County%2C_Colo._LCCN2017877605.jpg","page":"https://commons.wikimedia.org/wiki/File:Crates_of_peaches_in_the_orchard,_Delta_County,_Colo._LCCN2017877605.jpg","w":5467,"h":3849,"color":"#5d4e3c","license":"Public domain","author":"Lee, Russell, 1903-1986, photographer","subject":"wooden crates filled with ripe peaches stacked in rows in an orchard shed","tags":["peaches","crates","harvest","fruit","orchard","market","farm","produce","stone fruit","summer"],"cat":"food","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Alaska wild berries.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/45/Alaska_wild_berries.jpg","page":"https://commons.wikimedia.org/wiki/File:Alaska_wild_berries.jpg","w":2401,"h":1563,"color":"#6c4b55","license":"Public domain","author":"U.S. Fish and Wildlife Service","subject":"a full frame of wild blueberries and red cloudberries mixed together","tags":["berries","blueberries","wild berries","fruit","foraging","summer","texture","fresh","colour","produce"],"cat":"food","tone":"mid","temp":"cool","people":"none","q":2},{"id":"Kothapet Fruit Market.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/b1/Kothapet_Fruit_Market.jpg","page":"https://commons.wikimedia.org/wiki/File:Kothapet_Fruit_Market.jpg","w":3862,"h":2556,"color":"#a09464","license":"CC BY-SA 4.0","author":"Dey.sandip","subject":"a heap of green citrus fruit on straw with a worker resting beside it, from above","tags":["citrus","fruit","market","harvest","straw","aerial","produce","wholesale","figure","limes"],"cat":"food","tone":"mid","temp":"warm","people":"figure","q":2,"fp":[0.4,0.55]},{"id":"Snostskali Valley, Mountain road, Khevi, Georgia.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/5/58/Snostskali_Valley%2C_Mountain_road%2C_Khevi%2C_Georgia.jpg","page":"https://commons.wikimedia.org/wiki/File:Snostskali_Valley,_Mountain_road,_Khevi,_Georgia.jpg","w":4912,"h":3264,"color":"#808a7c","license":"CC BY 4.0","author":"Vyacheslav Argenberg","subject":"an empty road running straight into a steep green valley under big clouds","tags":["road","valley","mountains","green","running route","cycling","travel","summer","landscape","clouds"],"cat":"landscape","tone":"light","temp":"cool","people":"none","q":2,"fp":[0.5,0.6]},{"id":"Road Padum Zanskar Range Jun24 A7CR 00818.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/8/8d/Road_Padum_Zanskar_Range_Jun24_A7CR_00818.jpg","page":"https://commons.wikimedia.org/wiki/File:Road_Padum_Zanskar_Range_Jun24_A7CR_00818.jpg","w":9069,"h":6046,"color":"#808189","license":"CC BY-SA 4.0","author":"This Photo was taken by Timothy A. Gonsalves. Feel free to use my photos, but pl","subject":"a narrow road heading across a dry plain toward snow capped mountains","tags":["road","mountains","snow","valley","travel","road trip","running route","landscape","himalaya","adventure"],"cat":"landscape","tone":"mid","temp":"cool","people":"none","q":2,"fp":[0.5,0.6]},{"id":"Maestrodisciclaviereinsegnando.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/6/66/Maestrodisciclaviereinsegnando.jpg","page":"https://commons.wikimedia.org/wiki/File:Maestrodisciclaviereinsegnando.jpg","w":2018,"h":1506,"color":"#8ea6c9","license":"CC BY-SA 4.0","author":"Jilloau","subject":"a line of skiers following an instructor across a sunny slope under blue sky","tags":["ski lesson","skiers","ski instructor","slope","snow","group","winter","piste","ski school","alps"],"cat":"sport","tone":"light","temp":"cool","people":"figure","q":2,"fp":[0.45,0.55]},{"id":"Tomi Nikolov ski instructor Bansko Bulgaria.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/c/c8/Tomi_Nikolov_ski_instructor_Bansko_Bulgaria.jpg","page":"https://commons.wikimedia.org/wiki/File:Tomi_Nikolov_ski_instructor_Bansko_Bulgaria.jpg","w":4464,"h":2976,"color":"#aa9b97","license":"CC0","author":"Bansko.ski.expert","subject":"a ski instructor in a red jacket carving a turn down a groomed slope","tags":["ski instructor","skiing","carving","slope","snow","winter","piste","red jacket","ski school","alps"],"cat":"sport","tone":"light","temp":"cool","people":"figure","q":2,"fp":[0.45,0.5]},{"id":"Chairlift La Crusc 01.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/3/3f/Chairlift_La_Crusc_01.jpg","page":"https://commons.wikimedia.org/wiki/File:Chairlift_La_Crusc_01.jpg","w":5472,"h":3648,"color":"#36657d","license":"CC BY-SA 4.0","author":"Kritzolina","subject":"a single gondola cabin on its cable over a meadow at dusk under blue sky","tags":["gondola","chairlift","cable car","alpine","dusk","mountains","ski resort","lift","evening","travel"],"cat":"travel","tone":"mid","temp":"cool","people":"none","q":2,"fp":[0.35,0.6]},{"id":"Snow Covered Skis, Kosciuszko National Park.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/74/Snow_Covered_Skis%2C_Kosciuszko_National_Park.jpg","page":"https://commons.wikimedia.org/wiki/File:Snow_Covered_Skis,_Kosciuszko_National_Park.jpg","w":7360,"h":4912,"color":"#a8a8aa","license":"CC BY-SA 4.0","author":"Artefotograf","subject":"pairs of skis standing upright in deep fresh snow beneath snow laden branches","tags":["skis","fresh snow","powder","winter","ski resort","piste","snow","alpine","ski hire","ski school"],"cat":"sport","tone":"light","temp":"cool","people":"none","q":2,"fp":[0.5,0.55]},{"id":"Man turns drying chili peppers, Turkey.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/ec/Man_turns_drying_chili_peppers%2C_Turkey.jpg","page":"https://commons.wikimedia.org/wiki/File:Man_turns_drying_chili_peppers,_Turkey.jpg","w":2692,"h":1761,"color":"#a16148","license":"CC BY-SA 4.0","author":"Rotadefterim","subject":"red chillies drying in long curved rows on the ground with a worker, from above","tags":["chillies","drying","harvest","aerial","red","pattern","spice","farm","figure","hot sauce"],"cat":"food","tone":"mid","temp":"warm","people":"figure","q":3,"fp":[0.55,0.35]},{"id":"VitorJubini MercadoDaVilaRubim Vitoria ES (39182859020) (square crop).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/f8/VitorJubini_MercadoDaVilaRubim_Vitoria_ES_%2839182859020%29_%28square_crop%29.jpg","page":"https://commons.wikimedia.org/wiki/File:VitorJubini_MercadoDaVilaRubim_Vitoria_ES_(39182859020)_(square_crop).jpg","w":2777,"h":2777,"color":"#995234","license":"Public domain","author":"MTur Destinos","subject":"a mound of fresh red bird's eye chillies with a blue bowl buried in them","tags":["chillies","red","spice","hot sauce","market","fresh","pile","heat","food","produce"],"cat":"food","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Shan Hills, Myanmar, Red chili pepper plant.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/77/Shan_Hills%2C_Myanmar%2C_Red_chili_pepper_plant.jpg","page":"https://commons.wikimedia.org/wiki/File:Shan_Hills,_Myanmar,_Red_chili_pepper_plant.jpg","w":4000,"h":2248,"color":"#796127","license":"CC BY 4.0","author":"Vyacheslav Argenberg","subject":"long red and green chillies hanging ripe on the plant in sunlight","tags":["chillies","red","plant","harvest","garden","hot sauce","fresh","spice","farm","growing"],"cat":"food","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Dried chillies 2.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/0/0d/Dried_chillies_2.jpg","page":"https://commons.wikimedia.org/wiki/File:Dried_chillies_2.jpg","w":6000,"h":4000,"color":"#734d4e","license":"CC BY 2.0","author":"Richard Mortel","subject":"a deep pile of dried red chillies filling the frame, close up","tags":["dried chillies","red","spice","smoked chillies","hot sauce","market","texture","heat","food","mexican"],"cat":"food","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Blood orange slice.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/2c/Blood_orange_slice.jpg","page":"https://commons.wikimedia.org/wiki/File:Blood_orange_slice.jpg","w":3376,"h":1760,"color":"#b19580","license":"CC BY-SA 4.0","author":"Rhododendrites","subject":"a wedge of blood orange with deep red flesh lying on a pale ground","tags":["blood orange","citrus","wedge","fruit","red","winter","cocktail","hot sauce","food","still life"],"cat":"food","tone":"light","temp":"warm","people":"none","q":2},{"id":"Fermented hot sauce.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/a/a3/Fermented_hot_sauce.jpg","page":"https://commons.wikimedia.org/wiki/File:Fermented_hot_sauce.jpg","w":3456,"h":5184,"color":"#94847b","license":"CC BY-SA 2.0","author":"Veganbaking.net","subject":"an unlabelled bottle of orange hot sauce beside a dab on a white saucer","tags":["hot sauce","bottle","unlabelled","chilli sauce","condiment","saucer","product","spicy","kitchen","food"],"cat":"food","tone":"mid","temp":"warm","people":"none","q":2,"fp":[0.5,0.45]},{"id":"Two fried eggs.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/b1/Two_fried_eggs.jpg","page":"https://commons.wikimedia.org/wiki/File:Two_fried_eggs.jpg","w":2047,"h":1570,"color":"#544c3b","license":"CC BY-SA 4.0","author":"Balise42","subject":"two fried eggs with black pepper in a dark iron pan seen from above","tags":["fried eggs","breakfast","pan","pepper","brunch","cafe","eggs","cooking","cast iron","food"],"cat":"food","tone":"dark","temp":"warm","people":"none","q":2,"fp":[0.55,0.45]},{"id":"Arcade (8409657650).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/1/12/Arcade_%288409657650%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Arcade_(8409657650).jpg","w":2448,"h":2448,"color":"#423a3b","license":"CC BY 2.0","author":"Faruk Ateş from Vancouver & SF","subject":"a black arcade joystick and red and white buttons on a dark cabinet","tags":["arcade stick","joystick","buttons","arcade","gaming","retro","dark","controller","games","cabinet"],"cat":"tech","tone":"dark","temp":"neutral","people":"none","q":2,"fp":[0.35,0.5]},{"id":"Erasmusbrug Rotterdam night 2018.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/be/Erasmusbrug_Rotterdam_night_2018.jpg","page":"https://commons.wikimedia.org/wiki/File:Erasmusbrug_Rotterdam_night_2018.jpg","w":4928,"h":3264,"color":"#272b3b","license":"CC BY-SA 4.0","author":"Steven Lek","subject":"the white cable stayed bridge of Rotterdam lit at night over the river","tags":["rotterdam","bridge","night","skyline","river","city","netherlands","lights","architecture","travel"],"cat":"city","tone":"dark","temp":"cool","people":"none","q":2,"fp":[0.35,0.5]},{"id":"Germany Side-Rabbet-Plane--01.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/c/c9/Germany_Side-Rabbet-Plane--01.jpg","page":"https://commons.wikimedia.org/wiki/File:Germany_Side-Rabbet-Plane--01.jpg","w":4743,"h":3167,"color":"#c6aca3","license":"CC BY-SA 3.0","author":"CEphoto, Uwe Aranas","subject":"a pale beech wood plane with its iron and wedge, a clean still on white","tags":["hand plane","woodworking","tool","carpentry","joinery","workshop","wood","craft","product","still life"],"cat":"object","tone":"light","temp":"warm","people":"none","q":2},{"id":"Traditional Hand Plane, China.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/49/Traditional_Hand_Plane%2C_China.jpg","page":"https://commons.wikimedia.org/wiki/File:Traditional_Hand_Plane,_China.jpg","w":5119,"h":3124,"color":"#43322e","license":"CC BY-SA 2.0","author":"Rod Waddington","subject":"a worn wooden plane resting in curled shavings on an old workbench","tags":["hand plane","shavings","woodworking","workbench","carpentry","joinery","workshop","tool","craft","timber"],"cat":"craft","tone":"dark","temp":"warm","people":"none","q":2,"fp":[0.55,0.4]},{"id":"Pratt Art Center printmaking 02A.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/21/Pratt_Art_Center_printmaking_02A.jpg","page":"https://commons.wikimedia.org/wiki/File:Pratt_Art_Center_printmaking_02A.jpg","w":2592,"h":1944,"color":"#7b6c4f","license":"CC BY-SA 3.0","author":"Joe Mabel","subject":"a large daylit printmaking studio with tall factory windows and work tables","tags":["printmaking","studio","print room","workshop","windows","daylight","artists","press","tables","werkstatt"],"cat":"interior","tone":"mid","temp":"warm","people":"figure","q":2},{"id":"Various tools hanging on a pegboard in a workshop setting with natural light filtering in.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/8/87/Various_tools_hanging_on_a_pegboard_in_a_workshop_setting_with_natural_light_filtering_in.jpg","page":"https://commons.wikimedia.org/wiki/File:Various_tools_hanging_on_a_pegboard_in_a_workshop_setting_with_natural_light_filtering_in.jpg","w":6016,"h":4016,"color":"#5c5850","license":"CC BY 2.0","author":"Shixart1985","subject":"pliers, wrenches and screwdrivers hung on a perforated pegboard wall","tags":["pegboard","hand tools","pliers","wrenches","workshop","garage","tools","diy","hardware","tool hire"],"cat":"object","tone":"mid","temp":"neutral","people":"none","q":2},{"id":"Drill bits 2017 G1.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/d/d9/Drill_bits_2017_G1.jpg","page":"https://commons.wikimedia.org/wiki/File:Drill_bits_2017_G1.jpg","w":5600,"h":3500,"color":"#484949","license":"Public domain","author":"George Chernilevsky","subject":"a row of spiral masonry drill bits lying side by side, close up","tags":["drill bits","tools","steel","masonry","hardware","diy","spiral","texture","power tools","tool hire"],"cat":"object","tone":"dark","temp":"cool","people":"none","q":2},{"id":"Ladder in Gyumri.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/ea/Ladder_in_Gyumri.jpg","page":"https://commons.wikimedia.org/wiki/File:Ladder_in_Gyumri.jpg","w":2136,"h":3222,"color":"#9f9891","license":"CC BY-SA 4.0","author":"Araqangaraq","subject":"an aluminium ladder leaning on a pale wall with a long diagonal shadow","tags":["ladder","aluminium","wall","shadow","diy","tool hire","decorating","building","hardware","maintenance"],"cat":"object","tone":"light","temp":"cool","people":"none","q":2,"fp":[0.5,0.4]},{"id":"Zagedan Ridge, Camping tent, Caucasus Mountains.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/5/5c/Zagedan_Ridge%2C_Camping_tent%2C_Caucasus_Mountains.jpg","page":"https://commons.wikimedia.org/wiki/File:Zagedan_Ridge,_Camping_tent,_Caucasus_Mountains.jpg","w":4912,"h":3264,"color":"#787043","license":"CC BY 4.0","author":"Vyacheslav Argenberg","subject":"a small pale tent pitched on a steep grassy hillside in low golden light","tags":["tent","camping","hillside","outdoors","summer","hiking","golden hour","wild camping","adventure","gear hire"],"cat":"travel","tone":"mid","temp":"warm","people":"none","q":3,"fp":[0.45,0.55]},{"id":"High-Pressure-Cleaning-with-Personal-Protective-Equipment-01.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/20/High-Pressure-Cleaning-with-Personal-Protective-Equipment-01.jpg","page":"https://commons.wikimedia.org/wiki/File:High-Pressure-Cleaning-with-Personal-Protective-Equipment-01.jpg","w":3758,"h":2505,"color":"#535254","license":"CC BY-SA 3.0","author":"CEphoto, Uwe Aranas","subject":"a worker in waterproofs pressure washing a rusty machine part on a pallet","tags":["pressure washer","cleaning","worker","industrial","spray","maintenance","workshop","tool hire","water","figure"],"cat":"work","tone":"dark","temp":"cool","people":"figure","q":2,"fp":[0.4,0.5]},{"id":"Shadow of man pressure washing a building.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/9c/Shadow_of_man_pressure_washing_a_building.jpg","page":"https://commons.wikimedia.org/wiki/File:Shadow_of_man_pressure_washing_a_building.jpg","w":3648,"h":2736,"color":"#918a83","license":"CC BY-SA 4.0","author":"Krr005","subject":"a cleaner on a cherry picker pressure washing a concrete facade, with long shadows","tags":["pressure washer","facade cleaning","cherry picker","building","maintenance","shadow","wall","cleaning","tool hire","figure"],"cat":"work","tone":"mid","temp":"cool","people":"figure","q":2,"fp":[0.7,0.3]},{"id":"Une bénévole nettoie la coque du Kraken au karcher à Savone.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/c/ca/Une_b%C3%A9n%C3%A9vole_nettoie_la_coque_du_Kraken_au_karcher_%C3%A0_Savone.jpg","page":"https://commons.wikimedia.org/wiki/File:Une_b%C3%A9n%C3%A9vole_nettoie_la_coque_du_Kraken_au_karcher_%C3%A0_Savone.jpg","w":6240,"h":4160,"color":"#54443b","license":"CC BY-SA 4.0","author":"Victor Janjić","subject":"a worker in ear defenders blasting a ship hull with a pressure washer in spray","tags":["pressure washer","ship hull","boatyard","cleaning","spray","maintenance","worker","industrial","marine","figure"],"cat":"work","tone":"mid","temp":"warm","people":"figure","q":2,"fp":[0.45,0.5]},{"id":"Ice cube Air entrapment.JPG","file":"https://upload.wikimedia.org/wikipedia/commons/4/46/Ice_cube_Air_entrapment.JPG","page":"https://commons.wikimedia.org/wiki/File:Ice_cube_Air_entrapment.JPG","w":5049,"h":3366,"color":"#534542","license":"CC BY-SA 3.0","author":"Lusilier","subject":"fingers holding a large clear ice cube with a frosted core against dark knit","tags":["ice cube","hand","cold","clear","cocktail","drinks","bar","frozen","dark","close up"],"cat":"drink","tone":"dark","temp":"cool","people":"hands","q":2},{"id":"Phone Repair 02.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/8/84/Phone_Repair_02.jpg","page":"https://commons.wikimedia.org/wiki/File:Phone_Repair_02.jpg","w":5472,"h":3648,"color":"#696068","license":"CC BY-SA 4.0","author":"Amuzujoe","subject":"dark hands holding an opened phone over a cluttered repair bench","tags":["phone repair","hands","smartphone","repair shop","electronics","bench","fix","right to repair","tools","workshop"],"cat":"tech","tone":"mid","temp":"warm","people":"hands","q":2,"fp":[0.4,0.45]},{"id":"Soldering iron (UK Plug).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/bf/Soldering_iron_%28UK_Plug%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Soldering_iron_(UK_Plug).jpg","w":3354,"h":2408,"color":"#ccc7c7","license":"CC BY-SA 2.0","author":"oomlout","subject":"a red handled soldering iron with its coiled black cable on white","tags":["soldering iron","electronics","tool","repair","maker","product","workshop","diy","hardware","still life"],"cat":"object","tone":"light","temp":"neutral","people":"none","q":2},{"id":"Return to origins.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/5/58/Return_to_origins.jpg","page":"https://commons.wikimedia.org/wiki/File:Return_to_origins.jpg","w":3008,"h":2000,"color":"#685f53","license":"CC BY 2.0","author":"Feliciano Guimarães from Guimarães, Portugal","subject":"an old shepherd with a crook standing with a ewe and a white dog in pasture","tags":["shepherd","sheep","ewe","dog","farmer","crook","pasture","flock","countryside","figure"],"cat":"animal","tone":"mid","temp":"warm","people":"figure","q":2,"fp":[0.6,0.5]},{"id":"Reading corner.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/fe/Reading_corner.jpg","page":"https://commons.wikimedia.org/wiki/File:Reading_corner.jpg","w":5532,"h":3951,"color":"#919192","license":"CC BY-SA 4.0","author":"Øyvind Holmstad","subject":"a quiet reading corner with a leopard print chair and a floor lamp on blue boards","tags":["reading corner","armchair","lamp","interior","cosy","home","quiet","reading nook","wood floor","blue wall"],"cat":"interior","tone":"light","temp":"cool","people":"none","q":2},{"id":"Child draws on tablet while sitting indoors.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/6/6a/Child_draws_on_tablet_while_sitting_indoors.jpg","page":"https://commons.wikimedia.org/wiki/File:Child_draws_on_tablet_while_sitting_indoors.jpg","w":5718,"h":3804,"color":"#7b6253","license":"CC BY 2.0","author":"Shixart1985","subject":"a child's hands drawing on a tablet with a stylus, face out of frame","tags":["child","tablet","stylus","drawing","hands","kids","learning","home","screen time","family"],"cat":"family","tone":"mid","temp":"warm","people":"hands","q":2,"fp":[0.4,0.5]},{"id":"VR-Yhtymä Dr16 night train near Kolari.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/1/14/VR-Yhtym%C3%A4_Dr16_night_train_near_Kolari.jpg","page":"https://commons.wikimedia.org/wiki/File:VR-Yhtym%C3%A4_Dr16_night_train_near_Kolari.jpg","w":3219,"h":1987,"color":"#9a8f88","license":"CC BY-SA 3.0","author":"David Gubler","subject":"a red diesel train hauling carriages through a snowy birch forest","tags":["train","snow","winter","forest","railway","travel","birch","landscape","journey","north"],"cat":"travel","tone":"light","temp":"cool","people":"none","q":2,"fp":[0.35,0.65]},{"id":"Night Train.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/6/6e/Night_Train.jpg","page":"https://commons.wikimedia.org/wiki/File:Night_Train.jpg","w":1936,"h":1288,"color":"#1a1b1a","license":"CC0","author":"Tiraspolsky","subject":"a dark train sliding past at night in a long blur of lit windows","tags":["train","night","motion blur","lit windows","railway","travel","dark","journey","sleeper","platform"],"cat":"travel","tone":"dark","temp":"cool","people":"none","q":2},{"id":"2025-08-06, Lisbon Metro train waiting at Santa Apolónia.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/d/d7/2025-08-06%2C_Lisbon_Metro_train_waiting_at_Santa_Apol%C3%B3nia.jpg","page":"https://commons.wikimedia.org/wiki/File:2025-08-06,_Lisbon_Metro_train_waiting_at_Santa_Apol%C3%B3nia.jpg","w":6024,"h":4020,"color":"#63544a","license":"CC BY 4.0","author":"Patrycja Rosa (ptrcnull)","subject":"a red fronted Lisbon metro train arriving at a pale tiled platform","tags":["metro","lisbon","train","platform","station","underground","transit","portugal","arriving","commute"],"cat":"travel","tone":"mid","temp":"warm","people":"none","q":2,"fp":[0.6,0.6]},{"id":"Dried lemon slices.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/e7/Dried_lemon_slices.jpg","page":"https://commons.wikimedia.org/wiki/File:Dried_lemon_slices.jpg","w":3000,"h":3000,"color":"#7c7161","license":"CC0","author":"Fumikas Sagisavas","subject":"a heap of dried lemon slices filling the frame, close up","tags":["lemon","dried","slices","citrus","texture","garnish","drinks","cocktail","botanicals","food"],"cat":"food","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Lemon Series (3047083562).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/5/5a/Lemon_Series_%283047083562%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Lemon_Series_(3047083562).jpg","w":2048,"h":1365,"color":"#d0c089","license":"CC BY 2.0","author":"THOR","subject":"two lemon slices suspended in sparkling water with tiny bubbles on white","tags":["lemon","slices","sparkling water","bubbles","soda","drinks","citrus","fresh","lemonade","cocktail"],"cat":"drink","tone":"light","temp":"warm","people":"none","q":2},{"id":"Writing in a notebook with a feather pen while enjoying coffee at a desk surrounded by flowers.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/d/d2/Writing_in_a_notebook_with_a_feather_pen_while_enjoying_coffee_at_a_desk_surrounded_by_flowers.jpg","page":"https://commons.wikimedia.org/wiki/File:Writing_in_a_notebook_with_a_feather_pen_while_enjoying_coffee_at_a_desk_surrounded_by_flowers.jpg","w":6016,"h":4016,"color":"#716a64","license":"CC BY 2.0","author":"Shixart1985","subject":"hands writing in a notebook with a feather pen beside a cup of cocoa","tags":["notebook","writing","hands","desk","coffee","journal","freelancer","home office","planning","cosy"],"cat":"work","tone":"mid","temp":"warm","people":"hands","q":2,"fp":[0.55,0.6]},{"id":"A man sits comfortably on a sofa in a living room, focused on playing his acoustic guitar.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/1/1a/A_man_sits_comfortably_on_a_sofa_in_a_living_room%2C_focused_on_playing_his_acoustic_guitar.jpg","page":"https://commons.wikimedia.org/wiki/File:A_man_sits_comfortably_on_a_sofa_in_a_living_room,_focused_on_playing_his_acoustic_guitar.jpg","w":6240,"h":4160,"color":"#564d41","license":"CC BY 2.0","author":"Shixart1985","subject":"a grey haired man playing an acoustic guitar on a sofa by a window","tags":["guitar","acoustic","musician","sofa","home","playing","hobby","living room","music lessons","window"],"cat":"family","tone":"mid","temp":"warm","people":"face","q":2},{"id":"Brač and Čelo on the sofa (2019-04-20 16.48.01 by Marko Milivojevic @PIXNIO 2592510).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/6/67/Bra%C4%8D_and_%C4%8Celo_on_the_sofa_%282019-04-20_16.48.01_by_Marko_Milivojevic_%40PIXNIO_2592510%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Bra%C4%8D_and_%C4%8Celo_on_the_sofa_(2019-04-20_16.48.01_by_Marko_Milivojevic_@PIXNIO_2592510).jpg","w":3512,"h":5268,"color":"#6d6a60","license":"CC0","author":"Marko Milivojevic (milim84)","subject":"two old acoustic guitars resting in a teal velvet armchair by a window","tags":["guitars","acoustic","armchair","velvet","window","home","music","vintage","instrument","living room"],"cat":"object","tone":"mid","temp":"warm","people":"none","q":2,"fp":[0.5,0.6]},{"id":"Levy Strauss Race et Histoire, bass guitar, red sofa.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/b6/Levy_Strauss_Race_et_Histoire%2C_bass_guitar%2C_red_sofa.jpg","page":"https://commons.wikimedia.org/wiki/File:Levy_Strauss_Race_et_Histoire,_bass_guitar,_red_sofa.jpg","w":2848,"h":4272,"color":"#8d4c3e","license":"CC BY-SA 2.0","author":"Olivier Issaly","subject":"an open paperback lying on a red sofa with a bass guitar standing behind","tags":["book","sofa","reading","guitar","living room","home","cosy","weekend","red","interior"],"cat":"interior","tone":"mid","temp":"warm","people":"none","q":2,"fp":[0.4,0.55]},{"id":"Micropipette Rack.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/e5/Micropipette_Rack.jpg","page":"https://commons.wikimedia.org/wiki/File:Micropipette_Rack.jpg","w":2744,"h":3662,"color":"#867d69","license":"CC BY 4.0","author":"Alyssa LaGrange","subject":"a row of micropipettes with yellow caps in a rack, in shallow focus","tags":["micropipettes","laboratory","lab bench","science","research","biotech","testing","yellow","rack","lab equipment"],"cat":"science","tone":"light","temp":"cool","people":"none","q":2,"fp":[0.6,0.35]},{"id":"Glass door of the library at Amantaka luxury Resort & Hotel in Luang Prabang Laos.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/0/0f/Glass_door_of_the_library_at_Amantaka_luxury_Resort_%26_Hotel_in_Luang_Prabang_Laos.jpg","page":"https://commons.wikimedia.org/wiki/File:Glass_door_of_the_library_at_Amantaka_luxury_Resort_%26_Hotel_in_Luang_Prabang_Laos.jpg","w":6048,"h":4032,"color":"#7f6556","license":"CC BY-SA 4.0","author":"Basile Morin","subject":"tall glazed doors between warm wooden bookshelves with plants in clay pots","tags":["doorway","bookshelves","glass doors","library","interior","wood","quiet room","daylight","study","home"],"cat":"interior","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Santorin (GR), Akrotiri -- 2017 -- 2444.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/b4/Santorin_%28GR%29%2C_Akrotiri_--_2017_--_2444.jpg","page":"https://commons.wikimedia.org/wiki/File:Santorin_(GR),_Akrotiri_--_2017_--_2444.jpg","w":3499,"h":4899,"color":"#7d8da1","license":"CC BY-SA 4.0","author":"Dietmar Rabich","subject":"a weathered blue wooden door set in a rough whitewashed wall","tags":["blue door","door","whitewash","wall","entrance","mediterranean","rustic","texture","village","travel"],"cat":"architecture","tone":"light","temp":"cool","people":"none","q":2},{"id":"James Alexander 3Rocks at Sunrise.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/6/6d/James_Alexander_3Rocks_at_Sunrise.jpg","page":"https://commons.wikimedia.org/wiki/File:James_Alexander_3Rocks_at_Sunrise.jpg","w":5712,"h":3213,"color":"#726f6b","license":"CC BY 4.0","author":"Fox","subject":"a lone swimmer's head in dark choppy water under a pale dawn sky","tags":["sea swimming","swimmer","dawn","first light","open water","cold water","sea","sunrise","figure","wild swimming"],"cat":"sport","tone":"dark","temp":"cool","people":"figure","q":2,"fp":[0.4,0.65]},{"id":"Tide marker at Formby Point - geograph.org.uk - 2052952.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/e3/Tide_marker_at_Formby_Point_-_geograph.org.uk_-_2052952.jpg","page":"https://commons.wikimedia.org/wiki/File:Tide_marker_at_Formby_Point_-_geograph.org.uk_-_2052952.jpg","w":1600,"h":900,"color":"#9e9d9c","license":"CC BY-SA 2.0","author":"Gary Rogers","subject":"a tall tide marker post standing in wet sand flats under a soft grey sky","tags":["tide gauge","tide marker","tidal flats","beach","low tide","coast","sea","post","minimal","almanac"],"cat":"landscape","tone":"light","temp":"cool","people":"none","q":2},{"id":"Gin and tonic with lemon.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/3/33/Gin_and_tonic_with_lemon.jpg","page":"https://commons.wikimedia.org/wiki/File:Gin_and_tonic_with_lemon.jpg","w":2671,"h":2448,"color":"#5d554b","license":"CC BY-SA 2.0","author":"MuseumNext","subject":"a balloon glass of gin and tonic with lemon catching warm light on dark","tags":["gin and tonic","gin","copa glass","cocktail","lemon","bar","ice","drinks","distillery","dark"],"cat":"drink","tone":"dark","temp":"cool","people":"none","q":2,"fp":[0.55,0.45]},{"id":"Paris - A waiter lighting candles in a bar - 3418.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/c/cf/Paris_-_A_waiter_lighting_candles_in_a_bar_-_3418.jpg","page":"https://commons.wikimedia.org/wiki/File:Paris_-_A_waiter_lighting_candles_in_a_bar_-_3418.jpg","w":4368,"h":2912,"color":"#412c22","license":"CC BY-SA 3.0","author":"Jorge Royan","subject":"a bar woman lighting rows of red glass candles on a dark candlelit counter","tags":["candlelit bar","candles","bar","counter","evening","restaurant","wine bar","hospitality","warm light","figure"],"cat":"interior","tone":"dark","temp":"warm","people":"figure","q":2,"fp":[0.4,0.65]},{"id":"Wine cellar at Tahbilk.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/c/cd/Wine_cellar_at_Tahbilk.jpg","page":"https://commons.wikimedia.org/wiki/File:Wine_cellar_at_Tahbilk.jpg","w":2048,"h":2048,"color":"#32362f","license":"CC BY 4.0","author":"Peterdownunder","subject":"a long dim cellar of oak wine barrels lit by a single bulb","tags":["wine cellar","barrels","oak","cellar","winery","ageing","dark","cave","wine bar","tasting"],"cat":"interior","tone":"dark","temp":"cool","people":"none","q":2,"fp":[0.5,0.45]},{"id":"Dülmen, Kirchspiel, Erdbeerfeld -- 2015 -- 6522.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/c/c4/D%C3%BClmen%2C_Kirchspiel%2C_Erdbeerfeld_--_2015_--_6522.jpg","page":"https://commons.wikimedia.org/wiki/File:D%C3%BClmen,_Kirchspiel,_Erdbeerfeld_--_2015_--_6522.jpg","w":3300,"h":4698,"color":"#685245","license":"CC BY-SA 4.0","author":"Dietmar Rabich","subject":"stacked wooden crates of strawberries in a field at golden hour","tags":["fruit crates","strawberries","harvest","farm","pick your own","crates","summer","produce","field","golden hour"],"cat":"food","tone":"mid","temp":"warm","people":"none","q":2,"fp":[0.5,0.55]},{"id":"Winterswijk (NL), Wochenmarkt -- 2016 -- 4139.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/5/5a/Winterswijk_%28NL%29%2C_Wochenmarkt_--_2016_--_4139.jpg","page":"https://commons.wikimedia.org/wiki/File:Winterswijk_(NL),_Wochenmarkt_--_2016_--_4139.jpg","w":5472,"h":3648,"color":"#b9610e","license":"CC BY-SA 4.0","author":"Dietmar Rabich","subject":"wooden market crates heaped with bright oranges, close up","tags":["oranges","crates","market","citrus","fruit","produce","greengrocer","colour","wholesale","fresh"],"cat":"food","tone":"mid","temp":"warm","people":"none","q":2},{"id":"American French Tool 24x48 etching press.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/a/a8/American_French_Tool_24x48_etching_press.jpg","page":"https://commons.wikimedia.org/wiki/File:American_French_Tool_24x48_etching_press.jpg","w":1678,"h":1759,"color":"#828282","license":"CC BY-SA 4.0","author":"ColinMB","subject":"a large spoked etching press standing in a bare studio by a window, in mono","tags":["etching press","printmaking","press","studio","print room","black and white","intaglio","workshop","werkstatt","grid"],"cat":"craft","tone":"light","temp":"neutral","people":"none","q":2,"fp":[0.4,0.5]},{"id":"Woodshop.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/b7/Woodshop.jpg","page":"https://commons.wikimedia.org/wiki/File:Woodshop.jpg","w":4006,"h":2658,"color":"#967356","license":"CC BY-SA 4.0","author":"Dolly442","subject":"a long daylit woodshop of workbenches and machines under timber trusses","tags":["woodshop","workshop","workbenches","woodworking","joinery","machines","daylight","school","werkstatt","carpentry"],"cat":"interior","tone":"mid","temp":"warm","people":"none","q":2},{"id":"English queue - Flickr - gagilas.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/b5/English_queue_-_Flickr_-_gagilas.jpg","page":"https://commons.wikimedia.org/wiki/File:English_queue_-_Flickr_-_gagilas.jpg","w":3224,"h":2102,"color":"#696865","license":"CC BY-SA 2.0","author":"Petras Gagilas from Bexleyheath, Kent, UK","subject":"people with umbrellas queuing on a wet city street in black and white","tags":["queue","rain","umbrellas","wet street","city","black and white","waiting","crowd","venue","figures"],"cat":"city","tone":"mid","temp":"neutral","people":"figure","q":2},{"id":"Cognac glass.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/9a/Cognac_glass.jpg","page":"https://commons.wikimedia.org/wiki/File:Cognac_glass.jpg","w":5584,"h":4723,"color":"#16100a","license":"CC BY-SA 3.0","author":"Didier Descouens","subject":"a brandy snifter of amber cognac lit against a black background","tags":["glass","snifter","cognac","brandy","bar","spirits","drink","glassware","dark"],"cat":"drink","tone":"dark","temp":"warm","people":"none","q":2},{"id":"BiodegradablePlasticUtensils1.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/c/c0/BiodegradablePlasticUtensils1.jpg","page":"https://commons.wikimedia.org/wiki/File:BiodegradablePlasticUtensils1.jpg","w":2700,"h":1757,"color":"#464542","license":"Public domain","author":"Scott Bauer","subject":"plastic forks and spoons glowing with rainbow stress patterns on black","tags":["cutlery","forks","spoons","plastic","polarised","rainbow","abstract","pattern"],"cat":"abstract","tone":"dark","temp":"cool","people":"none","q":2},{"id":"Fountain pen writing (literacy).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/7b/Fountain_pen_writing_%28literacy%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Fountain_pen_writing_(literacy).jpg","w":4620,"h":3388,"color":"#b6b3af","license":"CC BY-SA 4.0","author":"Petar Milošević","subject":"a gold fountain pen nib writing cursive on white paper, close up","tags":["fountain","pen","nib","writing","handwriting","paper","stationery","letter","calligraphy"],"cat":"object","tone":"light","temp":"warm","people":"none","q":2,"fp":[0.3,0.5]},{"id":"Two-Tone Fountain Pen Nib-Plum.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/a/a8/Two-Tone_Fountain_Pen_Nib-Plum.jpg","page":"https://commons.wikimedia.org/wiki/File:Two-Tone_Fountain_Pen_Nib-Plum.jpg","w":4648,"h":3099,"color":"#424964","license":"CC BY-SA 4.0","author":"ElooKoN","subject":"macro of a two-tone fountain pen nib against a soft blue background","tags":["fountain","pen","nib","macro","writing","stationery","luxury","gold"],"cat":"object","tone":"dark","temp":"cool","people":"none","q":3},{"id":"Olympia Simplex.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/1/17/Olympia_Simplex.jpg","page":"https://commons.wikimedia.org/wiki/File:Olympia_Simplex.jpg","w":6000,"h":4000,"color":"#989797","license":"CC BY 4.0","author":"Sammlung der Medien und Wissenschaft","subject":"a black portable typewriter on a pale grey seamless backdrop","tags":["typewriter","vintage","writing","keys","author","office","retro","machine"],"cat":"object","tone":"light","temp":"neutral","people":"none","q":2},{"id":"12in-Vinyl-LP-Record-Angle.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/b6/12in-Vinyl-LP-Record-Angle.jpg","page":"https://commons.wikimedia.org/wiki/File:12in-Vinyl-LP-Record-Angle.jpg","w":4000,"h":4000,"color":"#7d7b6e","license":"Public domain","author":"Evan-Amos","subject":"a black vinyl LP with a plain yellow centre label on white","tags":["vinyl","record","lp","music","album","retro","audio","record","shop"],"cat":"object","tone":"light","temp":"neutral","people":"none","q":2},{"id":"Groove and needle in close embrace from beginning to end.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/4c/Groove_and_needle_in_close_embrace_from_beginning_to_end.jpg","page":"https://commons.wikimedia.org/wiki/File:Groove_and_needle_in_close_embrace_from_beginning_to_end.jpg","w":7952,"h":3181,"color":"#909090","license":"CC BY-SA 4.0","author":"Franz van Duns","subject":"two turntable tonearms resting over a spinning record, black and white","tags":["turntable","record","player","tonearm","needle","vinyl","music","dj","audio"],"cat":"object","tone":"light","temp":"neutral","people":"none","q":2},{"id":"Technics SL-120 turntable and pickup - front view (2019-04-28).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/8/88/Technics_SL-120_turntable_and_pickup_-_front_view_%282019-04-28%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Technics_SL-120_turntable_and_pickup_-_front_view_(2019-04-28).jpg","w":7952,"h":5304,"color":"#a0a3a4","license":"CC BY-SA 4.0","author":"Franz van Duns","subject":"a silver turntable with its dust cover open on a white backdrop","tags":["turntable","record","player","hifi","audio","vinyl","music","retro"],"cat":"object","tone":"light","temp":"neutral","people":"none","q":2},{"id":"A luthier at work on a violin 02.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/ee/A_luthier_at_work_on_a_violin_02.jpg","page":"https://commons.wikimedia.org/wiki/File:A_luthier_at_work_on_a_violin_02.jpg","w":5472,"h":3648,"color":"#887262","license":"CC BY-SA 4.0","author":"Kritzolina","subject":"a luthier's hands carving a violin top on a wooden jig","tags":["luthier","violin","carving","workshop","hands","wood","craft","instrument","maker"],"cat":"craft","tone":"mid","temp":"warm","people":"hands","q":3},{"id":"Santorin (GR), Fira -- 2017 -- 2598.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/d/d9/Santorin_%28GR%29%2C_Fira_--_2017_--_2598.jpg","page":"https://commons.wikimedia.org/wiki/File:Santorin_(GR),_Fira_--_2017_--_2598.jpg","w":5410,"h":3607,"color":"#647588","license":"CC BY-SA 4.0","author":"Dietmar Rabich","subject":"two white chairs and a blue table on a whitewashed terrace above the sea","tags":["chairs","table","terrace","santorini","greece","blue","white","hotel","holiday"],"cat":"travel","tone":"light","temp":"cool","people":"none","q":3},{"id":"Stacked chairs 01.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/a/ab/Stacked_chairs_01.jpg","page":"https://commons.wikimedia.org/wiki/File:Stacked_chairs_01.jpg","w":3648,"h":5472,"color":"#6e675d","license":"CC BY-SA 4.0","author":"Kritzolina","subject":"stacks of colourful metal cafe chairs against a wooden wall","tags":["chairs","stacked","metal","cafe","colourful","furniture","restaurant"],"cat":"object","tone":"mid","temp":"warm","people":"none","q":3},{"id":"Dülmen, Kreuzkapelle, Bänke -- 2021 -- 7365.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/72/D%C3%BClmen%2C_Kreuzkapelle%2C_B%C3%A4nke_--_2021_--_7365.jpg","page":"https://commons.wikimedia.org/wiki/File:D%C3%BClmen,_Kreuzkapelle,_B%C3%A4nke_--_2021_--_7365.jpg","w":6338,"h":4480,"color":"#945129","license":"CC BY-SA 4.0","author":"Dietmar Rabich","subject":"a carved oak panel with gothic tracery, close up","tags":["wood","carving","oak","panel","gothic","joinery","craft","furniture"],"cat":"texture","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Artisan coloring a lamp, Medina Marrakesh (Morocco).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/1/15/Artisan_coloring_a_lamp%2C_Medina_Marrakesh_%28Morocco%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Artisan_coloring_a_lamp,_Medina_Marrakesh_(Morocco).jpg","w":5070,"h":3708,"color":"#3e3624","license":"CC BY-SA 4.0","author":"Petar Milošević","subject":"a craftsman painting a white pierced metal lantern in a dim workshop","tags":["lantern","lamp","artisan","workshop","morocco","metalwork","craft","lighting"],"cat":"craft","tone":"dark","temp":"warm","people":"figure","q":3},{"id":"Among the branches of a potted jade plant.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/c/c8/Among_the_branches_of_a_potted_jade_plant.jpg","page":"https://commons.wikimedia.org/wiki/File:Among_the_branches_of_a_potted_jade_plant.jpg","w":4265,"h":3094,"color":"#31331e","license":"CC0","author":"W.carter","subject":"the thick branches and leaves of a potted jade plant, close up","tags":["jade","plant","succulent","houseplant","pot","leaves","plant","shop"],"cat":"nature","tone":"dark","temp":"cool","people":"none","q":2},{"id":"Echeveria 'Perle Von Nuremburg' Plant 3008px.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/fb/Echeveria_%27Perle_Von_Nuremburg%27_Plant_3008px.jpg","page":"https://commons.wikimedia.org/wiki/File:Echeveria_%27Perle_Von_Nuremburg%27_Plant_3008px.jpg","w":3008,"h":2000,"color":"#626157","license":"CC BY-SA 3.0","author":"Derek Ramsey (Ram-Man)","subject":"a blue-grey echeveria succulent rosette in a terracotta pot","tags":["succulent","echeveria","terracotta","pot","houseplant","plant","shop","garden"],"cat":"nature","tone":"mid","temp":"cool","people":"none","q":2},{"id":"Candle light projected through a glass orb.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/2c/Candle_light_projected_through_a_glass_orb.jpg","page":"https://commons.wikimedia.org/wiki/File:Candle_light_projected_through_a_glass_orb.jpg","w":4724,"h":2657,"color":"#4b432c","license":"CC BY-SA 4.0","author":"W.carter","subject":"a lit candle in a brass holder beside a glass paperweight in a pool of light","tags":["candle","brass","holder","glass","orb","flame","still","life","calm","evening"],"cat":"object","tone":"dark","temp":"warm","people":"none","q":2},{"id":"Манастир Моштаница-капела за паљење свећа (Moštanica Monastery, chapel for lighting candles).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/4c/%D0%9C%D0%B0%D0%BD%D0%B0%D1%81%D1%82%D0%B8%D1%80_%D0%9C%D0%BE%D1%88%D1%82%D0%B0%D0%BD%D0%B8%D1%86%D0%B0-%D0%BA%D0%B0%D0%BF%D0%B5%D0%BB%D0%B0_%D0%B7%D0%B0_%D0%BF%D0%B0%D1%99%D0%B5%D1%9A%D0%B5_%D1%81%D0%B2%D0%B5%D1%9B%D0%B0_%28Mo%C5%A1tanica_Monastery%2C_chapel_for_lighting_candles%29.jpg","page":"https://commons.wikimedia.org/wiki/File:%D0%9C%D0%B0%D0%BD%D0%B0%D1%81%D1%82%D0%B8%D1%80_%D0%9C%D0%BE%D1%88%D1%82%D0%B0%D0%BD%D0%B8%D1%86%D0%B0-%D0%BA%D0%B0%D0%BF%D0%B5%D0%BB%D0%B0_%D0%B7%D0%B0_%D0%BF%D0%B0%D1%99%D0%B5%D1%9A%D0%B5_%D1%81%D0%B2%D0%B5%D1%9B%D0%B0_(Mo%C5%A1tanica_Monastery,_chapel_for_lighting_candles).jpg","w":4239,"h":2983,"color":"#2b2623","license":"CC BY-SA 4.0","author":"Petar Milošević","subject":"three thin orange candles burning with their reflections in dark water","tags":["candles","flame","reflection","prayer","calm","spa","meditation"],"cat":"object","tone":"dark","temp":"warm","people":"none","q":3,"fp":[0.65,0.4]},{"id":"Nizza-Soap-4070848.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/47/Nizza-Soap-4070848.jpg","page":"https://commons.wikimedia.org/wiki/File:Nizza-Soap-4070848.jpg","w":4331,"h":3361,"color":"#ce526a","license":"CC BY-SA 4.0","author":"Ermell","subject":"rows of pink soap bars stacked in a wooden crate","tags":["soap","bars","marseille","handmade","crate","skincare","shop","bath"],"cat":"object","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Cobbler repairing shoes in old workshop (Bazaar in Bitola, Macedonia, 2025).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/e6/Cobbler_repairing_shoes_in_old_workshop_%28Bazaar_in_Bitola%2C_Macedonia%2C_2025%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Cobbler_repairing_shoes_in_old_workshop_(Bazaar_in_Bitola,_Macedonia,_2025).jpg","w":5472,"h":3648,"color":"#64625f","license":"CC BY-SA 4.0","author":"Petar Milošević","subject":"an old cobbler stitching a shoe at a sewing machine in his workshop, black and white","tags":["cobbler","shoemaker","shoes","repair","workshop","leather","sewing","machine","craft"],"cat":"craft","tone":"mid","temp":"neutral","people":"figure","q":2},{"id":"Traditional Moroccan shoes called \"babouches\".JPG","file":"https://upload.wikimedia.org/wikipedia/commons/5/5c/Traditional_Moroccan_shoes_called_%22babouches%22.JPG","page":"https://commons.wikimedia.org/wiki/File:Traditional_Moroccan_shoes_called_%22babouches%22.JPG","w":2816,"h":2112,"color":"#885f46","license":"CC BY-SA 4.0","author":"Pitchoon76","subject":"piles of colourful leather babouche slippers at a Moroccan market","tags":["shoes","slippers","babouche","leather","market","morocco","colourful"],"cat":"fashion","tone":"mid","temp":"warm","people":"none","q":3},{"id":"Jeansfabric.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/41/Jeansfabric.jpg","page":"https://commons.wikimedia.org/wiki/File:Jeansfabric.jpg","w":2232,"h":3406,"color":"#6f8192","license":"CC BY-SA 3.0","author":"Thegreenj","subject":"close up of blue denim twill weave, filling the frame","tags":["denim","fabric","textile","weave","jeans","cotton","blue","texture"],"cat":"texture","tone":"mid","temp":"cool","people":"none","q":2},{"id":"Morro Jable (Fuerteventura, Spain), Strand -- 2025 -- 2487.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/a/aa/Morro_Jable_%28Fuerteventura%2C_Spain%29%2C_Strand_--_2025_--_2487.jpg","page":"https://commons.wikimedia.org/wiki/File:Morro_Jable_(Fuerteventura,_Spain),_Strand_--_2025_--_2487.jpg","w":5472,"h":3648,"color":"#9b8c7e","license":"CC BY-SA 4.0","author":"Dietmar Rabich","subject":"wind ripples in pale beach sand flowing around a dark pebble","tags":["sand","ripples","beach","pebble","texture","calm","minimal"],"cat":"texture","tone":"light","temp":"neutral","people":"none","q":3,"fp":[0.65,0.5]},{"id":"Frost-covered lifebuoy, Lake Siskiyou.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/b4/Frost-covered_lifebuoy%2C_Lake_Siskiyou.jpg","page":"https://commons.wikimedia.org/wiki/File:Frost-covered_lifebuoy,_Lake_Siskiyou.jpg","w":5293,"h":3541,"color":"#495463","license":"CC BY-SA 4.0","author":"Radomianin","subject":"a frosted lifebuoy floating on still blue water beside a wooden post","tags":["water","lake","lifebuoy","calm","still","frost","blue"],"cat":"nature","tone":"mid","temp":"cool","people":"none","q":3},{"id":"IceBlockNearJoekullsarlon.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/71/IceBlockNearJoekullsarlon.jpg","page":"https://commons.wikimedia.org/wiki/File:IceBlockNearJoekullsarlon.jpg","w":2971,"h":1984,"color":"#707173","license":"CC BY-SA 4.0","author":"Andreas Tille","subject":"a backlit block of glacial ice on a black beach","tags":["ice","glacier","iceberg","iceland","beach","cold","winter"],"cat":"nature","tone":"dark","temp":"cool","people":"none","q":3},{"id":"Ice structure no. 2.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/bf/Ice_structure_no._2.jpg","page":"https://commons.wikimedia.org/wiki/File:Ice_structure_no._2.jpg","w":3583,"h":2417,"color":"#5e6168","license":"CC BY-SA 4.0","author":"BogTar201213","subject":"frost crystals spreading over dark ice in a diagonal band","tags":["ice","frost","crystals","texture","winter","cold"],"cat":"texture","tone":"dark","temp":"cool","people":"none","q":2},{"id":"Lake Baikal in winter.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/5/53/Lake_Baikal_in_winter.jpg","page":"https://commons.wikimedia.org/wiki/File:Lake_Baikal_in_winter.jpg","w":7360,"h":4912,"color":"#707880","license":"CC BY-SA 4.0","author":"Sergey Pesterev","subject":"cracked clear ice on a frozen lake beneath a rocky headland","tags":["ice","frozen","lake","baikal","winter","cracks","landscape","cold"],"cat":"landscape","tone":"mid","temp":"cool","people":"none","q":3},{"id":"Ordinary chickpeas in a ceramic bowl.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/d/d9/Ordinary_chickpeas_in_a_ceramic_bowl.jpg","page":"https://commons.wikimedia.org/wiki/File:Ordinary_chickpeas_in_a_ceramic_bowl.jpg","w":2100,"h":1400,"color":"#b38f69","license":"CC BY-SA 4.0","author":"AlixSaz","subject":"a glazed ceramic bowl of chickpeas on a woven straw mat","tags":["ceramic","bowl","chickpeas","pulses","pantry","kitchen","food"],"cat":"food","tone":"light","temp":"warm","people":"none","q":2},{"id":"Still life with strawberries in a crystal bowl.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/1/1f/Still_life_with_strawberries_in_a_crystal_bowl.jpg","page":"https://commons.wikimedia.org/wiki/File:Still_life_with_strawberries_in_a_crystal_bowl.jpg","w":4535,"h":3024,"color":"#423534","license":"CC BY-SA 4.0","author":"W.carter","subject":"strawberries in a glass bowl on a blue striped cloth","tags":["glass","bowl","strawberries","fruit","still","life","summer"],"cat":"food","tone":"mid","temp":"cool","people":"none","q":2},{"id":"Pottery wares at Sidi Bousaid 3.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/eb/Pottery_wares_at_Sidi_Bousaid_3.jpg","page":"https://commons.wikimedia.org/wiki/File:Pottery_wares_at_Sidi_Bousaid_3.jpg","w":2818,"h":1775,"color":"#916755","license":"CC BY-SA 4.0","author":"Emna Mizouni","subject":"painted ceramic tagines stacked for sale in a Tunisian shop","tags":["ceramics","tagine","pottery","painted","glaze","market","tunisia"],"cat":"object","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Play with a wheel.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/6/66/Play_with_a_wheel.jpg","page":"https://commons.wikimedia.org/wiki/File:Play_with_a_wheel.jpg","w":3000,"h":2000,"color":"#464646","license":"CC BY-SA 4.0","author":"Arjit Chowdhury","subject":"a potter at a kick wheel surrounded by drying clay bowls, seen from above","tags":["potter","wheel","clay","bowls","pottery","workshop","craft","overhead"],"cat":"craft","tone":"dark","temp":"neutral","people":"figure","q":3},{"id":"Pottery at the Chokhi Dhani Resort Panchkula 32.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/3/39/Pottery_at_the_Chokhi_Dhani_Resort_Panchkula_32.jpg","page":"https://commons.wikimedia.org/wiki/File:Pottery_at_the_Chokhi_Dhani_Resort_Panchkula_32.jpg","w":5472,"h":3648,"color":"#8b7a67","license":"CC BY-SA 4.0","author":"Kritzolina","subject":"hands shaping a ribbed clay pot on a wheel outdoors","tags":["pottery","clay","hands","wheel","potter","craft","handmade"],"cat":"craft","tone":"mid","temp":"warm","people":"hands","q":2},{"id":"Trinkgläser -- 2021 -- 4700.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/7b/Trinkgl%C3%A4ser_--_2021_--_4700.jpg","page":"https://commons.wikimedia.org/wiki/File:Trinkgl%C3%A4ser_--_2021_--_4700.jpg","w":5852,"h":4389,"color":"#a19fa0","license":"CC BY-SA 4.0","author":"Dietmar Rabich","subject":"close up of clear drinking glasses with soft red and blue reflections","tags":["glass","drinking","glasses","glassware","clear","reflections","minimal"],"cat":"abstract","tone":"light","temp":"cool","people":"none","q":2},{"id":"The copper chaser.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/c/c7/The_copper_chaser.jpg","page":"https://commons.wikimedia.org/wiki/File:The_copper_chaser.jpg","w":2981,"h":1676,"color":"#302317","license":"CC BY-SA 4.0","author":"IssamBarhoumi","subject":"an elderly metalworker chasing a brass vessel with a hammer in his shop","tags":["hammer","metalwork","brass","copper","artisan","workshop","craft"],"cat":"craft","tone":"dark","temp":"warm","people":"figure","q":2},{"id":"13-11-02-olb-by-RalfR-03.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/c/c5/13-11-02-olb-by-RalfR-03.jpg","page":"https://commons.wikimedia.org/wiki/File:13-11-02-olb-by-RalfR-03.jpg","w":4288,"h":2848,"color":"#826a4c","license":"CC BY 3.0","author":"Ralf Roletschek","subject":"wooden arches lined with old books leading through a historic library","tags":["library","books","shelves","arches","reading","history","study"],"cat":"interior","tone":"mid","temp":"warm","people":"none","q":3},{"id":"Buntstifte -- 2021 -- 9164.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/41/Buntstifte_--_2021_--_9164.jpg","page":"https://commons.wikimedia.org/wiki/File:Buntstifte_--_2021_--_9164.jpg","w":6720,"h":4480,"color":"#6e4a32","license":"CC BY-SA 4.0","author":"Dietmar Rabich","subject":"a row of coloured pencils in rainbow order on dark felt, close up","tags":["pencils","coloured","pencils","rainbow","stationery","art","school"],"cat":"object","tone":"dark","temp":"neutral","people":"none","q":3},{"id":"Key ring.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/f0/Key_ring.jpg","page":"https://commons.wikimedia.org/wiki/File:Key_ring.jpg","w":4220,"h":4220,"color":"#a09a94","license":"CC BY-SA 4.0","author":"Basile Morin","subject":"a bunch of brass and steel keys with a red pocket knife on grey","tags":["keys","keyring","brass","home","locksmith","property"],"cat":"object","tone":"light","temp":"neutral","people":"none","q":2},{"id":"London Big Ben Inner Clock Face 1070925-PSD.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/0/09/London_Big_Ben_Inner_Clock_Face_1070925-PSD.jpg","page":"https://commons.wikimedia.org/wiki/File:London_Big_Ben_Inner_Clock_Face_1070925-PSD.jpg","w":2811,"h":2720,"color":"#6d665f","license":"CC BY-SA 4.0","author":"Ermell","subject":"the gilded cast iron dial of a great clock tower face, close up","tags":["clock","dial","roman","numerals","time","gold","tower"],"cat":"object","tone":"mid","temp":"warm","people":"none","q":3},{"id":"Matthew Norman carriage clock.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/3/39/Matthew_Norman_carriage_clock.jpg","page":"https://commons.wikimedia.org/wiki/File:Matthew_Norman_carriage_clock.jpg","w":3488,"h":3104,"color":"#2a2724","license":"CC BY-SA 4.0","author":"Petar Milošević","subject":"a gilt carriage clock and its winding key on a black reflective surface","tags":["clock","carriage","clock","antique","time","gold","luxury"],"cat":"object","tone":"dark","temp":"warm","people":"none","q":2},{"id":"Solex 99 30 padlock with keys (DSCF2659).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/6/60/Solex_99_30_padlock_with_keys_%28DSCF2659%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Solex_99_30_padlock_with_keys_(DSCF2659).jpg","w":2575,"h":2344,"color":"#735e45","license":"CC BY 4.0","author":"Trougnouf","subject":"a brass padlock with two keys on a wooden table","tags":["padlock","keys","lock","security","brass","locksmith","storage","table","home"],"cat":"object","tone":"mid","temp":"warm","people":"none","q":2},{"id":"001 2019 06 23 Schluessel und Schluesselloecher.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/0/0f/001_2019_06_23_Schluessel_und_Schluesselloecher.jpg","page":"https://commons.wikimedia.org/wiki/File:001_2019_06_23_Schluessel_und_Schluesselloecher.jpg","w":1623,"h":3080,"color":"#b9b5b1","license":"CC BY-SA 4.0","author":"Friedrich Haag","subject":"a ring of old iron keys hanging against a white wall","tags":["keys","iron","antique","keyring","rustic","old","wall","home","property"],"cat":"object","tone":"light","temp":"neutral","people":"none","q":2},{"id":"003 2019 06 25 Schluessel und Schluesselloecher.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/74/003_2019_06_25_Schluessel_und_Schluesselloecher.jpg","page":"https://commons.wikimedia.org/wiki/File:003_2019_06_25_Schluessel_und_Schluesselloecher.jpg","w":3480,"h":1436,"color":"#888381","license":"CC BY-SA 4.0","author":"Friedrich Haag","subject":"a single antique iron key on a grey background","tags":["key","antique","iron","skeleton","key","lock"],"cat":"object","tone":"light","temp":"neutral","people":"none","q":2},{"id":"Bicycle reflections.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/0/02/Bicycle_reflections.jpg","page":"https://commons.wikimedia.org/wiki/File:Bicycle_reflections.jpg","w":1200,"h":1800,"color":"#707070","license":"CC BY-SA 3.0","author":"Tomascastelazo","subject":"a cyclist pushing a bicycle reflected in a rain puddle, black and white","tags":["bicycle","cyclist","rain","puddle","reflection","street","commute"],"cat":"city","tone":"mid","temp":"neutral","people":"figure","q":3},{"id":"Raleigh lady's loop frame bicycle 1930s.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/f2/Raleigh_lady%27s_loop_frame_bicycle_1930s.jpg","page":"https://commons.wikimedia.org/wiki/File:Raleigh_lady%27s_loop_frame_bicycle_1930s.jpg","w":2858,"h":1801,"color":"#a2a09b","license":"CC BY-SA 4.0","author":"DeFacto","subject":"a vintage black bicycle leaning against a rough stone wall","tags":["bicycle","vintage","bike","stone","wall","cycling"],"cat":"object","tone":"light","temp":"neutral","people":"none","q":3},{"id":"Rusty rebar nets.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/8/85/Rusty_rebar_nets.jpg","page":"https://commons.wikimedia.org/wiki/File:Rusty_rebar_nets.jpg","w":4680,"h":3353,"color":"#6d4323","license":"CC BY-SA 4.0","author":"W.carter","subject":"a stack of rusty steel rebar mesh, close up","tags":["rust","rebar","steel","mesh","texture","industrial"],"cat":"texture","tone":"dark","temp":"warm","people":"none","q":2},{"id":"Very rusty chain in rain 4.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/be/Very_rusty_chain_in_rain_4.jpg","page":"https://commons.wikimedia.org/wiki/File:Very_rusty_chain_in_rain_4.jpg","w":5472,"h":3651,"color":"#604232","license":"CC0","author":"W.carter","subject":"heavy rusted chain links piled in a tangle","tags":["rust","chain","metal","texture","industrial","harbour"],"cat":"texture","tone":"dark","temp":"warm","people":"none","q":3},{"id":"Assortment of rusty pipes 1.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/9e/Assortment_of_rusty_pipes_1.jpg","page":"https://commons.wikimedia.org/wiki/File:Assortment_of_rusty_pipes_1.jpg","w":5311,"h":3276,"color":"#a87d64","license":"CC BY-SA 4.0","author":"W.carter","subject":"a stack of rusty steel pipes seen side on in a yard","tags":["rust","pipes","steel","texture","industrial","metal","orange","stack"],"cat":"texture","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Bookshelf Prunksaal OeNB Vienna AT matl00786ch.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/ec/Bookshelf_Prunksaal_OeNB_Vienna_AT_matl00786ch.jpg","page":"https://commons.wikimedia.org/wiki/File:Bookshelf_Prunksaal_OeNB_Vienna_AT_matl00786ch.jpg","w":3015,"h":2010,"color":"#805430","license":"CC BY-SA 3.0","author":"Matl","subject":"leather bound antique books on a shelf behind a wooden library ladder","tags":["books","antique","leather","library","shelf","ladder"],"cat":"interior","tone":"mid","temp":"warm","people":"none","q":3},{"id":"Handmade historical medieval reconstruction bag 02.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/93/Handmade_historical_medieval_reconstruction_bag_02.jpg","page":"https://commons.wikimedia.org/wiki/File:Handmade_historical_medieval_reconstruction_bag_02.jpg","w":2776,"h":3065,"color":"#97918d","license":"CC BY-SA 4.0","author":"Anastasiya Lvova","subject":"a black leather shoulder bag with a braided strap on white","tags":["bag","leather","shoulder","bag","handmade","accessories"],"cat":"fashion","tone":"light","temp":"neutral","people":"none","q":2},{"id":"Suitcase BW 2025-08-17 14-54-11.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/a/aa/Suitcase_BW_2025-08-17_14-54-11.jpg","page":"https://commons.wikimedia.org/wiki/File:Suitcase_BW_2025-08-17_14-54-11.jpg","w":4000,"h":4000,"color":"#84725c","license":"CC BY-SA 4.0","author":"Berthold Werner","subject":"an open vintage travel case fitted with brushes, jars and a mirror","tags":["suitcase","vanity","case","vintage","travel","grooming"],"cat":"fashion","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Shop ceiling Tezontepec boots 2025.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/a/ac/Shop_ceiling_Tezontepec_boots_2025.jpg","page":"https://commons.wikimedia.org/wiki/File:Shop_ceiling_Tezontepec_boots_2025.jpg","w":5887,"h":3919,"color":"#74543d","license":"CC BY 4.0","author":"Carlos Valenzuela Montuy","subject":"a wall of colourful cowboy boots displayed in a shop","tags":["boots","cowboy","boots","leather","shoe","shop","western"],"cat":"fashion","tone":"mid","temp":"warm","people":"none","q":3},{"id":"Boots of a man.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/2a/Boots_of_a_man.jpg","page":"https://commons.wikimedia.org/wiki/File:Boots_of_a_man.jpg","w":3953,"h":3395,"color":"#888684","license":"CC0","author":"W.carter","subject":"worn hiking boots and jeans on a pale wooden deck","tags":["hiking","boots","outdoor","footwear","walking","jeans"],"cat":"fashion","tone":"light","temp":"neutral","people":"figure","q":2},{"id":"Mens' ballroom shoes, Eurodance CZ.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/d/d3/Mens%27_ballroom_shoes%2C_Eurodance_CZ.jpg","page":"https://commons.wikimedia.org/wiki/File:Mens%27_ballroom_shoes,_Eurodance_CZ.jpg","w":3070,"h":2046,"color":"#b0b0ad","license":"Public domain","author":"Martin Kozák","subject":"a pair of black leather lace up shoes on white","tags":["shoes","leather","oxford","formal","footwear","black","wedding","menswear","product"],"cat":"fashion","tone":"light","temp":"neutral","people":"none","q":2},{"id":"Red marble quarry Cava Buscada - Erto e Casso, Pordenone, Friuli-Venezia Giulia, Italy - 2021-09-27.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/94/Red_marble_quarry_Cava_Buscada_-_Erto_e_Casso%2C_Pordenone%2C_Friuli-Venezia_Giulia%2C_Italy_-_2021-09-27.jpg","page":"https://commons.wikimedia.org/wiki/File:Red_marble_quarry_Cava_Buscada_-_Erto_e_Casso,_Pordenone,_Friuli-Venezia_Giulia,_Italy_-_2021-09-27.jpg","w":3951,"h":2963,"color":"#ae9997","license":"CC BY-SA 4.0","author":"Mænsard vokser","subject":"a cut face of red marble with dark streaks in a quarry","tags":["marble","stone","quarry","texture","red","rock"],"cat":"texture","tone":"mid","temp":"warm","people":"none","q":3},{"id":"Stone wall old farm Dordogne.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/c/cd/Stone_wall_old_farm_Dordogne.jpg","page":"https://commons.wikimedia.org/wiki/File:Stone_wall_old_farm_Dordogne.jpg","w":4173,"h":2750,"color":"#7f7669","license":"CC0","author":"Jebulon","subject":"a wall of rounded flint and stone cobbles, close up","tags":["stone","wall","flint","cobbles","texture","masonry"],"cat":"texture","tone":"mid","temp":"neutral","people":"none","q":2},{"id":"Duisburg, Landschaftspark Duisburg-Nord -- 2020 -- 7834.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/0/03/Duisburg%2C_Landschaftspark_Duisburg-Nord_--_2020_--_7834.jpg","page":"https://commons.wikimedia.org/wiki/File:Duisburg,_Landschaftspark_Duisburg-Nord_--_2020_--_7834.jpg","w":6526,"h":4351,"color":"#8c786d","license":"CC BY-SA 4.0","author":"Dietmar Rabich","subject":"a crumbling concrete wall with exposed aggregate and rusty rebar","tags":["concrete","wall","texture","decay","rebar","industrial","urban","grit"],"cat":"texture","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Dörfleins Töpferei Döppmann-20190714-RM-194552.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/95/D%C3%B6rfleins_T%C3%B6pferei_D%C3%B6ppmann-20190714-RM-194552.jpg","page":"https://commons.wikimedia.org/wiki/File:D%C3%B6rfleins_T%C3%B6pferei_D%C3%B6ppmann-20190714-RM-194552.jpg","w":5111,"h":3241,"color":"#817569","license":"CC BY-SA 4.0","author":"Ermell","subject":"handmade clay teapots displayed in a white grid of shelves","tags":["teapots","ceramics","pottery","shelves","tea","shop"],"cat":"object","tone":"light","temp":"warm","people":"none","q":2},{"id":"Keramik Vase BW 2026-04-04 18-45-36.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/a/a9/Keramik_Vase_BW_2026-04-04_18-45-36.jpg","page":"https://commons.wikimedia.org/wiki/File:Keramik_Vase_BW_2026-04-04_18-45-36.jpg","w":4000,"h":6016,"color":"#928e80","license":"CC BY-SA 4.0","author":"Berthold Werner","subject":"a cream ceramic vase painted with a sunflower on a wooden table","tags":["vase","ceramic","sunflower","pottery","home","decor"],"cat":"object","tone":"light","temp":"warm","people":"none","q":2},{"id":"Steinway grand piano - pedals.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/d/da/Steinway_grand_piano_-_pedals.jpg","page":"https://commons.wikimedia.org/wiki/File:Steinway_grand_piano_-_pedals.jpg","w":2310,"h":1828,"color":"#6b6b67","license":"CC0","author":"Fanoftheworld","subject":"three brass piano pedals under a black lacquered piano","tags":["piano","pedals","brass","instrument","music","concert","lesson","black"],"cat":"object","tone":"mid","temp":"neutral","people":"none","q":2},{"id":"Photographic lenses and tubes 2025.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/97/Photographic_lenses_and_tubes_2025.jpg","page":"https://commons.wikimedia.org/wiki/File:Photographic_lenses_and_tubes_2025.jpg","w":6056,"h":3900,"color":"#504e49","license":"CC BY 4.0","author":"Carlos Valenzuela Montuy","subject":"a row of camera lenses standing on a dark wooden shelf","tags":["camera","lenses","photography","gear","studio","photographer","equipment","shelf"],"cat":"object","tone":"dark","temp":"neutral","people":"none","q":2},{"id":"Dülmen, Hausdülmen, Zaun einer Wiese -- 2021 -- 5083.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/1/16/D%C3%BClmen%2C_Hausd%C3%BClmen%2C_Zaun_einer_Wiese_--_2021_--_5083.jpg","page":"https://commons.wikimedia.org/wiki/File:D%C3%BClmen,_Hausd%C3%BClmen,_Zaun_einer_Wiese_--_2021_--_5083.jpg","w":6687,"h":4458,"color":"#a1938e","license":"CC BY-SA 4.0","author":"Dietmar Rabich","subject":"frost crystals growing on barbed wire against a sunrise sky","tags":["frost","ice","crystals","wire","winter","sunrise"],"cat":"nature","tone":"mid","temp":"warm","people":"none","q":3},{"id":"Great Sand Dunes NP 1.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/c/cf/Great_Sand_Dunes_NP_1.jpg","page":"https://commons.wikimedia.org/wiki/File:Great_Sand_Dunes_NP_1.jpg","w":4368,"h":2912,"color":"#8f9199","license":"CC BY-SA 3.0","author":"Daniel Schwen","subject":"a lone figure climbing a steep sand dune under a blue sky","tags":["sand","dune","desert","climb","adventure","travel","blue","sky","solitude"],"cat":"landscape","tone":"light","temp":"warm","people":"figure","q":3,"fp":[0.6,0.25]},{"id":"Embroidery on a cashmere shawl 05.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/d/d8/Embroidery_on_a_cashmere_shawl_05.jpg","page":"https://commons.wikimedia.org/wiki/File:Embroidery_on_a_cashmere_shawl_05.jpg","w":4787,"h":3192,"color":"#6f281e","license":"CC BY-SA 4.0","author":"Kritzolina","subject":"red floral embroidery on a black cashmere shawl, close up","tags":["embroidery","textile","shawl","floral","fabric","kashmir","needlework","pattern","red"],"cat":"texture","tone":"dark","temp":"warm","people":"none","q":3},{"id":"Lavoro a nodi su maglione, fatto ai ferri.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/7d/Lavoro_a_nodi_su_maglione%2C_fatto_ai_ferri.jpg","page":"https://commons.wikimedia.org/wiki/File:Lavoro_a_nodi_su_maglione,_fatto_ai_ferri.jpg","w":1923,"h":2048,"color":"#892d42","license":"CC BY-SA 4.0","author":"PROPOLI87","subject":"close up of a magenta cable knit wool fabric","tags":["knit","wool","cable","knit","texture","textile"],"cat":"texture","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Nadeln 002 2026 08 07.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/9a/Nadeln_002_2026_08_07.jpg","page":"https://commons.wikimedia.org/wiki/File:Nadeln_002_2026_08_07.jpg","w":6021,"h":3309,"color":"#4e363b","license":"CC BY-SA 4.0","author":"Friedrich Haag","subject":"two balls of pink and cream yarn with knitting on circular needles on black","tags":["yarn","knitting","wool","needles","craft","hobby","handmade","pink"],"cat":"craft","tone":"dark","temp":"warm","people":"none","q":2},{"id":"2008-07-27 Sunglasses.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/9d/2008-07-27_Sunglasses.jpg","page":"https://commons.wikimedia.org/wiki/File:2008-07-27_Sunglasses.jpg","w":3888,"h":2592,"color":"#59674b","license":"CC BY-SA 4.0","author":"Ildar Sagdejev (Specious)","subject":"black sunglasses resting on a grey rock against green foliage","tags":["sunglasses","eyewear","summer","outdoor","optician","accessories","rock"],"cat":"fashion","tone":"mid","temp":"cool","people":"none","q":2},{"id":"Longines 4 Grand Prix pocket watch - clockwork visible - enhanced resolution DSF3402-PSMS.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/4c/Longines_4_Grand_Prix_pocket_watch_-_clockwork_visible_-_enhanced_resolution_DSF3402-PSMS.jpg","page":"https://commons.wikimedia.org/wiki/File:Longines_4_Grand_Prix_pocket_watch_-_clockwork_visible_-_enhanced_resolution_DSF3402-PSMS.jpg","w":5304,"h":5304,"color":"#aaa794","license":"CC BY-SA 4.0","author":"Franz van Duns","subject":"an open antique pocket watch showing its brass movement","tags":["pocket","watch","movement","antique","time","watchmaker"],"cat":"object","tone":"light","temp":"warm","people":"none","q":2},{"id":"DIY means choosing the right tool for the purpose - a watchmaker's nightmare.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/0/0a/DIY_means_choosing_the_right_tool_for_the_purpose_-_a_watchmaker%27s_nightmare.jpg","page":"https://commons.wikimedia.org/wiki/File:DIY_means_choosing_the_right_tool_for_the_purpose_-_a_watchmaker%27s_nightmare.jpg","w":9504,"h":6336,"color":"#d1cdcf","license":"CC BY-SA 4.0","author":"Franz van Duns","subject":"hand tools arranged in a circle on white: hammer, pliers, wrenches, screwdrivers","tags":["hand","tools","hammer","pliers","wrenches","screwdrivers","diy"],"cat":"object","tone":"light","temp":"neutral","people":"none","q":2},{"id":"2020.05.30 Vintage Embroidered Hangers from Germany.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/6/6b/2020.05.30_Vintage_Embroidered_Hangers_from_Germany.jpg","page":"https://commons.wikimedia.org/wiki/File:2020.05.30_Vintage_Embroidered_Hangers_from_Germany.jpg","w":2992,"h":2992,"color":"#36312c","license":"CC BY-SA 4.0","author":"Tess Mattew","subject":"three hand-embroidered floral clothes hangers on dark green fabric","tags":["clothes","hangers","embroidery","vintage","wardrobe","boutique","floral"],"cat":"fashion","tone":"dark","temp":"warm","people":"none","q":2},{"id":"Wooden coat hangers.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/b8/Wooden_coat_hangers.jpg","page":"https://commons.wikimedia.org/wiki/File:Wooden_coat_hangers.jpg","w":2992,"h":3095,"color":"#baa288","license":"CC BY-SA 4.0","author":"Mike Peel","subject":"a stack of wooden clothes hangers on a light wood shelf","tags":["hangers","wooden","wardrobe","boutique","clothing","shop","minimal"],"cat":"fashion","tone":"light","temp":"warm","people":"none","q":2},{"id":"Canopy bed and wardrobes in Khan Pool Suite at Amantaka luxury Resort & Hotel in Luang Prabang Laos.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/f5/Canopy_bed_and_wardrobes_in_Khan_Pool_Suite_at_Amantaka_luxury_Resort_%26_Hotel_in_Luang_Prabang_Laos.jpg","page":"https://commons.wikimedia.org/wiki/File:Canopy_bed_and_wardrobes_in_Khan_Pool_Suite_at_Amantaka_luxury_Resort_%26_Hotel_in_Luang_Prabang_Laos.jpg","w":5833,"h":3889,"color":"#9d7457","license":"CC BY-SA 4.0","author":"Basile Morin","subject":"two wooden wardrobes framing a doorway to a canopy bed","tags":["wardrobes","furniture","bedroom","hotel","wood","interior","boutique","hotel"],"cat":"interior","tone":"light","temp":"warm","people":"none","q":2},{"id":"2023 Wkrętak elektryczny Xiaomi.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/0/04/2023_Wkr%C4%99tak_elektryczny_Xiaomi.jpg","page":"https://commons.wikimedia.org/wiki/File:2023_Wkr%C4%99tak_elektryczny_Xiaomi.jpg","w":5096,"h":3099,"color":"#b7babc","license":"CC BY-SA 4.0","author":"Jacek Halicki","subject":"a slim electric precision screwdriver and bit case on white","tags":["screwdriver","precision","tools","electronics","repair","gadget","product"],"cat":"tech","tone":"light","temp":"neutral","people":"none","q":2},{"id":"Papierkanten -- 2020 -- 9535.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/ee/Papierkanten_--_2020_--_9535.jpg","page":"https://commons.wikimedia.org/wiki/File:Papierkanten_--_2020_--_9535.jpg","w":5973,"h":4480,"color":"#295b4f","license":"CC BY-SA 4.0","author":"Dietmar Rabich","subject":"curved edges of teal paper sheets glowing in dark light","tags":["paper","edges","curves","abstract","texture","teal","background"],"cat":"abstract","tone":"dark","temp":"cool","people":"none","q":3},{"id":"Optical caustic Cosmetic oil bottle in the sun mj.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/99/Optical_caustic_Cosmetic_oil_bottle_in_the_sun_mj.jpg","page":"https://commons.wikimedia.org/wiki/File:Optical_caustic_Cosmetic_oil_bottle_in_the_sun_mj.jpg","w":3672,"h":2752,"color":"#93610f","license":"CC BY 4.0","author":"Mariojan photo","subject":"golden light caustics cast by a bottle of oil in the sun","tags":["oil","bottle","caustics","light","abstract","golden"],"cat":"abstract","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Woman taking a dropper of CBD oil.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/8/81/Woman_taking_a_dropper_of_CBD_oil.jpg","page":"https://commons.wikimedia.org/wiki/File:Woman_taking_a_dropper_of_CBD_oil.jpg","w":6000,"h":4000,"color":"#81726e","license":"CC BY 2.0","author":"elsaolofsson","subject":"a hand squeezing a glass dropper over a small amber bottle","tags":["dropper","bottle","serum","oil","skincare","wellness"],"cat":"health","tone":"mid","temp":"warm","people":"hands","q":2},{"id":"Eyeglasses (AM 71518-7).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/3/37/Eyeglasses_%28AM_71518-7%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Eyeglasses_(AM_71518-7).jpg","w":8688,"h":5792,"color":"#f2f1f1","license":"CC BY 4.0","author":"Unknown","subject":"round gold-rimmed eyeglasses on a white background","tags":["eyeglasses","spectacles","optician","frames","gold","round","product"],"cat":"fashion","tone":"light","temp":"neutral","people":"none","q":2},{"id":"Reading glasses.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/b2/Reading_glasses.jpg","page":"https://commons.wikimedia.org/wiki/File:Reading_glasses.jpg","w":1863,"h":1401,"color":"#b2b1a2","license":"Public domain","author":"Dori","subject":"black framed glasses on a blue table against a blurred window","tags":["eyeglasses","spectacles","reading","desk","optician","frames","blue"],"cat":"object","tone":"mid","temp":"cool","people":"none","q":2},{"id":"Old Books 01.JPG","file":"https://upload.wikimedia.org/wikipedia/commons/c/ca/Old_Books_01.JPG","page":"https://commons.wikimedia.org/wiki/File:Old_Books_01.JPG","w":2400,"h":2466,"color":"#b39b85","license":"CC0","author":"Ch. Maderthoner","subject":"four antique leather bound books stacked on a white surface","tags":["books","antique","stack","leather","old","library","history"],"cat":"object","tone":"light","temp":"warm","people":"none","q":2},{"id":"Perfume glass bottle.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/79/Perfume_glass_bottle.jpg","page":"https://commons.wikimedia.org/wiki/File:Perfume_glass_bottle.jpg","w":3648,"h":2736,"color":"#b8bec3","license":"CC BY-SA 4.0","author":"Santeri Viinamäki","subject":"a ribbed glass perfume bottle with a black cap on a pale wood shelf","tags":["perfume","bottle","glass","fragrance","scent","minimal","beauty","shelf"],"cat":"object","tone":"light","temp":"cool","people":"none","q":2},{"id":"Taartschep Gero Zilmeta 05.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/1/1c/Taartschep_Gero_Zilmeta_05.jpg","page":"https://commons.wikimedia.org/wiki/File:Taartschep_Gero_Zilmeta_05.jpg","w":5184,"h":3456,"color":"#dad8d7","license":"CC BY-SA 3.0","author":"Coyau","subject":"a curved silver cake server lying on a plain white background","tags":["cake","server","silver","cutlery","tableware","bakery","serving","product"],"cat":"object","tone":"light","temp":"neutral","people":"none","q":2},{"id":"2006-01-14 Surface waves.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/43/2006-01-14_Surface_waves.jpg","page":"https://commons.wikimedia.org/wiki/File:2006-01-14_Surface_waves.jpg","w":1920,"h":1320,"color":"#868a90","license":"CC BY-SA 3.0","author":"Roger McLassus","subject":"concentric ripples spreading across a grey water surface, close up","tags":["water","ripples","surface","calm","liquid","spa","minimal","grey"],"cat":"texture","tone":"mid","temp":"cool","people":"none","q":2},{"id":"Laptop-hard-drive-exposed.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/f8/Laptop-hard-drive-exposed.jpg","page":"https://commons.wikimedia.org/wiki/File:Laptop-hard-drive-exposed.jpg","w":4600,"h":3520,"color":"#c9c7c2","license":"CC BY-SA 3.0","author":"Evan-Amos","subject":"open laptop hard drive showing its platter and read arm on a white ground","tags":["hard drive","storage","data","disk","hardware","computer","repair","tech","backup","product still"],"cat":"tech","tone":"light","temp":"neutral","people":"none","q":2},{"id":"CanoScan 5600F main PCB top view.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/e1/CanoScan_5600F_main_PCB_top_view.jpg","page":"https://commons.wikimedia.org/wiki/File:CanoScan_5600F_main_PCB_top_view.jpg","w":6330,"h":4620,"color":"#72a58a","license":"CC BY-SA 4.0","author":"Mister rf","subject":"green printed circuit board with chips and capacitors seen flat from above","tags":["circuit board","pcb","electronics","chips","hardware","engineering","components","tech","green"],"cat":"tech","tone":"mid","temp":"cool","people":"none","q":2},{"id":"2026-03-07 D500-2006 Achim-Lammerts Juglans-regia.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/f5/2026-03-07_D500-2006_Achim-Lammerts_Juglans-regia.jpg","page":"https://commons.wikimedia.org/wiki/File:2026-03-07_D500-2006_Achim-Lammerts_Juglans-regia.jpg","w":5400,"h":3600,"color":"#839c9d","license":"CC BY-SA 4.0","author":"Achim Lammerts (Syntaxys)","subject":"a lone wind turbine and a bare walnut tree on a green field under pale blue sky","tags":["wind turbine","renewable","energy","green energy","field","tree","minimal","sustainability","climate","countryside"],"cat":"landscape","tone":"light","temp":"cool","people":"none","q":3},{"id":"Silicon chip from a computer laser mouse under a microscope 50х.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/5/55/Silicon_chip_from_a_computer_laser_mouse_under_a_microscope_50%D1%85.jpg","page":"https://commons.wikimedia.org/wiki/File:Silicon_chip_from_a_computer_laser_mouse_under_a_microscope_50%D1%85.jpg","w":5384,"h":3580,"color":"#a7865f","license":"CC BY-SA 4.0","author":"Alexander Klepnev","subject":"colourful microscope view of a silicon chip surface, gold, violet and teal traces","tags":["microchip","silicon","semiconductor","micrograph","circuit","chip design","engineering","abstract","tech","pattern"],"cat":"tech","tone":"mid","temp":"warm","people":"none","q":3},{"id":"2016 Operator kamery w czasie pracy.JPG","file":"https://upload.wikimedia.org/wikipedia/commons/8/81/2016_Operator_kamery_w_czasie_pracy.JPG","page":"https://commons.wikimedia.org/wiki/File:2016_Operator_kamery_w_czasie_pracy.JPG","w":3355,"h":2704,"color":"#939192","license":"CC BY-SA 4.0","author":"Jacek Halicki","subject":"a cameraman in a beanie filming with a shoulder camera on a tripod outdoors","tags":["camera operator","cameraman","film crew","video","production","filming","broadcast","tripod","media"],"cat":"work","tone":"mid","temp":"cool","people":"figure","q":2,"fp":[0.5,0.4]},{"id":"Phipps Conservatory 24.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/b4/Phipps_Conservatory_24.jpg","page":"https://commons.wikimedia.org/wiki/File:Phipps_Conservatory_24.jpg","w":7360,"h":4912,"color":"#797166","license":"CC BY-SA 4.0","author":"Dllu","subject":"a solar panel array angled towards a soft sunset sky above a garden","tags":["solar panels","solar","sunset","renewable","energy","clean energy","garden","sustainability","photovoltaic"],"cat":"tech","tone":"mid","temp":"warm","people":"none","q":3,"fp":[0.6,0.55]},{"id":"Barrow Offshore wind turbines NR.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/a/a7/Barrow_Offshore_wind_turbines_NR.jpg","page":"https://commons.wikimedia.org/wiki/File:Barrow_Offshore_wind_turbines_NR.jpg","w":3206,"h":2365,"color":"#6586a6","license":"CC BY-SA 3.0","author":"Andy Dingley","subject":"offshore wind turbines standing in a calm hazy blue sea","tags":["offshore wind","wind turbines","wind farm","sea","renewable","energy","calm","blue","minimal","climate"],"cat":"tech","tone":"light","temp":"cool","people":"none","q":3},{"id":"Power County Wind Farm 002.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/5/54/Power_County_Wind_Farm_002.jpg","page":"https://commons.wikimedia.org/wiki/File:Power_County_Wind_Farm_002.jpg","w":1920,"h":1349,"color":"#6a685e","license":"Public domain","author":"ENERGY.GOV","subject":"wind turbines scattered across golden rolling hills with snowy peaks behind","tags":["wind farm","wind turbines","hills","landscape","renewable","energy","utility","golden","countryside"],"cat":"landscape","tone":"mid","temp":"warm","people":"none","q":3},{"id":"Focused Discoveries.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/24/Focused_Discoveries.jpg","page":"https://commons.wikimedia.org/wiki/File:Focused_Discoveries.jpg","w":5304,"h":7952,"color":"#95958a","license":"CC BY 4.0","author":"Sagar Shetty98","subject":"a scientist in a white lab coat leaning over a microscope in a bright laboratory","tags":["laboratory","scientist","microscope","research","lab coat","biotech","science","health","clinic"],"cat":"science","tone":"light","temp":"cool","people":"figure","q":2,"fp":[0.55,0.45]},{"id":"Microscope \"Nachet et Fils\".jpg","file":"https://upload.wikimedia.org/wikipedia/commons/0/0f/Microscope_%22Nachet_et_Fils%22.jpg","page":"https://commons.wikimedia.org/wiki/File:Microscope_%22Nachet_et_Fils%22.jpg","w":3056,"h":4592,"color":"#130f0c","license":"CC BY-SA 4.0","author":"Didier Descouens","subject":"a polished brass antique microscope standing alone on a black background","tags":["microscope","brass","antique","science","laboratory","optics","instrument","dark","product still"],"cat":"science","tone":"dark","temp":"warm","people":"none","q":3},{"id":"Manganelli Siena.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/a/a7/Manganelli_Siena.jpg","page":"https://commons.wikimedia.org/wiki/File:Manganelli_Siena.jpg","w":2848,"h":4288,"color":"#6d534b","license":"Public domain","author":"H005","subject":"an old pharmacy doorway with arched iron grille and lit shelves of jars inside","tags":["pharmacy","apothecary","shopfront","door","old town","jars","chemist","italy","heritage","health"],"cat":"architecture","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Krankenhaus 002 2015 03 24.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/2a/Krankenhaus_002_2015_03_24.jpg","page":"https://commons.wikimedia.org/wiki/File:Krankenhaus_002_2015_03_24.jpg","w":3444,"h":2894,"color":"#626359","license":"CC BY-SA 4.0","author":"Friedrich Haag","subject":"a long clean hospital corridor with yellow handrails and polished floor","tags":["hospital","corridor","clinic","healthcare","ward","medical","interior","perspective","nursing"],"cat":"health","tone":"light","temp":"cool","people":"none","q":2},{"id":"Covid-19 San Salvatore 09.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/9c/Covid-19_San_Salvatore_09.jpg","page":"https://commons.wikimedia.org/wiki/File:Covid-19_San_Salvatore_09.jpg","w":3976,"h":2652,"color":"#a8a396","license":"CC BY-SA 4.0","author":"Alberto Giuliani","subject":"a masked health worker in blue scrubs sitting on a hospital corridor floor","tags":["hospital","corridor","nurse","healthcare","doctor","scrubs","pandemic","medical","fatigue","care"],"cat":"health","tone":"light","temp":"cool","people":"figure","q":2,"fp":[0.6,0.65]},{"id":"Paddleboard yoga.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/fe/Paddleboard_yoga.jpg","page":"https://commons.wikimedia.org/wiki/File:Paddleboard_yoga.jpg","w":4600,"h":3270,"color":"#92a2b0","license":"CC BY-SA 4.0","author":"kallerna","subject":"a silhouetted figure in a headstand on a paddleboard on a calm lake","tags":["yoga","paddleboard","balance","lake","wellness","headstand","retreat","fitness","calm","silhouette"],"cat":"sport","tone":"light","temp":"cool","people":"figure","q":3,"fp":[0.4,0.55]},{"id":"Human running gait - terminal swing to heel strike (runner with Asics Metaspeed Edge Paris - 2024 Ljubljana Marathon).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/99/Human_running_gait_-_terminal_swing_to_heel_strike_%28runner_with_Asics_Metaspeed_Edge_Paris_-_2024_Ljubljana_Marathon%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Human_running_gait_-_terminal_swing_to_heel_strike_(runner_with_Asics_Metaspeed_Edge_Paris_-_2024_Ljubljana_Marathon).jpg","w":4512,"h":2960,"color":"#393833","license":"CC BY-SA 4.0","author":"Petar Milošević","subject":"a runner's legs in blue socks and bright shoes mid stride on dark asphalt","tags":["running","runner","marathon","legs","shoes","stride","fitness","road race","athletics","training"],"cat":"sport","tone":"dark","temp":"cool","people":"figure","q":3,"fp":[0.45,0.6]},{"id":"Mountain biking.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/2e/Mountain_biking.jpg","page":"https://commons.wikimedia.org/wiki/File:Mountain_biking.jpg","w":1938,"h":2913,"color":"#6a795b","license":"CC BY-SA 3.0","author":"Petar Milošević","subject":"a mountain bike lying in green alpine grass below pines and peaks","tags":["mountain bike","cycling","bike","alps","trail","outdoors","adventure","meadow","portrait"],"cat":"sport","tone":"mid","temp":"cool","people":"none","q":2,"fp":[0.5,0.75]},{"id":"Ski resort, Soelden (P1032614).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/7a/Ski_resort%2C_Soelden_%28P1032614%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Ski_resort,_Soelden_(P1032614).jpg","w":2864,"h":2148,"color":"#b2b1b0","license":"CC BY-SA 4.0","author":"Matti Blume","subject":"a skier in black carving a turn on a wide groomed slope seen from above","tags":["skiing","skier","piste","snow","winter","ski resort","alps","carving","mountain"],"cat":"sport","tone":"light","temp":"cool","people":"figure","q":3,"fp":[0.42,0.5]},{"id":"Skiing in Oberhof March 2013-12-Ski track.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/a/aa/Skiing_in_Oberhof_March_2013-12-Ski_track.jpg","page":"https://commons.wikimedia.org/wiki/File:Skiing_in_Oberhof_March_2013-12-Ski_track.jpg","w":3162,"h":4754,"color":"#7c8a9d","license":"CC BY-SA 3.0","author":"Ximeg","subject":"cross country ski tracks running between snowy fir trees under blue sky","tags":["cross country skiing","ski track","snow","winter","forest","nordic","trail","cold","portrait"],"cat":"sport","tone":"light","temp":"cool","people":"none","q":2},{"id":"Flo dans Juvsøyla à Rjukan, Norvège-rotated.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/72/Flo_dans_Juvs%C3%B8yla_%C3%A0_Rjukan%2C_Norv%C3%A8ge-rotated.jpg","page":"https://commons.wikimedia.org/wiki/File:Flo_dans_Juvs%C3%B8yla_%C3%A0_Rjukan,_Norv%C3%A8ge-rotated.jpg","w":2048,"h":1536,"color":"#b4b6bd","license":"CC BY-SA 3.0","author":"Valentin Chapuis","subject":"an ice climber in pink gripping axes on a frozen waterfall wall","tags":["ice climbing","climbing","climber","ice","winter","adventure","mountaineering","rope","norway"],"cat":"sport","tone":"light","temp":"cool","people":"figure","q":2,"fp":[0.4,0.4]},{"id":"Crack climbing in Indian Creek, Utah.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/1/19/Crack_climbing_in_Indian_Creek%2C_Utah.jpg","page":"https://commons.wikimedia.org/wiki/File:Crack_climbing_in_Indian_Creek,_Utah.jpg","w":2000,"h":3008,"color":"#86565c","license":"CC BY 2.0","author":"Crystal","subject":"a small climber ascending a crack in a sheer red sandstone wall","tags":["rock climbing","climbing","climber","desert","sandstone","adventure","utah","outdoors","portrait"],"cat":"sport","tone":"mid","temp":"warm","people":"figure","q":3,"fp":[0.6,0.45]},{"id":"Mountaineers in High Tatry mountains winter.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/a/a2/Mountaineers_in_High_Tatry_mountains_winter.jpg","page":"https://commons.wikimedia.org/wiki/File:Mountaineers_in_High_Tatry_mountains_winter.jpg","w":2048,"h":1536,"color":"#778393","license":"CC BY-SA 3.0","author":"Wikimol","subject":"two mountaineers climbing a steep snow gully under a deep blue sky","tags":["mountaineering","climbing","snow","winter","alpine","hiking","adventure","expedition","mountains"],"cat":"sport","tone":"light","temp":"cool","people":"figure","q":2,"fp":[0.55,0.7]},{"id":"Richèl Hogenkamp - Masters de Madrid 2015 - 11.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/a/ab/Rich%C3%A8l_Hogenkamp_-_Masters_de_Madrid_2015_-_11.jpg","page":"https://commons.wikimedia.org/wiki/File:Rich%C3%A8l_Hogenkamp_-_Masters_de_Madrid_2015_-_11.jpg","w":3888,"h":2592,"color":"#d57a43","license":"CC BY-SA 4.0","author":"Carlos Delgado","subject":"a tennis player stretching for a backhand on an orange clay court","tags":["tennis","clay court","player","racket","backhand","match","sport club","athlete"],"cat":"sport","tone":"mid","temp":"warm","people":"figure","q":2,"fp":[0.55,0.45]},{"id":"Hiking Parumba, half-winter half-autumn, November 2020 01.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/1/15/Hiking_Parumba%2C_half-winter_half-autumn%2C_November_2020_01.jpg","page":"https://commons.wikimedia.org/wiki/File:Hiking_Parumba,_half-winter_half-autumn,_November_2020_01.jpg","w":3655,"h":5482,"color":"#5e799e","license":"CC BY-SA 4.0","author":"Liridon","subject":"two tiny hikers on a frosty ridge against a clear blue sky","tags":["hiking","hikers","ridge","mountain","frost","adventure","trekking","outdoors","portrait"],"cat":"sport","tone":"light","temp":"cool","people":"figure","q":2,"fp":[0.62,0.35]},{"id":"Children playing in the rice mill (edited).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/4a/Children_playing_in_the_rice_mill_%28edited%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Children_playing_in_the_rice_mill_(edited).jpg","w":8192,"h":5464,"color":"#8c8581","license":"CC BY-SA 4.0","author":"Azimronnie","subject":"two children rolling bicycle wheels between conical rice heaps from above","tags":["children","play","kids","wheels","rice","childhood","community","charity","village","pattern"],"cat":"family","tone":"mid","temp":"neutral","people":"figure","q":3},{"id":"Playing in the Nuba mountains.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/77/Playing_in_the_Nuba_mountains.jpg","page":"https://commons.wikimedia.org/wiki/File:Playing_in_the_Nuba_mountains.jpg","w":3000,"h":2000,"color":"#715f4c","license":"CC BY-SA 4.0","author":"Marco Gualazzini","subject":"children playing football at golden hour under the wreck of an old plane","tags":["children","football","play","golden hour","village","childhood","charity","africa","community","sunset"],"cat":"family","tone":"mid","temp":"warm","people":"figure","q":3},{"id":"ASUS ROG Strix G15 (G513QY-HQ012T)-top keyboard WASD PNr°0888.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/1/14/ASUS_ROG_Strix_G15_%28G513QY-HQ012T%29-top_keyboard_WASD_PNr%C2%B00888.jpg","page":"https://commons.wikimedia.org/wiki/File:ASUS_ROG_Strix_G15_(G513QY-HQ012T)-top_keyboard_WASD_PNr%C2%B00888.jpg","w":3216,"h":2173,"color":"#727275","license":"CC BY-SA 4.0","author":"D-Kuru","subject":"macro of translucent backlit keycaps on a dark keyboard","tags":["keyboard","keys","gaming","macro","computer","tech","esports","dark","close up"],"cat":"tech","tone":"dark","temp":"neutral","people":"none","q":2},{"id":"Panasonic, IFA 2018, Berlin (P1070144).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/95/Panasonic%2C_IFA_2018%2C_Berlin_%28P1070144%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Panasonic,_IFA_2018,_Berlin_(P1070144).jpg","w":2863,"h":3817,"color":"#767982","license":"CC BY-SA 4.0","author":"Matti Blume","subject":"black over-ear headphones hanging on a metal stand against a soft blurred room","tags":["headphones","audio","music","listening","studio","sound","podcast","electronics","portrait"],"cat":"tech","tone":"mid","temp":"cool","people":"none","q":2},{"id":"Girl listening to music with a smartphone.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/0/06/Girl_listening_to_music_with_a_smartphone.jpg","page":"https://commons.wikimedia.org/wiki/File:Girl_listening_to_music_with_a_smartphone.jpg","w":4000,"h":2978,"color":"#997141","license":"CC BY-SA 4.0","author":"Jerónimo Roure","subject":"a woman with earphones walking past an ochre wall while looking at her phone","tags":["smartphone","phone","music","earphones","walking","street","app","mobile","lifestyle","listening"],"cat":"tech","tone":"mid","temp":"warm","people":"figure","q":3,"fp":[0.55,0.5]},{"id":"Woman sitting near the Cais das Colunas and using her smartphone, Praça do Comércio, Lisbon, Portugal julesvernex2.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/a/ac/Woman_sitting_near_the_Cais_das_Colunas_and_using_her_smartphone%2C_Pra%C3%A7a_do_Com%C3%A9rcio%2C_Lisbon%2C_Portugal_julesvernex2.jpg","page":"https://commons.wikimedia.org/wiki/File:Woman_sitting_near_the_Cais_das_Colunas_and_using_her_smartphone,_Pra%C3%A7a_do_Com%C3%A9rcio,_Lisbon,_Portugal_julesvernex2.jpg","w":8316,"h":5394,"color":"#d5d3d1","license":"CC BY-SA 4.0","author":"Jules Verne Times Two","subject":"a lone person sitting on a stone sea wall using a phone under a white sky","tags":["smartphone","phone","alone","waterfront","minimal","mobile","calm","lisbon","app","sea"],"cat":"tech","tone":"light","temp":"neutral","people":"figure","q":2,"fp":[0.37,0.72]},{"id":"Solar power, Nieder-Olm (P1090617).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/b0/Solar_power%2C_Nieder-Olm_%28P1090617%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Solar_power,_Nieder-Olm_(P1090617).jpg","w":4608,"h":3456,"color":"#605f2f","license":"CC BY-SA 4.0","author":"Matti Blume","subject":"aerial view of a farmstead with solar roofs between green and golden fields","tags":["solar panels","solar","aerial","farm","fields","renewable","energy","agriculture","countryside"],"cat":"tech","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Vierwies wind farm, seen from a hot air balloon, Zele, 2026.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/a/a4/Vierwies_wind_farm%2C_seen_from_a_hot_air_balloon%2C_Zele%2C_2026.jpg","page":"https://commons.wikimedia.org/wiki/File:Vierwies_wind_farm,_seen_from_a_hot_air_balloon,_Zele,_2026.jpg","w":2662,"h":3992,"color":"#767876","license":"CC0","author":"DimiTalen","subject":"three wind turbines rising over hazy morning farmland seen from the air","tags":["wind turbines","wind farm","aerial","morning","haze","farmland","renewable","energy","portrait"],"cat":"tech","tone":"mid","temp":"warm","people":"none","q":3},{"id":"A surfer at the wave edit.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/d/d3/A_surfer_at_the_wave_edit.jpg","page":"https://commons.wikimedia.org/wiki/File:A_surfer_at_the_wave_edit.jpg","w":2047,"h":1667,"color":"#6a6b6a","license":"CC BY-SA 3.0","author":"Brocken Inaglory edit by user:Kallerna","subject":"a surfer cutting across a dark wave lit gold by late sun and spray","tags":["surfing","surfer","wave","golden hour","ocean","spray","action","sea","adventure"],"cat":"sport","tone":"dark","temp":"warm","people":"figure","q":3,"fp":[0.55,0.5]},{"id":"Henry Espinoza Panta smashing a wave at Lobitos.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/0/0f/Henry_Espinoza_Panta_smashing_a_wave_at_Lobitos.jpg","page":"https://commons.wikimedia.org/wiki/File:Henry_Espinoza_Panta_smashing_a_wave_at_Lobitos.jpg","w":6720,"h":4480,"color":"#8f9895","license":"CC BY-SA 4.0","author":"Freddy Sinarahua","subject":"a backlit surfer throwing spray off the lip of a green wave","tags":["surfing","surfer","wave","spray","backlit","ocean","action","peru","beach"],"cat":"sport","tone":"light","temp":"cool","people":"figure","q":2},{"id":"Lift Seceda Gherdëina.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/49/Lift_Seceda_Gherd%C3%ABina.jpg","page":"https://commons.wikimedia.org/wiki/File:Lift_Seceda_Gherd%C3%ABina.jpg","w":6500,"h":4338,"color":"#a2aaaf","license":"CC BY-SA 3.0","author":"This Photo was taken by Wolfgang Moroder. Feel free to use my photos, but please","subject":"a chairlift running down into a sea of cloud below snowy peaks","tags":["chairlift","ski lift","skiing","clouds","alps","winter","ski resort","mountain","snow"],"cat":"sport","tone":"light","temp":"cool","people":"none","q":2},{"id":"A swimmer and coral reefs of the Red Sea.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/fc/A_swimmer_and_coral_reefs_of_the_Red_Sea.jpg","page":"https://commons.wikimedia.org/wiki/File:A_swimmer_and_coral_reefs_of_the_Red_Sea.jpg","w":2110,"h":3200,"color":"#3e637d","license":"CC BY-SA 3.0","author":"kallerna","subject":"a swimmer following a rope across deep blue water above a reef, from above","tags":["swimming","open water","swimmer","sea","reef","blue","snorkel","travel","portrait"],"cat":"sport","tone":"mid","temp":"cool","people":"figure","q":2,"fp":[0.7,0.8]},{"id":"Joshua Tree - Jerry Brown 49.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/42/Joshua_Tree_-_Jerry_Brown_49.jpg","page":"https://commons.wikimedia.org/wiki/File:Joshua_Tree_-_Jerry_Brown_49.jpg","w":3872,"h":2592,"color":"#807877","license":"CC BY-SA 3.0","author":"Jarek Tuszyński","subject":"a climber on a sunlit red rock wall above a boulder strewn canyon","tags":["rock climbing","climbing","climber","desert","cliff","adventure","outdoors","canyon"],"cat":"sport","tone":"mid","temp":"warm","people":"figure","q":2,"fp":[0.65,0.4]},{"id":"Trekking trail of Netravati peak from the summit (Zoomed in).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/f7/Trekking_trail_of_Netravati_peak_from_the_summit_%28Zoomed_in%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Trekking_trail_of_Netravati_peak_from_the_summit_(Zoomed_in).jpg","w":6000,"h":4000,"color":"#b5b38b","license":"CC BY-SA 4.0","author":"iMahesh","subject":"a line of hikers on a red dirt path over a green grassy ridge in mist","tags":["hiking","trekking","hikers","trail","ridge","mist","green","group","adventure"],"cat":"sport","tone":"light","temp":"cool","people":"figure","q":2},{"id":"Forest ranger walking through the trail to Netravati peak.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/8/8e/Forest_ranger_walking_through_the_trail_to_Netravati_peak.jpg","page":"https://commons.wikimedia.org/wiki/File:Forest_ranger_walking_through_the_trail_to_Netravati_peak.jpg","w":4000,"h":6000,"color":"#696a32","license":"CC BY-SA 4.0","author":"iMahesh","subject":"a man walking away down a narrow path through dense green jungle","tags":["hiking","trail","forest","jungle","walking","from behind","outdoors","green","portrait"],"cat":"sport","tone":"mid","temp":"cool","people":"figure","q":2,"fp":[0.45,0.6]},{"id":"Wikimedia Foundation Servers-8055 03 square.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/d/de/Wikimedia_Foundation_Servers-8055_03_square.jpg","page":"https://commons.wikimedia.org/wiki/File:Wikimedia_Foundation_Servers-8055_03_square.jpg","w":3456,"h":3451,"color":"#333232","license":"CC BY-SA 4.0","author":"Victorgrigas","subject":"a dense tangle of blue network cables feeding servers in a dark rack","tags":["server rack","data centre","cables","network","servers","hosting","cloud","it","infrastructure"],"cat":"tech","tone":"dark","temp":"cool","people":"none","q":2},{"id":"Data Center của CMC Telecom (2).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/c/cc/Data_Center_c%E1%BB%A7a_CMC_Telecom_%282%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Data_Center_c%E1%BB%A7a_CMC_Telecom_(2).jpg","w":4928,"h":3280,"color":"#223544","license":"CC BY-SA 4.0","author":"Daoducquan","subject":"two technicians in blue vests working on cabled racks in a data centre","tags":["data centre","technician","engineers","server rack","cables","it support","networking","maintenance","work"],"cat":"work","tone":"dark","temp":"cool","people":"figure","q":2,"fp":[0.3,0.5]},{"id":"Network switches.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/e5/Network_switches.jpg","page":"https://commons.wikimedia.org/wiki/File:Network_switches.jpg","w":3008,"h":2000,"color":"#495555","license":"CC BY-SA 3.0","author":"ShakataGaNai","subject":"close up of blue and grey ethernet cables plugged into switch ports","tags":["ethernet","network cables","switch","networking","ports","data centre","it","connectivity","close up"],"cat":"tech","tone":"mid","temp":"cool","people":"none","q":2},{"id":"ADT Mixing Console.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/d/d5/ADT_Mixing_Console.jpg","page":"https://commons.wikimedia.org/wiki/File:ADT_Mixing_Console.jpg","w":2048,"h":1529,"color":"#6b6e6c","license":"CC BY-SA 4.0","author":"Prof. Pod","subject":"rows of colourful knobs on a large analogue mixing console","tags":["mixing desk","console","knobs","studio","recording","analogue","music","audio","pattern"],"cat":"tech","tone":"mid","temp":"neutral","people":"none","q":3},{"id":"Neumann U87 Condenser Microphone - Studio A, In Your Ear Studios.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/a/a6/Neumann_U87_Condenser_Microphone_-_Studio_A%2C_In_Your_Ear_Studios.jpg","page":"https://commons.wikimedia.org/wiki/File:Neumann_U87_Condenser_Microphone_-_Studio_A,_In_Your_Ear_Studios.jpg","w":5184,"h":3456,"color":"#472a21","license":"CC BY-SA 2.0","author":"Will Fisher from Richmond, VA, United States","subject":"a silver condenser microphone in a cradle against warm studio bokeh","tags":["microphone","studio","recording","vocals","podcast","music","condenser mic","audio","warm"],"cat":"tech","tone":"dark","temp":"warm","people":"none","q":3},{"id":"Shure SM7.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/fc/Shure_SM7.jpg","page":"https://commons.wikimedia.org/wiki/File:Shure_SM7.jpg","w":3024,"h":4032,"color":"#6c6050","license":"CC0","author":"The Midnite Wolf","subject":"a dynamic microphone on a stand in front of grey acoustic foam","tags":["microphone","podcast","studio","acoustic foam","broadcast","voice","recording","radio","portrait"],"cat":"tech","tone":"mid","temp":"neutral","people":"none","q":2},{"id":"Close up view of a microphone set up in a recording studio.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/73/Close_up_view_of_a_microphone_set_up_in_a_recording_studio.jpg","page":"https://commons.wikimedia.org/wiki/File:Close_up_view_of_a_microphone_set_up_in_a_recording_studio.jpg","w":4032,"h":6048,"color":"#685649","license":"CC BY 2.0","author":"Shixart1985","subject":"a slim pencil microphone on a boom in a dim recording studio","tags":["microphone","recording studio","studio","music","audio","acoustic","recording","portrait","dark"],"cat":"tech","tone":"dark","temp":"warm","people":"none","q":2},{"id":"Tube racks with eppendorf test tube.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/fe/Tube_racks_with_eppendorf_test_tube.jpg","page":"https://commons.wikimedia.org/wiki/File:Tube_racks_with_eppendorf_test_tube.jpg","w":3456,"h":2304,"color":"#885929","license":"CC BY-SA 4.0","author":"Mateus Figueiredo","subject":"an orange tube rack holding one sample tube on a busy lab bench","tags":["laboratory","sample tube","rack","biotech","research","lab bench","science","pipette","medical"],"cat":"science","tone":"mid","temp":"warm","people":"none","q":2,"fp":[0.5,0.55]},{"id":"Assistant Pharmacist.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/3/34/Assistant_Pharmacist.jpg","page":"https://commons.wikimedia.org/wiki/File:Assistant_Pharmacist.jpg","w":4825,"h":3228,"color":"#9aa2ab","license":"CC BY-SA 4.0","author":"M Joko Apriyo Putro","subject":"a pharmacist in mask and cap preparing medicine at a dispensary bench","tags":["pharmacy","pharmacist","dispensary","medicine","healthcare","compounding","clinic","work"],"cat":"health","tone":"light","temp":"cool","people":"figure","q":2,"fp":[0.45,0.5]},{"id":"The Stethoscope, Peru.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/7/75/The_Stethoscope%2C_Peru.jpg","page":"https://commons.wikimedia.org/wiki/File:The_Stethoscope,_Peru.jpg","w":4113,"h":2742,"color":"#918a85","license":"CC BY 2.0","author":"Alex Proimos","subject":"a doctor's hands in a white coat folding a stethoscope in front of the chest","tags":["doctor","stethoscope","hands","white coat","medical","clinic","healthcare","gp","care"],"cat":"health","tone":"light","temp":"neutral","people":"hands","q":3},{"id":"Hands of a child reach for a stethoscope and thermometer on a table in a healthcare environment undefined.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/f7/Hands_of_a_child_reach_for_a_stethoscope_and_thermometer_on_a_table_in_a_healthcare_environment_undefined.jpg","page":"https://commons.wikimedia.org/wiki/File:Hands_of_a_child_reach_for_a_stethoscope_and_thermometer_on_a_table_in_a_healthcare_environment_undefined.jpg","w":5525,"h":3676,"color":"#463f37","license":"CC BY 2.0","author":"Shixart1985","subject":"a child's hands near a stethoscope and thermometer on a dark table","tags":["paediatrics","child","stethoscope","thermometer","hands","healthcare","clinic","family doctor","care"],"cat":"health","tone":"dark","temp":"neutral","people":"hands","q":2},{"id":"Close-up of a stethoscope chest piece in a womans hand with a blurry background.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/bf/Close-up_of_a_stethoscope_chest_piece_in_a_womans_hand_with_a_blurry_background.jpg","page":"https://commons.wikimedia.org/wiki/File:Close-up_of_a_stethoscope_chest_piece_in_a_womans_hand_with_a_blurry_background.jpg","w":5725,"h":3822,"color":"#7e726c","license":"CC BY 2.0","author":"Shixart1985","subject":"a woman's hand holding a stethoscope chest piece towards the camera, soft blur","tags":["stethoscope","doctor","hand","medical","checkup","clinic","healthcare","care"],"cat":"health","tone":"mid","temp":"warm","people":"hands","q":2,"fp":[0.5,0.4]},{"id":"Stethoscope and Laptop Computer - Nci-vol-9713-300.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/e4/Stethoscope_and_Laptop_Computer_-_Nci-vol-9713-300.jpg","page":"https://commons.wikimedia.org/wiki/File:Stethoscope_and_Laptop_Computer_-_Nci-vol-9713-300.jpg","w":5184,"h":3456,"color":"#706253","license":"Public domain","author":"Daniel Sone (photographer)","subject":"hands typing on a laptop with a stethoscope lying in front on a desk","tags":["telehealth","doctor","laptop","stethoscope","hands","typing","medical records","clinic","healthcare"],"cat":"health","tone":"mid","temp":"warm","people":"hands","q":3},{"id":"Plastic Surgeon Performing Surgery in Operating Room.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/c/c5/Plastic_Surgeon_Performing_Surgery_in_Operating_Room.jpg","page":"https://commons.wikimedia.org/wiki/File:Plastic_Surgeon_Performing_Surgery_in_Operating_Room.jpg","w":8256,"h":5504,"color":"#334064","license":"CC BY-SA 4.0","author":"Tyler Frew MD","subject":"close up of a masked surgeon in cap and loupes looking down, blue light","tags":["surgeon","surgery","operating theatre","doctor","hospital","focus","medical","scrubs"],"cat":"health","tone":"dark","temp":"cool","people":"figure","q":3,"fp":[0.55,0.4]},{"id":"Operating Room Surgical Light During Plastic Surgery Procedure.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/3/32/Operating_Room_Surgical_Light_During_Plastic_Surgery_Procedure.jpg","page":"https://commons.wikimedia.org/wiki/File:Operating_Room_Surgical_Light_During_Plastic_Surgery_Procedure.jpg","w":8256,"h":5504,"color":"#315399","license":"CC BY-SA 4.0","author":"Tyler Frew MD","subject":"a gloved hand adjusting a round surgical light in a blue lit theatre","tags":["surgery","surgical light","operating theatre","hospital","gloves","hand","medical","doctor"],"cat":"health","tone":"dark","temp":"cool","people":"hands","q":3,"fp":[0.35,0.5]},{"id":"Naam Yoga LA Class.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/f8/Naam_Yoga_LA_Class.jpg","page":"https://commons.wikimedia.org/wiki/File:Naam_Yoga_LA_Class.jpg","w":3504,"h":2421,"color":"#836c57","license":"CC BY-SA 3.0","author":"Drmirshak","subject":"a yoga class stretching arms up in a bright wooden floored studio","tags":["yoga","yoga class","studio","stretch","wellness","fitness","group","mats","retreat"],"cat":"sport","tone":"light","temp":"warm","people":"figure","q":2},{"id":"Indoor swimming pool in New York City, January 2011.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/1/1a/Indoor_swimming_pool_in_New_York_City%2C_January_2011.jpg","page":"https://commons.wikimedia.org/wiki/File:Indoor_swimming_pool_in_New_York_City,_January_2011.jpg","w":1932,"h":2576,"color":"#272b24","license":"CC BY-SA 2.0","author":"Charles Smith from New York, United States","subject":"a lone swimmer in a lane of a dim indoor pool seen from a starting block","tags":["swimming","pool","swimmer","lanes","indoor pool","training","leisure centre","portrait","club"],"cat":"sport","tone":"dark","temp":"cool","people":"figure","q":2,"fp":[0.5,0.4]},{"id":"Swimming Pool lanes and starting blocks at AIS.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/8/8c/Swimming_Pool_lanes_and_starting_blocks_at_AIS.jpg","page":"https://commons.wikimedia.org/wiki/File:Swimming_Pool_lanes_and_starting_blocks_at_AIS.jpg","w":4608,"h":3456,"color":"#506471","license":"CC BY-SA 4.0","author":"KeepActive Australia","subject":"numbered starting blocks along a clear blue pool with red lane ropes","tags":["swimming pool","lanes","starting blocks","swimming","aquatic centre","training","club","blue","sport"],"cat":"sport","tone":"mid","temp":"cool","people":"none","q":2},{"id":"Colorful pile of dumbbells at the gym.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/1/19/Colorful_pile_of_dumbbells_at_the_gym.jpg","page":"https://commons.wikimedia.org/wiki/File:Colorful_pile_of_dumbbells_at_the_gym.jpg","w":8160,"h":6120,"color":"#664b31","license":"CC BY-SA 4.0","author":"Ser Amantio di Nicolao","subject":"a heap of orange, green, red and blue rubber dumbbells on a gym rack","tags":["dumbbells","gym","weights","fitness","colourful","workout","strength","training","studio"],"cat":"sport","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Close-up Hand holding dumbbell in gym.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/a/ad/Close-up_Hand_holding_dumbbell_in_gym.jpg","page":"https://commons.wikimedia.org/wiki/File:Close-up_Hand_holding_dumbbell_in_gym.jpg","w":4016,"h":6016,"color":"#7c807f","license":"CC BY 2.0","author":"Nenad Stojkovic","subject":"a hand in a grey hoodie sleeve gripping a black dumbbell beside a bench","tags":["dumbbell","gym","hand","workout","strength","fitness","training","personal trainer","portrait"],"cat":"sport","tone":"mid","temp":"neutral","people":"hands","q":2},{"id":"Exercise Treadmill Convey Motion.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/9/95/Exercise_Treadmill_Convey_Motion.jpg","page":"https://commons.wikimedia.org/wiki/File:Exercise_Treadmill_Convey_Motion.jpg","w":2250,"h":1500,"color":"#868488","license":"CC BY 4.0","author":"Larry D. Moore","subject":"a blurred runner on a treadmill in a pale room, black and white","tags":["treadmill","running","gym","cardio","fitness","motion blur","workout","home gym","monochrome"],"cat":"sport","tone":"light","temp":"neutral","people":"figure","q":2},{"id":"Olympic Road Race Womens winners, London - July 2012.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/eb/Olympic_Road_Race_Womens_winners%2C_London_-_July_2012.jpg","page":"https://commons.wikimedia.org/wiki/File:Olympic_Road_Race_Womens_winners,_London_-_July_2012.jpg","w":4354,"h":3626,"color":"#817a77","license":"CC BY-SA 3.0","author":"Diliff","subject":"three road cyclists in helmets racing through heavy rain past umbrellas","tags":["cycling","road race","cyclists","rain","bikes","racing","endurance","peloton","athletes"],"cat":"sport","tone":"mid","temp":"cool","people":"figure","q":2,"fp":[0.5,0.45]},{"id":"Trail running moscow.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/0/02/Trail_running_moscow.jpg","page":"https://commons.wikimedia.org/wiki/File:Trail_running_moscow.jpg","w":2592,"h":1936,"color":"#837d66","license":"CC BY-SA 4.0","author":"ValeryGL","subject":"a trail runner in orange on a dirt path through a green summer meadow","tags":["trail running","running","runner","meadow","path","outdoors","fitness","summer","training"],"cat":"sport","tone":"mid","temp":"warm","people":"figure","q":2,"fp":[0.6,0.6]},{"id":"Family walking at the evening, cox's bazar .jpg","file":"https://upload.wikimedia.org/wikipedia/commons/5/58/Family_walking_at_the_evening%2C_cox%27s_bazar_.jpg","page":"https://commons.wikimedia.org/wiki/File:Family_walking_at_the_evening,_cox%27s_bazar_.jpg","w":4160,"h":2143,"color":"#7896a2","license":"CC BY-SA 3.0","author":"Ferdous","subject":"two figures walking along a wet beach at dusk, mirrored in the sand","tags":["beach","walking","family","evening","reflection","sea","together","holiday","calm","coast"],"cat":"family","tone":"mid","temp":"cool","people":"figure","q":2,"fp":[0.72,0.45]},{"id":"Mother holding child while walking through a field during golden hour undefined.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/6/65/Mother_holding_child_while_walking_through_a_field_during_golden_hour_undefined.jpg","page":"https://commons.wikimedia.org/wiki/File:Mother_holding_child_while_walking_through_a_field_during_golden_hour_undefined.jpg","w":4024,"h":6048,"color":"#797a6b","license":"CC BY 2.0","author":"Shixart1985","subject":"a woman carrying a toddler through tall golden grass at sunset","tags":["family","mother","child","golden hour","meadow","summer","parenting","outdoors","portrait","warm"],"cat":"family","tone":"mid","temp":"warm","people":"figure","q":2},{"id":"ידיים של ילדים על יד של סבתא.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/ee/%D7%99%D7%93%D7%99%D7%99%D7%9D_%D7%A9%D7%9C_%D7%99%D7%9C%D7%93%D7%99%D7%9D_%D7%A2%D7%9C_%D7%99%D7%93_%D7%A9%D7%9C_%D7%A1%D7%91%D7%AA%D7%90.jpg","page":"https://commons.wikimedia.org/wiki/File:%D7%99%D7%93%D7%99%D7%99%D7%9D_%D7%A9%D7%9C_%D7%99%D7%9C%D7%93%D7%99%D7%9D_%D7%A2%D7%9C_%D7%99%D7%93_%D7%A9%D7%9C_%D7%A1%D7%91%D7%AA%D7%90.jpg","w":2210,"h":2071,"color":"#8e7a69","license":"CC BY-SA 4.0","author":"Hlmb","subject":"several small children's hands laid on a grandmother's hand from above","tags":["hands","children","grandmother","family","generations","together","care","love","elderly"],"cat":"family","tone":"mid","temp":"warm","people":"hands","q":2},{"id":"Child playing with a kite.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/f/fc/Child_playing_with_a_kite.jpg","page":"https://commons.wikimedia.org/wiki/File:Child_playing_with_a_kite.jpg","w":3093,"h":2325,"color":"#556e77","license":"CC0","author":"Wilfredor","subject":"a boy seen from behind holding a homemade kite against blue sky and trees","tags":["child","kite","play","from behind","summer","outdoors","childhood","park","sky"],"cat":"family","tone":"mid","temp":"cool","people":"figure","q":2,"fp":[0.4,0.55]},{"id":"Farjad jolani Cinematographer.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/d/d8/Farjad_jolani_Cinematographer.jpg","page":"https://commons.wikimedia.org/wiki/File:Farjad_jolani_Cinematographer.jpg","w":4623,"h":3332,"color":"#6c5848","license":"CC BY-SA 4.0","author":"DarkRavenCore","subject":"a masked cinematographer framing a shot through a rigged cinema camera","tags":["camera crew","cinematographer","film","production","cinema camera","filmmaking","video","set","work"],"cat":"work","tone":"dark","temp":"warm","people":"figure","q":2,"fp":[0.6,0.45]},{"id":"A photovoltaic power station in the United States (36130544874).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/4/4a/A_photovoltaic_power_station_in_the_United_States_%2836130544874%29.jpg","page":"https://commons.wikimedia.org/wiki/File:A_photovoltaic_power_station_in_the_United_States_(36130544874).jpg","w":1920,"h":1282,"color":"#7e7266","license":"Public domain","author":"Chris Allan, U.S. Department of Energy","subject":"long rows of solar panels on stilts across a dry field at dusk","tags":["solar farm","solar panels","photovoltaic","renewable","energy","utility","field","dusk","sustainability"],"cat":"tech","tone":"mid","temp":"warm","people":"none","q":2},{"id":"Competition kettlebell 16 kilo.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/1/14/Competition_kettlebell_16_kilo.jpg","page":"https://commons.wikimedia.org/wiki/File:Competition_kettlebell_16_kilo.jpg","w":3648,"h":5472,"color":"#827547","license":"CC BY-SA 3.0","author":"Knuckles","subject":"a worn orange kettlebell standing on grass in a sunny park","tags":["kettlebell","gym","outdoor fitness","strength","training","park","workout","bootcamp","portrait"],"cat":"sport","tone":"mid","temp":"warm","people":"none","q":2,"fp":[0.5,0.6]},{"id":"Goal on the move (5772132849).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/1/17/Goal_on_the_move_%285772132849%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Goal_on_the_move_(5772132849).jpg","w":3744,"h":3744,"color":"#5d7433","license":"CC BY 2.0","author":"Håkan Dahlström from Malmö, Sweden","subject":"a green netted football goal on a bright pitch with long tree shadows","tags":["football","soccer","goal","pitch","grass","shadows","club","training","summer"],"cat":"sport","tone":"mid","temp":"cool","people":"none","q":2,"fp":[0.5,0.45]},{"id":"Just a soccer ball (34782492153).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/3/3d/Just_a_soccer_ball_%2834782492153%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Just_a_soccer_ball_(34782492153).jpg","w":5184,"h":3456,"color":"#352d2b","license":"CC BY 2.0","author":"bluesbby from Mountain View, USA","subject":"a worn red and white football on dark ground in dappled light","tags":["football","soccer ball","ball","street","shadows","dark","minimal","grassroots","play"],"cat":"sport","tone":"dark","temp":"neutral","people":"none","q":2,"fp":[0.38,0.6]},{"id":"Jogging 20210116 161032.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/1/1f/Jogging_20210116_161032.jpg","page":"https://commons.wikimedia.org/wiki/File:Jogging_20210116_161032.jpg","w":4608,"h":2592,"color":"#656360","license":"CC BY-SA 4.0","author":"Ka23 13","subject":"a lone runner silhouetted on a dark hill crest against a pale dusk sky","tags":["running","jogging","silhouette","dusk","hill","fitness","solitude","training","minimal"],"cat":"sport","tone":"dark","temp":"cool","people":"figure","q":2,"fp":[0.62,0.4]},{"id":"Swimming Pool in a hotel in Tamil Nadu 03.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/2/2d/Swimming_Pool_in_a_hotel_in_Tamil_Nadu_03.jpg","page":"https://commons.wikimedia.org/wiki/File:Swimming_Pool_in_a_hotel_in_Tamil_Nadu_03.jpg","w":5472,"h":3648,"color":"#3b8ac5","license":"CC BY-SA 4.0","author":"Kritzolina","subject":"blue pool water with rippling reflections of palm trees and floating leaves","tags":["swimming pool","water","reflection","palms","summer","resort","blue","abstract","holiday","swimming"],"cat":"sport","tone":"mid","temp":"cool","people":"none","q":2},{"id":"A woman prepares for her yoga routine.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/1/16/A_woman_prepares_for_her_yoga_routine.jpg","page":"https://commons.wikimedia.org/wiki/File:A_woman_prepares_for_her_yoga_routine.jpg","w":3359,"h":5032,"color":"#463e41","license":"CC BY 2.0","author":"Shixart1985","subject":"a woman seen from behind carrying a rolled purple yoga mat","tags":["yoga","yoga mat","from behind","wellness","studio","fitness","pilates","class","portrait"],"cat":"sport","tone":"dark","temp":"warm","people":"figure","q":2,"fp":[0.5,0.6]},{"id":"Yogi unrolling yoga mat on the floor. (50214718967).jpg","file":"https://upload.wikimedia.org/wikipedia/commons/6/65/Yogi_unrolling_yoga_mat_on_the_floor._%2850214718967%29.jpg","page":"https://commons.wikimedia.org/wiki/File:Yogi_unrolling_yoga_mat_on_the_floor._(50214718967).jpg","w":3152,"h":4721,"color":"#5d4a42","license":"CC BY 2.0","author":"Nenad Stojkovic","subject":"hands unrolling a purple yoga mat on a warm wooden floor","tags":["yoga","yoga mat","hands","wellness","studio","home workout","pilates","fitness","portrait"],"cat":"sport","tone":"mid","temp":"warm","people":"hands","q":3,"fp":[0.5,0.65]},{"id":"Working hands. Bizzilla, or traditional maltese lace-making.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/b5/Working_hands._Bizzilla%2C_or_traditional_maltese_lace-making.jpg","page":"https://commons.wikimedia.org/wiki/File:Working_hands._Bizzilla,_or_traditional_maltese_lace-making.jpg","w":2640,"h":2793,"color":"#8c6d54","license":"CC BY-SA 4.0","author":"Renata Apan","subject":"elderly hands working bobbins over a lace pillow, close up","tags":["elderly hands","lace making","craft","hands","heritage","tradition","old age","handmade","malta"],"cat":"craft","tone":"mid","temp":"warm","people":"hands","q":3},{"id":"Elderly person holding a wooden cane while standing near a rustic background during daytime.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/3/3b/Elderly_person_holding_a_wooden_cane_while_standing_near_a_rustic_background_during_daytime.jpg","page":"https://commons.wikimedia.org/wiki/File:Elderly_person_holding_a_wooden_cane_while_standing_near_a_rustic_background_during_daytime.jpg","w":4016,"h":6016,"color":"#6b513d","license":"CC BY 2.0","author":"Shixart1985","subject":"an elderly hand resting on a wooden walking cane against warm wood","tags":["elderly hands","walking cane","old age","aged care","hands","mobility","senior","portrait"],"cat":"family","tone":"mid","temp":"warm","people":"hands","q":2,"fp":[0.45,0.45]},{"id":"Father & Son Sharing Music Skills.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/e4/Father_%26_Son_Sharing_Music_Skills.jpg","page":"https://commons.wikimedia.org/wiki/File:Father_%26_Son_Sharing_Music_Skills.jpg","w":2500,"h":1668,"color":"#a2a2a2","license":"CC BY-SA 4.0","author":"K15photos","subject":"a father playing guitar beside his small son on a doorstep, black and white","tags":["family","father","son","guitar","music","street","monochrome","together","childhood"],"cat":"family","tone":"mid","temp":"neutral","people":"figure","q":2,"fp":[0.5,0.6]},{"id":"Close-up of an electric car charging. Traffic lights in a blurry background.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/e/e5/Close-up_of_an_electric_car_charging._Traffic_lights_in_a_blurry_background.jpg","page":"https://commons.wikimedia.org/wiki/File:Close-up_of_an_electric_car_charging._Traffic_lights_in_a_blurry_background.jpg","w":5887,"h":3917,"color":"#6d7078","license":"CC BY 2.0","author":"Ivan Radic","subject":"a charging cable plugged into a blue electric car with city lights blurred behind","tags":["ev charging","electric vehicle","electric car","charging cable","city","night","mobility","clean transport","energy"],"cat":"tech","tone":"mid","temp":"cool","people":"none","q":3,"fp":[0.6,0.5]},{"id":"Honda electric car charging on private parking lot in Tokyo.jpg","file":"https://upload.wikimedia.org/wikipedia/commons/b/b5/Honda_electric_car_charging_on_private_parking_lot_in_Tokyo.jpg","page":"https://commons.wikimedia.org/wiki/File:Honda_electric_car_charging_on_private_parking_lot_in_Tokyo.jpg","w":4080,"h":3072,"color":"#a2a2a4","license":"CC0","author":"Syced","subject":"a charging connector plugged into the open port of a white electric car","tags":["ev charging","electric car","charging port","connector","home charging","mobility","clean energy","close up"],"cat":"tech","tone":"light","temp":"neutral","people":"none","q":2}]} \ No newline at end of file diff --git a/skills/hallmark/scripts/picture.mjs b/skills/hallmark/scripts/picture.mjs new file mode 100644 index 0000000..5ee04de --- /dev/null +++ b/skills/hallmark/scripts/picture.mjs @@ -0,0 +1,71 @@ +#!/usr/bin/env node +import { readFileSync, writeFileSync, existsSync } from 'node:fs'; +import { join, dirname, resolve } from 'node:path'; +import { fileURLToPath, pathToFileURL } from 'node:url'; +import { createRequire } from 'node:module'; + +const HERE = dirname(fileURLToPath(import.meta.url)); +const THEMES = join(HERE, '..', 'references', 'themes'); +const [slug, pageArg, yArg] = process.argv.slice(2); +if (!slug || !pageArg) { + console.error('usage: node picture.mjs [y of the lower screen at 1440x900]'); + process.exit(2); +} +if (!/^[a-z0-9][a-z0-9-]*$/.test(slug)) { console.error(`not a theme slug: ${slug}`); process.exit(2); } +const page = resolve(pageArg); +const themeFile = join(THEMES, `${slug}.md`); +if (!existsSync(themeFile)) { console.error(`no theme at ${themeFile}`); process.exit(1); } +if (!existsSync(page)) { console.error(`no page at ${page}`); process.exit(1); } + +let puppeteer = null; +const roots = [process.env.HALLMARK_PUPPETEER, process.cwd(), HERE].filter(Boolean); +try { const { execSync } = await import('node:child_process'); roots.push(dirname(execSync('npm root -g', { encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] }).trim())); } catch {} +for (const root of roots) { + for (const name of ['puppeteer-core', 'puppeteer']) { + try { puppeteer = (await import(pathToFileURL(createRequire(join(root, 'noop.js')).resolve(name)).href)).default; } catch {} + if (puppeteer) break; + } + if (puppeteer) break; +} +if (!puppeteer) { console.error('picture.mjs needs puppeteer-core or puppeteer (local, global or HALLMARK_PUPPETEER)'); process.exit(1); } +const CHROMES = [process.env.CHROME_PATH, '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome', '/Applications/Chromium.app/Contents/MacOS/Chromium', '/usr/bin/google-chrome', '/usr/bin/google-chrome-stable', '/usr/bin/chromium', '/usr/bin/chromium-browser', '/snap/bin/chromium', 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe', 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe']; +const findChrome = () => { const c = CHROMES.find((x) => x && existsSync(x)); if (c) return c; try { const b = typeof puppeteer.executablePath === 'function' ? puppeteer.executablePath() : null; if (typeof b === 'string' && existsSync(b)) return b; } catch {} return null; }; +const chrome = findChrome(); +if (!chrome) { console.error('no Chrome or Chromium found; set CHROME_PATH to its executable'); process.exit(1); } +const browser = await puppeteer.launch({ executablePath: chrome, headless: true }); +const p = await browser.newPage(); +await p.emulateMediaFeatures([{ name: 'prefers-reduced-motion', value: 'reduce' }]); +await p.setViewport({ width: 1440, height: 900, deviceScaleFactor: 1 }); +await p.goto(pathToFileURL(page).href, { waitUntil: 'networkidle0', timeout: 45000 }).catch(() => {}); +await p.evaluate(async () => { document.documentElement.classList.add('hallmark-shot'); await document.fonts.ready; for (const i of document.querySelectorAll('img[loading="lazy"]')) i.loading = 'eager'; for (let y = 0; y < document.documentElement.scrollHeight; y += 700) { window.scrollTo(0, y); await new Promise((r) => setTimeout(r, 40)); } window.scrollTo(0, 0); const waiting = [...document.images].filter((i) => !i.complete); await Promise.race([Promise.all(waiting.map((i) => new Promise((r) => { i.addEventListener('load', r, { once: true }); i.addEventListener('error', r, { once: true }); }))), new Promise((r) => setTimeout(r, 15000))]); await Promise.all([...document.images].map((i) => (i.complete && i.naturalWidth && i.decode ? i.decode().catch(() => {}) : null))); }); +await new Promise((r) => setTimeout(r, 800)); +// the viewport itself, not a clip: a clipped capture re-lays the page out and drops content sized in container units +await p.bringToFront(); +const first = await p.screenshot({ type: 'png' }); +let y = Number(yArg); +if (!yArg || Number.isNaN(y)) y = await p.evaluate(() => { const s = [...document.querySelectorAll('section')].map((e) => e.getBoundingClientRect().top + scrollY).filter((t) => t > 700); return s.length ? Math.round(s[0] - 40) : 1800; }); +await p.evaluate((v) => { window.scrollTo(0, v); for (const el of document.querySelectorAll('body *')) { const cs = getComputedStyle(el); if (/fixed|sticky/.test(cs.position) && el.getBoundingClientRect().top < 120) el.style.visibility = 'hidden'; } }, y); +await new Promise((r) => setTimeout(r, 700)); +const lower = await p.screenshot({ type: 'png' }); +const stamp = await p.evaluate(() => [...document.querySelectorAll('style')].map((s) => s.textContent.slice(0, 600)).join('\n')); +const cssPath = join(dirname(page), 'style.css'); +const head = (existsSync(cssPath) ? readFileSync(cssPath, 'utf8').slice(0, 600) : '') + '\n' + stamp; +const shape = (/shape:\s*([^·*\n]+?)\s*[·*\n]/.exec(head) || [])[1]; +const hero = (/hero:\s*([^·*\n]+?)\s*[·*\n]/.exec(head) || [])[1]; +const c = await browser.newPage(); +await c.setViewport({ width: 960, height: 1208, deviceScaleFactor: 1 }); +await c.setContent(`
          `, { waitUntil: 'load' }); +const out = join(THEMES, `${slug}.jpg`); +writeFileSync(out, await c.screenshot({ type: 'jpeg', quality: 80, clip: { x: 0, y: 0, width: 960, height: 1208 } })); +await browser.close(); +if (shape && hero) { + let src = readFileSync(themeFile, 'utf8'); + const short = shape.trim().split(/\s*[(;,:]/)[0].replace(/,\s*$/, ''); + const way = (new RegExp(`\\b${slug}:\\s*([a-z][a-z-]*)`).exec(head) || [])[1]; + const fallback = (/`([a-z][a-z-]*)`\s*\(default\)/.exec(src) || [])[1]; + const line = `pictured: ${short}, ${hero.trim().split(/[ ,(]/)[0]} hero${way && fallback && way !== fallback ? `, in the ${way} colourway` : ''}`; + src = /^pictured:.*$/m.test(src) ? src.replace(/^pictured:.*$/m, line) : src.replace(/^(material:.*)$/m, `$1\n${line}`); + writeFileSync(themeFile, src); + try { const { execFileSync } = await import('node:child_process'); execFileSync(process.execPath, [join(HERE, 'theme.mjs'), 'index'], { stdio: 'ignore' }); } catch {} +} +console.log(`${out} (lower screen at y ${y}${shape ? `; ${shape.trim()}, ${hero ? hero.trim() : '?'} hero` : ''})`); diff --git a/skills/hallmark/scripts/refcheck.mjs b/skills/hallmark/scripts/refcheck.mjs new file mode 100644 index 0000000..8a4dcd2 --- /dev/null +++ b/skills/hallmark/scripts/refcheck.mjs @@ -0,0 +1,405 @@ +#!/usr/bin/env node +import { readFileSync, readdirSync, statSync, existsSync, mkdtempSync, copyFileSync, rmSync, mkdirSync, writeFileSync, symlinkSync } from 'node:fs'; +import { tmpdir } from 'node:os'; +import { join, dirname, relative, basename, resolve } from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { spawnSync } from 'node:child_process'; + +const ROOT = resolve(dirname(fileURLToPath(import.meta.url)), '..'); +const args = process.argv.slice(2); +const AS_JSON = args.includes('--json'); +const ONLY_ERRORS = args.includes('--errors'); + +function walk(dir, out = []) { + for (const name of readdirSync(dir)) { + if (name === 'node_modules' || name === '.hallmark' || name.startsWith('.')) continue; + const p = join(dir, name); + const st = statSync(p); + if (st.isDirectory()) { if (name !== 'fixtures') walk(p, out); } + else out.push(p); + } + return out; +} + +const FILES = walk(ROOT); +const MD = FILES.filter((f) => f.endsWith('.md')); +const TEXT = FILES.filter((f) => /\.(md|mjs|json|yaml|css|html)$/.test(f)); +const BY_BASE = new Map(); +for (const f of FILES) { const b = basename(f); if (!BY_BASE.has(b)) BY_BASE.set(b, []); BY_BASE.get(b).push(f); } +const read = (f) => readFileSync(f, 'utf8'); +const findings = []; +const add = (level, file, line, rule, msg) => findings.push({ level, file: relative(ROOT, file), line, rule, msg }); +const lineAt = (src, i) => src.slice(0, i).split('\n').length; + +const SKILL = join(ROOT, 'SKILL.md'); +const VERSION = (/^version:\s*([\d.]+)/m.exec(read(SKILL)) || [])[1]; + +const gatesSrc = read(join(ROOT, 'references', 'gates.md')); +const GATES = new Map(); +for (const m of gatesSrc.matchAll(/^\|\s*(\d{1,2}(?:[a-d]|i{1,3})?)\s*\|\s*(Floor|Reflex|Ledger)\s*\|/gm)) GATES.set(m[1], m[2].toLowerCase()); +const FCHECKS = new Set([...gatesSrc.matchAll(/\b(F\d{1,2})\s/g)].map((m) => m[1])); +const retiredLine = (/Retired numbers stay retired:\*\*\s*([\d, and]+) are never reused/.exec(gatesSrc) || [])[1] || ''; +if (!retiredLine) findings.push({ level: 'error', file: 'references/gates.md', line: 1, rule: 'gate', msg: 'the retired-numbers sentence is missing or reworded; refcheck reads it' }); +const RETIRED = new Set((retiredLine.match(/\d+/g) || [])); +const NUMBERS = new Set([...GATES.keys()].map((k) => k.match(/^\d+/)[0])); + +function gateProblem(id) { + if (/^F\d+$/.test(id)) return FCHECKS.has(id) ? null : `F-check ${id} does not exist`; + const num = id.match(/^\d+/)[0]; + if (RETIRED.has(num)) return `gate ${num} is retired`; + if (GATES.has(id)) return null; + if (id === num && NUMBERS.has(num)) return null; + if (!NUMBERS.has(num)) return `gate ${num} does not exist`; + return `gate ${num} has no clause ${id.slice(num.length)}`; +} + +const ID = String.raw`(?:F\d{1,2}|\d{1,2}(?:[a-d]|i{1,3})?)`; +const GATE_LIST = new RegExp(String.raw`\b(?:gates?|waive|answered)\s+(${ID}(?:(?:\s*,\s*|\s+and\s+|\s+to\s+|\s+or\s+)${ID})*)`, 'gi'); +const PAREN_LIST = new RegExp(String.raw`\((${ID}(?:,\s*${ID})*)\)`, 'g'); + +for (const f of MD) { + const src = read(f); + const isGates = f.endsWith(join('references', 'gates.md')); + const seen = new Set(); + const check = (list, at) => { + for (const id of list.split(/\s*,\s*|\s+and\s+|\s+to\s+|\s+or\s+/)) { + const key = `${id}@${at}`; + if (!id || seen.has(key)) continue; + seen.add(key); + const p = gateProblem(id); + if (p) add('error', f, lineAt(src, at), 'gate', p); + } + }; + for (const m of src.matchAll(GATE_LIST)) { + if (isGates && /were merged|stay retired|Retired numbers/.test(src.slice(Math.max(0, m.index - 200), m.index + 200))) continue; + check(m[1], m.index); + } + for (const m of src.matchAll(PAREN_LIST)) { + if (/[\w-]/.test(src[m.index - 1] || '')) continue; + if (/^\d+$/.test(m[1]) && Number(m[1]) > 99) continue; + check(m[1], m.index); + } +} + +const PROJECT_FILES = new Set(['design.md', 'DESIGN.md', 'brand-spec.md', 'AGENTS.md', 'CLAUDE.md', 'brief.md', 'README.md', 'prompts.md', 'notes.md']); +const CODE_EXT = /\.(md|mjs)$/; +for (const f of MD) { + const src = read(f); + for (const m of src.matchAll(/\]\(([^)\s]+)\)/g)) { + const raw = m[1]; + if (/^(https?:|mailto:|#)/.test(raw)) continue; + const target = raw.split('#')[0]; + if (!target) continue; + const p = resolve(dirname(f), target); + if (!existsSync(p)) add('error', f, lineAt(src, m.index), 'link', `dead link ${raw}`); + } + for (const m of src.matchAll(/`([\w./-]+\.(?:md|mjs))`/g)) { + const name = m[1]; + if (name.includes('<') || name.includes('*')) continue; + const b = basename(name); + if (PROJECT_FILES.has(b) && !name.includes('references/')) continue; + if (!CODE_EXT.test(b)) continue; + const found = BY_BASE.has(b) || existsSync(resolve(dirname(f), name)) || existsSync(join(ROOT, name)); + if (!found) add('error', f, lineAt(src, m.index), 'mention', `names ${name}, which does not exist`); + } +} + +const headingsOf = new Map(); +function headings(file) { + if (!headingsOf.has(file)) { + const src = read(file); + const hs = [...src.matchAll(/^(#{1,4})\s+(.+)$/gm)].map((m) => m[2].replace(/[*`]/g, '').trim()); + const bold = [...src.matchAll(/^\s*(?:[-*]\s+|\d+\.\s+)?\*\*([^*]+)\*\*/gm)].map((m) => m[1].trim()); + headingsOf.set(file, { hs, bold }); + } + return headingsOf.get(file); +} +const norm = (s) => s.toLowerCase().replace(/[^a-z0-9 ]+/g, ' ').replace(/\s+/g, ' ').trim(); +for (const f of MD) { + const src = read(f); + for (const m of src.matchAll(/§\s*([^\n§]{1,60})/g)) { + const lineStart = src.lastIndexOf('\n', m.index) + 1; + const back = src.slice(lineStart, m.index); + const mentions = [...back.matchAll(/([\w-]+(?:\/[\w-]+)*\.md)/g)]; + const fm = mentions.length ? mentions[mentions.length - 1] : null; + let target = f; + if (fm) { + const cands = BY_BASE.get(basename(fm[1])) || []; + if (!cands.length) continue; + target = cands.find((c) => c.endsWith(fm[1])) || cands[0]; + } + const rest = m[1].trim(); + const { hs, bold } = headings(target); + const num = /^(\d+)\b/.exec(rest); + if (num) { + if (!hs.some((h) => new RegExp(`^${num[1]}[.\\s]`).test(h))) add('error', f, lineAt(src, m.index), 'section', `${relative(ROOT, target)} has no § ${num[1]}`); + continue; + } + const words = norm(rest.split(/[,.;:()]|\s(?:and|to|or|for|on|in|when|is|binds|says|owns)\s/)[0]).split(' ').slice(0, 3).join(' '); + if (!words || words.length < 3) continue; + const pool = [...hs, ...bold].map(norm); + const first = words.split(' ')[0]; + if (!pool.some((h) => h.includes(words) || h.startsWith(first) || h.includes(` ${first}`))) add('warn', f, lineAt(src, m.index), 'section', `${relative(ROOT, target)} has no section like "§ ${rest.split(/[,.;:)]/)[0].trim()}"`); + } + for (const m of src.matchAll(/\bStep (\d+(?:\.\d+)?)\b/g)) { + const n = m[1]; + if (n.includes('.') || Number(n) > 7) add('error', f, lineAt(src, m.index), 'step', `SKILL.md has no Step ${n} (steps run 0 to 7)`); + } +} + +const theme = read(join(ROOT, 'scripts', 'theme.mjs')); +const tokenNames = (s) => new Set([...s.matchAll(/(--[a-z][\w-]*)\s*:/g)].map((m) => m[1])); +const CANON = new Set(); +for (const block of ['SCALE', 'CUSTOM_TOKENS']) { + const m = new RegExp(`const ${block} = \`([\\s\\S]*?)\`;`).exec(theme); + if (m) for (const t of tokenNames(m[1])) CANON.add(t); +} +const THEME_DIR = join(ROOT, 'references', 'themes'); +const themeFiles = MD.filter((f) => dirname(f) === THEME_DIR && basename(f) !== 'README.md'); +const themeCount = new Map(); +for (const f of themeFiles) for (const t of tokenNames(read(f))) themeCount.set(t, (themeCount.get(t) || 0) + 1); +for (const [t, n] of themeCount) if (n >= Math.ceil(themeFiles.length * 0.9)) CANON.add(t); +for (const t of ['--banner-height', '--i', '--texture-opacity', '--logo-count']) CANON.add(t); +const PHANTOM = new Map(Object.entries({ + '--page-gutter': '--gutter', '--page-max': '--container', '--ease-standard': '--ease-out', '--dur-mid': '--dur-long', + '--dur-fast': '--dur-micro', '--dur-base': '--dur-short', '--dur-slow': '--dur-long', '--banner-h': '--banner-height', + '--bar-h': 'a min-height', '--font-mono': '--font-outlier', '--font-label': '--font-body', '--font-wordmark': '--font-outlier', + '--tracking-label': 'nothing (labels are untracked, gate 67)', '--display': '--font-display', '--rule-fine': '--rule-bar', +})); +const codeOf = (src) => [...src.matchAll(/```[a-z]*\n([\s\S]*?)```/g)].map((m) => ({ text: m[1], at: m.index + m[0].indexOf(m[1]) })).concat([...src.matchAll(/`([^`\n]+)`/g)].map((m) => ({ text: m[1], at: m.index }))); +for (const f of MD) { + const src = read(f); + const isTheme = dirname(f) === THEME_DIR; + const local = tokenNames(src); + for (const { text, at } of codeOf(src)) { + for (const m of text.matchAll(/var\(\s*(--[a-z][\w-]*)\s*(,)?/g)) { + const t = m[1]; + const line = lineAt(src, at + m.index); + if (PHANTOM.has(t) && !local.has(t)) add('error', f, line, 'token', `${t} does not exist; use ${PHANTOM.get(t)}`); + else if (!m[2] && !CANON.has(t) && !local.has(t) && !isTheme) { + const n = themeCount.get(t) || 0; + add('warn', f, line, 'token', n ? `${t} exists only in ${n} theme(s); a shared file cannot rely on it` : `${t} is not in the token vocabulary (export-formats.md § The token set)`); + } + } + } +} + +const stampRe = /Hallmark · (macrostructure|studied):/g; +for (const f of TEXT) { + const src = read(f); + if (/[\u2014\u2013]/.test(src)) for (const m of src.matchAll(/[\u2014\u2013]/g)) add('error', f, lineAt(src, m.index), 'dash', 'em or en dash'); + for (const m of src.matchAll(stampRe)) add('error', f, lineAt(src, m.index), 'stamp', `old stamp field "${m[1]}:"; the stamp opens with shape, genre, theme`); + for (const m of src.matchAll(/(?:Hallmark[^\n]{0,200}|\*\/[^\n]{0,0})\bv(\d+\.\d+\.\d+)\b/g)) { + if (VERSION && m[1] !== VERSION && !/v0\.|v1\./.test(`v${m[1]}`)) add('error', f, lineAt(src, m.index), 'version', `v${m[1]} where the skill is v${VERSION}`); + } +} +const themeVersion = (/const VERSION = '([\d.]+)'/.exec(theme) || [])[1]; +if (themeVersion !== VERSION) add('error', join(ROOT, 'scripts', 'theme.mjs'), 1, 'version', `theme.mjs VERSION ${themeVersion} where SKILL.md says ${VERSION}`); + +for (const f of MD) { + const src = read(f); + for (const m of src.matchAll(/```html\n([\s\S]*?)```/g)) { + const html = m[1].replace(//g, '').replace(/<(script|style)[\s\S]*?<\/\1>/g, ''); + for (const t of html.matchAll(/>([^<>]*)|->/.test(text)) add('error', f, line, '63', `arrow in sample copy: "${text.trim().slice(0, 50)}"`); + if (/\S\s·\s\S/.test(text) && !/marquee|ticker/i.test(html)) add('warn', f, line, '63', `middle-dot string in sample copy: "${text.trim().slice(0, 50)}"`); + } + } + for (const m of src.matchAll(/```css\n([\s\S]*?)```/g)) { + for (const r of m[1].matchAll(/([^{}]+)\{([^}]*)\}/g)) { + const sel = r[1].trim(); const body = r[2]; + const ls = /letter-spacing:\s*(-?[\d.]+)em/.exec(body); + if (/uppercase/.test(body) && ls && Number(ls[1]) > 0.04 && /label|caption|meta|tag|chip|eyebrow|kicker|th\b|nav|link|small|note/i.test(sel) && !/wordmark|logo|brand/i.test(sel)) add('error', f, lineAt(src, m.index + m[0].indexOf(m[1]) + r.index + r[0].length - r[0].trimStart().length), '67', `${sel} sets tracked capitals (${ls[1]}em)`); + if (/small-caps|smcp/.test(body)) add('error', f, lineAt(src, m.index + m[0].indexOf(m[1]) + r.index + r[0].length - r[0].trimStart().length), '67', `${sel} sets small caps`); + } + } +} + +const sloplint = read(join(ROOT, 'scripts', 'sloplint.mjs')); +const tiersBlock = (/const TIERS = new Map\(Object\.entries\(\{([\s\S]*?)\}\)\)/.exec(sloplint) || [])[1] || ''; +const TIERS = new Map([...tiersBlock.matchAll(/'([\w]+)':\s*'(\w+)'/g)].map((m) => [m[1], m[2]])); +for (const [id, tier] of GATES) { + const t = TIERS.get(id); + if (t && t !== tier) add('error', join(ROOT, 'scripts', 'sloplint.mjs'), 1, 'tier', `sloplint tiers ${id} as ${t}; gates.md says ${tier}`); +} + +const index = JSON.parse(read(join(THEME_DIR, 'index.json'))); +const indexed = new Set(index.themes.map((t) => t.slug)); +for (const f of themeFiles) if (!indexed.has(basename(f, '.md'))) add('error', f, 1, 'index', 'theme missing from index.json (run theme.mjs index)'); +for (const t of index.themes) if (!existsSync(join(ROOT, t.file))) add('error', join(THEME_DIR, 'index.json'), 1, 'index', `index lists ${t.file}, which does not exist`); + +const fontsSrc = read(join(ROOT, 'references', 'fonts.md')); +const unusedTable = fontsSrc.slice(fontsSrc.indexOf('## Display faces the catalog does not use'), fontsSrc.indexOf('## Body faces')); +const pairTable = fontsSrc.includes('## Pairings by tone') ? fontsSrc.slice(fontsSrc.indexOf('## Pairings by tone'), fontsSrc.indexOf('## The wordmark')) : ''; +const catalogFaces = index.themes.map((t) => ({ name: t.name, face: t.display.face.toLowerCase().replace(/ italic$/, '') })); +for (const [label, table] of [['the faces-the-catalog-does-not-use table', unusedTable], ['the display column of the pairings table', pairTable.split('\n').map((l) => l.split('|')[2] || '').join('\n')]]) { + for (const { name, face } of catalogFaces) { + if (new RegExp(`(^|[\\s,|])${face.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}(?=[\\s,|(]|$)`, 'im').test(table.toLowerCase())) add('error', join(ROOT, 'references', 'fonts.md'), lineAt(fontsSrc, fontsSrc.toLowerCase().indexOf(face)), 'fonts', `${label} offers ${face}, which ${name} already sets as its display face`); + } +} + +const reach = new Set([SKILL]); +const queue = [SKILL]; +while (queue.length) { + const f = queue.shift(); + const src = read(f); + const names = new Set([...src.matchAll(/([\w-]+\.(?:md|mjs|json))/g)].map((m) => m[1])); + for (const n of names) for (const c of BY_BASE.get(n) || []) if (!reach.has(c)) { reach.add(c); if (c.endsWith('.md')) queue.push(c); } +} +for (const f of themeFiles) reach.add(f); +for (const f of [...reach]) { + if (!f.endsWith('.md')) continue; + for (const m of read(f).matchAll(/([\w-]+)\/<[\w-]+>\.md/g)) for (const c of MD) if (basename(dirname(c)) === m[1]) reach.add(c); +} +for (const f of MD) if (!reach.has(f) && basename(f) !== 'README.md') add('warn', f, 1, 'orphan', 'no file reachable from SKILL.md names this file'); + +const skillBytes = Buffer.byteLength(read(SKILL)); +const front = /^---\n([\s\S]*?)\n---\n/.exec(readFileSync(SKILL, 'utf8')); +const fm = front ? Object.fromEntries(front[1].split('\n').map((l) => /^([a-z-]+):\s*(.*)$/.exec(l)).filter(Boolean).map((m) => [m[1], m[2]])) : {}; +if (!fm.name || !fm.description) add('error', SKILL, 1, 'frontmatter', 'SKILL.md needs name and description in its frontmatter, or installers find no skill'); +else if (!/^"(?:[^"\\]|\\.)*"$/.test(fm.description) || fm.description.length > 1026) add('error', SKILL, 2, 'frontmatter', 'the description must be one double-quoted line of 1,024 characters or fewer; an unquoted colon breaks strict YAML parsers'); +if (skillBytes > 19000) add('error', SKILL, 1, 'size', `SKILL.md is ${skillBytes} bytes; keep it at 19,000 or under so the 5,000 tokens a harness re-attaches after compaction still hold Step 7`); + +for (const f of themeFiles) { + const src = read(f); + const hint = /## Build hint[\s\S]*?```css\n([\s\S]*?)```/.exec(src); + if (!hint) continue; + const at = src.indexOf(hint[1]); + for (const m of hint[1].matchAll(/(?:^|[{;])\s*(?!--)([a-z-]+)\s*:([^;{}]*)/g)) { + if (/oklch\(|#[0-9a-fA-F]{3,8}\b|rgba?\(|hsla?\(/.test(m[2])) add('error', f, lineAt(src, at + m.index), 'literal', `build hint sets ${m[1]} with a colour literal; route it through a token (48)`); + } +} + +const exemplarDir = join(ROOT, 'scripts', 'fixtures', 'exemplars'); +const clean = [...(existsSync(exemplarDir) ? readdirSync(exemplarDir).filter((n) => n.endsWith('.html')).map((n) => join(exemplarDir, n)) : []), + ...['eyebrow-pass', 'tailwind-pass'].map((n) => join(ROOT, 'scripts', 'fixtures', n)).filter(existsSync)]; +for (const target of clean) { + const run = spawnSync(process.execPath, [join(ROOT, 'scripts', 'sloplint.mjs'), target, '--json'], { encoding: 'utf8' }); + let s = null; + try { s = JSON.parse(run.stdout).summary; } catch {} + if (!s) add('error', target, 1, 'lint', 'sloplint did not run on this file'); + else if (s.fails || s.reflex || s.warns) add('error', target, 1, 'lint', `must lint clean, has ${s.fails} FAIL, ${s.reflex} REFLEX, ${s.warns} WARN`); +} + +const FIX = join(ROOT, 'scripts', 'fixtures'); +{ + const tmp = mkdtempSync(join(tmpdir(), 'hallmark-links-')); + try { + const project = join(tmp, 'project'); + const shared = join(tmp, 'shared'); + mkdirSync(project); + mkdirSync(shared); + writeFileSync(join(shared, 'style.css'), 'p { color: var(--color-text); }'); + symlinkSync(shared, join(project, 'a-shared'), process.platform === 'win32' ? 'junction' : 'dir'); + symlinkSync(shared, join(project, 'b-shared'), process.platform === 'win32' ? 'junction' : 'dir'); + symlinkSync(project, join(project, 'parent'), process.platform === 'win32' ? 'junction' : 'dir'); + const run = spawnSync(process.execPath, [join(ROOT, 'scripts', 'sloplint.mjs'), project, '--scope', 'component', '--json'], { encoding: 'utf8', timeout: 5000 }); + let report = null; + try { report = JSON.parse(run.stdout); } catch {} + if (!report || report.summary.files !== 1) add('error', SKILL, 1, 'fixture', 'directory symlink cycles must terminate and each real file must be linted once'); + } finally { rmSync(tmp, { recursive: true, force: true }); } +} +{ + const tmp = mkdtempSync(join(tmpdir(), 'hallmark-build-targets-')); + try { + writeFileSync(join(tmp, 'source.css'), ':root { --paper: #f3f2ef; }'); + for (const dir of ['dist', 'build', 'coverage']) { + mkdirSync(join(tmp, dir)); + writeFileSync(join(tmp, dir, 'page.css'), 'body { background: #fff; color: #000; }'); + } + const cases = [['.']]; + for (const dir of ['dist', 'build', 'coverage']) cases.push([dir], ['.', dir], [dir, '.']); + for (const paths of cases) { + const run = spawnSync(process.execPath, [join(ROOT, 'scripts', 'sloplint.mjs'), ...paths, '--json'], { cwd: tmp, encoding: 'utf8', timeout: 5000 }); + let report = null; + try { report = JSON.parse(run.stdout); } catch {} + const explicitBuild = paths.find((p) => p !== '.'); + const files = paths.length > 1 ? 2 : 1; + if (!report || report.summary.files !== files || run.status !== (explicitBuild ? 1 : 0) + || (explicitBuild && !report.findings.some((f) => f.file === join(explicitBuild, 'page.css')))) { + add('error', SKILL, 1, 'fixture', `explicit build targets must be linted in either argument order, while nested build folders stay skipped: ${paths.join(' ')}`); + } + } + } finally { rmSync(tmp, { recursive: true, force: true }); } +} +{ + const tmp = mkdtempSync(join(tmpdir(), 'hallmark-dot-')); + try { + const theme = join(tmp, '.vitepress'); + mkdirSync(join(theme, '.cache'), { recursive: true }); + writeFileSync(join(theme, 'style.css'), 'p { color: var(--color-text); }'); + writeFileSync(join(theme, '.cache', 'style.css'), 'p { color: var(--color-text); }'); + const run = spawnSync(process.execPath, [join(ROOT, 'scripts', 'sloplint.mjs'), theme, '--scope', 'component', '--json'], { encoding: 'utf8', timeout: 5000 }); + let report = null; + try { report = JSON.parse(run.stdout); } catch {} + if (!report || report.summary.files !== 1) add('error', SKILL, 1, 'fixture', 'a dot folder named on the command line must be linted, while dot folders inside it stay skipped'); + } finally { rmSync(tmp, { recursive: true, force: true }); } +} +const lintJson = (t) => { const r = spawnSync(process.execPath, [join(ROOT, 'scripts', 'sloplint.mjs'), t, '--json'], { encoding: 'utf8' }); try { return JSON.parse(r.stdout); } catch { return null; } }; +const gatesOf = (j) => new Set(j.findings.map((x) => String(x.gate))); +const expectations = [ + ['eyebrow-fail', (j) => j.findings.filter((x) => x.gate === '54' && x.grade === 'FAIL').length === 6, 'gate 54 must FAIL six times'], + ['eyebrow-pass', (j) => !j.findings.some((x) => x.gate === '54'), 'gate 54 must not fire'], + ['waiver', (j) => ['fails:0', 'reflex:0', 'waived:5', 'rejected:2', 'answered:1', 'notes:1'].every((kv) => { const [k, v] = kv.split(':'); return j.summary[k] === Number(v); }), 'must report fails 0, reflex 0, waived 5, rejected 2, answered 1, notes 1'], + ['slopped.html', (j) => ['1', '2a', '4', '7b', '10a', '15', '19', '20', '22', '46a', '48', '54'].every((g) => gatesOf(j).has(g)), 'must fire 1, 2a, 4, 7b, 10a, 15, 19, 20, 22, 46a, 48 and 54'], + ['tailwind-fail', (j) => ['67', '54', '64', '10a', '12', '11', '2a', '2b', '29', '6a', '34', '48', '74', '3'].every((g) => gatesOf(j).has(g)), 'must fire 67, 54, 64, 10a, 12, 11, 2a, 2b, 29, 6a, 34, 48, 74 and 3'], +]; +for (const [name, ok, msg] of existsSync(FIX) ? expectations : []) { + const target = join(FIX, name); + if (!existsSync(target)) { add('error', target, 1, 'fixture', 'missing'); continue; } + const j = lintJson(target); + if (!j) add('error', target, 1, 'fixture', 'sloplint did not run on this fixture'); + else if (!ok(j)) add('error', target, 1, 'fixture', msg); +} + +const keptDir = join(FIX, 'kept'); +if (existsSync(keptDir)) { + const tmp = mkdtempSync(join(tmpdir(), 'hallmark-kept-')); + try { + const run = (flag) => spawnSync(process.execPath, [join(ROOT, 'scripts', 'sloplint.mjs'), 'index.html', flag, '--json'], { encoding: 'utf8', cwd: tmp }); + copyFileSync(join(keptDir, 'before.html'), join(tmp, 'index.html')); + run('--before'); + copyFileSync(join(keptDir, 'after.html'), join(tmp, 'index.html')); + let j = null; + try { j = JSON.parse(run('--kept').stdout); } catch {} + const kept = j ? j.findings.filter((x) => x.gate === 'kept') : []; + const fails = kept.filter((x) => x.grade === 'FAIL').map((x) => x.evidence).join(' | '); + const warns = kept.filter((x) => x.grade === 'WARN').map((x) => x.evidence).join(' | '); + const want = [[fails, 'rooms.html'], [fails, 'nights'], [fails, "track('book')"], [fails, 'book-button'], [fails, '#nav-toggle'], [warns, 'nav-toggle']]; + if (!j) add('error', keptDir, 1, 'fixture', 'sloplint --kept did not run on the kept fixture'); + else if (!want.every(([hay, needle]) => hay.includes(needle))) add('error', keptDir, 1, 'fixture', 'the kept check must fail the lost link, field, handler, test hook and script hook, and warn on the lost id'); + else if (fails.includes('mailto:')) add('error', keptDir, 1, 'fixture', 'a link recorded as dropped in the stamp must not fail'); + } finally { rmSync(tmp, { recursive: true, force: true }); } +} + +const REPO = resolve(ROOT, '..', '..'); +const pkgFile = join(REPO, 'package.json'); +if (existsSync(pkgFile)) { + let pkg = null; + try { pkg = JSON.parse(read(pkgFile)); } catch {} + if (pkg && pkg.name === 'hallmark') { + if (pkg.version !== VERSION) add('error', pkgFile, 1, 'version', `package.json says ${pkg.version} where SKILL.md says ${VERSION}`); + const docs = ['README.md', 'ROADMAP.md', ...(existsSync(join(REPO, 'docs')) ? readdirSync(join(REPO, 'docs')).filter((n) => n.endsWith('.md')).map((n) => join('docs', n)) : [])].map((n) => join(REPO, n)).filter(existsSync); + for (const f of docs) { + const src = read(f); + for (const m of src.matchAll(/\]\(([^)\s]+)\)/g)) { + const t = m[1].split('#')[0].split('?')[0]; + if (!t || /^(https?:|mailto:|data:)/.test(m[1])) continue; + if (!existsSync(resolve(dirname(f), t))) add('error', f, lineAt(src, m.index), 'link', `${m[1]} does not resolve`); + } + } + } +} + +const shown = ONLY_ERRORS ? findings.filter((x) => x.level === 'error') : findings; +const errors = findings.filter((x) => x.level === 'error').length; +const warns = findings.length - errors; +if (AS_JSON) console.log(JSON.stringify({ errors, warns, findings: shown }, null, 1)); +else { + shown.sort((a, b) => (a.level === b.level ? a.file.localeCompare(b.file) || a.line - b.line : a.level === 'error' ? -1 : 1)); + for (const x of shown) console.log(`${x.level === 'error' ? 'ERROR' : 'warn '} ${x.file}:${x.line} [${x.rule}] ${x.msg}`); + console.log(errors || warns ? `refcheck: ${errors} error(s), ${warns} warning(s) across ${MD.length} reference files` : `refcheck: clean across ${MD.length} reference files`); +} +process.exit(errors ? 1 : 0); diff --git a/skills/hallmark/scripts/reroll-exhaustion.test.mjs b/skills/hallmark/scripts/reroll-exhaustion.test.mjs new file mode 100644 index 0000000..adf5d75 --- /dev/null +++ b/skills/hallmark/scripts/reroll-exhaustion.test.mjs @@ -0,0 +1,48 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import { mkdtempSync, rmSync } from 'node:fs'; +import { tmpdir } from 'node:os'; +import { join } from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { spawnSync } from 'node:child_process'; + +const script = fileURLToPath(new URL('./theme.mjs', import.meta.url)); +function fixture(fn) { + const dir = mkdtempSync(join(tmpdir(), 'hallmark-reroll-')); + try { + const run = (reroll, n = 3) => spawnSync(process.execPath, + [script, 'deal', '--prompt', 'neighborhood bakery', '--reroll', String(reroll), + '--n', String(n), '--json', '--log', join(dir, 'log.json')], + {cwd: dir, encoding: 'utf8', timeout: 3000}); + fn(run); + } finally { rmSync(dir, {recursive: true, force: true}); } +} + +for (const n of [1, 3]) { + test('an exhausted catalog terminates even for a billion rerolls, hand=' + n, () => fixture(run => { + const result = run(1_000_000_000, n); + assert.ifError(result.error); + assert.equal(result.status, 1, result.stdout + result.stderr); + assert.match(result.stderr, /nothing left to deal at reroll 1000000000/); + assert.equal(result.stdout, ''); + })); +} + +test('normal first and next hands retain three different themes', () => fixture(run => { + const first = run(0), next = run(1); + assert.ifError(first.error); assert.ifError(next.error); + assert.equal(first.status, 0, first.stderr); + assert.equal(next.status, 0, next.stderr); + const a = JSON.parse(first.stdout), b = JSON.parse(next.stdout); + assert.equal(a.deal.length, 3); + assert.equal(b.deal.length, 3); + const previous = new Set(a.deal.map(theme => theme.slug)); + assert.ok(b.deal.every(theme => !previous.has(theme.slug))); +})); + +test('small exhausted requests retain their existing diagnostic', () => fixture(run => { + const result = run(100); + assert.ifError(result.error); + assert.equal(result.status, 1); + assert.match(result.stderr, /nothing left to deal at reroll 100/); +})); diff --git a/skills/hallmark/scripts/sloplint-render.mjs b/skills/hallmark/scripts/sloplint-render.mjs new file mode 100644 index 0000000..10f62da --- /dev/null +++ b/skills/hallmark/scripts/sloplint-render.mjs @@ -0,0 +1,1283 @@ +#!/usr/bin/env node +import { existsSync, mkdirSync, writeFileSync } from 'node:fs'; +import { join, dirname, basename, resolve } from 'node:path'; +import { fileURLToPath, pathToFileURL } from 'node:url'; + +const WIDTHS = [320, 375, 414, 768, 1024, 1280, 1440, 1920]; +const CHROMES = ['/Applications/Google Chrome.app/Contents/MacOS/Google Chrome', '/Applications/Chromium.app/Contents/MacOS/Chromium', '/usr/bin/google-chrome', '/usr/bin/google-chrome-stable', '/usr/bin/chromium', '/usr/bin/chromium-browser', '/snap/bin/chromium', 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe']; +const isUrl = (t) => /^https?:\/\//.test(t); +const slugOf = (t) => isUrl(t) ? t.replace(/^https?:\/\//, '').replace(/[^\w.-]+/g, '-').replace(/-+$/, '') : basename(t, '.html'); + +const SHOTS = []; +let SHOT_DIR = 'shots'; +const frames = (page) => page.evaluate(async () => { if (document.fonts && document.fonts.status !== 'loaded') await Promise.race([document.fonts.ready, new Promise((r) => setTimeout(r, 3000))]); await new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(r))); }).catch(() => {}); +const settleImages = (page) => page.evaluate(async () => { for (const i of document.querySelectorAll('img[loading="lazy"]')) i.loading = 'eager'; for (let y = 0; y < document.documentElement.scrollHeight; y += 700) { window.scrollTo(0, y); await new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(r))); } window.scrollTo(0, 0); const waiting = [...document.images].filter((i) => !i.complete); await Promise.race([Promise.all(waiting.map((i) => new Promise((r) => { i.addEventListener('load', r, { once: true }); i.addEventListener('error', r, { once: true }); }))), new Promise((r) => setTimeout(r, 15000))]); await Promise.all([...document.images].map((i) => (i.complete && i.naturalWidth && i.decode ? i.decode().catch(() => {}) : null))); }).catch(() => {}); +function contrast(a, b) { + const lin = (c) => (c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4); + const Y = (c) => 0.2126 * lin(c[0]) + 0.7152 * lin(c[1]) + 0.0722 * lin(c[2]); + const x = Y(a), y = Y(b); + return (Math.max(x, y) + 0.05) / (Math.min(x, y) + 0.05); +} + +// Keep the original element and each property's priority across asynchronous screenshots. +async function hideStyles(el, props) { + const saved = await el.evaluate((node, entries) => { + const previous = { hadStyle: node.hasAttribute('style'), props: entries.map(([k]) => [k, node.style.getPropertyValue(k), node.style.getPropertyPriority(k)]) }; + for (const [k, v] of entries) node.style.setProperty(k, v, 'important'); + return previous; + }, props); + return () => el.evaluate((node, previous) => { + for (const [k, value, priority] of previous.props) { + if (value) node.style.setProperty(k, value, priority); + else node.style.removeProperty(k); + } + if (!previous.hadStyle && !node.style.length) { + // Synchronize the CSSOM's lazy attribute before removing its empty shell. + node.getAttribute('style'); + node.removeAttribute('style'); + } + }, saved).catch(() => {}); +} + +async function pixelBehind(page, probe) { + // Change the stroke width alone so a pre-existing stroke color is never overwritten. + const HIDE = [['color', 'transparent'], ['text-shadow', 'none'], ['-webkit-text-stroke-width', '0'], ['text-decoration-color', 'transparent']]; + let el, restore; + try { + el = await page.$(`[data-hm-probe="${probe}"]`); + if (!el) return null; + restore = await hideStyles(el, HIDE); + const rect = await el.evaluate((node) => { + node.scrollIntoView({ block: 'center', behavior: 'instant' }); + const r = node.getBoundingClientRect(); + const x = Math.max(0, r.left), y = Math.max(0, r.top); + return { x: x + scrollX, y: y + scrollY, width: Math.min(r.right, innerWidth) - x, height: Math.min(r.bottom, innerHeight) - y }; + }); + if (!rect || rect.width < 2 || rect.height < 2) return null; + await frames(page); + const data = await page.screenshot({ clip: rect, encoding: 'base64' }); + return await page.evaluate(async (b64) => { + const img = new Image(); + img.src = 'data:image/png;base64,' + b64; + await img.decode(); + const c = document.createElement('canvas'); + c.width = img.width; c.height = img.height; + const x = c.getContext('2d'); + x.drawImage(img, 0, 0); + const d = x.getImageData(0, 0, c.width, c.height).data; + const ch = [[], [], []]; + for (let i = 0; i < d.length; i += 4) { ch[0].push(d[i]); ch[1].push(d[i + 1]); ch[2].push(d[i + 2]); } + return ch.map((a) => a.sort((p, q) => p - q)[a.length >> 1] / 255); + }, data); + } catch { return null; } + finally { + if (restore) await restore(); + if (el) await el.dispose().catch(() => {}); + await page.evaluate(() => window.scrollTo(0, 0)).catch(() => {}); + } +} + +async function shoot(page, file, tag, fullPage) { + try { + const dir = isUrl(file) ? join(process.cwd(), '.hallmark', SHOT_DIR) : join(dirname(file), '.hallmark', SHOT_DIR); + mkdirSync(dir, { recursive: true }); + const ignore = join(dirname(dir), '.gitignore'); + if (!existsSync(ignore)) writeFileSync(ignore, 'shots/\nbefore/\nbefore.json\nbefore.txt\ncompare.html\n'); + const out = join(dir, `${slugOf(file)}-${tag}.png`); + await page.screenshot({ path: out, fullPage }); + SHOTS.push(out); + } catch {} +} + +export async function renderCheck(htmlFiles, metaIn) { + const failed = []; + const meta = { genre: null, postureByFile: {}, heroPostureByFile: {}, photoShapeByFile: {}, jobByFile: {}, stage: 'page', scope: 'page', before: false, ...(metaIn || {}) }; + const heroOnly = meta.stage === 'hero'; + SHOT_DIR = meta.before ? 'before' : 'shots'; + const inventories = {}; + let puppeteer = null; + const { createRequire } = await import('node:module'); + const tryRoots = async (roots) => { + for (const root of roots) { + for (const name of ['puppeteer-core', 'puppeteer']) { + try { + const req = createRequire(join(root, 'noop.js')); + const resolved = req.resolve(name); + puppeteer = (await import(pathToFileURL(resolved).href)).default; + if (puppeteer) return; + } catch {} + } + } + }; + const local = [process.cwd(), dirname(fileURLToPath(import.meta.url))]; + if (process.env.HALLMARK_PUPPETEER) local.unshift(process.env.HALLMARK_PUPPETEER); + await tryRoots(local); + if (!puppeteer) { + try { + const { execSync } = await import('node:child_process'); + const g = execSync('npm root -g', { encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] }).trim(); + if (g) await tryRoots([dirname(g)]); + } catch {} + } + if (!puppeteer) { + const none = []; none.failed = failed; none.notRun = 'no puppeteer-core found locally, globally or via HALLMARK_PUPPETEER'; + return none; + } + let chrome = [process.env.CHROME_PATH, ...CHROMES].find((p) => p && existsSync(p)) || null; + if (!chrome && typeof puppeteer.executablePath === 'function') { + try { const bundled = puppeteer.executablePath(); if (bundled && existsSync(bundled)) chrome = bundled; } catch {} + } + if (!chrome) { + const none = []; none.failed = failed; none.notRun = 'no Chrome or Chromium found; set CHROME_PATH'; + return none; + } + const findings = []; + const browser = await puppeteer.launch({ executablePath: chrome, headless: true }); + try { + for (const file of htmlFiles) { + const page = await browser.newPage(); + try { + const scriptErrors = []; + page.on('pageerror', (e) => scriptErrors.push(String((e && e.message) || e).split('\n')[0])); + const lost = new Set(); + const lostName = (u) => { try { const x = new URL(u); return x.protocol === 'file:' ? x.pathname.split('/').pop() : x.host; } catch { return String(u).slice(0, 40); } }; + page.on('requestfailed', (r) => { if (['stylesheet', 'font'].includes(r.resourceType())) lost.add(lostName(r.url())); }); + page.on('response', (r) => { try { if (r.status() >= 400 && ['stylesheet', 'font'].includes(r.request().resourceType())) lost.add(lostName(r.url())); } catch {} }); + await page.emulateMediaFeatures([{ name: 'prefers-reduced-motion', value: 'reduce' }]).catch(() => {}); + const nav = await page.goto(isUrl(file) ? file : pathToFileURL(file).href, { waitUntil: isUrl(file) ? 'networkidle0' : 'load', timeout: 30000 }).then((r) => ({ r }), (e) => ({ e })); + if (nav.e && !/timeout/i.test(nav.e.message)) throw nav.e; + if (nav.r && isUrl(file) && !nav.r.ok() && nav.r.status() !== 304) throw new Error(`HTTP ${nav.r.status()} from ${file}`); + await page.evaluate(async () => { + document.documentElement.classList.add('hallmark-shot'); + for (const el of [document.documentElement, document.body]) if (el) el.style.setProperty('scroll-behavior', 'auto', 'important'); + const quiet = document.createElement('style'); + quiet.textContent = 'nextjs-portal, astro-dev-toolbar { display: none !important; }'; + document.head.appendChild(quiet); + if (document.fonts) await document.fonts.ready; + }).catch(() => {}); + if (isUrl(file)) { + const stamp = await page.evaluate(async () => { let t = [...document.querySelectorAll('style')].map((x) => x.textContent.slice(0, 4000)).join('\n'); for (const l of document.querySelectorAll('link[rel~="stylesheet"]')) { try { t += '\n' + (await (await fetch(l.href)).text()).slice(0, 4000); } catch {} } return t; }).catch(() => ''); + meta.postureByFile[file] = (/posture:\s*(restrained|committed|full-palette|drenched)/i.exec(stamp)?.[1] || 'restrained').toLowerCase(); + const field = (/hero:\s*([^·*\n]+)/i.exec(stamp) || [])[1] || ''; + let route = ''; try { route = new URL(file).pathname.replace(/\/$/, '') || '/'; } catch {} + const own = new RegExp(`(settled|banner|poster|ledge|corridor|stage|counter|index)\\s*\\(${route.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}\\)`, 'i').exec(field); + meta.photoShapeByFile[file] = /shape:\s*(photographic|portfolio)/i.test(stamp); + meta.jobByFile[file] = ((/\bjob:\s*([a-z][a-z /-]*)/i.exec(stamp) || [])[1] || '').trim().toLowerCase(); + meta.heroPostureByFile[file] = /theme:\s*custom\b/i.test(stamp) ? 'custom' : ((own || /(settled|banner|poster|ledge|corridor|stage|counter|index)\b/i.exec(field) || [])[1] || '').toLowerCase(); + } + const pageMeta = { genre: meta.genre, posture: meta.postureByFile[file] || 'restrained' }; + const prefix = heroOnly ? 'hero-' : ''; + for (const width of heroOnly ? [375, 1280] : WIDTHS) { + await page.setViewport({ width, height: width === 375 && heroOnly ? 812 : 800 }); + await page.evaluate(() => window.scrollTo(0, 0)).catch(() => {}); + await frames(page); + if (width === 1280) await shoot(page, file, `${prefix}1280x800`, false); + if (width === 375 && !heroOnly) { await settleImages(page); await frames(page); } + if (width === 375) await shoot(page, file, heroOnly ? 'hero-375x812' : '375', !heroOnly); + if (!heroOnly && (width === 375 || width === 1280)) for (const f of await page.evaluate(lineBreaks).catch(() => [])) findings.push({ ...f, file, line: 1 }); + const res = await page.evaluate(observe, width === 1280, pageMeta); + const measured = new Map(); + for (const f of res) { + if (f.probe == null) continue; + if (!measured.has(f.probe)) measured.set(f.probe, await pixelBehind(page, f.probe)); + const bg = measured.get(f.probe); + if (!bg) continue; + const real = contrast(f.fg, bg); + if (real >= f.threshold - 0.05) f.drop = true; + else f.evidence = f.evidence.replace(/computed contrast [\d.]+:1/, `contrast ${real.toFixed(2)}:1 against the pixels behind`).replace(/\([\d.]+:1\)$/, `(${real.toFixed(2)}:1)`); + } + for (const f of res) if (!f.drop) { const { probe, fg, threshold, drop, ...rest } = f; findings.push({ ...rest, file, line: 1, evidence: `[${width}px] ${f.evidence}` }); } + } + for (const [w, h] of [[1440, 900], [1920, 1080]]) { + await page.setViewport({ width: w, height: h }); + await page.evaluate(() => window.scrollTo(0, 0)).catch(() => {}); + await frames(page); + await shoot(page, file, `${prefix}${w}x${h}`, false); + if (!heroOnly && w === 1440) { + await settleImages(page); + await shoot(page, file, '1440-full', true); + } + await frames(page); + const res = await page.evaluate(observeSpace, w === 1440, heroOnly, meta.heroPostureByFile[file] || '', !!meta.photoShapeByFile[file], meta.jobByFile[file] || ''); + for (const f of res) findings.push({ ...f, file, line: 1, evidence: `[${w}px] ${f.evidence}` }); + } + if (!heroOnly) { + await page.setViewport({ width: 1440, height: 900 }); + await frames(page); + inventories[file] = await page.evaluate(inventory, (meta.selectors && meta.selectors[file]) || []).catch(() => null); + const quality = await page.evaluate(observeQuality, meta.scope).catch(() => []); + const hidden = await page.evaluate(observeOcclusion).catch(() => []); + for (const f of [...quality, ...hidden]) findings.push({ ...f, file, line: 1, evidence: `[1440px] ${f.evidence}` }); + await page.evaluate(() => { window.scrollTo(0, 0); if (document.activeElement && document.activeElement.blur) document.activeElement.blur(); }); + const rings = new Set(); + const bare = []; + for (let i = 0; i < 16; i++) { + await page.keyboard.press('Tab'); + await frames(page); + const ring = await page.evaluate(focusRing); + if (!ring || rings.has(ring.key)) continue; + rings.add(ring.key); + if (ring.bare) { if (bare.length < 4) bare.push(ring.key); continue; } + if (ring.ratio != null && ring.ratio < 2.95) { const bg = await pixelsAroundRing(page, ring); if (bg) ring.ratio = contrast(ring.ring, bg); } + if (ring.ratio != null && ring.ratio < 2.95) findings.push({ gate: '26a', grade: 'FAIL', file, line: 1, evidence: `[1440px] focus ring ${ring.ratio.toFixed(2)}:1 against what is behind it on ${ring.key}`, fix: 'A ring at 3:1 or better against the surface it is drawn over: --color-focus, or a ring colour per band' }); + } + if (bare.length) findings.push({ gate: '26a', grade: 'FAIL', file, line: 1, evidence: `[1440px] nothing shows keyboard focus on ${bare.join(', ')}`, fix: 'Give every control a :focus-visible ring; never remove an outline without putting one back' }); + } + if (!heroOnly) { + await page.setViewport({ width: 1440, height: 900 }); + await frames(page); + await page.evaluate(() => { + window.__hmSeen = [...document.querySelectorAll('p, li, h1, h2, h3, h4, dd, td, blockquote, figcaption')].filter((el) => { + const cs = getComputedStyle(el); const r = el.getBoundingClientRect(); + return cs.display !== 'none' && cs.visibility !== 'hidden' && r.width > 1 && r.height > 1 && !el.closest('nav, header, dialog, [hidden], [aria-hidden="true"]'); + }); + }).catch(() => {}); + await page.setViewport({ width: 375, height: 800 }); + await frames(page); + const cut = await page.evaluate(() => { + const flat = (t) => (t || '').replace(/\s+/g, ' ').trim(); + const shown = flat(document.body.innerText); + const gone = (window.__hmSeen || []).filter((el) => { + const cs = getComputedStyle(el); const r = el.getBoundingClientRect(); + if (!(cs.display === 'none' || cs.visibility === 'hidden' || r.width < 1 || r.height < 1)) return false; + const t = flat(el.textContent); + return t.length > 12 && !shown.includes(t); + }); + const off = [...document.querySelectorAll('table')].flatMap((t) => (t.rows[0] ? [...t.rows[0].cells] : [])).filter((el) => { const r = el.getBoundingClientRect(); return r.width > 1 && r.height > 1 && r.left >= window.innerWidth - 2; }); + return { words: gone.reduce((n, el) => n + flat(el.textContent).split(' ').length, 0), first: gone[0] ? flat(gone[0].textContent).slice(0, 36) : '', off: off.length, col: off[0] ? flat(off[0].textContent).slice(0, 24) : '' }; + }).catch(() => ({ words: 0, off: 0 })); + if (cut.words >= 40) findings.push({ gate: 'F25', grade: 'WARN', file, line: 1, evidence: `[375px] ${cut.words} words shown at 1440 are hidden on a phone (first: "${cut.first}")`, fix: 'If it matters, make it work on a phone; if it does not, cut it everywhere' }); + if (cut.off >= 2) findings.push({ gate: 'F25', grade: 'WARN', file, line: 1, evidence: `[375px] a table opens with ${cut.off} columns off-screen (from "${cut.col}")`, fix: 'Keep the column that names the row and the one that acts on it in view: restack each row, or pin the first column' }); + } + if (scriptErrors.length) findings.push({ gate: 'render', grade: 'FAIL', file, line: 1, evidence: `a script threw on load: ${scriptErrors[0].slice(0, 90)}`, fix: 'Fix the script; a page that throws ships half-working' }); + if (lost.size) findings.push({ gate: 'render', grade: 'WARN', file, line: 1, evidence: `the shots show a fallback: fonts or stylesheets did not load (${[...lost].slice(0, 2).join(', ')})`, fix: 'Recapture when the host answers or the path is right; never review or sign off a fallback face' }); + } catch (e) { + console.error(`render tier: failed on ${file}: ${e.message}`); + failed.push({ file, message: e.message }); + } finally { + await page.close().catch(() => {}); + } + } + } finally { + await browser.close().catch(() => {}); + } + if (SHOTS.length) console.error(heroOnly ? `render tier: ${SHOTS.length} hero screenshots in ${dirname(SHOTS[0])} (1280x800, 1440x900, 1920x1080 and 375x812 first screens)` : `render tier: ${SHOTS.length} screenshots in ${dirname(SHOTS[0])} (1280x800, 1440x900, 1920x1080 folds; 1440 and 375 full pages)`); + + const seen = new Set(); + const kept = findings.filter((f) => { + const k = f.file + '|' + f.gate + '|' + f.evidence.replace(/^\[\d+px\] /, ''); + if (seen.has(k)) return false; + seen.add(k); + return true; + }); + kept.failed = failed; + kept.inventories = inventories; + return kept; +} + +export function writeCompare(targets, note) { + const groups = new Map(); + for (const t of targets) { + const dir = isUrl(t) ? join(process.cwd(), '.hallmark') : join(dirname(t), '.hallmark'); + if (!groups.has(dir)) groups.set(dir, []); + groups.get(dir).push(slugOf(t)); + } + const esc = (x) => String(x).replace(/[&<>"]/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"' }[c])); + const made = []; + for (const [dir, slugs] of groups) { + const has = (side, slug, tag) => existsSync(join(dir, side, `${slug}-${tag}.png`)); + const pages = slugs.filter((x) => has('before', x, '1440x900') && has('shots', x, '1440x900')); + if (!pages.length) continue; + const pair = (slug, tag, label, cls) => (has('before', slug, tag) && has('shots', slug, tag) ? `
          ${esc(slug)} before, ${label}
          Before, ${label}
          ${esc(slug)} after, ${label}
          After, ${label}
          ` : ''); + const body = pages.map((x) => `

          ${esc(x)}

          ${pair(x, '1440x900', 'first screen at 1440', '')}${pair(x, '1440-full', 'whole page at 1440', '')}${pair(x, '375', 'whole page on a phone', 'phone')}
          `).join('\n'); + const html = ` + + + + +Before and after + + + + +

          Before and after

          +

          ${esc(note || 'Each pair shows the page as it stood and as it stands now, at the same size.')}

          +${body} + + +`; + writeFileSync(join(dir, 'compare.html'), html); + made.push(join(dir, 'compare.html')); + } + return made; +} + +function inventory(selectors) { + const base = location.pathname.slice(0, location.pathname.lastIndexOf('/') + 1); + const key = (raw) => { + try { + const u = new URL(raw, location.href); + if (!/^(https?|file):$/.test(u.protocol)) return raw.trim(); + if (u.origin !== location.origin) return u.href; + if (u.pathname === location.pathname && u.search === location.search && u.hash) return u.hash; + return (location.protocol === 'file:' && u.pathname.startsWith(base) ? u.pathname.slice(base.length) : u.pathname) + u.search + u.hash; + } catch { return raw.trim(); } + }; + const uniq = (a) => [...new Set(a.filter(Boolean))]; + const text = (el) => (el.innerText || el.textContent || '').replace(/\s+/g, ' ').trim(); + const quiet = (el) => !!el.closest('script, style, noscript, template'); + const links = uniq([...document.querySelectorAll('a[href]')].map((a) => a.getAttribute('href')).filter((h) => h && h.trim() && h.trim() !== '#').map(key)); + const fieldsIn = (root) => { + const n = {}; + return uniq([...root.querySelectorAll('input, select, textarea, button[name]')].filter((f) => f.getAttribute('name') || !(f.tagName === 'INPUT' && /^(submit|button|reset|image|hidden)$/i.test(f.getAttribute('type') || ''))).map((f) => { + const hook = f.getAttribute('data-testid') || f.getAttribute('data-test') || f.getAttribute('data-cy'); + if (f.getAttribute('name')) return f.getAttribute('name'); + if (f.id && !/^(:|radix-|headlessui-|react-aria)/.test(f.id)) return `#${f.id}`; + if (hook) return `[${hook}]`; + const t = f.tagName === 'INPUT' ? (f.getAttribute('type') || 'text').toLowerCase() : f.tagName.toLowerCase(); + n[t] = (n[t] || 0) + 1; + return `unnamed ${t} ${n[t]}`; + })); + }; + const fields = fieldsIn(document); + const actions = uniq([...document.querySelectorAll('form[action]')].map((f) => `${(f.getAttribute('method') || 'get').toLowerCase()} ${key(f.getAttribute('action'))}`)); + const forms = [...document.querySelectorAll('form')].map((f, i) => ({ + key: f.id ? `#${f.id}` : f.getAttribute('action') ? `${(f.getAttribute('method') || 'get').toLowerCase()} ${key(f.getAttribute('action'))}` : `form ${i + 1}`, + attrs: [`method=${(f.getAttribute('method') || 'get').toLowerCase()}`, f.getAttribute('action') ? `action=${key(f.getAttribute('action'))}` : '', f.hasAttribute('novalidate') ? 'novalidate' : ''].filter(Boolean), + fields: fieldsIn(f), + hidden: uniq([...f.querySelectorAll('input[type="hidden"][name]')].map((c) => `${c.getAttribute('name')}=${c.getAttribute('value') || ''}`)), + submits: f.querySelectorAll('button:not([type]), button[type="submit"], input[type="submit"], input[type="image"]').length, + controls: uniq([...f.querySelectorAll('button, input, select, textarea')].map((c) => `${c.tagName.toLowerCase()}${c.getAttribute('type') ? `[type=${c.getAttribute('type')}]` : ''}${c.getAttribute('name') ? `[name=${c.getAttribute('name')}]` : ''}`)), + })); + const hooked = (selectors || []).filter((x) => { try { return !!document.querySelector(x); } catch { return false; } }); + const headings = uniq([...document.querySelectorAll('h1, h2, h3, h4')].filter((h) => !quiet(h)).map((h) => text(h).toLowerCase().replace(/[\p{Extended_Pictographic}\uFE0F\u200d]/gu, '').replace(/\s+/g, ' ').trim()).filter((t) => t.length > 1)); + const body = text(document.body); + const figures = uniq((body.match(/[$€£¥]\s?\d[\d,.]*\+?[kKmM]?|\b\d[\d,.]*\s?%|\b\d[\d,.]*[kKmM]?\+(?=\s|$)|\b\d{1,3}(?:,\d{3})+\b|\b\d{1,2}[:.]\d{2}\s?(?:am|pm)?\b|\b(?:19|20)\d{2}\b|\b\d+(?:\.\d+)?\s(?:hours?|minutes?|mins?|days?|weeks?|months?|years?|seconds?|ms|km|kg|g|ml|mm|cm|gb|mb|tb|x)\b|\+?\d[\d\s().-]{7,}\d/gi) || []).map((t) => t.replace(/\s+/g, '').toLowerCase())); + const images = uniq([...document.querySelectorAll('img[src]')].map((i) => (i.getAttribute('src') || '').split('?')[0].split('/').pop())); + const controls = document.querySelectorAll('button, [role="button"], input[type="submit"], input[type="button"], select, textarea, input:not([type="hidden"])').length; + return { links, fields, actions, forms, hooked, headings, figures, images, controls, words: body ? body.split(' ').length : 0 }; +} + +function focusRing() { + let el = document.activeElement; + if (!el || el === document.body || el === document.documentElement) return null; + const box = el.getBoundingClientRect(); + if (box.width < 4 || box.height < 4) el = (el.labels && el.labels[0]) || el.closest('label') || el.parentElement; + if (!el) return null; + el.style.setProperty('transition', 'none', 'important'); + const cs = getComputedStyle(el); + const key = el.tagName.toLowerCase() + (el.classList[0] ? '.' + el.classList[0] : '') + ((el.textContent || '').trim() ? ` "${el.textContent.trim().slice(0, 18)}"` : ''); + if (cs.outlineStyle === 'none' || !(parseFloat(cs.outlineWidth) > 0)) { + const active = document.activeElement; + const chain = []; for (let n = el, i = 0; n && n !== document.body && i < 5; n = n.parentElement, i++) chain.push(n); + const look = () => chain.flatMap((n) => [null, '::before', '::after'].map((ps) => { const c = getComputedStyle(n, ps); return [c.outlineStyle, c.outlineWidth, c.boxShadow, c.borderTopColor, c.borderBottomColor, c.borderLeftColor, c.borderBottomWidth, c.backgroundColor, c.backgroundImage, c.color, c.textDecorationLine, c.opacity].join('|'); })).join('~'); + const focused = look(); + active.blur(); + const rest = look(); + active.focus({ preventScroll: true }); + return { key, ratio: null, bare: focused === rest }; + } + const cv = document.createElement('canvas'); cv.width = cv.height = 1; + const cx = cv.getContext('2d', { willReadFrequently: true }); + const rgb = (str) => { cx.clearRect(0, 0, 1, 1); cx.fillStyle = 'rgba(0, 0, 0, 0)'; cx.fillStyle = str; cx.fillRect(0, 0, 1, 1); const d = cx.getImageData(0, 0, 1, 1).data; return [d[0] / 255, d[1] / 255, d[2] / 255, d[3] / 255]; }; + const lin = (c) => (c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4); + const Y = (c) => 0.2126 * lin(c[0]) + 0.7152 * lin(c[1]) + 0.0722 * lin(c[2]); + let node = parseFloat(cs.outlineOffset) < 0 ? el : el.parentElement; + let bg = null; + for (; node && node !== document.documentElement; node = node.parentElement) { const c = rgb(getComputedStyle(node).backgroundColor); if (c[3] >= 0.9) { bg = c; break; } } + if (!bg) { const b = rgb(getComputedStyle(document.body).backgroundColor); bg = b[3] > 0 ? b : [1, 1, 1, 1]; } + const ring = rgb(cs.outlineColor); + if (ring[3] < 0.5) return { key, ratio: null }; + const a = Y(ring), b = Y(bg); + const r = el.getBoundingClientRect(); + const pad = Math.max(0, parseFloat(cs.outlineOffset)) + parseFloat(cs.outlineWidth) + 3; + return { key, ring: ring.slice(0, 3), ratio: (Math.max(a, b) + 0.05) / (Math.min(a, b) + 0.05), rect: { x: r.left, y: r.top, w: r.width, h: r.height }, pad }; +} + +async function pixelsAroundRing(page, ring) { + let handle, restore; + try { + handle = await page.evaluateHandle(() => { + let el = document.activeElement; + if (el) { const b = el.getBoundingClientRect(); if (b.width < 4 || b.height < 4) el = el.closest('label') || el.parentElement; } + return el; + }); + const el = handle.asElement(); + if (!el) return null; + restore = await hideStyles(el, [['outline-style', 'none'], ['box-shadow', 'none']]); + await frames(page); + const vw = await page.evaluate(() => [innerWidth, innerHeight, scrollX, scrollY]); + const x = Math.max(0, ring.rect.x - ring.pad), y = Math.max(0, ring.rect.y - ring.pad); + const clip = { x: x + vw[2], y: y + vw[3], width: Math.min(vw[0], ring.rect.x + ring.rect.w + ring.pad) - x, height: Math.min(vw[1], ring.rect.y + ring.rect.h + ring.pad) - y }; + if (clip.width < 4 || clip.height < 4) return null; + const data = await page.screenshot({ clip, encoding: 'base64' }); + return await page.evaluate(async (b64, inner) => { + const img = new Image(); img.src = 'data:image/png;base64,' + b64; await img.decode(); + const c = document.createElement('canvas'); c.width = img.width; c.height = img.height; + const x = c.getContext('2d'); x.drawImage(img, 0, 0); + const d = x.getImageData(0, 0, c.width, c.height).data; + const ch = [[], [], []]; + for (let py = 0; py < c.height; py++) for (let px = 0; px < c.width; px++) { + if (px >= inner.l && px < inner.r && py >= inner.t && py < inner.b) continue; + const i = (py * c.width + px) * 4; ch[0].push(d[i]); ch[1].push(d[i + 1]); ch[2].push(d[i + 2]); + } + if (!ch[0].length) return null; + return ch.map((a) => a.sort((p, q) => p - q)[a.length >> 1] / 255); + }, data, { l: ring.rect.x - x, t: ring.rect.y - y, r: ring.rect.x - x + ring.rect.w, b: ring.rect.y - y + ring.rect.h }); + } catch { return null; } + finally { + if (restore) await restore(); + if (handle) await handle.dispose().catch(() => {}); + } +} + +function observe(checkFold, meta) { + meta = meta || { genre: null, posture: 'restrained' }; + const out = []; + const push = (gate, grade, evidence, fix, extra) => out.push({ gate: String(gate), grade, evidence, fix, ...(extra || {}) }); + const describe = (el) => { + const cls = (el.className && typeof el.className === 'string') ? '.' + el.className.trim().split(/\s+/).slice(0, 2).join('.') : ''; + return el.tagName.toLowerCase() + cls; + }; + const visible = (el) => { + const cs = getComputedStyle(el); + if (cs.display === 'none' || cs.visibility === 'hidden' || parseFloat(cs.opacity) === 0) return false; + const r = el.getBoundingClientRect(); + return r.width > 1 && r.height > 1; + }; + + if (document.documentElement.scrollWidth > window.innerWidth + 1) { + push(34, 'FAIL', `horizontal scroll: scrollWidth ${document.documentElement.scrollWidth} > viewport ${window.innerWidth}`, + 'overflow-x: clip on html and body; find the overflowing block'); + } + + if (window.innerWidth === 375) { + const clipped = (el) => { for (let q = el.parentElement; q && q !== document.body && q !== document.documentElement; q = q.parentElement) { const cs = getComputedStyle(q); if (/hidden|clip|auto|scroll/.test(`${cs.overflowX} ${cs.overflow}`)) return true; } return false; }; + const spill = [...document.querySelectorAll('body *')].find((el) => { if (!visible(el) || getComputedStyle(el).position === 'fixed' || el.closest('svg') || clipped(el)) return false; const r = el.getBoundingClientRect(); return r.right > window.innerWidth + 2 || r.left < -2; }); + if (spill && document.documentElement.scrollWidth <= window.innerWidth + 1) { const r = spill.getBoundingClientRect(); push(34, 'FAIL', `${describe(spill)} runs ${Math.round(Math.max(r.right - window.innerWidth, -r.left))}px past the 375 screen, hidden only by the page's clip`, 'Stack it under 60rem: drop the desktop column gap, widths and offsets on the phone'); } + for (const sl of document.querySelectorAll('[data-slot]')) { const cs = getComputedStyle(sl); if (cs.display === 'none' || !sl.getClientRects().length || sl.closest('[hidden]')) continue; const r = sl.getBoundingClientRect(); if (r.width < 40 || r.height < 40) { push('F18', 'WARN', `slot "${sl.getAttribute('data-slot')}" renders at ${Math.round(r.width)} x ${Math.round(r.height)}px on a phone`, 'The slot collapsed: give it width: 100% and an aspect-ratio in the stacked layout'); break; } } + const flush = [...document.querySelectorAll('p, li, h1, h2, h3, blockquote, dd')].find((el) => { + if (!visible(el) || el.closest('nav, pre, table, [data-slot]')) return false; + const own = [...el.childNodes].filter((n) => n.nodeType === 3 && n.textContent.trim().length >= 20); + if (own.reduce((n, t) => n + t.textContent.trim().length, 0) < 40) return false; + let left = Infinity, right = -Infinity; + for (const t of own) { const range = document.createRange(); range.selectNodeContents(t); for (const r of range.getClientRects()) { if (r.width < 2) continue; left = Math.min(left, r.left); right = Math.max(right, r.right); } } + return right - left > 120 && right <= window.innerWidth + 1 && (left < 8 || right > window.innerWidth - 8); + }); + if (flush) push(72, 'REFLEX', `text runs to the edge of the screen (${describe(flush)})`, 'Give the page a gutter: 16px or more at each side on a phone'); + } + + for (const el of document.querySelectorAll('a, button, [role="button"], [role="tab"]')) { + if (!visible(el)) continue; + const text = (el.textContent || '').trim(); + if (!text) continue; + const isButton = el.tagName === 'BUTTON' || el.getAttribute('role') === 'button' || /btn|button|cta/i.test(typeof el.className === 'string' ? el.className : ''); + const block = el.closest('p, li, dd, td, blockquote, figcaption'); + if (!isButton && block && (block.innerText || '').trim().length > text.length + 12) continue; + if ([...el.querySelectorAll('*')].some((d) => !d.closest('svg') && /^(block|flex|grid|list-item|table)$/.test(getComputedStyle(d).display))) continue; + const cs = getComputedStyle(el); + const lh = parseFloat(cs.lineHeight) || parseFloat(cs.fontSize) * 1.4; + const tops = []; + const walker = document.createTreeWalker(el, NodeFilter.SHOW_TEXT); + for (let n = walker.nextNode(); n; n = walker.nextNode()) { + const host = n.parentElement; + if (!n.textContent.trim() || !host || host.closest('svg')) continue; + const hr = host.getBoundingClientRect(); + if (hr.width <= 2 || hr.height <= 2) continue; + const range = document.createRange(); + range.selectNodeContents(n); + for (const r of range.getClientRects()) if (r.width > 0 && r.height > 0) tops.push(r.top); + } + tops.sort((a, b) => a - b); + let lines = tops.length ? 1 : 0; + for (let i = 1; i < tops.length; i++) if (tops[i] - tops[i - 1] > lh * 0.6) lines++; + if (lines > 1) { + const primary = isButton || (!!el.closest('nav') && !el.closest('footer') && !el.closest('nav[aria-label*="bread" i]')); + push(primary ? '49a' : '49b', primary ? 'FAIL' : 'REFLEX', `${primary ? 'control' : 'link'} "${text.slice(0, 32)}" wraps to ${lines} lines (${describe(el)})`, + 'Shorten the label or set nowrap'); + } + } + + if (checkFold) { + const h1 = document.querySelector('h1'); + if (h1 && visible(h1)) { + const hr = h1.getBoundingClientRect(); + const scope = h1.closest('section, header, main, div') || document.body; + let cta = null; + for (const c of scope.querySelectorAll('a, button')) { + if (visible(c) && (c.textContent || '').trim()) { cta = c; break; } + } + const fold = 800; + if (hr.bottom > fold || hr.top < 0) { + push('44b', 'FAIL', `h1 crosses the 1280x800 fold (bottom ${Math.round(hr.bottom)}px)`, + 'Right-size the display clamp to the fold'); + } else if (cta) { + const cr = cta.getBoundingClientRect(); + if (cr.bottom > fold) { + push('44b', 'FAIL', `primary CTA below the 1280x800 fold (bottom ${Math.round(cr.bottom)}px)`, + 'Trim hero padding so the CTA fits the fold'); + } + } + } + } + + if (checkFold) { + const lin = (c) => (c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4); + const cvs = document.createElement('canvas'); cvs.width = cvs.height = 1; + const ctx2 = cvs.getContext('2d', { willReadFrequently: true }); + const toRgb = (str) => { ctx2.clearRect(0, 0, 1, 1); ctx2.fillStyle = 'rgba(0, 0, 0, 0)'; ctx2.fillStyle = str; ctx2.fillRect(0, 0, 1, 1); const d = ctx2.getImageData(0, 0, 1, 1).data; return { r: d[0] / 255, g: d[1] / 255, b: d[2] / 255, a: d[3] / 255 }; }; + const parse = (s) => { + if (!s || s === 'transparent') return null; + const m = /^rgba?\(([\d.]+),\s*([\d.]+),\s*([\d.]+)(?:,\s*([\d.]+))?\)$/.exec(s.trim()); + if (m) return { r: +m[1] / 255, g: +m[2] / 255, b: +m[3] / 255, a: m[4] == null ? 1 : +m[4] }; + const alpha = /\/\s*([\d.]+%?)\s*\)$/.exec(s); + const c = toRgb(s); + if (alpha) c.a = alpha[1].endsWith('%') ? parseFloat(alpha[1]) / 100 : parseFloat(alpha[1]); + return c; + }; + const lum = (c) => 0.2126 * lin(c.r) + 0.7152 * lin(c.g) + 0.0722 * lin(c.b); + const ratio = (a, b) => { + const la = lum(a), lb = lum(b); + return (Math.max(la, lb) + 0.05) / (Math.min(la, lb) + 0.05); + }; + const bgOf = (el) => { + let node = el; + while (node && node !== document.documentElement) { + const c = parse(getComputedStyle(node).backgroundColor); + if (c && c.a >= 0.9) return c; + node = node.parentElement; + } + const root = parse(getComputedStyle(document.body).backgroundColor); + return root && root.a > 0 ? root : { r: 1, g: 1, b: 1, a: 1 }; + }; + const over = (top, base) => ({ r: top.r * top.a + base.r * (1 - top.a), g: top.g * top.a + base.g * (1 - top.a), b: top.b * top.a + base.b * (1 - top.a), a: 1 }); + const gradStops = (el, base) => { + const out = []; + for (let node = el; node && node !== document.documentElement; node = node.parentElement) { + const cs2 = getComputedStyle(node); + if (/gradient/.test(cs2.backgroundImage)) { + const layers = []; let depth = 0, cur = ''; + for (const ch of cs2.backgroundImage) { if (ch === '(') depth++; if (ch === ')') depth--; if (ch === ',' && depth === 0) { layers.push(cur); cur = ''; } else cur += ch; } + layers.push(cur); + const sizes = cs2.backgroundSize.split(','); + for (const [li, layer] of layers.entries()) { + const bh = /\s([\d.]+)px\s*$/.exec((sizes[li] || sizes[0] || '').trim()); if (bh && parseFloat(bh[1]) <= 6) continue; + if (!/^\s*(linear|radial|conic)-gradient/.test(layer) || /[\s,(]\d(?:\.\d+)?px\b/.test(layer)) continue; + for (const m of layer.matchAll(/(?:oklch|oklab|lab|lch|rgba?|hsla?|color)\([^()]*\)|#[0-9a-fA-F]{3,8}\b/g)) out.push(over(toRgb(m[0]), base)); + } + } + const c = parse(cs2.backgroundColor); + if (c && c.a >= 0.9) break; + } + return out; + }; + let reported = 0; + const seenSel = new Set(); + for (const el of document.querySelectorAll('body *')) { + if (reported >= 10) break; + if (!visible(el) || el.closest('svg')) continue; + const hasText = [...el.childNodes].some((n) => n.nodeType === 3 && n.textContent.trim().length > 2); + if (!hasText) continue; + const cs = getComputedStyle(el); + const fg = parse(cs.color); + if (!fg || fg.a < 0.9) continue; + const bg = bgOf(el); + const size = parseFloat(cs.fontSize); + const weight = parseInt(cs.fontWeight, 10) || 400; + const large = size >= 24 || (size >= 18 && weight >= 700); + const threshold = large ? 3.0 : 4.5; + const key = describe(el); + const where = `${key} "${(el.innerText || el.textContent || '').replace(/\s+/g, ' ').trim().slice(0, 24)}"`; + const stops = gradStops(el, bg); + if (stops.length && !seenSel.has(key)) { + const rs = stops.map((c) => ratio(fg, c)); + const worst = Math.min(...rs), best = Math.max(...rs); + if (best < threshold - 0.05) { seenSel.add(key); reported++; push(40, 'FAIL', `contrast ${best.toFixed(2)}:1 at best over the gradient behind ${where}`, 'Raise the contrast to threshold, or give the text its own ground'); } + else if (worst < threshold - 0.05) { seenSel.add(key); reported++; push(40, 'WARN', `contrast drops to ${worst.toFixed(2)}:1 over the gradient behind ${where}`, 'Check the text where the gradient is darkest or lightest; give the label its own ground'); } + continue; + } + const r = ratio(fg, bg); + if (r < threshold - 0.05 && !seenSel.has(key)) { + seenSel.add(key); + reported++; + el.setAttribute('data-hm-probe', String(reported)); + const probe = { probe: reported, fg: [fg.r, fg.g, fg.b], threshold }; + push(40, 'FAIL', `computed contrast ${r.toFixed(2)}:1 < ${threshold}:1 on ${where}`, + 'Raise the contrast to threshold', probe); + const btnish = el.closest('a, button, [class*="btn"], [class*="cta"]'); + if (btnish && r < 1.6) { + push(41, 'FAIL', `button text ~ button fill on ${key} (${r.toFixed(2)}:1)`, + 'Use accent-ink or paper for the label', probe); + } + } + } + } + + if (checkFold && meta.posture === 'restrained') { + const cs0 = getComputedStyle(document.documentElement); + + const cv3 = document.createElement('canvas'); cv3.width = cv3.height = 1; + const cx3 = cv3.getContext('2d', { willReadFrequently: true }); + const toRgb = (str) => { + str = (str || '').trim(); + if (!str || str === 'transparent') return null; + cx3.clearRect(0, 0, 1, 1); cx3.fillStyle = 'rgba(1, 2, 3, 0.5)'; cx3.fillStyle = str; + if (cx3.fillStyle === 'rgba(1, 2, 3, 0.5)') return null; + cx3.fillRect(0, 0, 1, 1); + const d = cx3.getImageData(0, 0, 1, 1).data; + return [d[0], d[1], d[2], d[3] / 255]; + }; + const targets = ['--color-accent', '--color-accent-2'] + .map((t) => toRgb(cs0.getPropertyValue(t).trim())).filter(Boolean); + if (targets.length) { + const near = (str) => { + const p = toRgb(str); + if (!p || p[3] < 0.5) return false; + return targets.some((t) => Math.abs(t[0] - p[0]) + Math.abs(t[1] - p[1]) + Math.abs(t[2] - p[2]) <= 30); + }; + const CW = 16, COLS = Math.ceil(innerWidth / CW), ROWS = Math.ceil(800 / CW); + const grid = new Uint8Array(COLS * ROWS); + let walked = 0; + for (const el of document.querySelectorAll('body, body *')) { + if (++walked > 4000) break; + if (el !== document.body && !visible(el)) continue; + const cs = getComputedStyle(el); + const isBg = near(cs.backgroundColor); + const isTxt = near(cs.color) && parseFloat(cs.fontSize) >= 32 && + [...el.childNodes].some((nd) => nd.nodeType === 3 && nd.textContent.trim()); + if (!isBg && !isTxt) continue; + const r = el.getBoundingClientRect(); + const x0 = Math.max(0, Math.floor(r.left / CW)); + const x1 = Math.min(COLS - 1, Math.floor((Math.min(r.right, innerWidth) - 1) / CW)); + const y0 = Math.max(0, Math.floor(r.top / CW)); + const y1 = Math.min(ROWS - 1, Math.floor((Math.min(r.bottom, 800) - 1) / CW)); + const turned = cs.transform !== 'none' && !/^matrix\(1, 0, 0, 1, /.test(cs.transform); + for (let y = y0; y <= y1; y++) for (let x = x0; x <= x1; x++) { + if (turned) { const hit = document.elementFromPoint(x * CW + CW / 2, y * CW + CW / 2); if (!hit || !(hit === el || el.contains(hit))) continue; } + grid[y * COLS + x] = 1; + } + } + let filled = 0; + for (const c of grid) filled += c; + const pct = (100 * filled) / (COLS * ROWS); + const warnAt = meta.genre === 'atmospheric' ? 20 : 5; + const failAt = meta.genre === 'atmospheric' ? 30 : 8; + if (pct > failAt) { + push(23, 'FAIL', `accent paints ~${pct.toFixed(1)}% of the 1280x800 viewport (> ${failAt}%)`, + 'Retreat the accent to <= 5%; large colour belongs to paper/field tokens or a declared posture'); + } else if (pct > warnAt) { + push(23, 'WARN', `accent paints ~${pct.toFixed(1)}% of the 1280x800 viewport`, + 'Confirm this is a declared posture surface, else retreat to <= 5%'); + } + } + } + + if (checkFold) { + const sticky = []; + for (const el of document.querySelectorAll('body *')) { + const cs = getComputedStyle(el); + if (cs.position === 'sticky' && parseFloat(cs.top) === 0) sticky.push(el); + } + if (sticky.length >= 2) { + push(56, 'FAIL', `two sticky top:0 elements: ${sticky.slice(0, 2).map(describe).join(' + ')}`, + 'Offset the second sticky by banner height'); + } + } + + return out; +} + +// F26: a paragraph whose last line is one short word (a straggler), or a head of two or three lines whose last line is a stub +function lineBreaks() { + const out = []; + const vis = (el) => { const s = getComputedStyle(el); if (s.display === 'none' || s.visibility === 'hidden' || parseFloat(s.opacity) === 0) return false; const r = el.getBoundingClientRect(); return r.width > 1 && r.height > 1; }; + const lines = (el) => { + const rows = []; + const w = document.createTreeWalker(el, NodeFilter.SHOW_TEXT); + for (let t = w.nextNode(); t; t = w.nextNode()) { + if (!t.textContent.trim() || t.parentElement.closest('svg, [aria-hidden="true"]')) continue; + const rg = document.createRange(); rg.selectNodeContents(t); + for (const q of rg.getClientRects()) { + if (!q.width || !q.height) continue; + const row = rows.find((x) => Math.abs(x.mid - (q.top + q.height / 2)) < q.height / 3); + if (row) { row.l = Math.min(row.l, q.left); row.r = Math.max(row.r, q.right); } else rows.push({ mid: q.top + q.height / 2, l: q.left, r: q.right }); + } + } + return rows.sort((a, b) => a.mid - b.mid).map((x) => x.r - x.l); + }; + const bad = []; + for (const e of document.querySelectorAll('p, li, blockquote, h1, h2, h3')) { + if (bad.length >= 3 || !vis(e) || e.closest('nav, footer, svg, pre, code, table, [aria-hidden="true"], [data-slot]') || e.querySelector('br')) continue; + const text = (e.innerText || '').trim(); const words = text.split(/\s+/).length; + if (words < 4 || e.getBoundingClientRect().width < 200) continue; + const cs = getComputedStyle(e); const wrap = `${cs.textWrap || ''} ${cs.textWrapStyle || ''}`; + if (/flex|grid|table/.test(cs.display) || [...e.children].some((c) => /flex|grid|block|table/.test(getComputedStyle(c).display))) continue; + const ls = lines(e); if (ls.length < 2) continue; + const last = ls[ls.length - 1], widest = Math.max(...ls), prev = ls[ls.length - 2]; + const head = /^H[123]$/.test(e.tagName); + if (head && ls.length <= 3 && !/balance/.test(wrap) && last < prev * 0.35) bad.push(`${e.tagName.toLowerCase()} "${text.replace(/\s+/g, ' ').slice(0, 32)}" ends on a stub`); + else if (!head && !/pretty|balance/.test(wrap) && !/\s/.test(text.split(/\s+/).slice(-1)[0]) && last < widest * 0.3 && ls.length >= 2 && (e.innerText || '').trim().split('\n').pop().trim().split(/\s+/).length === 1) bad.push(`"${text.replace(/\s+/g, ' ').slice(0, 32)}" leaves one word on its last line`); + } + if (bad.length) out.push({ gate: 'F26', grade: 'WARN', evidence: `[${innerWidth}px] ${bad.join('; ')}`, fix: 'text-wrap: balance on heads and pretty on body copy, or rewrite the line; a
          goes only between phrases and is checked at 375' }); + return out; +} + +function observeSpace(atLaptop, heroOnly, heroPosture, photoShape, job) { + const freeFold = /^(poster|ledge|banner|custom)$/.test(heroPosture || ''); + const out = []; + const push = (gate, grade, evidence, fix) => out.push({ gate: String(gate), grade, evidence, fix }); + const vw = window.innerWidth, vh = window.innerHeight; + const vis = (el) => { const s = getComputedStyle(el); if (s.display === 'none' || s.visibility === 'hidden' || parseFloat(s.opacity) === 0) return false; const r = el.getBoundingClientRect(); return r.width > 1 && r.height > 1; }; + const abs = (el) => { const r = el.getBoundingClientRect(); return { top: r.top + scrollY, bottom: r.bottom + scrollY, left: r.left, right: r.right, w: r.width, h: r.height }; }; + let secs = [...document.querySelectorAll('section, main > div, footer')].filter((s) => vis(s) && s.getBoundingClientRect().height > 40); + secs = secs.filter((s) => !secs.some((o) => o !== s && o.contains(s))); + const h1 = document.querySelector('h1'); + const heroish = (el) => /^(SECTION|HEADER)$/.test(el.tagName) || [...el.classList].some((c) => /^hero(-[\w-]+)?$/i.test(c) || /(^|-)hero$/i.test(c)); + let hero = null; + for (let n = h1; n && n !== document.body; n = n.parentElement) if (heroish(n)) { hero = n; break; } + hero = hero || [...document.querySelectorAll('section, header, [class]')].find(heroish) || secs[0]; + const heroEnd = hero ? abs(hero).bottom : null; + + let stack = 0, textBox = null, fig = null; + if (hero && h1) { + const cta = [...hero.querySelectorAll('a, button')].filter((c) => vis(c) && (c.textContent || '').trim() && !c.closest('nav'))[0]; + const ctaTop = cta ? abs(cta).top : Infinity; + const texts = [...hero.querySelectorAll('h1, h2, p, small, [class*="sub"], [class*="lede"], [class*="eyebrow"], [class*="kicker"], [class*="label"]')].filter((e) => vis(e) && (e.innerText || '').trim() && !e.closest('nav, svg, table, figure, [data-slot], form, fieldset, label, output, [role="tabpanel"], [role="group"]') && abs(e).top < ctaTop); + const seen = []; + for (const e of texts) { if (seen.some((o) => o.contains(e) || e.contains(o))) continue; seen.push(e); } + stack = seen.length; + const ink = (el) => { let L = Infinity, T = Infinity, R = -Infinity, B = -Infinity; const w = document.createTreeWalker(el, NodeFilter.SHOW_TEXT); for (let t = w.nextNode(); t; t = w.nextNode()) { if (!t.textContent.trim() || t.parentElement.closest('svg')) continue; const rg = document.createRange(); rg.selectNodeContents(t); for (const q of rg.getClientRects()) { if (!q.width || !q.height) continue; L = Math.min(L, q.left); T = Math.min(T, q.top); R = Math.max(R, q.right); B = Math.max(B, q.bottom); } } return L === Infinity ? abs(el) : { top: T + scrollY, bottom: B + scrollY, left: L, right: R }; }; + const boxes = [h1, ...seen.filter((e) => Math.abs(abs(e).left - abs(h1).left) < 40)].map(ink); + textBox = { top: Math.min(...boxes.map((b) => b.top)), bottom: Math.max(...boxes.map((b) => b.bottom), cta ? abs(cta).bottom : 0), left: Math.min(...boxes.map((b) => b.left)), right: Math.max(...boxes.map((b) => b.right)) }; + let bestA = 0; + const clipped = (el) => { const r = el.getBoundingClientRect(); let L = r.left, T = r.top, R = r.right, B = r.bottom; for (let p = el.parentElement; p && p !== document.body; p = p.parentElement) { const cs = getComputedStyle(p); if (/hidden|clip/.test(`${cs.overflow} ${cs.overflowX} ${cs.overflowY}`)) { const q = p.getBoundingClientRect(); L = Math.max(L, q.left); T = Math.max(T, q.top); R = Math.min(R, q.right); B = Math.min(B, q.bottom); } } R = Math.min(R, vw); return { top: T + scrollY, bottom: B + scrollY, left: L, right: R, w: Math.max(0, R - L), h: Math.max(0, B - T) }; }; + const beside = (b) => b.left >= textBox.right - 40 || b.right <= textBox.left + 40; + const consider = (e) => { + if (!vis(e) || e.closest('nav') || e.contains(h1) || seen.some((t) => e.contains(t))) return; + const b = clipped(e); const a = b.w * b.h; + if (b.w > 160 && b.h > 120 && a > bestA && b.w < vw * 0.95 && beside(b)) { fig = b; fig.el = e; bestA = a; } + }; + for (const e of hero.querySelectorAll('svg, canvas, img, figure, video, picture, [data-slot], [class*="fig"], [class*="visual"], [class*="device"], [class*="demo"], [class*="shot"], [class*="illus"], [class*="panel"]')) consider(e); + if (!fig) { + const heroBg = getComputedStyle(hero).backgroundColor; + for (const e of hero.querySelectorAll('div, span, aside, i, b')) { + const cs = getComputedStyle(e); + if (cs.backgroundImage !== 'none' || (cs.backgroundColor !== 'rgba(0, 0, 0, 0)' && cs.backgroundColor !== heroBg) || parseFloat(cs.borderTopWidth) > 0) consider(e); + } + } + if (fig) { + fig.side = fig.left >= textBox.right - 40 ? 'right' : 'left'; + let lca = h1.parentElement; + while (lca && !lca.contains(fig.el)) lca = lca.parentElement; + let col = h1; + while (col.parentElement && col.parentElement !== lca) col = col.parentElement; + const cb = abs(col); + fig.colEdge = fig.side === 'right' ? Math.max(textBox.right, cb.right) : Math.min(textBox.left, cb.left); + } + } + + if (atLaptop) { + + const words = []; + const tw = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT); + let n; + while ((n = tw.nextNode())) { + const p = n.parentElement; if (!p || !vis(p) || p.closest('script, style, noscript, svg, [data-slot], [data-credits]')) continue; + const t = n.textContent.trim(); if (!t) continue; + const pr = p.getBoundingClientRect(); const c = t.split(/\s+/).filter((w) => /[A-Za-z]{2,}/.test(w)).length; if (c) words.push({ top: pr.top + scrollY, bottom: pr.bottom + scrollY, c }); + } + const H = document.documentElement.scrollHeight; + let maxWords = 0, at = 0; + for (let y = 0; y < H; y += 50) { const w = Math.round(words.reduce((a, x) => { const h = Math.max(1, x.bottom - x.top); const ov = Math.max(0, Math.min(x.bottom, y + 900) - Math.max(x.top, y)); return a + x.c * Math.min(1, ov / h); }, 0)); if (w > maxWords) { maxWords = w; at = y; } } + if (maxWords > 95) push(58, 'FAIL', `${maxWords} words on one screen (from y=${at})`, 'One idea per screen: cut to about 80 words, make the section an object'); + else if (maxWords > 80) push(58, 'WARN', `${maxWords} words on one screen (from y=${at})`, 'Close to the 80-word screen budget'); + if (stack > 2) push(58, 'FAIL', `hero carries ${stack} text blocks before its actions`, 'Headline, one sentence, actions; delete the rest'); + + const clipAbs = (el, stop) => { const r0 = el.getBoundingClientRect(); let T = r0.top, B = r0.bottom; for (let q = el.parentElement; q && q !== document.body; q = q.parentElement) { const cs = getComputedStyle(q); if (/hidden|clip/.test(`${cs.overflow} ${cs.overflowY}`)) { const qr = q.getBoundingClientRect(); T = Math.max(T, qr.top); B = Math.min(B, qr.bottom); } if (q === stop) break; } return { top: T + scrollY, bottom: B + scrollY }; }; + const content = (s) => { let top = Infinity, bottom = -Infinity; for (const c of s.querySelectorAll('*')) { if (!vis(c)) continue; if (!(c.innerText || '').trim() && !/^(SVG|IMG|CANVAS|VIDEO)$/.test(c.tagName) && getComputedStyle(c).backgroundColor === 'rgba(0, 0, 0, 0)') continue; if (c.children.length && ![...c.childNodes].some((n) => n.nodeType === 3 && n.textContent.trim()) && !/^(SVG)$/.test(c.tagName) && getComputedStyle(c).backgroundColor === 'rgba(0, 0, 0, 0)') continue; const b = clipAbs(c, s); if (b.bottom <= b.top) continue; top = Math.min(top, b.top); bottom = Math.max(bottom, b.bottom); } if (top === Infinity) { const b = abs(s); return b; } return { top, bottom }; }; + // a paper is a colour or a painted image (a gradient, a split ground), whichever the nearest box sets + const paperOf = (el) => { for (let q = el; q; q = q.parentElement) { const cs = getComputedStyle(q), c = cs.backgroundColor; if (/gradient|url\(/.test(cs.backgroundImage)) return `${c}|${cs.backgroundImage}`; if (!/^(transparent|rgba\(0, 0, 0, 0\))$/.test(c)) return c; } return 'none'; }; + const gaps = [], shifts = []; + for (let i = 0; !heroOnly && i < secs.length - 1; i++) { gaps.push(Math.round(content(secs[i + 1]).top - content(secs[i]).bottom)); shifts.push(paperOf(secs[i]) !== paperOf(secs[i + 1])); } + const real = gaps.filter((g) => g > -50); + const short = gaps.filter((g, i) => g > -50 && g < (shifts[i] ? 64 : 112)); + if (real.length) { + const min = short.length ? Math.min(...short) : Infinity; + if (short.length) push(59, 'REFLEX', `smallest gap between sections is ${min}px (gaps: ${real.join(', ')})`, '120px or more between sections, by the --section-gap steps'); + else if (real.length > 2 && new Set(real).size === 1) push(59, 'REFLEX', `every section gap is ${min}px`, 'Vary the rhythm across --section-gap-s, --section-gap and --section-gap-l'); + } + if (!heroOnly && secs.length > 9) push(59, 'WARN', `${secs.length} sections`, 'Six to nine sections a page, hero and footer included; merge or cut'); + else if (!heroOnly && secs.length < 5) push(77, 'WARN', `${secs.length} sections, hero and footer included`, 'A landing strip, not a page: six to nine sections, five on a thin prompt (layout.md § 3)'); + if (!heroOnly) { + for (const sl of document.querySelectorAll('[data-slot]')) { + const cs = getComputedStyle(sl); + if (cs.display === 'none' || cs.visibility === 'hidden' || !sl.getClientRects().length || sl.closest('[hidden]')) continue; + const r = sl.getBoundingClientRect(); + if (r.width < 40 || r.height < 40) { push('F18', 'WARN', `slot "${sl.getAttribute('data-slot')}" renders at ${Math.round(r.width)} x ${Math.round(r.height)}px`, 'The slot collapsed: give it a width from its track and a real aspect-ratio, never a percentage of a shrink-to-fit parent'); break; } + } + for (const e of document.querySelectorAll('p, li, dd, td, th, h2, h3, h4, figcaption, blockquote')) { + if (!vis(e) || e.closest('nav, svg, [aria-hidden="true"]')) continue; + const t = (e.innerText || '').trim(); + if (t.length < 24) continue; + const cs = getComputedStyle(e); + const fs = parseFloat(cs.fontSize) || 16; + const lh = parseFloat(cs.lineHeight) || fs * 1.4; + const r = e.getBoundingClientRect(); + if (r.width < fs * 8 && r.height / lh >= 3.6) { push('F17', 'WARN', `"${t.slice(0, 28)}" squeezed to ${Math.round(r.width)}px wide over ${Math.round(r.height / lh)} lines (${e.tagName.toLowerCase()}${e.classList[0] ? '.' + e.classList[0] : ''})`, 'A grid placement or a span ran wide; give the text its column back'); break; } + } + } + + const nameOf = (e) => `${e.tagName.toLowerCase()}${e.getAttribute('data-slot') ? `[data-slot=${e.getAttribute('data-slot')}]` : e.classList[0] ? '.' + e.classList[0] : ''}`; + const dataish = /chart|graph|plot|spark|map|diagram|logo|wordmark|brand|icon|flag|qr|avatar/i; + const drawn = []; + for (const svg of document.querySelectorAll('svg')) { + if (!vis(svg) || svg.parentElement.closest('svg')) continue; + const r = svg.getBoundingClientRect(); + if (r.width < 120 || r.height < 120) continue; + let named = false; + for (let q = svg; q && q !== document.body && !named; q = q.parentElement) named = dataish.test(`${typeof q.className === 'string' ? q.className : (q.className && q.className.baseVal) || ''} ${q.id || ''} ${q.getAttribute('aria-label') || ''} ${q.getAttribute('data-kind') || ''}`); + if (named || svg.querySelector('text')) continue; + const shapes = [...svg.querySelectorAll('path, ellipse, circle, polygon')]; + const curvy = shapes.filter((s) => s.tagName === 'ellipse' || s.tagName === 'circle' && parseFloat(s.getAttribute('r') || 0) > 6 || /[CcQqSsAa]/.test(s.getAttribute('d') || '')).length; + const fills = new Set(shapes.map((s) => getComputedStyle(s).fill).filter((f) => f && f !== 'none')); + if (curvy >= 3 || (shapes.length >= 6 && fills.size >= 3)) drawn.push(`${nameOf(svg.parentElement || svg)} (${Math.round(r.width)}x${Math.round(r.height)}, ${shapes.length} shapes)`); + } + if (drawn.length) push(80, 'REFLEX', `drawn illustration: ${drawn.slice(0, 3).join('; ')}`, 'A photograph (theme.mjs photos), the product built, or type at scale; SVG is for icons, logos and labelled charts or diagrams (imagery.md § 7)'); + + const empty = []; + const shows = (box) => { + const b = box.getBoundingClientRect(); + let area = 0; + for (const m of box.querySelectorAll('img, video, picture, canvas, iframe, svg')) { if (!vis(m) || (m.tagName.toLowerCase() === 'svg' && m.parentElement.closest('svg'))) continue; if (m.tagName === 'IMG' && !(m.getAttribute('src') || m.getAttribute('srcset') || '').trim()) continue; const q = m.getBoundingClientRect(); area += q.width * q.height; if (area >= b.width * b.height * 0.25) return true; } + const bits = [...box.querySelectorAll('*')].filter((e) => vis(e) && ((e.innerText || '').trim() || /^(INPUT|SELECT|TEXTAREA|BUTTON)$/.test(e.tagName)) && !e.children.length); + return bits.length >= 4 || (box.innerText || '').trim().length >= 80 || box.matches('[data-kind="product"]') || !!box.closest('[data-kind="product"]'); + }; + for (const sl of document.querySelectorAll('[data-slot]')) { if (!vis(sl) || sl.closest('[hidden]')) continue; const r = sl.getBoundingClientRect(); if (r.width < 160 || r.height < 120) continue; if (!shows(sl)) empty.push(`${nameOf(sl)} ${Math.round(r.width)}x${Math.round(r.height)}`); } + for (const e of document.querySelectorAll('div, figure, span, i, aside')) { + if (e.hasAttribute('data-slot') || e.closest('[data-slot]') || !vis(e)) continue; + const r = e.getBoundingClientRect(); const cs = getComputedStyle(e); + if (r.width < 300 || r.height < 200 || r.width > vw * 0.9 || !/gradient/.test(cs.backgroundImage) || /url\(/.test(cs.backgroundImage)) continue; + if ((e.innerText || '').trim().length > 60 || e.querySelector('img, video, canvas, svg, picture, input, table')) continue; + if (!shows(e)) empty.push(`${nameOf(e)} ${Math.round(r.width)}x${Math.round(r.height)}, a gradient with nothing in it`); + } + if (empty.length) push(81, 'REFLEX', `${empty.length} empty picture${empty.length > 1 ? 's' : ''}: ${empty.slice(0, 3).join('; ')}`, 'Put the picture in: the user\'s image, a library photograph (theme.mjs photos) or the product built at full fidelity; the wash is only a loading colour (imagery.md § 3)'); + + const marks = []; + const colourOf = (e) => { const cs = getComputedStyle(e); return e instanceof SVGElement ? `${cs.fill}|${cs.stroke}` : `${cs.backgroundColor}|${cs.borderTopColor}|${cs.color}`; }; + for (const p of document.querySelectorAll('*')) { + if (p.children.length < 24 || !vis(p)) continue; + const kids = [...p.children].filter((k) => !/^(defs|title|desc|style|script)$/i.test(k.tagName)); + if (kids.length < 24) continue; + const small = kids.filter((k) => { const q = k.getBoundingClientRect(); return !(k.textContent || '').trim() && q.width > 0 && q.height > 0 && ((q.width <= 24 && q.height <= 48) || q.width <= 6 || q.height <= 6); }); + if (small.length < 24 || small.length < kids.length * 0.8) continue; + const tally = new Map(); for (const k of small) { const c = colourOf(k); tally.set(c, (tally.get(c) || 0) + 1); } + if (Math.max(...tally.values()) < small.length * 0.6 || tally.size > 4) continue; + const sizes = small.map((k) => { const q = k.getBoundingClientRect(); return Math.round(q.width) * 1000 + Math.round(q.height); }); + const common = Math.max(...[...new Set(sizes)].map((s) => sizes.filter((x) => x === s).length)); + if (common < small.length * 0.7) continue; + if (marks.some((m) => m.el.contains(p) || p.contains(m.el))) continue; + marks.push({ el: p, text: `${nameOf(p)} holds ${small.length} identical marks` }); + } + const ONE_FOR_EACH = /\bone (?:mark|dot|stroke|tick|line|square|bar|cell|pin|block|circle|seed|bead|stripe|notch)s? (?:for|per) (?:each|every)\b/i; + const ONE_FOR_EACH_BARE = /\bone (?:for|per) (?:each|every)\b/i; + for (const e of document.querySelectorAll('[aria-label], figcaption, svg title, p, small, span')) { + if (marks.length >= 2) break; + const t = `${e.getAttribute('aria-label') || ''} ${(e.textContent || '').length < 160 ? e.textContent : ''}`; + const counting = ONE_FOR_EACH.test(t) || (ONE_FOR_EACH_BARE.test(t) && (e.matches('figcaption') || (e.getAttribute('aria-label') && e.closest('svg, figure, [role="img"]')))); + if (counting && !marks.some((m) => m.el.contains(e))) marks.push({ el: e, text: `"${t.trim().slice(0, 60)}"` }); + } + if (marks.length) push(82, 'REFLEX', `counting device: ${marks.slice(0, 2).map((m) => m.text).join('; ')}`, 'Set the number in type at the size it deserves; never one mark for each thing (imagery.md § 7)'); + + if (heroEnd != null) { + const foot = [...document.querySelectorAll('body footer, [role="contentinfo"]')].filter(vis).pop(); + const docH = foot ? Math.min(document.documentElement.scrollHeight, abs(foot).top) : document.documentElement.scrollHeight, from = Math.max(heroEnd, vh); + const box = document.querySelector('.container') || document.body; + const cw = Math.min(box.getBoundingClientRect().width || vw, vw); + let area = 0, n = 0; + const seenA = []; + const add = (el) => { if (!vis(el) || el.closest('footer') || seenA.some((o) => o.contains(el))) return; const b = abs(el); const top = Math.max(b.top, from), bot = Math.min(b.bottom, docH); if (bot - top < 80 || b.w < 160) return; seenA.push(el); area += (bot - top) * Math.min(b.w, cw); n++; }; + for (const m of document.querySelectorAll('img, video')) { if (m.closest('[data-kind="product"], [data-product]')) continue; const nw = m.naturalWidth || m.videoWidth || 0; if (m.tagName === 'IMG' && /\.svg(\?|$)/i.test(m.currentSrc || m.src || '')) continue; if (m.tagName === 'IMG' && nw && nw < 200) continue; add(m); } + for (const e of document.querySelectorAll('section *, main *')) { const bi = getComputedStyle(e).backgroundImage; if (/url\(/.test(bi) && !/svg|data:image\/svg/i.test(bi)) add(e); } + const share = area / Math.max(1, (docH - from) * cw); + if (share > (photoShape ? 0.45 : 0.36) && n >= 3) push(83, 'REFLEX', `photographs cover ${Math.round(share * 100)}% of the page below the hero (${n} pictures${photoShape ? ', a photograph-led shape' : ''})`, 'Balance the page: cut or shrink pictures until they cover a quarter to a third of it, and carry the freed sections in type, figures, the product or a list (imagery.md § 5)'); + } + if (heroEnd != null && !/subscribe|join|attend|listen|visit|newsletter|waitlist/.test(job || '')) { + const foot = [...document.querySelectorAll('body footer, [role="contentinfo"]')].filter(vis).pop(); + const before = foot ? secs.filter((x) => x !== foot && abs(x).bottom <= abs(foot).top + 2).pop() : secs[secs.length - 1]; + // a form whose submit books, asks or requests is the job's own action, not a mailing list + const asks = (f) => { const t = [...f.querySelectorAll('button, input[type=submit]')].map((b) => b.innerText || b.value || '').join(' '); return /\b(book|enquir|inquir|request|contact|walkthrough|demo|quote|reserve|apply|start|create|order|buy|download|try)/i.test(t) && !/newsletter|updates|subscribe|the list|mailing/i.test(t); }; + const signup = (box) => box && [...box.querySelectorAll('form, [role="form"]')].find((f) => { if (asks(f)) return false; const fields = [...f.querySelectorAll('input:not([type=hidden]):not([type=submit]):not([type=checkbox]):not([type=radio]), textarea, select')].filter(vis); return fields.length >= 1 && fields.length <= 2 && fields.some((x) => x.type === 'email' || /e-?mail/i.test(`${x.name} ${x.id} ${x.placeholder} ${x.getAttribute('autocomplete') || ''}`)); }); + const hit = signup(before) || signup(foot); + if (hit) push(85, 'REFLEX', `the page closes on an email sign-up${job ? ` on a ${job} page` : ' and the stamp names no job'}`, 'End on what the visitor came to do (the booking, the buy box, the download, the next date, the latest issue) or on the last strong section; an email close is for a subscribe or join page, and the stamp says job: (anatomy.md)'); + } + + let heroFoot = null; + if (hero && !/^(poster|ledge)$/.test(heroPosture || '')) { + const hb = abs(hero); + let cTop = Infinity, cBottom = -Infinity; + for (const c of hero.querySelectorAll('*')) { + // the site nav is not hero content; a nav lower in the hero (a band of section links) is + const nv = c.closest('nav'); + if (!vis(c) || (nv && abs(nv).top <= hb.top + 220) || c === hero) continue; + const cs = getComputedStyle(c); + const painted = (c.innerText || '').trim() || /^(SVG|IMG|CANVAS|VIDEO|PICTURE)$/.test(c.tagName) || cs.backgroundColor !== 'rgba(0, 0, 0, 0)' || cs.backgroundImage !== 'none' || parseFloat(cs.borderTopWidth) > 0; + if (!painted || /fixed|sticky/.test(cs.position)) continue; + const b = abs(c); cTop = Math.min(cTop, b.top); cBottom = Math.max(cBottom, Math.min(b.bottom, hb.bottom)); + } + let navBottom = hb.top; + for (const n of document.querySelectorAll('header, nav, [class*="nav"], [class*="bar"]')) { if (!vis(n) || hero.contains(n) && !/fixed|sticky/.test(getComputedStyle(n).position)) continue; const cs = getComputedStyle(n); const b = abs(n); if ((/fixed|sticky/.test(cs.position) || hero.contains(n)) && b.top <= hb.top + 40 && b.bottom < hb.top + 220) navBottom = Math.max(navBottom, b.bottom); } + const after = secs.find((x) => x !== hero && !hero.contains(x) && abs(x).top >= hb.bottom - 4); + const bottomEdge = after ? Math.min(content(after).top, hb.bottom + 240) : hb.bottom; + const topPad = cTop - navBottom, bottomPad = bottomEdge - cBottom; + if (heroPosture !== 'custom' && isFinite(topPad) && isFinite(bottomPad) && topPad > 24 && bottomPad < topPad - 8) push('44a', 'REFLEX', `hero content sits low: ${Math.round(topPad)}px above it, ${Math.round(bottomPad)}px below`, 'Centre the content in its screen: the space below 1.0 to 1.5 times the space above (a Ledge sits low on purpose; say Ledge in the stamp)'); + heroFoot = { cBottom, navBottom }; + } + if (heroEnd != null && !freeFold) { + if (heroEnd > vh + 8) push('44c', 'REFLEX', `hero runs past the 1440x900 fold (hero ends at ${Math.round(heroEnd)}px)`, 'Size the display and the visual so the hero is one screen'); + else if (heroEnd < vh * 0.84 && secs.length > 1) push('44c', 'REFLEX', `hero ends at ${Math.round(heroEnd)}px of a 900px screen`, 'Fill the first screen with the visual or the headline, not with copy'); + } + if (fig && textBox && !freeFold) { + const off = Math.round((fig.top + fig.bottom) / 2 - (textBox.top + textBox.bottom) / 2); + const gap = Math.round(fig.side === 'right' ? fig.left - fig.colEdge : fig.colEdge - fig.right); + const edge = Math.round(fig.side === 'right' ? vw - fig.right : fig.left); + if (Math.abs(off) > 60) push('44c', 'REFLEX', `hero visual centre is ${off}px from the text block centre`, 'Align the visual beside the text'); + const inkGap = Math.round(fig.side === 'right' ? fig.left - textBox.right : textBox.left - fig.right); + if (inkGap > 240 && gap <= 120) push('44c', 'REFLEX', `hero text ends ${inkGap}px short of its visual`, 'Widen the text column or bring the visual in: the text and the visual stand 48 to 120px apart (layout.md § 6)'); + if (gap > 120 || (edge < 8 && gap > 48 && heroPosture !== 'stage')) push('44c', 'REFLEX', `hero visual sits ${gap}px from the text and ${edge}px from the viewport edge`, 'Bring the visual to within 48 to 120px of the text; never pin it to the corner'); + } + + if (heroFoot && hero && isFinite(heroFoot.cBottom)) { + const hb = abs(hero); + const after = secs.find((x) => x !== hero && !hero.contains(x) && abs(x).top >= hb.bottom - 4); + const nextTop = after ? content(after).top : Infinity; + const band = Math.round(Math.min(vh, nextTop) - heroFoot.cBottom); + if (heroFoot.cBottom < vh && band > 160) push(79, 'REFLEX', `${band}px of nothing between the hero's last content (y ${Math.round(heroFoot.cBottom)}) and ${nextTop < vh ? 'the next section' : 'the fold'}`, 'Centre the content in the screen and grow the visual or the head (layout.md § 6); never fill it with copy'); + } + + if (!heroOnly) { + const below = secs.filter((x) => x !== hero && !(hero && (hero.contains(x) || x.contains(hero))) && x.tagName !== 'FOOTER' && !x.closest('footer, nav') && (!hero || abs(x).top >= abs(hero).bottom - 4)); + const leavesOf = (root) => { + const out = []; + const w = document.createTreeWalker(root, NodeFilter.SHOW_TEXT); + for (let t = w.nextNode(); t; t = w.nextNode()) { if (!t.textContent.trim()) continue; const p = t.parentElement; if (!p || !vis(p) || p.closest('script, style, noscript')) continue; const rg = document.createRange(); rg.selectNodeContents(t); for (const q of rg.getClientRects()) if (q.width > 1 && q.height > 1) out.push({ top: q.top + scrollY, bottom: q.bottom + scrollY, left: q.left, right: q.right }); } + for (const e of root.querySelectorAll('*')) { + if (!vis(e) || (e.closest('svg') && e.tagName.toLowerCase() !== 'svg')) continue; + const cs = getComputedStyle(e); + const painted = /^(IMG|SVG|CANVAS|VIDEO|PICTURE|IFRAME|INPUT|TEXTAREA|SELECT|TABLE)$/i.test(e.tagName) || e.hasAttribute('data-slot') || cs.backgroundImage !== 'none' || cs.backgroundColor !== 'rgba(0, 0, 0, 0)' || (parseFloat(cs.borderTopWidth) || 0) + (parseFloat(cs.borderBottomWidth) || 0) + (parseFloat(cs.borderLeftWidth) || 0) + (parseFloat(cs.borderRightWidth) || 0) >= 2; + if (!painted) continue; + const b = e.getBoundingClientRect(); if (b.width * b.height < 64 || (b.width > vw * 0.97 && !/^(IMG|PICTURE|VIDEO|CANVAS|SVG)$/i.test(e.tagName) && !e.hasAttribute('data-slot'))) continue; + out.push({ top: b.top + scrollY, bottom: b.bottom + scrollY, left: b.left, right: b.right }); + } + return out; + }; + // content a rail scrolls past the screen's edge does not widen the page's measure + const span = (ls) => ls.filter((b) => b.right > 0 && b.left < vw).reduce((a, b) => ({ left: Math.min(a.left, Math.max(0, b.left)), right: Math.max(a.right, Math.min(vw, b.right)) }), { left: Infinity, right: -Infinity }); + const all = span([...(hero ? [hero] : []), ...below].flatMap(leavesOf)); + const W = all.right - all.left; + const h1fs = h1 ? parseFloat(getComputedStyle(h1).fontSize) : 0; + const heads = below.flatMap((x) => [...x.querySelectorAll('h2')]).filter((h) => vis(h) && !h.closest('nav, footer')); + if (heads.length) { + const sizes = heads.map((h) => parseFloat(getComputedStyle(h).fontSize)).sort((a, b) => a - b); + const med = sizes[Math.floor(sizes.length / 2)]; + if (med < 40) push(78, 'REFLEX', `section heads render at ${Math.round(med)}px${h1fs ? ` under a ${Math.round(h1fs)}px hero head` : ''}`, 'h2 at --text-section (about 52px at 1440), item titles at --text-title (layout.md § 2)'); + } + const thin = []; + let bands = 0; + if (W > 400) for (const sec of below) { + const ls = leavesOf(sec); + if (!ls.length) continue; + const u = span(ls); + const wPct = (Math.min(u.right, all.right) - Math.max(u.left, all.left)) / W; + const words = (sec.innerText || '').split(/\s+/).filter((x) => /[A-Za-z0-9]/.test(x)).length; + let mass = false, statement = false; + const secBg = getComputedStyle(sec).backgroundColor; + for (const e of sec.querySelectorAll('img, svg, canvas, video, picture, figure, iframe, [data-slot]')) { if (!vis(e) || (e.tagName.toLowerCase() === 'svg' && e.closest('[data-slot], figure') && e.closest('[data-slot], figure') !== e)) continue; if (e.getBoundingClientRect().height >= 300) { mass = true; break; } } + if (!mass) for (const e of sec.querySelectorAll('div, article, aside, ul, ol, dl, table, form, a')) { + if (!vis(e)) continue; + const cs = getComputedStyle(e); const r = e.getBoundingClientRect(); + const filled = (cs.backgroundColor !== 'rgba(0, 0, 0, 0)' && cs.backgroundColor !== secBg) || cs.backgroundImage !== 'none' || (parseFloat(cs.borderTopWidth) || 0) + (parseFloat(cs.borderBottomWidth) || 0) + (parseFloat(cs.borderLeftWidth) || 0) + (parseFloat(cs.borderRightWidth) || 0) >= 2; + if (filled && r.height >= 240 && r.width >= W * 0.35 && r.width < vw * 0.97) { mass = true; break; } + } + if (!mass) for (const t of sec.querySelectorAll('table, ul, ol, dl, div, [class]')) { + if (!vis(t)) continue; + if (t.tagName === 'TABLE') { const r = t.getBoundingClientRect(); if (t.querySelectorAll('tr').length >= 4 && r.width >= W * 0.6) { mass = true; break; } continue; } + const kids = [...t.children].filter((k) => vis(k) && k.getBoundingClientRect().height > 20); + if (kids.length < 3) continue; + const rs = kids.map((k) => k.getBoundingClientRect()); + const across = rs.every((r) => Math.abs(r.top - rs[0].top) < 12) && new Set(rs.map((r) => Math.round(r.left))).size === rs.length; + const spread = Math.max(...rs.map((r) => r.right)) - Math.min(...rs.map((r) => r.left)); + const tall = Math.max(...rs.map((r) => r.bottom)) - Math.min(...rs.map((r) => r.top)); + if ((across && spread >= W * 0.7) || (!across && spread >= W * 0.4 && tall >= 120)) { mass = true; break; } + } + if (!mass && [...sec.querySelectorAll('input:not([type=hidden]), select, textarea')].filter(vis).length >= 2) mass = true; + for (const e of sec.querySelectorAll('h2, h3, p, blockquote, h2 span, p span, div, output, [contenteditable]')) { if (!vis(e) || (/^(DIV|OUTPUT)$/.test(e.tagName) && ![...e.childNodes].some((n) => n.nodeType === 3 && n.textContent.trim()))) continue; const cs = getComputedStyle(e); const fs = parseFloat(cs.fontSize); const lh = parseFloat(cs.lineHeight) || fs * 1.15; const r = e.getBoundingClientRect(); const n = (e.innerText || '').split(/\s+/).filter(Boolean).length; if ((fs >= 40 && n <= 40 && r.height >= lh * 1.8 && r.width >= W * 0.5) || fs >= 72) { statement = true; break; } } + if (statement) mass = true; + const painted = getComputedStyle(sec).backgroundColor !== 'rgba(0, 0, 0, 0)' || getComputedStyle(sec).backgroundImage !== 'none'; + if (!mass && painted && words <= 40 && sec.querySelector('a, button, form') && !bands) { bands++; continue; } + if ((wPct < 0.72 && !statement) || !mass) thin.push(`${(sec.querySelector('h2, h3') || {}).innerText ? `"${sec.querySelector('h2, h3').innerText.trim().slice(0, 28)}"` : sec.tagName.toLowerCase() + (sec.className && typeof sec.className === 'string' ? '.' + sec.className.trim().split(/\s+/)[0] : '')} (${Math.round(wPct * 100)}% wide${mass ? '' : ', no mass'})`); + } + if (thin.length) push(77, 'REFLEX', `${thin.length} thin section${thin.length > 1 ? 's' : ''}: ${thin.slice(0, 3).join('; ')}`, 'Widen the body to ten of twelve columns and give it mass: a visual 300px tall or more, a set of three across, rows, or a statement (layout.md § 4 and § 5)'); + } + } else { + + if (textBox && textBox.left < 120) push('44d', 'FAIL', `hero text starts ${Math.round(textBox.left)}px from the edge at 1920`, 'Cap the container at 1360 to 1520px and centre it'); + if (heroEnd != null && heroEnd > vh + 8) push('44d', 'FAIL', `hero runs past the 1920x1080 screen (hero ends at ${Math.round(heroEnd)}px)`, 'Cap vw-sized visuals and display sizes'); + const inkWidth = (e) => { const range = document.createRange(); range.selectNodeContents(e); return range.getBoundingClientRect().width; }; + const wide = [...document.querySelectorAll('p, h1, h2, h3, li')].filter((e) => vis(e) && !e.querySelector('p, h1, h2, h3, h4, div, figure, ul, ol, table, section') && (e.innerText || '').trim().length > 40 && inkWidth(e) > 1600); + if (wide.length) push('44d', 'FAIL', `${wide.length} text block${wide.length > 1 ? 's run' : ' runs'} wider than 1600px at 1920 (first: ${wide[0].tagName.toLowerCase()} "${(wide[0].innerText || '').trim().slice(0, 28)}")`, 'Cap the container; hold the measure'); + } + return out; +} + +function observeQuality(scope) { + const out = []; + const push = (gate, grade, evidence, fix) => out.push({ gate: String(gate), grade, evidence, fix }); + const vis = (el) => { const cs = getComputedStyle(el); if (cs.display === 'none' || cs.visibility === 'hidden' || parseFloat(cs.opacity) === 0) return false; const r = el.getBoundingClientRect(); return r.width > 1 && r.height > 1; }; + const name = (el) => el.tagName.toLowerCase() + (el.classList && el.classList[0] ? '.' + el.classList[0] : ''); + const abs = (r) => ({ top: r.top + scrollY, bottom: r.bottom + scrollY, left: r.left, right: r.right }); + const clear = (c) => /^(transparent|rgba\(0, 0, 0, 0\))$/.test(c); + const quiet = (el) => !!el.closest('script, style, noscript, [aria-hidden="true"], dialog:not([open])') || !!(el.parentElement && el.parentElement.closest('svg')); + const all = [...document.body.querySelectorAll('*')].filter((el) => !quiet(el) && vis(el)); + + const boxes = []; + for (const el of all) { + const media = /^(IMG|svg|CANVAS|VIDEO|PICTURE|IFRAME|INPUT|BUTTON|SELECT|TEXTAREA)$/.test(el.tagName) || el.hasAttribute('data-slot'); + if (!media && ![...el.childNodes].some((n) => n.nodeType === 3 && n.textContent.trim())) continue; + boxes.push({ el, ...abs(el.getBoundingClientRect()) }); + } + const overlapX = (a, b) => Math.min(a.right, b.right) - Math.max(a.left, b.left) > 8; + const crowded = []; + for (const h of document.querySelectorAll('h2, h3, h4')) { + if (!vis(h) || quiet(h) || h.closest('nav, footer, table, [data-slot]')) continue; + let small = false; + for (let p = h.parentElement; p && p !== document.body; p = p.parentElement) { + const cs = getComputedStyle(p); + if (!clear(cs.backgroundColor) || parseFloat(cs.borderTopWidth) > 0 || cs.boxShadow !== 'none') { small = p.getBoundingClientRect().height < 200; break; } + } + if (small) continue; + const hb = abs(h.getBoundingClientRect()); + let above = null, below = null; + for (const b of boxes) { + if (h.contains(b.el) || b.el.contains(h) || !overlapX(b, hb)) continue; + if (b.bottom <= hb.top + 1 && (!above || b.bottom > above.bottom)) above = b; + if (b.top >= hb.bottom - 1 && (!below || b.top < below.top)) below = b; + } + if (!above || !below) continue; + const up = hb.top - above.bottom, down = below.top - hb.bottom; + if (down < 6 || down > 160) continue; + if (up < 0.75 * down && down - up >= 12) crowded.push(`${name(h)} "${(h.innerText || '').trim().slice(0, 18)}" ${Math.round(up)}px over, ${Math.round(down)}px under`); + } + if (crowded.length >= 2) push(71, 'REFLEX', `heads nearer what precedes them than what they head: ${crowded.slice(0, 2).join('; ')}`, 'At least twice the space above a head as below it'); + + const tight = []; + for (const el of all) { + if (tight.length >= 3) break; + if (/^(SECTION|MAIN|HEADER|FOOTER|NAV|ARTICLE|INPUT|TEXTAREA|SELECT|svg|IMG|TABLE|THEAD|TBODY|TR|TD|TH|PRE|CODE|IFRAME|VIDEO|CANVAS|DIALOG)$/.test(el.tagName) || el.closest('[data-slot], table')) continue; + const r = el.getBoundingClientRect(); + if (r.width <= 100 || r.height <= 30 || r.width > innerWidth * 0.9) continue; + const cs = getComputedStyle(el); + if (cs.display === 'inline') continue; + if (/auto|scroll/.test(cs.overflowX + cs.overflowY)) continue; + const bw = ['Top', 'Right', 'Bottom', 'Left'].map((k) => parseFloat(cs[`border${k}Width`]) || 0); + const inked = (k) => bw[k] >= 1 && !clear(cs[`border${['Top', 'Right', 'Bottom', 'Left'][k]}Color`]); + let under = 'rgb(255, 255, 255)'; + for (let p = el.parentElement; p; p = p.parentElement) { const c = getComputedStyle(p).backgroundColor; if (!clear(c)) { under = c; break; } } + const filled = !clear(cs.backgroundColor) && cs.backgroundColor !== under; + if (!filled && !(inked(1) && inked(3))) continue; + const sides = ['left', 'right', 'top', 'bottom']; + let L = Infinity, T = Infinity, Rr = -Infinity, B = -Infinity, fs = parseFloat(cs.fontSize) || 16; + const walk = document.createTreeWalker(el, NodeFilter.SHOW_TEXT); + for (let t = walk.nextNode(); t; t = walk.nextNode()) { + const host = t.parentElement; + if (!t.textContent.trim() || !host || host.closest('svg') || !vis(host)) continue; + let nested = false; + for (let p = host; p && p !== el; p = p.parentElement) { + const ps = getComputedStyle(p); + if (/absolute|fixed/.test(ps.position) || (!clear(ps.backgroundColor) && ps.backgroundColor !== cs.backgroundColor) || (parseFloat(ps.borderTopWidth) >= 1 && parseFloat(ps.borderLeftWidth) >= 1)) { nested = true; break; } + } + if (nested) continue; + const rg = document.createRange(); rg.selectNodeContents(t); + const hf = parseFloat(getComputedStyle(host).fontSize) || 16; const trim = hf >= 40 ? 0.2 * hf : 0; + for (const q of rg.getClientRects()) { if (!q.width || !q.height) continue; L = Math.min(L, q.left); T = Math.min(T, q.top + trim); Rr = Math.max(Rr, q.right); B = Math.max(B, q.bottom - trim); fs = parseFloat(getComputedStyle(host).fontSize) || fs; } + } + if (L === Infinity) continue; + const side = Math.max(8, Math.min(0.5 * fs, 24)) - 0.5, end = Math.max(4, Math.min(0.3 * fs, 12)) - 0.5; + const inset = { left: L - (r.left + bw[3]), right: r.right - bw[1] - Rr, top: T - (r.top + bw[0]), bottom: r.bottom - bw[2] - B }; + const short = Object.entries(inset).filter(([k, v]) => sides.includes(k) && v < (k === 'left' || k === 'right' ? side : end)); + if (short.length) tight.push(`${name(el)} ${short.map(([k, v]) => `${k} ${Math.round(v)}px`).join(', ')}`); + } + if (tight.length) push(72, 'REFLEX', `text crowds the edge of its box: ${tight.join('; ')}`, 'Pad the box: max(8px, 0.5em) at the sides, max(4px, 0.3em) above and below'); + + const controls = all.filter((el) => (el.tagName === 'BUTTON' || el.getAttribute('role') === 'button' || (el.tagName === 'A' && /btn|button|cta/i.test(String(el.className))) || (el.tagName === 'INPUT' && /^(submit|button|text|email|search|tel|url|password|number)$/.test(el.type))) && !el.closest('nav, header, dialog, [role="dialog"], [data-slot], [role="tablist"]') && (el.tagName === 'INPUT' || (el.innerText || '').trim())); + const offSize = controls.map((el) => ({ el, h: el.getBoundingClientRect().height })).filter((c) => c.h > 8 && (c.h < (scope === 'app' ? 30 : 42) || c.h > 54)); + if (offSize.length) push('39b', 'REFLEX', `control height outside ${scope === 'app' ? '32 to 52px' : '44 to 52px'}: ${offSize.slice(0, 3).map((c) => `${name(c.el)} ${Math.round(c.h)}px`).join(', ')}`, 'Marketing controls stand 44 to 52px; app UI 32 to 40px with a 44px hit target'); + + const long = []; + for (const el of all) { + if (long.length >= 2 || el.tagName !== 'P' || el.closest('nav, footer, table, figure, [data-slot]')) continue; + const t = (el.innerText || '').replace(/\s+/g, ' ').trim(); + if (t.length < 240) continue; + const cs = getComputedStyle(el); + const lh = parseFloat(cs.lineHeight) || parseFloat(cs.fontSize) * 1.4; + let cols = 1; for (let q = el; q && q !== document.body && cols === 1; q = q.parentElement) { const qc = getComputedStyle(q); if (qc.columnCount !== 'auto' || qc.columnWidth !== 'auto') cols = Math.max(1, Math.round(q.getBoundingClientRect().width / Math.max(1, el.getClientRects()[0]?.width || q.getBoundingClientRect().width))); } + const lines = Math.round(el.getBoundingClientRect().height / lh) * cols; + if (lines >= 3 && t.length / lines > 88) long.push(`${name(el)} about ${Math.round(t.length / lines)} characters a line`); + } + if (long.length) push(25, 'REFLEX', `running prose set too wide: ${long.join(', ')}`, 'Cap the measure at 45 to 75ch'); + + const tiles = all.find((g) => { + if (g.closest('nav, footer, form, table')) return false; + const kids = [...g.children].filter(vis); + if (kids.length < 3 || kids.length > 4) return false; + const rects = kids.map((k) => k.getBoundingClientRect()); + if (rects.some((r) => Math.abs(r.top - rects[0].top) > 4 || r.width < 160) || Math.max(...rects.map((r) => r.width)) > Math.min(...rects.map((r) => r.width)) * 1.04) return false; + return kids.every((k) => { + const head = k.querySelector('h2, h3, h4'); + if (!head) return false; + const icon = [...k.querySelectorAll('svg, img, [class*="icon"], span, div, i')].find((n) => { + if (n.contains(head) || head.contains(n)) return false; + const r = n.getBoundingClientRect(); + const glyph = (n.textContent || '').trim(); + const iconish = n.tagName === 'svg' || n.tagName === 'IMG' || /icon/i.test(String(n.className && n.className.baseVal != null ? n.className.baseVal : n.className)) || (glyph.length > 0 && glyph.length <= 2 && /\p{Extended_Pictographic}/u.test(glyph)); + const media = n.tagName === 'svg' || n.tagName === 'IMG'; + return iconish && r.height > 8 && r.height <= 96 && (!media || r.width <= 96) && r.bottom <= head.getBoundingClientRect().top + 2; + }); + return !!icon; + }); + }); + if (tiles) push(3, 'REFLEX', `equal columns of icon-above-heading tiles (${name(tiles)})`, 'Vary the widths, set the icon inline with the heading, or drop the icons'); + + const cv = document.createElement('canvas'); cv.width = cv.height = 1; + const cx = cv.getContext('2d', { willReadFrequently: true }); + const rgb = (s) => { cx.clearRect(0, 0, 1, 1); cx.fillStyle = 'rgba(0, 0, 0, 0)'; cx.fillStyle = s; cx.fillRect(0, 0, 1, 1); const d = cx.getImageData(0, 0, 1, 1).data; return [d[0] / 255, d[1] / 255, d[2] / 255, d[3] / 255]; }; + const lin = (c) => (c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4); + const lum = (c) => 0.2126 * lin(c[0]) + 0.7152 * lin(c[1]) + 0.0722 * lin(c[2]); + const ratio = (a, b) => (Math.max(lum(a), lum(b)) + 0.05) / (Math.min(lum(a), lum(b)) + 0.05); + const over = (c, b) => [0, 1, 2].map((i) => c[i] * c[3] + b[i] * (1 - c[3])); + const bgOf = (n) => { for (; n && n !== document.documentElement; n = n.parentElement) { const c = rgb(getComputedStyle(n).backgroundColor); if (c[3] >= 0.9) return c; } const b = rgb(getComputedStyle(document.body).backgroundColor); return b[3] > 0 ? b : [1, 1, 1, 1]; }; + const weak = []; + for (const f of all.filter((el) => /^(TEXTAREA|SELECT)$/.test(el.tagName) || (el.tagName === 'INPUT' && /^(text|email|search|tel|url|password|number|date|time)$/.test(el.type)))) { + const fh = f.getBoundingClientRect().height; + const around = bgOf(f.parentElement); + let best = ratio(over(rgb(getComputedStyle(f).backgroundColor), around), around); + for (let n = f, d = 0; n && d < 3 && n.getBoundingClientRect().height <= fh + 48; n = n.parentElement, d++) { + const cs = getComputedStyle(n); const back = d ? bgOf(n.parentElement) : around; + for (const s of ['Top', 'Right', 'Bottom', 'Left']) if (parseFloat(cs[`border${s}Width`]) >= 1 && cs[`border${s}Style`] !== 'none') best = Math.max(best, ratio(over(rgb(cs[`border${s}Color`]), back), back)); + for (const m of (cs.boxShadow || '').matchAll(/((?:rgba?|oklch|oklab|color)\([^)]*\)|#[0-9a-f]{3,8})\s+(-?[\d.]+)px\s+(-?[\d.]+)px\s+([\d.]+)px\s+(-?[\d.]+)px/gi)) if (+m[4] === 0 && (+m[5] >= 1 || Math.abs(+m[3]) >= 1)) best = Math.max(best, ratio(over(rgb(m[1]), back), back)); + } + if (best < 2.95) weak.push(`${name(f)} ${best.toFixed(2)}:1`); + } + if (weak.length) push(40, 'FAIL', `a field's edge is under 3:1 against what surrounds it: ${weak.slice(0, 3).join(', ')}`, 'Draw the field in --color-muted, or fill it a step off the surface it sits on'); + + const weights = new Map(); + const strained = []; + const tw = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT); + for (let t = tw.nextNode(); t; t = tw.nextNode()) { + const host = t.parentElement; const txt = t.textContent.trim(); + if (!txt || !host || quiet(host) || host.closest('svg') || !vis(host)) continue; + const hs = getComputedStyle(host); + const w = Math.round((parseFloat(hs.fontWeight) || 400) / 100) * 100; + weights.set(w, (weights.get(w) || 0) + txt.length); + if (strained.length >= 4 || txt.length < 3 || host.closest('sup, sub, [data-slot], figure svg') || strained.some((x) => x.el === host)) continue; + const size = parseFloat(hs.fontSize) || 16; + const prose = !!host.closest('p, li, dd, blockquote') && txt.length > 60 && size < 28; + const lh = parseFloat(hs.lineHeight); + if (size < 11 || (prose && size < 12)) strained.push({ el: host, why: `${name(host)} at ${Math.round(size * 10) / 10}px` }); + else if (prose && lh && lh / size < 1.3 && host.getBoundingClientRect().height > lh * 2.2) strained.push({ el: host, why: `${name(host)} leaded ${(lh / size).toFixed(2)}` }); + } + if (strained.length) push(75, 'REFLEX', `text that strains the eye: ${strained.map((x) => x.why).join(', ')}`, 'Running text 12px or more (16px for body), functional text 11px or more, multi-line prose leaded 1.3 or more'); + const dead = [...document.querySelectorAll('img')].filter((el) => !quiet(el) && el.complete && el.naturalWidth === 0 && (el.currentSrc || el.getAttribute('src'))); + if (dead.length) push(76, 'FAIL', `an image that does not load: ${dead.slice(0, 3).map((el) => (el.getAttribute('src') || '').split('/').pop().slice(0, 40)).join(', ')}`, 'Point it at a file that exists, make it a data-slot placeholder, or remove it'); + const used = [...weights].filter(([, n]) => n >= 30).map(([w]) => w).sort((a, b) => a - b); + if (used.length > 3) push('F19', 'WARN', `${used.length} font weights in running use (${used.join(', ')})`, 'Three weights at most, display and body together, picked as extremes'); + + for (const g of all) { + const cs = getComputedStyle(g); + const grid = /grid/.test(cs.display); + const wrap = /flex/.test(cs.display) && cs.flexWrap === 'wrap' && cs.flexDirection.startsWith('row'); + if ((!grid && !wrap) || g.closest('nav, footer, form')) continue; + const kids = [...g.children].filter((c) => vis(c) && !/absolute|fixed/.test(getComputedStyle(c).position)); + if (kids.length < 3) continue; + const rects = kids.map((c) => c.getBoundingClientRect()); + if (grid && Math.max(...rects.map((r) => r.width)) > Math.min(...rects.map((r) => r.width)) * 1.15) continue; + if (wrap && !kids.every((c) => c.querySelector('img, svg') || /^(IMG|svg)$/.test(c.tagName) || c.getBoundingClientRect().width >= 120)) continue; + const rows = []; + for (const r of rects) { const row = rows.find((x) => Math.abs(x.top - r.top) < 4); if (row) row.n++; else rows.push({ top: r.top, n: 1 }); } + rows.sort((a, b) => a.top - b.top); + if (rows.length >= 2 && rows[rows.length - 1].n === 1 && rows[rows.length - 2].n >= 2) { push('F20', 'WARN', `${name(g)} leaves one item alone on its last row (${rows.map((x) => x.n).join(' + ')})`, 'Change the count or the columns so the last row is not an orphan'); break; } + } + return out; +} + +async function observeOcclusion() { + const out = []; + const vis = (el) => { const cs = getComputedStyle(el); if (cs.display === 'none' || cs.visibility === 'hidden' || parseFloat(cs.opacity) === 0) return false; const r = el.getBoundingClientRect(); return r.width > 3 && r.height > 3; }; + const pinned = (el) => { for (let p = el; p && p !== document.body; p = p.parentElement) if (/fixed|sticky/.test(getComputedStyle(p).position)) return true; return false; }; + const unseen = (el) => { const cs = getComputedStyle(el); return parseFloat(cs.opacity) < 0.05 || (/^(transparent|rgba\(0, 0, 0, 0\))$/.test(cs.backgroundColor) && cs.backgroundImage === 'none' && !(el.innerText || '').trim() && !/^(IMG|svg|CANVAS|VIDEO|PICTURE)$/.test(el.tagName) && !el.querySelector('img, svg, canvas, video')); }; + const runs = []; + let total = 0, hidden = 0; + const tw = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT); + for (let t = tw.nextNode(); t; t = tw.nextNode()) { + const host = t.parentElement; const txt = t.textContent.trim(); + if (!txt || !host || host.closest('script, style, noscript, svg, [aria-hidden="true"], nav, header, dialog, [popover], [role="menu"], details:not([open]), [hidden]')) continue; + if (getComputedStyle(host).display === 'none') continue; + total += txt.length; + let gone = false; + for (let p = host; p && p !== document.body; p = p.parentElement) { const cs = getComputedStyle(p); if (cs.display === 'none') { gone = null; break; } if (cs.visibility === 'hidden' || parseFloat(cs.opacity) === 0) gone = true; } + if (gone === null) { total -= txt.length; continue; } + if (gone) { hidden += txt.length; continue; } + if (!host.closest('[data-slot]') && vis(host)) runs.push({ t, host }); + } + if (total > 500 && hidden > 150 && hidden / total > 0.3) out.push({ gate: '62', grade: 'FAIL', evidence: `${Math.round((100 * hidden) / total)}% of the page's text is still hidden after load`, fix: 'Visible by default: scope the hidden state under a .js class, or show the end state under reduced motion' }); + const bad = []; + const H = document.documentElement.scrollHeight; + for (let y = 0; y < H && bad.length < 3; y += Math.max(200, innerHeight - 100)) { + window.scrollTo(0, y); + await new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(r))); + for (const { t, host } of runs) { + if (bad.length >= 3) break; + if (pinned(host)) continue; + const rg = document.createRange(); rg.selectNodeContents(t); + for (const q of rg.getClientRects()) { + if (q.width < 6 || q.height < 6) continue; + const cx = q.left + q.width / 2, cy = q.top + q.height / 2; + if (cy < 0 || cy >= innerHeight || cx < 0 || cx >= innerWidth) continue; + const ghost = getComputedStyle(host).pointerEvents === 'none'; if (ghost) host.style.setProperty('pointer-events', 'auto', 'important'); + const top = document.elementFromPoint(cx, cy); + if (ghost) host.style.removeProperty('pointer-events'); + if (!top || top === host || host.contains(top) || top.contains(host) || pinned(top) || unseen(top)) continue; + const tr = top.getBoundingClientRect(); + if (!(cx >= tr.left && cx <= tr.right && cy >= tr.top && cy <= tr.bottom)) { + const clearPseudo = (ps) => /^(none|normal)$/.test(ps.content) || (/^(transparent|rgba\(0, 0, 0, 0\))$/.test(ps.backgroundColor) && ps.backgroundImage === 'none'); + if (clearPseudo(getComputedStyle(top, '::after')) && clearPseudo(getComputedStyle(top, '::before'))) continue; + } + bad.push(`${top.tagName.toLowerCase()}${top.classList[0] ? '.' + top.classList[0] : ''} over "${t.textContent.trim().slice(0, 16)}"`); + break; + } + } + } + window.scrollTo(0, 0); + if (bad.length) out.push({ gate: '73', grade: 'FAIL', evidence: `text painted under another element: ${bad.join('; ')}`, fix: 'Give the text its own space, or put it above what covers it on a surface of its own' }); + return out; +} + +if (process.argv[1] && import.meta.url === pathToFileURL(resolve(process.argv[1])).href) { + const htmls = process.argv.slice(2).filter((p) => p.endsWith('.html')); + const res = await renderCheck(process.argv.slice(2).filter((p) => isUrl(p)).concat(htmls.map((p) => resolve(process.cwd(), p)))); + console.log(JSON.stringify(res, null, 2)); + process.exit(0); +} diff --git a/skills/hallmark/scripts/sloplint-render.test.mjs b/skills/hallmark/scripts/sloplint-render.test.mjs new file mode 100644 index 0000000..03445ca --- /dev/null +++ b/skills/hallmark/scripts/sloplint-render.test.mjs @@ -0,0 +1,66 @@ +import assert from 'node:assert/strict'; +import { mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs'; +import { tmpdir } from 'node:os'; +import { join } from 'node:path'; +import { pathToFileURL } from 'node:url'; +import test from 'node:test'; + +// Use the production helpers unchanged, with test-only exports in a temporary module. +const dir = mkdtempSync(join(tmpdir(), 'hallmark-render-')); +const source = readFileSync(new URL('./sloplint-render.mjs', import.meta.url), 'utf8'); +const modulePath = join(dir, 'render.mjs'); +writeFileSync(modulePath, source + '\nexport { pixelBehind, pixelsAroundRing };\n'); +const { pixelBehind, pixelsAroundRing } = await import(pathToFileURL(modulePath)); +rmSync(dir, { recursive: true, force: true }); +const puppeteerPath = process.env.HALLMARK_TEST_PUPPETEER; +const chromePath = process.env.HALLMARK_TEST_CHROME; +const skip = !puppeteerPath || !chromePath ? 'set HALLMARK_TEST_PUPPETEER and HALLMARK_TEST_CHROME for real-browser regressions' : false; + +async function withPage(run) { + const { default: puppeteer } = await import(pathToFileURL(puppeteerPath)); + const browser = await puppeteer.launch({ executablePath: chromePath, headless: true }); + try { + const page = await browser.newPage(); + await page.setViewport({ width: 400, height: 300 }); + await run(page); + } finally { + await browser.close(); + } +} +const styles = (page) => page.$eval('#target', (el) => ({ + properties: [...el.style].sort().map((k) => [k, el.style.getPropertyValue(k), el.style.getPropertyPriority(k)]), + hasStyle: el.hasAttribute('style'), + marker: el.getAttribute('data-hm-ring'), + color: getComputedStyle(el).color, +})); + +for (const outcome of ['success', 'screenshot failure', 'small clip']) { + test(`text pixel probe restores inline styles after ${outcome}`, { skip }, async () => withPage(async (page) => { + await page.setContent('

          Low contrast text

          '); + if (outcome === 'small clip') await page.$eval('#target', (el) => { el.style.width = '1px'; el.style.height = '1px'; }); + const before = await styles(page); + if (outcome === 'screenshot failure') page.screenshot = async () => { throw new Error('fixture screenshot failure'); }; + const result = await pixelBehind(page, 1); + if (outcome === 'success') assert.deepEqual(result, [1, 1, 1], 'sample the white background with text hidden'); + else assert.equal(result, null); + assert.deepEqual(await styles(page), before); + })); + test(`ring pixel probe restores inline styles after ${outcome}`, { skip }, async () => withPage(async (page) => { + await page.setContent(''); + await page.focus('#target'); + const rect = await page.$eval('#target', (el) => { const r = el.getBoundingClientRect(); return { x: r.x, y: r.y, w: r.width, h: r.height }; }); + const before = await styles(page); + if (outcome === 'screenshot failure') page.screenshot = async () => { throw new Error('fixture screenshot failure'); }; + const result = await pixelsAroundRing(page, { rect: outcome === 'small clip' ? { x: 500, y: 500, w: 1, h: 1 } : rect, pad: 4 }); + if (outcome === 'success') assert.deepEqual(result, [1, 1, 1], 'sample the white surrounding pixels with ring hidden'); + else assert.equal(result, null); + assert.deepEqual(await styles(page), before); + })); +} + +test('text probe preserves absence of an inline style attribute', { skip }, async () => withPage(async (page) => { + await page.setContent('

          Plain text

          '); + const before = await styles(page); + await pixelBehind(page, 1); + assert.deepEqual(await styles(page), before); +})); diff --git a/skills/hallmark/scripts/sloplint.mjs b/skills/hallmark/scripts/sloplint.mjs new file mode 100644 index 0000000..a7a2cc8 --- /dev/null +++ b/skills/hallmark/scripts/sloplint.mjs @@ -0,0 +1,4426 @@ +#!/usr/bin/env node +/* sloplint: Hallmark's mechanical gate checker. Zero dependencies, Node 18+. Gate ids and tiers: references/gates.md. */ +import { createHash } from 'node:crypto'; +import { readFileSync, readdirSync, statSync, realpathSync, existsSync, writeFileSync, mkdirSync } from 'node:fs'; +import { join, extname, dirname, basename, resolve } from 'node:path'; +import { fileURLToPath } from 'node:url'; + +const GENRES = ['editorial', 'modern-minimal', 'atmospheric', 'playful']; +const args = process.argv.slice(2); +const opts = { genre: null, scope: 'page', json: false, render: false, tier: null, stage: 'page', before: false, kept: false, urls: [], paths: [] }; +for (let i = 0; i < args.length; i++) { + const a = args[i]; + if (a === '--genre') { opts.genre = args[++i]; } + else if (a === '--scope') { opts.scope = args[++i]; } + else if (a === '--json') { opts.json = true; } + else if (a === '--render') { opts.render = true; } + else if (a === '--before') { opts.before = true; } + else if (a === '--kept') { opts.kept = true; } + else if (a === '--tier') { opts.tier = args[++i]; } + else if (a === '--stage') { opts.stage = args[++i]; } + else if (a === '--url') { opts.urls.push(args[++i]); opts.render = true; } + else if (a === '--help' || a === '-h') { usage(); process.exit(0); } + else if (a.startsWith('--')) { console.error(`unknown flag ${a}`); usage(); process.exit(2); } + else opts.paths.push(a); +} +function usage() { + console.error('usage: node sloplint.mjs [--genre editorial|modern-minimal|atmospheric|playful] [--scope page|component|app] [--stage hero|page] [--json] [--render] [--url http://localhost:3000] [--tier floor] [--before | --kept]'); + console.error('--before records what the target says and does (.hallmark/before.json, screenshots in .hallmark/before); --kept checks a redesign against that record'); + console.error('reads .html and .css, plus .jsx .tsx .vue .svelte .astro (Tailwind class strings, cn/clsx/cva calls); skips node_modules, dist, build, coverage and dot folders'); +} +if (!opts.paths.length && !opts.urls.length) { usage(); process.exit(2); } +if (!['hero', 'page'].includes(opts.stage)) { console.error('--stage must be hero or page'); process.exit(2); } +if (opts.urls.some((u) => !/^https?:\/\//.test(u || ''))) { console.error('--url takes an http or https address'); process.exit(2); } +if (opts.genre && !GENRES.includes(opts.genre)) { + console.error(`--genre must be one of: ${GENRES.join(', ')}`); process.exit(2); +} +if (!['page', 'component', 'app'].includes(opts.scope)) { + console.error('--scope must be page, component or app'); process.exit(2); +} +if (opts.before && opts.kept) { console.error('--before records and --kept compares; pass one'); process.exit(2); } + +const DOC_EXT = new Set(['.html', '.jsx', '.tsx', '.vue', '.svelte', '.astro']); +const BUILD_DIRS = new Set(['dist', 'build', 'coverage']); +function collectFiles(paths) { + const files = []; + const seen = new Set(); + const visit = (p, top) => { + const abs = resolve(p); + let st; + let real; + try { st = statSync(abs); real = realpathSync(abs); } catch { console.error(`sloplint: cannot read ${p}`); if (top) process.exit(2); return; } + if (st.isDirectory()) { + const base = basename(abs); + if (base === 'node_modules' || (!top && (base.startsWith('.') || BUILD_DIRS.has(base)))) return; + } + if (seen.has(real)) return; + seen.add(real); + if (st.isDirectory()) { + for (const e of readdirSync(abs)) visit(join(abs, e), false); + } else { + const ext = extname(abs).toLowerCase(); + if (ext === '.css' || DOC_EXT.has(ext)) files.push(abs); + } + }; + for (const p of paths) visit(p, true); + return files; +} + +function stripComments(src) { + let out = ''; + let i = 0; + while (i < src.length) { + if (src[i] === '/' && src[i + 1] === '*') { + const end = src.indexOf('*/', i + 2); + const stop = end === -1 ? src.length : end + 2; + out += src.slice(i, stop).replace(/[^\n]/g, ' '); + i = stop; + } else if (src[i] === '"' || src[i] === "'") { + const q = src[i]; let j = i + 1; + while (j < src.length && src[j] !== q) { if (src[j] === '\\') j++; j++; } + out += src.slice(i, Math.min(j + 1, src.length)); i = j + 1; + } else { out += src[i]; i++; } + } + return out; +} + +function parseCss(source, file, lineOffset = 0) { + const src = stripComments(source); + const nl = []; + for (let i = 0; i < src.length; i++) if (src[i] === '\n') nl.push(i); + const lineOf = (pos) => { + let lo = 0, hi = nl.length; + while (lo < hi) { const mid = (lo + hi) >> 1; if (nl[mid] < pos) lo = mid + 1; else hi = mid; } + return lo + 1 + lineOffset; + }; + const rules = []; + const flatBody = (s, e) => { + const out = src.slice(s, e).split(''); + let depth = 0, edge = -1; + for (let i = 0; i < out.length; i++) { + const c = out[i]; + if (c === '{') { + if (depth === 0) for (let k = edge + 1; k < i; k++) if (out[k] !== '\n') out[k] = ' '; + depth++; out[i] = ' '; + } else if (c === '}') { + depth = Math.max(0, depth - 1); out[i] = ' '; + if (depth === 0) edge = i; + } else if (depth > 0) { if (c !== '\n') out[i] = ' '; } + else if (c === ';') edge = i; + } + return out.join(''); + }; + const nestSel = (sel, parent) => { + const p = parent.includes(',') ? `:is(${parent})` : parent; + return sel.split(/,(?![^(]*\))/).map((part) => part.includes('&') ? part.trim().replace(/&/g, p) : `${p} ${part.trim()}`).join(', '); + }; + const makeRule = (selector, s, e, media, keyframes) => { + const body = flatBody(s, e); + const decls = []; + let off = 0; + for (const part of body.split(';')) { + const idx = part.indexOf(':'); + if (idx > 0) { + const prop = part.slice(0, idx).trim().toLowerCase(); + const value = part.slice(idx + 1).trim().replace(/!important\s*$/i, '').trim(); + if (prop && value && /^-{0,2}[a-z]/.test(prop) && !/[{}]/.test(prop)) { + decls.push({ prop, value, line: lineOf(s + off + idx) }); + } + } + off += part.length + 1; + } + return { selector, decls, media: media || null, keyframes: keyframes || null, file, line: lineOf(s) }; + }; + const walk = (start, end, media, keyframes, parent = null) => { + let i = start; + while (i < end) { + while (i < end && /[\s;]/.test(src[i])) i++; + if (i >= end) break; + let j = i; + while (j < end && src[j] !== '{' && src[j] !== '}' && src[j] !== ';') j++; + if (j >= end) break; + if (src[j] === '}' || src[j] === ';') { i = j + 1; continue; } + const selector = src.slice(i, j).trim().replace(/\s+/g, ' '); + const blockStart = j + 1; + let depth = 1, k = blockStart; + while (k < end && depth > 0) { + if (src[k] === '{') depth++; + else if (src[k] === '}') depth--; + k++; + } + const blockEnd = Math.max(blockStart, k - 1); + if (selector.startsWith('@')) { + if (/^@(media|supports|layer|container|scope)/i.test(selector)) { + const q = /^@media/i.test(selector) ? selector.replace(/^@media/i, '').trim() : media; + if (parent) rules.push(makeRule(parent, blockStart, blockEnd, q, keyframes)); + walk(blockStart, blockEnd, q, keyframes, parent); + } else if (/^@(-webkit-)?keyframes/i.test(selector)) { + const name = selector.replace(/^@(-webkit-)?keyframes/i, '').trim(); + walk(blockStart, blockEnd, media, name || 'anon'); + } else if (/^@font-face/i.test(selector)) { + rules.push(makeRule('@font-face', blockStart, blockEnd, media, null)); + } else if (/^@theme\b/i.test(selector)) { + rules.push(makeRule('@theme', blockStart, blockEnd, media, null)); + walk(blockStart, blockEnd, media, keyframes); + } + } else { + const sel = parent && !keyframes ? nestSel(selector, parent) : selector; + rules.push(makeRule(sel, blockStart, blockEnd, media, keyframes)); + if (!keyframes && src.slice(blockStart, blockEnd).includes('{')) walk(blockStart, blockEnd, media, keyframes, sel); + } + i = k; + } + }; + walk(0, src.length, null, null); + return rules; +} + +const VOID_TAGS = new Set(['area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'link', 'meta', 'param', 'source', 'track', 'wbr']); +const HTML_NAMES = new Set(('a abbr address area article aside audio b base bdi bdo blockquote body br button canvas caption cite code col colgroup data datalist dd del details dfn dialog div dl dt em embed fieldset figcaption figure footer form h1 h2 h3 h4 h5 h6 head header hgroup hr html i iframe img input ins kbd label legend li link main map mark menu meta meter nav noscript object ol optgroup option output p param picture pre progress q rp rt ruby s samp script search section select slot small source span strong style sub summary sup svg table tbody td template textarea tfoot th thead time title tr track u ul var video wbr').split(' ')); + +function parseHtml(file, src, kind = 'html') { + const nl = []; + for (let i = 0; i < src.length; i++) if (src[i] === '\n') nl.push(i); + const lineOf = (pos) => { + let lo = 0, hi = nl.length; + while (lo < hi) { const mid = (lo + hi) >> 1; if (nl[mid] < pos) lo = mid + 1; else hi = mid; } + return lo + 1; + }; + const styles = []; + const styleRe = /]*>([\s\S]*?)<\/style>/gi; + let m; + while ((m = styleRe.exec(src))) { + styles.push({ css: m[1], lineOffset: lineOf(m.index) - 1 }); + } + let scripts = ''; + const scriptRe = /]*>([\s\S]*?)<\/script>/gi; + while ((m = scriptRe.exec(src))) scripts += m[1] + '\n'; + + const pad = (t) => t.replace(/[^\n]/g, ' '); + const masked = src + .replace(//g, pad) + .replace(/(<(script|style)\b[^>]*>)([\s\S]*?)(<\/\2\s*>)/gi, (m0, open, tag, body, close) => open + pad(body) + close); + const tags = []; + const comps = []; + const tagRe = /<(\/?)([a-zA-Z][a-zA-Z0-9-]*)((?:"[^"]*"|'[^']*'|[^>"'])*)>/g; + while ((m = tagRe.exec(masked))) { + if (kind !== 'html' && !HTML_NAMES.has(m[2])) { + comps.push({ close: m[1] === '/', name: m[2], attrs: m[3] || '', pos: m.index, end: m.index + m[0].length, selfClosing: /\/\s*$/.test(m[3] || ''), line: lineOf(m.index) }); + continue; + } + tags.push({ + close: m[1] === '/', name: m[2].toLowerCase(), attrs: m[3] || '', + pos: m.index, end: m.index + m[0].length, + selfClosing: /\/\s*$/.test(m[3] || '') || VOID_TAGS.has(m[2].toLowerCase()), + line: lineOf(m.index), + }); + } + const noScript = src.replace(/]*>[\s\S]*?<\/script>/gi, ' ') + .replace(/]*>[\s\S]*?<\/style>/gi, ' ') + .replace(//g, ' '); + const text = noScript.replace(/<[^>]*>/g, ' ') + .replace(/"|�?34;/g, '"').replace(/�?39;|'/g, "'") + .replace(/…|…/g, '\u2026').replace(/—|—|—/gi, '\u2014').replace(/–|–|–/gi, '\u2013') + .replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>') + .replace(/ /g, ' ').replace(/[ \t]+/g, ' '); + return { file, src, masked, styles, scripts, tags, text, lineOf, kind, comps }; +} + +function braceEnd(s, j) { + let depth = 0; + for (let i = j; i < s.length; i++) { + const c = s[i]; + if (c === '"' || c === "'" || c === '`') { + i++; + while (i < s.length && s[i] !== c) { if (s[i] === '\\') i++; i++; } + continue; + } + if (c === '{') depth++; + else if (c === '}' && --depth === 0) return i; + } + return s.length; +} + +const FRONTMATTER = /^\s*---[^\n]*\n[\s\S]*?\n---/; +function templateMask(src, kind) { + const n = src.length; + let out = null; + const put = (k, ch) => { if (!out) out = src.split(''); out[k] = ch; }; + const blank = (a, b) => { for (let k = a; k < b; k++) if (src[k] !== '\n' && src[k] !== ' ') put(k, ' '); }; + const lower = src.toLowerCase(); + const braces = kind === 'svelte' || kind === 'astro'; + let i = 0; + if (kind === 'astro') { + const fm = FRONTMATTER.exec(src); + if (fm) { blank(0, fm[0].length); i = fm[0].length; } + } + while (i < n) { + const lt = src.indexOf('<', i); + if (lt < 0) break; + if (src.startsWith('', lt + 4); i = e < 0 ? n : e + 3; continue; } + if (!/[A-Za-z]/.test(src[lt + 1] || '')) { i = lt + 1; continue; } + let j = lt + 1; + while (j < n && /[\w:.-]/.test(src[j])) j++; + const name = lower.slice(lt + 1, j); + while (j < n && src[j] !== '>') { + const c = src[j]; + if (c === '"' || c === "'") { + let e = src.indexOf(c, j + 1); + if (e < 0) e = n; + for (let k = j + 1; k < e; k++) if (src[k] === '<' || src[k] === '>') put(k, ' '); + j = e + 1; + continue; + } + if (c === '{' && braces) { const e = braceEnd(src, j); blank(j + 1, e); j = e + 1; continue; } + j++; + } + i = j + 1; + if (name === 'script' || name === 'style' || name === 'textarea') { + const e = lower.indexOf(' { + let s = seg; + if (after) s = s.replace(/^\S+/, ''); + if (before) s = s.replace(/\S+$/, ''); + return s; +}; +function clsLits(s, level = 0) { + if (level > 20) return []; + const parts = []; + let i = 0; + while (i < s.length) { + const c = s[i]; + if (c === '/' && s[i + 1] === '/') { const e = s.indexOf('\n', i); i = e < 0 ? s.length : e; continue; } + if (c === '/' && s[i + 1] === '*') { const e = s.indexOf('*/', i + 2); i = e < 0 ? s.length : e + 2; continue; } + if (c === '"' || c === "'") { + let j = i + 1; + while (j < s.length && s[j] !== c && s[j] !== '\n') { if (s[j] === '\\') j++; j++; } + parts.push(s.slice(i + 1, j)); + i = j + 1; + continue; + } + if (c === '`') { + let j = i + 1, seg = '', after = false; + while (j < s.length && s[j] !== '`') { + if (s[j] === '\\') { seg += s[j + 1] || ''; j += 2; continue; } + if (s[j] === '$' && s[j + 1] === '{') { + parts.push(cutGlued(seg, after, true)); + const e = braceEnd(s, j + 1); + parts.push(clsLits(s.slice(j + 2, e), level + 1).join(' ')); + j = e + 1; seg = ''; after = true; + continue; + } + seg += s[j]; j++; + } + parts.push(cutGlued(seg, after, false)); + i = j + 1; + continue; + } + i++; + } + return parts.join(' ').split(/\s+/).filter(Boolean); +} + +const JS_EXPR_KW = new Set(['return', 'yield', 'await', 'case', 'default', 'else', 'do', 'throw', 'typeof', 'void', 'delete', 'in', 'of', 'new', 'instanceof']); +const CLASS_FNS = new Set(['cn', 'clsx', 'classNames', 'classnames', 'twMerge', 'twJoin', 'cva', 'cx', 'tv']); +function jsxPseudo(src) { + const n = src.length; + const out = new Array(n); + for (let k = 0; k < n; k++) out[k] = src[k] === '\n' ? '\n' : ' '; + const classes = []; + const calls = []; + let hi = 0, fails = 0, inClass = 0, depth = 0; + const blank = (a, b) => { for (let k = a; k < b && k < n; k++) out[k] = src[k] === '\n' ? '\n' : ' '; }; + const paint = (a, b) => { for (let k = a; k < b && k < n; k++) out[k] = src[k]; if (b > hi) hi = b; }; + const write = (a, b, text) => { + blank(a, b); + let k = a; + for (const ch of text) { while (k < b && src[k] === '\n') k++; if (k >= b) break; out[k++] = ch; } + if (b > hi) hi = b; + }; + const ws = (i) => { while (i < n && /\s/.test(src[i])) i++; return i; }; + const gap = (i) => { + for (;;) { + i = ws(i); + if (src[i] === '/' && src[i + 1] === '*') { const e = src.indexOf('*/', i + 2); if (e < 0) return n; i = e + 2; continue; } + if (src[i] === '/' && src[i + 1] === '/') { const e = src.indexOf('\n', i); if (e < 0) return n; i = e; continue; } + return i; + } + }; + const strEnd = (i) => { + const q = src[i]; + let j = i + 1; + while (j < n && src[j] !== q && src[j] !== '\n') { if (src[j] === '\\') j++; j++; } + return Math.min(j + 1, n); + }; + const tplEnd = (i) => { + let j = i + 1; + while (j < n && src[j] !== '`') { + if (src[j] === '\\') { j += 2; continue; } + if (src[j] === '$' && src[j + 1] === '{') { j = js(j + 2, true) + 1; continue; } + j++; + } + return Math.min(j + 1, n); + }; + const reEnd = (i) => { + let j = i + 1, set = false; + while (j < n && src[j] !== '\n') { + const c = src[j]; + if (c === '\\') { j += 2; continue; } + if (c === '[') set = true; + else if (c === ']') set = false; + else if (c === '/' && !set) { j++; while (j < n && /[a-z]/i.test(src[j])) j++; return j; } + j++; + } + return -1; + }; + function js(i, stop) { + if (depth > 200) return stop ? Math.min(braceEnd(src, i - 1), n) : n; + depth++; + const r = jsScan(i, stop); + depth--; + return r; + } + function jsScan(i, stop) { + let level = 0, val = false; + while (i < n) { + const c = src[i]; + if (c === ' ' || c === '\n' || c === '\t' || c === '\r') { i++; continue; } + if (c === '/' && src[i + 1] === '/') { const e = src.indexOf('\n', i); i = e < 0 ? n : e; continue; } + if (c === '/' && src[i + 1] === '*') { const e = src.indexOf('*/', i + 2); i = e < 0 ? n : e + 2; continue; } + if (c === '"' || c === "'") { i = strEnd(i); val = true; continue; } + if (c === '`') { i = tplEnd(i); val = true; continue; } + if (c === '{') { level++; i++; val = false; continue; } + if (c === '}') { if (stop && level === 0) return i; level--; i++; val = true; continue; } + if (c === ')' || c === ']') { i++; val = true; continue; } + if (c === '<' && !val && fails < 500 && /[A-Za-z_$>]/.test(src[i + 1] || '')) { + const e = el(i); + if (e > 0) { i = e; val = true; continue; } + fails++; + } + if (c === '/' && !val) { const e = reEnd(i); if (e > 0) { i = e; val = true; continue; } } + if (/[A-Za-z_$]/.test(c)) { + let j = i + 1; + while (j < n && /[\w$]/.test(src[j])) j++; + const w = src.slice(i, j); + val = !JS_EXPR_KW.has(w); + if (!inClass && CLASS_FNS.has(w) && src[i - 1] !== '.' && src[ws(j)] === '(') calls.push(i); + i = j; + continue; + } + if (c >= '0' && c <= '9') { let j = i + 1; while (j < n && /[\w.]/.test(src[j])) j++; i = j; val = true; continue; } + i++; + val = false; + } + return n; + } + function el(start) { + if (depth > 200) return -1; + const mc = classes.length, mk = calls.length; + depth++; + const e = tag(start); + depth--; + if (e < 0) { blank(start, Math.max(hi, start + 1)); hi = start; classes.length = mc; calls.length = mk; } + return e; + } + function tag(start) { + let i = start + 1; + if (src[i] === '>') return kids(i + 1, ''); + let j = i; + while (j < n && /[\w$.:-]/.test(src[j])) j++; + const name = src.slice(i, j); + paint(start, j); + i = j; + let cls = null; + for (;;) { + i = gap(i); + if (i >= n) return -1; + const c = src[i]; + if (c === '/' && src[i + 1] === '>') { paint(i, i + 2); if (cls) classes.push([start, cls]); return i + 2; } + if (c === '>') { paint(i, i + 1); i++; break; } + if (c === '{') { const e = js(i + 1, true); if (e >= n) return -1; blank(i, e + 1); i = e + 1; continue; } + if (!/[A-Za-z_$]/.test(c)) return -1; + let k = i + 1; + while (k < n && /[\w$:.-]/.test(src[k])) k++; + const attr = src.slice(i, k); + let v = ws(k); + if (src[v] !== '=') { paint(i, k); i = k; continue; } + v = ws(v + 1); + const q = src[v]; + const isCls = attr === 'className' || attr === 'class'; + let e; + if (q === '"' || q === "'") { + e = src.indexOf(q, v + 1); + if (e < 0) return -1; + if (isCls) cls = (cls || []).concat(src.slice(v + 1, e).split(/\s+/).filter(Boolean)); + else paint(i, e + 1); + } else if (q === '{') { + if (isCls) inClass++; + e = js(v + 1, true); + if (isCls) inClass--; + if (e >= n) return -1; + if (isCls) cls = (cls || []).concat(clsLits(src.slice(v + 1, e))); + else { paint(i, v); write(v, e + 1, '"' + src.slice(v + 1, e).replace(/[^\w$.\-/:#@]+/g, ' ') + '"'); } + } else if (q === '<') { + e = el(v) - 1; + if (e < 0) return -1; + blank(i, e + 1); + } else return -1; + if (isCls && cls) write(i, e + 1, 'class="' + cls.join(' ').replace(/"/g, "'").replace(/[<>]/g, ' ') + '"'); + i = e + 1; + } + if (cls) classes.push([start, cls]); + return kids(i, name); + } + function kids(i, name) { + while (i < n) { + const c = src[i]; + if (c === '{') { const e = js(i + 1, true); if (e >= n) return -1; i = e + 1; continue; } + if (c === '<') { + if (src[i + 1] === '/') { + const k = ws(i + 2); + let j = k; + while (j < n && /[\w$.:-]/.test(src[j])) j++; + const e = ws(j); + if (src[e] !== '>' || src.slice(k, j) !== name) return -1; + if (name) paint(i, e + 1); + return e + 1; + } + if (/[A-Za-z_$>]/.test(src[i + 1] || '')) { const e = el(i); if (e > 0) { i = e; continue; } } + i++; + continue; + } + out[i] = c; + if (i >= hi) hi = i + 1; + i++; + } + return -1; + } + js(0, false); + return { pseudo: out.join(''), classAt: new Map(classes), calls }; +} + +function classCalls(src, sites) { + const out = []; + let last = -1; + for (const pos of [...sites].sort((a, b) => a - b)) { + if (pos < last) continue; + const open = src.indexOf('(', pos); + if (open < 0) continue; + let depth = 0, i = open; + for (; i < src.length; i++) { + const c = src[i]; + if (c === '/' && src[i + 1] === '/') { const e = src.indexOf('\n', i); i = e < 0 ? src.length : e; continue; } + if (c === '/' && src[i + 1] === '*') { const e = src.indexOf('*/', i + 2); i = e < 0 ? src.length : e + 1; continue; } + if (c === '"' || c === "'" || c === '`') { i++; while (i < src.length && src[i] !== c) { if (src[i] === '\\') i++; i++; } continue; } + if (c === '(') depth++; + else if (c === ')' && --depth === 0) break; + } + last = i; + const toks = clsLits(src.slice(open + 1, i)); + if (toks.length) out.push({ pos, name: /^[\w$]+/.exec(src.slice(pos))[0], toks }); + } + return out; +} + +function scriptSites(src, kind) { + const ranges = []; + for (const m of src.matchAll(/]*>([\s\S]*?)<\/script>/gi)) ranges.push([m.index + m[0].length - m[1].length - 9, m.index + m[0].length - 9]); + const fm = kind === 'astro' ? FRONTMATTER.exec(src) : null; + if (fm) ranges.push([0, fm[0].length]); + const sites = []; + for (const [a, b] of ranges) { + for (const m of src.slice(a, b).matchAll(/(?/]+))`, 'i'); + const m = re.exec(attrStr); + if (!m) return null; + return m[2] ?? m[3] ?? m[4] ?? ''; +} +function hasAttr(attrStr, name) { + return new RegExp(`(?:^|\\s)${name}(?=[\\s=/]|$)`, 'i').test(attrStr); +} + +function directChildren(doc, idx) { + const open = doc.tags[idx]; + if (open.close || open.selfClosing) return []; + const children = []; + let depth = 1; + let childStart = -1, childOpen = null, childIdx = -1; + for (let i = idx + 1; i < doc.tags.length; i++) { + const t = doc.tags[i]; + if (t.close) { + depth--; + if (depth === 0) break; + if (depth === 1 && childOpen) { + children.push({ name: childOpen.name, open: doc.src.slice(childOpen.pos, childOpen.end), html: doc.src.slice(childStart, t.end), idx: childIdx }); + childOpen = null; + } + continue; + } + if (depth === 1) { + if (t.selfClosing) { + children.push({ name: t.name, open: doc.src.slice(t.pos, t.end), html: doc.src.slice(t.pos, t.end), idx: i }); + } else { + childStart = t.pos; childOpen = t; childIdx = i; + } + } + if (!t.selfClosing) depth++; + } + return children; +} + +function ancestorMap(doc) { + if (doc._anc) return doc._anc; + const map = new Map(); + const stack = []; + for (let i = 0; i < doc.tags.length; i++) { + const t = doc.tags[i]; + if (t.close) { stack.pop(); continue; } + map.set(i, stack.slice()); + if (!t.selfClosing) stack.push(t.name); + } + doc._anc = map; + return map; +} + +function plainText(html) { + return html.replace(/<[^>]*>/g, ' ') + .replace(/·|�?183;|�?b7;/gi, '·').replace(/•|•|•/gi, '•').replace(/—|—|—/gi, '\u2014').replace(/–|–|–/gi, '\u2013') + .replace(/→|→|→|⟶|⟶/gi, '\u2192').replace(/»|»|»/gi, '\u00bb').replace(/›|›|›/gi, '\u203a') + .replace(/ | /g, ' ').replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>') + .replace(/’|‘|’|‘|’|‘/gi, '\u2019').replace(/”|“|“|”/gi, '"') + .replace(/&#\d+;|&[a-z]+;/gi, ' ') + .replace(/\s+/g, ' ').trim(); +} + +function innerOf(doc, idx) { + const open = doc.tags[idx]; + if (open.close || open.selfClosing) return null; + let depth = 1; + for (let i = idx + 1; i < doc.tags.length; i++) { + const t = doc.tags[i]; + if (t.selfClosing) continue; + if (t.close) { depth--; if (depth === 0) return { inner: doc.src.slice(open.end, t.pos), endPos: t.pos }; } + else depth++; + } + return { inner: doc.src.slice(open.end), endPos: doc.src.length }; +} + +function parseNum(s) { const v = parseFloat(s); return Number.isNaN(v) ? null : v; } + +function parseColor(raw) { + if (!raw) return null; + const v = raw.trim().toLowerCase(); + if (v === 'white') return { r: 1, g: 1, b: 1, alpha: 1 }; + if (v === 'black') return { r: 0, g: 0, b: 0, alpha: 1 }; + if (v === 'transparent') return { r: 0, g: 0, b: 0, alpha: 0 }; + let m; + if ((m = /^#([0-9a-f]{3,8})$/.exec(v))) { + const h = m[1]; + if (h.length === 3 || h.length === 4) { + const r = parseInt(h[0] + h[0], 16) / 255, g = parseInt(h[1] + h[1], 16) / 255, b = parseInt(h[2] + h[2], 16) / 255; + const a = h.length === 4 ? parseInt(h[3] + h[3], 16) / 255 : 1; + return { r, g, b, alpha: a }; + } + if (h.length === 6 || h.length === 8) { + const r = parseInt(h.slice(0, 2), 16) / 255, g = parseInt(h.slice(2, 4), 16) / 255, b = parseInt(h.slice(4, 6), 16) / 255; + const a = h.length === 8 ? parseInt(h.slice(6, 8), 16) / 255 : 1; + return { r, g, b, alpha: a }; + } + return null; + } + if ((m = /^rgba?\(([^)]+)\)$/.exec(v))) { + const parts = m[1].split('/'); + const nums = parts[0].split(/[\s,]+/).filter(Boolean); + if (nums.length < 3) return null; + const chan = (s) => s.endsWith('%') ? parseNum(s) / 100 : parseNum(s) / 255; + let alpha = 1; + if (parts[1] != null) alpha = parts[1].trim().endsWith('%') ? parseNum(parts[1]) / 100 : parseNum(parts[1]); + else if (nums.length === 4) alpha = nums[3].endsWith('%') ? parseNum(nums[3]) / 100 : parseNum(nums[3]); + const [r, g, b] = nums.slice(0, 3).map(chan); + if ([r, g, b].some((x) => x == null)) return null; + return { r, g, b, alpha: alpha ?? 1 }; + } + if ((m = /^hsla?\(([^)]+)\)$/.exec(v))) { + const parts = m[1].split('/'); + const nums = parts[0].split(/[\s,]+/).filter(Boolean); + if (nums.length < 3) return null; + const h = parseNum(nums[0]); + const s = parseNum(nums[1]) / 100, l = parseNum(nums[2]) / 100; + let alpha = 1; + if (parts[1] != null) alpha = parts[1].trim().endsWith('%') ? parseNum(parts[1]) / 100 : parseNum(parts[1]); + else if (nums.length === 4) alpha = nums[3].endsWith('%') ? parseNum(nums[3]) / 100 : parseNum(nums[3]); + if ([h, s, l].some((x) => x == null)) return null; + const c = (1 - Math.abs(2 * l - 1)) * s; + const hp = ((h % 360) + 360) % 360 / 60; + const x = c * (1 - Math.abs((hp % 2) - 1)); + let rgb = [0, 0, 0]; + if (hp < 1) rgb = [c, x, 0]; else if (hp < 2) rgb = [x, c, 0]; + else if (hp < 3) rgb = [0, c, x]; else if (hp < 4) rgb = [0, x, c]; + else if (hp < 5) rgb = [x, 0, c]; else rgb = [c, 0, x]; + const mAdd = l - c / 2; + return { r: rgb[0] + mAdd, g: rgb[1] + mAdd, b: rgb[2] + mAdd, alpha: alpha ?? 1 }; + } + if ((m = /^oklch\(([^)]+)\)$/.exec(v))) { + const parts = m[1].split('/'); + const nums = parts[0].split(/\s+/).filter(Boolean); + if (nums.length < 3) return null; + let L = parseNum(nums[0]); + if (nums[0].endsWith('%')) L = L / 100; + const C = parseNum(nums[1]); + let H = nums[2] === 'none' ? 0 : parseNum(nums[2]); + let alpha = 1; + if (parts[1] != null) alpha = parts[1].trim().endsWith('%') ? parseNum(parts[1]) / 100 : parseNum(parts[1]); + if (L == null || C == null || H == null) return null; + const rgb = oklchToSrgb(L, C, H); + return { ...rgb, alpha: alpha ?? 1, okl: { L, C, H } }; + } + return null; +} + +function oklchToSrgb(L, C, H) { + const hr = (H * Math.PI) / 180; + const a = C * Math.cos(hr), b = C * Math.sin(hr); + const l_ = L + 0.3963377774 * a + 0.2158037573 * b; + const m_ = L - 0.1055613458 * a - 0.0638541728 * b; + const s_ = L - 0.0894841775 * a - 1.2914855480 * b; + const l = l_ ** 3, mm = m_ ** 3, s = s_ ** 3; + const lin = [ + 4.0767416621 * l - 3.3077115913 * mm + 0.2309699292 * s, + -1.2684380046 * l + 2.6097574011 * mm - 0.3413193965 * s, + -0.0041960863 * l - 0.7034186147 * mm + 1.7076147010 * s, + ].map((c) => Math.min(1, Math.max(0, c))); + const enc = (c) => (c <= 0.0031308 ? 12.92 * c : 1.055 * c ** (1 / 2.4) - 0.055); + return { r: enc(lin[0]), g: enc(lin[1]), b: enc(lin[2]) }; +} + +function srgbToOklch(col) { + const dec = (c) => (c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4); + const r = dec(col.r), g = dec(col.g), b = dec(col.b); + const l = Math.cbrt(0.4122214708 * r + 0.5363325363 * g + 0.0514459929 * b); + const m = Math.cbrt(0.2119034982 * r + 0.6806995451 * g + 0.1073969566 * b); + const s = Math.cbrt(0.0883024619 * r + 0.2817188376 * g + 0.6299787005 * b); + const L = 0.2104542553 * l + 0.7936177850 * m - 0.0040720468 * s; + const a = 1.9779984951 * l - 2.4285922050 * m + 0.4505937099 * s; + const b2 = 0.0259040371 * l + 0.7827717662 * m - 0.8086757660 * s; + const C = Math.sqrt(a * a + b2 * b2); + let H = (Math.atan2(b2, a) * 180) / Math.PI; + if (H < 0) H += 360; + return { L, C, H }; +} + +function luminance(col) { + const dec = (c) => (c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4); + return 0.2126 * dec(col.r) + 0.7152 * dec(col.g) + 0.0722 * dec(col.b); +} +function contrastRatio(a, b) { + const la = luminance(a), lb = luminance(b); + const hi = Math.max(la, lb), lo = Math.min(la, lb); + return (hi + 0.05) / (lo + 0.05); +} + +const TOKEN_SEL = /^(?:html|:root)?(?:\[data-(?:theme|mode|scheme)[^\]]*\]|:root|:not\([^)]*\))*$/i; +function isTokenRule(rule) { + if (rule.selector === '@font-face' || rule.selector === '@theme' || basename(rule.file).toLowerCase() === 'tokens.css') return true; + return rule.selector.split(',').every((p) => { const t = p.trim(); return t && TOKEN_SEL.test(t); }); +} + +function buildTokens(rules) { + const tokens = {}; + for (const r of rules) { + if (!isTokenRule(r)) continue; + for (const d of r.decls) if (d.prop.startsWith('--')) tokens[d.prop] = d.value; + } + return tokens; +} + +function resolveVars(value, tokens, local = null, depth = 0) { + if (!value || depth > 5 || !value.includes('var(')) return value; + const out = value.replace(/var\(\s*(--[\w-]+)\s*(?:,\s*([^()]*(?:\([^()]*\)[^()]*)*))?\)/g, (m0, name, fb) => { + const v = (local && local[name] != null) ? local[name] : tokens[name]; + if (v != null) return v; + if (fb != null) return fb.trim(); + return m0; + }); + if (out === value) return out; + return resolveVars(out, tokens, local, depth + 1); +} + +// A family's identity ignores spaces, hyphens and underscores, so "GeistSans" and "Geist Sans" are one face +const famKey = (f) => String(f || '').replace(/[\s_-]+/g, ''); +function firstFamily(value) { + const first = value.split(',')[0].trim().replace(/^['"]|['"]$/g, '').toLowerCase(); + return first; +} + +function pxOf(value) { + const m = /^(-?\d+(?:\.\d+)?)(px|rem|em)$/.exec(value.trim()); + if (!m) return null; + const n = parseFloat(m[1]); + return m[2] === 'px' ? n : n * 16; +} + +const rel = (f) => f.startsWith(process.cwd()) ? f.slice(process.cwd().length + 1) : f; +const trunc = (s, n = 72) => (s.length > n ? s.slice(0, n - 1) + '…' : s); + +const PAGE_ONLY = new Set(['3', '8', '9', '25', '28', '32', '34', '42', '44', '46b', '47b', '47c', '49', '50', '54', '55', '56', '58', '59', '65', '66', '68', '69', '71', '77', '78', '79', '80', '81', '82', '83', 'F7', 'F8', 'F15', 'F16', 'F20']); +const gateNumber = (id) => (/^(\d{1,2})/.exec(String(id)) || [])[1] || null; +const pageOnly = (id) => PAGE_ONLY.has(String(id)) || PAGE_ONLY.has(gateNumber(id)); +const APP_SKIP = new Set(['1', '6', '8', '9', '32', '42', '44', '46b', '58', '59', '66', '68', '77', '78', '79', '81', '82', '83', '85', 'F8', 'F15', 'F20']); +const appSkip = (id) => APP_SKIP.has(String(id)) || APP_SKIP.has(gateNumber(id)); + +const TIERS = new Map(Object.entries({ + '2': 'floor', '4': 'floor', '10': 'floor', '15': 'floor', '17': 'floor', '18': 'floor', '19': 'floor', + '20': 'floor', '26': 'floor', '27': 'floor', '28': 'floor', '30': 'floor', '33': 'floor', '34': 'floor', + '39': 'floor', '40': 'floor', '41': 'floor', '46': 'floor', '48': 'floor', '49': 'floor', '50': 'floor', + '53': 'floor', '54': 'floor', '56': 'floor', '58': 'floor', '62': 'floor', '63': 'floor', '67': 'floor', '70': 'floor', + '1': 'reflex', '3': 'reflex', '6': 'reflex', '7': 'reflex', '8': 'reflex', '9': 'reflex', '11': 'reflex', + '12': 'reflex', '16': 'reflex', '22': 'reflex', '23': 'reflex', '24': 'reflex', '25': 'reflex', '29': 'reflex', + '37': 'reflex', '38': 'reflex', '42': 'reflex', '44': 'reflex', '47': 'reflex', '55': 'reflex', '59': 'reflex', + '64': 'reflex', '65': 'reflex', '66': 'reflex', '68': 'reflex', '69': 'reflex', + '32': 'ledger', + '2a': 'floor', '2b': 'reflex', '6a': 'floor', '6b': 'reflex', '7a': 'floor', '7b': 'reflex', + '10a': 'floor', '10b': 'reflex', '24a': 'floor', '24b': 'reflex', '26a': 'floor', '26b': 'reflex', + '28a': 'floor', '28b': 'reflex', '30a': 'floor', '30b': 'reflex', '38i': 'floor', '38ii': 'reflex', '38iii': 'reflex', + '39a': 'floor', '39b': 'reflex', '44a': 'reflex', '44b': 'floor', '44c': 'reflex', '44d': 'floor', + '46a': 'floor', '46b': 'reflex', '47a': 'floor', '47b': 'reflex', '47c': 'reflex', '49a': 'floor', '49b': 'reflex', + '55a': 'floor', '55b': 'reflex', '71': 'reflex', '72': 'reflex', '73': 'floor', '74': 'reflex', '75': 'reflex', '76': 'floor', + '77': 'reflex', '78': 'reflex', '79': 'reflex', '80': 'reflex', '81': 'reflex', '82': 'reflex', '83': 'reflex', '84': 'reflex', '85': 'reflex', +})); + +const HERO_SKIP = new Set(['8', '9', '32', '59', '76', '77', '78', 'F8', 'F15']); +function baseGate(id) { + const s = String(id).trim(); + if (/^F\d+$/i.test(s)) return s.toUpperCase(); + const m = /^(\d{1,2}(?:i{1,3}|[a-z])?)/.exec(s); + return m ? m[1] : s; +} +function tierOf(gate) { + const exact = TIERS.get(String(gate).trim()); + if (exact) return exact; + const b = baseGate(gate); + if (/^F\d+$/.test(b)) return 'finish'; + return TIERS.get(b) || 'floor'; +} + +function fontFamilyCount(ctx) { + const fams = new Set(); + for (const [prop, val] of Object.entries(ctx.tokens || {})) { + if (/^--font-/.test(prop)) fams.add(famKey(firstFamily(resolveVars(val, ctx.tokens)))); + } + return fams.size; +} +const GUARDS = { + '1': (ctx) => fontFamilyCount(ctx) >= 2 || 'fewer than two font families are declared', + '2b': (ctx) => { + for (const { r, grad } of gradientTextRules(ctx)) { + if (!grad) return `${r.selector} clips text to a background that is not a gradient ramp`; + if (/#[0-9a-f]{3,8}\b|oklch\(|rgba?\(|hsla?\(/i.test(grad.value)) return `${r.selector}: the ramp stops are literals, not tokens`; + const hues = gradientHues(grad.value, ctx); + if (hues.length >= 2 && Math.max(...hues) - Math.min(...hues) > 40) return `${r.selector}: ramp spans ${Math.round(Math.max(...hues) - Math.min(...hues))} degrees of hue`; + } + for (const it of twGroup(ctx).items) { + const g = twGradient(ctx, it.info); + if (!g || !g.text) continue; + if (it.info.stops.some((s) => s.kind !== 'token')) return `${twWhere(it)}: the ramp stops are palette or literal classes, not tokens`; + const hues = it.info.stops.map((s) => s.hue).filter((h) => h != null); + if (hues.length >= 2 && Math.max(...hues) - Math.min(...hues) > 40) return `${twWhere(it)}: ramp spans ${Math.round(Math.max(...hues) - Math.min(...hues))} degrees of hue`; + } + return true; + }, + '7': (ctx) => /surface:\s*absolute/i.test(ctx.stampText) || 'the stamp does not declare surface: absolute', + '23': (ctx) => /posture:\s*(restrained|committed|full-palette|drenched)/i.test(ctx.stampText) + || 'the stamp declares no colour posture', + '37': (ctx) => fontFamilyCount(ctx) <= 4 || 'five or more families is past the backstop', + '26b': (ctx) => !ctx.docs.some((d) => d.tags.some((t) => !t.close && /aria-disabled/i.test(t.attrs))) || 'aria-disabled appears in the markup', + '38': () => 'name the clause: 38ii (italic display) or 38iii (accented word)', + '38ii': (ctx) => /font-synthesis\s*:\s*none/i.test(ctx.allCss) || 'font-synthesis: none is not declared', + '38iii': (ctx) => accentedWordInHero(ctx), + '42': (ctx) => (/(^|[·*])\s*nav:\s*\S/im.test(ctx.stampText) && /(^|[·*])\s*footer:\s*\S/im.test(ctx.stampText)) || 'the stamp has no nav: and footer: fields naming the chrome', + '64': (ctx) => monoIsMaterial(ctx) || 'none of --font-display, --font-body or --font-outlier is a monospace face', + '65': (ctx) => /by request|pinned|user named/i.test(ctx.stampText) || 'the stamp does not say the theme was asked for by name', + '44': (ctx) => /(^|[·*])\s*hero:\s*\S/im.test(ctx.stampText) || 'the stamp names no hero: posture', +}; + +const WAIVER_MAX = 3; + +const WAIVER_FILLER = /\b(a|an|the|is|it|this|that|was|are|and|but|so|very|just|really|here|quite|more|most)\b/gi; +const WAIVER_BOILERPLATE_PHRASES = [ + 'design choice', 'design decision', 'intentionally', 'intentional', 'by design', + 'looks better', 'for the aesthetic', 'aesthetic', 'necessary here', 'necessary', + 'the prompt requires it', 'prompt requires', 'the brief requires it', 'brief requires', 'on purpose', 'deliberate', 'deliberately', + 'it works', 'works better', 'needed', 'required', 'fine', 'ok', 'okay', +]; +function reasonIsBoilerplate(reason) { + let r = reason.toLowerCase(); + for (const p of WAIVER_BOILERPLATE_PHRASES) r = r.split(p).join(' '); + r = r.replace(WAIVER_FILLER, ' ').replace(/[^a-z0-9]+/g, ' ').trim(); + return r.length < 12; +} + +let WAIVED = new Set(); +let ANSWERED = new Set(); +let DISMISSED = new Set(); +let VERBATIM = false; +let APPSCREEN = false; +let LAYOUT_KEPT = false; +const STRUCTURAL = new Set(['6b', '8', '9', '32', '42', '44a', '44c', '58', '77', '79']); +const SPACING = new Set(['24b', '59', '78']); +const COPY_GATES = new Set(['19', '58', '69']); + +const findings = []; +function report(gate, grade, file, line, evidence, fix) { + const g = String(gate); + if (opts.before && g === '20') return; + if (opts.scope === 'component' && pageOnly(g)) return; + if ((opts.scope === 'app' || APPSCREEN) && appSkip(g)) return; + if (opts.stage === 'hero' && HERO_SKIP.has(String(g))) return; + const tier = tierOf(g); + const b = baseGate(g); + const waived = WAIVED.has(b) || WAIVED.has(gateNumber(b)); + if (VERBATIM && COPY_GATES.has(gateNumber(b)) && (grade === 'FAIL' || grade === 'WARN')) grade = 'NOTE'; + const owned = LAYOUT_KEPT === 'full' ? gateNumber(b) === '58' : STRUCTURAL.has(b) || STRUCTURAL.has(gateNumber(b)) || (LAYOUT_KEPT === 'polish' && SPACING.has(b)); + if (LAYOUT_KEPT && owned && grade !== 'NOTE') grade = 'NOTE'; + if (grade === 'FAIL') { + if (tier === 'ledger') grade = 'NOTE'; + else if (tier === 'reflex') grade = waived ? 'WAIVED' : 'REFLEX'; + } + if (tier === 'finish' && grade !== 'FAIL' && ANSWERED.has(b)) grade = 'ANSWERED'; + if (grade === 'WARN' && (DISMISSED.has(b) || DISMISSED.has(gateNumber(b)))) grade = 'DISMISSED'; + if (grade === 'WARN' && tier === 'reflex' && waived) grade = 'WAIVED'; + findings.push({ gate: g, grade, tier, file: rel(file), line: line || 1, evidence: trunc(String(evidence), g === 'kept' ? 400 : 120), fix }); +} + +function applyWaivers(ctx, dir) { + WAIVED = new Set(); ANSWERED = new Set(); DISMISSED = new Set(); + VERBATIM = /\bcopy:\s*verbatim\b/i.test(ctx.stampText); + APPSCREEN = /\bshape:\s*app screen\b/i.test(ctx.stampText); + LAYOUT_KEPT = (/\bredesign:\s*(polish|restyle|full)\b/i.exec(ctx.stampText) || [])[1]?.toLowerCase() || false; + const re = /\/\*\s*Hallmark\s*·\s*waive\s+(\d{1,2}[a-z]{0,3}|F\d+)\s*·\s*([^·*]+?)\s*·\s*([^*]+?)\s*\*\//gi; + const claims = [...ctx.stampText.matchAll(re)].map((m) => ({ + id: m[1], evidence: m[2].trim(), reason: m[3].trim(), raw: m[0], + })); + + const wellFormed = new Set(claims.map((c) => c.raw)); + const malformed = [...ctx.stampText.matchAll(/\/\*[^*]*Hallmark[^*]*·\s*waive\b[^*]*\*\//gi)] + .map((m) => m[0]).filter((raw) => !wellFormed.has(raw)); + const reasons = new Map(); + for (const c of claims) { + const key = c.reason.toLowerCase(); + reasons.set(key, (reasons.get(key) || 0) + 1); + } + + const pageWords = new Set( + (ctx.stampText.replace(/\/\*\s*Hallmark\s*·\s*(?:waive|answered|dismissed)\b[^*]*\*\//gi, ' ') + ' ' + ctx.docs.map((d) => d.text).join(' ')) + .toLowerCase().match(/[a-z]{4,}/g) || [] + ); + const file = ctx.cssFiles[0]?.file || ctx.docs[0]?.file || dir; + const rejectAt = (c, why) => + findings.push({ + gate: baseGate(c.id), grade: 'WAIVER', tier: tierOf(c.id), file: rel(file), line: 1, + evidence: trunc(`waiver on ${c.id} REJECTED (${why})`), + fix: 'Fix the gate, or satisfy the guard and say why in the page\'s own words', + }); + + for (const raw of malformed) { + findings.push({ + gate: 'waive', grade: 'WAIVER', tier: 'reflex', file: rel(file), line: 1, + evidence: trunc(`malformed waiver, ignored: ${raw.replace(/\s+/g, ' ')}`), + fix: 'Three · -separated fields: /* Hallmark · waive · · */', + }); + } + for (const c of claims) { + const b = baseGate(c.id); + const tier = tierOf(c.id); + if (tier !== 'reflex') { + rejectAt(c, tier === 'ledger' ? 'a Ledger note is bookkeeping, nothing to waive' + : tier === 'finish' ? 'Finish findings are answered, not waived' + : 'Floor is never waivable'); + continue; + } + if (/^\d+$/.test(c.id) && [...TIERS.keys()].some((k) => k !== c.id && gateNumber(k) === c.id)) { rejectAt(c, `name the clause (${[...TIERS.keys()].filter((k) => k !== c.id && gateNumber(k) === c.id).join(' or ')})`); continue; } + if (WAIVED.has(b)) { rejectAt(c, 'one waiver per gate'); continue; } + if (c.reason.length < 24) { rejectAt(c, 'reason under 24 characters'); continue; } + if (reasonIsBoilerplate(c.reason)) { rejectAt(c, 'boilerplate reason'); continue; } + if (reasons.get(c.reason.toLowerCase()) > 1) { rejectAt(c, 'reason reused on another waiver'); continue; } + const words = c.reason.toLowerCase().match(/[a-z]{4,}/g) || []; + if (!words.some((w) => pageWords.has(w))) { rejectAt(c, 'reason shares no word with the page'); continue; } + const guard = GUARDS[b] || GUARDS[gateNumber(b)]; + const verdict = guard ? guard(ctx) : true; + if (verdict !== true) { rejectAt(c, `guard: ${verdict}`); continue; } + WAIVED.add(b); + } + + if (WAIVED.size > WAIVER_MAX) { + findings.push({ + gate: 'waive', grade: 'NOTE', tier: 'ledger', file: rel(file), line: 1, + evidence: trunc(`${WAIVED.size} reflex gates waived (${[...WAIVED].join(', ')}): that is a house style, not a set of exceptions`), + fix: 'Lock it into a design.md so later pages inherit it instead of re-arguing it', + }); + } + + const ansRe = /\/\*\s*Hallmark\s*·\s*answered\s+(\d{1,2}[a-z]{0,3}|F\d+)\s*·\s*([^*]+?)\s*\*\//gi; + for (const m of ctx.stampText.matchAll(ansRe)) { + const id = baseGate(m[1]); + const reason = m[2].trim(); + const bad = tierOf(id) !== 'finish' ? 'only Finish findings are answered; Reflex is waived and Floor is fixed' + : reason.length < 24 ? 'reason under 24 characters' + : reasonIsBoilerplate(reason) ? 'boilerplate reason' : null; + if (bad) { + findings.push({ + gate: id, grade: 'WAIVER', tier: tierOf(id), file: rel(file), line: 1, + evidence: trunc(`answer on ${m[1]} REJECTED (${bad})`), + fix: 'Two · -separated fields: /* Hallmark · answered · */', + }); + continue; + } + ANSWERED.add(id); + } + + const disRe = /\/\*\s*Hallmark\s*·\s*dismissed\s+(\d{1,2}[a-z]{0,3}|F\d+)\s*·\s*([^*]+?)\s*\*\//gi; + for (const m of ctx.stampText.matchAll(disRe)) { + const reason = m[2].trim(); + const bad = reason.length < 24 ? 'reason under 24 characters' : reasonIsBoilerplate(reason) ? 'boilerplate reason' : null; + if (bad) { + findings.push({ gate: baseGate(m[1]), grade: 'WAIVER', tier: tierOf(m[1]), file: rel(file), line: 1, evidence: trunc(`dismissal of ${m[1]} REJECTED (${bad})`), fix: 'Two · -separated fields: /* Hallmark · dismissed · */' }); + continue; + } + DISMISSED.add(baseGate(m[1])); + } +} + +const GRADE_RANK = { FAIL: 0, REFLEX: 1, WAIVER: 2, WARN: 3, WAIVED: 4, ANSWERED: 5, DISMISSED: 6, NOTE: 7 }; + +function gateSortKey(g) { + const f = /^F(\d+)$/.exec(g); + if (f) return 900 + Number(f[1]); + const n = parseFloat(g); + return Number.isNaN(n) ? 999 : n; +} + +function selectorIsInteractive(sel) { + return /(^|[\s,>+~(])(a|button|input|select|textarea|summary)\b|\.(btn|button|cta|link|tab|chip|control)/i.test(sel); +} +const HEADING_SEL = /(^|[\s,>+~(])h[1-6]\b|__title|__display|__headline|hero__(title|display|headline|h\d)|wordmark|masthead|display/i; +const GENERIC_FAMILIES = new Set(['serif', 'sans-serif', 'monospace', 'cursive', 'fantasy', 'system-ui', 'ui-monospace', 'ui-serif', 'ui-sans-serif', 'ui-rounded', 'math', 'emoji', 'fangsong', 'inherit', 'initial', 'unset']); + +function mergedDeclsBySelector(ctx) { + if (ctx._merged) return ctx._merged; + const map = new Map(); + for (const r of ctx.rules) { + if (r.keyframes || r.selector === '@font-face') continue; + const key = r.selector + '@@' + (r.media || ''); + if (!map.has(key)) map.set(key, { selector: r.selector, media: r.media, decls: [], file: r.file, line: r.line }); + map.get(key).decls.push(...r.decls); + } + ctx._merged = [...map.values()]; + return ctx._merged; +} + +function styleIndex(ctx) { + if (ctx._styleIdx) return ctx._styleIdx; + const entries = []; + for (const r of ctx.rules) { + if (r.keyframes || r.selector === '@font-face') continue; + if (r.media && /max-width/i.test(r.media)) continue; + for (const part of r.selector.split(',')) { + const compound = part.trim().split(/[\s>+~]+/).filter(Boolean).pop(); + if (!compound) continue; + const cleaned = compound.replace(/::?[a-z-]+(\([^)]*\))?/gi, '').replace(/\[[^\]]*\]/g, ''); + const classes = (cleaned.match(/\.[a-zA-Z_][\w-]*/g) || []).map((c) => c.slice(1)); + const tagM = /^([a-zA-Z][\w-]*)/.exec(cleaned); + const tag = tagM ? tagM[1].toLowerCase() : null; + if (!classes.length && !tag) continue; + entries.push({ classes, tag, decls: r.decls, state: /:(hover|active|focus|focus-visible|focus-within|disabled|checked|visited|target)\b|::?(before|after|marker|placeholder|selection|backdrop)\b/i.test(compound) }); + } + } + ctx._styleIdx = entries; + return entries; +} + +function styleFor(ctx, classAttr, tagName, restingOnly = false) { + const have = new Set(String(classAttr || '').split(/\s+/).filter(Boolean)); + const decls = []; + for (const e of styleIndex(ctx)) { + if (restingOnly && e.state) continue; + if (e.tag && e.tag !== tagName) continue; + if (!e.classes.every((c) => have.has(c))) continue; + decls.push(...e.decls); + } + return decls; +} + +function declValue(ctx, decls, prop) { + let v = null; + for (const d of decls) if (d.prop === prop) v = d.value; + return v == null ? null : resolveVars(v, ctx.tokens); +} + +function fontPxOf(ctx, decls) { + const v = declValue(ctx, decls, 'font-size'); + if (!v) return null; + const clamped = /clamp\(\s*([^,]+),/.exec(v); + return pxOf(clamped ? clamped[1].trim() : v); +} + +function trackingEmOf(ctx, decls, fontPx) { + const v = declValue(ctx, decls, 'letter-spacing'); + if (!v) return null; + const m = /^(-?\d*\.?\d+)em$/.exec(v.trim()); + if (m) return parseFloat(m[1]); + const px = pxOf(v); + if (px == null || !fontPx) return null; + return px / fontPx; +} + +function check1(ctx) { + const banned = new Set(['inter', 'roboto', 'open sans', 'poppins', 'lato', 'system-ui', '-apple-system', 'arial', 'helvetica', 'helvetica neue', 'segoe ui']); + const seen = new Set(); + const flag = (fam, file, line, where) => { + if ([...banned].some((b) => famKey(b) === famKey(fam)) && !seen.has(fam + where)) { + seen.add(fam + where); + report(1, 'FAIL', file, line, `display font "${fam}" (${where})`, 'Pick a display face from the typography catalog'); + } + }; + for (const [prop, val] of Object.entries(ctx.tokens)) { + if (/^--font-(display|heading|title|hero)/.test(prop)) { + const tr = ctx.rules.find((r) => isTokenRule(r) && r.decls.some((d) => d.prop === prop)); + flag(firstFamily(resolveVars(val, ctx.tokens)), tr ? tr.file : ctx.rules[0]?.file || '?', tr ? tr.decls.find((d) => d.prop === prop)?.line : 1, prop); + } + } + for (const r of ctx.rules) { + if (isTokenRule(r) || !HEADING_SEL.test(r.selector)) continue; + for (const d of r.decls) { + if (d.prop === 'font-family') flag(firstFamily(resolveVars(d.value, ctx.tokens)), r.file, d.line, r.selector); + } + } +} + +const hueIn = (h, lo, hi) => (lo <= hi ? h >= lo && h <= hi : h >= lo || h <= hi); +function gradientHues(value, ctx) { + const resolved = resolveVars(value, ctx.tokens); + const stops = []; + const colRe = /#[0-9a-fA-F]{3,8}\b|oklch\([^)]*\)|rgba?\([^)]*\)|hsla?\([^)]*\)/g; + let cm; + while ((cm = colRe.exec(resolved))) { + const c = parseColor(cm[0]); + if (c && c.alpha > 0.05) { + const ok = c.okl || srgbToOklch(c); + if (ok.C > 0.04) stops.push(ok.H); + } + } + return stops; +} +function paperIsDark(ctx) { + const p = parseColor(resolveVars(ctx.tokens['--color-paper'] || '', ctx.tokens)); + return !!p && (p.okl || srgbToOklch(p)).L < 0.4; +} +function bannedGradient(stops, ctx) { + const purple = stops.some((h) => hueIn(h, 265, 330)); + const blue = stops.some((h) => hueIn(h, 200, 264)); + const pink = stops.some((h) => hueIn(h, 331, 25)); + const cyan = stops.some((h) => hueIn(h, 170, 230)); + if (purple && blue) return 'purple-to-blue'; + if (purple && pink) return 'purple-to-pink'; + if (cyan && paperIsDark(ctx)) return 'cyan-on-dark'; + return null; +} +function gradientTextRules(ctx) { + const out = []; + for (const r of mergedDeclsBySelector(ctx)) { + const clip = r.decls.find((d) => /background-clip/.test(d.prop) && /\btext\b/i.test(d.value)); + if (!clip) continue; + const grad = r.decls.find((d) => /^background(-image)?$/.test(d.prop) && /gradient\(/i.test(d.value)); + const transparent = r.decls.find((d) => (d.prop === 'color' || d.prop === '-webkit-text-fill-color') && /transparent/i.test(d.value)); + if (grad || transparent) out.push({ r, clip, grad }); + } + return out; +} +function withoutPatterns(value) { + let out = '', i = 0; + const re = /repeating-(?:linear|radial|conic)-gradient\(/gi; + let m; + while ((m = re.exec(value))) { + out += value.slice(i, m.index); + let depth = 1, k = m.index + m[0].length; + while (k < value.length && depth > 0) { if (value[k] === '(') depth++; else if (value[k] === ')') depth--; k++; } + i = k; re.lastIndex = k; + } + return out + value.slice(i); +} + +function check2(ctx) { + const textRules = new Set(); + for (const { r, clip, grad } of gradientTextRules(ctx)) { + textRules.add(r.selector); + const banned = grad ? bannedGradient(gradientHues(grad.value, ctx), ctx) : null; + if (banned) report('2a', 'FAIL', r.file, clip.line, `${banned} gradient text on ${r.selector}`, 'One anchor hue, solid ink'); + else report('2b', 'FAIL', r.file, clip.line, `gradient text on ${r.selector}`, 'Solid ink; weight or a display face. Guard: a single-hue ramp from two tokens with 40 and 41 passing'); + } + for (const r of ctx.rules) { + if (textRules.has(r.selector)) continue; + for (const d of r.decls) { + if (!/gradient\(/i.test(d.value)) continue; + const washes = withoutPatterns(d.value); + if (!/gradient\(/i.test(washes)) continue; + const banned = bannedGradient(gradientHues(washes, ctx), ctx); + if (banned) report('2a', 'FAIL', r.file, d.line, `${banned} gradient on ${r.selector}`, 'One anchor hue; drop the gradient'); + } + } +} + +function check3(ctx) { + for (const r of ctx.rules) { + for (const d of r.decls) { + if (d.prop !== 'grid-template-columns') continue; + const v = resolveVars(d.value, ctx.tokens).trim(); + if (/^repeat\(\s*3\s*,\s*(minmax\(\s*0(px)?\s*,\s*1fr\s*\)|1fr)\s*\)$/.test(v) + || /^(1fr|minmax\(\s*0(px)?\s*,\s*1fr\s*\))(\s+(1fr|minmax\(\s*0(px)?\s*,\s*1fr\s*\))){2}$/.test(v)) { + + const classes = (r.selector.match(/\.[a-zA-Z][\w-]*/g) || []).map((c) => c.slice(1)); + let iconTiles = !ctx.docs.length && !classes.length; + for (const doc of ctx.docs) { + for (let i = 0; i < doc.tags.length; i++) { + const t = doc.tags[i]; + if (t.close || t.selfClosing) continue; + const cls = getAttr(t.attrs, 'class') || ''; + if (!classes.some((c) => cls.split(/\s+/).includes(c))) continue; + const inner = innerOf(doc, i); + if (inner && (/class\s*=\s*["'][^"']*icon/i.test(inner.inner) || /= 0; i--) { + if (stack[i].name === t.name) { stack.splice(i); break; } + } + continue; + } + if (t.selfClosing) continue; + const cls = getAttr(t.attrs, 'class') || ''; + const isCard = cls.split(/\s+/).some((c) => { const base = c.split('--')[0]; return base && cardWord.test(base) && !containerish.test(base); }); + if (isCard && stack.some((s) => s.isCard)) { + report(4, 'FAIL', doc.file, t.line, `card nested in card: class="${trunc(cls, 40)}"`, 'Keep one containment layer'); + } + stack.push({ name: t.name, isCard }); + } + } +} + +function check3Stripe(ctx) { + for (const r of ctx.rules) { + for (const d of r.decls) { + if (!/^border-(left|right|inline-start|inline-end)$/.test(d.prop)) continue; + const m = /(\d+(?:\.\d+)?)px/.exec(d.value); + if (m && parseFloat(m[1]) >= 3 && !/transparent|none/i.test(d.value)) { + report(3, 'WARN', r.file, d.line, `side stripe ${d.prop}: ${trunc(d.value, 32)} on ${r.selector}`, 'Hairline all round, none, or an accent square'); + } + } + } +} + +function heroClasses(ctx) { + const out = new Set(); + for (const doc of ctx.docs) { + const h1 = doc.tags.findIndex((t) => !t.close && t.name === 'h1'); + if (h1 < 0) continue; + for (let i = h1 - 1; i >= 0; i--) { + const t = doc.tags[i]; + if (t.close || !/^(section|header)$/.test(t.name)) continue; + for (const c of (getAttr(t.attrs, 'class') || '').split(/\s+/)) if (c) out.add(c); + break; + } + } + return out; +} +function check6a(ctx) { + const heroCls = heroClasses(ctx); + const isHero = (sel) => /hero/i.test(sel) || [...heroCls].some((c) => sel.includes('.' + c)); + const seen = new Set(); + for (const r of ctx.rules) { + if (r.keyframes || isTokenRule(r) || !isHero(r.selector)) continue; + for (const d of r.decls) { + if (!/^(min-)?height$/.test(d.prop)) continue; + const v = resolveVars(d.value, ctx.tokens); + if (!/\d\s*vh\b/i.test(v) || seen.has(r.selector)) continue; + seen.add(r.selector); + report('6a', 'FAIL', r.file, d.line, `hero sized in vh: ${d.prop}: ${trunc(v, 24)} on ${r.selector}`, 'dvh or svh'); + } + } +} + +function check7(ctx) { + const props = /^(color|background|background-color|border-color|outline-color)$|^--color-/; + for (const r of ctx.rules) { + if (r.selector === '@font-face') continue; + for (const d of r.decls) { + if (!props.test(d.prop)) continue; + const resolved = resolveVars(d.value, ctx.tokens).trim(); + const c = parseColor(resolved); + if (!c || c.alpha < 1) continue; + const isWhite = c.r > 0.999 && c.g > 0.999 && c.b > 0.999; + const isBlack = c.r < 0.001 && c.g < 0.001 && c.b < 0.001; + if (isWhite && ctx.genre === 'modern-minimal') continue; + if (isWhite || isBlack) { + + const viaToken = d.prop.startsWith('--') || /var\(/.test(d.value); + report(viaToken ? '7b' : '7a', 'FAIL', r.file, d.line, `pure ${isBlack ? '#000' : '#fff'}: ${d.prop}: ${trunc(d.value, 28)} (${r.selector})`, 'Tint the base toward the anchor hue'); + } + } + } +} + +function check10(ctx) { + for (const r of ctx.rules) { + for (const d of r.decls) { + if (d.prop === 'transition' && /(^|,)\s*all[\s,]|^all$|^all\s/.test(d.value.trim())) { + report('10a', 'FAIL', r.file, d.line, `transition: all on ${r.selector}`, 'List the transitioned properties explicitly'); + } + if (d.prop === 'transition-property' && /\ball\b/.test(d.value)) { + report('10a', 'FAIL', r.file, d.line, `transition-property: all on ${r.selector}`, 'List the transitioned properties explicitly'); + } + } + } +} + +function check11(ctx) { + const byScale = new Map(); + for (const r of ctx.rules) { + if (!/:hover/.test(r.selector)) continue; + for (const d of r.decls) { + if (d.prop !== 'transform') continue; + const m = /scale\(\s*([\d.]+)\s*\)/.exec(d.value); + if (m && parseFloat(m[1]) !== 1) { + const k = m[1]; + if (!byScale.has(k)) byScale.set(k, []); + byScale.get(k).push({ sel: r.selector, file: r.file, line: d.line }); + } + } + } + for (const [k, list] of byScale) { + const distinct = new Set(list.map((x) => x.sel)); + if (distinct.size >= 2) { + report(11, 'WARN', list[0].file, list[0].line, `hover scale(${k}) on ${distinct.size} selectors`, 'One hover signal per element'); + } + } + for (const r of ctx.rules) { + if (!/:hover/.test(r.selector) || !/(^|[\s>+~,])(img|picture|figure|video)\b|__(img|image|photo|thumb|cover)\b|\.(img|image|photo|thumb|cover)\b/i.test(r.selector)) continue; + const t = r.decls.find((d) => d.prop === 'transform' && /scale|rotate/.test(d.value)); + if (t) report(11, 'WARN', r.file, t.line, `image transforms on hover (${r.selector})`, 'Imagery sits still; give the container the feedback'); + } +} + +function check12(ctx) { + const uiSel = /:hover|:active|:focus|\b(btn|button|modal|dialog|tooltip|dropdown|menu|popover|toast|tab|input|select|switch|toggle|accordion)\b/i; + const playful = ctx.genre === 'playful' || /genre:\s*playful/.test(ctx.stampText || ''); + const declared = playful && /--ease-spring/.test(Object.keys(ctx.tokens).join(' ')); + const springHome = (r) => /primary|cta|press|character|mascot|hero__btn|btn--solid|btn--main/i.test(r.selector); + const springSels = new Set(); + for (const r of ctx.rules) { + if (!uiSel.test(r.selector)) continue; + for (const d of r.decls) { + if (!/transition|animation/.test(d.prop)) continue; + if (declared && /var\(--ease-spring\)/.test(d.value) && springHome(r) && (springSels.add(baseSelector(r.selector).split(':')[0]), springSels.size <= 2)) continue; + const re = /cubic-bezier\(\s*([-\d.]+)\s*,\s*([-\d.]+)\s*,\s*([-\d.]+)\s*,\s*([-\d.]+)\s*\)/g; + let m; + while ((m = re.exec(resolveVars(d.value, ctx.tokens)))) { + const y1 = parseFloat(m[2]), y2 = parseFloat(m[4]); + if (y1 > 1.05 || y2 > 1.05 || y1 < -0.05 || y2 < -0.05) { + report(12, 'FAIL', r.file, d.line, `overshoot easing ${m[0]} on ${r.selector}`, 'Use exponential ease-out on UI state changes'); + } + } + } + } +} + +function check10Motion(ctx) { + const hardRe = /(? /tooltip|tip\b/i.test(r.selector)); + const delayed = (r) => r.decls.find((d) => /^transition(-delay)?$/.test(d.prop) && /(\d{3,})ms|([1-9][\d.]*)s\b/.test(d.value)); + const hover = tips.filter((r) => /:hover/.test(r.selector)).map(delayed).find(Boolean); + const focus = tips.filter((r) => /:focus/.test(r.selector)).map(delayed).find(Boolean); + if (hover && focus) { + report(17, 'WARN', tips[0].file, focus.line, 'tooltip focus delay matches hover delay', 'Hover delay 800-1000ms; focus delay 0'); + } +} + +function check18(ctx) { + const autoish = /carousel|marquee|ticker|rotate|slider|scroll|auto/i; + const paused = ctx.rules.some((r) => /:hover|:focus|\[data-loop\]/.test(r.selector) && r.decls.some((d) => d.prop === 'animation-play-state' && /paused/.test(d.value))); + for (const r of ctx.rules) { + if (r.keyframes || !autoish.test(r.selector)) continue; + for (const d of r.decls) { + if (/^animation(-iteration-count)?$/.test(d.prop) && /\binfinite\b/.test(d.value) && !paused) { + report(18, 'WARN', r.file, d.line, `infinite animation on ${r.selector} with no pause state`, 'Pause on hover and focus'); + } + } + } +} + +function check19(ctx) { + for (const doc of ctx.docs) { + const t = maskedProse(doc); + const patterns = [ + [/\b(jane doe|john smith|john doe|example user)\b/i, 'placeholder name'], + [/\bAcme\b/, 'startup cliche name'], + [/\bNexus\b/, 'startup cliche name'], + ]; + const title = (/]*>([^<]*)<\/title>/i.exec(doc.src) || [])[1] || ''; + for (const [re, label] of patterns) { + const m = re.exec(t); + if (!m) continue; + if (label === 'startup cliche name' && (re.test(title) || (t.match(new RegExp(re.source, 'g')) || []).length >= 3)) continue; + report(19, 'FAIL', doc.file, doc.lineOf(m.index), `${label}: "${m[0]}"`, 'Use plausible audience-fitting names'); + } + } +} + +function check20(ctx) { + if (ctx.tokensOnly) return; + const stamped = (src) => { + const lines = src.split('\n').map((l) => l.trim()).filter(Boolean); + let i = 0; + while (i < lines.length && /^@charset\b/i.test(lines[i])) i++; + return i < lines.length && /^\/\*\s*Hallmark/.test(lines[i]); + }; + let ok = false; + const cssSources = []; + for (const f of ctx.cssFiles) cssSources.push(f.raw); + for (const doc of ctx.docs) for (const s of doc.styles) cssSources.push(s.css); + for (const s of cssSources) if (stamped(s)) { ok = true; break; } + const pageCss = ctx.cssFiles.length || ctx.docs.some((d) => d.kind === 'html' && d.styles.length); + if (!ok && cssSources.length && pageCss) { + const where = ctx.cssFiles[0]?.file || ctx.docs[0]?.file; + report(20, 'FAIL', where, 1, 'no Hallmark stamp on the first non-empty line of any CSS', 'The stamp comment is line 1 of the CSS; only @charset may precede it'); + } +} + +function check22(ctx) { + if (ctx.genre === 'modern-minimal') return; + const MASK_PROPS = /(^|-)mask(-image|-composite|-mode)?$|^filter$|^backdrop-filter$/; + for (const r of ctx.rules) { + for (const d of r.decls) { + if (MASK_PROPS.test(d.prop)) continue; + const re = /oklch\(\s*([\d.]+%?)\s+([\d.]+)\s+[\d.]+(?:deg)?\s*(?:\/\s*([\d.]+%?))?\s*\)/g; + let m; + while ((m = re.exec(d.value))) { + const chroma = parseFloat(m[2]); + const alpha = m[3] ? (m[3].endsWith('%') ? parseFloat(m[3]) / 100 : parseFloat(m[3])) : 1; + if (chroma === 0 && alpha >= 1) { + report(22, 'FAIL', r.file, d.line, `zero-chroma ${m[0]} (${d.prop} on ${r.selector})`, 'Give neutrals at least 0.005 chroma'); + } + } + } + } +} + +function check23(ctx) { + if (ctx.posture === 'drenched') return; + const ACC = /var\(\s*--color-accent(?:-2)?\s*[,)]/; + const SURFACE = /(^|[\s,>~+])(body|html|main|section|header|footer|aside)(\b|$)|\bhero\b|__hero|banner|\bstrip\b|\bband\b/i; + const big = (r) => r.decls.some((d) => + (/^(min-)?height$/.test(d.prop) && (parseFloat((/([\d.]+)\s*(vh|dvh|svh)/.exec(d.value) || [])[1] || 0) >= 40 || (pxOf(d.value) ?? 0) >= 320)) || + (d.prop === 'inset' && /^0(px)?(\s|$)/.test(d.value.trim()))); + for (const r of ctx.rules) { + if (isTokenRule(r) || r.keyframes) continue; + for (const d of r.decls) { + if (!/^background(-color|-image)?$/.test(d.prop) || !ACC.test(d.value)) continue; + if (/\/\s*0?\.[0-2]\d*/.test(d.value)) continue; + if (ctx.genre === 'atmospheric' && /radial-gradient/i.test(d.value)) continue; + if (SURFACE.test(r.selector) || big(r)) { + report(23, 'WARN', r.file, d.line, + `accent background on viewport-scale rule "${trunc(r.selector, 44)}"`, + 'Accent stays <= 5% of a viewport; large fills belong to paper/field tokens or a declared posture in the stamp'); + } + } + const col = r.decls.find((d) => d.prop === 'color' && ACC.test(d.value)); + const fsDecl = r.decls.find((d) => d.prop === 'font-size'); + if (col && fsDecl) { + const rv = resolveVars(fsDecl.value, ctx.tokens); + const clampMax = /,\s*([^,()]+)\)\s*$/.exec(rv); + const maxPx = pxOf(rv) ?? (clampMax ? pxOf(clampMax[1].trim()) : null); + if ((maxPx != null && maxPx >= 48) || /--text-display\b/.test(fsDecl.value)) { + report(23, 'WARN', r.file, col.line, + `display-size text set in accent on "${trunc(r.selector, 44)}"`, + 'Accent marks emphasis; set display type in ink and keep accent for small signals'); + } + } + } +} + +function check24(ctx) { + const props = /^(padding|margin|gap|row-gap|column-gap)(-[a-z]+)?$/; + for (const r of ctx.rules) { + for (const d of r.decls) { + if (!props.test(d.prop)) continue; + const re = /(-?\d+(?:\.\d+)?)px/g; + let m; + while ((m = re.exec(d.value))) { + const v = Math.abs(parseFloat(m[1])); + if (v > 2 && (v % 4 !== 0 || !Number.isInteger(v))) { + report('24b', 'FAIL', r.file, d.line, `${d.prop}: ${trunc(d.value, 28)} (off the 4px scale) on ${r.selector}`, 'Use the 4px spacing scale'); + } + } + } + } +} + +function check24a(ctx) { + const spaceVals = new Map(); + for (const [k, v] of Object.entries(ctx.tokens)) { + if (!/^--space-/.test(k)) continue; + const px = pxOf(resolveVars(v, ctx.tokens)); + if (px != null && px > 0) spaceVals.set(px, k); + } + if (!spaceVals.size) return; + const props = /^(padding|margin|gap|row-gap|column-gap)(-[a-z]+)?$/; + const counts = new Map(); + for (const r of ctx.rules) { + if (r.keyframes || isTokenRule(r)) continue; + for (const d of r.decls) { + if (!props.test(d.prop)) continue; + const raw = d.value.replace(/var\([^)]*\)/g, ' '); + for (const m of raw.matchAll(/(? 8) report('24a', 'FAIL', file, 1, `+${n - 8} more raw spacing lengths with a matching --space-* token in this file`, 'Use the tokens'); +} + +function shortProse(ctx, sel) { + const cls = [...sel.matchAll(/\.([\w-]+)/g)].map((m) => m[1]).pop(); + if (!cls) return false; + const texts = []; + for (const doc of ctx.docs) for (const m of doc.src.matchAll(new RegExp(`<(\\w+)[^>]*class="[^"]*\\b${cls}\\b[^"]*"[^>]*>([\\s\\S]*?)`, 'g'))) { + for (const p of (/^p$/i.test(m[1]) ? [m[2]] : m[2].match(/]*>[\s\S]*?<\/p>/g) || [])) texts.push(p.replace(/<[^>]+>/g, ' ').replace(/\s+/g, ' ').trim()); + } + return texts.length > 0 && texts.every((t) => t.length <= 200 && (t.match(/[.!?](?:\s|$)/g) || []).length <= 2); +} + +function check25(ctx) { + const proseish = /(^|[\s,>+~(])p\b|lede|prose|copy|__body|__text|__desc|paragraph/i; + for (const r of ctx.rules) { + if (!proseish.test(r.selector) || HEADING_SEL.test(r.selector)) continue; + for (const d of r.decls) { + if (d.prop !== 'max-width') continue; + const m = /^([\d.]+)ch$/.exec(resolveVars(d.value, ctx.tokens).trim()); + if (m) { + const ch = parseFloat(m[1]); + const floor = /lede|hero|caption|figcaption|__line|__sub|subhead|tagline/i.test(r.selector) || shortProse(ctx, r.selector) ? 28 : 45; + if (ch < floor || ch > 75) { + report(25, 'WARN', r.file, d.line, `measure ${ch}ch on ${r.selector} (${floor}-75ch range)`, 'Set prose measure between 45 and 75ch; a one-sentence lede or caption from 28ch'); + } + } + } + } +} + +function check26(ctx) { + const hasInteractive = ctx.docs.some((doc) => /<(a|button|input|select|textarea)\b|role\s*=\s*["']button/i.test(doc.src)) + || ctx.rules.some((r) => selectorIsInteractive(r.selector)); + if (!hasInteractive) return; + const has = (pseudo) => ctx.rules.some((r) => r.selector.includes(pseudo)); + const tv = twGroup(ctx).variants; + const shared = ctx.shared || {}; + const once = (key) => !shared.once || (!shared.once.has(key) && !!shared.once.add(key)); + const file = ctx.cssFiles[0]?.file || ctx.docs[0]?.file || '?'; + if (!has(':focus-visible') && !has(':focus') && !shared.focus && ![...tv].some((v) => /^focus(?:-visible|-within)?$/.test(v)) && once('26a')) { + report('26a', 'FAIL', file, 1, 'no :focus-visible styling anywhere', 'A focus ring at 3:1 or better, instant'); + } + if (!has(':active') && !shared.active && !tv.has('active') && once('26b:active')) { + report('26b', 'FAIL', file, 1, 'no :active styling anywhere', 'All eight states; guard: not a form control, no aria-disabled anywhere'); + } + const hasFormish = ctx.docs.some((doc) => /<(button|input|select|textarea)\b/i.test(doc.src)); + if (hasFormish && !has(':disabled') && !shared.disabled && !tv.has('disabled') && !tv.has('aria-disabled') && !ctx.rules.some((r) => /\[disabled\]|aria-disabled/.test(r.selector)) && once('26b:disabled')) { + report('26b', 'FAIL', file, 1, 'no :disabled styling anywhere', 'All eight states; guard: not a form control, no aria-disabled anywhere'); + } +} + +function check27(ctx) { + const tw = twGroup(ctx); + const moves = (r) => r.decls.some((d) => /^(transform|translate|scale|rotate)$/.test(d.prop) && !/^none\b/.test(d.value.trim())); + const hasMotion = ctx.rules.some((r) => r.keyframes) + || ctx.rules.some((r) => r.decls.some((d) => /^transition/.test(d.prop) && /transform/.test(d.value))) + || (ctx.rules.some((r) => r.decls.some((d) => /^transition/.test(d.prop) && /(^|[\s,])all\b/.test(d.value))) && ctx.rules.some((r) => /:(hover|active|focus)/.test(r.selector) && moves(r))); + if (!hasMotion && !tw.motion) return; + const hasPRM = ctx.rules.some((r) => r.media && /prefers-reduced-motion/i.test(r.media)) + || ctx.cssFiles.some((f) => /prefers-reduced-motion/i.test(stripComments(f.raw))) + || ctx.docs.some((doc) => doc.styles.some((s) => /prefers-reduced-motion/i.test(stripComments(s.css)))) + || tw.variants.has('motion-reduce') || tw.variants.has('motion-safe') || !!ctx.shared?.prm; + if (!hasPRM && ctx.shared) { + if (ctx.shared.once.has('27')) return; + ctx.shared.once.add('27'); + } + if (!hasPRM && !hasMotion) { + const m = tw.motion; + report(27, 'FAIL', m.doc.file, m.line, `motion utilities (${m.info.animate || 'a transition on a transform'}) with no motion-reduce: or motion-safe: variant anywhere`, 'Add motion-reduce: fallbacks, or put the motion behind motion-safe:'); + } else if (!hasPRM) { + const kf = ctx.rules.find((r) => r.keyframes); + const file = kf ? kf.file : (ctx.cssFiles[0]?.file || ctx.docs[0]?.file || '?'); + report(27, 'FAIL', file, kf ? kf.line : 1, 'motion present, no prefers-reduced-motion block', 'Add a prefers-reduced-motion fallback'); + } +} + +function check28(ctx) { + for (const doc of ctx.docs) { + let firstMedia = true, seenH1 = false, heroPassed = false; + for (const t of doc.tags) { + if (t.close) { if (seenH1 && (t.name === 'section' || t.name === 'header')) heroPassed = true; continue; } + if (t.name === 'h1') seenH1 = true; + if (t.name === 'video') { + if (hasAttr(t.attrs, 'autoplay') && !hasAttr(t.attrs, 'muted')) { + report('28a', 'FAIL', doc.file, t.line, 'autoplay video without muted', 'autoplay muted loop playsinline, with poster'); + } + if (!getAttr(t.attrs, 'poster')) { + report('28b', 'FAIL', doc.file, t.line, 'video without poster', 'Add a poster frame; guard: below the fold and not the LCP'); + } + if ((getAttr(t.attrs, 'loading') || '').toLowerCase() === 'lazy' && firstMedia) { + report('28a', 'WARN', doc.file, t.line, 'lazy-loaded hero video', 'Never lazy on the LCP video; preload its poster with fetchpriority=high'); + } + firstMedia = false; + } + if (t.name === 'img') { + if (firstMedia && !heroPassed && (getAttr(t.attrs, 'loading') || '').toLowerCase() === 'lazy') { + report('28a', 'WARN', doc.file, t.line, 'lazy-loaded first image (likely LCP)', 'fetchpriority=high on the LCP element'); + } + firstMedia = false; + } + } + } +} + +function check30(ctx) { + const EMOJI = /(?![©®™‼⁉←-⇿])\p{Extended_Pictographic}/u; + const GLYPH = /(?![©®™‼⁉←-⇿✓-✖])(?:\p{Emoji_Presentation}|\p{Extended_Pictographic}️)/u; + for (const doc of ctx.docs) { + const lines = new Set(); + let n = 0; + const flag = (line, what) => { if (lines.has(line) || n >= 8) return; lines.add(line); n++; report('30a', 'FAIL', doc.file, line, what, 'One icon library, a custom SVG, or the word alone'); }; + for (let i = 0; i < doc.tags.length; i++) { + const t = doc.tags[i]; + if (t.close || t.selfClosing) continue; + const cls = getAttr(t.attrs, 'class') || ''; + const iconish = /icon|card|step|tier|feature|value|prop|badge/i.test(cls); + const inner = innerOf(doc, i); + if (!inner) continue; + const content = inner.inner.replace(/<[^>]*>/g, '').trim(); + if (content && content.length <= 4 && EMOJI.test(content) && (iconish || !/<[a-z]/.test(inner.inner))) { + lines.add(doc.lineOf(t.end + inner.inner.search(EMOJI))); + report('30a', 'FAIL', doc.file, t.line, `emoji icon "${content}" in <${t.name} class="${trunc(cls, 28)}">`, 'One icon library or custom SVG'); + continue; + } + if (!/^(h[1-6]|button|a|label|th|summary|option|legend|dt)$/.test(t.name) || /<(p|div|ul|ol|table|section)\b/i.test(inner.inner)) continue; + const text = plainText(inner.inner); + const at = inner.inner.search(GLYPH); + if (!text || at < 0) continue; + const line = doc.lineOf(t.end + at); + flag(line, `emoji in <${t.name}> "${trunc(text, 32)}"`); + } + const raw = doc.raw || doc.src; + const body = doc.kind === 'html' ? doc.masked : raw; + const lineAt = (text, pos) => text.slice(0, pos).split('\n').length; + for (const m of body.matchAll(/>\s*((?:\p{Emoji_Presentation}|\p{Extended_Pictographic}️)[^<>{}\n]{0,40})/gu)) flag(lineAt(body, m.index + m[0].length - m[1].length), `text opens with an emoji: "${trunc(m[1].trim(), 32)}"`); + for (const m of raw.matchAll(/placeholder\s*=\s*["']([^"']*)["']/g)) if (GLYPH.test(m[1])) flag(lineAt(raw, m.index), `emoji in a placeholder "${trunc(m[1], 28)}"`); + if (doc.kind !== 'html') for (const m of raw.matchAll(/(["'`])\s*((?:(?:\p{Emoji_Presentation}|\p{Extended_Pictographic}️?)‍?){1,3})\s*\1/gu)) flag(lineAt(raw, m.index), `emoji passed as an icon: ${m[2]}`); + } + const libs = new Map([ + ['material', /material-icons|material-symbols/i], + ['heroicons', /heroicon/i], + ['lucide', /lucide/i], + ['phosphor', /phosphor|\bph-(?:bold|fill|light|duotone|[a-z]+-[a-z]+)/i], + ['font-awesome', /font-?awesome|\bfa-(solid|regular|brands|light)\b/i], + ['feather', /feather-icons|\bfeather\b/i], + ['tabler', /tabler-icons/i], + ['bootstrap-icons', /bootstrap-icons|\bbi-[a-z]/i], + ]); + const found = new Set(); + const hay = ctx.docs.map((d) => d.src).join('\n') + ctx.cssFiles.map((f) => f.raw).join('\n'); + for (const [name, re] of libs) if (re.test(hay)) found.add(name); + if (found.size >= 2) { + report('30b', 'WARN', ctx.docs[0]?.file || ctx.cssFiles[0]?.file, 1, `icon libraries mixed: ${[...found].join(' + ')}`, 'One icon library per page; guard: the second is a brand mark in at most two slots'); + } +} + +function check33(ctx) { + const labeledAttrs = (a) => hasAttr(a, 'aria-hidden') || getAttr(a, 'aria-label') != null + || getAttr(a, 'aria-labelledby') != null + || ['img', 'presentation', 'none'].includes((getAttr(a, 'role') || '').toLowerCase()); + for (const doc of ctx.docs) { + const stack = []; + for (const t of doc.tags) { + if (t.close) { + for (let i = stack.length - 1; i >= 0; i--) { + if (stack[i].name === t.name) { stack.splice(i); break; } + } + continue; + } + if (t.name === 'svg' || t.name === 'canvas') { + const ancestorLabeled = stack.some((s) => s.labeled); + const titled = t.name === 'svg' && !t.selfClosing && /]*>\s*\S/i.test(innerOf(doc, doc.tags.indexOf(t))?.inner || ''); + if (!labeledAttrs(t.attrs) && !ancestorLabeled && !titled) { + report(33, 'FAIL', doc.file, t.line, `<${t.name}> without aria-hidden or aria-label`, 'Add aria-hidden or an aria-label'); + } + } + if (!t.selfClosing) stack.push({ name: t.name, labeled: labeledAttrs(t.attrs) }); + } + } +} + +function check34(ctx) { + const clipped = new Set(); + let hidden = null; + for (const r of ctx.rules) { + if (!/(^|[\s,])(html|body)\b/.test(r.selector)) continue; + const targets = r.selector.split(',').map((p) => (/^\s*(html|body)\s*$/.exec(p) || [])[1]).filter(Boolean); + for (const d of r.decls) { + if (d.prop === 'overflow-x' || d.prop === 'overflow') { + if (/\bclip\b/.test(d.value)) for (const t of targets) clipped.add(t); + else if (/\bhidden\b/.test(d.value)) hidden = { file: r.file, line: d.line, sel: r.selector }; + } + } + } + const hiddenUtil = []; + for (const it of twGroup(ctx).items) { + if (it.idx < 0 || !/^(html|body)$/.test(it.name)) continue; + if (it.info.oxClip) clipped.add(it.name); + if (it.info.oxHidden) hiddenUtil.push(it); + } + for (const it of hiddenUtil) report(34, 'FAIL', it.doc.file, it.line, `${it.info.oxHidden} on <${it.name}> (breaks sticky)`, 'overflow-x-clip on both html and body, never hidden'); + const shell = (d) => d.kind === 'html' && !d.styles.length && /]*type\s*=\s*["']module["'][^>]*\bsrc\s*=\s*["'][^"']+\.(?:tsx?|jsx?|mjs|vue|svelte)["']/i.test(d.raw || d.src) && ![...(d.raw || d.src).matchAll(/]*>/gi)].some((m) => /rel\s*=\s*["']stylesheet/i.test(m[0]) && !/href\s*=\s*["']https?:/i.test(m[0])); + const pageish = ctx.docs.some((d) => (d.kind === 'html' && !shell(d)) || (d.kind !== 'html' && d.tags.some((t) => !t.close && (t.name === 'html' || t.name === 'body')))); + const file = ctx.cssFiles[0]?.file || ctx.docs[0]?.file; + const both = clipped.has('html') && clipped.has('body'); + if (!both && hidden) { + report(34, 'FAIL', hidden.file, hidden.line, `overflow-x: hidden on ${hidden.sel} (breaks sticky)`, 'Use overflow-x: clip on both html and body, never hidden'); + } else if (!both && file && ctx.docs.length && pageish && !hiddenUtil.length) { + const where = clipped.size ? `overflow-x: clip on ${[...clipped][0]} only` : 'no overflow-x: clip on html and body'; + report(34, 'FAIL', file, 1, where, 'overflow-x: clip on both html and body'); + } + for (const r of ctx.rules) { + for (const d of r.decls) { + if (/^(width|min-width)$/.test(d.prop) && /(^|[^\w.-])100vw\b/.test(d.value)) { + report(34, 'FAIL', r.file, d.line, `${d.prop}: ${trunc(d.value, 28)} on ${r.selector} (scrollbar overflow)`, 'width: 100% with container padding'); + } + } + } +} + +function check37(ctx) { + const families = new Map(); + const generic = GENERIC_FAMILIES; + for (const r of ctx.rules) { + if (r.selector === '@font-face') continue; + for (const d of r.decls) { + if (d.prop !== 'font-family' && !/^--font-/.test(d.prop)) continue; + if (/^--font-/.test(d.prop) && !isTokenRule(r)) continue; + const fam = firstFamily(resolveVars(d.value, ctx.tokens)); + if (!fam || generic.has(fam) || fam.startsWith('var(')) continue; + if (![...families.keys()].some((k) => famKey(k) === famKey(fam))) families.set(fam, { file: r.file, line: d.line }); + } + } + if (families.size > 3) { + const list = [...families.keys()].join(', '); + const first = [...families.values()][3]; + report(37, 'FAIL', first.file, first.line, `${families.size} font families: ${trunc(list, 56)}`, 'Drop the extra family; three is the ceiling'); + } +} + +function check38a(ctx) { + for (const r of ctx.rules) { + if (!HEADING_SEL.test(r.selector)) continue; + for (const d of r.decls) { + if (d.prop === 'font-style' && /italic|oblique/.test(d.value)) { + report('38ii', 'FAIL', r.file, d.line, `italic display type on ${r.selector}`, 'Roman headers; emphasis via weight or accent'); + } + } + } + + const normSel = ctx.rules.filter((r) => /(^|[\s,>+~])(em|i)\b/.test(r.selector) + && r.decls.some((d) => d.prop === 'font-style' && /normal/.test(d.value))).flatMap((r) => r.selector.split(',').map((x) => x.trim())); + const normalised = (level, classes) => normSel.some((sel) => /^(em|i)$/.test(sel) || new RegExp(`(^|[\\s,>+~])h${level}\\b`).test(sel) || classes.some((c) => sel.includes('.' + c))); + for (const doc of ctx.docs) { + const re = /]*)>([\s\S]*?)<\/h\1>/gi; + let m; + while ((m = re.exec(doc.src))) { + const classes = ((/class\s*=\s*["']([^"']*)["']/i.exec(m[2]) || [])[1] || '').split(/\s+/).filter(Boolean); + if (/<(em|i)\b/i.test(m[3]) && !normalised(m[1], classes)) { + report('38i', 'FAIL', doc.file, doc.lineOf(m.index), `/ inside `, 'Roman headers; emphasis via weight or accent'); + } + } + } +} + +function check39(ctx) { + const hasInputs = ctx.docs.some((doc) => /<(input|textarea|select)\b/i.test(doc.src)) + || ctx.rules.some((r) => /(^|[\s,>+~])(input|textarea|select)\b/.test(r.selector)); + if (!hasInputs) return; + const inputSel = /(^|[\s,>+~])(input|textarea|select)\b|__input|__field|\.(input|field)\b/; + const widthOf = (v) => { const m = /(\d+(?:\.\d+)?)px/.exec(v); return m ? parseFloat(m[1]) : null; }; + let baseW = null, baseWhere = null; + for (const r of ctx.rules) { + if (!inputSel.test(r.selector) || /:hover|:focus|:active|:disabled|\[|:checked/.test(r.selector)) { + continue; + } + for (const d of r.decls) { + if (d.prop === 'border' || d.prop === 'border-width') { + const w = widthOf(d.value); + if (w != null && baseW == null) { baseW = w; baseWhere = { file: r.file, line: d.line }; } + } + } + } + for (const r of ctx.rules) { + if (!inputSel.test(r.selector)) continue; + const stateful = /:hover|:focus|\.is-error|\[aria-invalid/.test(r.selector); + if (!stateful) continue; + for (const d of r.decls) { + if (d.prop === 'border' || d.prop === 'border-width') { + const w = widthOf(d.value); + if (w != null && baseW != null && w !== baseW) { + report('39a', 'FAIL', r.file, d.line, `border-width ${baseW}px -> ${w}px on ${r.selector} (layout shift)`, 'Keep border-width constant; move state to outline'); + } + } + } + if (/:focus/.test(r.selector)) { + const setsBorder = r.decls.some((d) => /^border(-color)?$/.test(d.prop)); + const setsOutline = r.decls.some((d) => /^outline/.test(d.prop)); + if (setsBorder && !setsOutline) { + report('39a', 'FAIL', r.file, r.line, `focus state via border on ${r.selector}`, 'Focus ring via outline, not border'); + } + } + } + for (const r of ctx.rules) { + if (!/:disabled|\[disabled\]/.test(r.selector)) continue; + const hasOpacity = r.decls.some((d) => d.prop === 'opacity'); + const hasCursor = r.decls.some((d) => d.prop === 'cursor' && /not-allowed/.test(d.value)); + if (hasOpacity && !hasCursor) { + report('39a', 'FAIL', r.file, r.line, `disabled via opacity alone on ${r.selector}`, 'Three disabled channels: fill, ink and cursor, plus the disabled attribute'); + } + } +} + +function check40_41(ctx) { + const bySel = mergedDeclsBySelector(ctx); + const resolveColor = (value, local) => { + const resolved = resolveVars(value, ctx.tokens, local).trim(); + return parseColor(resolved); + }; + for (const r of bySel) { + const local = {}; + for (const d of r.decls) if (d.prop.startsWith('--')) local[d.prop] = d.value; + const colorD = r.decls.find((d) => d.prop === 'color'); + const bgD = r.decls.find((d) => d.prop === 'background-color') + || r.decls.find((d) => d.prop === 'background' && !/gradient|url\(/i.test(d.value)); + if (colorD && bgD && !/::selection|::placeholder|::-moz/.test(r.selector)) { + const fg = resolveColor(colorD.value, local); + const bg = resolveColor(bgD.value, local); + if (fg && bg && fg.alpha >= 1 && bg.alpha >= 1) { + const sizeD = r.decls.find((d) => d.prop === 'font-size'); + const weightD = r.decls.find((d) => d.prop === 'font-weight'); + const sizePx = sizeD ? pxOf(resolveVars(sizeD.value, ctx.tokens, local)) : null; + const weight = weightD ? parseInt(weightD.value, 10) || 400 : 400; + const large = (sizePx != null && sizePx >= 24) || (sizePx != null && sizePx >= 18 && weight >= 700); + const threshold = large ? 3.0 : 4.5; + const ratio = contrastRatio(fg, bg); + if (ratio < threshold - 0.05) { + report(40, 'WARN', r.file, colorD.line, `${ratio.toFixed(2)}:1 < ${threshold}:1 on ${r.selector}`, 'Raise the contrast to threshold'); + } + const okFg = srgbToOklch(fg), okBg = srgbToOklch(bg); + const btnish = /btn|button|cta|pill|chip/i.test(r.selector); + if (btnish && Math.abs(okFg.L - okBg.L) < 0.05 && Math.abs(okFg.C - okBg.C) < 0.05) { + report(41, 'WARN', r.file, colorD.line, `button text ~ button fill on ${r.selector} (dL ${Math.abs(okFg.L - okBg.L).toFixed(3)})`, 'Use accent-ink or paper for the label'); + } + } + } + const faceProp = Object.keys(local).find((k) => /(face|fill|bg)$/.test(k)); + const inkProp = Object.keys(local).find((k) => /(ink|text)$/.test(k)); + if (faceProp && inkProp) { + const face = resolveColor(local[faceProp], local); + const ink = resolveColor(local[inkProp], local); + if (face && ink && face.alpha >= 1 && ink.alpha >= 1) { + const a = srgbToOklch(face), b = srgbToOklch(ink); + if (Math.abs(a.L - b.L) < 0.05 && Math.abs(a.C - b.C) < 0.05) { + report(41, 'WARN', r.file, r.line, `${inkProp} ~ ${faceProp} on ${r.selector}`, 'Use accent-ink or paper for the label'); + } + } + } + } + if (ctx.tokens['--color-accent'] && !ctx.tokens['--color-accent-ink']) { + const used = ctx.rules.some((r) => !isTokenRule(r) && r.decls.some((d) => + /^background(-color)?$/.test(d.prop) && /var\(\s*--color-accent\s*[),]/.test(d.value))); + if (used) { + const file = ctx.cssFiles[0]?.file || ctx.docs[0]?.file; + report(41, 'WARN', file, 1, 'accent fills a surface but --color-accent-ink is undefined', 'Define and apply --color-accent-ink'); + } + } else if (ctx.tokens['--color-accent'] && ctx.tokens['--color-accent-ink']) { + const a = parseColor(resolveVars(ctx.tokens['--color-accent'], ctx.tokens)); + const i = parseColor(resolveVars(ctx.tokens['--color-accent-ink'], ctx.tokens)); + if (a && i && contrastRatio(a, i) < 4.45) { + const file = ctx.cssFiles[0]?.file || ctx.docs[0]?.file; + report(41, 'WARN', file, 1, `accent-ink vs accent only ${contrastRatio(a, i).toFixed(2)}:1`, 'Accent-ink needs 4.5:1 against accent'); + } + } + const sectionish = /section|panel|hero|footer|band|block|col\b|__col|card|cta|dark|invert/i; + for (const r of bySel) { + if (!sectionish.test(r.selector) || /:hover|:focus|:active|::|@font-face/.test(r.selector)) continue; + const local = {}; + for (const d of r.decls) if (d.prop.startsWith('--')) local[d.prop] = d.value; + const bgD = r.decls.find((d) => d.prop === 'background-color') + || r.decls.find((d) => d.prop === 'background' && !/gradient|url\(/i.test(d.value)); + if (!bgD) continue; + const bg = resolveColor(bgD.value, local); + if (!bg || bg.alpha < 1) continue; + const okl = srgbToOklch(bg); + if (okl.L < 0.5) { + const hasColor = r.decls.some((d) => d.prop === 'color'); + if (!hasColor) { + report(41, 'WARN', r.file, bgD.line, `dark surface (L ${(okl.L * 100).toFixed(0)}%) on ${r.selector} sets no text colour`, 'Swap text to paper in the same rule'); + } + } + } +} + +function check42(ctx) { + for (const doc of ctx.docs) { + const navIdx = doc.tags.findIndex((t) => !t.close && (t.name === 'nav' || (t.name === 'header' && /banner|nav/i.test(t.attrs)))); + if (navIdx === -1) continue; + const inner = innerOf(doc, navIdx); + if (!inner) continue; + const links = (inner.inner.match(/ (navCls && r.selector.includes(navCls) || /(^|[\s,])(nav|header)\b/.test(r.selector)) + && r.decls.some((d) => /^border(-bottom)?$/.test(d.prop) && /\b1px\b/.test(d.value))); + const hasCta = /btn|cta|button/i.test(inner.inner); + if (links >= 4 && links <= 6 && hairline && hasCta) { + report(42, 'WARN', doc.file, navTag.line, `default nav shape: ${links} links + CTA + 1px hairline`, 'Give the nav a shape of its own (layout.md, navs)'); + } + } +} + +function check42Footer(ctx) { + for (const doc of ctx.docs) { + const idx = doc.tags.findIndex((t) => !t.close && t.name === 'footer'); + if (idx === -1) continue; + const inner = innerOf(doc, idx); + if (!inner) continue; + const uls = (inner.inner.match(/ /footer/i.test(r.selector) && r.decls.some((d) => + d.prop === 'grid-template-columns' + && (/repeat\(\s*4\s*,/.test(d.value) + || /^(1fr|minmax\([^)]*\))(\s+(1fr|minmax\([^)]*\))){3,}$/.test(d.value.trim())))); + + let linkGroups = 0; + const colRe = /<(ul|div|p|nav)\b[^>]*class\s*=\s*"[^"]*(col|column|links|group)[^"]*"[^>]*>([\s\S]*?)<\/\1>/gi; + let cm; + while ((cm = colRe.exec(inner.inner))) { + if ((cm[3].match(/= 3) linkGroups++; + } + for (const um of inner.inner.matchAll(/]*>([\s\S]*?)<\/ul>/gi)) { + if ((um[1].match(/= 3) linkGroups++; + } + if (uls >= 4 || (fourEqualCol && linkGroups >= 3)) { + report(42, 'WARN', doc.file, doc.tags[idx].line, `default footer shape: ${uls >= 4 ? uls + ' link columns' : '4 equal columns of links'}`, 'Decide the footer and name it in the stamp, or build another shape'); + } + } +} + +function check46(ctx) { + const shapes = [ + /\b\d+(\.\d+)?\s*[x×]\s*faster\b/i, + /trusted by [\d,.]+\s*\+?/i, + /\b99\.9+\s*%/, + /\b[\d,]{4,}\s*\+\s*(teams|users|customers|developers|companies|creators)\b/i, + /\b\d+(\.\d+)?\s*%\s*(faster|uptime|conversion|accuracy|retention|growth|fewer|less|more)\b/i, + /\+\s*\d+(\.\d+)?\s*%\s*(conversion|growth|revenue|retention)\b/i, + /\bsaves?\s+\d+\s+hours?\b/i, + ]; + for (const doc of ctx.docs) { + const prose = maskedProse(doc); + const lines = new Set(); + for (const re of shapes) { + const m = re.exec(prose); + if (!m) continue; + const line = doc.lineOf(m.index); + if (lines.has(line)) continue; + lines.add(line); + report('46a', 'WARN', doc.file, line, `metric "${m[0].trim()}": verify the user supplied this number`, 'Confirm the metric or drop the slot'); + } + } +} + +const CHROME_47 = [ + ['47a', /(browser|window|mac|osx)[-_]?(bar|chrome|dots|controls)|traffic[-_]?light|title[-_]?bar|window[-_]?(dots|buttons)|url[-_]?(bar|pill)/i], + ['47b', /phone[-_]?(frame|mock(up)?)|device[-_]?frame|\bnotch\b|terminal[-_]?(chrome|frame|bar|dots|header)|(ide|editor)[-_]?(chrome|frame)|(browser|window)[-_]?frame/i], +]; +function check47(ctx) { + for (const [gate, re] of CHROME_47) { + for (const doc of ctx.docs) { + for (const t of doc.tags) { + if (t.close) continue; + const cls = getAttr(t.attrs, 'class'); + const m = cls ? re.exec(cls) : null; + if (m) { report(gate, 'FAIL', doc.file, t.line, `re-drawn chrome class "${m[0]}" (class="${trunc(cls, 32)}")`, 'Use a real screenshot in a figure'); break; } + } + } + for (const r of ctx.rules) { + const m = re.exec(r.selector); + if (m) { + report(gate, 'FAIL', r.file, r.line, `re-drawn chrome selector ${r.selector}`, 'Use a real screenshot in a figure'); + break; + } + } + } +} + +function check48(ctx) { + const colorLit = /#[0-9a-fA-F]{3,8}\b|(? isTokenRule(r) && r.decls.some((d) => d.prop === prop)); + report(48, 'FAIL', tr ? tr.file : ctx.cssFiles[0]?.file || ctx.docs[0]?.file, tr ? tr.decls.find((d) => d.prop === prop)?.line : 1, `${prop} is still the scaffold placeholder "FILL ME"`, /^--font-/.test(prop) ? 'Fill the face from the theme tokens (scaffold) or fonts.md on a custom run before building' : 'Fill the colour from the theme tokens (scaffold) or direction.md on a custom run before building'); + } + } + for (const r of ctx.rules) { + if (isTokenRule(r)) continue; + for (const d of r.decls) { + if (d.prop === 'font-family') { + const v = d.value; + if (/FILL ME/i.test(resolveVars(v, ctx.tokens))) { + report(48, 'FAIL', r.file, d.line, `font-family on ${r.selector} resolves to the placeholder "FILL ME"`, 'Fill the face from the theme tokens (scaffold) or fonts.md on a custom run before building'); + continue; + } + if (!v.includes('var(')) { + const fam = firstFamily(v); + if (!GENERIC_FAMILIES.has(fam)) { + report(48, 'FAIL', r.file, d.line, `font-family literal "${trunc(v, 36)}" on ${r.selector}`, 'Lift the value into the token block'); + } + } + continue; + } + if (!colorLit.test(d.value)) continue; + const re = /#[0-9a-fA-F]{3,8}\b|oklch\([^)]*\)|rgba?\([^)]*\)|hsla?\([^)]*\)/g; + let m; + while ((m = re.exec(d.value))) { + const c = parseColor(m[0]); + if (!c) continue; + if (c.alpha === 0) continue; + const isOklch = m[0].toLowerCase().startsWith('oklch'); + const ev = `${isOklch ? 'oklch' : 'colour'} literal ${trunc(m[0], 30)} outside tokens (${d.prop} on ${trunc(r.selector, 30)})`; + report(48, 'FAIL', r.file, d.line, ev, 'Lift the value into the token block'); + } + } + } + for (const doc of ctx.docs) { + const re = /style\s*=\s*"([^"]*)"/gi; + let m; + while ((m = re.exec(doc.src))) { + const lit = /#[0-9a-fA-F]{3,8}\b|oklch\([^)]*\)|rgba?\([^)]*\)|hsla?\([^)]*\)/.exec(m[1]); + if (lit && parseColor(lit[0])) { + const isOklch = lit[0].toLowerCase().startsWith('oklch'); + const ev = `inline-style colour literal ${trunc(lit[0], 30)}`; + report(48, 'FAIL', doc.file, doc.lineOf(m.index), ev, 'Lift the value into the token block'); + } + } + } +} + +function check49(ctx) { + const nowrapSelectors = ctx.rules.filter((r) => r.decls.some((d) => d.prop === 'white-space' && /nowrap/.test(d.value))); + const covered = (cls, tag) => nowrapSelectors.some((r) => + (cls && cls.split(/\s+/).some((c) => c && r.selector.includes('.' + c))) || new RegExp(`(^|[\\s,>+~])${tag}\\b`).test(r.selector)); + for (const doc of ctx.docs) { + for (let i = 0; i < doc.tags.length; i++) { + const t = doc.tags[i]; + if (t.close || t.selfClosing) continue; + const cls = getAttr(t.attrs, 'class') || ''; + const clickable = t.name === 'button' || (t.name === 'a' && /btn|cta|button|nav/i.test(cls)) + || (/(^|\s)(btn|button)(\s|$|__|--)/i.test(cls) && !/^(section|header|footer|main|article|aside|nav|form|ul|ol)$/.test(t.name)); + if (!clickable) continue; + const inner = innerOf(doc, i); + if (!inner) continue; + const label = inner.inner.replace(/<[^>]*>/g, ' ').replace(/\s+/g, ' ').trim(); + if (label.length > 24 && !covered(cls, t.name)) { + report(49, 'WARN', doc.file, t.line, `long clickable label "${trunc(label, 36)}" without nowrap`, 'Shorten the label or set nowrap'); + } + } + } +} + +function check50(ctx) { + for (const r of ctx.rules) { + for (const d of r.decls) { + if (d.prop !== 'grid-template-columns') continue; + let flat = resolveVars(d.value, ctx.tokens); + for (let k = 0; k < 4 && /\((?:[^()]*)\)/.test(flat); k++) flat = flat.replace(/(calc|min|max|clamp|var|fit-content)\(([^()]*)\)/g, 'X'); + flat = flat.replace(/minmax\([^()]*\)/g, 'MM'); + const bare = /(? c.slice(1)); + let hit = null; + for (const doc of ctx.docs) { + for (let i = 0; i < doc.tags.length; i++) { + const t = doc.tags[i]; + if (t.close || t.selfClosing) continue; + const cls = getAttr(t.attrs, 'class') || ''; + if (!classes.some((c) => cls.split(/\s+/).includes(c))) continue; + const inner = innerOf(doc, i); + if (inner && /<(img|picture|video)\b/i.test(inner.inner)) { hit = { doc, t }; break; } + } + if (hit) break; + } + if (hit) { + report(50, 'FAIL', r.file, d.line, `bare ${bare[0]} track holds images (${r.selector})`, 'Use minmax(0, 1fr) for image tracks'); + } + } + } +} + +function check50Wrap(ctx) { + const wrapCovered = (cls, tag) => ctx.rules.some((r) => { + const has = r.decls.some((d) => + (d.prop === 'overflow-wrap' && /anywhere|break-word/.test(d.value)) + || (d.prop === 'word-break' && /break-word|break-all/.test(d.value)) + || (d.prop === 'hyphens' && /auto/.test(d.value))); + if (!has) return false; + if (/^\*|:where\(|html|body/.test(r.selector)) return true; + return (cls && cls.split(/\s+/).some((c) => c && r.selector.includes('.' + c))) + || new RegExp(`(^|[\\s,>+~])${tag}\\b`).test(r.selector); + }); + for (const doc of ctx.docs) { + for (let i = 0; i < doc.tags.length; i++) { + const t = doc.tags[i]; + if (t.close || t.selfClosing) continue; + const cls = getAttr(t.attrs, 'class') || ''; + const displayish = /^h[12]$/.test(t.name) || /hero__(title|display)|section__title|__display/.test(cls); + if (!displayish) continue; + const inner = innerOf(doc, i); + if (!inner) continue; + const textContent = inner.inner.replace(/<[^>]*>/g, ' ').replace(/\s+/g, ' ').trim(); + let risky = null; + for (const word of textContent.split(' ')) { + for (const seg of word.split('-')) { + if (seg.replace(/[^\w]/g, '').length >= 16) { risky = word; break; } + } + if (risky) break; + } + if (risky && !wrapCovered(cls, t.name)) { + report(50, 'FAIL', doc.file, t.line, `display header word "${trunc(risky, 30)}" with no overflow-wrap`, 'Add overflow-wrap: break-word and min-width: 0'); + } + } + } +} + +function check53(ctx) { + const radios = ctx.rules.filter((r) => /input\[type=["']?radio["']?\]|\.(radio|tab-input|tab-radio)\b/i.test(r.selector)); + for (const r of radios) { + const abs = r.decls.some((d) => d.prop === 'position' && /absolute|fixed/.test(d.value)); + const topZero = r.decls.some((d) => d.prop === 'top' && /^0(px|rem)?$/.test(d.value.trim())); + if (abs && topZero) { + const guarded = ctx.docs.some((doc) => /preventScroll/.test(doc.scripts)); + if (!guarded) { + report(53, 'FAIL', r.file, r.line, `radio tabs at position:absolute top:0 (${r.selector}), no JS guard`, 'Keep radios in flow or add a JS guard'); + } + } + } +} + +const EYEBROW_CONTAINER = /^(div|header|footer|section|article|aside|hgroup|li|main|figure|a|body|blockquote)$/; + +const EYEBROW_SKIP_TAGS = /^(figcaption|label|legend|caption|th|dt|summary|option|code|kbd|button|select|nav|time)$/; +const EYEBROW_ANCESTOR_SKIP = /^(form|fieldset|table|thead|tbody|nav|menu|dl|select|figcaption|label|button)$/; + +const EYEBROW_BLOCKY = /<(p|ul|ol|hr|h[1-6]|img|table|figure|section|article|blockquote|form|dl)\b/i; +const EYEBROW_CLASS = /\b(eyebrow|kicker|overline|superhead|suphead|rubric|strap(line)?|pre-?(title|head(ing)?)|section-?label|num-?label|chapter|ordinal|topic|category|dept)\b|__(num|label|tag|kicker|chip|badge|meta|index|caps|micro)\b|\b(tag|chip|badge|meta|caps|micro|label|index)\b/i; +const EYEBROW_ANNOUNCE = /^(features?|benefits?|introducing|new|how it works?|the (process|tour)|our (process|story|work|team|approach|values?)|why (us|choose|we)|pricing|plans?|faq|questions?|testimonials?|reviews?|trusted by|as seen in|what we do|about( us)?|services?|solutions?|use cases?|get started|contact|team|work|projects?|gallery|blog|news|resources?|examples?|overview)$/i; + +function capsRatio(s) { + const letters = s.replace(/[^A-Za-z]/g, ''); + if (!letters) return 0; + return (letters.match(/[A-Z]/g) || []).length / letters.length; +} + +function eyebrowHeadingBearing(ctx, B, aPx) { + if (/^h[1-6]$/.test(B.name)) return true; + if (/]/i.test(B.html)) return true; + + const cls = getAttr(B.open, 'class') || ''; + if (!/__(title|display|head(line)?|h\d)\b|hero__/i.test(cls)) return false; + const bPx = fontPxOf(ctx, styleFor(ctx, cls, B.name)); + return bPx != null && aPx != null && bPx >= 1.5 * aPx; +} + +function eyebrowHit(ctx, A, B, inOrderedList) { + if (EYEBROW_SKIP_TAGS.test(A.name)) return null; + if (/(^|\s)for\s*=/i.test(A.open)) return null; + if (/role\s*=\s*["']status|aria-live|aria-current|aria-hidden\s*=\s*["']true/i.test(A.open)) return null; + const inner = A.html.slice(A.open.length); + if (EYEBROW_BLOCKY.test(inner) || /]*\sdatetime\s*=/i.test(A.html)) return null; + if (/]*\salt\s*=\s*["'][^"']+/i.test(A.html)) return null; + + const ownHref = A.name === 'a' ? getAttr(A.open, 'href') : null; + if (ownHref && !/^#?$/.test(ownHref.trim())) return null; + const innerHref = /]*\shref\s*=\s*["']([^"']*)["']/i.exec(inner); + if (innerHref && !/^#?$/.test(innerHref[1].trim())) return null; + + const text = plainText(A.html); + if (!text) return null; + const words = text.split(/[\s·/|\u2014\u2013]+/).filter(Boolean); + if (words.length > 7 || text.length > 56) return null; + if (/[\w/-]+\.[a-z]{1,4}$/i.test(text)) return null; + + if (/^[\d.,]+\s*(?:[%°+]|[a-z]{1,3})$/i.test(text)) return null; + const stripped = text.replace(/^\s*(?:no\.?\s*)?\d{1,3}(?:\s*[·./\u2014\u2013-]\s*|\s+|$)/i, '').trim(); + if ((stripped.match(/\d/g) || []).length >= 2) return null; + + if (inOrderedList && stripped && !EYEBROW_ANNOUNCE.test(stripped)) return null; + + const cls = getAttr(A.open, 'class') || ''; + const aDecls = styleFor(ctx, cls, A.name); + + const pos = declValue(ctx, aDecls, 'position'); + if (pos && /absolute|fixed/.test(pos)) return null; + const aPx = fontPxOf(ctx, aDecls); + if (!eyebrowHeadingBearing(ctx, B, aPx)) return null; + + if (EYEBROW_CLASS.test(cls)) return { text }; + let signals = 0; + const tt = declValue(ctx, aDecls, 'text-transform'); + if ((tt && /uppercase/.test(tt)) || (capsRatio(text) >= 0.6 && /[A-Z]/.test(text))) signals++; + const tr = trackingEmOf(ctx, aDecls, aPx || 16); + if (tr != null && tr >= 0.04) signals++; + if (aPx != null && aPx <= 15) signals++; + const ff = declValue(ctx, aDecls, 'font-family'); + if (ff && /mono|--font-label/i.test(ff)) signals++; + const fv = declValue(ctx, aDecls, 'font-variant-caps'); + if (fv && /small-caps/.test(fv)) signals++; + if (signals >= 2) return { text }; + if (EYEBROW_ANNOUNCE.test(stripped)) return { text }; + return null; +} + +function check54(ctx) { + for (const doc of ctx.docs) { + const anc = ancestorMap(doc); + for (let i = 0; i < doc.tags.length; i++) { + const t = doc.tags[i]; + if (t.close || t.selfClosing || !EYEBROW_CONTAINER.test(t.name)) continue; + const ancestors = anc.get(i) || []; + if (ancestors.some((n) => EYEBROW_ANCESTOR_SKIP.test(n))) continue; + const inOl = ancestors.includes('ol'); + const kids = directChildren(doc, i); + for (let k = 0; k < kids.length - 1; k++) { + const A = kids[k]; + let B = null; + for (let j = k + 1; j < Math.min(kids.length, k + 3); j++) { + const c = kids[j]; + if (c.name === 'hr' || /aria-hidden\s*=\s*["']true/i.test(c.open)) continue; + B = c; break; + } + if (!B) continue; + const hit = eyebrowHit(ctx, A, B, inOl); + if (hit) { + report(54, 'FAIL', doc.file, doc.tags[A.idx]?.line || t.line, + `eyebrow "${trunc(hit.text, 32)}" before <${B.name}>`, + 'Cut it; the heading already says this (craft.md § 7 has twelve other openings)'); + break; + } + } + } + } + check54Unheaded(ctx); +} + +function check54Unheaded(ctx) { + for (const doc of ctx.docs) { + for (let i = 0; i < doc.tags.length; i++) { + const t = doc.tags[i]; + if (t.close || t.selfClosing || !/^(section|article)$/.test(t.name)) continue; + const labelledBy = getAttr(t.attrs, 'aria-labelledby'); + if (!labelledBy) continue; + const body = innerOf(doc, i); + if (!body || /]/i.test(body.inner)) continue; + const idRe = new RegExp(`<([a-z][\\w-]*)\\b[^>]*\\sid\\s*=\\s*["']${labelledBy.split(/\s+/)[0]}["'][^>]*>`, 'i'); + const m = idRe.exec(body.inner); + if (!m || /^h[1-6]$/i.test(m[1])) continue; + report(54, 'WARN', doc.file, doc.lineOf(body.endPos - body.inner.length + m.index), + `section labelled by <${m[1].toLowerCase()}> with no heading element`, + 'Promote it to

          ; a label doing heading duty should be a heading'); + } + } +} + +function check55(ctx) { + const bySel = mergedDeclsBySelector(ctx); + for (const r of bySel) { + const upper = r.decls.find((d) => d.prop === 'text-transform' && /uppercase/.test(d.value)); + if (!upper) continue; + const displayish = HEADING_SEL.test(r.selector); + const lhD = r.decls.find((d) => d.prop === 'line-height'); + if (!lhD) continue; + const lh = parseFloat(resolveVars(lhD.value, ctx.tokens)); + if (Number.isNaN(lh) || lh >= 1.02) continue; + const bigType = r.decls.some((d) => d.prop === 'font-size' && (pxOf(resolveVars(d.value, ctx.tokens)) ?? 0) >= 28); + if (!displayish && !bigType) continue; + const nowrap = r.decls.some((d) => d.prop === 'white-space' && /nowrap/.test(d.value)); + if (!nowrap && lh >= 1.0) continue; + report(nowrap ? '55b' : '55a', 'FAIL', r.file, lhD.line, `uppercase + line-height ${lh} on ${r.selector} (cap collision)`, nowrap ? 'A single-line caps lockup holds 1.02 or more' : 'Line-height 1.0 minimum for caps heads that can wrap'); + } +} + +function check56(ctx) { + const bySel = mergedDeclsBySelector(ctx); + const sticky = []; + for (const r of bySel) { + const isSticky = r.decls.some((d) => d.prop === 'position' && /sticky/.test(d.value)); + const topZero = r.decls.some((d) => d.prop === 'top' && /^(0|0px|0rem|-1px)$/.test(resolveVars(d.value, ctx.tokens).trim())); + if (isSticky && topZero) sticky.push(r); + } + if (sticky.length >= 2) { + const sels = sticky.map((r) => r.selector).join(' + '); + report(56, 'FAIL', sticky[1].file, sticky[1].line, `two sticky top:0 elements: ${trunc(sels, 52)}`, 'Offset the second sticky by banner height'); + } +} + +function checkCopyTell(ctx) { + for (const doc of ctx.docs) { + const prose = maskedProse(doc); + const m = /\w\s--\s\w|[\u2014\u2013]|—|–|—|–/.exec(prose); + if (m) report(19, 'FAIL', doc.file, doc.lineOf(m.index), `dash "${m[0]}" in copy`, 'A comma, a colon, a full stop or parentheses; never a dash'); + const seenBuzz = new Set(); + for (const buzz of prose.matchAll(new RegExp(/\b(seamless(ly)?|robust|empower(s|ing)?|supercharge[sd]?|best[- ]in[- ]class|industry[- ]leading|mission[- ]critical|future[- ]proof(ed)?|unleash(es|ed|ing)?|elevate[sd]?|effortless(ly)?|unlock(s|ing)?|next[- ]generation|world[- ]class|cutting[- ]edge|streamline[sd]?|revolutioni[sz]e[sd]?|game[- ]chang(er|ing)|enterprise[- ]grade|quietly (trusted|in use)|built for the modern|in today's)\b/.source, 'gi'))) { + const word = buzz[0].toLowerCase(); + if (seenBuzz.has(word) || seenBuzz.size >= 8) continue; + seenBuzz.add(word); + report(19, 'FAIL', doc.file, doc.lineOf(buzz.index), `buzzword "${buzz[0]}"`, 'Say what the product does, in its own nouns'); + } + const cadence = prose.match(/(^|[.!?]\s+)(not|no)\s+[a-z][^.!?\n]{0,40}[.]\s+(just|only|a|an)?\s*[a-z][^.!?\n]{0,40}[.]/gi) || []; + if (cadence.length >= 3) report(19, 'FAIL', doc.file, doc.lineOf(prose.indexOf(cadence[0].trim()) || 0), `rebuttal cadence repeated ${cadence.length} times ("${trunc(cadence[0].trim(), 40)}")`, 'Once is voice; three times is a tic'); + } +} + +function monoIsMaterial(ctx) { + const mono = (v) => v && /mono|code|courier|silkscreen|jetbrains|plex mono|geist mono|commit|fira code|space mono|dm mono|roboto mono|source code|ibm plex mono|press start|vt323|share tech/i.test(firstFamily(resolveVars(v, ctx.tokens))); + return mono(ctx.tokens['--font-display']) || mono(ctx.tokens['--font-body']) || mono(ctx.tokens['--font-outlier']); +} + +const HIDE_OK = /tooltip|popover|menu|dropdown|modal|dialog|toast|overlay|backdrop|sheet|drawer|panel|:hover|:focus|:checked|:target|\[open|\[aria-(?:expanded|selected|current|pressed)|::before|::after|\.is-|\[hidden|\[aria-hidden|sr-only|visually-hidden|skip|placeholder|::marker|\[data-slot/i; +function startingStyleText(css) { + let out = ''; + for (const m of css.matchAll(/@starting-style\s*\{/gi)) { + let depth = 1, k = m.index + m[0].length; + while (k < css.length && depth > 0) { if (css[k] === '{') depth++; else if (css[k] === '}') depth--; k++; } + out += css.slice(m.index, k) + ' '; + const open = css.lastIndexOf('{', m.index - 1), close = css.lastIndexOf('}', m.index - 1); + if (open > close) out += css.slice(Math.max(close + 1, 0), open) + ' '; + } + return out; +} +function check62(ctx) { + const starting = startingStyleText(ctx.allCss); + const jsScoped = (sel) => /(^|[\s,])(html|body)?\.js\b|\[data-js|\.no-js|html\.has-js/i.test(sel); + const animatedNames = new Map(); + for (const r of ctx.rules) if (r.keyframes) { + const arr = animatedNames.get(r.keyframes) || []; + arr.push(r); animatedNames.set(r.keyframes, arr); + } + const animatesVisible = (name) => (animatedNames.get(name) || []).some((r) => /to|100%/.test(r.selector) && r.decls.some((d) => d.prop === 'opacity' && parseFloat(d.value) === 1)); + const seen = new Set(); + for (const r of ctx.rules) { + if (r.keyframes || (r.media && /\bprint\b/i.test(r.media)) || r.selector === '@font-face') continue; + const hidden = r.decls.find((d) => (d.prop === 'opacity' && parseFloat(resolveVars(d.value, ctx.tokens)) === 0) || (d.prop === 'visibility' && /hidden/.test(d.value))); + if (!hidden) continue; + if (HIDE_OK.test(r.selector.replace(/:not\([^)]*\)/g, '')) || jsScoped(r.selector) || (starting && starting.includes(r.selector))) continue; + const revealish = /reveal|fade|animate|aos|in-view|inview|appear|enter|rise|slide|stagger|observe|lazy/i.test(r.selector) || r.decls.some((d) => d.prop === 'transform' && /translate|scale/.test(d.value)); + if (!revealish) continue; + const anim = r.decls.find((d) => d.prop === 'animation' || d.prop === 'animation-name'); + const animName = anim ? anim.value.split(/\s+/).find((w) => animatedNames.has(w)) : null; + if (animName && animatesVisible(animName)) continue; + const key = r.selector; + if (seen.has(key)) continue; seen.add(key); + report(62, 'FAIL', r.file, hidden.line, `${r.selector} is hidden at rest (${hidden.prop}: ${hidden.value}) and depends on a script to appear`, 'Visible by default: scope the hidden state under a .js class the script adds, or animate from visible with @starting-style'); + } +} + +const TEXT_TAGS = new Set(['p', 'span', 'li', 'small', 'a', 'div', 'figcaption', 'td', 'th', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'time', 'dd', 'dt', 'cite', 'strong', 'em', 'b', 'label', 'button', 'summary']); +function check63(ctx) { + for (const doc of ctx.docs) { + const dotLines = new Set(); const arrowLines = new Set(); let dotCount = 0; + const tickerRanges = []; + for (let i = 0; i < doc.tags.length; i++) { + const t = doc.tags[i]; + if (t.close || t.selfClosing || !/marquee|ticker|tape|crawl/i.test(getAttr(t.attrs, 'class') || '')) continue; + const inner = innerOf(doc, i); + if (inner) tickerRanges.push([t.pos, inner.endPos]); + } + for (let i = 0; i < doc.tags.length; i++) { + const t = doc.tags[i]; + if (t.close || t.selfClosing || !TEXT_TAGS.has(t.name)) continue; + const cls = getAttr(t.attrs, 'class') || ''; + if (/marquee|ticker|tape|crawl/i.test(cls) || tickerRanges.some(([a, b]) => t.pos > a && t.pos < b)) continue; + const inner = innerOf(doc, i); + if (!inner) continue; + if (/<(p|div|li|section|article|ul|ol|table)\b/i.test(inner.inner)) continue; + const text = plainText(inner.inner); + if (!text) continue; + const dots = (text.match(/\s[·•]\s/g) || []).length; + if (dots >= 2 && !dotLines.has(t.line)) { dotLines.add(t.line); report(63, 'FAIL', doc.file, t.line, `middle-dot meta string "${trunc(text, 50)}"`, 'Line breaks, columns or hairlines; one dot in a byline at most'); } + if ((t.name === 'a' || t.name === 'button') && /(\u2192|->|\u203a|\u00bb|\u27f6)\s*$/.test(text) && !arrowLines.has(t.line)) { arrowLines.add(t.line); report(63, 'FAIL', doc.file, t.line, `arrow glued to the label "${trunc(text, 40)}"`, 'A verb as the label; the link already says it goes somewhere'); } + if (/^[A-Z]{3,}\s+-\s+\S/.test(text) && text.length < 60) report(63, 'FAIL', doc.file, t.line, `WORD - fragment label "${trunc(text, 40)}"`, 'Say the thing as a sentence or a heading'); + } + for (let i = 0; i < doc.tags.length; i++) { + const t = doc.tags[i]; + if (t.close || !/^(span|i|b|em|s)$/.test(t.name)) continue; + const cls = getAttr(t.attrs, 'class') || ''; + if (!/(^|\s)(dot|status-dot|indicator|bullet|pip|blip)(\s|$|__|-)/i.test(cls)) continue; + if (/aria-live|role\s*=\s*"status"/i.test(t.attrs)) continue; + const inner = innerOf(doc, i); + if (inner && plainText(inner.inner)) continue; + dotCount++; + if (dotCount === 3) report(63, 'FAIL', doc.file, t.line, `decorative status dots (${cls.trim()}) repeated across the page`, 'Delete them; a dot means live state, and only where it is one'); + } + } +} + +function check64(ctx) { + if (monoIsMaterial(ctx)) return; + const monoFam = (v) => /mono|courier|jetbrains|plex mono|geist mono|commit|fira code|space mono|dm mono|roboto mono|source code|silkscreen/i.test(firstFamily(resolveVars(v, ctx.tokens))); + const LABELISH = /label|caption|meta|eyebrow|kicker|tag\b|badge|chip|small|folio|footnote|legend|\bth\b|thead|figcaption|overline|dateline|byline|credit|note\b/i; + const DATAISH = /code|pre\b|kbd|samp|num|figure|stat|price|value|data|tabular|counter|timer|clock|coord|amount|total|score|version|hash|\bid\b|sku|time|date|hour|utc|eta|lot\b|edition|ref\b|dimension|measure|reading|plate-?no|tag-?no|url|uri\b|path|endpoint|command|cmd|snippet|install/i; + const seen = new Set(); + for (const r of ctx.rules) { + if (r.keyframes || r.selector === '@font-face' || isTokenRule(r)) continue; + if (!LABELISH.test(r.selector) || DATAISH.test(r.selector)) continue; + const fam = r.decls.find((d) => d.prop === 'font-family' || (d.prop === 'font' && /var\(--font|mono/i.test(d.value))); + if (!fam) continue; + const raw = fam.prop === 'font' ? (/var\(--font-[\w-]+\)/.exec(fam.value) || [fam.value])[0] : fam.value; + if (!monoFam(raw)) continue; + const key = baseSelector(r.selector); + if (seen.has(key)) continue; seen.add(key); + report(64, 'FAIL', r.file, fam.line, `monospace label voice on ${r.selector}`, 'Labels in the body face, a step smaller, sentence case; mono only for code and figures'); + } +} + +function check65(ctx) { + const paper = parseColor(resolveVars(ctx.tokens['--color-paper'] || '', ctx.tokens)); + const accent = parseColor(resolveVars(ctx.tokens['--color-accent'] || '', ctx.tokens)); + if (!paper || !accent) return; + const p = paper.okl || srgbToOklch(paper); const a = accent.okl || srgbToOklch(accent); + const cream = p.L >= 0.9 && p.C >= 0.006 && p.H >= 55 && p.H <= 105; + const clay = a.C >= 0.08 && a.H >= 15 && a.H <= 55; + const disp = firstFamily(resolveVars(ctx.tokens['--font-display'] || '', ctx.tokens)); + const hcSerif = /bodoni|didot|didone|playfair|fraunces|instrument serif|cormorant|dm serif|libre caslon display|abril|prata|gloock|newsreader|editorial new|gt sectra|canela|freight|yeseva|rozha|boska|melodrama/i.test(disp); + const catalogTheme = /theme:\s*(?!custom\b)[A-Z][\w-]*\s*\((?:deal|by request)/.test(ctx.stampText); + if (cream && clay && hcSerif && !catalogTheme) report(65, 'FAIL', ctx.cssFiles[0]?.file || ctx.docs[0]?.file, 1, `the named look: cream paper (L ${Math.round(p.L * 100)}%, hue ${Math.round(p.H)}) + ${disp} + a clay accent (hue ${Math.round(a.H)})`, 'Move one axis, the accent first; or stamp the theme as asked for by name'); +} + +function checkF15(ctx) { + const widths = new Map(); + for (const r of ctx.rules) { + if (r.keyframes || r.media || !/container|wrap|inner|shell|content|section|page|main/i.test(r.selector)) continue; + for (const d of r.decls) if (d.prop === 'max-width') { const px = maxPxIn(resolveVars(d.value, ctx.tokens)); if (px && px >= 900) widths.set(px, r.selector); } + } + if (widths.size > 1) report('F15', 'WARN', ctx.cssFiles[0]?.file || ctx.docs[0]?.file, 1, `${widths.size} container widths on one page (${[...widths.keys()].join(', ')}px)`, 'One container width, applied by the same two-element pattern in every section'); + const gaps = new Map(); + for (const r of ctx.rules) { + if (r.keyframes || r.media || /hero|masthead|fold|\b(?:app|ui|demo|sample|screen|product|mock|device|console|editor|window)(?:\b|__|--)|\[data-slot/i.test(r.selector)) continue; + const cols = r.decls.find((d) => d.prop === 'grid-template-columns' && trackCount(d.value) > 1 && !/^repeat\(\s*auto/.test(d.value.trim())); + if (!cols) continue; + const gap = r.decls.find((d) => /^(gap|column-gap)$/.test(d.prop)); + if (gap) { const v = resolveVars(gap.value, ctx.tokens).split(/\s+/).pop(); const px = maxPxIn(v); if (px != null && px >= 24) gaps.set(v, r.selector); } + } + if (gaps.size > 2) report('F15', 'WARN', ctx.cssFiles[0]?.file || ctx.docs[0]?.file, 1, `${gaps.size} different column gaps across multi-column sections (${[...gaps.keys()].join(', ')})`, 'One column gap for every multi-column section'); +} + +function trackCount(v) { + const t = v.replace(/\[[^\]]*\]/g, ' ').trim(); + const rep = /^repeat\(\s*(\d+)/.exec(t); + if (rep) return Number(rep[1]); + let depth = 0, n = 0, inTok = false; + for (const ch of t) { + if (ch === '(') depth++; + else if (ch === ')') depth--; + if (depth === 0 && /\s/.test(ch)) inTok = false; + else if (!inTok) { inTok = true; n++; } + } + return n; +} + +function checkF16(ctx) { + if (ctx.tokensOnly || !ctx.tokens['--color-accent']) return; + const tw = twGroup(ctx); + const missing = []; + if (!/::selection/.test(ctx.allCss) && !tw.variants.has('selection')) missing.push('::selection'); + if (!/scrollbar-color|::-webkit-scrollbar/.test(ctx.allCss) && !tw.scrollbar) missing.push('scrollbar-color'); + const hasInputs = ctx.docs.some((d) => /<(input|textarea)\b/i.test(d.src)); + if (hasInputs && !/caret-color/.test(ctx.allCss) && !tw.caret) missing.push('caret-color'); + if (missing.length) report('F16', 'WARN', ctx.cssFiles[0]?.file || ctx.docs[0]?.file, 1, `browser surfaces unthemed: ${missing.join(', ')}`, 'Theme the parts you did not draw from the palette'); +} + +const proseRun = (run, pad) => { + let r = run; + for (let k = 0; k < 3 && /\{[^{}]*\}/.test(r); k++) r = r.replace(/\{[^{}]*\}/g, pad); + return /[;=(){}]|\breturn\b/.test(r) ? pad(r) : r; +}; +function maskedProse(doc) { + if (doc._prose == null) { + const pad = (m) => m.replace(/[^\n]/g, ' '); + const src = doc.kind && doc.kind !== 'html' ? doc.src.replace(/(^|>)([^<>]*)(?=<|$)/g, (m0, a, run) => a + proseRun(run, pad)) : doc.src; + doc._prose = src + .replace(/<(script|style|pre|code|kbd|samp|textarea)\b[^>]*>[\s\S]*?<\/\1>/gi, pad) + .replace(//g, pad) + .replace(/<[^>]*>/g, pad); + } + return doc._prose; +} + +function maxPxIn(value) { + let best = null; + for (const m of String(value).matchAll(/(-?\d+(?:\.\d+)?)(px|rem|em)/g)) { + const px = m[2] === 'px' ? parseFloat(m[1]) : parseFloat(m[1]) * 16; + if (best == null || px > best) best = px; + } + return best; +} + +function baseSelector(sel) { + return sel.replace(/::?[a-z-]+(\([^)]*\))?/gi, '').replace(/\s+/g, ' ').trim(); +} + +function checkF1(ctx) { + const dq = /(?:"|"|�?34;)(?=[A-Za-z])|[A-Za-z](?:"|"|�?34;)/g; + const ap = /[A-Za-z](?:'|�?39;|')(?=[A-Za-z])/g; + for (const doc of ctx.docs) { + const prose = maskedProse(doc); + const hits = [...prose.matchAll(dq), ...prose.matchAll(ap)].sort((a, b) => a.index - b.index); + if (!hits.length) continue; + const around = prose.slice(Math.max(0, hits[0].index - 16), hits[0].index + 16).replace(/\s+/g, ' ').trim(); + report('F1', 'WARN', doc.file, doc.lineOf(hits[0].index), + `straight quote in prose x${hits.length} (first: ${trunc(around, 40)})`, 'Use typographic quotes: \u201C \u201D \u2019'); + } +} + +function checkF2(ctx) { + for (const doc of ctx.docs) { + const prose = maskedProse(doc); + const hits = [...prose.matchAll(/\.{3,}/g)]; + if (!hits.length) continue; + report('F2', 'WARN', doc.file, doc.lineOf(hits[0].index), + `three-period ellipsis in prose x${hits.length}`, 'Use a true ellipsis character (\u2026)'); + } +} + +function checkF3(ctx) { + const H12 = /(^|[\s,>+~(])h[12]\b/i; + const targets = []; + let satisfied = false; + for (const r of mergedDeclsBySelector(ctx)) { + const isH12 = H12.test(r.selector); + const isDisplayClass = HEADING_SEL.test(r.selector) + && r.decls.some((d) => d.prop === 'font-size' && (maxPxIn(resolveVars(d.value, ctx.tokens)) ?? 0) >= 40); + if (!isH12 && !isDisplayClass) continue; + targets.push(r); + if (r.decls.some((d) => /^text-wrap(-style)?$/.test(d.prop) && /balance/.test(d.value))) satisfied = true; + } + if (targets.length && !satisfied) { + report('F3', 'WARN', targets[0].file, targets[0].line, + `no text-wrap: balance on any display head (${targets.length} head rule(s), e.g. ${trunc(targets[0].selector, 32)})`, + 'Add text-wrap: balance to h1/h2-level heads'); + } +} + +function checkF4(ctx) { + const BTN = /\b(btn|button|cta)\b|__(btn|button|cta)\b/i; + const filled = new Map(); + for (const r of mergedDeclsBySelector(ctx)) { + if (isTokenRule(r) || /:hover|:active|:focus|:disabled|\.is-|\[disabled/i.test(r.selector)) continue; + const first = baseSelector(r.selector.split(',')[0]); + if (!BTN.test(first)) continue; + for (const d of r.decls) { + if (!/^background(-color)?$/.test(d.prop)) continue; + const rv = resolveVars(d.value, ctx.tokens); + if (/transparent|none/i.test(rv)) continue; + if (/var\(\s*--color-(?!paper|rule|muted|focus)[\w-]+/.test(d.value) && !filled.has(first)) filled.set(first, { r, d }); + } + } + if (filled.size >= 2) { + const sels = [...filled.keys()]; + const second = filled.get(sels[1]); + report('F4', 'WARN', second.r.file, second.d.line, + `${filled.size} filled primary-button recipes: ${trunc(sels.join(' + '), 52)}`, + 'One filled primary per page; demote the rest to outline/quiet variants'); + } +} + +function checkF5(ctx) { + for (const r of mergedDeclsBySelector(ctx)) { + if (isTokenRule(r) || !/icon|\bico\b/i.test(r.selector)) continue; + const radius = r.decls.find((d) => d.prop === 'border-radius'); + if (!radius) continue; + const rv = resolveVars(radius.value, ctx.tokens); + const pct = /(\d+(?:\.\d+)?)%/.exec(rv); + const round = (pct && parseFloat(pct[1]) >= 50) || ((maxPxIn(rv) ?? 0) >= 999); + if (!round) continue; + const bg = r.decls.find((d) => /^background(-color)?$/.test(d.prop) + && !/^(none|transparent)$/i.test(resolveVars(d.value, ctx.tokens).trim())); + if (!bg) continue; + const small = r.decls.some((d) => (d.prop === 'width' || d.prop === 'height') + && (pxOf(resolveVars(d.value, ctx.tokens)) ?? 999) <= 64); + if (small) { + report('F5', 'WARN', r.file, bg.line, `icon-in-coloured-circle coin: ${trunc(r.selector, 40)}`, + 'Drop the tinted coin; set the icon at text size in currentColor'); + } + } +} + +function checkF6(ctx) { + const NUM_SEL = /\b(stat(?!ement)|price|table|figure|count|num)[\w-]*/i; + const hasTnum = (r) => r.decls.some((d) => d.prop === 'font-variant-numeric' + || (d.prop === 'font-feature-settings' && /tnum/.test(d.value))); + if (ctx.rules.some((r) => /^(html|body|:root)\b/i.test(r.selector.trim()) && hasTnum(r))) return; + const bySel = mergedDeclsBySelector(ctx); + const covered = new Set(bySel.filter(hasTnum).map((r) => baseSelector(r.selector))); + const warned = new Set(); + for (const r of bySel) { + if (isTokenRule(r) || !NUM_SEL.test(r.selector)) continue; + const base = baseSelector(r.selector); + if (warned.has(base) || covered.has(base)) continue; + const fs2 = r.decls.find((d) => d.prop === 'font-size'); + if (!fs2 || (maxPxIn(resolveVars(fs2.value, ctx.tokens)) ?? 0) < 24) continue; + warned.add(base); + report('F6', 'WARN', r.file, fs2.line, + `numeric selector ${trunc(base, 36)} at display size without tabular figures`, + 'Add font-variant-numeric: tabular-nums'); + } +} + +function checkF7(ctx) { + const byKey = new Map(); + for (const r of mergedDeclsBySelector(ctx)) { + if (isTokenRule(r) || /::(before|after)/.test(r.selector)) continue; + const get = (re) => { + const d = r.decls.filter((x) => re.test(x.prop)).pop(); + return d ? resolveVars(d.value, ctx.tokens).replace(/\s+/g, ' ').trim() : ''; + }; + const border = get(/^border$/) + || [get(/^border-width$/), get(/^border-style$/), get(/^border-color$/)].filter(Boolean).join(' '); + const radius = get(/^border-radius$/); + const surface = get(/^background(-color)?$/) || ''; + const shadow = get(/^box-shadow$/); + if (!radius || (!border && !surface && !shadow)) continue; + const key = [border, radius, surface, shadow].join(' | '); + if (!byKey.has(key)) byKey.set(key, { sels: new Set(), r }); + for (const part of r.selector.split(',')) byKey.get(key).sels.add(baseSelector(part)); + } + for (const v of byKey.values()) { + if (v.sels.size >= 6) { + report('F7', 'WARN', v.r.file, v.r.line, + `same container recipe on ${v.sels.size} selectors (${trunc([...v.sels].slice(0, 4).join(', '), 48)}...)`, + 'Vary weight, radius, or fill by role; not every box is the same box'); + } + } +} + +function checkF8(ctx) { + const famOf = (sel) => { + const m = /\.([a-z][\w-]*)/i.exec(sel) || /(^|[\s>+~])([a-z][\w-]*)/i.exec(sel); + const name = m ? (m[1] || m[2]) : sel; + return name.split('__')[0].split('--')[0].toLowerCase(); + }; + const NAVISH = /^(nav|header|topbar|masthead|banner)$/; + const timeline = new Map(), sticky = new Map(), animated = new Set(); + for (const r of ctx.rules) { + if (r.keyframes || isTokenRule(r)) continue; + for (const d of r.decls) { + if (d.prop === 'animation-timeline' && !/^(none|auto)$/i.test(d.value.trim()) + && !timeline.has(famOf(r.selector))) timeline.set(famOf(r.selector), { r, d }); + if (d.prop === 'animation' || d.prop === 'animation-name') animated.add(famOf(r.selector)); + if (d.prop === 'position' && /sticky/i.test(d.value)) sticky.set(famOf(r.selector), { r, d }); + } + } + const families = new Map(timeline); + for (const [fam, v] of sticky) { + if (!families.has(fam) && animated.has(fam) && !NAVISH.test(fam)) families.set(fam, v); + } + if (families.size > 1) { + const names = [...families.keys()]; + const second = families.get(names[1]); + report('F8', 'WARN', second.r.file, second.d.line, + `${families.size} scroll-choreography patterns on one page (${trunc(names.join(', '), 44)})`, + 'Budget is one scroll pattern per page (scroll-choreography.md); cut the rest'); + } +} + +function checkF9(ctx) { + const FAKE = /(i\.pravatar\.cc|pravatar\.cc|api\.dicebear\.com|dicebear\.com|randomuser\.me|thispersondoesnotexist\.com|ui-avatars\.com)/i; + const UNSPLASH = /https?:\/\/[^"'()\s]*unsplash\.com[^"'()\s]*/gi; + const PERSONY = /person|face|portrait|people|headshot/i; + const scan = (text, file, lineAt) => { + const f = FAKE.exec(text); + if (f) report('F9', 'FAIL', file, lineAt(f.index), `fake-human avatar service ${f[1]}`, + 'Drop the face, or use the real person\'s own photo; a generated stranger is fabricated social proof'); + for (const m of text.matchAll(UNSPLASH)) { + if (PERSONY.test(m[0])) report('F9', 'WARN', file, lineAt(m.index), + `stock person-keyword URL ${trunc(m[0], 44)}`, + 'Faces as social proof need real people; a stock face is a stranger'); + } + }; + for (const doc of ctx.docs) scan(doc.src, doc.file, (i) => doc.lineOf(i)); + for (const c of ctx.cssFiles) scan(c.raw, c.file, (i) => c.raw.slice(0, i).split('\n').length); +} + +function fontSizePxOf(r, ctx) { + const fs = r.decls.find((d) => d.prop === 'font-size'); + if (fs) return pxOf(resolveVars(fs.value, ctx.tokens)); + const f = r.decls.find((d) => d.prop === 'font'); + if (!f) return null; + const m = /(?:^|\s)(\d+(?:\.\d+)?(?:px|rem|em))(?:\/[\d.]+(?:px|rem|em)?)?\s/.exec(resolveVars(f.value, ctx.tokens) + ' '); + return m ? pxOf(m[1]) : null; +} + +const LABEL67 = /label|caption|meta|eyebrow|kicker|tag\b|badge|chip|small|folio|footnote|legend|\bth\b|thead|figcaption|overline|dateline|byline|credit|note\b|\bnav\b|menu|link|pill|status|unit|smallcaps|count|placard/i; +const CONTROL67 = /btn|button|cta|\.sign\b|plate|control/i; +const EXEMPT67_NAME = /^(wordmark|marquee|ticker|logo|brand|abbr|logo-?(mark|type|text)|brand-?(mark|name|type))$/i; +const EXEMPT67_PART = /(^|[-_])(wordmark|marquee|ticker|logotype|logo|brand)([-_]|$)|(^|[-_])(slab|nav|site|head|header|masthead|bar)[-_]+mark([-_]|$)/i; +const exemptName67 = (n) => !!n && (EXEMPT67_NAME.test(n.split('--')[0].split('__').pop()) || EXEMPT67_PART.test(n)); +const SCROLLER67 = /(^|[-_])(marquee|ticker)([-_]|$)/i; +function exempt67(sel) { + return sel.split(',').some((part) => { + const comps = baseSelector(part).split(/[\s>+~]+/).filter(Boolean); + const comp = comps[comps.length - 1] || ''; + const names = (comp.match(/\.[a-zA-Z_][\w-]*/g) || []).map((c) => c.slice(1)); + names.push((/^[a-zA-Z][\w-]*/.exec(comp) || [''])[0]); + if (names.some(exemptName67)) return true; + return comps.slice(0, -1).some((c) => (c.match(/\.[a-zA-Z_][\w-]*/g) || []).some((x) => SCROLLER67.test(x.slice(1)))); + }); +} +function inherited67(bySel, sel, prop) { + const base = baseSelector(sel); + let best = null, bestLen = 0; + for (const o of bySel) { + if (/:hover|:focus|:active/.test(o.selector) || (o.media && /max-width/i.test(o.media))) continue; + for (const part of o.selector.split(',')) { + const ob = baseSelector(part); + if (!ob || ob === base || ob.length <= bestLen || !base.startsWith(ob) || !/[\s>+~]/.test(base[ob.length] || '')) continue; + const d = o.decls.filter((x) => x.prop === prop).pop(); + if (d) { best = d.value; bestLen = ob.length; } + } + } + return best; +} +const isSmallCaps67 = (prop, v) => (/^font-variant(-caps)?$/.test(prop) && /\b(all-)?(small|petite)-caps\b/.test(v)) + || (prop === 'font-feature-settings' && /\b(smcp|c2sc)\b/.test(v)); +function check67(ctx) { + const bySel = mergedDeclsBySelector(ctx); + const displayish = (r) => HEADING_SEL.test(r.selector) || /display|title|headline|bill|poster|banner/i.test(r.selector) || r.decls.some((d) => (d.prop === 'font-family' || d.prop === 'font') && /--font-display/.test(d.value)) || (fontSizePxOf(r, ctx) || 0) >= 28; + const upperDisplay = bySel.some((r) => displayish(r) && !LABEL67.test(r.selector) && r.decls.some((d) => d.prop === 'text-transform' && /uppercase/.test(d.value))); + const isUpper = (v) => v != null && /uppercase/.test(resolveVars(v, ctx.tokens)); + const seen = new Set(); + for (const r of bySel) { + if (isTokenRule(r) || exempt67(r.selector) || /::first-letter\s*(,|$)/.test(r.selector)) continue; + const ownTT = r.decls.filter((d) => d.prop === 'text-transform').pop(); + const ownUpper = ownTT ? isUpper(ownTT.value) : null; + const ownSmallCaps = r.decls.some((d) => isSmallCaps67(d.prop, resolveVars(d.value, ctx.tokens))); + const px = fontSizePxOf(r, ctx); + const ownEm = trackingEmOf(ctx, r.decls, px || 16); + const ownSignal = ownUpper === true || ownSmallCaps || (ownEm != null && ownEm > 0.03); + if (!ownSignal) continue; + const upper = ownUpper != null ? ownUpper : isUpper(inherited67(bySel, r.selector, 'text-transform')); + const smallCaps = ownSmallCaps || ['font-variant', 'font-variant-caps', 'font-feature-settings'].some((prop) => { + const v = inherited67(bySel, r.selector, prop); + return v != null && isSmallCaps67(prop, resolveVars(v, ctx.tokens)); + }); + let em = ownEm; + if (em == null) { + const v = inherited67(bySel, r.selector, 'letter-spacing'); + if (v != null) em = trackingEmOf(ctx, [{ prop: 'letter-spacing', value: v }], px || 16); + } + const tracked = em != null && em > 0.03; + const subject = r.selector.split(',').map((p) => baseSelector(p).split(/[\s>+~]+/).filter(Boolean).pop() || ''); + const bigToken = r.decls.some((d) => d.prop === 'font-size' && /--text-(display|section|title)|clamp\(\s*(?:[2-9]|\d{2,})(?:\.\d+)?rem/.test(d.value)); + const labelish = subject.some((s) => LABEL67.test(s)) ? !((px != null && px >= 28) || bigToken) + : LABEL67.test(r.selector) && !subject.every((s) => /^h[1-6]\b/i.test(s)) && (px == null || px < 20); + const control = CONTROL67.test(r.selector); + const heading = HEADING_SEL.test(r.selector) && !labelish; + if (heading && !control) continue; + const key = baseSelector(r.selector); + if (seen.has(key)) continue; + const small = px != null && px <= 15; + if (control && !labelish) { + if (!upper && !smallCaps) { if (!(tracked && small)) continue; } + else if (upperDisplay && (em == null || em <= 0.045)) continue; + seen.add(key); + report(67, 'FAIL', r.file, r.line, upperDisplay ? `${r.selector}: uppercase control tracked ${em}em` : `${r.selector}: uppercase control on a page whose display is not uppercase`, 'Controls follow the display voice: sentence case here, or tracking 0.04em at most where the display itself is uppercase'); + continue; + } + const caps = upper || smallCaps; + if ((caps && (labelish || smallCaps || tracked || small)) || (tracked && (labelish || small))) { + seen.add(key); + const what = smallCaps ? 'small caps' : upper ? 'uppercase' : 'letter-spaced'; + report(67, 'FAIL', r.file, r.line, `${r.selector}: ${what}${tracked ? ` tracked ${em}em` : ''}${px != null ? ` at ${Math.round(px)}px` : ''} in a label role`, 'Labels, captions, table heads, nav links and meta are the body face (or the theme\'s label face), a step smaller, sentence case, untracked'); + } + } + check67Html(ctx); +} + +const CAPS_TAGS = /^(p|span|small|a|li|div|figcaption|td|th|dt|dd|label|time|cite|strong|b|em|button|summary)$/; +function check67Html(ctx) { + for (const doc of ctx.docs) { + const anc = ancestorMap(doc); + const seen = new Set(); + for (let i = 0; i < doc.tags.length; i++) { + const t = doc.tags[i]; + if (t.close || t.selfClosing || !CAPS_TAGS.test(t.name)) continue; + const cls = getAttr(t.attrs, 'class') || ''; + if (cls.split(/\s+/).some(exemptName67)) continue; + if ((anc.get(i) || []).some((n) => /^(svg|pre|code|abbr|kbd|samp)$/.test(n))) continue; + const inner = innerOf(doc, i); + if (!inner || /<(p|div|ul|ol|h[1-6]|table|section|article|svg|img|abbr|code|kbd)\b/i.test(inner.inner)) continue; + const text = plainText(inner.inner); + const letters = text.replace(/[^A-Za-z]/g, ''); + if (letters.length < 5 || capsRatio(text) < 0.95 || /^[A-Z]{2,5}$/.test(text) || /^\(?\s*(CC0|CC BY(-SA|-NC|-ND)*( [0-9.]+)?|PD|GFDL)\b/.test(text)) continue; + const decls = styleFor(ctx, cls, t.name); + const px = fontPxOf(ctx, decls); + const em = trackingEmOf(ctx, decls, px || 16); + const tracked = em != null && em > 0.03; + if (!((px != null && px <= 15) || tracked)) continue; + const key = cls || t.name; + if (seen.has(key)) continue; + seen.add(key); + report(67, 'FAIL', doc.file, t.line, `"${trunc(text, 32)}" typed in capitals${px != null ? ` at ${Math.round(px)}px` : ''}${tracked ? ` tracked ${em}em` : ''} (<${t.name}${cls ? ` class="${trunc(cls, 24)}"` : ''}>)`, 'Sentence case in the body face; capitals survive only as a wordmark or as the display voice'); + } + } +} + +const ACCENT38 = /(?:^|[\s,])((?:h[1-3]|\.display|\.headline|\.title|[.\w-]*__(?:title|display|headline))[^\s,>+~]*)\s*(?:>|\s)\s*(em|i|b|strong|span|mark|\.[\w-]+)(?::nth-child\([^)]*\))?(?:::?[\w-]+)?\s*$/i; +const INHERITED38 = /^(inherit|currentcolor|unset|initial|normal)$/i; +function accentedHeads(ctx) { + if (ctx._acc38) return ctx._acc38; + const out = []; + const seen = new Set(); + for (const r of ctx.rules) { + if (r.keyframes || isTokenRule(r)) continue; + const m = ACCENT38.exec(r.selector); + if (!m) continue; + const marked = r.decls.some((d) => + (/^(color|background|background-color|-webkit-text-stroke|font-weight|text-decoration|text-decoration-color|border-bottom|box-shadow)$/.test(d.prop) && !INHERITED38.test(d.value.trim())) + || (d.prop === 'font-style' && !INHERITED38.test(d.value.trim()))); + if (!marked || seen.has(r.selector)) continue; + seen.add(r.selector); + out.push({ r, head: m[1] }); + } + const marks = (r) => r.decls.some((d) => (/^(color|background|background-color|-webkit-text-stroke|font-weight|text-decoration|text-decoration-color|border-bottom|box-shadow|font-style)$/.test(d.prop) && !INHERITED38.test(d.value.trim()))); + for (const doc of ctx.docs) { + for (let i = 0; i < doc.tags.length; i++) { + const t = doc.tags[i]; + if (t.close || !/^h[1-3]$/.test(t.name)) continue; + const inner = innerOf(doc, i); + if (!inner) continue; + const headLen = plainText(inner.inner).replace(/\s+/g, '').length || 1; + const spans = [...inner.inner.matchAll(/<(span|em|strong|b|i|mark)\b[^>]*\bclass\s*=\s*["']([^"']+)["'][^>]*>([\s\S]*?)<\/\1>/gi)]; + const cover = (cls) => spans.filter((x) => x[2].split(/\s+/).includes(cls)).reduce((n, x) => n + plainText(x[3]).replace(/\s+/g, '').length, 0) / headLen; + for (const m of spans) { + if (!/[A-Za-z0-9]/.test(plainText(m[3]))) continue; + for (const cls of m[2].split(/\s+/).filter(Boolean)) { + if (cover(cls) >= 0.8) continue; + for (const r of ctx.rules) { + if (r.keyframes || isTokenRule(r) || seen.has(r.selector)) continue; + if (!r.selector.split(',').some((part) => !/::?(before|after)\b/.test(part) && baseSelector(part).trim() === `.${cls}`)) continue; + if (r.decls.some((d) => (d.prop === 'display' && /^(block|flex|grid|table)/.test(d.value.trim())) || (d.prop === 'position' && /absolute|fixed/.test(d.value)))) continue; + if (!marks(r)) continue; + const headDecls = styleFor(ctx, getAttr(t.attrs, 'class'), t.name, true); + const norm = (v) => String(v || '').replace(/\s+/g, ' ').trim().toLowerCase(); + const own = (prop) => declValue(ctx, headDecls, prop) ?? (prop === 'color' ? resolveVars('var(--color-ink)', ctx.tokens) : null); + const marking = r.decls.filter((d) => /^(color|background|background-color|-webkit-text-stroke|font-weight|text-decoration|text-decoration-color|border-bottom|box-shadow|font-style)$/.test(d.prop) && !INHERITED38.test(d.value.trim())); + if (marking.length && marking.every((d) => /^(color|font-weight)$/.test(d.prop) && own(d.prop) != null && norm(resolveVars(d.value, ctx.tokens)) === norm(own(d.prop)))) continue; + seen.add(r.selector); + out.push({ r, head: t.name }); + } + } + } + } + } + ctx._acc38 = out; + return out; +} +function accentedWordInHero(ctx) { + const heads = accentedHeads(ctx); + if (!heads.length) return true; + const sels = new Set(heads.map((h) => baseSelector(h.r.selector))); + if (sels.size > 1) return `the accented word sits on ${sels.size} selectors (${trunc([...sels].join(', '), 48)}); the signature appears once`; + const { r, head } = heads[0]; + if (/hero/i.test(r.selector) || /^h1\b/i.test(head)) return true; + const cls = (/\.([\w-]+)/.exec(head) || [])[1]; + if (!cls || !ctx.docs.length) return true; + let count = 0, aboveFirstH2 = false; + for (const doc of ctx.docs) { + let h2Seen = false; + for (const t of doc.tags) { + if (t.close) continue; + if (t.name === 'h2') h2Seen = true; + if ((getAttr(t.attrs, 'class') || '').split(/\s+/).includes(cls)) { count++; if (!h2Seen) aboveFirstH2 = true; } + } + } + if (count === 1 && aboveFirstH2) return true; + return count !== 1 ? `.${cls} appears ${count} times in the markup; the signature appears once, in the hero` : `.${cls} sits below the first h2, outside the hero`; +} +function check38c(ctx) { + for (const { r } of accentedHeads(ctx)) { + report('38iii', 'FAIL', r.file, r.line, `accented word inside a heading (${r.selector})`, 'Set the whole head one way: a line break, a second line at a second size, or the whole head in the accent. Guard: the theme names the coloured word as its signature and it appears once on the page, in the hero'); + } +} + +function heroIndexOf(doc, h1Idx) { + for (let i = h1Idx - 1; i >= 0; i--) { + const t = doc.tags[i]; + if (t.close || !/^(section|header)$/.test(t.name)) continue; + const inner = innerOf(doc, i); + if (inner && inner.endPos > doc.tags[h1Idx].pos) return i; + } + return -1; +} +const wordsOf = (t) => plainText(t).split(/\s+/).filter((w) => /[A-Za-z0-9]/.test(w)); + +const TELLS19 = [ + [/\bwhether you'?re\b/i, 'filler opener'], + [/\bwe'?ve got you covered\b/i, 'cliche'], + [/\bsay goodbye to\b/i, 'cliche'], + [/\bno credit card required\b/i, 'template line'], + [/\beverything you need to\b/i, 'cliche'], + [/\ball in one place\b/i, 'cliche'], + [/\blorem ipsum\b/i, 'placeholder text'], + [/\ball rights reserved\b/i, 'template footer line'], + [/\bmade with\s*(?:♥|❤|\u{1f9e1}|\u{1f49b}|\u{1f49a}|\u{1f499}|\u{1f49c}|\u{1f5a4}|\u{1f90d}|♥|♥|❤|<3)/iu, 'made with a heart'], +]; +function check19Tells(ctx) { + for (const doc of ctx.docs) { + const prose = maskedProse(doc); + const lines = new Set(); + const tell = (idx, what, text) => { + const line = doc.lineOf(idx); + if (lines.has(line)) return; + lines.add(line); + report(19, what === 'template footer line' ? 'WARN' : 'FAIL', doc.file, line, `${what}: "${trunc(text, 40)}"`, what === 'template footer line' ? 'A stock line with no legal effect; cut it unless the owner wants it' : 'Say what the product does, in its own nouns'); + }; + for (const [re, what] of TELLS19) { + const m = re.exec(prose); + if (m) tell(m.index, what, m[0]); + } + const stock = []; + for (let i = 0; i < doc.tags.length; i++) { + const t = doc.tags[i]; + if (t.close || t.name !== 'a') continue; + const label = plainText(innerOf(doc, i)?.inner || '').replace(/[\u2192\u203a\u00bb]|->/g, '').trim(); + if (/^(learn more|read more|find out more|click here|more info|see more)$/i.test(label)) stock.push({ t, label }); + } + if (stock.length >= 2) report(19, 'WARN', doc.file, stock[0].t.line, `stock link label "${stock[0].label}" x${stock.length}`, 'Say where each link goes: the thing it opens, in its own noun'); + for (let i = 0; i < doc.tags.length; i++) { + const t = doc.tags[i]; + if (t.close || !/^h[1-6]$/.test(t.name)) continue; + const text = plainText(innerOf(doc, i)?.inner || ''); + if (/^Meet\s+[A-Z][\w-]*[.!]?$/.test(text)) tell(t.pos, 'the "Meet " heading', text); + else if (/^[A-Z][a-z]+\.\s+[A-Z][a-z]+\.\s+[A-Z][a-z]+\.$/.test(text)) tell(t.pos, 'the three-word triad heading', text); + } + } +} + +function check58Static(ctx) { + for (const doc of ctx.docs) { + const h1 = doc.tags.findIndex((t) => !t.close && t.name === 'h1'); + if (h1 >= 0) { + const words = wordsOf(innerOf(doc, h1)?.inner || ''); + if (words.length > 7) report(58, 'WARN', doc.file, doc.tags[h1].line, `h1 runs ${words.length} words ("${trunc(words.join(' '), 40)}")`, 'Seven words or fewer, 50 characters or fewer'); + const heroIdx = heroIndexOf(doc, h1); + const hero = heroIdx >= 0 ? innerOf(doc, heroIdx) : null; + if (hero) { + for (let i = h1 + 1; i < doc.tags.length && doc.tags[i].pos < hero.endPos; i++) { + const t = doc.tags[i]; + if (t.close || t.name !== 'p') continue; + const pw = wordsOf(innerOf(doc, i)?.inner || ''); + if (pw.length > 12) report(58, 'WARN', doc.file, t.line, `hero paragraph runs ${pw.length} words`, 'One sentence, twelve words or fewer'); + break; + } + } + } + const sections = doc.tags.filter((t) => !t.close && t.name === 'section').length; + const fullPage = sections >= 5 || doc.tags.some((t) => !t.close && t.name === 'footer'); + if (!fullPage || doc.kind !== 'html') continue; + const countWords = (t) => t.split(/\s+/).filter((w) => /[A-Za-z0-9]/.test(w)).length; + let hiddenWords = 0, hiddenEnd = -1; + for (let i = 0; i < doc.tags.length; i++) { + const t = doc.tags[i]; + if (t.close || t.selfClosing || t.pos < hiddenEnd) continue; + const cls = getAttr(t.attrs, 'class') || ''; + if (!(/(^|\s)(sr-only|visually-hidden|screen-reader-text|skip|skip-link)(\s|$)/i.test(cls) || /aria-hidden\s*=\s*["']?true/i.test(t.attrs) || /(^|\s)hidden(\s|=|$)/i.test(t.attrs) || /(^|\s)data-credits(\s|=|$)/i.test(t.attrs))) continue; + const inner = innerOf(doc, i); + if (!inner) continue; + hiddenWords += countWords(plainText(inner.inner)); + hiddenEnd = inner.endPos; + } + const total = countWords(doc.text) - hiddenWords; + if (total > 450) report(58, 'WARN', doc.file, 1, `${total} visible words on the page (450 at most)`, 'Cut copy: one idea per screen, sections become objects'); + } +} + +const SECOND_CTA = /^(learn more|see how it works|watch (the )?demo|get started|book a demo)$/i; +function check42TwoButton(ctx) { + for (const doc of ctx.docs) { + const h1 = doc.tags.findIndex((t) => !t.close && t.name === 'h1'); + if (h1 < 0) continue; + const heroIdx = heroIndexOf(doc, h1); + const hero = heroIdx >= 0 ? innerOf(doc, heroIdx) : null; + if (!hero) continue; + const anc = ancestorMap(doc); + const controls = []; + for (let i = heroIdx + 1; i < doc.tags.length && doc.tags[i].pos < hero.endPos; i++) { + const t = doc.tags[i]; + if (t.close || t.selfClosing || !(t.name === 'button' || t.name === 'a')) continue; + const cls = getAttr(t.attrs, 'class') || ''; + if (t.name === 'a' && !/btn|cta|button/i.test(cls)) continue; + if ((anc.get(i) || []).includes('nav')) continue; + controls.push({ t, cls, label: plainText(innerOf(doc, i)?.inner || '').trim() }); + } + if (controls.length < 2) continue; + const fillOf = (c) => { const decls = styleFor(ctx, c.cls, c.t.name, true); let raw = null; for (const d of decls) if (d.prop === 'background-color' || d.prop === 'background') raw = d.value; if (!raw || /--color-paper\b/.test(raw)) return false; const bg = resolveVars(raw, ctx.tokens); return !/^(none|transparent|inherit|initial|unset)$/i.test(bg.trim()) && !/transparent/i.test(bg) && !/var\(--color-paper/.test(raw); }; + const firstFilled = fillOf(controls[0]); + if (firstFilled && fillOf(controls[1])) { report('F4', 'WARN', doc.file, controls[1].t.line, `two filled buttons side by side in the hero: "${trunc(controls[0].label, 20)}" and "${trunc(controls[1].label, 20)}"`, 'One filled primary per screen; the second action is outlined or a typographic link'); continue; } + if (!SECOND_CTA.test(controls[1].label) || !firstFilled) continue; + report(19, 'WARN', doc.file, controls[1].t.line, `the stock second action in the hero: "${trunc(controls[0].label, 20)}" then "${controls[1].label}"`, 'One action in the hero; the second button is the template speaking'); + } +} + +const PLACEHOLDER_IMG = /placehold\.co|via\.placeholder\.com|source\.unsplash\.com\/random|dummyimage\.com/i; +function check68(ctx) { + for (const doc of ctx.docs) { + if (doc.kind !== 'html') continue; + const slots = []; + for (let i = 0; i < doc.tags.length; i++) { + const t = doc.tags[i]; + if (t.close || !/\bdata-slot\s*=/.test(t.attrs)) continue; + const inner = t.selfClosing ? null : innerOf(doc, i); + if (inner && /]*\bsrc\s*=\s*["'][^"']+["']/i.test(inner.inner)) continue; + if (inner && (inner.inner.match(/<[a-z][\w-]*\b[^>]*>\s*[^<\s]/gi) || []).length >= 6) continue; + let hiddenUp = false; + for (let k = i - 1, d = 0; k >= 0 && !hiddenUp; k--) { const u = doc.tags[k]; if (u.selfClosing) continue; if (u.close) { d++; continue; } if (d > 0) { d--; continue; } if (/(?:^|\s)hidden(?:\s|=|$)/.test(u.attrs)) hiddenUp = true; } + if (hiddenUp) continue; + slots.push({ i, t }); + } + if (slots.length && !ctx.docs.some((d) => d.kind !== 'html') && !/hallmarkSlots/.test(doc.src) && !ctx.docs.some((d) => d !== doc && /hallmarkSlots/.test(d.src))) report('F18', 'WARN', doc.file, slots[0].t.line, `${slots.length} slot${slots.length > 1 ? 's' : ''} and no slot script`, 'Paste the hallmarkSlots script the scaffold printed before , so the user\'s images drop in (imagery.md § 3)'); + if (slots.length > 5) report(68, 'FAIL', doc.file, slots[5].t.line, `${slots.length} empty slots on one page`, 'Two to four slots carry a page; set the rest in type, names and facts in a list or table'); + const byRun = new Map(); + for (const sl of slots) { + let depth = 0, parentIdx = -1; + for (let k = sl.i - 1; k >= 0; k--) { const t = doc.tags[k]; if (t.selfClosing) continue; if (t.close) depth++; else if (depth === 0) { parentIdx = k; break; } else depth--; } + const up = (from) => { let d = 0; for (let k = from - 1; k >= 0; k--) { const t = doc.tags[k]; if (t.selfClosing) continue; if (t.close) d++; else if (d === 0) return k; else d--; } return -1; }; + const gp = parentIdx >= 0 ? up(parentIdx) : -1; + const ggp = gp >= 0 ? up(gp) : -1; + for (const key of new Set([parentIdx, gp, ggp])) { if (key < 0) continue; byRun.set(key, (byRun.get(key) || 0) + 1); } + } + for (const [key, n] of byRun) if (n >= 4) { report(68, 'FAIL', doc.file, doc.tags[key].line, `${n} empty slots in one row or grid`, 'A set the page has no pictures of is set in type with one slot at most'); break; } + } +} + +const FACT69 = /(?:[£$€¥]\s?\d[\d,.]*|\d[\d,.]*\s?(?:pm|am|MAD|kg|g|ml|km|mi|miles|%)\b|\b\d{1,2}:\d{2}\b)/gi; +const REGION69 = /^(section|header|footer|article|aside|nav|form|dialog)$/; +function check69(ctx) { + for (const doc of ctx.docs) { + if (doc.kind !== 'html') continue; + const bodyAt = doc.tags.findIndex((t) => !t.close && t.name === 'body'); + const stack = []; + const seen = new Map(); + let uid = 0; + const regionOf = () => { + const r = stack.find((e) => REGION69.test(e.name)); + if (r) return r.id; + const band = stack.find((e, i) => i > 0 && (stack[i - 1].name === 'body' || stack[i - 1].name === 'main') && e.name !== 'main'); + return band ? band.id : 'root'; + }; + for (let i = Math.max(bodyAt, 0); i < doc.tags.length; i++) { + const t = doc.tags[i]; + if (t.close) { const at = stack.map((e) => e.name).lastIndexOf(t.name); if (at >= 0) stack.length = at; } + else if (!t.selfClosing) stack.push({ name: t.name, id: uid++ }); + const next = doc.tags[i + 1]; + if (/^(script|style|template|noscript)$/.test(t.name) && !t.close) continue; + const chunk = doc.masked.slice(t.end, next ? next.pos : doc.masked.length) + .replace(/£/g, '£').replace(/€/g, '€').replace(/ | /g, ' '); + if (!chunk.trim()) continue; + const region = regionOf(); + for (const f of chunk.match(FACT69) || []) { + const k = f.replace(/\s+/g, '').toLowerCase(); + if (!seen.has(k)) seen.set(k, new Set()); + seen.get(k).add(region); + } + } + const loud = [...seen].map(([k, s]) => [k, s.size]).filter(([, n]) => n >= 4).sort((a, b) => b[1] - a[1]); + if (loud.length) report(69, 'WARN', doc.file, 1, `the same fact printed in ${loud[0][1]} sections: ${loud.slice(0, 3).map(([k, n]) => `${k} (${n})`).join(', ')}`, 'Say each fact once, where it does work; cut the restatements'); + } +} + +function check70(ctx) { + const SUCCESS = /\b(sent|thanks|thank you|reserved|booked|on the list|subscribed|in touch|received|confirmed|ordered|chosen|on its way|signed up|all set|you're in|you are in|done)\b/i; + const NEG = /\b(not|nothing|no|never|isn't|wasn't|didn't|cannot|can't|failed|try again|soon)\b/i; + for (const doc of ctx.docs) { + const js = (doc.scripts && typeof doc.scripts === 'string') ? doc.scripts : (doc.src.match(/]*>([\s\S]*?)<\/script>/gi) || []).join('\n'); + if (!/= 2 && SUCCESS.test(head) && !NEG.test(str)) { m = [x[0]]; break; } + } + if (!m) continue; + if (/\bfetch\s*\(|XMLHttpRequest|navigator\.sendBeacon|\.submit\s*\(\s*\)|axios|\$\.ajax/.test(js)) continue; + report(70, 'WARN', doc.file, doc.lineOf ? doc.lineOf(doc.src.indexOf(m[0]) >= 0 ? doc.src.indexOf(m[0]) : 0) : 1, `a script prints success ("${trunc(m[0].replace(/["'`]/g, ''), 30)}") with no request behind it`, 'No success state until the form posts somewhere; an empty data-endpoint and a handoff note'); + } +} + +function check47Placeholders(ctx) { + for (const doc of ctx.docs) { + const m = PLACEHOLDER_IMG.exec(doc.src); + if (m) report('47c', 'WARN', doc.file, doc.lineOf(m.index), `placeholder image service ${m[0]}`, 'A labelled data-slot in the theme colours, or a real asset'); + } + for (const c of ctx.cssFiles) { + const m = PLACEHOLDER_IMG.exec(c.raw); + if (m) report('47c', 'WARN', c.file, c.raw.slice(0, m.index).split('\n').length, `placeholder image service ${m[0]}`, 'A labelled data-slot in the theme colours, or a real asset'); + } +} + +const TAILWIND_HEX = /#(0f172a|1e293b|6366f1|8b5cf6|3b82f6|f8fafc|64748b)\b/i; +function check65Tailwind(ctx) { + for (const r of ctx.rules) { + if (!isTokenRule(r) || r.selector === '@font-face') continue; + for (const d of r.decls) { + const m = TAILWIND_HEX.exec(d.value); + if (m) report(74, 'WARN', r.file, d.line, `default Tailwind palette ${m[0]} on ${d.prop}`, 'Mix the colour for this page in OKLCH; a stock swatch is the AI look'); + } + } +} + +function splitTop(v) { + const out = []; + let depth = 0, cur = ''; + for (const ch of v) { + if (ch === '(') depth++; + if (ch === ')') depth--; + if (ch === ',' && depth === 0) { out.push(cur); cur = ''; } else cur += ch; + } + if (cur.trim()) out.push(cur); + return out; +} +const COLOR_RE = /#[0-9a-fA-F]{3,8}\b|oklch\([^)]*\)|rgba?\([^)]*\)|hsla?\([^)]*\)|color-mix\((?:[^()]|\([^()]*\))*\)|\b(white|black|transparent)\b/i; +const lengthPx = (x) => (x === '0' ? 0 : pxOf(x)); +function check29Glow(ctx) { + const seen = new Set(); + const once = (key, file, line, ev, fix) => { if (seen.has(key)) return; seen.add(key); report(29, 'WARN', file, line, ev, fix); }; + for (const r of mergedDeclsBySelector(ctx)) { + if (isTokenRule(r)) continue; + const local = {}; + for (const d of r.decls) if (d.prop.startsWith('--')) local[d.prop] = d.value; + const bf = r.decls.find((d) => /^(-webkit-)?backdrop-filter$/.test(d.prop) && /blur\(/i.test(d.value)); + if (bf) { + const bgD = r.decls.filter((d) => /^background(-color)?$/.test(d.prop)).pop(); + const rv = bgD ? resolveVars(bgD.value, ctx.tokens, local).trim() : ''; + const c = parseColor(rv); + const mixed = /color-mix\([^)]*\b(white|black|--color-(paper|ink))\b[^)]*\btransparent\b/i.test(rv); + const nearWhite = c && c.r > 0.85 && c.g > 0.85 && c.b > 0.85; + const nearBlack = c && c.r < 0.15 && c.g < 0.15 && c.b < 0.15; + if ((c && c.alpha < 0.95 && (nearWhite || nearBlack)) || (!c && mixed)) { + once('glass:' + r.selector, r.file, bf.line, `glass panel: backdrop-filter blur over a translucent ${nearBlack ? 'black' : 'white'} on ${trunc(r.selector, 36)}`, 'Solid or grained surface; elevation by lightness'); + } + } + for (const d of r.decls) { + if (d.prop !== 'box-shadow') continue; + for (const part of splitTop(resolveVars(d.value, ctx.tokens, local))) { + const cm = COLOR_RE.exec(part); + if (!cm) continue; + const c = parseColor(cm[0]); + if (!c || c.alpha <= 0.05) continue; + const ok = c.okl || srgbToOklch(c); + if (ok.C <= 0.04) continue; + const lens = part.replace(cm[0], ' ').replace(/\binset\b/, ' ').trim().split(/\s+/).filter(Boolean).map(lengthPx); + if (lens.length >= 3 && lens[0] === 0 && lens[1] === 0 && lens[2] != null && lens[2] > 20) { + once('glow:' + r.selector, r.file, d.line, `chromatic zero-offset glow (blur ${Math.round(lens[2])}px) on ${trunc(r.selector, 36)}`, 'Shadows carry offset and blur in a neutral; colour is not depth'); + break; + } + } + } + if (/::(before|after)/.test(r.selector) && r.decls.some((d) => d.prop === 'position' && /absolute|fixed/.test(d.value))) { + const f = r.decls.find((d) => d.prop === 'filter' && /blur\(\s*(\d+(?:\.\d+)?)px/i.test(d.value)); + const n = f ? parseFloat(/blur\(\s*(\d+(?:\.\d+)?)px/i.exec(f.value)[1]) : 0; + if (n > 40) once('orb:' + r.selector, r.file, f.line, `blurred orb: filter blur(${n}px) on the positioned ${trunc(r.selector, 36)}`, 'Delete the wash; a surface is paper or ground, not a light show'); + } + } +} + +function check11Lift(ctx) { + const lifts = new Map(); + for (const r of mergedDeclsBySelector(ctx)) { + if (!/:hover/.test(r.selector)) continue; + const t = r.decls.find((d) => (d.prop === 'transform' && /translateY\(\s*-\s*\d/.test(resolveVars(d.value, ctx.tokens))) || (d.prop === 'translate' && /^0(px)?\s+-\d/.test(resolveVars(d.value, ctx.tokens)))); + const sh = r.decls.find((d) => d.prop === 'box-shadow'); + if (t && sh) for (const part of r.selector.split(',')) lifts.set(baseSelector(part), { r, t }); + } + if (lifts.size < 3) return; + const third = [...lifts.values()][2]; + report(11, 'WARN', third.r.file, third.t.line, `the hover lift (translateY plus shadow) on ${lifts.size} selectors (${trunc([...lifts.keys()].slice(0, 3).join(', '), 44)})`, 'One signal per element; the same lift on every card is the template'); +} + +function check15Fade(ctx) { + const focusProps = new Map(); + for (const r of ctx.rules) { + if (!/:focus-visible/.test(r.selector)) continue; + for (const part of r.selector.split(',')) { + if (!/:focus-visible/.test(part)) continue; + const base = baseSelector(part).replace(/^\*$/, ''); + const set = focusProps.get(base) || new Set(); + for (const d of r.decls) { + if (d.prop === 'box-shadow') set.add('box-shadow'); + if (/^outline/.test(d.prop)) set.add('outline'); + } + focusProps.set(base, set); + } + } + if (!focusProps.size) return; + const global = focusProps.get('') || new Set(); + for (const r of ctx.rules) { + if (r.keyframes || /:focus|:hover|:active/.test(r.selector)) continue; + for (const d of r.decls) { + if (d.prop !== 'transition' && d.prop !== 'transition-property') continue; + for (const prop of ['box-shadow', 'outline']) { + if (!new RegExp(`(^|[\\s,])${prop}(-[a-z]+)?\\b`).test(d.value)) continue; + const own = r.selector.split(',').some((p) => (focusProps.get(baseSelector(p)) || new Set()).has(prop)); + if (global.has(prop) || own) { + report(15, 'FAIL', r.file, d.line, `${trunc(r.selector, 32)} transitions ${prop} while :focus-visible sets it (the ring fades in)`, 'Rings appear instantly: transition the hover property only, or draw the ring with a property that is not transitioned'); + break; + } + } + } + } +} + +function checkF7Pills(ctx) { + const CONTROLISH = /btn|button|cta|input|select|textarea|switch|toggle|control|chip|pill|tag|badge|status/i; + const sels = new Set(); + let where = null; + for (const r of mergedDeclsBySelector(ctx)) { + if (isTokenRule(r)) continue; + const d = r.decls.filter((x) => x.prop === 'border-radius').pop(); + if (!d) continue; + if (!/^(9999px|999px|50rem)$/.test(resolveVars(d.value, ctx.tokens).trim())) continue; + for (const part of r.selector.split(',')) { + const b = baseSelector(part); + if (!b || CONTROLISH.test(b)) continue; + sels.add(b); + where = where || { r, d }; + } + } + if (sels.size >= 5) report('F7', 'WARN', where.r.file, where.d.line, `the pill radius on ${sels.size} non-control selectors (${trunc([...sels].slice(0, 4).join(', '), 48)})`, 'Pills are for controls; boxes and media take the card radius'); +} + +const TW_SIZE = { xs: 12, sm: 14, base: 16, lg: 18, xl: 20, '2xl': 24, '3xl': 30, '4xl': 36, '5xl': 48, '6xl': 60, '7xl': 72, '8xl': 96, '9xl': 128 }; +const TW_TRACK = { tighter: -0.05, tight: -0.025, normal: 0, wide: 0.025, wider: 0.05, widest: 0.1 }; +const TW_HUE = { red: 25, orange: 47, amber: 70, yellow: 86, lime: 131, green: 150, emerald: 163, teal: 183, cyan: 215, sky: 237, blue: 260, indigo: 277, violet: 293, purple: 304, fuchsia: 322, pink: 354, rose: 16 }; +const TW_COLOURS = 'slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose'; +const TW_PAL = new RegExp(`^(?:bg|text|border(?:-[xytrblse])?|ring(?:-offset)?|outline|decoration|divide|from|via|to|fill|stroke|shadow|accent|caret|placeholder|inset-shadow|inset-ring|drop-shadow)-(?:${TW_COLOURS})-(?:50|[1-9]00|950)(?:\\/(?:\\d{1,3}|\\[[^\\]]*\\]))?$`); +const TW_SHADE = new RegExp(`^(${TW_COLOURS})-(?:50|[1-9]00|950)(?:\\/\\S*)?$`); +const TW_ACCENT = /^text-(?:red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)-(?:500|600|700)(?:\/\S*)?$/; +const TW_PURPLE = /^(?:purple|violet|fuchsia|indigo)$/; +const TW_BLUE = /^(?:blue|sky|cyan|indigo)$/; +const TW_PINK = /^(?:pink|rose)$/; +const TW_GREY = /^(?:slate|gray|zinc|neutral|stone)$/; +const TW_NONFILL = /^bg-(?:none|transparent|inherit|current|fixed|local|scroll|cover|contain|auto|center|top|bottom|left|right|no-repeat|repeat(?:-[\w-]+)?|(?:left|right|top|bottom)-(?:top|bottom|left|right)|clip-[\w-]+|origin-[\w-]+|blend-[\w-]+|gradient-to-[\w-]+|(?:linear|radial|conic)(?:-.*)?|size-.*|position-.*|\[(?:url|length|position|size|image|(?:repeating-)?(?:linear|radial|conic)-gradient)[^\]]*\].*)$/; +const TW_GLASS = /^bg-(?:white|black|(?:slate|gray|zinc|neutral|stone)-(?:50|100|900|950)|paper|ink|background|foreground)\/(\d{1,2}|\[(?:0?\.\d+|\d{1,2}%)\])$/; +const TW_MONO = /mono|courier|jetbrains|plex mono|geist mono|commit|fira code|space mono|dm mono|roboto mono|source code|silkscreen/i; +const TW_LOGO = /logo|brand|wordmark/i; +const TW_ROOT = { size: null, em: null, upper: false, caps: false, noLabel: false, code: false, eyeSkip: false, inOl: false, logo: false, logoSelf: false }; +const TW_PARSED = new Map(); + +function twParse(tok) { + let p = TW_PARSED.get(tok); + if (p) return p; + const variants = []; + let depth = 0, cur = ''; + for (const ch of tok) { + if (ch === '[' || ch === '(') depth++; + else if ((ch === ']' || ch === ')') && depth > 0) depth--; + if (ch === ':' && depth === 0) { variants.push(cur); cur = ''; } else cur += ch; + } + let base = cur; + if (base.startsWith('!')) base = base.slice(1); + if (base.endsWith('!')) base = base.slice(0, -1); + const neg = base.length > 1 && base.startsWith('-'); + if (neg) base = base.slice(1); + p = { variants: variants.map((v) => v.replace(/^(?:group|peer)-/, '').replace(/\/[\w-]+$/, '')), base, neg }; + TW_PARSED.set(tok, p); + return p; +} + +const twTokens = (ctx) => ctx.twTok || ctx.tokens; +const twValue = (tok, v) => resolveVars(v, tok).trim().replace(/^(-?)\./, '$10.'); + +function twSize(ctx, b) { + const tok = twTokens(ctx); + let m = /^text-(xs|sm|base|lg|[2-9]?xl)(?:\/\S+)?$/.exec(b); + if (m) return TW_SIZE[m[1]]; + m = /^text-(?:\[(?:length:)?([^\]]+)\]|\((?:length:)?(--[\w-]+)\))(?:\/\S+)?$/.exec(b); + let v = m ? (m[1] ? m[1].replace(/_/g, ' ') : `var(${m[2]})`) : null; + if (!m) { + m = /^text-([a-z][\w-]*?)(?:\/\S+)?$/.exec(b); + v = m && tok[`--text-${m[1]}`]; + } + if (!v) return null; + const r = twValue(tok, v); + const cl = /^clamp\(\s*([^,]+),/.exec(r); + return pxOf(cl ? twValue(tok, cl[1]) : r); +} + +function twTrack(ctx, b, neg) { + const tok = twTokens(ctx); + let m = /^tracking-(tighter|tight|normal|wide|wider|widest)$/.exec(b); + let v = null; + if (m) v = `${TW_TRACK[m[1]]}em`; + else if ((m = /^tracking-(?:\[([^\]]+)\]|\((--[\w-]+)\))$/.exec(b))) v = m[1] ? m[1].replace(/_/g, ' ') : `var(${m[2]})`; + else if ((m = /^tracking-([a-z][\w-]*)$/.exec(b)) && tok[`--tracking-${m[1]}`]) v = tok[`--tracking-${m[1]}`]; + if (v == null) return null; + const r = twValue(tok, v); + const e = /^(-?\d*\.?\d+)em$/.exec(r); + const px = e ? null : pxOf(r); + if (!e && px == null) return null; + const out = e ? parseFloat(e[1]) : px; + return e ? { em: neg ? -out : out } : { px: neg ? -out : out }; +} + +const twHue = (c) => { + if (!c || c.alpha <= 0.05) return null; + const ok = c.okl || srgbToOklch(c); + return ok.C > 0.04 ? ok.H : null; +}; +function twStop(ctx, v, tok) { + if (/^\[?-?\d*\.?\d+%\]?$/.test(v)) return null; + const tokens = twTokens(ctx); + const pm = TW_SHADE.exec(v); + if (pm) return { tok, kind: 'palette', pal: pm[1], hue: TW_GREY.test(pm[1]) ? null : TW_HUE[pm[1]] }; + if (/^(?:white|black|transparent|current|inherit)(?:\/\S*)?$/.test(v)) return { tok, kind: 'plain', hue: null }; + if (v.startsWith('(')) return { tok, kind: 'token', hue: twHue(parseColor(twValue(tokens, `var${v.replace(/\/\S*$/, '').replace(/^\((?:color:)?/, '(')}`))) }; + if (v.startsWith('[')) { + const inner = v.slice(1, v.lastIndexOf(']')).replace(/_/g, ' '); + return { tok, kind: /var\(/.test(inner) ? 'token' : 'literal', hue: twHue(parseColor(twValue(tokens, inner))) }; + } + const tv = tokens[`--color-${v.replace(/\/\S*$/, '')}`]; + return { tok, kind: 'token', hue: tv ? twHue(parseColor(twValue(tokens, tv))) : null }; +} + +function twFamily(v) { + if (/var\(/.test(v)) return null; + const named = v.replace(/^family-name:/, ''); + if (named === v && !/^['"]/.test(v) && /^(?:\d|weight:|number:)/.test(v)) return null; + const fam = firstFamily(named.replace(/_/g, ' ')); + return !fam || GENERIC_FAMILIES.has(fam) ? null : fam; +} + +function twLiterals(b, tok, f) { + for (const m of b.matchAll(/\[([^\]]+)\]/g)) { + const v = m[1].replace(/url\([^)]*\)/gi, ' ').replace(/_/g, ' '); + const fam = /^font-family:(.+)$/.exec(v); + if (fam && !/var\(/.test(fam[1]) && !GENERIC_FAMILIES.has(firstFamily(fam[1]))) f.font = f.font || tok; + for (const c of v.matchAll(TW_COLOR_LIT)) { + const col = parseColor(c[0]); + if (col && col.alpha > 0) f.colours.push({ tok, oklch: /^oklch/i.test(c[0]) }); + } + } +} +const TW_COLOR_LIT = /#[0-9a-fA-F]{3,8}\b|oklch\([^)]*\)|rgba?\([^)]*\)|hsla?\([^)]*\)/g; + +function twInfo(ctx, toks, tw) { + const f = { + upper: false, normalCase: false, caps: false, size: null, em: null, mono: false, accent: null, + tAll: null, bounce: null, overshoot: null, hScale: null, hRotate: null, grad: false, stops: [], clip: false, clear: false, + bblur: null, glass: null, blur: 0, blurTok: null, pos: null, fill: false, shadows: [], shadowCol: null, vh: null, + oxHidden: null, oxClip: false, colours: [], font: null, pal: [], rounded: false, cols3: false, animate: null, + transform: false, transition: false, caret: false, scrollbar: false, hero: false, padded: false, + }; + let sizeV = null; + const tracks = []; + for (const tok of toks) { + if (tok.includes('__')) continue; + const p = twParse(tok); + const b = p.base; + if (!b) continue; + const plain = !p.variants.length; + for (const v of p.variants) tw.variants.add(v); + const hover = p.variants.includes('hover'); + if (TW_PAL.test(b)) f.pal.push(b.replace(/\/.*$/, '')); + if (b.includes('[')) twLiterals(b, tok, f); + if (/hero/i.test(b)) f.hero = true; + if (b === 'uppercase') { f.upper = true; continue; } + if (b === 'normal-case') { if (plain) f.normalCase = true; continue; } + if (b === 'small-caps' || /^\[font-variant(?:-caps)?:[^\]]*(?:small|petite)-caps/.test(b) || /^\[font-feature-settings:[^\]]*(?:smcp|c2sc)/.test(b)) { f.caps = true; continue; } + if (b.startsWith('text-')) { + const px = twSize(ctx, b); + if (px != null) { + if (plain) f.size = px; else sizeV = sizeV == null ? px : Math.min(sizeV, px); + continue; + } + if (b === 'text-transparent') { f.clear = true; continue; } + if (TW_ACCENT.test(b)) f.accent = f.accent || tok; + continue; + } + if (b.startsWith('tracking-')) { + const r = twTrack(ctx, b, p.neg); + if (r) tracks.push({ r, plain }); + continue; + } + if (b === 'font-mono') { f.mono = true; continue; } + if (b.startsWith('font-')) { + const arb = /^font-\[(.+)\]$/.exec(b); + const fam = arb ? twFamily(arb[1]) : null; + if (fam) { f.font = f.font || tok; if (TW_MONO.test(fam)) f.mono = true; } + const named = !arb && /^font-([a-z][\w-]*)$/.exec(b); + const tv = named && twTokens(ctx)[`--font-${named[1]}`]; + if (tv && /mono|courier|code/i.test(firstFamily(resolveVars(tv, twTokens(ctx))))) f.mono = true; + continue; + } + if (b === 'transition-all' || /^transition-\[[^\]]*\b(?:all|width|height|top|left|right|bottom|inset)\b/.test(b) || /^\[transition(?:-property)?:[^\]]*\b(?:all|width|height|top|left)\b/.test(b)) { + f.tAll = f.tAll || tok; f.transition = true; + continue; + } + if (/^transition(?:-transform)?$/.test(b)) { f.transition = true; if (b !== 'transition') f.transform = true; continue; } + if (b.startsWith('animate-')) { + if (b !== 'animate-none') f.animate = f.animate || tok; + if (b === 'animate-bounce') f.bounce = f.bounce || tok; + continue; + } + const ez = /^ease-\[cubic-bezier\(([^)]*)\)\]$/.exec(b); + if (ez) { + const n = ez[1].split(/[,_\s]+/).filter(Boolean).map(Number); + if (n.length === 4 && [n[1], n[3]].some((y) => y > 1.05 || y < -0.05)) f.overshoot = f.overshoot || tok; + continue; + } + if (/^(?:scale|translate|rotate|skew)-/.test(b)) { + f.transform = true; + if (hover && /^scale-/.test(b) && !/^scale-(?:[xy]-)?100$/.test(b)) f.hScale = f.hScale || tok; + if (hover && /^rotate-/.test(b) && b !== 'rotate-0') f.hRotate = f.hRotate || tok; + continue; + } + if (/^bg-(?:gradient-to-|linear-|radial|conic)|^bg-\[(?:repeating-)?(?:linear|radial|conic)-gradient/.test(b) || /^\[background(?:-image)?:[^\]]*gradient\(/.test(b)) f.grad = true; + const st = /^(?:from|via|to)-(.+)$/.exec(b); + if (st) { const s = twStop(ctx, st[1], tok); if (s) f.stops.push(s); continue; } + if (b === 'bg-clip-text' || /^\[(?:-webkit-)?background-clip:text\]$/.test(b)) { f.clip = true; continue; } + if (b === '[-webkit-text-fill-color:transparent]') { f.clear = true; continue; } + if (/^backdrop-blur(?:-|$)/.test(b) || /^\[(?:-webkit-)?backdrop-filter:[^\]]*blur/.test(b)) { f.bblur = f.bblur || tok; continue; } + const bl = /^blur-(?:(2xl|3xl)|\[(\d*\.?\d+)(px|rem)\])$/.exec(b); + if (bl) { + const px = bl[1] ? (bl[1] === '2xl' ? 40 : 64) : parseFloat(bl[2]) * (bl[3] === 'rem' ? 16 : 1); + if (px > f.blur) { f.blur = px; f.blurTok = tok; } + continue; + } + if (b === 'absolute' || b === 'fixed') { f.pos = f.pos || b; continue; } + if (b.startsWith('bg-')) { + const gm = TW_GLASS.exec(b); + if (gm) { + const v = gm[1].replace(/^\[|\]$/g, ''); + const a = v.endsWith('%') ? parseFloat(v) / 100 : v.includes('.') ? parseFloat(v) : parseFloat(v) / 100; + if (a < 0.95) f.glass = f.glass || tok; + } + if (!TW_NONFILL.test(b)) f.fill = true; + continue; + } + if (b.startsWith('shadow-')) { + const sm = /^shadow-\[(.+)\]$/.exec(b); + if (sm) f.shadows.push({ v: sm[1], tok }); + else if (!/^shadow-(?:2xs|xs|sm|md|lg|xl|2xl|inner|none)$/.test(b)) f.shadowCol = f.shadowCol || b.slice(7); + continue; + } + if (/^(?:min-)?h-(?:screen|\[[^\]]*\d\s*vh[^\]]*\])$/.test(b)) { f.vh = f.vh || tok; continue; } + if (b === 'overflow-x-hidden') { f.oxHidden = f.oxHidden || tok; continue; } + if (b === 'overflow-x-clip' || b === 'overflow-clip') { f.oxClip = true; continue; } + if (/^rounded(?:-|$)/.test(b)) { if (b !== 'rounded-none') f.rounded = true; continue; } + if (b === 'grid-cols-3') { f.cols3 = true; continue; } + if (/^p[xytrblse]?-/.test(b)) { f.padded = true; continue; } + if (b.startsWith('caret-')) { f.caret = true; continue; } + if (b.startsWith('scrollbar') || b.startsWith('[scrollbar-')) f.scrollbar = true; + } + if (f.size == null) f.size = sizeV; + let emV = null; + for (const { r, plain } of tracks) { + const em = r.em != null ? r.em : r.px / (f.size || 16); + if (plain) f.em = em; else emV = emV == null ? em : Math.max(emV, em); + } + if (f.em == null) f.em = emV; + return f; +} + +const TW_CLASS_ATTR = /(?:^|\s)(class|className|:class|v-bind:class|x-bind:class|class:list)\s*=\s*/g; +function twInterp(val) { + const parts = []; + let i = 0, seg = '', after = false; + while (i < val.length) { + if (val[i] === '{') { + parts.push(cutGlued(seg, after, true)); + const e = braceEnd(val, i); + parts.push(clsLits(val.slice(i + 1, e)).join(' ')); + i = e + 1; seg = ''; after = true; + continue; + } + seg += val[i++]; + } + parts.push(cutGlued(seg, after, false)); + return parts.join(' ').split(/\s+/).filter(Boolean); +} +function twTokensOf(doc, t) { + if (doc.classAt) return doc.classAt.get(t.pos) || []; + const tag = (doc.raw || doc.src).slice(t.pos, t.end); + if (!tag.includes('class')) return []; + const out = []; + for (const m of tag.matchAll(TW_CLASS_ATTR)) { + const i = m.index + m[0].length; + const q = tag[i]; + let val, dyn = m[1] !== 'class' && m[1] !== 'className'; + if (q === '"' || q === "'") { const e = tag.indexOf(q, i + 1); val = tag.slice(i + 1, e < 0 ? tag.length : e); } + else if (q === '{') { val = tag.slice(i + 1, braceEnd(tag, i)); dyn = true; } + else val = (/^[^\s>]*/.exec(tag.slice(i)) || [''])[0]; + if (dyn) out.push(...clsLits(val)); + else if (val.includes('{')) out.push(...twInterp(val)); + else out.push(...val.split(/\s+/)); + } + for (const d of tag.matchAll(/(?:^|\s)class:(?!list\b)([\w-]+)/g)) out.push(d[1]); + return out.filter(Boolean); +} + +function twFrame(parent, t, f, toks) { + const logo = toks.some((x) => TW_LOGO.test(x)) || TW_LOGO.test(getAttr(t.attrs, 'aria-label') || ''); + return { + size: f && f.size != null ? f.size : parent.size, + em: f && f.em != null ? f.em : parent.em, + upper: f ? f.upper || (!f.normalCase && parent.upper) : parent.upper, + caps: (f && f.caps) || parent.caps, + noLabel: parent.noLabel || /^(?:svg|pre|code|abbr|kbd|samp)$/.test(t.name), + code: parent.code || /^(?:pre|code|kbd|samp)$/.test(t.name), + eyeSkip: parent.eyeSkip || EYEBROW_ANCESTOR_SKIP.test(t.name), + inOl: parent.inOl || t.name === 'ol', + logo: parent.logo || (t.name === 'a' && logo), + logoSelf: logo, + }; +} + +function twGroup(ctx) { + if (ctx._tw) return ctx._tw; + const tw = { items: [], variants: new Set(), caret: false, scrollbar: false, motion: null, upperDisplay: false }; + ctx._tw = tw; + const add = (it) => { + const f = it.info; + tw.items.push(it); + if (f.caret) tw.caret = true; + if (f.scrollbar) tw.scrollbar = true; + if (!tw.motion && (f.animate || (f.transition && f.transform))) tw.motion = it; + if (/^h[12]$/.test(it.name) && f.upper) tw.upperDisplay = true; + }; + for (const doc of ctx.docs) { + const stack = []; + for (let i = 0; i < doc.tags.length; i++) { + const t = doc.tags[i]; + if (t.close) { stack.pop(); continue; } + const parent = stack.length ? stack[stack.length - 1] : TW_ROOT; + const toks = twTokensOf(doc, t); + const info = toks.length ? twInfo(ctx, toks, tw) : null; + const frame = twFrame(parent, t, info, toks); + if (info) add({ doc, idx: i, name: t.name, attrs: t.attrs, line: t.line, toks, info, frame }); + if (!t.selfClosing) stack.push(frame); + } + for (let c = 0; c < doc.comps.length; c++) { + const t = doc.comps[c]; + if (t.close) continue; + const toks = twTokensOf(doc, t); + if (!toks.length) continue; + const info = twInfo(ctx, toks, tw); + add({ doc, idx: -1, comp: c, name: t.name, attrs: t.attrs, line: t.line, toks, info, frame: twFrame(TW_ROOT, t, info, toks) }); + } + for (const v of doc.virtuals || []) { + const info = twInfo(ctx, v.toks, tw); + add({ doc, idx: -1, virtual: true, name: v.name, attrs: '', line: doc.lineOf(v.pos), toks: v.toks, info, frame: twFrame(TW_ROOT, { name: v.name, attrs: '' }, info, v.toks) }); + } + } + return tw; +} + +function twWhere(it) { + return it.virtual ? `${it.name}() class string` : `<${it.name} class="${trunc(it.toks.join(' '), 32)}">`; +} + +function compInner(doc, c) { + const open = doc.comps[c]; + if (open.selfClosing) return ''; + let depth = 1; + for (let i = c + 1; i < doc.comps.length; i++) { + const t = doc.comps[i]; + if (t.name !== open.name || t.selfClosing) continue; + if (!t.close) depth++; + else if (--depth === 0) return doc.src.slice(open.end, t.pos); + } + return ''; +} + +function twPlain(doc, html) { + let s = html; + if (doc.kind !== 'html' && doc.kind !== 'jsx') for (let k = 0; k < 3 && /\{[^{}]*\}/.test(s); k++) s = s.replace(/\{[^{}]*\}/g, ' '); + return plainText(s); +} + +function twText(it) { + if (it.text == null) { + let inner = ''; + if (it.idx >= 0) inner = innerOf(it.doc, it.idx)?.inner || ''; + else if (it.comp != null) inner = compInner(it.doc, it.comp); + it.text = twPlain(it.doc, inner); + } + return it.text; +} + +function closeIndex(doc, idx) { + if (doc.tags[idx].selfClosing) return idx; + let depth = 1; + for (let i = idx + 1; i < doc.tags.length; i++) { + const t = doc.tags[i]; + if (t.selfClosing) continue; + if (!t.close) depth++; + else if (--depth === 0) return i; + } + return doc.tags.length - 1; +} + +function twGradient(ctx, f) { + if (!f.stops.length || (!f.grad && f.stops.length < 2)) return null; + const names = f.stops.filter((s) => s.pal).map((s) => s.pal); + let banned = null; + for (const a of names) { + if (!TW_PURPLE.test(a)) continue; + if (names.some((x) => x !== a && TW_BLUE.test(x))) { banned = 'purple-to-blue'; break; } + if (names.some((x) => x !== a && TW_PINK.test(x))) { banned = 'purple-to-pink'; break; } + } + if (!banned) banned = bannedGradient(f.stops.map((s) => s.hue).filter((h) => h != null), { tokens: twTokens(ctx) }); + return { banned, text: f.clip && f.clear, list: f.stops.map((s) => s.tok).join(' ') }; +} + +function twGlow(ctx, f) { + const tokens = twTokens(ctx); + for (const s of f.shadows) { + for (const part of splitTop(resolveVars(s.v.replace(/_/g, ' '), tokens))) { + const cm = COLOR_RE.exec(part); + const lens = (cm ? part.replace(cm[0], ' ') : part).replace(/\binset\b/, ' ').trim().split(/\s+/).filter(Boolean).map(lengthPx); + if (lens.length < 3 || lens[0] !== 0 || lens[1] !== 0 || lens[2] == null || lens[2] < 8) continue; + let chroma = 0; + if (cm) { + const c = parseColor(cm[0]); + if (c && c.alpha > 0.05) chroma = (c.okl || srgbToOklch(c)).C; + } else if (f.shadowCol) { + const name = f.shadowCol.replace(/\/\S*$/, ''); + const pm = TW_SHADE.exec(name); + const tv = tokens[`--color-${name}`]; + chroma = pm ? (TW_GREY.test(pm[1]) ? 0 : 0.2) : tv ? (twHue(parseColor(resolveVars(tv, tokens).trim())) != null ? 0.2 : 0) : 0; + } + if (chroma > 0.04) return `glow: ${s.tok}${cm ? '' : ` with shadow-${f.shadowCol}`}`; + } + } + return null; +} + +function twDataText(s) { + const t = s.trim(); + const letters = (t.match(/[A-Za-z]/g) || []).length; + const digits = (t.match(/\d/g) || []).length; + if (digits >= letters) return true; + if (/^v?\d+(?:\.\d+)+/.test(t) || /[⌘⌥⇧⌃⎋↵]|^(?:ctrl|cmd|alt|shift|option)\s*[+-]/i.test(t)) return true; + if (/[{}();=<>]|^\$\s|^(?:npm|npx|pnpm|yarn|bun|git|curl|cd|ls|brew|pip|docker|node) |^--?[a-z]|[\w-]+\.[a-z][a-z0-9]{0,3}$|^[#.]?[a-z]+(?:[-_][a-z0-9]+)+$|^[a-z]+[A-Z]\w*$|^\/[\w/.-]*$|^https?:/.test(t)) return true; + return digits > 0 && /^(?:\d{1,2}:\d{2}|(?:jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)[a-z]*\.?\s+\d)/i.test(t); +} + +function tw67(it, tw) { + const f = it.info, fr = it.frame; + if (!(f.upper || f.caps || (f.em != null && f.em > 0.03))) return null; + if (fr.logo || fr.logoSelf || fr.noLabel) return null; + const size = fr.size, em = fr.em; + if ((size != null && size >= 24) || (size == null && /^h[1-6]$/.test(it.name))) return null; + const caps = fr.upper || fr.caps; + const small = size != null && size <= 15; + const tracked = em != null && em > 0.03; + const control = /^(?:button|input)$/.test(it.name) || /(?:button|btn|cta)$/i.test(it.name) || (it.name === 'a' && f.fill && f.padded) || /role\s*=\s*["']?button/i.test(it.attrs); + if (tw.upperDisplay && control && (em == null || em <= 0.04)) return null; + if (!((caps && (small || tracked)) || (tracked && small))) return null; + return { what: fr.caps ? 'small caps' : fr.upper ? 'uppercase' : 'letter-spaced', size, em: tracked ? Math.round(em * 1000) / 1000 : null }; +} + +function tw54(it) { + const f = it.info, fr = it.frame, doc = it.doc; + if (it.idx < 0 || !/^(?:p|span|div|small)$/.test(it.name) || fr.eyeSkip) return null; + if (!(f.upper || (f.em != null && f.em > 0.03) || f.accent)) return null; + if (fr.size == null || fr.size > 14) return null; + const t = doc.tags[it.idx]; + if (/role\s*=\s*["']?status|aria-live|aria-current|aria-hidden\s*=\s*["']?true/i.test(t.attrs)) return null; + const c = closeIndex(doc, it.idx); + const nx = doc.tags[c + 1]; + if (!nx || nx.close || !/^h[1-3]$/.test(nx.name)) return null; + const inner = c > it.idx ? doc.src.slice(t.end, doc.tags[c].pos) : ''; + if (EYEBROW_BLOCKY.test(inner) || /]*\shref\s*=\s*["']([^"']*)["']/i.exec(inner); + if (href && !/^#?$/.test(href[1].trim())) return null; + const text = twPlain(doc, inner); + const signal =[f.upper ? 'uppercase' : null, f.em != null && f.em > 0.03 ? `tracked ${Math.round(f.em * 1000) / 1000}em` : null, f.accent].filter(Boolean).join(', '); + if (!text) return doc.kind !== 'html' && c > it.idx && (doc.raw || '').slice(t.end, doc.tags[c].pos).includes('{') ? { text: '', next: nx.name, signal } : null; + const words = text.split(/[\s·/|\u2014\u2013]+/).filter(Boolean); + if (words.length > 7 || text.length > 56 || /[\w/-]+\.[a-z]{1,4}$/i.test(text)) return null; + const stripped = text.replace(/^\s*(?:no\.?\s*)?\d{1,3}(?:\s*[·./\u2014\u2013-]\s*|\s+|$)/i, '').trim(); + if ((stripped.match(/\d/g) || []).length >= 2) return null; + if (fr.inOl && stripped && !EYEBROW_ANNOUNCE.test(stripped)) return null; + return { text, next: nx.name, signal }; +} + +function twTiles(it, byIdx) { + const doc = it.doc; + let tiles = 0; + for (const k of directChildren(doc, it.idx)) { + if (!/]*class/.test(inner.inner) && !twPlain(doc, inner.inner)) { tiles++; break; } + } + } + return tiles; +} + +function checkTailwind(ctx) { + const tw = twGroup(ctx); + if (!tw.items.length) return; + const had = (gate, doc, line) => findings.some((x) => x.gate === gate && x.file === rel(doc.file) && x.line === line); + const monoOk = monoIsMaterial({ tokens: twTokens(ctx) }); + const byDoc = new Map(); + for (const it of tw.items) { + if (!byDoc.has(it.doc)) byDoc.set(it.doc, []); + byDoc.get(it.doc).push(it); + const { doc, info: f } = it; + const at = (gate, grade, ev, fix) => report(gate, grade, doc.file, it.line, ev, fix); + const where = twWhere(it); + if (f.tAll) at('10a', 'FAIL', `${f.tAll} on ${where}`, 'Name the properties: transition-colors, transition-opacity or transition-transform'); + if (f.bounce || f.overshoot) at(12, 'FAIL', `${f.bounce ? 'bounce' : 'overshoot easing'} ${f.bounce || f.overshoot} on ${where}`, 'Exponential ease-out on UI state; no bounce or overshoot'); + const g = twGradient(ctx, f); + if (g && g.banned) at('2a', 'FAIL', `${g.banned} gradient${g.text ? ' text' : ''} (${g.list}) on ${where}`, 'One anchor hue, solid ink'); + else if (g && g.text) at('2b', 'FAIL', `gradient text (${g.list}) on ${where}`, 'Solid ink; weight or a display face. Guard: a single-hue ramp from two tokens with 40 and 41 passing'); + const g29 = f.bblur && f.glass ? `glass: ${f.bblur} over ${f.glass}` + : f.blur >= 40 && f.pos && (f.fill || f.grad || f.stops.length) ? `blurred orb: ${f.blurTok} on a filled ${f.pos} element` + : twGlow(ctx, f); + if (g29) at(29, 'WARN', `${g29} on ${where}`, 'Solid or grained surface; elevation by lightness, shadows with offset and blur'); + if (f.colours.length || f.font) { + const what = [f.colours.length ? `colour literal ${f.colours[0].tok}` : null, f.font ? `font-family literal ${f.font}` : null].filter(Boolean).join(' and '); + at(48, f.font || f.colours.some((c) => !c.oklch) ? 'FAIL' : 'WARN', `${what} in a class on ${where}`, 'Lift the value into the token block (@theme or :root) and use its utility name'); + } + if ((f.hScale || f.hRotate) && /^(?:img|picture|image)$/i.test(it.name)) at(11, 'WARN', `${f.hScale || f.hRotate} on ${where}: the image moves on hover`, 'Imagery sits still; give the container the feedback'); + const t67 = tw67(it, tw); + if (t67 && !had('67', doc, it.line)) { + const text = it.virtual ? '' : twText(it); + at(67, 'FAIL', `${text ? `"${trunc(text, 24)}" ` : ''}${t67.what}${t67.size != null ? ` at ${t67.size}px` : ''}${t67.em != null ? ` tracked ${t67.em}em` : ''} on ${where}`, 'Sentence case in the body face, a step smaller, untracked: drop uppercase and the tracking-* class'); + } + const e54 = tw54(it); + if (e54 && !had('54', doc, it.line)) { + at(54, 'FAIL', `eyebrow ${e54.text ? `"${trunc(e54.text, 24)}" ` : ''}before <${e54.next}> (${e54.signal} at ${it.frame.size}px)`, 'Cut it; open the section another way (craft.md, Opening a section)'); + } + if (!monoOk && f.mono && !it.virtual && !it.frame.code && !/^(?:code|pre|kbd|samp|time|var)$/.test(it.name) && it.frame.size != null && it.frame.size <= 14) { + const text = twText(it); + if (/[A-Za-z]/.test(text) && !twDataText(text)) at(64, 'FAIL', `font-mono on "${trunc(text, 24)}" at ${it.frame.size}px (${where})`, 'Labels in the body face at a smaller size and normal case; font-mono only for code and figures'); + } + } + for (const [doc, list] of byDoc) { + const pal = new Map(); + let palAt = null; + for (const it of list) for (const p of it.info.pal) if (!pal.has(p)) { pal.set(p, it); if (pal.size === 5) palAt = it; } + if (palAt) report(74, 'WARN', doc.file, palAt.line, `default palette instead of theme tokens: ${pal.size} distinct palette classes (${[...pal.keys()].slice(0, 4).join(' ')})`, 'Extend the Tailwind theme with the Hallmark tokens and use those names'); + const scaled = list.filter((it) => it.info.hScale); + if (scaled.length >= 3) report(11, 'WARN', doc.file, scaled[2].line, `hover scale on ${scaled.length} elements in this file (${scaled.slice(0, 3).map((it) => it.info.hScale).join(', ')})`, 'One hover signal per element; not every card grows'); + const first = new Set(['section', 'header'].map((n) => doc.tags.findIndex((t) => !t.close && t.name === n)).filter((x) => x >= 0)); + const byIdx = new Map(); + for (const it of list) if (it.idx >= 0) byIdx.set(it.idx, it); + for (const it of list) { + if (it.info.vh && !it.virtual && (first.has(it.idx) || it.info.hero)) report('6a', 'FAIL', doc.file, it.line, `hero sized in vh: ${it.info.vh} on ${twWhere(it)}`, 'min-h-dvh or min-h-svh'); + if (it.info.cols3 && it.idx >= 0) { + const n = twTiles(it, byIdx); + if (n >= 3) report(3, 'WARN', doc.file, it.line, `icon-tile row: ${n} children of ${twWhere(it)} open on an icon in a rounded filled tile above an h3`, 'Vary column widths or drop the icon tiles'); + } + } + } +} + +const EMOJI_ICON = /(?![©®™‼⁉←-⇿])\p{Extended_Pictographic}/u; +function checkComponentText(ctx) { + for (const doc of ctx.docs) { + for (let c = 0; c < doc.comps.length; c++) { + const t = doc.comps[c]; + if (t.close || t.selfClosing) continue; + const inner = compInner(doc, c); + if (!inner || /<(?:p|div|li|section|article|ul|ol|table)\b/i.test(inner)) continue; + const text = twPlain(doc, inner); + if (!text) continue; + if (/(?:link|button|btn|cta)$/i.test(t.name) && /(→|->|›|»|⟶)\s*$/.test(text)) report(63, 'FAIL', doc.file, t.line, `arrow glued to the label "${trunc(text, 40)}" (<${t.name}>)`, 'A verb as the label; the link already says it goes somewhere'); + if ((text.match(/\s[·•]\s/g) || []).length >= 2) report(63, 'FAIL', doc.file, t.line, `middle-dot meta string "${trunc(text, 50)}"`, 'Line breaks, columns or hairlines; one dot in a byline at most'); + if (text.length <= 4 && EMOJI_ICON.test(text)) report('30a', 'FAIL', doc.file, t.line, `emoji icon "${text}" in <${t.name}>`, 'One icon library or custom SVG'); + } + } +} + +function checkF21(ctx) { + for (const doc of ctx.docs) { + if (doc.kind !== 'html') continue; + let prev = 0; + for (const m of doc.src.matchAll(/]*>([\s\S]*?)<\/h\1>/gi)) { + const level = Number(m[1]); + if (prev && level > prev + 1) { + report('F21', 'WARN', doc.file, doc.lineOf(m.index), `h${prev} is followed by h${level} ("${trunc(m[2].replace(/<[^>]+>/g, ' ').replace(/\s+/g, ' ').trim(), 32)}")`, 'Step heading levels one at a time; size a head with CSS, never with its level'); + break; + } + prev = level; + } + } +} + +function checkF22(ctx) { + for (const r of ctx.rules) { + const j = r.decls.find((d) => d.prop === 'text-align' && /^justify\b/.test(d.value.trim())); + if (j && !r.decls.some((d) => d.prop === 'hyphens' && /auto/.test(d.value))) { report('F22', 'WARN', r.file, j.line, `justified text without hyphenation on ${r.selector}`, 'Set it left, or add hyphens: auto'); return; } + } + for (const doc of ctx.docs) { + const m = /class(?:Name)?\s*=\s*["'][^"']*(?]*)>/i.exec(doc.src); + if (!html || !getAttr(html[1], 'lang')) missing.push('lang on '); + if (!/]*>\s*[^<\s][^<]*<\/title>/i.test(doc.src)) missing.push('a '); + if (!/<meta\b[^>]*\bname\s*=\s*["']description["'][^>]*>/i.test(doc.src)) missing.push('a meta description'); + if (missing.length) report('F23', 'WARN', doc.file, 1, `the document lacks ${missing.join(', ')}`, 'Name the language, title the page in its own words, and describe it in one sentence for link previews'); + } +} + +function checkF24(ctx) { + const wide = (value) => resolveVars(value, ctx.tokens).split(/,(?![^(]*\))/).some((layer) => { + if (/\binset\b/.test(layer)) return false; + const len = [...layer.replace(/(?:oklch|oklab|rgba?|hsla?|color|color-mix)\([^)]*\)/g, '').matchAll(/(-?\d*\.?\d+)(px|rem|em)?(?=\s|$)/g)].map((m) => parseFloat(m[1]) * (m[2] === 'rem' || m[2] === 'em' ? 16 : 1)); + return len.length >= 3 && len[2] + Math.min(0, len[3] || 0) >= 24; + }); + for (const r of ctx.rules) { + const sh = r.decls.find((d) => d.prop === 'box-shadow' && d.value.trim() !== 'none'); + if (!sh || !wide(sh.value)) continue; + const edge = r.decls.find((d) => /^border(?:-(?:top|right|bottom|left|inline|block)(?:-(?:start|end))?)?$/.test(d.prop) && /(?:^|\s)(?:1px|0\.5px|thin|var\(--rule-hair\))(?:\s|$)/.test(d.value) && !/\b(?:none|transparent)\b/.test(d.value)); + if (edge) { report('F24', 'WARN', r.file, sh.line, `a hairline border under a wide soft shadow on ${r.selector}`, 'Commit to one: a defined edge, or elevation by shadow'); return; } + } + for (const doc of ctx.docs) { + const m = /class(?:Name)?\s*=\s*["'][^"']*(?<![\w:-])border(?![\w-])[^"']*(?<![\w:-])shadow-(?:xl|2xl)(?![\w-])|class(?:Name)?\s*=\s*["'][^"']*(?<![\w:-])shadow-(?:xl|2xl)(?![\w-])[^"']*(?<![\w:-])border(?![\w-])/.exec(doc.raw || doc.src); + if (m) { report('F24', 'WARN', doc.file, doc.lineOf ? doc.lineOf(m.index) : 1, 'a hairline border under a wide soft shadow (border with shadow-xl or shadow-2xl)', 'Commit to one: a defined edge, or elevation by shadow'); return; } + } +} + +let LIBRARY = null; +function library() { + if (LIBRARY) return LIBRARY; + LIBRARY = new Map(); + try { for (const p of JSON.parse(readFileSync(join(dirname(fileURLToPath(import.meta.url)), 'photos.json'), 'utf8')).photos) { LIBRARY.set(p.file.split('/').pop(), p); LIBRARY.set(savedName(p.id), p); } } catch { /* no library */ } + return LIBRARY; +} +// theme.mjs photos --save names a file after its title; match that name back to the library entry. +const savedName = (id) => id.replace(/\.[a-z]+$/i, '').normalize('NFKD').replace(/[\u0300-\u036f]/g, '').toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '').slice(0, 60) || `photo-${createHash('sha1').update(id).digest('hex').slice(0, 10)}`; +const SAVED = /([a-z0-9-]+)-(?:960|1280|1920)\.jpg/g; +const COMMONS = /upload\.wikimedia\.org\/wikipedia\/commons\/(?:thumb\/)?[0-9a-f]\/[0-9a-f]{2}\/([^/"'\s)?]+)/g; +const STOCK = /(?:images|plus)\.unsplash\.com\/(premium_photo|photo)-[\w-]+|images\.pexels\.com\/photos\/\d+|cdn\.pixabay\.com\/photo\//g; +function check76(ctx) { + const lib = library(); + const text = ctx.docs.filter((d) => d.kind === 'html').map((d) => d.src).join('\n'); + const credited = (p) => /^(CC0|Public domain|PD)/i.test(p.license) || text.includes(p.page) || text.includes(p.page.replace(/^https:/, '')) || text.includes(p.author); + const seen = new Set(); + for (const doc of ctx.docs) { + let stock = 0, plus = 0; + for (const m of doc.src.matchAll(STOCK)) { + if (m[1] === 'premium_photo') { if (!plus++) report('76', 'FAIL', doc.file, doc.lineOf(m.index), 'an Unsplash+ photo, which needs a paid licence', 'Use a library photograph (theme.mjs photos) or the user\'s own'); } + else if (!stock++) report('76', 'WARN', doc.file, doc.lineOf(m.index), 'a photo hotlinked from a stock site, whose terms bar images picked by an AI tool', 'Use a library photograph (theme.mjs photos) or the user\'s own; dismiss only if the user supplied this one'); + } + for (const m of doc.src.matchAll(COMMONS)) { + const name = m[1].replace(/^\d+px-/, ''); + if (seen.has(name)) continue; + seen.add(name); + const p = lib.get(name); + if (!p) { if (lib.size) report('76', 'WARN', doc.file, doc.lineOf(m.index), `a Commons file that is not in the library (${trunc(decodeURIComponent(name), 40)})`, 'Pick photographs with theme.mjs photos, or check its licence and credit it by hand'); } + else if (!credited(p)) report('76', 'FAIL', doc.file, doc.lineOf(m.index), `a library photo with no credit on the page (${trunc(p.author, 30)}, ${p.license})`, 'Add its printed credit to the footer\'s Photographs line (imagery.md § 2)'); + } + for (const m of doc.src.matchAll(SAVED)) { + const p = lib.get(m[1]); + if (!p || seen.has(m[1])) continue; + seen.add(m[1]); + if (!credited(p)) report('76', 'FAIL', doc.file, doc.lineOf(m.index), `a library photo with no credit on the page (${trunc(p.author, 30)}, ${p.license})`, 'Add its printed credit to the footer\'s Photographs line (imagery.md § 2)'); + } + if (doc.kind !== 'html') continue; + for (const m of doc.src.matchAll(/<img\b([^>]*)>/gi)) { + const src = getAttr(m[1], 'src'); + if ((src == null || !src.trim() || src.trim() === '#') && !getAttr(m[1], 'srcset') && !hasAttr(m[1], 'data-src')) { report('76', 'FAIL', doc.file, doc.lineOf(m.index), 'an <img> with no source', 'Give it the real image, make it a data-slot placeholder, or remove it'); break; } + } + } +} + +const CHECKS = [check1, check2, check3, check3Stripe, check4, check6a, check7, check10, check10Motion, check11, + check12, check15, check17, check18, check19, check20, check22, check23, check24, check24a, + check25, check26, check27, check28, check30, check33, check34, check37, check38a, + check39, check40_41, check42, check42Footer, check46, check47, check48, check49, + check50, check50Wrap, check53, check54, check55, check56, checkCopyTell, check62, check63, check64, check65, check67, check38c, + check19Tells, check58Static, check68, check69, check70, check42TwoButton, check47Placeholders, check65Tailwind, check29Glow, check11Lift, check15Fade, + checkF1, checkF2, checkF3, checkF4, checkF5, checkF6, checkF7, checkF7Pills, checkF8, checkF9, checkF15, checkF16, checkF21, checkF22, checkF23, checkF24, check76, + checkTailwind, checkComponentText]; + +const files = opts.paths.length ? collectFiles(opts.paths) : []; +if (!files.length && !opts.urls.length) { console.error('sloplint: no .html, .css, .jsx, .tsx, .vue, .svelte or .astro files found'); process.exit(2); } + +const groups = new Map(); +for (const f of files) { + const dir = dirname(f); + if (!groups.has(dir)) groups.set(dir, { css: [], html: [] }); + const g = groups.get(dir); + if (extname(f).toLowerCase() === '.css') g.css.push(f); + else g.html.push(f); +} + +const localRef = (href) => href && !/^(?:[a-z]+:|\/\/)/i.test(href) ? href.split(/[?#]/)[0] : null; +function importsOf(css, from) { + const out = []; + for (const m of stripComments(css).matchAll(/@import\s+(?:url\(\s*)?["']?([^"')\s;]+)["']?\s*\)?/gi)) { + const ref = localRef(m[1]); + if (ref) out.push(resolve(from, ref)); + } + return out; +} +function linksOf(doc, from) { + const out = []; + for (const t of doc.tags) { + if (t.close || t.name !== 'link' || !/stylesheet/i.test(getAttr(t.attrs, 'rel') || '')) continue; + const ref = localRef(getAttr(t.attrs, 'href')); + if (ref) out.push(resolve(from, ref)); + } + return out; +} + +const projectRoots = new Map(); +function projectRoot(dir) { + if (projectRoots.has(dir)) return projectRoots.get(dir); + const up = dirname(dir); + const root = existsSync(join(dir, 'package.json')) ? dir : up === dir ? null : projectRoot(up); + projectRoots.set(dir, root); + return root; +} +function shareProjects(contexts) { + const byRoot = new Map(); + for (const [dir, ctx] of contexts) { + const root = projectRoot(dir); + if (!root) continue; + if (!byRoot.has(root)) byRoot.set(root, []); + byRoot.get(root).push(ctx); + } + for (const list of byRoot.values()) { + const parts = list.filter((c) => !c.cssFiles.length && c.docs.length && c.docs.every((d) => d.kind !== 'html')); + if (!parts.length || parts.length === list.length) continue; + const tokens = {}; + const shared = { focus: false, active: false, disabled: false, prm: false, once: new Set() }; + for (const c of list) { + Object.assign(tokens, c.tokens); + const tv = twGroup(c).variants; + const sel = (re) => c.rules.some((r) => re.test(r.selector)); + shared.focus = shared.focus || sel(/:focus/) || [...tv].some((v) => /^focus/.test(v)); + shared.active = shared.active || sel(/:active/) || tv.has('active'); + shared.disabled = shared.disabled || sel(/:disabled|\[disabled\]|aria-disabled/) || tv.has('disabled') || tv.has('aria-disabled'); + shared.prm = shared.prm || /prefers-reduced-motion/i.test(stripComments(c.allCss)) || tv.has('motion-reduce') || tv.has('motion-safe'); + } + for (const c of list) c.shared = shared; + const stamped = list.find((c) => !parts.includes(c) && /Hallmark\s*·/.test(c.stampText)); + for (const c of parts) { + if (stamped && !/Hallmark\s*·/.test(c.stampText)) c.stampText = `${c.stampText}\n${stamped.stampText}`; + c.twTok = { ...tokens, ...c.tokens }; + c._tw = null; + } + } +} + +const waiversByKey = new Map(); +const postureByFile = {}; +const heroPostureByFile = {}; +const photoShapeByFile = {}; +const jobByFile = {}; +const contexts = []; +const parsedDocs = new Map(); +const docOf = (f) => { + if (parsedDocs.has(f)) return parsedDocs.get(f); + let doc = null; + try { doc = parseDoc(f, readFileSync(f, 'utf8')); } catch (e) { console.error(`sloplint: skipped ${rel(f)}, it could not be parsed (${e.message})`); } + parsedDocs.set(f, doc); + return doc; +}; +function buildContext(key, cssList, docList) { + const cssFiles = []; + const rules = []; + const docs = []; + const inGroup = new Set([...cssList, ...docList.map((d) => d.file)]); + const pending = []; + for (const f of cssList) { + const raw = readFileSync(f, 'utf8'); + cssFiles.push({ file: f, raw }); + rules.push(...parseCss(raw, f)); + pending.push(...importsOf(raw, dirname(f))); + } + for (const doc of docList) { + docs.push(doc); + for (const st of doc.styles) { + rules.push(...parseCss(st.css, doc.file, st.lineOffset)); + pending.push(...importsOf(st.css, dirname(doc.file))); + } + pending.push(...linksOf(doc, dirname(doc.file))); + } + const reached = new Set(); + while (pending.length) { + const p = pending.shift(); + if (inGroup.has(p) || extname(p).toLowerCase() !== '.css' || !existsSync(p)) continue; + inGroup.add(p); + reached.add(p); + let raw; + try { raw = readFileSync(p, 'utf8'); } catch { continue; } + cssFiles.push({ file: p, raw, attached: true }); + rules.push(...parseCss(raw, p)); + pending.push(...importsOf(raw, dirname(p))); + } + const head40 = (t) => t.split('\n').slice(0, 40).join('\n'); + const stampText = [ + ...cssFiles.map((c) => head40(c.raw)), + ...docs.flatMap((d) => d.styles.map((st) => head40(st.css))), + ].join('\n'); + const posture = (/posture:\s*(restrained|committed|full-palette|drenched)/i.exec(stampText)?.[1] || 'restrained').toLowerCase(); + // a custom page designs its own hero: 44a and 44c read it as free + const heroPosture = /theme:\s*custom\b/i.test(stampText) ? 'custom' : (/hero:\s*(settled|banner|poster|ledge|corridor|stage|counter|index)\b/i.exec(stampText)?.[1] || '').toLowerCase(); + const photoShape = /shape:\s*(photographic|portfolio)/i.test(stampText); + const job = ((/\bjob:\s*([a-z][a-z /-]*)/i.exec(stampText) || [])[1] || '').trim().toLowerCase(); + for (const d of docs) { postureByFile[d.file] = posture; heroPostureByFile[d.file] = heroPosture; photoShapeByFile[d.file] = photoShape; jobByFile[d.file] = job; } + const allCss = cssFiles.map((c) => c.raw).join('\n') + '\n' + + docs.map((d) => d.styles.map((st) => st.css).join('\n')).join('\n'); + const tokensOnly = !docs.length && rules.length > 0 && rules.every(isTokenRule); + contexts.push([key, { rules, tokens: buildTokens(rules), docs, cssFiles, genre: opts.genre, stampText, allCss, posture, tokensOnly }]); + return reached; +} +for (const [dir, g] of groups) { + const docs = g.html.map(docOf).filter(Boolean); + const pages = docs.filter((d) => d.kind === 'html'); + const parts = docs.filter((d) => d.kind !== 'html'); + if (!pages.length) { buildContext(dir, g.css, parts); continue; } + const used = new Set(); + for (const page of pages) { + const linked = new Set(); + const queue = [...linksOf(page, dirname(page.file)), ...page.styles.flatMap((st) => importsOf(st.css, dirname(page.file)))]; + while (queue.length) { + const q = queue.shift(); + if (linked.has(q) || !existsSync(q) || extname(q).toLowerCase() !== '.css') continue; + linked.add(q); + try { queue.push(...importsOf(readFileSync(q, 'utf8'), dirname(q))); } catch {} + } + const own = pages.length === 1 ? g.css : g.css.filter((c) => linked.has(c)); + own.forEach((c) => used.add(c)); + for (const c of linked) used.add(c); + buildContext(page.file, own, [page]); + } + const rest = g.css.filter((c) => !used.has(c)); + if (rest.length || parts.length) buildContext(dir, rest, parts); +} +shareProjects(contexts); +for (const [key, ctx] of contexts) { + applyWaivers(ctx, key); + waiversByKey.set(key, { WAIVED, ANSWERED, DISMISSED, VERBATIM, APPSCREEN, LAYOUT_KEPT }); + for (const check of CHECKS) { + try { check(ctx); } catch (e) { + console.error(`sloplint: internal error in ${check.name} for ${rel(key)}: ${e.message}`); + } + } +} + +let renderNotRun = null; +let domInventories = {}; +if (opts.render) { + const isShell = (f) => { try { const x = readFileSync(f, 'utf8'); return /<script\b[^>]*type\s*=\s*["']module["'][^>]*\bsrc\s*=\s*["'][^"']+\.(?:tsx?|jsx?|mjs|vue|svelte)["']/i.test(x); } catch { return false; } }; + const htmlFiles = files.filter((f) => extname(f).toLowerCase() === '.html' && !(opts.urls.length && isShell(f))); + if (!htmlFiles.length && !opts.urls.length) renderNotRun = 'no HTML page to render; pass --url for a running dev server'; + else try { + const mod = await import(new URL('./sloplint-render.mjs', import.meta.url).href); + const extra = await mod.renderCheck([...htmlFiles, ...opts.urls], { genre: opts.genre, postureByFile, heroPostureByFile, photoShapeByFile, jobByFile, stage: opts.stage, selectors: opts.before || opts.kept ? Object.fromEntries([...new Set(contexts.flatMap(([, c]) => c.docs))].filter((d) => d.kind === 'html').map((d) => [d.file, scriptSelectors(d)])) : {}, scope: opts.scope === 'app' || [...waiversByKey.values()].some((x) => x.APPSCREEN) ? 'app' : opts.scope, before: opts.before }); + domInventories = extra.inventories || {}; + const allWaivers = { WAIVED: new Set([...waiversByKey.values()].flatMap((x) => [...x.WAIVED])), ANSWERED: new Set([...waiversByKey.values()].flatMap((x) => [...x.ANSWERED])), DISMISSED: new Set([...waiversByKey.values()].flatMap((x) => [...(x.DISMISSED || [])])), VERBATIM: [...waiversByKey.values()].some((x) => x.VERBATIM), APPSCREEN: [...waiversByKey.values()].some((x) => x.APPSCREEN), LAYOUT_KEPT: [...waiversByKey.values()].map((x) => x.LAYOUT_KEPT).find(Boolean) || false }; + for (const f of extra) { + const w = /^https?:/.test(f.file) ? allWaivers : (waiversByKey.get(f.file) || waiversByKey.get(dirname(f.file))); + WAIVED = w ? w.WAIVED : new Set(); + ANSWERED = w ? w.ANSWERED : new Set(); + DISMISSED = w ? (w.DISMISSED || new Set()) : new Set(); + VERBATIM = !!(w && w.VERBATIM); + APPSCREEN = !!(w && w.APPSCREEN); + LAYOUT_KEPT = (w && w.LAYOUT_KEPT) || false; + report(f.gate, f.grade === 'REFLEX' ? 'FAIL' : f.grade, f.file, f.line, f.evidence, f.fix); + } + for (const x of extra.failed || []) { WAIVED = new Set(); ANSWERED = new Set(); DISMISSED = new Set(); VERBATIM = false; APPSCREEN = false; LAYOUT_KEPT = false; report('render', 'FAIL', x.file, 1, `the page did not render (${trunc(x.message, 60)}); its render gates did not run`, 'Fix the page or the URL and rerun; an unrendered page is never a pass'); } + if (extra.notRun) renderNotRun = extra.notRun; + } catch (e) { + renderNotRun = e.message; + } +} + +const SNAP = join(process.cwd(), '.hallmark', 'before.json'); +const squash = (t) => t.replace(/\s+/g, ' ').trim(); +const escRe = (t) => t.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); +function wiringOf(src) { + const body = src.replace(/<!--[\s\S]*?-->/g, ''); + const w = { handlers: [], links: [], fields: [], hooks: [], ids: [], scripts: [] }; + const val = String.raw`("[^"]*"|'[^']*'|\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\})`; + for (const m of body.matchAll(new RegExp(String.raw`(?<![\w-])(on[A-Z]\w*|on:[\w|]+|@[a-z][\w.:-]*|v-on:[\w.:-]+|on(?:click|submit|change|input|keydown|keyup|blur|focus))\s*=\s*` + val, 'g'))) w.handlers.push(`${m[1]}=${squash(m[2])}`); + for (const m of body.matchAll(new RegExp(String.raw`(?<![\w:-])(?:href|to|action)\s*=\s*` + val, 'g'))) { + const tag = (/<([A-Za-z][\w.-]*)[^<]*$/.exec(body.slice(Math.max(0, m.index - 600), m.index)) || [])[1] || ''; + if (/^(link|base|use|image|script|style)$/.test(tag)) continue; + const v = squash(m[1]).replace(/^["']|["']$/g, '').replace(/^\.\//, ''); + if (v && v !== '#') w.links.push(v); + } + for (const m of body.matchAll(/(?<![\w-])name\s*=\s*["']([^"']+)["']/g)) { + const tag = (/<([A-Za-z][\w.-]*)[^<]*$/.exec(body.slice(Math.max(0, m.index - 600), m.index)) || [])[1] || ''; + if (!/^(meta|slot|iframe|param|a|map|object|link)$/i.test(tag)) w.fields.push(m[1]); + } + for (const m of body.matchAll(/\bregister\(\s*["']([\w.-]+)["']/g)) w.fields.push(m[1]); + for (const m of body.matchAll(new RegExp(String.raw`\bdata-(?:testid|test|cy|qa|track[\w-]*|analytics[\w-]*|event[\w-]*|gtm[\w-]*)\s*=\s*` + val, 'g'))) w.hooks.push(squash(m[1]).replace(/^["']|["']$/g, '')); + for (const m of body.matchAll(/(?<![\w-])id\s*=\s*["']([^"'{}\s]+)["']/g)) w.ids.push(m[1]); + for (const m of body.matchAll(/<script\b[^>]*\bsrc\s*=\s*["']([^"']+)["']/gi)) w.scripts.push(m[1].split('?')[0].replace(/^\.\//, '')); + return w; +} +function scriptText(doc) { + const raw = doc.raw || doc.src; + let js = [...raw.matchAll(/<script\b(?![^>]*\bsrc\s*=)(?![^>]*application\/(?:ld\+)?json)[^>]*>([\s\S]*?)<\/script>/gi)].map((m) => m[1]).join('\n'); + for (const m of raw.matchAll(/<script\b[^>]*\bsrc\s*=\s*["']([^"']+)["']/gi)) { + if (/^(?:https?:)?\/\//.test(m[1])) continue; + try { js += '\n' + readFileSync(resolve(dirname(doc.file), m[1].split('?')[0]), 'utf8'); } catch {} + } + return js; +} +function scriptSelectors(doc) { + const js = scriptText(doc); + const sels = new Set(); + for (const m of js.matchAll(/getElementById\(\s*["'`]([\w-]+)["'`]/g)) sels.add('#' + m[1]); + for (const m of js.matchAll(/(?:querySelector(?:All)?|closest|matches)\(\s*(["'`])((?:(?!\1)[^\\\n])+)\1/g)) if (!m[2].includes('${')) sels.add(m[2].trim()); + return [...sels].sort(); +} +function scriptHooks(doc) { + const markup = (doc.raw || doc.src).replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi, ''); + const has = (tok) => tok[0] === '#' ? new RegExp(`(?<![\\w-])id\\s*=\\s*["']${escRe(tok.slice(1))}["']`).test(markup) + : tok[0] === '.' ? new RegExp(`(?<![\\w-])class\\s*=\\s*["'][^"']*(?<![\\w-])${escRe(tok.slice(1))}(?![\\w-])`).test(markup) + : markup.includes(tok.slice(1)); + const queried = scriptSelectors(doc); + const tokens = (sel) => [...sel.matchAll(/#[\w-]+|\.[A-Za-z_][\w-]*|\[data-[\w-]+/g)].map((t) => t[0]); + return { queried, hooked: queried.filter((sel) => { const t = tokens(sel); return t.length > 0 && t.every(has); }) }; +} +function takeInventory() { + const docs = [...new Set(contexts.flatMap(([, c]) => c.docs))]; + const byFile = {}; + for (const d of docs) { const w = wiringOf(d.raw || d.src); byFile[rel(d.file)] = Object.fromEntries(Object.entries(w).map(([k, v]) => [k, [...new Set(v)].sort()])); } + const pages = {}; + for (const [file, inv] of Object.entries(domInventories)) if (inv) pages[/^https?:/.test(file) ? file : rel(file)] = inv; + const scripts = {}; + for (const d of docs) if (d.kind === 'html') { + const h = scriptHooks(d); + const dom = domInventories[d.file]; + if (dom && Array.isArray(dom.hooked)) h.dom = dom.hooked; + h.hides = /\.hidden\s*=|["'`]hidden["'`]/.test(scriptText(d)); + if (h.queried.length || h.hides) scripts[rel(d.file)] = h; + } + return { files: byFile, wiring: unionWiring(Object.values(byFile)), scripts, pages }; +} +function unionWiring(list) { + const u = { handlers: new Set(), links: new Set(), fields: new Set(), hooks: new Set(), ids: new Set() }; + for (const w of list) for (const k of Object.keys(u)) for (const v of w[k] || []) u[k].add(v); + return Object.fromEntries(Object.entries(u).map(([k, v]) => [k, [...v].sort()])); +} +let keptLine = null; +if (opts.kept) { + let was = null; + try { was = JSON.parse(readFileSync(SNAP, 'utf8')); } catch {} + WAIVED = new Set(); ANSWERED = new Set(); DISMISSED = new Set(); VERBATIM = false; APPSCREEN = false; LAYOUT_KEPT = false; + if (!was) report('kept', 'FAIL', SNAP, 1, 'no before record here; --kept has nothing to compare against', 'Run sloplint with --before from this folder before the redesign starts'); + else { + const now = takeInventory(); + const outside = Object.keys(was.files || {}).filter((f) => !(f in now.files) && existsSync(resolve(f))); + if (was.files) was.wiring = unionWiring(Object.entries(was.files).filter(([f]) => !outside.includes(f)).map(([, w]) => w)); + const stamps = contexts.map(([, c]) => c.stampText).join('\n'); + for (const m of stamps.matchAll(/\/\*\s*Hallmark\s*·\s*(dropped|reworded)\s+([^·*]+?)\s*·\s*([^*]+?)\s*\*\//gi)) if (m[2].trim() && m[3].trim().length < 12) report('kept', 'WARN', SNAP, 1, `${m[1]} ${trunc(m[2].trim(), 40)} is not on the record: its reason is under 12 characters`, 'Say why in a clause'); + const allowed = [...stamps.matchAll(/\/\*\s*Hallmark\s*·\s*(dropped|reworded)\s+([^·*]+?)\s*·\s*([^*]+?)\s*\*\//gi)].filter((m) => m[3].trim().length >= 12).flatMap((m) => (m[1].toLowerCase() === 'reworded' ? [...m[2].matchAll(/"([^"]+)"/g)].map((q) => q[1]) : m[2].split(',')).map((t) => t.trim().replace(/^[`"']|[`"']$/g, '').toLowerCase()).filter(Boolean)); + const acked = {}; + const gone = (a, b, cat) => (a || []).filter((x) => { + if ((b || []).includes(x)) return false; + if (allowed.some((t) => x.toLowerCase() === t || (t.length >= 4 && x.toLowerCase().includes(t)))) { if (cat) (acked[cat] ||= new Set()).add(x); return false; } + return true; + }); + const fieldsGone = (b, a, where) => { + const named = (b || []).filter((x) => !x.startsWith('unnamed ')); + const spare = (a || []).length - named.filter((x) => (a || []).includes(x)).length; + const short = Math.max(0, (b || []).length - named.length - spare); + return [...gone(named, a, 'fields'), ...(short ? [`${short} field${short > 1 ? 's' : ''} with no name${where}`] : [])]; + }; + const hard = { links: new Set(), fields: new Set(), forms: new Set(), handlers: new Set(), 'test hooks': new Set(), scripts: new Set() }; + const soft = { headings: new Set(), figures: new Set(), images: new Set(), ids: new Set() }; + const total = { links: new Set(was.wiring.links), fields: new Set(was.wiring.fields), handlers: new Set(was.wiring.handlers), 'test hooks': new Set(was.wiring.hooks), headings: new Set(), figures: new Set() }; + for (const x of gone(was.wiring.links, now.wiring.links, 'links')) hard.links.add(x); + for (const x of gone(was.wiring.fields, now.wiring.fields, 'fields')) hard.fields.add(x); + for (const x of gone(was.wiring.handlers, now.wiring.handlers, 'handlers')) hard.handlers.add(x); + for (const x of gone(was.wiring.hooks, now.wiring.hooks, 'test hooks')) hard['test hooks'].add(x); + for (const x of gone(was.wiring.ids, now.wiring.ids)) soft.ids.add(x); + for (const [f, w] of Object.entries(was.files || {})) if (now.files[f]) for (const x of gone(w.scripts, now.files[f].scripts)) hard.scripts.add(`${x} on ${f}`); + const skipped = []; + let wordsWas = 0, wordsNow = 0; + for (const [k, b] of Object.entries(was.pages || {})) { + const a = now.pages[k]; + if (!a) { skipped.push(k); continue; } + for (const x of b.links || []) total.links.add(x); + for (const x of b.fields || []) total.fields.add(x); + for (const x of b.headings || []) total.headings.add(x); + for (const x of b.figures || []) total.figures.add(x); + for (const x of gone(b.links, [...a.links, ...now.wiring.links], 'links')) hard.links.add(x); + for (const x of fieldsGone(b.fields, a.fields, ` on ${k}`)) hard.fields.add(x); + for (const x of gone(b.actions, a.actions)) hard.forms.add(x); + for (const x of gone(b.headings, a.headings, 'headings')) soft.headings.add(x); + for (const x of gone(b.figures, a.figures, 'figures')) soft.figures.add(x); + for (const x of gone(b.images, a.images)) soft.images.add(x); + wordsWas += b.words || 0; wordsNow += a.words || 0; + } + const list = (set, n = 8) => { const a = [...set]; return a.slice(0, n).map((x) => trunc(x, 48)).join(', ') + (a.length > n ? ` and ${a.length - n} more` : ''); }; + const fix = 'Restore each one, or record it in the stamp: /* Hallmark · dropped <item>, <item> · <the reason> */'; + total['script hooks'] = new Set(); hard['script hooks'] = new Set(); + for (const [f, h] of Object.entries(was.scripts || {})) { + if (outside.includes(f)) continue; + const n = now.scripts[f]; + const both = n && h.dom && n.dom; + const had = both ? h.dom : h.hooked; + for (const x of had) total['script hooks'].add(`${f} ${x}`); + const unhooked = n ? had.filter((x) => n.queried.includes(x) && !(both ? n.dom : n.hooked).includes(x)) : []; + for (const x of unhooked) hard['script hooks'].add(`${f} ${x}`); + } + const guard = contexts.some(([, c]) => c.rules.some((r) => /\[hidden\]/.test(r.selector) && r.decls.some((d) => d.prop === 'display' && /none/.test(d.value)))); + if (!guard && Object.values(now.scripts).some((h) => h.hides)) report('kept', 'FAIL', SNAP, 1, 'a script hides elements with the hidden attribute and no rule pins it, so any display rule shows them again', 'Add [hidden] { display: none !important; } to the stylesheet'); + for (const [k, b] of Object.entries(was.pages || {})) { + const a = now.pages[k]; + if (!a) continue; + for (const bf of b.forms || []) { + const af = (a.forms || []).find((x) => x.key === bf.key) || (a.forms || []).find((x) => x.attrs.join() === bf.attrs.join()); + if (!af) { if (!allowed.includes(bf.key.toLowerCase())) hard.forms.add(`the form ${bf.key} on ${k}`); continue; } + for (const x of fieldsGone(bf.fields, af.fields, '')) hard.fields.add(`${x} in ${bf.key} on ${k}`); + for (const x of bf.hidden) if (!af.hidden.includes(x)) hard.fields.add(`hidden ${x} in ${bf.key} on ${k}`); + for (const x of bf.attrs) if (!af.attrs.includes(x)) hard.forms.add(`${x} on ${bf.key} (${k})`); + if (bf.submits && !af.submits) hard.forms.add(`a submit control in ${bf.key} (${k})`); + for (const x of bf.controls || []) if (!(af.controls || []).includes(x) && !(!x.includes('[name=') && (af.controls || []).some((y) => y.startsWith(`${x}[name=`))) && !allowed.some((t) => x.toLowerCase().includes(t) && t.length >= 4)) hard.forms.add(`${x} in ${bf.key} (${k})`); + } + } + for (const x of [...hard.fields]) if ([...hard.fields].some((y) => y.startsWith(`${x} in `))) hard.fields.delete(x); + for (const [k, set] of Object.entries(hard)) if (set.size) report('kept', 'FAIL', SNAP, 1, k === 'script hooks' ? `a script still queries what its page no longer has: ${list(set)}` : k === 'forms' ? `a form lost what it had before: ${list(set)}` : `${k} the page had before and no longer has: ${list(set)}`, k === 'script hooks' ? 'Keep the ids, classes and attributes scripts query, or change the script with the markup' : fix); + for (const [k, set] of Object.entries(soft)) if (set.size) report('kept', 'WARN', SNAP, 1, `${k} gone or reworded since the before record: ${list(set)}`, 'Restore it, or record it in the stamp: /* Hallmark · reworded "<old>" to "<new>" · <the gate that named it> */ or dropped <item> · <the reason>'); + if (wordsWas > 80 && wordsNow < wordsWas * 0.6) report('kept', 'WARN', SNAP, 1, `the pages hold ${wordsNow} words where they held ${wordsWas}`, 'Check that no section of content was dropped'); + if (skipped.length) report('kept', 'WARN', SNAP, 1, `not compared, because this run did not render them: ${list(skipped, 4)}`, 'Render the same pages or URLs the before record holds'); + if (outside.length) report('kept', 'WARN', SNAP, 1, `not compared, because this run did not read them: ${list(outside, 4)}`, 'Run --kept on the same target as --before'); + const lostOf = (k) => (hard[k] || soft[k]).size; + keptLine = { parts: ['links', 'fields', 'handlers', 'test hooks', 'script hooks', 'headings', 'figures'].filter((k) => total[k].size).map((k) => { const d = acked[k] ? acked[k].size : 0; return `${k} ${Math.max(0, total[k].size - lostOf(k) - d)}/${total[k].size}${d ? ` (${d} dropped on record)` : ''}`; }), was: was.summary || null }; + } +} + +const seen = new Set(); +const tierOk = (f) => !opts.tier || (opts.tier === 'floor' ? (f.tier === 'floor' && f.grade === 'FAIL') : f.tier === opts.tier); +const unique = findings.filter((f) => { + if (!tierOk(f)) return false; + const k = `${f.gate}|${f.grade}|${f.file}|${f.line}|${f.evidence}`; + if (seen.has(k)) return false; + seen.add(k); + return true; +}); + +unique.sort((a, b) => { + const ra = GRADE_RANK[a.grade] ?? 9, rb = GRADE_RANK[b.grade] ?? 9; + if (ra !== rb) return ra - rb; + const ga = gateSortKey(a.gate), gb = gateSortKey(b.gate); + if (ga !== gb) return ga - gb; + if (a.file !== b.file) return a.file < b.file ? -1 : 1; + return a.line - b.line; +}); + +const count = (g) => unique.filter((f) => f.grade === g).length; +const fails = count('FAIL'); +const reflex = count('REFLEX'); +const warns = count('WARN'); +const waived = count('WAIVED'); +const rejected = count('WAIVER'); +const answered = count('ANSWERED'); +const dismissed = count('DISMISSED'); +const notes = count('NOTE'); + +const tally = [`${fails} FAIL`]; +if (reflex) tally.push(`${reflex} REFLEX`); +tally.push(`${warns} WARN`); +if (waived) tally.push(`${waived} WAIVED`); +if (rejected) tally.push(`${rejected} REJECTED`); +if (answered) tally.push(`${answered} ANSWERED`); +if (dismissed) tally.push(`${dismissed} DISMISSED`); +if (notes) tally.push(`${notes} NOTE`); + +let beforeLine = null; +if (opts.before) { + const inv = takeInventory(); + mkdirSync(dirname(SNAP), { recursive: true }); + writeFileSync(SNAP, JSON.stringify({ v: 1, at: new Date().toISOString(), scope: opts.scope, summary: { fails, reflex, warns }, ...inv }, null, 1) + '\n'); + beforeLine = `before: recorded ${new Set([...inv.wiring.links, ...Object.values(inv.pages).flatMap((p) => p.links)]).size} links, ${new Set([...inv.wiring.fields, ...Object.values(inv.pages).flatMap((p) => p.fields)]).size} fields, ${inv.wiring.handlers.length} handlers, ${inv.wiring.hooks.length} test hooks, ${new Set(Object.values(inv.scripts).flatMap((h) => h.hooked)).size} script hooks${Object.keys(inv.pages).length ? ` and ${Object.keys(inv.pages).length} rendered page(s)` : ''} in ${rel(SNAP)}; --kept checks a redesign against it`; +} +const keptNote = keptLine ? `kept: ${keptLine.parts.join(', ') || 'nothing recorded'}${keptLine.was ? `; before ${keptLine.was.fails} FAIL, ${keptLine.was.reflex} REFLEX, now ${fails} FAIL, ${reflex} REFLEX` : ''}` : null; +let compareNote = null; +if (opts.kept && opts.render && !renderNotRun) { + try { + const mod = await import(new URL('./sloplint-render.mjs', import.meta.url).href); + const made = mod.writeCompare([...files.filter((f) => extname(f).toLowerCase() === '.html'), ...opts.urls], keptNote ? keptNote.replace(/^kept: /, 'Kept: ').replace(/; before (\d+) FAIL, (\d+) REFLEX, now (\d+) FAIL, (\d+) REFLEX/, '. Floor findings: $1 before, $3 now. Reflex findings: $2 before, $4 now') + '.' : null); + if (made.length) compareNote = `compare: ${made.map(rel).join(', ')} shows before and after side by side`; + } catch {} +} +const scopeNote = `${files.length} file(s)${opts.urls.length ? ` and ${opts.urls.length} URL(s)` : ''}${opts.stage === 'hero' ? ' (hero stage)' : ''}`; +const renderNote = opts.render ? (renderNotRun ? `render tier not run: ${renderNotRun}` : null) : null; +if (opts.json) { + console.log(JSON.stringify({ + summary: { fails, reflex, warns, waived, rejected, answered, dismissed, notes, files: files.length, render: opts.render ? (renderNotRun ? `not run: ${renderNotRun}` : 'ran') : 'off', ...(keptNote ? { kept: keptNote } : {}), ...(beforeLine ? { before: beforeLine } : {}) }, + findings: unique, + }, null, 2)); +} else { + if (!unique.length) console.log(`sloplint: clean. 0 FAIL, 0 REFLEX, 0 WARN across ${scopeNote}.`); + else if (opts.before) { + const by = new Map(); + for (const f of unique) { const k = `${f.grade} ${f.gate}`; if (!by.has(k)) by.set(k, []); by.get(k).push(f); } + for (const [k, list] of by) console.log(` ${k}${list.length > 1 ? ` x${list.length}` : ''} ${list.slice(0, 2).map((f) => `${f.file}:${f.line} ${trunc(f.evidence, 64)}`).join('; ')} | fix: ${list[0].fix}`); + const every = join(dirname(SNAP), 'before.txt'); + mkdirSync(dirname(SNAP), { recursive: true }); + const ignore = join(dirname(SNAP), '.gitignore'); + if (!existsSync(ignore)) writeFileSync(ignore, 'shots/\nbefore/\nbefore.json\nbefore.txt\ncompare.html\n'); + writeFileSync(every, unique.map((f) => `${f.grade} ${f.gate} ${f.file}:${f.line} ${f.evidence} | fix: ${f.fix}`).join('\n') + '\n'); + console.log(`sloplint: ${tally.join(', ')} across ${scopeNote}, grouped by gate; every line is in ${rel(every)}.`); + } else { + const byFile = new Map(); + for (const f of unique) { if (!byFile.has(f.file)) byFile.set(f.file, []); byFile.get(f.file).push(f); } + const told = new Set(); + for (const [file, list] of byFile) { + console.log(file); + for (const f of list) { + const key = `${f.gate}|${f.fix}`; + const fix = f.grade !== 'WAIVED' && f.grade !== 'ANSWERED' && f.grade !== 'DISMISSED' && !told.has(key) ? ` | fix: ${f.fix}` : ''; + told.add(key); + console.log(` ${f.grade} ${f.gate} :${f.line} ${f.evidence}${fix}`); + } + } + console.log(`sloplint: ${tally.join(', ')} across ${scopeNote}.`); + } + if (renderNote) console.log(renderNote); + if (keptNote) console.log(keptNote); + if (compareNote) console.log(compareNote); + if (beforeLine) console.log(beforeLine); +} +const exitCode = !opts.before && (fails > 0 || reflex > 0) ? 1 : 0; +if (process.stdout.writableLength) process.stdout.once('drain', () => process.exit(exitCode)); else process.exit(exitCode); diff --git a/skills/hallmark/scripts/theme.mjs b/skills/hallmark/scripts/theme.mjs new file mode 100644 index 0000000..079d3cd --- /dev/null +++ b/skills/hallmark/scripts/theme.mjs @@ -0,0 +1,660 @@ +#!/usr/bin/env node +import { readFileSync, writeFileSync, readdirSync, existsSync, mkdirSync, renameSync } from 'node:fs'; +import { join, dirname, basename, resolve } from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { createHash, randomBytes } from 'node:crypto'; + +const HERE = dirname(fileURLToPath(import.meta.url)); +const THEMES = join(HERE, '..', 'references', 'themes'); +const INDEX = join(THEMES, 'index.json'); +const VERSION = '2.0.0'; +const PHOTOS = join(HERE, 'photos.json'); +const args = process.argv.slice(2); +const cmd = args[0]; +const flag = (k, d = null) => { const i = args.indexOf('--' + k); const v = i >= 0 ? args[i + 1] : undefined; return v !== undefined && !String(v).startsWith('--') ? v : d; }; +const has = (k) => args.includes('--' + k); +const VALUED = new Set(['genre', 'prompt', 'brief', 'log', 'n', 'reroll', 'dealt', 'dir', 'axes', 'face', 'hue', 'entry', 'redesign', 'scope', 'theme', 'orient', 'save', 'avoid', 'material', 'seed', 'job']); +const positional = () => { const out = []; for (let i = 1; i < args.length; i++) { const a = args[i]; if (a.startsWith('--')) { if (VALUED.has(a.slice(2))) i++; continue; } out.push(a); } return out; }; +const GENRES = ['editorial', 'modern-minimal', 'atmospheric', 'playful']; +// A theme slug names a file in references/themes, so it is a plain name, never a path. +const isSlug = (s) => /^[a-z0-9][a-z0-9-]*$/.test(s); + +function usage() { + console.error(`usage: + node theme.mjs deal --genre <g> --prompt "<prompt>" [--log .hallmark/log.json] [--n 3] [--reroll 0] [--json] + node theme.mjs scaffold <slug> [--dealt "<n>/3, seed <seed>"] [--redesign polish|restyle|full] [--scope app] [--dir <beside the stylesheet>] [--force] + node theme.mjs scaffold --custom | --brand [--redesign polish|restyle|full] [--scope app] [--dir <beside the stylesheet>] [--force] + node theme.mjs check [--axes "<paper>/<display>/<accent>"] [--face "<display face>"] [--hue <accent hue>] [--log .hallmark/log.json] + paper: light | mid | dark · accent: warm | cool | neutral | chromatic-<hue name> + display: roman-serif | high-contrast-serif | slab-serif | grotesk-sans | grotesk-heavy | geometric-sans | rounded-sans | display-condensed | display-heavy | mono | pixel | handwritten | blackletter + node theme.mjs draw --material photo|product|words --job <subscribe|book|visit|attend|buy|try|sign up|hire|join|listen> [--theme <slug>] [--log .hallmark/log.json] [--seed <hex>] + node theme.mjs photos "<subject>" ["<subject>" ...] [--theme <slug>] [--n 3] [--orient landscape|portrait|square] [--log .hallmark/log.json] [--avoid <file naming photos>] [--save <dir>] [--json] + node theme.mjs log --entry '<one JSON object>' [--log .hallmark/log.json] + node theme.mjs index + node theme.mjs list + node theme.mjs validate <files...>`); +} + +function parseHeader(src, file) { + const m = /^---\r?\n([\s\S]*?)\r?\n---/.exec(src); + if (!m) throw new Error(`${file}: no header block`); + const h = {}; + for (const line of m[1].split('\n')) { + const mm = /^([a-z]+):\s*(.*)$/.exec(line.trim()); + if (mm) h[mm[1]] = mm[2].trim(); + } + const need = ['name', 'slug', 'genre', 'paper', 'display', 'accent', 'posture', 'keywords', 'material']; + for (const k of need) if (!h[k]) throw new Error(`${file}: header is missing "${k}"`); + const [pband, pL, phue] = h.paper.split(/\s+/); + const [dclass, ...dface] = h.display.split(/\s+/); + const [aband, ahue] = h.accent.split(/\s+/); + return { + name: h.name, slug: h.slug, genre: h.genre, posture: h.posture, + paper: { band: pband, L: Number(pL), hue: Number(phue) }, + display: { class: dclass, face: dface.join(' ') }, + accent: { band: aband, hue: Number(ahue) }, + keywords: h.keywords.split(',').map((s) => s.trim().toLowerCase()).filter(Boolean), + material: h.material, file: `references/themes/${basename(file)}`, + ...(h.photo ? { photo: h.photo } : {}), + ...(h.pictured ? { pictured: h.pictured } : {}), + ...(existsSync(join(THEMES, basename(file).replace(/\.md$/, '.jpg'))) ? { picture: `references/themes/${basename(file).replace(/\.md$/, '.jpg')}` } : {}), + }; +} + +function buildIndex() { + const files = readdirSync(THEMES).filter((f) => f.endsWith('.md') && f !== 'README.md').sort(); + const entries = files.map((f) => parseHeader(readFileSync(join(THEMES, f), 'utf8'), f)); + const slugs = new Set(); + for (const e of entries) { + if (slugs.has(e.slug)) throw new Error(`duplicate slug ${e.slug}`); + slugs.add(e.slug); + } + writeFileSync(INDEX, JSON.stringify({ themes: entries }, null, 1) + '\n'); + return entries; +} + +function loadIndex() { + if (!existsSync(INDEX)) return buildIndex(); + return JSON.parse(readFileSync(INDEX, 'utf8')).themes; +} + +function addLog() { + const file = resolve(flag('log', '.hallmark/log.json')); + let entry; + try { entry = JSON.parse(flag('entry', '')); } catch { entry = null; } + if (!entry || Array.isArray(entry) || typeof entry !== 'object') { console.error('--entry takes one JSON object, the build\'s log entry'); process.exit(2); } + if (!entry.date) entry.date = new Date().toISOString().slice(0, 10); + if (!entry.mode) entry.mode = 'build'; + if (!['build', 'redesign'].includes(entry.mode)) { console.error('mode is build or redesign'); process.exit(2); } + if (entry.mode === 'redesign' && !['polish', 'restyle', 'full'].includes(entry.depth)) { console.error('a redesign entry names its depth: polish, restyle or full'); process.exit(2); } + const composed = entry.scope !== 'app' && (entry.mode === 'build' || entry.depth === 'full'); + if (!entry.imagery && entry.enrichment) entry.imagery = entry.enrichment; + if (!entry.prompt && entry.brief) { entry.prompt = entry.brief; delete entry.brief; } + const missing = [...(composed ? ['shape', 'axes', 'hero', 'nav', 'footer', 'imagery', 'entry', 'fingerprint', 'sections', 'signature'] : []), ...(entry.depth === 'polish' ? [] : ['theme']), 'prompt'].filter((k) => !entry[k]); + if (entry.photos && !Array.isArray(entry.photos)) { console.error('photos is the list of photo ids the page used'); process.exit(2); } + if (existsSync(file)) { try { JSON.parse(readFileSync(file, 'utf8')); } catch { console.error(`${file} is not valid JSON; fix it or move it aside, nothing was written`); process.exit(1); } } + const next = [entry, ...readLog(file)].slice(0, 20); + mkdirSync(dirname(file), { recursive: true }); + const tmp = `${file}.${process.pid}.tmp`; + writeFileSync(tmp, JSON.stringify(next, null, 1) + '\n'); + renameSync(tmp, file); + console.log(`logged ${entry.mode === 'redesign' ? `a ${entry.depth} redesign` : entry.shape || '?'} in ${entry.theme || '?'} at the top of ${file} (${next.length} of 20)${missing.length ? `; missing ${missing.join(', ')}, which Rotation reads, so log them` : ''}`); +} + +function readLog(p) { + if (!p || !existsSync(p)) return []; + try { const j = JSON.parse(readFileSync(p, 'utf8')); return Array.isArray(j) ? j : (j.runs || []); } catch { return []; } +} + +function contrastOf(f, b) { + const rgb = ([L, C, H]) => { const h = H * Math.PI / 180, x = C * Math.cos(h), y = C * Math.sin(h); const l = (L + 0.3963377774 * x + 0.2158037573 * y) ** 3, m = (L - 0.1055613458 * x - 0.0638541728 * y) ** 3, s2 = (L - 0.0894841775 * x - 1.2914855480 * y) ** 3; return [4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s2, -1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s2, -0.0041960863 * l - 0.7034186147 * m + 1.7076147010 * s2].map((c) => Math.min(1, Math.max(0, c))); }; + const Y = (c) => 0.2126 * c[0] + 0.7152 * c[1] + 0.0722 * c[2]; + const a = Y(rgb(f)), c = Y(rgb(b)); + return (Math.max(a, c) + 0.05) / (Math.min(a, c) + 0.05); +} + +const triple = (t) => `${t.paper.band}/${t.display.class}/${t.accent.band}`; +const words = (s) => (s || '').toLowerCase().replace(/[^a-z0-9\s-]/g, ' ').split(/\s+/).filter((w) => w.length > 2); +const ASK = new Set(['build', 'make', 'create', 'design', 'need', 'want', 'please', 'page', 'site', 'website', 'landing', 'called', 'for', 'and', 'the', 'with', 'that', 'this', 'our', 'your']); +const promptWords = (s) => words(s).filter((w) => !ASK.has(w)); +const stem = (w) => { let x = w.replace(/(?:ing|ed)$/, ''); if (x.length < 3) x = w; return x.endsWith('ss') ? x : x.replace(/s$/, ''); }; +const hueGap = (a, b) => { const d = Math.abs(((a - b) % 360 + 360) % 360); return Math.min(d, 360 - d); }; + +function seededRand(key) { + let h = createHash('sha256').update(key).digest(); + let i = 0; + return () => { if (i >= h.length - 4) { h = createHash('sha256').update(h).digest(); i = 0; } const v = h.readUInt32BE(i); i += 4; return v / 0xffffffff; }; +} + +function pickFrom(pool, n, exclude) { + const avail = pool.filter((s) => !exclude.has(s.t.slug)); + const picked = []; + const tripleOf = (s) => triple(s.t); + if (!avail.length) return picked; + picked.push(avail[0]); + const rest = () => avail.filter((s) => !picked.includes(s)); + if (n >= 2 && rest().length) { + const best = rest()[0]; + const other = rest().find((s) => s.t.paper.band !== picked[0].t.paper.band && s.fit >= best.fit - 2 && tripleOf(s) !== tripleOf(picked[0])); + picked.push(other || rest().find((s) => tripleOf(s) !== tripleOf(picked[0])) || best); + } + while (picked.length < n && rest().length) { + const cand = rest().find((s) => picked.every((p) => tripleOf(p) !== tripleOf(s))) || rest()[0]; + picked.push(cand); + } + return picked; +} + +// A project's own salt, so two projects dealing the same prompt on the same day get different hands; +// one project still gets the same deal back (reroll moves it on). +function projectSalt() { + const f = resolve(dirname(resolve(flag('log', '.hallmark/log.json'))), 'salt'); + try { if (existsSync(f)) return readFileSync(f, 'utf8').trim(); mkdirSync(dirname(f), { recursive: true }); const salt = randomBytes(4).toString('hex'); writeFileSync(f, salt + '\n'); return salt; } catch { return 'nosalt'; } +} + +// The draw: the structural decisions a model converges on when left alone, dealt fresh for every build +// against the log and the theme's own picture, so two builds of one prompt in one theme come out as +// different pages. The model takes it unless the prompt's material refuses a pick, and says so. +const DRAW = { + shapes: { + photo: ['Photographic', 'Marquee Hero', 'Split Studio', 'Catalogue', 'Narrative Workflow', 'Bento Grid', 'Conversational FAQ', 'Letter', 'Feature Stack'], + product: ['Workbench', 'Feature Stack', 'Bento Grid', 'Narrative Workflow', 'Marquee Hero', 'Split Studio', 'Conversational FAQ', 'Map / Diagram', 'Stat-Led'], + words: ['Long Document', 'Manifesto', 'Letter', 'Index-First', 'Conversational FAQ', 'Marquee Hero', 'Narrative Workflow'], + }, + heroes: { photo: ['Poster', 'Stage', 'Ledge', 'Settled', 'Poster', 'Stage'], product: ['Stage', 'Settled', 'Banner', 'Corridor', 'Stage'], words: ['Corridor', 'Ledge', 'Banner', 'Settled'] }, + navs: ['edge-aligned', 'floating pill', 'masthead', 'slab', 'search-led bar', 'banner over a retracting bar'], + footers: ['mast', 'statement', 'colophon block', 'newsletter-first', 'letter close', 'index columns'], + openers: ['Split', 'Showcase', 'Grid', 'Bento', 'Rows', 'Table', 'Steps', 'Statement', 'Rail', 'Pinned', 'Switcher', 'Index', 'Schedule', 'Offer'], + jobs: { + subscribe: { sections: ['an example issue set as it arrives (a sample)', 'the archive as an Index of past issues (sample titles)', 'who writes it, with a picture slot', 'the contents of one issue, as rows'], close: ['a second subscribe field under the archive', 'the archive itself, ending on the latest issue'], open: ['Index', 'Rail', 'Statement', 'Split'], heroes: ['Counter', 'Corridor', 'Index', 'Banner'], action: ['the subscribe field in the hero, beside the latest issue', 'the subscribe field in the hero and once more under the issues'] }, + book: { sections: ['the menu as a Switcher by lunch and dinner (sample dishes, no prices unless given)', 'the room as a full-bleed photograph with no head', 'hours and the address as a section of their own', 'the next free times as buttons'], close: ['hours, the address and the booking again', 'the booking beside one last photograph'], open: ['Switcher', 'Index', 'Schedule', 'Split', 'Showcase'], heroes: ['Counter', 'Poster', 'Stage', 'Index'], action: ['a sticky booking bar', 'the booking times in the hero', 'the booking beside the menu or the rooms'] }, + visit: { sections: ['what is on now as the lead picture', 'what is coming as dated rows', 'the shelves or the rooms as a Rail', 'getting there, with the hours'], close: ['visit information and the address', 'what is on next'], open: ['Showcase', 'Schedule', 'Rail', 'Split'], heroes: ['Poster', 'Ledge', 'Stage'], action: ['hours and the address in the hero', 'hours, the map and the way in at the close', 'a sticky bar with today\'s hours'] }, + attend: { sections: ['the days as a Schedule', 'the lineup as an Index, set large', 'ticket tiers as rows', 'the place and how to get there', 'questions as rows'], close: ['tickets again', 'the questions', 'the mailing list for the next edition'], open: ['Schedule', 'Index', 'Rail', 'Showcase'], heroes: ['Index', 'Poster', 'Counter', 'Ledge'], action: ['tickets in the hero', 'tickets beside the lineup', 'a sticky ticket bar'] }, + buy: { sections: ['the range as an Offer or a Rail (sample names; no prices unless given)', 'the thing in use, close and large', 'how it is made, as a Pinned run', 'delivery and care as plain facts'], close: ['the offer again', 'delivery and the guarantee as plain facts'], open: ['Offer', 'Rail', 'Showcase', 'Switcher'], heroes: ['Counter', 'Stage', 'Poster'], action: ['the offer as the hero', 'a sticky buy bar', 'the offer after the product close up'] }, + try: { sections: ['features as named moments in screens (Pinned or Switcher)', 'a before and after', 'the platforms and what it needs'], close: ['the download beside one last screen'], open: ['Pinned', 'Switcher', 'Showcase', 'Rail'], heroes: ['Counter', 'Stage', 'Settled'], action: ['the download beside the screen in the hero', 'the download in the hero and at the close'] }, + 'sign up': { sections: ['the product at work as a Pinned run', 'a code sample or the integration', 'pricing as a table with its period switch', 'questions as rows'], close: ['the hero\'s action in a short band', 'the code sample'], open: ['Pinned', 'Switcher', 'Showcase', 'Bento', 'Table'], heroes: ['Stage', 'Settled', 'Banner', 'Counter'], action: ['sign up in the hero', 'sign up in the hero and beside the price'] }, + hire: { sections: ['the work as an Index of projects with pictures', 'one project opened as a case', 'what the studio does, as a short list', 'where it is'], close: ['contact details per office', 'a plain email and phone'], open: ['Index', 'Rail', 'Showcase', 'Statement'], heroes: ['Index', 'Poster', 'Corridor', 'Ledge'], action: ['the enquiry after the work', 'a contact line in the nav and at the close'] }, + join: { sections: ['what a session is like, shown', 'when and where as a Schedule', 'membership options as rows', 'first-visit guidance'], close: ['the first visit', 'the membership options'], open: ['Schedule', 'Grid', 'Split', 'Showcase'], heroes: ['Counter', 'Poster', 'Corridor'], action: ['join in the hero', 'join beside the schedule'] }, + listen: { sections: ['the record with its tracks as an Index (sample titles unless given)', 'dates as rows with ticket links', 'earlier work as covers in a Rail', 'a live photograph or the video'], close: ['the dates', 'more of the catalogue', 'the mailing list'], open: ['Index', 'Rail', 'Showcase', 'Schedule'], heroes: ['Poster', 'Index', 'Counter', 'Ledge'], action: ['the player or the record in the hero', 'listen in the hero and the dates beside it'] }, + }, + leads: { photo: ['the place', 'the thing itself, close', 'the making', 'the offer and its price', 'the season or the date', 'the people at work'], product: ['the job it does', 'the screen at work', 'the speed or the limit', 'the material it handles', 'the price', 'the before and after'], words: ['the claim', 'the question', 'the first line of the argument', 'the date and the place', 'the list itself'] }, +}; +function draw() { + const material = flag('material', 'photo'); + if (!DRAW.shapes[material]) { console.error('--material is photo, product or words'); process.exit(2); } + const seed = flag('seed', '') || randomBytes(3).toString('hex'); + const rand = seededRand(`draw·${seed}`); + const log = readLog(flag('log', '.hallmark/log.json')); + const low = (x) => String(x || '').toLowerCase(); + let pictured = []; + const slug = flag('theme', ''); + if (slug && isSlug(slug) && existsSync(join(THEMES, `${slug}.md`))) pictured = low(parseHeader(readFileSync(join(THEMES, `${slug}.md`), 'utf8'), slug).pictured).split(/,\s*/).map((x) => x.replace(/ hero$/, '')); + const recent = (k, n) => log.slice(0, n).map((r) => low(r[k])); + const near = (opts, n, k, extra = []) => { const bad = new Set([...recent(k, n), ...extra]); const ok = opts.filter((o) => ![...bad].some((b) => b && b.includes(low(o)))); return ok.length ? ok : opts; }; + const take = (opts, m = 1) => { const pool = [...new Set(opts)]; const out = []; while (out.length < m && pool.length) out.push(pool.splice(Math.floor(rand() * pool.length), 1)[0]); return out; }; + const shapes = take(near(DRAW.shapes[material], 3, 'shape', pictured), 1); + // Synonyms match the whole job: "app" is try, "application" is not. + const JOB_SYNONYMS = { download: 'try', app: 'try', software: 'sign up', saas: 'sign up', newsletter: 'subscribe', waitlist: 'subscribe', watch: 'listen', read: 'listen' }; + const rawJob = low(flag('job', '')).trim(); + const jobName = JOB_SYNONYMS[rawJob] || rawJob; + const job = DRAW.jobs[jobName] || null; + const [hero] = take(near(job ? [...job.heroes, ...job.heroes, ...DRAW.heroes[material].filter((h) => !/settled|stage/i.test(h) || job.heroes.includes(h))] : DRAW.heroes[material], 1, 'hero', pictured)); + const [nav] = take(near(DRAW.navs, 3, 'nav')); + const [footer] = take(near(DRAW.footers.filter((f) => f !== 'newsletter-first' || /subscribe/.test(jobName)), 3, 'footer')); + const [action] = job ? take(job.action) : [null]; + const native = job ? take(job.sections, 3) : []; + const [close] = job ? take(job.close) : [null]; + const lastOpen = low((log[0] && (Array.isArray(log[0].sections) ? log[0].sections[0] : String(log[0].sections || '').split(/[,>·]/)[0])) || ''); + const [opener] = take((job ? job.open : DRAW.openers).filter((o) => !lastOpen.includes(low(o)))); + const skip = take(['Split', 'Grid', 'Band', 'Statement', 'Steps', 'Figures'].filter((o) => o !== opener), 2); + const [lead] = take(DRAW.leads[material]); + if (has('json')) { console.log(JSON.stringify({ seed, material, job: jobName || null, shapes, hero, nav, footer, opener, skip, lead, action, native, close })); return; } + console.log(`draw ${seed} (fresh each build; --seed ${seed} repeats it)${pictured.length ? ` · clear of the theme picture's ${pictured.join(' and ')}` : ''}`); + console.log(`shape: ${shapes[0]} · hero: ${hero} · nav: ${nav} · footer: ${footer}`); + console.log(`${job ? '' : `first section after the hero: ${opener} · `}leave out this time: ${skip.join(' and ')} · the hero leads with ${lead}, if the prompt has it`); + const jobs = 'subscribe, book, visit, attend, buy, try, sign up, hire, join, listen'; + console.log(job ? `job: ${jobName} · the action: ${action}\nbuild these, in the order the shape suits (the first right after the hero): ${native.join('; ')} · close on: ${close} (anatomy.md § ${jobName})` : rawJob ? `unknown --job "${rawJob}": name the page's job (${jobs}) and draw again with --job` : `no --job given: name the page's job (${jobs}) and draw again with --job`); + console.log(`photos: pass --seed ${seed} to every theme.mjs photos call, so this build's picks are its own, and take its first fitting pick for the hero rather than hunting for the library's single best frame`); + console.log('take the draw unless the prompt\'s material refuses a pick; name any swap in the Picks block, and stamp draw: ' + seed); +} + +function deal() { + const genre = flag('genre', 'editorial'); + if (!GENRES.includes(genre)) { console.error(`unknown genre "${genre}" (valid: ${GENRES.join(', ')})`); process.exit(2); } + const prompt = flag('prompt', flag('brief', '')); // --brief is the older name + const n = Number(flag('n', 3)); + const reroll = Number(flag('reroll', 0)); + const log = readLog(flag('log', '.hallmark/log.json')); + const themes = loadIndex(); + const recent = log.slice(0, 3); + const recentNames = new Set(recent.map((r) => String(r.theme || '').toLowerCase())); + const lastAxes = recent[0] && recent[0].axes ? String(recent[0].axes) : null; + const occupiedAxes = new Set(recent.map((r) => r.axes).filter(Boolean)); + const bw = new Set(promptWords(prompt).map(stem)); + const slug = `${promptWords(prompt).slice(0, 4).join('-') || 'prompt'}-${createHash('sha1').update(prompt.trim().toLowerCase()).digest('hex').slice(0, 4)}`; + const seedBase = `${slug}·${projectSalt()}·${new Date().toISOString().slice(0, 10)}`; + const seedKey = `${seedBase}·r${reroll}`; + const rand = seededRand(seedBase); + + const df = new Map(); + for (const t of themes) for (const k of new Set(t.keywords.map((k) => k.toLowerCase()))) df.set(k, (df.get(k) || 0) + 1); + const scored = themes.map((t) => { + let fit = 0; const hits = []; + for (const k of t.keywords) { const kw = k.toLowerCase().split(/\s+/).map(stem); if (kw.every((w) => bw.has(w))) { const d = df.get(k.toLowerCase()); fit += d <= 2 ? 3 : d <= 4 ? 2 : 1; hits.push(k); } } + if (t.genre === genre) fit += 2; else fit -= 1; + const blocked = recentNames.has(t.name.toLowerCase()) || (lastAxes && lastAxes === triple(t)); + const sibling = occupiedAxes.has(triple(t)); + if (sibling && !blocked) fit -= 1; + return { t, fit, hits, blocked, sibling, r: rand() }; + }); + const pool = scored.filter((s) => !s.blocked).sort((a, b) => b.fit - a.fit || a.r - b.r); + const previously = new Set(); + for (let r = 0; r < reroll; r++) { + const hand = pickFrom(pool, n, previously); + if (!hand.length) break; + for (const p of hand) previously.add(p.t.slug); + } + const picked = pickFrom(pool, n, previously); + if (!picked.length) { console.error(`nothing left to deal at reroll ${reroll}; use a lower --reroll`); process.exit(1); } + + if (has('json')) { console.log(JSON.stringify({ seed: seedKey, genre, deal: picked.map((s) => ({ ...s.t, fit: s.fit, hits: s.hits })), avoided: [...recentNames] })); return; } + console.log(`deal: ${seedKey} · genre ${genre}${reroll ? ` · reroll ${reroll}` : ''}`); + picked.forEach((s, i) => { + const why = s.hits.length ? `fits: ${s.hits.slice(0, 4).join(', ')}` : (s.t.genre === genre ? 'genre fit' : 'adjacent genre'); + console.log(`${i + 1}. ${s.t.name} (${s.t.slug}) · ${triple(s.t)} · ${s.t.material} · ${why}${s.t.picture ? ` · ${s.t.picture}` : ''}${s.t.pictured ? `, pictured as ${s.t.pictured}` : ''}`); + }); + if (recent.length) console.log(`avoid: ${recent.map((r) => `${r.theme || '?'} (${r.axes || 'no axes'})`).join(' · ')}`); + console.log(`next: look at the pictures, pick the material this prompt wants, read references/themes/<slug>.md, then theme.mjs scaffold <slug> --dealt "<n>/${picked.length}, seed ${seedKey}"`); +} + +const PAPER_BANDS = new Set(['light', 'mid', 'dark']); +const DISPLAY_CLASSES = new Set(['roman-serif', 'high-contrast-serif', 'slab-serif', 'grotesk-sans', 'grotesk-heavy', 'geometric-sans', 'rounded-sans', 'display-condensed', 'display-heavy', 'mono', 'pixel', 'handwritten', 'blackletter']); +const ACCENT_BAND = /^(warm|cool|neutral|chromatic-[a-z-]+)$/; +const listOf = (set) => [...set].join(', '); + +function check() { + const axes = flag('axes'); + if (!axes && !flag('face') && flag('hue') == null) { usage(); process.exit(2); } + const [pb, dc, ab] = (axes || '//').split('/').map((s) => s.trim()); + const unknown = !axes ? null : !PAPER_BANDS.has(pb) ? `paper band "${pb}" (valid: ${listOf(PAPER_BANDS)})` + : !DISPLAY_CLASSES.has(dc) ? `display class "${dc}" (valid: ${listOf(DISPLAY_CLASSES)})` + : !ACCENT_BAND.test(ab || '') ? `accent band "${ab}" (valid: warm, cool, neutral, chromatic-<hue name>)` : null; + if (unknown) { console.error(`unknown ${unknown}`); process.exit(2); } + const face = (flag('face', '') || '').toLowerCase().trim(); + const hue = flag('hue') != null ? Number(flag('hue')) : null; + const themes = loadIndex(); + const log = readLog(flag('log', '.hallmark/log.json')); + let bad = 0, near = 0; + const named = new Set(); + const look = (t) => `look at references/themes/${t.slug}.jpg beside your plan and move an axis only if the two would read alike`; + if (axes) for (const t of themes) { + if (t.paper.band === pb && t.display.class === dc && t.accent.band === ab) { near++; named.add(t.slug); console.log(`near: ${t.name} sits on ${triple(t)} · ${look(t)}`); } + } + const toks = (x) => x.split(/[\s-]+/).filter(Boolean); + const sameFamily = (a, b) => { const A = toks(a), B = toks(b), n = Math.min(A.length, B.length); return n > 0 && A.slice(0, n).join(' ') === B.slice(0, n).join(' '); }; + if (face) for (const t of themes) { + const tf = t.display.face.toLowerCase(); + if (sameFamily(tf, face)) { bad++; console.log(`collision: ${t.name} already sets its display in ${t.display.face} · pick a face no theme uses (fonts.md)`); } + } + if (hue != null) for (const t of themes) { + // with axes: themes on the same paper and display class within 20 degrees; hue alone: any theme within 10 + if (named.has(t.slug)) continue; + if (axes ? t.paper.band === pb && t.display.class === dc && hueGap(t.accent.hue, hue) <= 20 : hueGap(t.accent.hue, hue) <= 10) { near++; console.log(`near: ${t.name} is ${triple(t)} at hue ${t.accent.hue} · ${look(t)}`); } + } + const recent = axes ? log.slice(0, 3).filter((r) => r.axes === axes) : []; + for (const r of recent) { near++; console.log(`recent: ${r.theme || 'a build'} on ${r.date || '?'} used ${axes} · vary another decision (the shape, the pictures, the type scale)`); } + if (!bad && !near) { console.log(axes ? `clear: ${axes}${face ? ` in ${face}` : ''}${hue != null ? ` at hue ${hue}` : ''} lands on no catalog theme and no recent build` : [face && `clear: no catalog theme sets its display in ${flag('face')}`, hue != null && `clear: no catalog theme's accent sits within 10 degrees of hue ${hue}`].filter(Boolean).join('\n')); return; } + if (bad) process.exitCode = 1; +} + +function list() { + for (const t of loadIndex()) console.log(`${t.name.padEnd(12)} ${triple(t).padEnd(38)} ${t.genre.padEnd(15)} ${t.material}`); +} + +const TREATMENTS = { natural: {}, warm: { sepia: 0.28, saturate: 0.94 }, muted: { saturate: 0.65, contrast: 0.97 }, mono: { grayscale: 1, contrast: 1.18 } }; +const ADJUST = { con: ['contrast', (n) => 1 + n / 100], sat: ['saturate', (n) => Math.max(0, 1 + n / 100)], vib: ['saturate', (n) => 1 + n / 200], exp: ['brightness', (n) => 1 + n / 100], high: ['brightness', (n) => 1 + n / 300], shad: ['brightness', (n) => 1 + n / 400], sepia: ['sepia', (n) => n / 100], blur: ['blur', (n) => n / 20] }; +const r2 = (n) => Math.round(n * 100) / 100; + +// A theme's photo: line as CSS on every picture in a slot: filter functions, and for duotone or tint a +// multiply plate under the photo and a lighten plate over it, both in the theme's own tokens. +function treatmentOf(spec, tokens) { + const parts = String(spec || 'natural').trim().split(/\s+/); + const f = new Map(), bad = []; + let duo = null; + const tok = (n) => { if (!tokens[`--color-${n}`]) bad.push(`no --color-${n} token`); return `var(--color-${n})`; }; + for (let i = 0; i < parts.length; i++) { + const p = parts[i]; + if (p in TREATMENTS) for (const [k, v] of Object.entries(TREATMENTS[p])) f.set(k, v); + else if (p === 'duotone') { duo = [tok(parts[++i]), tok(parts[++i])]; f.set('grayscale', 1); if (!f.has('contrast')) f.set('contrast', 1.08); } + else if (p === 'tint') { const t = tok(parts[++i]); const dark = (tokens['--color-paper'] || [1])[0] < 0.4; duo = dark ? ['var(--color-paper)', t] : [`color-mix(in oklab, ${t}, black 55%)`, `color-mix(in oklab, ${t}, white 82%)`]; f.set('grayscale', 1); } + else if (/^[a-z]+=-?\d+$/.test(p) && p.split('=')[0] in ADJUST) { const [k, n] = p.split('='); const [fn, v] = ADJUST[k]; f.set(fn, k === 'vib' && f.has(fn) ? f.get(fn) * v(Number(n)) : v(Number(n))); } + else bad.push(`"${p}" is not a treatment (natural, warm, muted, mono, duotone <dark> <light>, tint <token>, or con|sat|vib|exp|high|shad|sepia|blur=<n>)`); + } + const filter = [...f].map(([k, v]) => `${k}(${k === 'blur' ? `${r2(v)}px` : r2(v)})`).join(' '); + const css = !filter && !duo ? '' : duo + ? `[data-slot]:has(> img) { isolation: isolate; background: ${duo[1]}; outline: 1px solid color-mix(in oklab, var(--color-ink) 8%, transparent); outline-offset: -1px; }\n[data-slot] > img { z-index: 0; filter: ${filter}; mix-blend-mode: multiply; }\n[data-slot]:has(> img)::before { content: ""; position: absolute; inset: 0; z-index: 1; background: ${duo[0]}; mix-blend-mode: lighten; pointer-events: none; }` + : `[data-slot] > img { filter: ${filter}; }`; + return { css, bad }; +} + +function tokensOf(src, file) { + const tok = {}; + for (const m of tokenBlockOf(src, file).matchAll(/(--color-[\w-]+):\s*oklch\(\s*([\d.]+)%\s+([\d.]+)\s+([\d.]+)\s*\)/g)) tok[m[1]] = [Number(m[2]) / 100, Number(m[3]), Number(m[4])]; + return tok; +} + +const SYNONYMS = { cafe: ['coffee'], coffee: ['cafe', 'espresso'], restaurant: ['dining', 'dish'], bakery: ['bread', 'pastry'], bread: ['bakery', 'loaf'], wine: ['vineyard', 'grape'], cider: ['apple', 'orchard'], gin: ['botanical', 'spirit', 'distillery'], beer: ['brewery'], ski: ['snow', 'slope'], snow: ['winter'], sea: ['coast', 'ocean'], beach: ['coast', 'sea'], hotel: ['room', 'lobby'], office: ['desk', 'workspace'], studio: ['workshop'], workshop: ['studio', 'craft'], pottery: ['ceramic', 'clay'], ceramic: ['pottery', 'clay'], weaving: ['loom', 'textile'], textile: ['fabric'], fabric: ['textile'], tailor: ['sewing', 'fabric'], fashion: ['clothing'], garden: ['plant', 'flower'], farm: ['field', 'farmland'], city: ['street', 'urban'], train: ['railway', 'station'], concert: ['music', 'stage'], music: ['concert', 'record'], book: ['library', 'reading'], print: ['printing', 'press'], skate: ['skateboard', 'skatepark'], running: ['runner', 'marathon'], gym: ['fitness'], yoga: ['wellness'], lab: ['science', 'laboratory'], doctor: ['clinic', 'medical'], kid: ['child', 'children'], dog: ['pet'], cat: ['pet'] }; + +async function photos() { + if (!existsSync(PHOTOS)) { console.error(`no photo library at ${PHOTOS}`); process.exit(1); } + const lib = JSON.parse(readFileSync(PHOTOS, 'utf8')).photos; + const subjects = positional(); + if (!subjects.length) { usage(); process.exit(2); } + const n = Math.max(1, Number(flag('n', 3)) || 3); + const orient = flag('orient', ''); + const slug = flag('theme', ''); + let header = null, treat = { css: '', bad: [] }; + if (slug) { + const file = join(THEMES, `${slug}.md`); + if (!isSlug(slug) || !existsSync(file)) { console.error(`no theme at ${file}`); process.exit(1); } + const src = readFileSync(file, 'utf8'); + header = parseHeader(src, file); + treat = treatmentOf(header.photo, tokensOf(src, file)); + if (treat.bad.length) console.error(`${slug}'s photo: line: ${treat.bad.join('; ')}`); + } + const recent = new Set(readLog(flag('log', '.hallmark/log.json')).slice(0, 5).flatMap((r) => Array.isArray(r.photos) ? r.photos : [])); + const avoidText = flag('avoid', '') && existsSync(flag('avoid', '')) ? readFileSync(flag('avoid', ''), 'utf8') : ''; + const avoid = { has: (id) => !!avoidText && (avoidText.includes(id) || avoidText.includes(id.replace(/ /g, '_'))) }; + const shape = (p) => { const r = p.w / p.h; return r > 1.18 ? 'landscape' : r < 0.85 ? 'portrait' : 'square'; }; + const PHOTO_STOP = new Set(['seen', 'from', 'with', 'into', 'onto', 'over', 'under', 'behind', 'above', 'below', 'beside', 'near', 'close', 'view', 'shot', 'photo', 'image', 'picture', 'some', 'very', 'one', 'two', 'three', 'each', 'every', 'its', 'their', 'his', 'her', 'who', 'where', 'while', 'up', 'down', 'out']); + const docs = lib.map((p) => { const t = new Set(); for (const x of p.tags) for (const w of words(x)) t.add(stem(w)); for (const w of words(p.subject)) t.add(stem(w)); t.add(stem(p.cat)); return t; }); + const df = new Map(); for (const d of docs) for (const w of d) df.set(w, (df.get(w) || 0) + 1); + const idf = (w) => Math.log((lib.length + 1) / ((df.get(w) || 0) + 1)) + 0.3; + // Close scores rotate from build to build, so two pages on one subject rarely share their photographs; --seed repeats a pick. + const jitter = seededRand(`photos·${flag('seed', '') || randomBytes(3).toString('hex')}`); + const used = new Set(); + const result = []; + for (const subject of subjects) { + const q = [...new Set(promptWords(subject).map(stem))].filter((w) => !PHOTO_STOP.has(w)); + const total = q.reduce((a, w) => a + idf(w), 0) || 1; + const wantFace = /\b(portrait|face|person|people)\b/i.test(subject); + const scored = lib.map((p, i) => { + if (used.has(p.id) || avoid.has(p.id) || (orient && shape(p) !== orient)) return null; + const d = docs[i]; let got = 0; const missing = []; + for (const w of q) { + if (d.has(w)) got += idf(w); + else if ((SYNONYMS[w] || []).some((x) => d.has(stem(x)))) got += 0.7 * idf(w); + else if ([...d].some((x) => { let k = 0; while (k < x.length && k < w.length && x[k] === w[k]) k++; return k >= 5 || (k >= 4 && Math.max(x.length, w.length) <= 6 && k >= 0.8 * Math.min(x.length, w.length)); })) got += 0.8 * idf(w); + else missing.push(w); + } + const cov = got / total; + if (cov < 0.45) return null; + let s = cov * 10; + for (const t of p.tags) if (t.includes(' ') && subject.toLowerCase().includes(t)) s += 1; + if (p.q === 3) s += 0.8; + if (p.tags.includes('overused')) s -= 0.8; + if (p.people === 'face' && !wantFace) s -= 3; + if (recent.has(p.id)) s -= 4; + s += jitter() * (flag('seed', '') ? 4 : 2.5); + if (header) { if (header.paper.band === 'dark' && p.tone !== 'light') s += 0.3; if (header.paper.band === 'light' && p.tone !== 'dark') s += 0.15; if ((header.accent.band === 'warm') === (p.temp === 'warm')) s += 0.2; } + return { p, s, cov, missing }; + }).filter(Boolean).sort((a, b) => b.s - a.s).slice(0, n); + for (const { p } of scored) used.add(p.id); + result.push({ subject, picks: scored.map(({ p, s, cov, missing }) => ({ ...p, orient: shape(p), score: Math.round(s * 10) / 10, match: cov >= 0.75 ? 'close' : 'partial', ...(missing.length ? { missing } : {}), sizes: widthsOf(p), credit: creditOf(p) })) }); + } + const saveDir = flag('save', ''); + if (saveDir) { + mkdirSync(resolve(saveDir), { recursive: true }); + for (const r of result) for (const p of r.picks) { + const w = p.sizes[p.sizes.length - 1]; + const file = join(resolve(saveDir), `${savedName(p.id)}-${w}.jpg`); + try { + const url = thumbOf(p, w); + if (!url.startsWith('https://upload.wikimedia.org/')) throw new Error('not a Wikimedia Commons file'); + let res; + for (let t = 0; t < 4; t++) { res = await fetch(url, { headers: { 'User-Agent': 'Hallmark/2.0 (https://github.com/Nutlope/hallmark; theme.mjs photos --save)' }, signal: AbortSignal.timeout(60000) }); if (res.status !== 429) break; await new Promise((ok) => setTimeout(ok, 10000 * (t + 1))); } + if (!res.ok) throw new Error(`HTTP ${res.status}`); + if (!/^image\//.test(res.headers.get('content-type') || '')) throw new Error(`not an image (${res.headers.get('content-type') || 'no content-type'})`); + writeFileSync(file, Buffer.from(await res.arrayBuffer())); p.saved = file; + } catch (e) { p.saved = null; p.error = String(e.message || e); } + } + } + if (has('json')) { console.log(JSON.stringify({ theme: slug || null, treatment: header ? header.photo || 'natural' : null, subjects: result })); return; } + if (header) console.log(`treatment: ${header.photo || 'natural'} (${slug})${treat.css ? '. It is CSS on every picture in a slot, written into base.css by the scaffold; a page built without it adds:\n' + treat.css : ', no filter'}`); + for (const r of result) { + console.log(`\n"${r.subject}"${r.picks.length ? '' : ': nothing in the library fits; try other words (the place, the material, the action), or leave a slot for the user\'s photo'}`); + for (const p of r.picks) { + const src = p.saved || thumbOf(p, p.sizes.includes(1280) ? 1280 : p.sizes[p.sizes.length - 1]); + const set = p.saved ? '' : ` srcset="${p.sizes.map((w) => `${thumbOf(p, w)} ${w}w`).join(', ')}"`; + const pos = p.fp ? ` style="object-position: ${Math.round(p.fp[0] * 100)}% ${Math.round(p.fp[1] * 100)}%"` : ''; + console.log(` ${p.subject} · ${p.w}x${p.h} ${p.orient} · ${p.tone}, ${p.temp}${p.people !== 'none' ? `, ${p.people}` : ''}${p.match === 'partial' ? ` · partial match, no ${p.missing.join(', ')}` : ''}${p.error ? ` · not saved: ${p.error}` : ''}`); + const [iw, ih] = p.saved ? [p.sizes[p.sizes.length - 1], Math.round(p.h * p.sizes[p.sizes.length - 1] / p.w)] : [p.w, p.h]; + console.log(` <img src="${src}"${set}${p.saved ? '' : ' sizes="100vw"'} width="${iw}" height="${ih}" alt="${p.subject}"${pos}>`); + console.log(` credit: ${p.credit}`); + } + } + console.log('\nset sizes to the layout (50vw for a half, 100vw full-bleed) and crop with the frame (aspect-ratio and object-fit: cover; object-position keeps the subject). Every photo carries its credit on the page: one line in the footer, "Photographs: <credit>, <credit>", each linked to its page (imagery.md § 2). Log the ids in the entry\'s photos list.'); +} + +const WIDTHS = [960, 1280, 1920]; +// The file name --save writes, which sloplint maps back to the library entry for its credit. +function savedName(id) { return id.replace(/\.[a-z]+$/i, '').normalize('NFKD').replace(/[\u0300-\u036f]/g, '').toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '').slice(0, 60) || `photo-${createHash('sha1').update(id).digest('hex').slice(0, 10)}`; } +// Commons serves thumbnails at standard widths only, and none at or past the original's width. +function widthsOf(p) { const w = WIDTHS.filter((x) => x < p.w); return w.length ? w : [WIDTHS[0]]; } +function thumbOf(p, w) { + const name = p.file.split('/').pop(); + return `${p.file.replace('/wikipedia/commons/', '/wikipedia/commons/thumb/')}/${w}px-${p.thumbName || name}`; +} +function creditOf(p) { return `<a href="${p.page}">${p.author}</a> (${p.license}, Wikimedia Commons)`; } + +function tokenBlockOf(src, file) { + const m = /```css\s*\n:root\s*\{([\s\S]*?)\n\}\s*\n```/.exec(src); + if (!m) throw new Error(`${file}: no :root block in a css fence`); + return m[1].replace(/\/\*[\s\S]*?\*\//g, '').split('\n').map((l) => l.replace(/\s+$/, '')).filter((l) => l.trim()).join('\n'); +} + +const SCALE = ` --space-3xs: 2px; --space-2xs: 4px; --space-xs: 8px; --space-sm: 12px; --space-md: 16px; --space-lg: 24px; --space-xl: 40px; --space-2xl: 64px; --space-3xl: 96px; --space-4xl: 144px; + --text-xs: 0.8125rem; --text-sm: 0.875rem; --text-md: 1rem; --text-lg: 1.25rem; --text-xl: 1.5625rem; --text-2xl: 1.953rem; --text-3xl: 2.441rem; + --text-display-s: clamp(2.25rem, 4vw + 0.5rem, 3.75rem); --text-display: clamp(2.75rem, 5vw + 1rem, 5.25rem); + --text-section: clamp(2rem, 2.5vw + 1rem, 3.5rem); --text-title: clamp(1.25rem, 0.75vw + 0.875rem, 1.625rem); --text-lead: clamp(1.125rem, 0.35vw + 1rem, 1.375rem); + --ease-out: cubic-bezier(0.16, 1, 0.3, 1); --ease-in: cubic-bezier(0.7, 0, 0.84, 0); --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1); + --dur-micro: 120ms; --dur-short: 220ms; --dur-long: 420ms; + --color-error: oklch(52% 0.19 27); --color-success: oklch(50% 0.12 150); + --container: 1440px; --gutter: 64px; --gap-columns: 32px; --section-gap-s: 120px; --section-gap: 144px; --section-gap-l: 176px; + --z-base: 1; --z-raised: 10; --z-dropdown: 100; --z-sticky: 200; --z-sticky-nav: 300; --z-modal: 400; --z-toast: 500; --z-tooltip: 600;`; + +const CUSTOM_TOKENS = ` --color-paper: FILL ME; --color-paper-2: FILL ME; --color-paper-3: FILL ME; + --color-ink: FILL ME; --color-ink-2: FILL ME; --color-muted: FILL ME; + --color-rule: FILL ME; + --color-accent: FILL ME; --color-accent-ink: FILL ME; --color-focus: FILL ME; + --font-display: "FILL ME", ui-serif, serif; --font-body: "FILL ME", ui-sans-serif, system-ui, sans-serif; --font-outlier: var(--font-body); + --radius-card: 4px; --radius-pill: 999px; --rule-hair: 1px; --shadow-card: none; + --tracking-display: -0.02em;`; + +const BASE = `*, *::before, *::after { box-sizing: border-box; } +html, body { overflow-x: clip; } +html { scrollbar-color: var(--color-muted) var(--color-paper); scroll-padding-top: var(--space-3xl); } +body { margin: 0; background: var(--color-paper); color: var(--color-ink); font-family: var(--font-body); font-size: var(--text-md); line-height: 1.55; -webkit-font-smoothing: antialiased; caret-color: var(--color-accent); } +::selection { background: color-mix(in oklab, var(--color-accent) 22%, transparent); color: var(--color-ink); } +:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; } +a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.16em; } +h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: var(--display-weight, 700); font-synthesis: none; letter-spacing: var(--tracking-display); line-height: 1.05; overflow-wrap: break-word; min-width: 0; text-wrap: balance; } +h1 { max-width: 20ch; font-size: var(--text-display); } h2 { max-width: 30ch; font-size: var(--text-section); } h3 { max-width: 40ch; font-size: var(--text-title); line-height: 1.2; } +.lead { font-size: var(--text-lead); line-height: 1.45; max-width: 52ch; } +p { margin: 0; text-wrap: pretty; } +p:not([class]) { max-width: 65ch; } +img, video { max-width: 100%; height: auto; display: block; } +svg { display: block; } +[hidden] { display: none !important; } +button, input, select, textarea { font: inherit; } +.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); box-sizing: border-box; } +.num, .figure, td.num { font-variant-numeric: tabular-nums; } +.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } +[data-slot] { position: relative; overflow: hidden; background: linear-gradient(160deg, var(--color-paper-2, var(--color-paper)), var(--color-paper-3, var(--color-paper))); } +[data-slot] > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; } +[data-slot]:has(> img) > :not(img):not([data-keep]) { display: none !important; } +@media (max-width: 60rem) { :root { --gutter: 24px; --section-gap-s: 80px; --section-gap: 96px; --section-gap-l: 120px; } } +@media (max-width: 40rem) { :root { --gutter: 16px; --section-gap-s: 56px; --section-gap: 72px; --section-gap-l: 96px; --gap-columns: 16px; } } +@media (prefers-reduced-motion: reduce) { *:not(.keep-motion), *:not(.keep-motion)::before, *:not(.keep-motion)::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; } }`; + +// A custom run sets its own type: its base keeps the Floor's rules and drops the heading sizes, weight, leading and measure. +const BASE_CUSTOM = BASE.replace(/^h1, h2, h3 \{[^}]*\}$/m, 'h1, h2, h3 { margin: 0; font-family: var(--font-display); font-synthesis: none; overflow-wrap: break-word; min-width: 0; text-wrap: balance; }').replace(/^h1 \{ max-width[^\n]*\n/m, '').replace(/^\.lead \{[^\n]*\n/m, ''); + +const SLOTS_JS = `window.hallmarkSlots = (m) => { for (const [k, v] of Object.entries(m)) { const s = document.querySelector(\`[data-slot="\${k}"]\`); if (!s) continue; const im = new Image(); im.src = typeof v === 'string' ? v : v.src; im.alt = (typeof v === 'object' && v.alt) || s.dataset.alt || ''; s.querySelectorAll(':scope > img').forEach((o) => o.remove()); s.prepend(im); } };\ndocument.querySelectorAll('[data-slot] img').forEach((i) => { if (i.complete && !i.naturalWidth) i.remove(); else i.addEventListener('error', () => i.remove(), { once: true }); });`; + +function scaffold() { + const brand = has('brand'); + const custom = has('custom') || brand; + const depth = flag('redesign', ''); + if (depth && !['polish', 'restyle', 'full'].includes(depth)) { console.error('--redesign takes polish, restyle or full'); process.exit(2); } + const tail = depth ? ` · redesign: ${depth}` : ''; + const slug = custom ? null : positional()[0]; + if (!custom && !slug) { usage(); process.exit(2); } + const app = flag('scope', '') === 'app'; + const sheet = ['src/index.css', 'src/app/globals.css', 'app/globals.css', 'src/styles/globals.css', 'styles/globals.css', 'src/styles/global.css', 'src/main.css', 'src/styles.css', 'src/global.css', 'src/app.css', 'src/App.css', 'app/app.css'].find((f) => existsSync(f)); + const dir = resolve(flag('dir', sheet ? dirname(sheet) : '.')); + let name = 'custom world'; + let tokens = CUSTOM_TOKENS; + let header = null; + if (!custom) { + const file = join(THEMES, `${slug}.md`); + if (!isSlug(slug) || !existsSync(file)) { console.error(`no theme at ${file}; run \`theme.mjs list\` for the slugs`); process.exit(1); } + const src = readFileSync(file, 'utf8'); + header = parseHeader(src, file); + name = header.name; + tokens = tokenBlockOf(src, file); + } + const out = join(dir, 'tokens.css'); + const baseOut = join(dir, 'base.css'); + for (const f of [out, baseOut]) if (existsSync(f) && !has('force')) { console.error(`${f} exists; pass --force to overwrite it`); process.exit(1); } + mkdirSync(dir, { recursive: true }); + const dark = header && header.paper.band === 'dark'; + const sized = app ? SCALE.replace(/ --text-xs:[^\n]*\n --text-display-s:[^\n]*\n --text-section:[^\n]*\n/, ' --text-xs: 0.75rem; --text-sm: 0.875rem; --text-md: 1rem; --text-lg: 1.2rem; --text-xl: 1.44rem; --text-2xl: 1.728rem; --text-3xl: 2.074rem;\n --text-display-s: 1.44rem; --text-display: 1.728rem; --text-section: 1.2rem; --text-title: 1rem; --text-lead: 1rem;\n') : SCALE; + const scale = dark ? sized.replace('--color-error: oklch(52% 0.19 27); --color-success: oklch(50% 0.12 150);', '--color-error: oklch(72% 0.15 27); --color-success: oklch(76% 0.13 150);') : sized; + const sheetSrc = sheet ? readFileSync(sheet, 'utf8') : ''; + const tw = /@import\s+["']tailwindcss/.test(sheetSrc); + const tw3 = !tw && /@tailwind\s+(?:base|utilities)\b/.test(sheetSrc); + const scheme = header ? ` color-scheme: ${dark ? 'dark' : 'light'};\n` : ''; + const decls = `${scale}\n${tokens}`.split(/;(?![^()]*\))(?=(?:[^"]*"[^"]*")*[^"]*$)/).map((d) => d.trim()).filter(Boolean); + const themed = decls.filter((d) => /^--(color|font|text|tracking|radius|shadow|ease)-/.test(d)); + const css = tw + ? `@theme static {\n${themed.map((d) => ` ${d};`).join('\n')}\n}\n:root {\n${scheme}${decls.filter((d) => !themed.includes(d)).map((d) => ` ${d};`).join('\n')}\n}\n` + : `:root {\n${scheme}${scale}\n${tokens}\n}\n`; + writeFileSync(out, css); + const own = !custom && /## Build hint[\s\S]*?(::selection\s*\{[^}]*\})/.exec(readFileSync(join(THEMES, `${slug}.md`), 'utf8')); + const base = own ? BASE.replace(/::selection \{[^}]*\}/, own[1].replace(/\s+/g, ' ')) : custom && !brand ? BASE_CUSTOM : BASE; + const steps = base.split('\n').filter((l) => /^@media[^{]*\{\s*:root/.test(l)); + const photo = custom ? '' : treatmentOf(header.photo, tokensOf(readFileSync(join(THEMES, `${slug}.md`), 'utf8'), slug)).css; + writeFileSync(baseOut, (tw ? base.split('\n').filter((l) => !steps.includes(l)).join('\n') : base) + (photo ? `\n/* photographs: ${header.photo} */\n${photo}` : '') + '\n'); + if (tw) writeFileSync(out, readFileSync(out, 'utf8') + steps.join('\n') + '\n'); + const src = custom ? '' : readFileSync(join(THEMES, `${slug}.md`), 'utf8'); + const dial = /stated in the stamp \(`([a-z0-9-]+):/.exec(src); + const theme = brand ? 'brand' : custom ? 'custom' : `${name} (${flag('dealt', '') ? `deal ${flag('dealt', '')}` : 'by request'})`; + const made = custom ? `\n * paper: oklch(<>) · accent: oklch(<>) · display: <face> · body: <face>` : ''; + const axes = custom ? '<paper>/<display>/<accent> · posture: <posture>' : `${triple(header)} · posture: ${header.posture}`; + const kept = depth ? ', or kept' : ''; + const stamp = app + ? `/* Hallmark · shape: app screen · genre: ${header ? header.genre : '<genre>'} · theme: ${theme}${tail}${made}\n * nav: <the shell${kept}> · signature: <the one object${kept}> · states: <the ones the screens have>${dial ? ` · ${dial[1]}: <the dials>` : ''}\n * axes: ${axes} · contrast: pass · v${VERSION} */` + : brand + ? `/* Hallmark · shape: <shape, or kept> · genre: <genre> · theme: brand${tail}${made} · hero: <posture, or kept> · nav: <shape, or kept> · footer: <shape, or kept> · signature: <the one move, or kept>\n * axes: ${axes} · contrast: pass · fold: pass · v${VERSION} */` + : custom + ? `/* Hallmark · shape: <your name for the structure> · genre: <genre> · theme: custom${tail} · job: <subscribe|book|visit|attend|buy|try|sign up|hire|join|listen> · idea: "<one sentence>" · vibe: "<4 to 8 words>"${made} · hero: <in your own words> · nav: <shape> · footer: <shape> · imagery: <photographs, the product, or none> · signature: <the one thing a visitor remembers>\n * axes: ${axes} · contrast: pass · fold: pass · v${VERSION} */` + : `/* Hallmark · shape: <shape${kept}> · genre: ${header.genre} · theme: ${theme}${tail}${depth ? '' : ' · job: <subscribe|book|visit|attend|buy|try|sign up|hire|join|listen> · draw: <seed>'}\n * hero: <posture${kept}> · nav: <shape${kept}> · footer: <shape${kept}> · imagery: <photographs, the product, or none> · signature: <the one move>${dial ? ` · ${dial[1]}: <the dials>` : ''}\n * axes: ${axes} · contrast: pass · fold: pass · v${VERSION} */`; + console.log(`wrote ${out} (${brand ? 'the shared scale; fill every --color-* and --font-* from the palette and faces the pre-flight found' : custom ? 'a starting scale, yours to rewrite; fill every --color-* and --font-* before building' : `${name} tokens plus the shared scale`}) and ${baseOut} (the base rules the Floor already decided)${sheet && !flag('dir', '') ? `, beside ${sheet}` : ''}`); + if (!custom && !flag('dealt', '')) { + const pic = join(THEMES, `${slug}.jpg`); + if (existsSync(pic)) console.log(`look at ${pic}: the material at full size${header.pictured ? `, from a page built as ${header.pictured}` : ''}. Take its palette balance, type voice and surfaces, never its layout; the room and the sections are layout.md.`); + } + console.log(''); + console.log('start the page\'s stylesheet with these lines, then write only the page:'); + console.log(stamp); + console.log('/* Hallmark · pre-emit critique: P_ H_ E_ S_ R_ V_ · weakest: _, <what you did about it> */'); + console.log(tw || tw3 ? '@import "./tokens.css";' : '@import url("./tokens.css");'); + console.log(tw || tw3 ? '@import "./base.css" layer(base);' : '@import url("./base.css");'); + if (tw3) console.log('Tailwind 3: the stamp and both imports go above the @tailwind directives; an @import below them is dropped without an error.'); + if (tw) console.log('Tailwind 4: both imports go below @import "tailwindcss". tokens.css is written as an @theme block, so every colour, face, size, radius, shadow and ease is a utility (bg-paper, font-display, rounded-card); export-formats.md § Tailwind v4 has the names it shares with Tailwind.'); + if (app) return; + console.log(''); + console.log('and, only if the page has data-slot containers, once before </body>:'); + console.log(`<script>${SLOTS_JS}</script>`); + console.log(''); + console.log(`pictures (imagery.md): node ${join(HERE, 'theme.mjs')} photos "<subject>" ["<subject>" ...]${slug ? ` --theme ${slug}` : ''}`); +} + +function validate(files) { + let bad = 0; + for (const f of files) { + try { + // Frontmatter accepts CRLF, so the CSS Build hint matchers must see the same + // normalised text; a raw CRLF file silently skipped every hint check. + const src = readFileSync(f, 'utf8').replace(/\r\n?/g, '\n'); + const e = parseHeader(src, f); + const problems = []; + if (!PAPER_BANDS.has(e.paper.band)) problems.push(`paper band ${e.paper.band}`); + if (!DISPLAY_CLASSES.has(e.display.class)) problems.push(`display class ${e.display.class}`); + if (!ACCENT_BAND.test(e.accent.band)) problems.push(`accent band ${e.accent.band}`); + if (!['editorial', 'modern-minimal', 'atmospheric', 'playful'].includes(e.genre)) problems.push(`genre ${e.genre}`); + if (!['restrained', 'committed', 'full-palette', 'drenched'].includes(e.posture)) problems.push(`posture ${e.posture}`); + if (e.keywords.length < 8) problems.push(`only ${e.keywords.length} keywords`); + if (/[\u2014\u2013]/.test(src)) problems.push('contains an em or en dash'); + if (Buffer.byteLength(src) > 8000) problems.push(`${Buffer.byteLength(src)} bytes, over 8,000`); + for (const sec of ['Tokens', 'Type', 'Surfaces', 'Range', 'Controls', 'Motion', 'Voice', 'Do-nots', 'Build hint']) if (!new RegExp(`^## ${sec}\\b`, 'm').test(src)) problems.push(`missing the ${sec} section`); + if (!/^photo:/m.test(src)) problems.push('no photo: line in the header (natural, warm, muted, mono, duotone <dark> <light> or tint <token>, imagery.md § 5)'); + else { const t = treatmentOf(/^photo:\s*(.*)$/m.exec(src)[1], tokensOf(src, f)); if (t.bad.length) problems.push(`photo: ${t.bad.join('; ')}`); } + if (/\b(?:hand-built|hand-drawn|drawn) (?:svg|illustration|object|figure)|\bsvg (?:illustration|drawing|figure)/i.test(src)) problems.push('prescribes a drawn illustration (imagery.md § 7, gate 80)'); + for (const m of src.matchAll(/https:\/\/api\.fontshare\.com\/v2\/css\?[^"'\s>]*/g)) if ((m[0].match(/f\[\]=/g) || []).length > 1) problems.push('a Fontshare link loading more than one family (Fontshare may drop all but the first; use one link per family)'); + if (/^signature:/m.test(src)) problems.push('a signature: line in the header (a theme is a material; the page finds its signature in the prompt)'); + if (/object family|the one object|signature object|signature move/i.test(src)) problems.push('names an object or a signature move (a theme carries no components)'); + if (/\b(?:generous|plenty of) (?:air|whitespace|white space)|(?:air|whitespace|white space|space) (?:carr(?:y|ies)|doing|does) (?:the|every)/i.test(src)) problems.push('a rule about space (layout.md owns room and density)'); + if (/--tracking-label/.test(src)) problems.push('declares --tracking-label (labels are untracked, gate 67)'); + if (/font-variant(-caps)?:\s*[a-z-]*small-caps|small caps|small capitals|small-caps/i.test(src)) problems.push('prescribes small caps (gate 67)'); + if (/eyebrow|kicker|overline/i.test(src)) problems.push('names an eyebrow (gate 54)'); + if (/→|Learn more/.test(src)) problems.push('arrow or Learn-more copy (gate 63)'); + for (const m of src.matchAll(/^[^\n]*text-transform:\s*uppercase[^\n]*$/gm)) { + const line = m[0]; + const ls = /letter-spacing:\s*(-?[\d.]+)em/.exec(line); + const isDisplay = /\.display|h1|h2|\.marquee|wordmark/.test(line); + if (ls && parseFloat(ls[1]) > 0.045) problems.push(`uppercase tracked ${ls[1]}em in the build hint (gate 67)`); + else if (!isDisplay && /label|caption|meta|\bth\b|small|tag|chip|badge|nav|count/.test(line)) problems.push(`uppercase label rule in the build hint: ${line.trim().slice(0, 60)} (gate 67)`); + } + const hint = (/## Build hint[\s\S]*?```css\n([\s\S]*?)```/.exec(src) || [])[1] || ''; + for (const m of hint.matchAll(/(?:transition|animation)[^;{}]*?\b(\d{2,3})ms\b/g)) problems.push(`raw duration ${m[1]}ms in the build hint (use --dur-micro, --dur-short or --dur-long)`); + if (/(?:transition|animation)[^;{}]*(?<![-\w])ease(?:-in-out|-in|-out)?\b/.test(hint)) problems.push('bare ease keyword in the build hint (use --ease-out, --ease-in or --ease-in-out)'); + for (const m of hint.matchAll(/(?<![-\w])(black|white)\b(?!-)/g)) problems.push(`named colour ${m[1]} in the build hint (route it through a token)`); + for (const m of hint.matchAll(/\b(?:padding|margin|gap|row-gap|column-gap)(?:-[a-z-]+)?\s*:\s*([^;{}]+)/g)) { + const raw = m[1].replace(/var\([^)]*\)/g, ' ').replace(/calc\([^)]*\)/g, ' '); + for (const px of raw.match(/(?<![\w.-])(\d+)px\b/g) || []) if ([2, 4, 8, 12, 16, 24, 40, 64, 96, 144].includes(parseInt(px, 10))) problems.push(`raw ${px} spacing in the build hint where a --space-* token exists (24a)`); + } + const fence = tokenBlockOf(src, f); + if (/\/\*/.test(fence)) problems.push('comment inside the token block'); + if (!existsSync(f.replace(/\.md$/, '.jpg'))) console.log(`${f}: note, no picture yet (scripts/picture.mjs)`); + if (!/waive 22/.test(src)) for (const m of fence.matchAll(/(--color-(?:paper|paper-2|paper-3|ink|ink-2|muted|rule|rule-2)):\s*oklch\(\s*[\d.]+%\s+([\d.]+)/g)) if (Number(m[2]) < 0.005) problems.push(`${m[1]} chroma ${m[2]} is under the 0.005 floor (gate 22), or the file names waive 22`); + for (const k of ['--color-paper', '--color-ink', '--color-muted', '--color-rule', '--color-accent', '--color-accent-ink', '--color-focus', '--font-display', '--font-body', '--radius-card', '--tracking-display', '--display-weight']) if (!fence.includes(k + ':')) problems.push(`token block lacks ${k}`); + const tok = {}; + for (const m of fence.matchAll(/(--color-[\w-]+):\s*oklch\(\s*([\d.]+)%\s+([\d.]+)\s+([\d.]+)\s*\)/g)) tok[m[1]] = [Number(m[2]) / 100, Number(m[3]), Number(m[4])]; + const pairs = [['--color-ink-2', '--color-paper'], ['--color-muted', '--color-paper'], ['--color-muted', '--color-paper-2'], ['--color-accent-ink', '--color-accent']]; + for (const [fg, bg] of pairs) if (tok[fg] && tok[bg]) { const r = contrastOf(tok[fg], tok[bg]); if (r < 4.5) problems.push(`${fg} on ${bg} is ${r.toFixed(2)}:1, under 4.5 (gate 40)`); } + if (problems.length) { bad++; console.log(`${f}: ${problems.join('; ')}`); } else console.log(`${f}: ok (${e.name}, ${triple(e)}, ${src.length} bytes)`); + } catch (err) { bad++; console.log(`${f}: ${err.message}`); } + } + process.exitCode = bad ? 1 : 0; +} + +try { + if (cmd === 'deal') deal(); + else if (cmd === 'draw') draw(); + else if (cmd === 'check') check(); + else if (cmd === 'scaffold') scaffold(); + else if (cmd === 'log') addLog(); + else if (cmd === 'photos') await photos(); + else if (cmd === 'index') { const e = buildIndex(); console.log(`indexed ${e.length} themes into ${INDEX}`); } + else if (cmd === 'list') list(); + else if (cmd === 'validate') { + const files = args.slice(1).filter((a) => !a.startsWith('--') && basename(a) !== 'README.md'); + if (!files.length) { usage(); process.exit(2); } + validate(files); + } + else { usage(); process.exit(2); } +} catch (e) { + console.error(String(e.message || e)); process.exit(1); +} diff --git a/skills/hallmark/scripts/theme.test.mjs b/skills/hallmark/scripts/theme.test.mjs new file mode 100644 index 0000000..8b55325 --- /dev/null +++ b/skills/hallmark/scripts/theme.test.mjs @@ -0,0 +1,44 @@ +import assert from 'node:assert/strict'; +import { spawnSync } from 'node:child_process'; +import { mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs'; +import { tmpdir } from 'node:os'; +import { join } from 'node:path'; +import { fileURLToPath } from 'node:url'; +import test from 'node:test'; + +test('validate accepts a theme with either LF or CRLF line endings', () => { + const source = readFileSync(new URL('../references/themes/hum.md', import.meta.url), 'utf8').replace(/\r\n/g, '\n'); + const cli = fileURLToPath(new URL('./theme.mjs', import.meta.url)); + const dir = mkdtempSync(join(tmpdir(), 'hallmark-theme-')); + try { + for (const [name, text] of [['lf', source], ['crlf', source.replace(/\n/g, '\r\n')]]) { + assert.ok(Buffer.byteLength(text) < 8000, 'fixture must stay below the independent size limit'); + const file = join(dir, `${name}.md`); + writeFileSync(file, text); + const result = spawnSync(process.execPath, [cli, 'validate', file], { encoding: 'utf8' }); + assert.equal(result.status, 0, `${name}: ${result.stdout}${result.stderr}`); + assert.match(result.stdout, /: ok \(Hum,/); + } + } finally { + rmSync(dir, { recursive: true, force: true }); + } +}); + +test('validate rejects an invalid Build hint in a CRLF file, like it does in LF', () => { + const source = readFileSync(new URL('../references/themes/hum.md', import.meta.url), 'utf8').replace(/\r\n/g, '\n'); + const at = source.indexOf('```css', source.indexOf('## Build hint')) + '```css\n'.length; + const bad = `${source.slice(0, at)} color: black;\n${source.slice(at)}`; + const cli = fileURLToPath(new URL('./theme.mjs', import.meta.url)); + const dir = mkdtempSync(join(tmpdir(), 'hallmark-theme-crlf-')); + try { + for (const [name, text] of [['lf', bad], ['crlf', bad.replace(/\n/g, '\r\n')]]) { + const file = join(dir, `${name}.md`); + writeFileSync(file, text); + const result = spawnSync(process.execPath, [cli, 'validate', file], { encoding: 'utf8' }); + assert.equal(result.status, 1, `${name}: ${result.stdout}${result.stderr}`); + assert.match(result.stdout, /named colour black in the build hint/, `${name}: ${result.stdout}`); + } + } finally { + rmSync(dir, { recursive: true, force: true }); + } +}); diff --git a/skills/stop-slop/SKILL.md b/skills/stop-slop/SKILL.md new file mode 100644 index 0000000..83f2032 --- /dev/null +++ b/skills/stop-slop/SKILL.md @@ -0,0 +1,68 @@ +--- +name: stop-slop +description: Remove AI writing patterns from prose. Use when drafting, editing, or reviewing text to eliminate predictable AI tells. +metadata: + trigger: Writing prose, editing drafts, reviewing content for AI patterns + author: Hardik Pandya (https://hvpandya.com) +--- + +# Stop Slop + +Eliminate predictable AI writing patterns from prose. + +## Core Rules + +1. **Cut filler phrases.** Remove throat-clearing openers, emphasis crutches, and all adverbs. See [references/phrases.md](references/phrases.md). + +2. **Break formulaic structures.** Avoid binary contrasts, negative listings, dramatic fragmentation, rhetorical setups, false agency. See [references/structures.md](references/structures.md). + +3. **Use active voice.** Every sentence needs a human subject doing something. No passive constructions. No inanimate objects performing human actions ("the complaint becomes a fix"). + +4. **Be specific.** No vague declaratives ("The reasons are structural"). Name the specific thing. No lazy extremes ("every," "always," "never") doing vague work. + +5. **Put the reader in the room.** No narrator-from-a-distance voice. "You" beats "People." Specifics beat abstractions. + +6. **Vary rhythm.** Mix sentence lengths. Two items beat three. End paragraphs differently. No em dashes. + +7. **Trust readers.** State facts directly. Skip softening, justification, hand-holding. + +8. **Cut quotables.** If it sounds like a pull-quote, rewrite it. + +## Quick Checks + +Before delivering prose: + +- Any adverbs? Kill them. +- Any passive voice? Find the actor, make them the subject. +- Inanimate thing doing a human verb ("the decision emerges")? Name the person. +- Sentence starts with a Wh- word? Restructure it. +- Any "here's what/this/that" throat-clearing? Cut to the point. +- Any "not X, it's Y" contrasts? State Y directly. +- Three consecutive sentences match length? Break one. +- Paragraph ends with punchy one-liner? Vary it. +- Em-dash anywhere? Remove it. +- Vague declarative ("The implications are significant")? Name the specific implication. +- Narrator-from-a-distance ("Nobody designed this")? Put the reader in the scene. +- Meta-joiners ("The rest of this essay...")? Delete. Let the essay move. + +## Scoring + +Rate 1-10 on each dimension: + +| Dimension | Question | +|-----------|----------| +| Directness | Statements or announcements? | +| Rhythm | Varied or metronomic? | +| Trust | Respects reader intelligence? | +| Authenticity | Sounds human? | +| Density | Anything cuttable? | + +Below 35/50: revise. + +## Examples + +See [references/examples.md](references/examples.md) for before/after transformations. + +## License + +MIT diff --git a/skills/stop-slop/references/examples.md b/skills/stop-slop/references/examples.md new file mode 100644 index 0000000..0376b6d --- /dev/null +++ b/skills/stop-slop/references/examples.md @@ -0,0 +1,59 @@ +# Before/After Examples + +## Example 1: Throat-Clearing + Binary Contrast + +**Before:** +> "Here's the thing: building products is hard. Not because the technology is complex. Because people are complex. Let that sink in." + +**After:** +> "Building products is hard. Technology is manageable. People aren't." + +**Changes:** Removed opener, binary contrast structure, and emphasis crutch. Direct statements. + +--- + +## Example 2: Filler + Unnecessary Reassurance + +**Before:** +> "It turns out that most teams struggle with alignment. The uncomfortable truth is that nobody wants to admit they're confused. And that's okay." + +**After:** +> "Teams struggle with alignment. Nobody admits confusion." + +**Changes:** Cut hedging ("most"), removed throat-clearing phrases, deleted permission-granting ending. + +--- + +## Example 3: Business Jargon Stack + +**Before:** +> "In today's fast-paced landscape, we need to lean into discomfort and navigate uncertainty with clarity. This matters because your competition isn't waiting." + +**After:** +> "Move faster. Your competition is." + +**Changes:** Eliminated jargon entirely. Core message in six words. + +--- + +## Example 4: Dramatic Fragmentation + +**Before:** +> "Speed. Quality. Cost. You can only pick two. That's it. That's the tradeoff." + +**After:** +> "Speed, quality, cost—pick two." + +**Changes:** Single sentence. No performative emphasis. + +--- + +## Example 5: Rhetorical Setup + +**Before:** +> "What if I told you that the best teams don't optimize for productivity? Here's what I mean: they optimize for learning. Think about it." + +**After:** +> "The best teams optimize for learning, not productivity." + +**Changes:** Direct claim. No rhetorical scaffolding. diff --git a/skills/stop-slop/references/phrases.md b/skills/stop-slop/references/phrases.md new file mode 100644 index 0000000..f9234fe --- /dev/null +++ b/skills/stop-slop/references/phrases.md @@ -0,0 +1,128 @@ +# Phrases to Remove + +## Throat-Clearing Openers + +Remove these announcement phrases. State the content directly. + +- "Here's the thing:" +- "Here's what [X]" +- "Here's this [X]" +- "Here's that [X]" +- "Here's why [X]" +- "The uncomfortable truth is" +- "It turns out" +- "The real [X] is" +- "Let me be clear" +- "The truth is," +- "I'll say it again:" +- "I'm going to be honest" +- "Can we talk about" +- "Here's what I find interesting" +- "Here's the problem though" + +Any "here's what/this/that" construction is throat-clearing before the point. Cut it and state the point. + +## Emphasis Crutches + +These add no meaning. Delete them. + +- "Full stop." / "Period." +- "Let that sink in." +- "This matters because" +- "Make no mistake" +- "Here's why that matters" + +## Business Jargon + +Replace with plain language. + +| Avoid | Use instead | +|-------|-------------| +| Navigate (challenges) | Handle, address | +| Unpack (analysis) | Explain, examine | +| Lean into | Accept, embrace | +| Landscape (context) | Situation, field | +| Game-changer | Significant, important | +| Double down | Commit, increase | +| Deep dive | Analysis, examination | +| Take a step back | Reconsider | +| Moving forward | Next, from now | +| Circle back | Return to, revisit | +| On the same page | Aligned, agreed | + +## Adverbs + +Kill all adverbs. No -ly words. No softeners, no intensifiers, no hedges. + +Specific offenders: + +- "really" +- "just" +- "literally" +- "genuinely" +- "honestly" +- "simply" +- "actually" +- "deeply" +- "truly" +- "fundamentally" +- "inherently" +- "inevitably" +- "interestingly" +- "importantly" +- "crucially" + +Also cut these filler phrases: + +- "At its core" +- "In today's [X]" +- "It's worth noting" +- "At the end of the day" +- "When it comes to" +- "In a world where" +- "The reality is" + +## Meta-Commentary + +Remove self-referential asides. The essay should move, not announce its own structure. + +- "Hint:" +- "Plot twist:" / "Spoiler:" +- "You already know this, but" +- "But that's another post" +- "X is a feature, not a bug" +- "Dressed up as" +- "The rest of this essay explains..." +- "Let me walk you through..." +- "In this section, we'll..." +- "As we'll see..." +- "I want to explore..." + +## Performative Emphasis + +False intimacy or manufactured sincerity: + +- "creeps in" +- "I promise" +- "They exist, I promise" + +## Telling Instead of Showing + +Announcing difficulty or significance rather than demonstrating it: + +- "This is genuinely hard" +- "This is what leadership actually looks like" +- "This is what X actually looks like" +- "actually matters" + +## Vague Declaratives + +Sentences that announce importance without naming the specific thing. Kill these. + +- "The reasons are structural" +- "The implications are significant" +- "This is the deepest problem" +- "The stakes are high" +- "The consequences are real" + +If a sentence says something is important/deep/structural without showing the specific thing, cut it or replace it with the specific thing. diff --git a/skills/stop-slop/references/structures.md b/skills/stop-slop/references/structures.md new file mode 100644 index 0000000..bbcc359 --- /dev/null +++ b/skills/stop-slop/references/structures.md @@ -0,0 +1,134 @@ +# Structures to Avoid + +## Binary Contrasts + +These create false drama. State the point directly. + +| Pattern | Problem | +|---------|---------| +| "Not because X. Because Y." / "Not because X, but because Y." | Telegraphed reversal | +| "[X] isn't the problem. [Y] is." | Formulaic reframe | +| "The answer isn't X. It's Y." | Predictable pivot | +| "It feels like X. It's actually Y." | Setup/reveal cliche | +| "The question isn't X. It's Y." | Rhetorical misdirection | +| "Not X. But Y." / "not X, it's Y" / "isn't X, it's Y" | Mechanical contrast | +| "It's not this. It's that." | Same formula, different words | +| "stops being X and starts being Y" | False transformation arc | +| "doesn't mean X, but actually Y" | Negation-then-assertion crutch | +| "is about X but not Y" | False distinction | +| "not just X but also Y" | Additive hedge | + +**Instead:** State Y directly. "The problem is Y." "Y matters here." Drop the negation entirely. + +## Negative Listing + +Listing what something is *not* before revealing what it *is*. A rhetorical striptease. + +| Pattern | Problem | +|---------|---------| +| "Not a X... Not a Y... A Z." | Dramatic buildup through negation | +| "It wasn't X. It wasn't Y. It was Z." | Same structure, past tense | + +**Instead:** State Z. The reader doesn't need the runway. + +## Dramatic Fragmentation + +Sentence fragments for emphasis read as manufactured profundity. + +| Pattern | Problem | +|---------|---------| +| "[Noun]. That's it. That's the [thing]." | Performative simplicity | +| "X. And Y. And Z." | Staccato drama | +| "This unlocks something. [Word]." | Artificial revelation | + +**Instead:** Complete sentences. Trust content over presentation. + +## Rhetorical Setups + +These announce insight rather than deliver it. + +| Pattern | Problem | +|---------|---------| +| "What if [reframe]?" | Socratic posturing | +| "Here's what I mean:" | Redundant preview | +| "Think about it:" | Condescending prompt | +| "And that's okay." | Unnecessary permission | + +**Instead:** Make the point. Let readers draw conclusions. + +## Formulaic Constructions + +| Pattern | Problem | +|---------|---------| +| "By the time X, I was Y." | Narrative template | +| "X that isn't Y" | Indirect. Say "X is broken" | + +## False Agency + +Giving inanimate things human verbs. Complaints don't "become" fixes. Bets don't "live or die." Decisions don't "emerge." A person does something to make those things happen. AI loves this because it avoids naming the actor. + +| Pattern | Problem | +|---------|---------| +| "a complaint becomes a fix" | The complaint did nothing. Someone fixed it. | +| "a bet lives or dies in days" | Bets don't have lifespans. Someone kills the project or ships it. | +| "the decision emerges" | Decisions don't emerge. Someone decides. | +| "the culture shifts" | Cultures don't shift on their own. People change behavior. | +| "the conversation moves toward" | Conversations don't move. Someone steers. | +| "the data tells us" | Data sits there. Someone reads it and draws a conclusion. | +| "the market rewards" | Markets don't reward. Buyers pay for things. | + +**Instead:** Name the human. "The team fixed it that week" beats "the complaint becomes a fix." If no specific person fits, use "you" to put the reader in the seat. + +## Narrator-from-a-Distance + +Floating above the scene instead of putting the reader in it. + +| Pattern | Problem | +|---------|---------| +| "Nobody designed this." | Disembodied observation | +| "This happens because..." | Lecturer voice | +| "This is why..." | Same | +| "People tend to..." | Armchair sociologist | + +**Instead:** Put the reader in the room. "You don't sit down one day and decide to..." beats "Nobody designed this." + +## Passive Voice + +Every sentence needs a subject doing something. Passive voice hides the actor and drains energy. + +| Pattern | Fix | +|---------|-----| +| "X was created" | Name who created it | +| "It is believed that" | Name who believes it | +| "Mistakes were made" | Name who made them | +| "The decision was reached" | Name who decided | + +**Instead:** Find the actor. Put them at the front of the sentence. + +## Sentence Starters to Avoid + +| Pattern | Fix | +|---------|-----| +| Sentences starting with What, When, Where, Which, Who, Why, How | Restructure. Lead with the subject or the verb. | +| Paragraphs starting with "So" | Start with content | +| Sentences starting with "Look," | Remove | + +Wh- openers become a crutch. "What makes this hard is..." becomes "The constraint is..." or better, name the specific constraint. + +## Rhythm Patterns + +| Pattern | Fix | +|---------|-----| +| Three-item lists | Use two items or one | +| Questions answered immediately | Let questions breathe or cut them | +| Every paragraph ends punchily | Vary endings | +| Em-dashes | Remove. Use commas or periods. No em dashes at all. | +| Staccato fragmentation | Don't stack short punchy sentences | +| "Not always. Not perfectly." | Hedging disguised as reassurance | + +## Word Patterns + +| Pattern | Problem | +|---------|---------| +| Lazy extremes (every, always, never, everyone, everybody, nobody) | False authority. Use specifics instead of sweeping claims. | +| All adverbs (-ly words, "really," "just," "literally," "genuinely," "honestly," "simply," "actually") | Empty emphasis. See phrases.md for full list. |