@jonandev/longbeard 0.12.1 → 0.13.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.
Files changed (36) hide show
  1. package/AGENTS.md +1 -2
  2. package/CHANGELOG.md +28 -0
  3. package/beard.json +3 -6
  4. package/package.json +2 -2
  5. package/skills/design/SKILL.md +22 -36
  6. package/skills/design-brief/SKILL.md +3 -1
  7. package/skills/design-check/references/design-rules.md +2 -1
  8. package/skills/design-content/SKILL.md +2 -0
  9. package/skills/design-direction/SKILL.md +61 -87
  10. package/skills/design-direction/references/design-rules.md +2 -1
  11. package/skills/design-direction/references/full-build.md +7 -6
  12. package/skills/design-direction/references/graphic.md +1 -5
  13. package/skills/design-direction/references/grid.md +48 -65
  14. package/skills/design-direction/references/library.md +2 -0
  15. package/skills/design-direction/references/screen-template.html +1 -1
  16. package/skills/design-direction/scripts/canvas.mjs +308 -0
  17. package/skills/design-direction/scripts/moodboard.mjs +238 -96
  18. package/skills/design-families/SKILL.md +16 -15
  19. package/skills/design-families/scripts/families.mjs +2 -1
  20. package/skills/design-families/scripts/moodboard.mjs +238 -96
  21. package/skills/design-figma/SKILL.md +2 -0
  22. package/skills/design-identity/SKILL.md +8 -1
  23. package/skills/{design-direction → design-identity}/references/controls.md +10 -10
  24. package/skills/design-identity/references/identity-board.html +2 -2
  25. package/skills/design-moodboard/SKILL.md +41 -77
  26. package/skills/design-moodboard/references/sources.md +12 -1
  27. package/skills/design-moodboard/scripts/families.mjs +2 -1
  28. package/skills/design-moodboard/scripts/moodboard.mjs +238 -96
  29. package/skills/design-prototype/SKILL.md +49 -68
  30. package/skills/design-prototype/references/design-md-template.md +1 -0
  31. package/skills/design-prototype/references/design-rules.md +2 -1
  32. package/skills/design-prototype/references/five-second.md +2 -3
  33. package/skills/design-prototype/references/graphic.md +1 -1
  34. package/skills/design-prototype/scripts/drift.mjs +273 -0
  35. package/skills/design-wordmark/SKILL.md +2 -0
  36. package/skills/design-direction/references/five-second.md +0 -47
@@ -9,7 +9,7 @@ The size is the format in `docs/brief.md`, never phone or desktop. The design br
9
9
  - **On screen:** the pixels the format gives.
10
10
  - **In print:** the paper's ratio, at a working width of 1200 px (A3 portrait is 1200 × 1697). Figma carries the real size later.
11
11
  - **Build at it:** each screen is built at `?size=<width>x<height>`, and the page's own default size is set to the format, so every later capture is the whole piece. `grid.md`'s "px at 1440" means px at this working width, and every measure stays a share of the piece's width and height.
12
- - **Capture at it.** Every `--clip 0,0,1440,900` in `grid.md` and `five-second.md` is `--width <w> --clip 0,0,<w>,<h>` at this size, whole piece, never its top half. On the sheet, a tall piece takes more columns (`--cols 4`). Whether `sheet.mjs` lays out portrait tiles well is not checked: look at the sheet before showing it.
12
+ - **Capture at it.** Every `--clip 0,0,1440,900` in `grid.md` is `--width <w> --clip 0,0,<w>,<h>` at this size, whole piece, never its top half. On the canvas a tall piece shows whole, at its own proportions; look at it before showing it.
13
13
  - **A reference of another proportion** (a wide poster for a tall brief) is a base only if its layout survives at the format's ratio, with each measure kept as a share of its own sides. Otherwise it lends moves and is never a base.
14
14
 
15
15
  ## What the pieces carry
@@ -26,10 +26,6 @@ The size is the format in `docs/brief.md`, never phone or desktop. The design br
26
26
  - **Touch-up:** the same rule, repair and never tidy. Contrast where text sits is fixed; so is a fact the brief gives that is not on the piece, added where the facts sit. Text over a picture, giant type, crops, overlaps and collisions are never faults here, and type cropped by the edge on purpose carries `data-crop`.
27
27
  - **Nothing important in the trim:** on a print piece, mark where the trim and a safe margin fall at the working size (3 mm each by default, theirs if they give one). A word or a fact in the trim is a fault. A crop or a picture that runs off the edge on purpose is not.
28
28
 
29
- ## The five-second check
30
-
31
- The questions are the same. The capture is shown at the size the piece reaches the eye: a poster read across a street, scaled so its long side is about 400 px; a feed post at phone size, about 390 px wide. "What would you do first" is what they would do about it: go, scan, remember the date. It is checked against the design brief's `read from` line and its takeaway.
32
-
33
29
  ## The doc
34
30
 
35
31
  `docs/design/design-direction.md` as in the skill, with `navigation: none` and the format on the first line of Composition. `Primary action:` says "none" or the link, the code or the date to save.
@@ -1,114 +1,97 @@
1
1
  # Building the screens
2
2
 
3
- Read by `design-direction`, steps 3 and 4.
3
+ Read by `design-direction`, steps 3 and 4. Each screen is one reference rebuilt faithfully with the product's content, changed by one or two things borrowed from others. The agent's own taste adds nothing.
4
4
 
5
- Eight first screens: each one reference rebuilt faithfully with the product's own content, changed by one or two things borrowed from other references, and checked until it still works. The agent's own taste adds nothing.
5
+ Each screen is `.longbeard/design/direction/screens/<n>.html` from [screen-template.html](screen-template.html): plain HTML and CSS in px at 1440 (or the device width for an app), every face and colour a variable in `LOOK`, and a `PROVENANCE` list. The translation before its moves is kept as `screens/<n>-base.html`. Anything the product does not really have yet carries `data-standin="picture"` or `data-standin="fact"`, with `data-standin-note`; their own pictures carry nothing.
6
6
 
7
- Each screen is its own page, `.longbeard/design/direction/screens/<n>.html`, from [screen-template.html](screen-template.html): plain HTML and CSS, sizes in px at 1440 (or the device's width for an app), every face and colour a variable from `LOOK`, and a `PROVENANCE` list. Keep each screen's translation, before its moves, as `screens/<n>-base.html`. Anything the product does not really have yet (a stand-in picture, a price, an hour, a number or a name the brief does not give) carries `data-standin="picture"` or `data-standin="fact"`, and `data-standin-note` for what is assumed. A picture of theirs carries nothing.
8
-
9
- One file for all eight, `.longbeard/design/direction/screens.json`:
7
+ `.longbeard/design/direction/screens.json`, one entry per screen:
10
8
 
11
9
  ```
12
- [{ "n": 1, "base": "<card name>", "moves": [{ "what": "<the move, in a phrase>", "from": "<card name>", "like": "<their words, or null>" }], "picture": "<its main picture>", "tone": "<ground: light or dark, warm or cool>", "why": "<one line>", "proposed": false, "build": "quick", "state": "built" }]
10
+ [{ "n": 1, "base": "<card name>", "moves": [{ "what": "<the move>", "from": "<card name>", "like": "<their words, or null>" }], "picture": "<its main picture>", "tone": "<light or dark, warm or cool>", "why": "<one line>", "proposed": false, "build": "quick", "state": "built" }]
13
11
  ```
14
12
 
15
- `build` is `quick` or `full`. `state` is where the screen ended, written by whoever finishes it, and nothing else is final:
16
-
17
- - **A quick screen:** `built`.
18
- - **A full screen:** `built` while its loop runs; `critiqued` when the loop stopped with only small spots left; `fixed` when the third pass ended with larger spots still listed. What is left goes on the sheet as known faults.
19
- - **Failed:** from any job, `"failure": "<why>"`.
20
- - **The round is done** when every screen has ended: a full screen still at `built` is not done. The sheet is drawn only then.
13
+ `build` is `quick` or `full`. `state` is where it ended: a quick screen `built`; a full screen (their favourite and its hardest screen) `built` while it runs, then `critiqued` (only small spots, nothing fixed) or `fixed`; any job that failed twice `failed` with `"failure": "<why>"`. Optional: `round` (1 when left out), `of` and `part` for a part's version, `of` and `test` for the hardest screen, `fault` (one line), `shot`. The canvas is drawn only when every screen has ended.
21
14
 
22
15
  ## Five principles
23
16
 
24
- Everything below is one of these; decide a case not listed by them.
17
+ Decide any case by these. They go to every builder as written.
25
18
 
26
19
  ### 1. The base stands unless a move names it
27
20
 
28
- A screen is its base, measured, until a move changes one named thing. What no move names stays as the base has it: layout (zones, proportions, margins, where headline, pictures and small text sit), anchors (a centred picture, a full-bleed panel, a headline on the axis), balance, alignments, devices and picture treatment.
21
+ What no move names stays as the base has it: layout (zones, proportions, margins, where headline, pictures and small text sit), anchors, balance, alignments, devices and picture treatment. The layout always comes from a reference; a move may turn it or take another's, never invent one.
29
22
 
30
- - The layout always comes from a reference. A move may turn it or take another reference's, never invent one.
31
- - What they said they like in the base is kept exactly ("this red" stays this red). That holds against contrast too: a liked colour is never stepped lighter or darker to pass. Text on it that fails is fixed with what else the screen has (the other colour of the pair, a size or weight that makes it large text, another crop, the liked colour moved from the text to a fill behind it); when none fits, the colour stays and the screen carries a warning, on the sheet and in the table, with the pair and its ratio ("liked terracotta under the button label: 3.9:1, AA asks 4.5"). What they never named is kept by its role: "a punchy accent over a quarter of the page" may become a punchy orange from another reference, at the same strength and share.
32
- - A borrowed thing fits around the base's anchors, or goes to a base with room for it.
33
- - Text on a picture sits on a calm area, as light or dark as the source's. The picture is chosen and cropped to the text, never the text moved off it. With no such picture, say so on the sheet and offer one that has it.
34
- - A device that held content in its source (a box with a product, a band of words) holds the product's content, or is left out; never empty.
23
+ - **Left out:** what they wrote to leave out of the base is dropped, or, when the composition needs its role (a ground, a frame, a face), filled from the nearest reference on the board. Never by the agent's own choice.
24
+ - **Liked:** what they like in the base is kept exactly, even against contrast. A liked colour is never stepped to pass: fix the text with what the screen has (the pair's other colour, large text, another crop, the colour moved to a fill behind it); when nothing fits, keep it with a warning and its ratio ("liked terracotta under the label: 3.9:1, AA asks 4.5"). What they never named is kept by its role, and may be swapped for another reference's colour of the same role and strength.
25
+ - A borrowed thing fits around the base's anchors, or goes to another base.
26
+ - Text on a picture sits on a calm area, as light or dark as the source's: the picture is chosen and cropped to the text, never the text moved. With no such picture, say so.
27
+ - A device that held content in its source holds the product's content, or is left out; never empty.
35
28
 
36
29
  ### 2. Every measure is a share of the screen, and is kept
37
30
 
38
- Sizes, gaps and fills are measured in the source as a share of its width and height, and kept at 1440 within 15%: type sizes, gaps between pictures, the room between headline and menu, text to the margin or a panel's edge, a label to its picture, the parts of a small device (size, stroke, spacing), and how much of its zone a text block fills.
31
+ Sizes, gaps and fills, measured in the source as a share of its width and height, are kept at 1440 within 15%: type sizes, gaps, the room between headline and menu, text to the margin, a label to its picture, a small device's parts, how much of its zone a text block fills.
39
32
 
40
- - An element that grew (longer copy, a bigger face) is set smaller within its role until its room is kept; it never eats its neighbour's gap unless the source collides on purpose.
41
- - A rule or a border ends where it ends in the source; whatever runs off the screen runs off as there.
42
- - Marks that become words (dashes or dots made into links) keep the marks' colour and take the base's small-text size. A poster sets its small text for its own size; on a screen, text read to act (the menu, a control's label) takes the size the board's screen references give it, never smaller.
43
- - **When a layout turns,** every gap and alignment turns with its zone, mirrored, never closed up. Each text block keeps the edge it hangs from (outer margin, seam, axis), its ragged side and its room; running text stays aligned to the reading direction. What is grouped with a text block (button, arrows, small print) moves with it, its inside spacing unchanged.
33
+ - An element that grew (longer copy) is set smaller within its role; it never eats a neighbour's gap unless the source collides on purpose.
34
+ - A rule ends where it ends in the source; what runs off the screen runs off as there.
35
+ - Text read to act (the menu, a label) takes the size the board's screen references give it, never a poster's smaller size.
36
+ - **A turned layout** turns every gap and alignment with its zone, mirrored, never closed up. Each text block keeps the edge it hangs from and its ragged side; what is grouped with it moves with it.
44
37
 
45
38
  ### 3. A borrowed thing keeps its geometry and its why
46
39
 
47
- Before placing a borrowed thing, measure how it sits in its source (its size against the screen, what it overlaps and how far, the room around it) and keep those relations.
40
+ Measure how it sits in its source (size against the screen, what it overlaps and how far, its room) and keep that. **Nothing they left out of a reference is borrowed from it.**
48
41
 
49
- **The why they gave is the rule for using it.** "The orange dot, the only contrast on a quiet page" goes only on a quiet base, alone. A why that describes an arrangement ("black-and-white photos at different heights, like a contact sheet") goes only where the arrangement is, never onto one framed picture. Read each why against the base; if it would not be true there, the move goes to another base. A like belongs to its reference, never a house style across the round.
42
+ **Their why is the rule for using it.** "The orange dot, the only contrast on a quiet page" goes only on a quiet base, alone. A why that describes an arrangement goes only where the arrangement is. If the why would not be true on this base, the move goes to another. A like belongs to its reference, never a house style.
50
43
 
51
44
  ### 4. A move changes only what it names
52
45
 
53
- One or two moves per screen, each borrowed from another reference, spread across the round. A move is one of:
46
+ One or two moves per screen, spread across the round. A move is one of:
54
47
  - **a palette:** another reference's whole palette, or the subject's;
55
- - **a thing from the subject:** one they liked on its card (a stamp, a number, a paper bag), changed in form to fit, a device or a layout, keeping what they liked in it;
56
- - **a colour by its role:** one colour they did not name, for another of the same role and strength;
57
- - **an element:** one device from another reference, on the base's grid, or a surface finish (a grain, a shadow, a blend) from its reading;
58
- - **the face:** another's display face that can carry the base's headline, at its size;
59
- - **the picture treatment:** another's crop, tone or frame, never its kind of picture (the product's own decide it; with none of that kind, the sheet says so);
60
- - **the layout turned:** mirrored, headline and picture traded, or one zone moved, proportions kept;
61
- - **the scale:** the headline larger or smaller, as far as another reference sets its own.
62
-
63
- A move brings only that one thing: a face move never brings its source's colour, case or weight beyond the role; a palette move never brings a face.
48
+ - **a thing from the subject** they liked (a stamp, a number), changed in form to fit;
49
+ - **a colour by its role:** one they did not name, for another of the same role and strength;
50
+ - **an element:** one device, or a surface finish, from another reference;
51
+ - **the face:** another's display face that can carry the base's headline;
52
+ - **the picture treatment:** another's crop, tone or frame, never its kind of picture;
53
+ - **the layout turned:** mirrored, headline and picture traded, or one zone moved;
54
+ - **the scale:** the headline larger or smaller, as far as another reference goes.
64
55
 
65
- The moves are theirs: what they said they like in each reference, the subject's card too, is what is borrowed. Where they named nothing, propose a move from the reading, marked `"proposed": true` in `screens.json` and in the table. A move the base cannot take is dropped for another, never forced.
56
+ A move brings only its one thing: a face move brings no colour, a palette move no face. Moves come from what they like; where they named nothing, propose one from the reading, marked `"proposed": true`. A move the base cannot take is dropped for another.
66
57
 
67
58
  ### 5. Nothing from outside the board
68
59
 
69
- Every face, colour, element and effect names its reference in `PROVENANCE`; the subject's card is one, and its pictures and what they liked in them are the product's own material, not the agent's taste. The design brief rules out only what it names; a like it rules out is carried by its role.
60
+ Every face, colour, element and effect names its reference in `PROVENANCE`; the subject's card counts. The design brief rules out only what it names; a like it rules out is carried by its role.
70
61
 
71
62
  ## Which screens
72
63
 
73
- Every reference they liked is the base of at least one screen, the lead of two. With fewer than eight, the lead, then the likes, take a second screen with other moves. Across the eight, faces, picture treatments, palettes and pictures spread as widely as the board's: each face mostly on its own reference's screens, a borrowed thing on two screens at most, different photos and crops. **The spread is checked on the plan, before any screen is built:** from the `picture` and `tone` in `screens.json`, no main picture on more than two screens and no tone on more than half. A plan that fails changes its pairings. Only a like that says it is the point ("always black and white") repeats more.
64
+ Every like is the base of at least one screen, the lead of two; with fewer than eight, the lead and then the likes take a second. **Check the spread on the plan, before building:** no main picture on more than two screens, no tone on more than half, a borrowed thing on two screens at most. A plan that fails changes its pairings. Only a like that says it is the point ("always black and white") repeats.
74
65
 
75
- ## The quick round
66
+ ## A quick round
76
67
 
77
- Each screen is built once and not judged: no critic, no fixer, no device close-ups.
68
+ **1. Plan (you).** Pair bases and moves, write `screens.json`, check the spread, then one brief per screen, `briefs/<n>.md`: the base's reading and picture path with what they left out of it; each move with its source picture, like and why; the content in fill order; the product's pictures for it; the five principles. Nothing else.
78
69
 
79
- **1. Plan (you).** Pair bases and moves for the eight (principles 3 and 4), write `screens.json` (`build: quick`), check its spread, and only then write each screen's brief, `.longbeard/design/direction/briefs/<n>.md`: the base's reading from `library.json` and its picture's path; each move in words with its source picture's path, its like and its why; the content in the base's slots, in the fill order; the product's pictures for this base (principle 1); the five principles, as written. Nothing else from this file or the session.
70
+ **2. Build (a fresh agent per screen, from its brief only).** Translate the base into `screens/<n>-base.html` with the product's content, capture it, and measure it against the reference:
80
71
 
81
- **2. Build (a fresh agent per screen, from its brief only).**
82
- - Translate the base into `screens/<n>-base.html` from [screen-template.html](screen-template.html), with the product's content and pictures, treated only as the reference treats its own. Capture it, then measure it against the reference:
83
- ```
84
- node <skill>/scripts/layout-diff.mjs <reference picture> .longbeard/design/direction/grid/<n>-base.png --out .longbeard/design/direction/checks/<n>-base
85
- ```
86
- Fix the translation until nothing it lists is off, or each that is has a reason (longer copy set smaller).- Make the moves into `screens/<n>.html`, by principles 3 and 4, and capture it. State `built`.
72
+ ```
73
+ node <skill>/scripts/layout-diff.mjs <reference picture> .longbeard/design/direction/grid/<n>-base.png --out .longbeard/design/direction/checks/<n>-base
74
+ ```
75
+
76
+ Fix it until nothing listed is off without a reason. Then make the moves into `screens/<n>.html`, capture, state `built`.
87
77
 
88
- **Then the round (you).**
89
- - **Not a copy.** One fresh agent is given every screen of the round beside its base, each pair at thumbnail size and numbered, and answers yes or no for each: *can you tell them apart at a glance, by the ground or accent, the face, the layout turned, a device added or gone, or the picture treatment?* Yes is not a copy. No is a copy: its plan gets another move, it is built again from step 2, and the rebuilt screens go to one fresh judge together. Keeping the base's layout, measures and system is the method, never a copy by itself.
90
- - **As varied as the board** (Which screens), again on what was built.
91
- - **Contrast,** every screen, rough or not; a failure blocks the sheet, except a liked colour kept with its warning (principle 1). Fixed with the screen's own colours or another crop (principle 1), never by moving the text:
78
+ **3. Check the round (you).**
79
+ - **Not a copy:** one fresh judge sees every screen beside its base, as numbered thumbnails, and answers yes or no each: *can you tell them apart at a glance* (ground or accent, face, layout turned, a device added or gone, picture treatment)? A no gets another move and is rebuilt; the rebuilt ones go to one judge together.
80
+ - **Spread** again, on what was built.
81
+ - **Contrast,** every screen; a failure blocks the canvas, except a liked colour with its warning. Fixed with the screen's own colours or another crop:
92
82
  ```
93
83
  node <skill>/scripts/screen-contrast.mjs "file://$PWD/.longbeard/design/direction/screens/1.html" --wait-title ready
94
84
  ```
95
- - **Faults:** a clipped word, text under 12 px at 1440, a lone word on a heading's last line, the same sentence twice.
96
- - **Each picture:** `picture-cast.mjs <pictures>`, run on the product's pictures, not the captures: a cast, blown highlights or crushed shadows the reference lacks is a picture to replace.
97
-
98
- A helper that fails twice is recorded as `failed` with why, and shows on the sheet as failed.
85
+ - **Faults:** a clipped word, text under 12 px at 1440, a lone last word in a heading, a sentence twice.
86
+ - **Pictures:** `picture-cast.mjs` on the product's pictures; a cast or blown highlights the reference lacks means another picture.
99
87
 
100
- ## Without fresh agents
88
+ **Without fresh agents,** do each job yourself, one screen at a time from its brief alone; as critic, write the list from the prepared pictures before fixing anything. Say the round is weaker, in each screen's `fault` ("built and judged by one agent").
101
89
 
102
- When no agent can be started clean, do the jobs yourself, one screen at a time, each from its brief alone. As critic, look only at the prepared pictures and write the list before you fix anything, never from memory of the build. The round is weaker, and says so: the sheet carries `--note`, and the table's first line says why ("built and judged by one agent: no clean agent could be started"). Never call such a screen checked as if a critic had seen it.
103
-
104
- ## Capture and sheet
90
+ ## Capture and the canvas
105
91
 
106
92
  ```
107
93
  node <skill>/scripts/capture.mjs "file://$PWD/.longbeard/design/direction/screens/1.html" --out .longbeard/design/direction/grid/1.png --clip 0,0,1440,900
108
- node <skill>/scripts/sheet.mjs .longbeard/design/direction/grid/sheet.html --rough 1,2,4 .longbeard/design/direction/grid/1.png … .longbeard/design/direction/grid/8.png
109
- node <skill>/scripts/capture.mjs "file://$PWD/.longbeard/design/direction/grid/sheet.html" --out .longbeard/design/direction/grid/sheet.png
94
+ node <skill>/scripts/canvas.mjs .longbeard/design/direction/screens.json --board .longbeard/design/direction/board.md --shots .longbeard/design/direction/grid --out .longbeard/design/direction/canvas.html
110
95
  ```
111
96
 
112
- `--rough` lists the quick screens (`none` when all are full), which the sheet labels. `--note "<text>"` prints a line under the sheet. A second sheet shows each screen beside its base (`grid/bases.html`, `--cols 2`).
113
-
114
- For an app, or a site whose design brief says `first seen on: phone`, build and capture at the device size (`?size=390x844`, `--width 390`, a clip of that size); the desktop comes in `design-prototype`.
97
+ Every screen is captured as `grid/<n>.png` (a full build's newer version as its `shot`). The canvas shows each one with its build (`quick`, `full` or `failed`), its fault, and beside it its base and moves with their pictures and likes; "Beside its base" shows the two together. Rows: each `round`, then each favourite's parts (`of`, `part`) and its hardest screen (`of`, `test`). Without fresh agents, put the round's weakness in a screen's `fault` ("built and judged by one agent"). For an app, or `first seen on: phone`, build and capture at the device size (`?size=390x844`, `--width 390`).
@@ -10,6 +10,7 @@ Write `.longbeard/design/direction/library.json`, one reading per reference (the
10
10
  "references": [{
11
11
  "name": "<card name>",
12
12
  "likes": [{ "what": "<what they like in it, in their words>", "why": "<what it does for them: the rule for using it>" }],
13
+ "avoid": ["<what they wrote to leave out of it, in their words>"],
13
14
  "concept": "<what makes it, in one or two sentences: the idea a designer would defend>",
14
15
  "move": "<the one move a person would point at: the disc cutting into the title, one word filling the width>",
15
16
  "layout": "<where everything sits, as a share of the screen: margins, columns, the picture's box, the headline's box, the small text's places, what overlaps or runs off an edge, how much is empty>",
@@ -53,6 +54,7 @@ Give it every measure the picture gave (`width`, `xheight`, `dark`, `contrast`).
53
54
  ## What each part is for
54
55
 
55
56
  - **`likes`:** their words from the board's note (or the card's `like:`). What they like is what the designs borrow; why is how it is used, and where it would be wrong.
57
+ - **`avoid`:** their words from the board's Leave out box (or the card's `avoid:`). Never on a screen built on it, never borrowed from it; the reading still records it (in `devices`, `palette`, wherever it sits), so the rebuild knows what to drop. Empty when they wrote nothing.
56
58
  - **`concept` and `move`:** what must survive every change; the critic and the not-a-copy check judge on them.
57
59
  - **`layout`, `type`, `spacing`:** the system, in numbers, so the rebuild is measured, not approximated. Type sizes are the reference's against its screen: a 96 px headline on a 1440 screen stays 96 px.
58
60
  - **`palette`:** the colours as they work together. A palette is borrowed whole, or one colour they did not name is swapped for another of the same role. Never one colour picked out of it by itself.
@@ -23,7 +23,7 @@
23
23
  &ground=%23… &ink=%23… &accent=%23… (accent=none hides it) &size=390x844.
24
24
 
25
25
  CONTROLS: empty in a built screen. When the screen is chosen, first.html gets
26
- the ranges its board uses (references/controls.md). The page then shows a few
26
+ the ranges its board uses (design-identity's references/controls.md). The page then shows a few
27
27
  live controls over the screen when opened with ?controls, never in a capture
28
28
  (no ?controls, or ?capture). Display text is what carries the class "display".
29
29
  -->
@@ -0,0 +1,308 @@
1
+ #!/usr/bin/env node
2
+ // The direction's screens as one page to choose from: every screen in a strip
3
+ // (rounds, a favourite's parts and its hardest screen each in a row), the one
4
+ // they open shown large, and beside it what it is made from: its base and each
5
+ // move, with the reference's picture and their own words. Actions write a
6
+ // line for the chat. No dependencies. It shows what was built; it adds no
7
+ // colour of its own.
8
+ //
9
+ // node canvas.mjs .longbeard/design/direction/screens.json --board .longbeard/design/direction/board.md --shots .longbeard/design/direction/grid --out .longbeard/design/direction/canvas.html
10
+ //
11
+ // screens.json entries (grid.md): n, base, moves [{ what, from, like }], build, state,
12
+ // failure, and optionally round (1 when left out), of (the screen it belongs to),
13
+ // part (a part of that screen), test (its hardest screen), fault (one line), shot
14
+ // (a picture; else <shots>/<n>.png). board.md cards give each reference's shot and like.
15
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
16
+ import { dirname, isAbsolute, relative, resolve } from "node:path";
17
+
18
+ const args = process.argv.slice(2);
19
+ const flag = (name) => {
20
+ const i = args.indexOf(`--${name}`);
21
+ return i === -1 ? "" : (args.splice(i, 2)[1] ?? "");
22
+ };
23
+ const boardArg = flag("board");
24
+ const shotsArg = flag("shots");
25
+ const outArg = flag("out");
26
+ const [screensArg] = args;
27
+ if (!screensArg || !outArg || !shotsArg || args.length !== 1 || !/\.html$/.test(outArg)) {
28
+ console.error("usage: node canvas.mjs <screens.json> --shots <folder of n.png> [--board <board.md>] --out <canvas.html>");
29
+ process.exit(2);
30
+ }
31
+ const outPath = resolve(outArg);
32
+ const href = (abs) => {
33
+ const src = relative(dirname(outPath), abs).split("\\").join("/").split("/").map(encodeURIComponent).join("/");
34
+ return src.startsWith(".") ? src : `./${src}`;
35
+ };
36
+ const esc = (s) => String(s ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
37
+
38
+ if (!existsSync(screensArg)) {
39
+ console.error(`canvas: no screens at ${screensArg}`);
40
+ process.exit(1);
41
+ }
42
+ let screens;
43
+ try {
44
+ screens = JSON.parse(readFileSync(screensArg, "utf8"));
45
+ } catch (e) {
46
+ console.error(`canvas: ${screensArg} could not be read: ${e.message}`);
47
+ process.exit(1);
48
+ }
49
+ if (!Array.isArray(screens) || !screens.length) {
50
+ console.error(`canvas: ${screensArg} lists no screens`);
51
+ process.exit(1);
52
+ }
53
+ const open = screens.filter((s) => !s.state);
54
+ if (open.length) {
55
+ console.error(`canvas: screen ${open.map((s) => s.n).join(", ")} has no state yet; draw the canvas when every screen has ended`);
56
+ process.exit(1);
57
+ }
58
+
59
+ // The board's cards, by name: their shot and their words.
60
+ const cards = new Map();
61
+ if (boardArg) {
62
+ if (!existsSync(boardArg)) {
63
+ console.error(`canvas: no board at ${boardArg}`);
64
+ process.exit(1);
65
+ }
66
+ for (const chunk of readFileSync(boardArg, "utf8").split(/^### /m).slice(1)) {
67
+ const nl = chunk.indexOf("\n");
68
+ const name = (nl === -1 ? chunk : chunk.slice(0, nl)).trim();
69
+ const fields = {};
70
+ for (const line of (nl === -1 ? "" : chunk.slice(nl + 1)).split(/\r?\n/)) {
71
+ const m = line.match(/^- ([a-z][a-z /-]*):\s*(.*)$/i);
72
+ if (m && !(m[1].toLowerCase() in fields)) fields[m[1].toLowerCase()] = m[2].trim();
73
+ }
74
+ const shot = fields.shot || "";
75
+ const src = /^https?:\/\//i.test(shot) ? shot : shot && existsSync(resolve(shot)) ? href(resolve(shot)) : "";
76
+ cards.set(name, { name, src, like: fields.like || "", avoid: fields.avoid || "" });
77
+ }
78
+ }
79
+ const cardOf = (name) => cards.get(name) || { name: name || "", src: "", like: "", avoid: "" };
80
+
81
+ let missing = 0;
82
+ const shotOf = (s) => {
83
+ const path = s.shot ? (isAbsolute(s.shot) ? s.shot : resolve(s.shot)) : resolve(shotsArg, `${s.n}.png`);
84
+ if (existsSync(path)) return href(path);
85
+ missing++;
86
+ console.error(`canvas: no picture for screen ${s.n} at ${relative(process.cwd(), path)}`);
87
+ return "";
88
+ };
89
+
90
+ // Rows: each round, then each favourite's parts and its hardest screen.
91
+ const rows = new Map();
92
+ for (const s of screens) {
93
+ const key = s.of != null ? (s.test ? `${s.of} · hardest screen` : `${s.of} · ${s.part || "parts"}`) : `Round ${s.round || 1}`;
94
+ if (!rows.has(key)) rows.set(key, []);
95
+ rows.get(key).push(s);
96
+ }
97
+ const label = (s) => (s.state === "failed" ? "failed" : s.build === "full" ? "full" : "quick");
98
+ const data = screens.map((s) => {
99
+ const base = cardOf(s.base);
100
+ return {
101
+ n: String(s.n),
102
+ src: shotOf(s),
103
+ label: label(s),
104
+ of: s.of != null ? String(s.of) : "",
105
+ part: s.part || "",
106
+ test: Boolean(s.test),
107
+ fault: s.state === "failed" ? `failed: ${s.failure || "no reason given"}` : s.fault || "",
108
+ base: { name: base.name, src: base.src, like: base.like, avoid: base.avoid },
109
+ moves: (s.moves || []).map((m) => {
110
+ const c = cardOf(m.from);
111
+ return { what: m.what || "", from: c.name, src: c.src, like: m.like || c.like || "", proposed: Boolean(s.proposed) };
112
+ }),
113
+ };
114
+ });
115
+
116
+ const strip = [...rows.entries()]
117
+ .map(
118
+ ([name, list]) => `<div class="row"><span class="rl">${esc(name)}</span>${list
119
+ .map((s) => {
120
+ const d = data.find((x) => x.n === String(s.n));
121
+ return `<button type="button" class="th" data-n="${esc(d.n)}"${d.label === "failed" ? " data-failed" : ""}>${d.src ? `<img src="${esc(d.src)}" alt="">` : `<span class="none">no picture</span>`}<span class="tl">${esc(d.n)} · ${esc(d.label)}</span></button>`;
122
+ })
123
+ .join("")}</div>`,
124
+ )
125
+ .join("");
126
+
127
+ // The Long Beard beard, small and one ink: it marks the page as the tool's and adds no colour.
128
+ const LOGO = "iVBORw0KGgoAAAANSUhEUgAAACoAAABYBAMAAABxB3iiAAAAMFBMVEWfn59ubm7Z2dn+/v7+/v7////+/v4AAAACAgIXFxcnJyfp6enX19c3NzdXV1dGRkbPaZsJAAAAEHRSTlP///AgWZ/+AP////7/////SdcINAAABTtJREFUeNpdlWtUVFUUx3/3zB1AZhhu4AO1hVOCj8yYKLKHyaiEq5eOS9DoQ2IFPj6UtSyVamm1AC2ttFUIZo6GikU6mrrMVTFoargsxzFTU2kkKN/OyENgHrcPd5jBzrfzW/+77/7vc/Y+0kLCK1Cf2jfgSwNAjkB35vPjEzeWWgFED90/fFfDtktd5tu0P415O+uDxwZ7tZ1ubPj7uhGHUp8/uUITh+nxiv5/UNCQ/9clcyTuD8FBv26GDUXfb7iTHhpsbap5JnftXse4u5fNdPZQdyB+cckqtcm0ZMh6773hHAKDdo9eesRUDHvGLRhjfsOq/W3ajfsfeGoaoDv4Ys399SmgG4uzPKBL0hINfv/gAedlMzIoV84fbg6biUlvnhDSvA1OapzfY/zLiSfr+1llwP+6swfiLzndMRVBcFBthyNCeWStoiCz/8TWa/Oj1NBefAsRGFauKlFI90yxHyElT/dFA8RUMXCizynqq1o2Odi7CQD9tpXsmOJUhNRS0aTf9/YxO+ipOxCsnGo4qYj0jSHa5yUOOA15RYesZZdlQ7pLbjcA04ZeGCrtmrJT4XKFMyU+oOt88nxSZanx95yJY7aNGJtzzGANxJyRx9v2heo2Fbda/l1+rGqhKv3pi/UiwCgNCS1yGd6Mrbz1UtJsz1ZLBgIPsXaJOR+1SqXMaLArSsnmNlG3b5u0yIsv9Io0S3rVZc5+vTPXqHs6eVJocJ/WB4suX2gZuMA2uWlv17m/xK3OE+/J9zDLOMVMKOtgYHZheuo62TQst92+sfGPornzJ/VfYunz68qOoCxL5LW7PqwuP2yqJFixTO813jQEdN6RCbNaLq5+y/vV1h9S+pU5qUzJdki5a5Z1391McRXfVV9yAqOOZ7jJHHH1xaXDYopTj8ZdNBoMhcZ34/6ZIS24+nDS3wvaT6Wb6lz32pKq6+LiTrp1j5/1VWYdqE1f935trX/UECXO23g9UzD65mTdqZwsvg7s2anf/I5VBNPQjRWJvuSjqyosB48MzHk0w53S5otHgBSvCneD3VPyAfHPTvDGTQUB0gs205ZHEIvzXi0cdbDPxxr90TrBp3rMvLzL6TE36b1BJwJk5R8T+63Jc5f6vPZrenNfrQM8h9bTwuoLw3Z9vmE7n3hABmVHwgMmNeBuwd8unZ38aaqCAL3PgR9VBTV2PVbJBQLuaEVVpS2DIca2RHLgBQFtAuj65C3AQqxd67eA6yZGBa8CFOgfQo1Mgm4rMVZAP86OTQEB49VushatBGBtPokWkCGBbwsKeq719PzC63chQMIVbYAuPFdBIIWk+ihVbcoBKwKCRm+UpjlW3QABU/ytUZqtb9sOAlR6N5Z0U8tXzOL/S6DuXNhbrYYAgXzmdl2CFuE+J1ATafreEzExok3UTpPxAo5HaEYvrS5CzQ6NJsRDMEK9No1KQHKEWqRohHmaMzugRKkfAFPEW3RVfxboTTu0QfJV6czwCJOj0lsnpk6eBOH7EC3lmdcAVzjf1tAmAHlkYxngUzXqxKe56rQBP4f/pkrVMB2yy4CYsFbONAH5/FJeiN7RFj4huuKvQx0l5dA+TxLhHK5kB2x6J2k2wPRcWptGA5aQzb+CKkDqzi4MayfuQOEpAIxJq7eH34Dg0Zr3WzQfdd8c98drjmXPE2GI87fa5r7h12nAud2HLfuGQvf5BtejPTWTMzaWcNEONfk3cqL1Dc1JKXEt/2Jr6bnmXpWU+w6v6VxTxvKEvN71fbziSEzeYkOB+7aqy42Z7jNFaqNV2/4HUzT8HOE538sAAAAASUVORK5CYII=";
129
+
130
+ const html = `<!DOCTYPE html>
131
+ <html lang="en">
132
+ <head>
133
+ <meta charset="utf-8">
134
+ <meta name="viewport" content="width=device-width, initial-scale=1">
135
+ <title>Direction</title>
136
+ <style>
137
+ /* Quiet chrome: the screens and references are the only colour on the page. */
138
+ :root { --canvas: #f3f2ef; --paper: #ffffff; --ink: #1c1c1a; --muted: #6f6c65; --line: #dedbd4; --soft: #e9e7e2; }
139
+ * { box-sizing: border-box; }
140
+ html { color-scheme: light; }
141
+ body { margin: 0; background: var(--canvas); color: var(--ink); font-family: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; -webkit-font-smoothing: antialiased; }
142
+ main { max-width: 1680px; margin: 0 auto; padding: 22px 28px 150px; }
143
+ .brand { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
144
+ .brand img { height: 44px; width: auto; display: block; }
145
+ .brand span { font-size: 16px; font-weight: 600; }
146
+ .brand h1 { margin: 0; font-size: 16px; font-weight: 400; color: var(--muted); }
147
+ .brand h1::before { content: "/"; margin-right: 10px; color: var(--line); }
148
+ .brand .keys { margin-left: auto; font-size: 12px; color: var(--muted); }
149
+ kbd { font: 11px ui-monospace, Menlo, monospace; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: var(--paper); color: var(--ink); }
150
+ .strip { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
151
+ .row { display: flex; gap: 10px; align-items: flex-end; overflow-x: auto; padding: 4px 2px 6px; }
152
+ .rl { flex: none; width: 110px; font-size: 12px; color: var(--muted); padding-bottom: 20px; }
153
+ .th { flex: none; width: 150px; padding: 0; border: 0; background: none; cursor: pointer; text-align: left; font: inherit; color: var(--muted); }
154
+ .th img, .th .none { width: 150px; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; display: block; border-radius: 4px; background: var(--soft); outline: 2px solid transparent; outline-offset: 2px; }
155
+ .th .none { display: grid; place-items: center; font-size: 11px; }
156
+ .tl { display: block; font: 11px ui-monospace, Menlo, monospace; margin-top: 5px; }
157
+ .th[aria-current="true"] img, .th[aria-current="true"] .none { outline-color: var(--ink); }
158
+ .th[aria-current="true"] .tl { color: var(--ink); }
159
+ .th[data-failed] .tl { text-decoration: line-through; }
160
+ .main { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
161
+ .stage { display: grid; gap: 14px; grid-template-columns: 1fr; }
162
+ .stage[data-compare] { grid-template-columns: 1fr 1fr; }
163
+ .shot { display: block; background: var(--paper); border-radius: 6px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); text-decoration: none; }
164
+ .shot img { width: 100%; max-height: 72vh; object-fit: contain; object-position: top; background: var(--soft); display: block; }
165
+ .shot .cap { display: block; padding: 6px 10px; font-size: 12px; color: var(--muted); }
166
+ .basebox[hidden] { display: none; }
167
+ h2 { margin: 14px 0 2px; font-size: 16px; font-weight: 600; }
168
+ .fault { margin: 4px 0 0; color: var(--ink); }
169
+ .fault:empty { display: none; }
170
+ .fault::before { content: "Fault: "; font-weight: 600; }
171
+ .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
172
+ .acts button, .acts input { font: inherit; font-size: 13px; padding: 8px 12px; border-radius: 6px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); }
173
+ .acts button { cursor: pointer; }
174
+ .acts .primary { background: var(--ink); border-color: var(--ink); color: var(--paper); font-weight: 600; }
175
+ .acts input { min-width: 220px; flex: 1 1 220px; }
176
+ aside h3 { margin: 0 0 12px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
177
+ .ing { display: grid; grid-template-columns: 96px 1fr; gap: 12px; margin-bottom: 16px; }
178
+ .ing img, .ing .none { width: 96px; aspect-ratio: 4 / 3; object-fit: cover; object-position: top; border-radius: 4px; display: block; background: var(--soft); }
179
+ .ing b { display: block; font-weight: 600; font-size: 13px; overflow-wrap: anywhere; }
180
+ .ing i { display: block; font-style: normal; color: var(--muted); font-size: 13px; line-height: 1.4; }
181
+ .ing q { display: block; font-size: 13px; line-height: 1.4; margin-top: 3px; quotes: "\\201C" "\\201D"; }
182
+ .ing q:empty { display: none; }
183
+ .ing .out { display: block; font-size: 13px; margin-top: 3px; color: var(--muted); }
184
+ .ing .out:empty { display: none; }
185
+ .bar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--paper); border-top: 1px solid var(--line); }
186
+ .bar-in { max-width: 1680px; margin: 0 auto; padding: 10px 28px; display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; }
187
+ .bar label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
188
+ .bar textarea { width: 100%; font: 12px/1.4 ui-monospace, Menlo, monospace; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; height: 46px; resize: vertical; background: var(--canvas); }
189
+ #copy { font: inherit; font-size: 13px; font-weight: 600; padding: 9px 16px; border-radius: 6px; border: 0; background: var(--ink); color: var(--paper); cursor: pointer; }
190
+ button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid #2f6fdb; outline-offset: 2px; }
191
+ @media (max-width: 900px) {
192
+ main { padding: 16px 16px 200px; }
193
+ .main, .stage[data-compare] { grid-template-columns: 1fr; }
194
+ .brand .keys { display: none; }
195
+ .rl { width: 64px; }
196
+ .bar-in { grid-template-columns: 1fr; padding: 10px 16px; }
197
+ }
198
+ </style>
199
+ </head>
200
+ <body>
201
+ <main>
202
+ <div class="brand"><img src="data:image/png;base64,${LOGO}" alt="" width="21" height="44"><span>Long Beard</span><h1>Direction</h1><span class="keys"><kbd>←</kbd><kbd>→</kbd> move between screens</span></div>
203
+ <div class="strip">${strip}</div>
204
+ <div class="main">
205
+ <section>
206
+ <div class="stage" id="stage">
207
+ <a class="shot" id="shot" target="_blank" rel="noopener"><img id="big" alt=""><span class="cap" id="cap"></span></a>
208
+ <a class="shot basebox" id="basebox" target="_blank" rel="noopener" hidden><img id="baseimg" alt=""><span class="cap" id="basecap"></span></a>
209
+ </div>
210
+ <h2 id="title"></h2>
211
+ <p class="fault" id="fault"></p>
212
+ <div class="acts">
213
+ <button type="button" class="primary" data-act="take">Take this one</button>
214
+ <button type="button" data-act="more">More of this</button>
215
+ <button type="button" data-act="compare" aria-pressed="false">Beside its base</button>
216
+ <input type="text" id="ask" placeholder="Or say it: with 6's colours, open the menu…" aria-label="What to do with this screen">
217
+ </div>
218
+ </section>
219
+ <aside><h3>Made from</h3><div id="made"></div></aside>
220
+ </div>
221
+ </main>
222
+ <div class="bar"><div class="bar-in">
223
+ <div><label for="out">Copy this into the chat</label><textarea id="out" readonly></textarea></div>
224
+ <button type="button" id="copy">Copy</button>
225
+ </div></div>
226
+ <script>
227
+ (() => {
228
+ const screens = ${JSON.stringify(data).replace(/</g, "\\u003c")};
229
+ const key = "longbeard-canvas:" + location.pathname;
230
+ const $ = (id) => document.getElementById(id);
231
+ const thumbs = [...document.querySelectorAll(".th")];
232
+ const esc = (s) => String(s || "").replace(/[&<>"']/g, (c) => ({ "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" })[c]);
233
+ const said = [];
234
+ let at = 0;
235
+ try { at = Math.max(0, screens.findIndex((s) => s.n === localStorage.getItem(key))); } catch (e) {}
236
+ const ing = (src, title, what, like, avoid) =>
237
+ '<div class="ing">' + (src ? '<img src="' + esc(src) + '" alt="">' : '<span class="none"></span>') +
238
+ '<div><b>' + esc(title) + '</b><i>' + esc(what) + '</i><q>' + esc(like) + '</q><span class="out">' + (avoid ? "left out: " + esc(avoid) : "") + '</span></div></div>';
239
+ function show(i) {
240
+ at = (i + screens.length) % screens.length;
241
+ const s = screens[at];
242
+ for (const t of thumbs) t.setAttribute("aria-current", t.dataset.n === s.n ? "true" : "false");
243
+ $("big").src = s.src || "";
244
+ $("shot").href = s.src || "#";
245
+ $("cap").textContent = s.n + " · " + s.label;
246
+ $("baseimg").src = s.base.src || "";
247
+ $("basebox").href = s.base.src || "#";
248
+ $("basecap").textContent = "Base: " + s.base.name;
249
+ const kind = s.test ? "hardest screen for " + s.of : s.part ? s.part + " of " + s.of : "on " + s.base.name;
250
+ $("title").textContent = s.n + " · " + kind;
251
+ $("fault").textContent = s.fault;
252
+ $("made").innerHTML =
253
+ ing(s.base.src, "Base · " + s.base.name, "the layout, spacing and everything no move names", s.base.like, s.base.avoid) +
254
+ s.moves.map((m) => ing(m.src, "+ " + m.from, m.what + (m.proposed ? " (proposed)" : ""), m.like, "")).join("");
255
+ try { localStorage.setItem(key, s.n); } catch (e) {}
256
+ }
257
+ function write() {
258
+ $("out").value = said.length ? said.join("\\n") : "";
259
+ }
260
+ for (const t of thumbs) t.addEventListener("click", () => show(screens.findIndex((s) => s.n === t.dataset.n)));
261
+ for (const b of document.querySelectorAll("[data-act]")) {
262
+ b.addEventListener("click", () => {
263
+ const s = screens[at];
264
+ if (b.dataset.act === "compare") {
265
+ const on = b.getAttribute("aria-pressed") !== "true";
266
+ b.setAttribute("aria-pressed", on ? "true" : "false");
267
+ $("basebox").hidden = !on;
268
+ if (on) $("stage").dataset.compare = ""; else delete $("stage").dataset.compare;
269
+ return;
270
+ }
271
+ said.push(b.dataset.act === "take" ? "take " + s.n : "more of " + s.n);
272
+ write();
273
+ });
274
+ }
275
+ $("ask").addEventListener("keydown", (e) => {
276
+ if (e.key !== "Enter" || !e.target.value.trim()) return;
277
+ said.push(screens[at].n + " " + e.target.value.trim().replace(/\\s+/g, " "));
278
+ e.target.value = "";
279
+ write();
280
+ });
281
+ document.addEventListener("keydown", (e) => {
282
+ if (/^(INPUT|TEXTAREA)$/.test(e.target.tagName) || e.metaKey || e.ctrlKey || e.altKey) return;
283
+ if (e.key === "ArrowRight") { e.preventDefault(); show(at + 1); }
284
+ if (e.key === "ArrowLeft") { e.preventDefault(); show(at - 1); }
285
+ });
286
+ // The text box is the real path: the clipboard API can be refused on a file:// page.
287
+ $("copy").addEventListener("click", async (e) => {
288
+ const out = $("out");
289
+ out.focus();
290
+ out.select();
291
+ let ok = false;
292
+ try { await navigator.clipboard.writeText(out.value); ok = true; } catch (err) {}
293
+ if (!ok) { try { ok = document.execCommand("copy"); } catch (err) {} }
294
+ e.target.textContent = ok ? "Copied" : "Selected, press Cmd/Ctrl+C";
295
+ setTimeout(() => { e.target.textContent = "Copy"; }, 1800);
296
+ });
297
+ show(at);
298
+ write();
299
+ })();
300
+ </script>
301
+ </body>
302
+ </html>
303
+ `;
304
+
305
+ mkdirSync(dirname(outPath), { recursive: true });
306
+ writeFileSync(outPath, html);
307
+ console.error(`canvas: ${screens.length} screens in ${rows.size} row${rows.size === 1 ? "" : "s"}${missing ? `, ${missing} without a picture` : ""}`);
308
+ console.log(outArg);