@jonandev/longbeard 0.14.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.15.0 — 2026-11-26
6
+
7
+ - **Motion you can choose.** When your design brief asks for present or leading motion and your board has nothing moving, the moodboard offers a short motion search; you watch each candidate live from its link and like what moves well, and only your likes are recorded. The prototype then shows two or three versions of each key moment, each rebuilt from a moving reference on your board with whatever it needs (a motion library for sequenced or scroll-driven work), and DESIGN.md records the one you pick.
8
+ - **Eight concepts.** Every first screen now develops one liked reference's idea, written out and redrawn for your product, with at most two things borrowed from your other likes. Your lead gets two screens, each a different take; six other likes get one each. Any liked reference can lead a screen, whatever it was made as (a section, an inner page, a poster, an app screen): it keeps its idea and is redrawn for the role this screen plays in your product (a site's opening screen, an app's first screen, or the piece itself for a graphic), so what only worked in its old role stays out.
9
+ - **Lighter design steps.** Each first screen no longer carries a copy of the screen's fixed code (the look from the address, font loading, the live controls): it is one `screen.js` beside the screens, so a round of eight is written with far fewer tokens and in less time. The skill descriptions are shorter, so every session loads less, and `design-brief` and `design-direction` say the same things in fewer words. Nothing to do after `update`.
10
+
11
+ If you already ran `init`: run `npx longbeard update` to take the new design skills. The `AGENTS.md` block is unchanged, and a direction in progress keeps working.
12
+
5
13
  ## 0.14.0 — 2026-11-25
6
14
 
7
15
  - **Concepts, not only rebuilds.** Of the eight first screens, six still rebuild one of your references; two now develop a concept you liked: the agent writes out what it is and why it works, then redraws it for your content, keeping its devices, type and colour. Before you see one it must be the same concept and not a copy; a screen with no concept behind it goes. The canvas labels them "concept from …". Style still comes only from your board.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jonandev/longbeard",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
4
4
  "description": "Designs like an Art director. Codes like a Senior Engineer.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1,11 +1,9 @@
1
1
  ---
2
2
  name: design
3
3
  description: >
4
- The way into the design-* skills. Reads what the project already has and
5
- says which design skill to run next, and why, in a few lines. It suggests;
6
- they choose, and any design-* skill can be called directly instead. Runs when
7
- docs/brief.md exists, the brief is a site, an app or a graphic, and there is no approved DESIGN.md,
8
- or when they ask what to do next on the look.
4
+ The way into the design-* skills: reads the project and suggests the next
5
+ design skill, and why. Runs when a site, app or graphic brief has no
6
+ approved DESIGN.md, or when they ask what next on the look.
9
7
  ---
10
8
 
11
9
  # Design
@@ -1,13 +1,9 @@
1
1
  ---
2
2
  name: design-brief
3
3
  description: >
4
- The questions a designer asks a client before looking for anything: what the
5
- first screen must make someone think and do, the personality, how it should
6
- feel and never feel, who it must stand apart from, and what is already fixed.
7
- One message of questions with suggested answers from the product brief, one
8
- read-back, and the answers written to docs/design/design-brief.md. Runs after
9
- docs/brief.md exists and the brief is a site, an app or a graphic, before any other design-* skill,
10
- or when the feel of the product changes.
4
+ A designer's questions before any looking: what the first screen must do,
5
+ personality, feel, never, apart from, fixed. Writes docs/design/design-
6
+ brief.md. Runs before any other design-* skill, or when the feel changes.
11
7
  ---
12
8
 
13
9
  # Design brief
@@ -102,35 +98,9 @@ Give each number as the scale's right end (loud 2 is fairly quiet), so the read-
102
98
 
103
99
  **Names stay out.** The sites and brands they love, and the competitors they named, go to `.longbeard/design/brief-loves.md` for `design-moodboard` to search from. Before that first write, add `.longbeard/design/` to `.gitignore` if it is missing, and say why in one line: the names must never be committed. The committed doc describes what those things do ("long editorial pages, one picture at a time"), never who. Owned colours and faces are theirs, so their values are written.
104
100
 
105
- ## Who reads what
101
+ Every line is read by a later step, so nobody asks again and each answer changes something.
106
102
 
107
- So nobody asks again, and so each answer changes something:
108
-
109
- | Line | Read by |
110
- |---|---|
111
- | takeaway | `design-direction` (what the screens carry, headlines), `design-content` |
112
- | first seen on | `design-direction` (the size the screens are built at) |
113
- | pace | `design` and every design skill: quick drops the optional stops |
114
- | words, personality, feel, never | `design-moodboard` (queries and picks), `design-direction` (the against-the-brief column), `design-identity` (options and their notes) |
115
- | apart from, distance | `design-moodboard` (what to search and keep out), `design-direction` (the eye's check), `design-check` (could it be mistaken for one) |
116
- | fixed | the direction's library (`theirs` entries, dropped grounds), `design-identity` |
117
- | accessibility | every contrast check (`contrast.mjs --level`, `screen-contrast.mjs --min`), `DESIGN.md`, `design-check` |
118
- | motion | `design-prototype` (builds those picks and nothing beyond them), `DESIGN.md` (its Motion section), `design-check` (checks against them), `design-moodboard` (the pasted link, and examples only if asked) |
119
- | dense | `design-prototype`, `DESIGN.md` |
120
- | voice | headlines, copy, the identity board, `DESIGN.md` |
121
- | decides | every approval: the direction, the identity board, `DESIGN.md` |
122
-
123
- ## Quick
124
-
125
- `pace: quick` asks the same questions (they take a minute, and everything after reads them) and changes what follows:
126
-
127
- - `design-moodboard`: their references as they are (three or more), or one search shown as one contact sheet of about 30, from which they name six to ten; no picker rounds, no gap search, no grouping.
128
- - `design-direction`: subject pictures, one round of eight, more only if they ask.
129
- - `design-identity`: the chosen screen's type and colours become the identity as built, contrast-checked; no options, straight to the board.
130
- - `design-prototype`: as usual. Never quick on states or contrast.
131
- - `design-content` and `design-wordmark` are not offered.
132
-
133
- They can switch to full at any step; the design brief records it under **Changes**.
103
+ `pace: quick` asks the same questions (they take a minute, and everything after reads them); each later skill says what it skips. They can switch to full at any step; the design brief records it under **Changes**.
134
104
 
135
105
  ## Then
136
106
 
@@ -1,12 +1,10 @@
1
1
  ---
2
2
  name: design-check
3
3
  description: >
4
- Check a screen against the design rules and DESIGN.md, and report findings
5
- (rule, hard or soft, where, fix). Frame mode checks a Figma frame, called
6
- by design-figma after each screen. Build mode checks a built UI spec against its
7
- Ready frames, run after implement-spec, with evidence for the PR. Docs mode
8
- checks the committed design docs name no reference. Hard
9
- findings block; soft findings are reported. It reports and never redesigns.
4
+ Checks a Figma frame, a built UI or the design docs against the design
5
+ rules and DESIGN.md, and reports; hard findings block, soft ones are
6
+ reported. Runs after each Figma screen, after implement-spec, or on the
7
+ docs.
10
8
  ---
11
9
 
12
10
  # design-check
@@ -1,14 +1,9 @@
1
1
  ---
2
2
  name: design-content
3
3
  description: >
4
- Optional, any time. Plan what each key screen says and shows: its sections in
5
- order, the one thing it leads with, real copy in the product's voice, and
6
- the full set of pictures each screen needs, with licensed stand-ins of the
7
- product's own subject where they have none. (The first three or four
8
- pictures are found by design-direction.) Never asks them to write final copy.
9
- Writes docs/design/design-content.md. Runs after the design brief, when
10
- they ask about copy or imagery, or when design offers it because they have
11
- no pictures.
4
+ Optional. What each key screen says and shows: sections, real copy in the
5
+ voice, and the pictures it needs, with licensed stand-ins. Writes
6
+ docs/design/design-content.md. Runs when they ask about copy or pictures.
12
7
  ---
13
8
 
14
9
  # Design content
@@ -1,15 +1,9 @@
1
1
  ---
2
2
  name: design-direction
3
3
  description: >
4
- Find the direction: eight first screens. Six adapt one of their references
5
- to this product as a designer would (its essence kept, never a copy), with
6
- one or two things borrowed from their other references; two develop a liked
7
- reference's concept further, redrawn for this product. Nothing on a screen
8
- that is not on their board. One agent builds them, scripts check
9
- contrast and clipped text, and they pick on a rendered canvas, or ask for
10
- more or a mix. Writes docs/design/design-direction.md. Runs after
11
- design-brief and design-moodboard; design-identity then refines its type
12
- and colour.
4
+ Eight first screens, each one liked reference's concept redrawn for this
5
+ product, nothing off their board; they pick. Writes docs/design/design-
6
+ direction.md. Runs after design-brief and design-moodboard.
13
7
  ---
14
8
 
15
9
  # Design direction
@@ -57,7 +51,7 @@ It says how many cards it left out for a missing shot: capture those again first
57
51
  - **What they like** is what is borrowed; **why** is where it may go. A like without a why: ask once.
58
52
  - **What they leave out is never on a screen:** dropped, or its role filled from another of their references.
59
53
  - With fewer than 6 references, say once that the eight will look alike.
60
- - **A like the design brief rules out** ("gold on deep green", brief: light only): the brief wins, and the like is carried by its role. Say it once before building; a change goes under **Changes** in the design brief.
54
+ - **A like the design brief rules out:** the brief wins, and the like is carried by its role. Say it once before building; a change goes under **Changes** in the design brief.
61
55
 
62
56
  ## 2. Read the references
63
57
 
@@ -69,15 +63,13 @@ Read the lead and every like closely: its grid, the share of the screen each blo
69
63
 
70
64
  ## 3. Eight first screens
71
65
 
72
- Read [Before you build](references/design-floor.md#before-you-build) first, and apply it to each screen while you draw it. Build them yourself, one after another, each `screens/<n>.html` from [screen-template.html](references/screen-template.html) at 1440 by 900 (an app, or `first seen on: phone`: 390 by 844).
66
+ Read [Before you build](references/design-floor.md#before-you-build) first, and apply it to each screen while you draw it. Build them yourself, one after another, each `screens/<n>.html` from [screen-template.html](references/screen-template.html) at 1440 by 900 (an app, or `first seen on: phone`: 390 by 844). Copy [screen.js](references/screen.js) to `screens/` once: every screen loads it, and none repeats it.
73
67
 
74
- - **Every screen does a first screen's job:** what this is, for whom, the one action. A reference that is not a first screen (a section from mid-page, an inner page, a poster) lends its system and its moves; what only works in its own role is left out.
75
- - **Every screen adapts its base, as a designer would, never copies it.** First its essence (the reading's `concept`: what it is, why it works). Keep that essence and its scene: the composition's logic, the proportions that make it work, the character of its type and colour. Then adapt the specifics to this client: their content and pictures, only the text its `slots` allow, and where the brief or the subject asks, a colour or face of the same character (another vibrant for a vibrant, a near cousin of the face from `fonts.mjs`). Sizes are scaled to this screen, at [rule 5](references/design-floor.md#5-typography)'s size floor. Two questions for every screen: would a designer call it the same idea (it must be yes), and would they call it a copy (it must be no)? A copy fails, and so does a screen that drifts from the idea.
76
- - **Then one or two moves** borrowed from their other liked references. A move is what they said they like, placed where their why says it belongs, and it changes only what it names. A why that would not be true on this base sends the move to another base.
77
- - **Never a collage.** A screen is its base and at most two moves, nothing more. The lead may set the round's tone, but its devices are moves like any other's: a device sits on its own reference's screens and on at most two others, so the eight stay eight different screens.
78
- - **Spread:** the lead is the base of two screens; four stand on one of their liked references each; two are **concepts**, each from a liked reference no other screen stands on. Eight screens, seven references: only with fewer than six likes does a reference take a second screen, the lead first, then the likes. Accent options still unanswered: about two screens each. Only the lead and their likes are used, never a card they did not pick. No main picture on more than two screens.
79
- - **What they like is taken whole.** A liked reference's scene, and any device borrowed from it (a ring of text, a block of colour, prints laid on a table), keeps the form, the job and the space around it that it has there. It is never taken apart, restyled or given another job: a block of colour that is a ground does not become a button, a ring of text gets no extra line, pictures laid over each other stay far enough apart to read as separate pictures. A move changes where things sit, never what they are.
80
- - **A concept** goes further: it develops one liked reference that no other screen is built on (the like with the clearest why first) and redraws its arrangement. First write its `concept` in the reading as a designer would defend it: what it is, and why it works (the tension, the hierarchy, what does the work). Then redraw the arrangement for this product's content so that idea still does the work, with that reference's devices, type, colour and picture treatment. Before you check it, two questions: would a designer call it the same concept (it must be yes), and would they call it a copy (it must be no)? Either answer wrong: redraw. A screen with no concept behind it is not a concept: it is generic, and goes.
68
+ - **Every screen does the job of this product's first view** (a site's opening screen, an app's first screen, the piece itself for a graphic): what this is, for whom, the one action. Any liked reference can lead one, whatever it was made as: a reference made for another role (a section from mid-page, an inner page, a poster for a site) keeps its idea and its system, redrawn for this role; what only works in its own role is left out.
69
+ - **Every screen is a concept: one liked reference, developed as a designer would, never copied.** First write its `concept` in the reading as a designer would defend it: what it is, and why it works (the tension, the hierarchy, what does the work). Keep that essence and its scene, redrawn for this screen's role (above). Then redraw the arrangement for this product's content so the idea still does the work, with that reference's devices, type, colour and picture treatment, and adapt the specifics to this client: their content and pictures, only the text its `slots` allow, and where the brief or the subject asks, a colour or face of the same character (another vibrant for a vibrant, a near cousin of the face from `fonts.mjs`). Sizes are scaled to this screen, at [rule 5](references/design-floor.md#5-typography)'s size floor. Two questions for every screen: would a designer call it the same concept (it must be yes), and would they call it a copy (it must be no)? Either answer wrong: redraw. A screen with no concept behind it is generic, and goes.
70
+ - **At most two moves** borrowed from their other liked references, only where they help the idea, never a collage. A move is what they said they like, placed where their why says it belongs, and it changes only what it names. A why that would not be true on this screen sends the move to another. The lead's devices are moves like any other's: on its own screens and at most two others, so the eight stay eight different screens.
71
+ - **Spread: eight concepts.** The lead develops two, each a different take on its idea; six develop one liked reference each, a different one for every screen. With fewer than six likes, the lead and then the likes take a second. Accent options still unanswered: about two screens each. Only the lead and their likes are used, never a card they did not pick. No main picture on more than two screens.
72
+ - **What they like is taken whole.** A liked reference's scene, and any device borrowed from it, keeps the form, the job and the space around it that it has there: never taken apart, restyled or given another job. A move changes where things sit, never what they are.
81
73
  - **Nothing off their board's character:** no face, colour, gradient, shadow, radius, button style or effect their references do not show in kind. An adapted colour or face keeps the role and energy of the one it replaces and comes from the board, the subject or the accent options. `PROVENANCE` names the reference for each, and what was adapted; before the checks, go through the screen's CSS, and anything it cannot name goes.
82
74
  - **Where the board shows nothing for a part** (a field, a price, a badge), take it from the base's own system; if the base has none, from another of their references. The name is set in the base's type; a mark is `design-wordmark`'s.
83
75
  - **Marked, not hidden:** anything the product does not really have yet carries `data-standin="picture"` or `"fact"`, with `data-standin-note`.
@@ -85,10 +77,10 @@ Read [Before you build](references/design-floor.md#before-you-build) first, and
85
77
  Record each in `.longbeard/design/direction/screens.json`:
86
78
 
87
79
  ```
88
- [{ "n": 1, "base": "<card name>", "moves": [{ "what": "<the move>", "from": "<card name>", "like": "<their words, or null>" }], "accent": "<#hex from the options, or null>", "state": "built" }]
80
+ [{ "n": 1, "kind": "concept", "base": "<card name>", "idea": "<the concept it keeps, in one line>", "moves": [{ "what": "<the move>", "from": "<card name>", "like": "<their words, or null>" }], "accent": "<#hex from the options, or null>", "state": "built" }]
89
81
  ```
90
82
 
91
- A concept also has `"kind": "concept"` and `"idea": "<the concept it keeps, in one line>"`; its `base` is the reference it develops.
83
+ `base` is the reference it develops; `moves` may be empty.
92
84
 
93
85
  `state` is `built`, or `failed` with `"failure": "<why>"`. Optional: `round` (1 when left out), `fault` (one line), `shot`.
94
86
 
@@ -119,11 +111,11 @@ It shows every screen in a strip and, for the one they open, what it is made fro
119
111
  - **More of 3:** three more on 3's base with other moves, in round 2.
120
112
  - **A mix** ("4 with 7's colours"): one screen.
121
113
  - **More:** a fresh round of eight, new pairings. After two rounds with nothing taken, ask once what is missing (`design-moodboard`).
122
- - **A part,** only when they ask ("other menus for 3"): three or four versions of that part on the real screen, everything else kept, each from a reference that shows that part. **Options live on the page:** each version is an element with `data-variant="<n>"` and `data-from="<card name>"`, and the page loads [variants.js](references/variants.js) (copy it beside the page): `?variant=<n>` shows one, a small bar names its reference, and ← → flip between them. Capture each with `?variant=<n>&bar=0`, and record each in `screens.json` as `"of": <n>, "part": "<name>"`.
114
+ - **A part,** only when they ask ("other menus for 3"): three or four versions of that part on the real screen, everything else kept, each from a reference that shows that part. They live on the page, flipped with [variants.js](references/variants.js) (how, in its header); record each in `screens.json` as `"of": <n>, "part": "<name>"`.
123
115
 
124
116
  Every version stays theirs. A pick that breaks a why they gave: ask once whether the why still holds; never block it.
125
117
 
126
- On their yes, read it back in one line, with three to five **principles**: what this design does on every screen, drawn from their whys and the chosen screen, in their words where they gave some ("one loud thing per screen", "pictures always run to the edge", "type does the decorating"). Each is specific enough that a page could break it. A correction rewrites a principle. Then read its base's motion unless the brief's is none ([library.md](references/library.md)), copy it to `prototype/first.html`, and set `"chosen": n` in `screens.json`. When the brief's `decides` names someone else, they confirm it first.
118
+ On their yes, read it back in one line, with three to five **principles**: what this design does on every screen, drawn from their whys and the chosen screen, in their words where they gave some ("one loud thing per screen", "pictures always run to the edge", "type does the decorating"). Each is specific enough that a page could break it. A correction rewrites a principle. Then read its base's motion unless the brief's is none ([library.md](references/library.md)), copy it and `screen.js` to `prototype/` (as `first.html`), and set `"chosen": n` in `screens.json`. When the brief's `decides` names someone else, they confirm it first.
127
119
 
128
120
  **In context, before the identity.** A studio shows a chosen concept where it will live before it is signed off. Build two more pages from the chosen screen: its phone view (390 wide), and the brief's key screen that is hardest for this look (the densest list, a form), in the chosen screen's frame and principles, each page opening with its own job. Check them like the eight, and show them beside the chosen screen with the direction. If the look breaks on real content, say where in one line: going back to another pick is still cheap. The prototype starts from these pages.
129
121
 
@@ -169,9 +161,4 @@ No reference names, links or paths. Then the direction in up to five lines:
169
161
 
170
162
  ## Do not
171
163
 
172
- - Rank the screens, or recommend from taste: the one recommendation names the design brief line it serves.
173
- - Add anything their board does not have, or anything they wrote to leave out.
174
- - Show a concept that drops the idea it develops, or copies its reference's layout.
175
- - Fit more text on a screen than its base carries.
176
- - Undo what they like because a check flagged it.
177
164
  - Take a reference's content, pictures or words.
@@ -72,6 +72,6 @@ What a reference cannot show is "not seen", never guessed.
72
72
 
73
73
  ## The subject
74
74
 
75
- The subject is a card on the board and is read like a reference, without a layout and never a base. `subject-colours.mjs` proposes a palette from its pictures ([subject.md](subject.md)): a quiet ground, its ink, and an accent when the subject has a second hue. Write it as `"subject": { "ground", "ink", "accent", "likes": [{ "what", "why" }], "things": ["<what they liked in its pictures or world: a stamp, a number, a paper bag>"] }`. The palette is one more a screen may borrow, as a quiet tint or an accent, never stronger than the references' own pages. A liked thing is a move that may change form (principle 4).
75
+ The subject is a card on the board and is read like a reference, without a layout and never a base. Its palette comes from [subject.md](subject.md). Write it as `"subject": { "ground", "ink", "accent", "likes": [{ "what", "why" }], "things": ["<what they liked in its pictures or world: a stamp, a number, a paper bag>"] }`. A liked thing is a move that may change form (principle 4).
76
76
 
77
77
  **Record, never judge.** A gradient, a glow, a face the rules call a tell: if a reference uses it, it is in its reading. What they own goes in `"theirs"`; a refused face or colour is left out; light only or dark only leaves out the readings' palettes of the other kind as borrowable palettes, never the references.
@@ -4,9 +4,10 @@
4
4
  A screen is one reference rebuilt faithfully with the product's content, then
5
5
  changed by one or two moves borrowed from other references. Write
6
6
  it as a designer would write a static page: plain HTML and CSS, measured
7
- sizes in px at the screen's width. The template only does what is the same
8
- every time: the look as variables, overrides in the URL, the faces loaded,
9
- and the title set to "ready" once they are in, so a capture can wait for it.
7
+ sizes in px at the screen's width. What is the same every time (the look as
8
+ variables, overrides in the URL, the faces loaded, the title set to "ready"
9
+ so a capture can wait for it, the live controls) is screen.js, copied once
10
+ beside the pages and loaded last. Never paste it into a page.
10
11
 
11
12
  WRITE three things:
12
13
  - LOOK: the faces and colours this screen uses, by role. Every colour and
@@ -69,165 +70,7 @@ const CONTROLS = {
69
70
  // accent: [["#f4f1ea", "#e2501c"]], // each reference's ground and accent, as its reading has them
70
71
  // radius: [0, 24], // the usual corner in px at 1440: least and most
71
72
  };
72
- // ---------------------------------------------------------------- controls: the measures (plain functions)
73
- const Controls = {
74
- rgb: (hex) => { const h = hex.replace("#", ""); const f = h.length === 3 ? h.replace(/./g, "$&$&") : h; return [0, 2, 4].map((i) => parseInt(f.slice(i, i + 2), 16)); },
75
- hex: (c) => "#" + c.map((v) => Math.round(Math.min(255, Math.max(0, v))).toString(16).padStart(2, "0")).join(""),
76
- lum: (c) => { const [r, g, b] = c.map((v) => { v /= 255; return v <= 0.03928 ? v / 12.92 : ((v + 0.055) / 1.055) ** 2.4; }); return 0.2126 * r + 0.7152 * g + 0.0722 * b; },
77
- contrast(a, b) { const x = this.lum(this.rgb(a)), y = this.lum(this.rgb(b)); return (Math.max(x, y) + 0.05) / (Math.min(x, y) + 0.05); },
78
- // [least, most] of the numbers, or null when the board has no range (fewer than two values, or all alike).
79
- range(list) { const v = (Array.isArray(list) ? list : []).filter((n) => typeof n === "number" && isFinite(n)); if (v.length < 2) return null; const lo = Math.min(...v), hi = Math.max(...v); return hi > lo ? [lo, hi] : null; },
80
- // The board's range, widened to hold the screen's own value, so the screen can always come back to itself.
81
- span(range, own) { return [Math.min(range[0], own), Math.max(range[1], own)]; },
82
- // The accent's contrast against the ground, for each pair (ground, accent) the board has.
83
- accentRatios(pairs) { return (Array.isArray(pairs) ? pairs : []).filter((p) => Array.isArray(p) && p[0] && p[1]).map((p) => Math.round(10 * this.contrast(p[1], p[0])) / 10); },
84
- // The accent moved along the line from the ground through itself, to the contrast asked for.
85
- accentAt(ground, accent, target) {
86
- const g = this.rgb(ground), a = this.rgb(accent);
87
- let best = null;
88
- for (let t = 0; t <= 3.001; t += 0.01) {
89
- const hex = this.hex(g.map((v, i) => v + (a[i] - v) * t));
90
- const d = Math.abs(this.contrast(hex, ground) - target);
91
- if (!best || d < best.d - 1e-9) best = { d, hex };
92
- }
93
- return { hex: best.hex, ratio: Math.round(10 * this.contrast(best.hex, ground)) / 10 };
94
- },
95
- // What the person pastes back: only what moved, in the measures the board gives.
96
- copy(lines) { return lines.length ? ["Adjusted on this screen (own to chosen). Record in first.html's LOOK and CSS, not in the address:", ...lines].join("\n") : "Nothing moved: the screen as it was."; },
97
- };
98
- // ---------------------------------------------------------------- controls: the panel (only with ?controls, never in a capture)
99
- function mountControls(look) {
100
- const set = (k, v) => document.documentElement.style.setProperty(k, v);
101
- const root = document.getElementById("screen");
102
- const all = [...root.querySelectorAll("*")];
103
- const px = (v) => parseFloat(v) || 0;
104
- const round = (n, d) => Math.round(n * d) / d;
105
- const display = all.filter((e) => e.classList.contains("display") && !e.parentElement.closest(".display") && e.textContent.trim()).map((e) => {
106
- const cs = getComputedStyle(e), size = px(cs.fontSize), lh = px(cs.lineHeight);
107
- return { e, size, lead: cs.lineHeight.endsWith("px") && lh ? lh / size : 1.2 };
108
- });
109
- const chars = new Map();
110
- for (const e of all) {
111
- if (e.closest(".display")) continue;
112
- const n = [...e.childNodes].filter((c) => c.nodeType === 3).map((c) => c.textContent.trim()).join("").length;
113
- if (n) { const s = Math.round(px(getComputedStyle(e).fontSize)); chars.set(s, (chars.get(s) || 0) + n); }
114
- }
115
- const body = [...chars].sort((a, b) => b[1] - a[1])[0]?.[0] || 0;
116
- const biggest = display.slice().sort((a, b) => b.size - a.size)[0];
117
- const corners = ["TopLeft", "TopRight", "BottomRight", "BottomLeft"];
118
- const rounded = [];
119
- for (const e of all) {
120
- const cs = getComputedStyle(e), r = e.getBoundingClientRect(), half = Math.min(r.width, r.height) / 2;
121
- const raw = corners.map((c) => cs[`border${c}Radius`]);
122
- if (raw.some((v) => /[%/ ]/.test(v))) continue;
123
- const v = raw.map(px);
124
- if (v.some((n) => n > 0) && v.every((n) => n < half)) rounded.push({ e, v });
125
- }
126
- const tally = new Map();
127
- for (const { v } of rounded) { const n = Math.round(v.find((x) => x > 0)); tally.set(n, (tally.get(n) || 0) + 1); }
128
- const ownRadius = [...tally].sort((a, b) => b[1] - a[1])[0]?.[0] || 0;
129
- const state = {};
130
- const kinds = [];
131
- const type = Controls.range(CONTROLS.type), lead = Controls.range(CONTROLS.leading), rad = Controls.range(CONTROLS.radius), acc = Controls.range(Controls.accentRatios(CONTROLS.accent));
132
- const ownAccent = look.accent ? round(Controls.contrast(look.accent, look.ground), 10) : 0;
133
- const refresh = () => {
134
- const kt = state.type === undefined ? 1 : state.type / (biggest.size / body), kl = state.leading === undefined ? 1 : state.leading / biggest.lead;
135
- for (const d of display) {
136
- d.e.style.fontSize = kt === 1 ? "" : `${d.size * kt}px`;
137
- d.e.style.lineHeight = kt === 1 && kl === 1 ? "" : String(d.lead * kl);
138
- }
139
- const kr = state.radius === undefined ? 1 : state.radius / ownRadius;
140
- for (const { e, v } of rounded) corners.forEach((c, i) => { e.style[`border${c}Radius`] = kr === 1 || !v[i] ? "" : `${v[i] * kr}px`; });
141
- state.accentHex = state.accent === undefined || Math.abs(state.accent - ownAccent) < 0.05 ? look.accent : Controls.accentAt(look.ground, look.accent, state.accent).hex;
142
- if (look.accent) set("--accent", state.accentHex);
143
- };
144
- if (biggest && body && type) {
145
- const own = round(biggest.size / body, 10);
146
- kinds.push({ key: "type", label: "Type scale", note: "display over text", own, range: Controls.span(type, own), step: 0.1,
147
- line: (v) => `type scale: ${own} to ${v} (every display size x ${round(v / own, 100)}; text stays ${body}px)` });
148
- }
149
- if (biggest && lead) {
150
- const own = round(biggest.lead, 100);
151
- kinds.push({ key: "leading", label: "Line spacing", note: "display line height", own, range: Controls.span(lead, own), step: 0.01,
152
- line: (v) => `line spacing: ${own} to ${v} (every display line height x ${round(v / own, 100)})` });
153
- }
154
- if (look.accent && acc) {
155
- kinds.push({ key: "accent", label: "Accent strength", note: "contrast against the ground", own: ownAccent, range: Controls.span(acc, ownAccent), step: 0.1,
156
- line: () => `accent: ${look.accent} to ${state.accentHex} (${ownAccent}:1 to ${round(Controls.contrast(state.accentHex, look.ground), 10)}:1 against the ground)` });
157
- }
158
- if (ownRadius && rad) {
159
- kinds.push({ key: "radius", label: "Corner radius", note: "px, rounded corners only", own: ownRadius, range: Controls.span(rad, ownRadius), step: 1,
160
- line: (v) => `corner radius: ${ownRadius}px to ${v}px (every rounded corner x ${round(v / ownRadius, 100)}; discs, pills and arches stay)` });
161
- }
162
- if (!kinds.length) return;
163
- const style = Object.assign(document.createElement("style"), { textContent: "#lb-controls{position:fixed;right:12px;bottom:12px;z-index:99999;font:12px/1.4 system-ui,sans-serif;color:#111;text-align:left}#lb-controls *{box-sizing:border-box}#lb-controls .lb-box{width:290px;margin-bottom:6px;padding:12px;background:#fff;border:1px solid #111;display:none}#lb-controls.lb-open .lb-box{display:block}#lb-controls label{display:block;margin:0 0 10px}#lb-controls label b{display:flex;justify-content:space-between}#lb-controls small{color:#555}#lb-controls input[type=range]{width:100%}#lb-controls button{font:inherit;padding:4px 8px;margin-right:6px;background:#fff;color:#111;border:1px solid #111;cursor:pointer}#lb-controls textarea{display:block;width:100%;height:96px;margin-top:8px;font:11px/1.3 ui-monospace,monospace;resize:none}" });
164
- const panel = Object.assign(document.createElement("div"), { id: "lb-controls" });
165
- const box = Object.assign(document.createElement("div"), { className: "lb-box" });
166
- const out = Object.assign(document.createElement("textarea"), { readOnly: true });
167
- const show = () => { out.value = Controls.copy(kinds.filter((k) => state[k.key] !== undefined && state[k.key] !== k.own).map((k) => k.line(state[k.key]))); };
168
- for (const k of kinds) {
169
- const label = document.createElement("label"), head = document.createElement("b"), name = document.createElement("span"), val = document.createElement("span");
170
- const input = Object.assign(document.createElement("input"), { type: "range", min: k.range[0], max: k.range[1], step: k.step, value: k.own });
171
- const list = Object.assign(document.createElement("datalist"), { id: `lb-own-${k.key}` }), tick = Object.assign(document.createElement("option"), { value: k.own }), note = document.createElement("small");
172
- list.appendChild(tick);
173
- input.setAttribute("list", list.id);
174
- name.textContent = k.label;
175
- val.textContent = k.own;
176
- note.textContent = `${k.note}: its own ${k.own} (the tick); the board ${round(k.range[0], 100)} to ${round(k.range[1], 100)}`;
177
- input.oninput = () => { state[k.key] = Number(input.value); val.textContent = input.value; refresh(); show(); };
178
- k.reset = () => { delete state[k.key]; input.value = k.own; val.textContent = k.own; };
179
- head.append(name, val);
180
- label.append(head, input, list, note);
181
- box.appendChild(label);
182
- }
183
- const button = (text, click) => Object.assign(document.createElement("button"), { textContent: text, onclick: click });
184
- box.append(
185
- button("Reset", () => { kinds.forEach((k) => k.reset()); refresh(); show(); }),
186
- button("Copy", () => { out.select(); try { navigator.clipboard.writeText(out.value).catch(() => document.execCommand("copy")); } catch (_) { document.execCommand("copy"); } }),
187
- out,
188
- );
189
- panel.append(box, button("Adjust", () => panel.classList.toggle("lb-open")));
190
- document.head.appendChild(style);
191
- document.body.appendChild(panel);
192
- show();
193
- }
194
- // ---------------------------------------------------------------- the same every time
195
- (async () => {
196
- const q = new URLSearchParams(location.search);
197
- const look = { ...LOOK, more: { ...(LOOK.more || {}) } };
198
- for (const k of ["face", "body", "ground", "ink"]) if (q.get(k)) look[k] = q.get(k);
199
- if (q.get("weight")) look.weight = Number(q.get("weight"));
200
- if (q.get("accent")) look.accent = q.get("accent") === "none" ? null : q.get("accent");
201
- const [W, H] = (q.get("size") || "1440x900").split("x").map(Number);
202
- const set = (k, v) => document.documentElement.style.setProperty(k, v);
203
- set("--w", W + "px");
204
- set("--h", H + "px");
205
- set("--face", `"${look.face}"`);
206
- set("--weight", look.weight || 400);
207
- set("--body-face", `"${look.body || look.face}"`);
208
- set("--ground", look.ground);
209
- set("--ink", look.ink);
210
- set("--accent", look.accent || look.ink);
211
- for (const [k, v] of Object.entries(look.more)) set(`--${k}`, v);
212
- document.body.dataset.provenance = PROVENANCE.length;
213
- const wanted = [[look.face, look.weight || 400], [look.body || look.face, 400], [look.body || look.face, 700]];
214
- const sheets = [];
215
- for (const href of look.css || []) wanted.push([null, null, href]);
216
- for (const [face, weight, href] of wanted) {
217
- const urls = href ? [href] : [`https://fonts.googleapis.com/css2?family=${encodeURIComponent(face).replace(/%20/g, "+")}:wght@${weight}&display=block`, `https://fonts.googleapis.com/css2?family=${encodeURIComponent(face).replace(/%20/g, "+")}&display=block`];
218
- for (const url of urls) {
219
- if (document.querySelector(`link[href="${url}"]`)) continue;
220
- const link = Object.assign(document.createElement("link"), { rel: "stylesheet", href: url });
221
- sheets.push(new Promise((done) => ((link.onload = done), (link.onerror = done))));
222
- document.head.appendChild(link);
223
- }
224
- }
225
- await Promise.all(sheets);
226
- await Promise.all(wanted.filter(([f]) => f).map(([f, w]) => document.fonts.load(`${w} 100px "${f}"`).catch(() => [])));
227
- await document.fonts.ready;
228
- document.title = "ready";
229
- if (q.has("controls") && !q.has("capture")) mountControls(look);
230
- })();
231
73
  </script>
74
+ <script src="screen.js"></script>
232
75
  </body>
233
76
  </html>
@@ -0,0 +1,163 @@
1
+ // The fixed part of every direction screen: the look from the URL, the faces
2
+ // loaded, the title set to "ready", and the live controls (only with ?controls).
3
+ // Copy it once beside the screens (screens/screen.js, prototype/screen.js); each
4
+ // page loads it after its own LOOK, PROVENANCE and CONTROLS. Never edit a copy.
5
+ // ---------------------------------------------------------------- controls: the measures (plain functions)
6
+ const Controls = {
7
+ rgb: (hex) => { const h = hex.replace("#", ""); const f = h.length === 3 ? h.replace(/./g, "$&$&") : h; return [0, 2, 4].map((i) => parseInt(f.slice(i, i + 2), 16)); },
8
+ hex: (c) => "#" + c.map((v) => Math.round(Math.min(255, Math.max(0, v))).toString(16).padStart(2, "0")).join(""),
9
+ lum: (c) => { const [r, g, b] = c.map((v) => { v /= 255; return v <= 0.03928 ? v / 12.92 : ((v + 0.055) / 1.055) ** 2.4; }); return 0.2126 * r + 0.7152 * g + 0.0722 * b; },
10
+ contrast(a, b) { const x = this.lum(this.rgb(a)), y = this.lum(this.rgb(b)); return (Math.max(x, y) + 0.05) / (Math.min(x, y) + 0.05); },
11
+ // [least, most] of the numbers, or null when the board has no range (fewer than two values, or all alike).
12
+ range(list) { const v = (Array.isArray(list) ? list : []).filter((n) => typeof n === "number" && isFinite(n)); if (v.length < 2) return null; const lo = Math.min(...v), hi = Math.max(...v); return hi > lo ? [lo, hi] : null; },
13
+ // The board's range, widened to hold the screen's own value, so the screen can always come back to itself.
14
+ span(range, own) { return [Math.min(range[0], own), Math.max(range[1], own)]; },
15
+ // The accent's contrast against the ground, for each pair (ground, accent) the board has.
16
+ accentRatios(pairs) { return (Array.isArray(pairs) ? pairs : []).filter((p) => Array.isArray(p) && p[0] && p[1]).map((p) => Math.round(10 * this.contrast(p[1], p[0])) / 10); },
17
+ // The accent moved along the line from the ground through itself, to the contrast asked for.
18
+ accentAt(ground, accent, target) {
19
+ const g = this.rgb(ground), a = this.rgb(accent);
20
+ let best = null;
21
+ for (let t = 0; t <= 3.001; t += 0.01) {
22
+ const hex = this.hex(g.map((v, i) => v + (a[i] - v) * t));
23
+ const d = Math.abs(this.contrast(hex, ground) - target);
24
+ if (!best || d < best.d - 1e-9) best = { d, hex };
25
+ }
26
+ return { hex: best.hex, ratio: Math.round(10 * this.contrast(best.hex, ground)) / 10 };
27
+ },
28
+ // What the person pastes back: only what moved, in the measures the board gives.
29
+ copy(lines) { return lines.length ? ["Adjusted on this screen (own to chosen). Record in first.html's LOOK and CSS, not in the address:", ...lines].join("\n") : "Nothing moved: the screen as it was."; },
30
+ };
31
+ // ---------------------------------------------------------------- controls: the panel (only with ?controls, never in a capture)
32
+ function mountControls(look) {
33
+ const set = (k, v) => document.documentElement.style.setProperty(k, v);
34
+ const root = document.getElementById("screen");
35
+ const all = [...root.querySelectorAll("*")];
36
+ const px = (v) => parseFloat(v) || 0;
37
+ const round = (n, d) => Math.round(n * d) / d;
38
+ const display = all.filter((e) => e.classList.contains("display") && !e.parentElement.closest(".display") && e.textContent.trim()).map((e) => {
39
+ const cs = getComputedStyle(e), size = px(cs.fontSize), lh = px(cs.lineHeight);
40
+ return { e, size, lead: cs.lineHeight.endsWith("px") && lh ? lh / size : 1.2 };
41
+ });
42
+ const chars = new Map();
43
+ for (const e of all) {
44
+ if (e.closest(".display")) continue;
45
+ const n = [...e.childNodes].filter((c) => c.nodeType === 3).map((c) => c.textContent.trim()).join("").length;
46
+ if (n) { const s = Math.round(px(getComputedStyle(e).fontSize)); chars.set(s, (chars.get(s) || 0) + n); }
47
+ }
48
+ const body = [...chars].sort((a, b) => b[1] - a[1])[0]?.[0] || 0;
49
+ const biggest = display.slice().sort((a, b) => b.size - a.size)[0];
50
+ const corners = ["TopLeft", "TopRight", "BottomRight", "BottomLeft"];
51
+ const rounded = [];
52
+ for (const e of all) {
53
+ const cs = getComputedStyle(e), r = e.getBoundingClientRect(), half = Math.min(r.width, r.height) / 2;
54
+ const raw = corners.map((c) => cs[`border${c}Radius`]);
55
+ if (raw.some((v) => /[%/ ]/.test(v))) continue;
56
+ const v = raw.map(px);
57
+ if (v.some((n) => n > 0) && v.every((n) => n < half)) rounded.push({ e, v });
58
+ }
59
+ const tally = new Map();
60
+ for (const { v } of rounded) { const n = Math.round(v.find((x) => x > 0)); tally.set(n, (tally.get(n) || 0) + 1); }
61
+ const ownRadius = [...tally].sort((a, b) => b[1] - a[1])[0]?.[0] || 0;
62
+ const state = {};
63
+ const kinds = [];
64
+ const type = Controls.range(CONTROLS.type), lead = Controls.range(CONTROLS.leading), rad = Controls.range(CONTROLS.radius), acc = Controls.range(Controls.accentRatios(CONTROLS.accent));
65
+ const ownAccent = look.accent ? round(Controls.contrast(look.accent, look.ground), 10) : 0;
66
+ const refresh = () => {
67
+ const kt = state.type === undefined ? 1 : state.type / (biggest.size / body), kl = state.leading === undefined ? 1 : state.leading / biggest.lead;
68
+ for (const d of display) {
69
+ d.e.style.fontSize = kt === 1 ? "" : `${d.size * kt}px`;
70
+ d.e.style.lineHeight = kt === 1 && kl === 1 ? "" : String(d.lead * kl);
71
+ }
72
+ const kr = state.radius === undefined ? 1 : state.radius / ownRadius;
73
+ for (const { e, v } of rounded) corners.forEach((c, i) => { e.style[`border${c}Radius`] = kr === 1 || !v[i] ? "" : `${v[i] * kr}px`; });
74
+ state.accentHex = state.accent === undefined || Math.abs(state.accent - ownAccent) < 0.05 ? look.accent : Controls.accentAt(look.ground, look.accent, state.accent).hex;
75
+ if (look.accent) set("--accent", state.accentHex);
76
+ };
77
+ if (biggest && body && type) {
78
+ const own = round(biggest.size / body, 10);
79
+ kinds.push({ key: "type", label: "Type scale", note: "display over text", own, range: Controls.span(type, own), step: 0.1,
80
+ line: (v) => `type scale: ${own} to ${v} (every display size x ${round(v / own, 100)}; text stays ${body}px)` });
81
+ }
82
+ if (biggest && lead) {
83
+ const own = round(biggest.lead, 100);
84
+ kinds.push({ key: "leading", label: "Line spacing", note: "display line height", own, range: Controls.span(lead, own), step: 0.01,
85
+ line: (v) => `line spacing: ${own} to ${v} (every display line height x ${round(v / own, 100)})` });
86
+ }
87
+ if (look.accent && acc) {
88
+ kinds.push({ key: "accent", label: "Accent strength", note: "contrast against the ground", own: ownAccent, range: Controls.span(acc, ownAccent), step: 0.1,
89
+ line: () => `accent: ${look.accent} to ${state.accentHex} (${ownAccent}:1 to ${round(Controls.contrast(state.accentHex, look.ground), 10)}:1 against the ground)` });
90
+ }
91
+ if (ownRadius && rad) {
92
+ kinds.push({ key: "radius", label: "Corner radius", note: "px, rounded corners only", own: ownRadius, range: Controls.span(rad, ownRadius), step: 1,
93
+ line: (v) => `corner radius: ${ownRadius}px to ${v}px (every rounded corner x ${round(v / ownRadius, 100)}; discs, pills and arches stay)` });
94
+ }
95
+ if (!kinds.length) return;
96
+ const style = Object.assign(document.createElement("style"), { textContent: "#lb-controls{position:fixed;right:12px;bottom:12px;z-index:99999;font:12px/1.4 system-ui,sans-serif;color:#111;text-align:left}#lb-controls *{box-sizing:border-box}#lb-controls .lb-box{width:290px;margin-bottom:6px;padding:12px;background:#fff;border:1px solid #111;display:none}#lb-controls.lb-open .lb-box{display:block}#lb-controls label{display:block;margin:0 0 10px}#lb-controls label b{display:flex;justify-content:space-between}#lb-controls small{color:#555}#lb-controls input[type=range]{width:100%}#lb-controls button{font:inherit;padding:4px 8px;margin-right:6px;background:#fff;color:#111;border:1px solid #111;cursor:pointer}#lb-controls textarea{display:block;width:100%;height:96px;margin-top:8px;font:11px/1.3 ui-monospace,monospace;resize:none}" });
97
+ const panel = Object.assign(document.createElement("div"), { id: "lb-controls" });
98
+ const box = Object.assign(document.createElement("div"), { className: "lb-box" });
99
+ const out = Object.assign(document.createElement("textarea"), { readOnly: true });
100
+ const show = () => { out.value = Controls.copy(kinds.filter((k) => state[k.key] !== undefined && state[k.key] !== k.own).map((k) => k.line(state[k.key]))); };
101
+ for (const k of kinds) {
102
+ const label = document.createElement("label"), head = document.createElement("b"), name = document.createElement("span"), val = document.createElement("span");
103
+ const input = Object.assign(document.createElement("input"), { type: "range", min: k.range[0], max: k.range[1], step: k.step, value: k.own });
104
+ const list = Object.assign(document.createElement("datalist"), { id: `lb-own-${k.key}` }), tick = Object.assign(document.createElement("option"), { value: k.own }), note = document.createElement("small");
105
+ list.appendChild(tick);
106
+ input.setAttribute("list", list.id);
107
+ name.textContent = k.label;
108
+ val.textContent = k.own;
109
+ note.textContent = `${k.note}: its own ${k.own} (the tick); the board ${round(k.range[0], 100)} to ${round(k.range[1], 100)}`;
110
+ input.oninput = () => { state[k.key] = Number(input.value); val.textContent = input.value; refresh(); show(); };
111
+ k.reset = () => { delete state[k.key]; input.value = k.own; val.textContent = k.own; };
112
+ head.append(name, val);
113
+ label.append(head, input, list, note);
114
+ box.appendChild(label);
115
+ }
116
+ const button = (text, click) => Object.assign(document.createElement("button"), { textContent: text, onclick: click });
117
+ box.append(
118
+ button("Reset", () => { kinds.forEach((k) => k.reset()); refresh(); show(); }),
119
+ button("Copy", () => { out.select(); try { navigator.clipboard.writeText(out.value).catch(() => document.execCommand("copy")); } catch (_) { document.execCommand("copy"); } }),
120
+ out,
121
+ );
122
+ panel.append(box, button("Adjust", () => panel.classList.toggle("lb-open")));
123
+ document.head.appendChild(style);
124
+ document.body.appendChild(panel);
125
+ show();
126
+ }
127
+ // ---------------------------------------------------------------- the same every time
128
+ (async () => {
129
+ const q = new URLSearchParams(location.search);
130
+ const look = { ...LOOK, more: { ...(LOOK.more || {}) } };
131
+ for (const k of ["face", "body", "ground", "ink"]) if (q.get(k)) look[k] = q.get(k);
132
+ if (q.get("weight")) look.weight = Number(q.get("weight"));
133
+ if (q.get("accent")) look.accent = q.get("accent") === "none" ? null : q.get("accent");
134
+ const [W, H] = (q.get("size") || "1440x900").split("x").map(Number);
135
+ const set = (k, v) => document.documentElement.style.setProperty(k, v);
136
+ set("--w", W + "px");
137
+ set("--h", H + "px");
138
+ set("--face", `"${look.face}"`);
139
+ set("--weight", look.weight || 400);
140
+ set("--body-face", `"${look.body || look.face}"`);
141
+ set("--ground", look.ground);
142
+ set("--ink", look.ink);
143
+ set("--accent", look.accent || look.ink);
144
+ for (const [k, v] of Object.entries(look.more)) set(`--${k}`, v);
145
+ document.body.dataset.provenance = PROVENANCE.length;
146
+ const wanted = [[look.face, look.weight || 400], [look.body || look.face, 400], [look.body || look.face, 700]];
147
+ const sheets = [];
148
+ for (const href of look.css || []) wanted.push([null, null, href]);
149
+ for (const [face, weight, href] of wanted) {
150
+ const urls = href ? [href] : [`https://fonts.googleapis.com/css2?family=${encodeURIComponent(face).replace(/%20/g, "+")}:wght@${weight}&display=block`, `https://fonts.googleapis.com/css2?family=${encodeURIComponent(face).replace(/%20/g, "+")}&display=block`];
151
+ for (const url of urls) {
152
+ if (document.querySelector(`link[href="${url}"]`)) continue;
153
+ const link = Object.assign(document.createElement("link"), { rel: "stylesheet", href: url });
154
+ sheets.push(new Promise((done) => ((link.onload = done), (link.onerror = done))));
155
+ document.head.appendChild(link);
156
+ }
157
+ }
158
+ await Promise.all(sheets);
159
+ await Promise.all(wanted.filter(([f]) => f).map(([f, w]) => document.fonts.load(`${w} 100px "${f}"`).catch(() => [])));
160
+ await document.fonts.ready;
161
+ document.title = "ready";
162
+ if (q.has("controls") && !q.has("capture")) mountControls(look);
163
+ })();
@@ -14,7 +14,7 @@ Before the screens: three or four pictures of what the product is about (the bak
14
14
  node <skill>/scripts/pictures.mjs "flour on a wooden bench" --out .longbeard/design/pictures --count 2 --orientation landscape
15
15
  ```
16
16
 
17
- It keeps only pictures whose licence holds everywhere (CC0, CC BY, CC BY-SA, public domain marked as worldwide) large enough for a screen, and writes `credits.tsv` beside them, with a ready credit line for each; credits required by a licence must appear in the product, and the ready line is in `credits.tsv`. Open each (a contact sheet); drop one that is off-subject and search again with a more concrete query ("roasted coffee beans", not "coffee"). Commons leans to museum and archive photos for some subjects (crafts come back as excavated shards and old engravings): after two queries that miss, ask them for two or three photos of their own, a phone is fine, or go on with fewer.
17
+ It keeps only freely licensed pictures large enough for a screen, and writes `credits.tsv` beside them: a credit a licence requires must appear in the product. Drop one that is off-subject and search again with a more concrete query ("roasted coffee beans", not "coffee"). After two queries that miss, ask them for two or three photos of their own, a phone is fine, or go on with fewer.
18
18
  - **Pictures a reference could hold.** The references' pictures are clean: one subject, a plain or quiet ground, a calm crop. Prefer the stand-in that is one loaf on a plain bench to the one with a kettle and a counter behind it; crop to the subject. A picture with clutter in it makes a faithful layout look unfinished.
19
19
  - **Of the kind the look uses.** When the moodboard is photographs, look for photographs; when it is illustration or renders, say that those are not searched, and use the closest photographs, cropped and toned as the moodboard does, until theirs exist.
20
20
 
@@ -1,11 +1,9 @@
1
1
  ---
2
2
  name: design-figma
3
3
  description: >
4
- Build the approved design in Figma: variables and styles from DESIGN.md, the
5
- identity board on the Cover, only the components the key screens need, the
6
- key screens and every reachable state, each checked with design-check and
7
- marked Ready on approval. Runs when DESIGN.md exists and its screens have no
8
- Ready frames, or for a feature's screens. Figma is required for UI projects.
4
+ Builds the approved design in Figma: tokens, the identity board,
5
+ components and every key screen and state, marked Ready on approval. Runs
6
+ when DESIGN.md exists without Ready frames, or for a feature's screens.
9
7
  ---
10
8
 
11
9
  # Design Figma
@@ -1,13 +1,9 @@
1
1
  ---
2
2
  name: design-identity
3
3
  description: >
4
- Lock and refine the identity on the screen they chose in design-direction:
5
- the type pairing and a small set of colours, starting from what that screen
6
- was built with, with close alternatives from measured font lists, even colour
7
- steps, their other references, the subject's pictures and anything they own,
8
- all rendered on that screen, never picked by the agent. Ends in the identity
9
- board: the faces at size and the colours as swatches with their values and
10
- roles. Runs after design-direction; or for a rebrand.
4
+ Refines the chosen screen's type and colours from rendered options traced
5
+ to their board, then the identity board. Writes docs/design/design-
6
+ identity.md. Runs after design-direction, or for a rebrand.
11
7
  ---
12
8
 
13
9
  # Design identity
@@ -1,13 +1,9 @@
1
1
  ---
2
2
  name: design-moodboard
3
3
  description: >
4
- References for the look. Reads their own moodboard (a Figma board, a folder,
5
- links) and fills only what it lacks, or, without one, finds a wide pool from
6
- the sources they choose for them to mark like or no on a picker page, with
7
- one sharper second round. The keeps are captured privately; the committed doc
8
- describes what the board says, move by move, without naming a source. Runs
9
- after docs/design/design-brief.md exists, or when a key screen has no
10
- reference ("one piece").
4
+ References for the look: reads their own board, or finds a pool they mark
5
+ like or no, and fills only gaps. Writes docs/design/design-moodboard.md.
6
+ Runs after the design brief, or when a key screen has no reference.
11
7
  ---
12
8
 
13
9
  # Design moodboard
@@ -56,11 +52,11 @@ A keep with a live link to a site or app gets its other screens as in **Search**
56
52
 
57
53
  **Keep every card that fits;** drop only what plainly fails (off-topic, broken, a duplicate) and say how many in one line. A poster, specimen, packaging or illustration is kept as `screen: no`.
58
54
 
59
- **Is it enough?** At least six screens; every key screen in the brief shown by at least one keep; and, when every keep is a screen, one far reference (print, signage, packaging; Fonts In Use has these, [sources.md](references/sources.md)). All met: say so in one line. Otherwise say what it lacks in up to three lines:
55
+ **Is it enough?** At least six screens; every key screen in the brief shown by at least one keep; when every keep is a screen, one far reference (print, signage, packaging; Fonts In Use has these, [sources.md](references/sources.md)); and, when the design brief's motion is present or leading, a keep that shows it moving (a card with `frames:`, or the site they pasted for its motion). All met: say so in one line. Otherwise say what it lacks in up to three lines:
60
56
 
61
57
  > Search for these, or go with what your board has?
62
58
 
63
- A gap: search only that, 20 to 60 candidates, one picker round. Too thin: the full **Search**, their fits as seeds. "Go": what it lacks goes under `Missing`.
59
+ A gap: search only that, 20 to 60 candidates, one picker round. A motion gap is judged moving, never from a thumbnail: in the picker they open each candidate's link and watch it live, then like it with what moves that they like. Only a like is read, so the prototype can rebuild it: a live page from its code, a GIF or video from its own frames. Too thin: the full **Search**, their fits as seeds. "Go": what it lacks goes under `Missing`.
64
60
 
65
61
  **Big boards.** Over about 60 keeps (not at `quick`), group them by eye so the board they choose from has headings: look at them on contact sheets (`contact-sheet.mjs`, never picture by picture), and give each card a `topic:` line naming its group for what is seen, in words a person outside design would use ("one huge word is the picture"). As many groups as there are looks; strays stay strays, and none is dropped. Their own board is never changed. Say the groups in one line each with the doc.
66
62
 
@@ -40,7 +40,7 @@ A nominee is not a reference. Open it full size and drop anything weak before it
40
40
  - **Fonts In Use.** Print, signage, packaging, books and identities, each with its typefaces named: the place for the far reference (`screen: no`), and for type when the board has none. Its `web` and `software-apps` formats are screens like any gallery's. Keep a use with one clear idea (a crop, a type pairing, a material); its typefaces go on the card as what was read, never as a pick. Capture the use page's own image, never the shop or studio it shows.
41
41
  - **Footer Design, CTA Gallery.** One part each, the footer or the call to action: search them when the board covers that part and has no example of it. Same test as the curated galleries: a live page with one clear idea. Capture the live site at that section (`--clip-selector "footer"` or the section's own selector), not the gallery's screenshot.
42
42
  - **Recent's other listings.** `interface`, app screenshots and app icons are screens and marks for an app, judged like a gallery's. `branding`, `posters` and `print` are the far reference (`screen: no`), and a graphic's own references when the brief is a poster or a card; `og-images` when it is a social post. `illustration` is imagery, never a site.
43
- - **Recent motion, launch videos, Codrops demos.** Only for the motion part, when the design brief's `motion` is not none and they asked for examples. Keep a piece whose motion is one idea you can name in a line (a reveal, a transition, type set moving). A Codrops demo is a demo, not a product: it gives one move, never the look of a site. Record it with `--frames`, never judge it from the thumbnail.
43
+ - **Recent motion, launch videos, Codrops demos.** Only for the motion part, when the design brief's `motion` is not none and their board has none moving, or they asked for examples. Keep a piece whose motion is one idea you can name in a line (a reveal, a transition, type set moving). A Codrops demo is a demo, not a product: it gives one move, never the look of a site. Record it with `--frames`, never judge it from the thumbnail.
44
44
  - **Dark Mode Design.** Only when the look is dark.
45
45
  - **Muzli.** Only a way to reach the original, which then has to pass its own test.
46
46
 
@@ -1,13 +1,9 @@
1
1
  ---
2
2
  name: design-prototype
3
3
  description: >
4
- Design the product's key screens in the chosen direction and identity: the
5
- first screen finished, then the other key screens in its frame, with real
6
- copy and pictures and every reachable state, checked by script. On their yes
7
- to the rendered prototype, writes DESIGN.md in one go, contrast-checked.
8
- Runs when docs/design/design-direction.md and design-identity.md exist and
9
- there is no DESIGN.md, or for a feature that needs screens once DESIGN.md
10
- exists.
4
+ The key screens and their states in the chosen direction, checked by
5
+ script; on their yes, DESIGN.md. Runs when the direction and identity
6
+ exist and there is no DESIGN.md, or for a feature with screens.
11
7
  ---
12
8
 
13
9
  # Design prototype
@@ -41,6 +37,7 @@ Read the brief, the design brief, the identity, the direction and `design-conten
41
37
  - **Faces** loaded at every size. A stand-in face is said again.
42
38
  - **The rest of the page:** below the first screen, small text, every width down to the phone.
43
39
  - **Motion:** exactly the design brief's `motion` line, from the direction's `motion:` line, nothing beyond (`none` is state changes only). Honour `prefers-reduced-motion`.
40
+ - **Motion options,** when the brief's motion is present or leading, as a studio shows motion studies once the still look holds: for each moment the brief names (two at most), two or three versions, each rebuilt from a different reference on the board that shows it moving (what moves, trigger, time, easing: from a live page's code, its CSS and the motion library calls in its scripts; from a GIF or video, its own frames; recorded frames only to see the sequence), on `home.html` as a `data-variant` with `data-from`, flipped with [variants.js](references/variants.js). Build each with what its move needs, as the reference does: CSS for a state change, a motion library for sequenced, scroll-driven, split-type or physics work. A version that only hints at a complex move is not that reference. One such reference: one version, and say so. Never a move no reference makes.
44
41
  - **What waits for the prototype** (the direction's `for the prototype` line), placed in the composition's own system, never shrinking the headline or tidying a device.
45
42
  - **The ownable**, finished. **The states** reachable here (empty, loading, error), and the second theme if asked for.
46
43
 
@@ -90,6 +87,8 @@ Give the paths and every key screen on one sheet, desktop then phone (`sheet.mjs
90
87
 
91
88
  > Is this the product? Want options anywhere?
92
89
 
90
+ With motion options, the question also asks which version for each moment, one line each for what moves. The others are removed on their pick, and the pick is what `DESIGN.md`'s Motion records. The pick is the motion system, as the chosen screen is the frame: its eases, times and staggers carry to every page's reveals, hovers and transitions, and their notes on it are iterated like any other.
91
+
93
92
  **Options** only when asked: two to four layouts for that page or part from different references, on the real page with its header, content and density, each a `data-variant` with `data-from` its reference, flipped with [variants.js](references/variants.js) (`?variant=<n>`, ← →); a sheet only to see them side by side. Never ranked. Iterate until it is the product.
94
93
 
95
94
  ### 5. Approve: write `DESIGN.md` in one go
@@ -53,7 +53,7 @@ Contrast (scripts/contrast.mjs, at the level under Accessibility):
53
53
  - <component>: <what it is for, its variants, its states>
54
54
 
55
55
  ## Motion
56
- - <the design brief's picks as built: how much, driven by, character and where it applies, moments, or "none: state changes only"; what moves and when, as the direction's `motion:` line has it; reduced motion turns it off>
56
+ - <the design brief's picks as built: how much, driven by, character and where it applies, moments, or "none: state changes only"; what moves and when, as the direction's `motion:` line has it, or the motion option they picked; built with CSS or the motion library the prototype used, so the stack can carry it; reduced motion turns it off>
57
57
 
58
58
  | Token | Duration | Easing | Use |
59
59
  |---|---|---|---|
@@ -1,12 +1,9 @@
1
1
  ---
2
2
  name: design-wordmark
3
3
  description: >
4
- Optional, after the identity. A wordmark made from the identity's own faces and devices:
5
- four to six marks rendered in the navigation and at hero size on the
6
- identity's grounds, picked and pushed once. Adds the mark to
7
- docs/design/design-identity.md and the identity board. Runs once the
8
- identity is chosen, when they want a mark beyond the name set in the
9
- display face.
4
+ Optional. A wordmark from the identity's faces and devices, judged in the
5
+ chosen screen. Runs once the identity is chosen and they want a mark
6
+ beyond the name set in type.
10
7
  ---
11
8
 
12
9
  # Design wordmark
@@ -1,11 +1,9 @@
1
1
  ---
2
2
  name: framework-skills
3
3
  description: >
4
- Find and propose agent skills for the frameworks and languages the project
5
- uses: the framework's own published skills first, else the most installed,
6
- read before proposing, installed on yes with longbeard add. Runs at
7
- Architecture once the stack is decided, and again when the repo gains a new
8
- stack (a pubspec.yaml, a new framework in package.json, a Cargo.toml).
4
+ Finds and proposes published agent skills for the project's frameworks and
5
+ languages, installs on yes. Runs at Architecture once the stack is
6
+ decided, and when the repo gains a new stack.
9
7
  ---
10
8
 
11
9
  # Framework skills
@@ -1,12 +1,10 @@
1
1
  ---
2
2
  name: idea
3
3
  description: >
4
- Turn an idea, or an existing repo, into docs/brief.md: one page that says
5
- what the product is, for whom, its core flows and key screens, and whether
6
- it has a UI. Grills in rounds until every section is settled, then writes
7
- the brief and offers the next stage. Runs first in a new project, when a
8
- repo has no brief, or when the product itself changes. A feature for a
9
- product that has a brief goes to to-spec, not here.
4
+ Turn an idea, or an existing repo, into docs/brief.md: what the product
5
+ is, for whom, its core flows, key screens and surface. Runs first, when a
6
+ repo has no brief, or when the product itself changes; a feature goes to
7
+ to-spec.
10
8
  ---
11
9
 
12
10
  # Idea