@jonandev/longbeard 0.11.2 → 0.12.1
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/AGENTS.md +4 -5
- package/CHANGELOG.md +72 -0
- package/README.md +64 -43
- package/beard.json +124 -28
- package/bin/long-beard.js +171 -36
- package/package.json +1 -1
- package/skills/design/SKILL.md +51 -126
- package/skills/design-brief/SKILL.md +146 -0
- package/skills/design-brief/references/graphic.md +59 -0
- package/skills/design-check/SKILL.md +27 -11
- package/skills/design-check/references/design-rules.md +21 -7
- package/skills/design-check/scripts/capture.mjs +121 -37
- package/skills/design-check/scripts/contrast.mjs +23 -9
- package/skills/design-check/scripts/rules.mjs +613 -0
- package/skills/design-check/scripts/screen-contrast.mjs +428 -0
- package/skills/design-check/scripts/tokens.mjs +346 -0
- package/skills/design-content/SKILL.md +118 -0
- package/skills/design-content/scripts/contact-sheet.mjs +259 -0
- package/skills/design-content/scripts/pictures.mjs +197 -0
- package/skills/design-direction/SKILL.md +115 -200
- package/skills/design-direction/references/controls.md +58 -0
- package/skills/{design → design-direction}/references/design-rules.md +21 -7
- package/skills/design-direction/references/five-second.md +47 -0
- package/skills/design-direction/references/full-build.md +19 -0
- package/skills/design-direction/references/graphic.md +35 -0
- package/skills/design-direction/references/grid.md +114 -0
- package/skills/design-direction/references/library.md +75 -0
- package/skills/design-direction/references/screen-template.html +233 -0
- package/skills/design-direction/references/subject.md +33 -0
- package/skills/design-direction/scripts/capture.mjs +121 -37
- package/skills/design-direction/scripts/contact-sheet.mjs +18 -7
- package/skills/design-direction/scripts/fonts.mjs +276 -0
- package/skills/design-direction/scripts/layout-diff.mjs +118 -0
- package/skills/design-direction/scripts/measure.mjs +1728 -0
- package/skills/design-direction/scripts/moodboard.mjs +123 -32
- package/skills/design-direction/scripts/picture-cast.mjs +270 -0
- package/skills/design-direction/scripts/pictures.mjs +197 -0
- package/skills/design-direction/scripts/screen-contrast.mjs +428 -0
- package/skills/design-direction/scripts/sheet.mjs +67 -0
- package/skills/design-direction/scripts/subject-colours.mjs +410 -0
- package/skills/design-families/SKILL.md +138 -0
- package/skills/design-families/scripts/contact-sheet.mjs +259 -0
- package/skills/design-families/scripts/families.mjs +606 -0
- package/skills/design-families/scripts/measure.mjs +1728 -0
- package/skills/design-families/scripts/moodboard.mjs +467 -0
- package/skills/design-families/scripts/tag.mjs +289 -0
- package/skills/design-figma/SKILL.md +69 -0
- package/skills/design-figma/references/graphic.md +26 -0
- package/skills/design-identity/SKILL.md +134 -0
- package/skills/design-identity/references/graphic.md +8 -0
- package/skills/design-identity/references/identity-board.html +140 -0
- package/skills/{design → design-identity}/scripts/capture.mjs +121 -37
- package/skills/design-identity/scripts/colours.mjs +213 -0
- package/skills/design-identity/scripts/contrast.mjs +41 -0
- package/skills/design-identity/scripts/fonts.mjs +276 -0
- package/skills/design-identity/scripts/measure.mjs +1728 -0
- package/skills/design-identity/scripts/sheet.mjs +67 -0
- package/skills/design-identity/scripts/subject-colours.mjs +410 -0
- package/skills/design-moodboard/SKILL.md +184 -0
- package/skills/design-moodboard/references/graphic.md +25 -0
- package/skills/{design-direction → design-moodboard}/references/sources.md +21 -11
- package/skills/design-moodboard/scripts/capture.mjs +893 -0
- package/skills/design-moodboard/scripts/contact-sheet.mjs +259 -0
- package/skills/design-moodboard/scripts/crops.mjs +256 -0
- package/skills/design-moodboard/scripts/dribbble-cards.mjs +418 -0
- package/skills/design-moodboard/scripts/families.mjs +606 -0
- package/skills/design-moodboard/scripts/group.mjs +221 -0
- package/skills/design-moodboard/scripts/measure.mjs +1728 -0
- package/skills/design-moodboard/scripts/moodboard.mjs +467 -0
- package/skills/{design-direction → design-moodboard}/scripts/picker.mjs +121 -20
- package/skills/design-moodboard/scripts/pictures.mjs +197 -0
- package/skills/design-moodboard/scripts/tag.mjs +289 -0
- package/skills/design-prototype/SKILL.md +149 -0
- package/skills/design-prototype/references/design-md-template.md +82 -0
- package/skills/design-prototype/references/design-rules.md +203 -0
- package/skills/design-prototype/references/five-second.md +47 -0
- package/skills/design-prototype/references/graphic.md +27 -0
- package/skills/design-prototype/scripts/capture.mjs +893 -0
- package/skills/design-prototype/scripts/contrast.mjs +41 -0
- package/skills/design-prototype/scripts/links.mjs +308 -0
- package/skills/design-prototype/scripts/pictures.mjs +197 -0
- package/skills/design-prototype/scripts/rules.mjs +613 -0
- package/skills/design-prototype/scripts/screen-contrast.mjs +428 -0
- package/skills/design-prototype/scripts/sheet.mjs +67 -0
- package/skills/design-prototype/scripts/tokens.mjs +346 -0
- package/skills/design-wordmark/SKILL.md +65 -0
- package/skills/design-wordmark/scripts/capture.mjs +893 -0
- package/skills/design-wordmark/scripts/sheet.mjs +67 -0
- package/skills/framework-skills/SKILL.md +71 -0
- package/skills/idea/SKILL.md +13 -7
- package/skills/idea/references/graphic.md +64 -0
- package/skills/design/references/design-md-template.md +0 -58
- package/skills/design/scripts/contrast.mjs +0 -27
- package/skills/design-direction/scripts/dribbble-cards.mjs +0 -356
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# The five-second check
|
|
2
|
+
|
|
3
|
+
Read by `design-direction` (the chosen screen, after the touch-up) and `design-prototype` (the first screen and each key screen, before `DESIGN.md`). The design brief's takeaway says what someone should think and do in five seconds. This checks it on eyes that know nothing about the product. Every other check asks whether the screen follows the rules; this one asks whether it works.
|
|
4
|
+
|
|
5
|
+
## With fresh agents
|
|
6
|
+
|
|
7
|
+
Three agents that have seen nothing: a new agent or a clean session each, on a small model where you can choose one, given only the capture (`capture.mjs … --clip 0,0,1440,900`, or the device size for an app; for a site most people open on their phone, the 390 capture too). Never the brief, the design brief, the product's name from anywhere but the screen, or this conversation. Each gets exactly:
|
|
8
|
+
|
|
9
|
+
> You glance at this screen for five seconds. Answer in one short line each, from what you see, not what you guess:
|
|
10
|
+
> 1. What is this?
|
|
11
|
+
> 2. Who is it for?
|
|
12
|
+
> 3. What would you do first?
|
|
13
|
+
> 4. One word for how it feels.
|
|
14
|
+
|
|
15
|
+
Several screens (the prototype's key screens): the same three agents see all of them, one at a time, each in its own order, and answer the four questions for each. Never three new agents per screen.
|
|
16
|
+
|
|
17
|
+
No agent can be started clean (no subagents, no second session): say "five-second check: not run" and offer the people version. Never answer the questions yourself: you know too much.
|
|
18
|
+
|
|
19
|
+
## Compare, as facts
|
|
20
|
+
|
|
21
|
+
One table: the takeaway's think and do, then each agent's answers, then a verdict per row.
|
|
22
|
+
|
|
23
|
+
| | Takeaway | 1 | 2 | 3 | |
|
|
24
|
+
|---|---|---|---|---|---|
|
|
25
|
+
| What it is | a bakery, open now | … | … | … | 3 of 3 |
|
|
26
|
+
| What to do | order for pickup | … | … | … | 1 of 3 |
|
|
27
|
+
| Feel | warm, plain, exact (never: fussy) | … | … | … | 2 of 3 |
|
|
28
|
+
|
|
29
|
+
- **Got it:** two or three of three say it in any words.
|
|
30
|
+
- **Missed:** one or none. Say what they read instead ("two read it as a café menu, not an order page").
|
|
31
|
+
- **Feel:** compared with the design brief's three words and its never word. A never word in an answer is said, always.
|
|
32
|
+
|
|
33
|
+
## Then
|
|
34
|
+
|
|
35
|
+
A miss is a fact for them, not a redesign for you.
|
|
36
|
+
|
|
37
|
+
- **In the direction:** a miss on what to do, or what it is, is fixed only with the touch-up's own means: the headline says the takeaway outright, the primary action is present and findable, rank put right. Shown before and after, run again once. A miss only a different composition would fix is said in one line, and the choice stays theirs: keep it, or go back to the grid.
|
|
38
|
+
- **In the prototype:** the same on each key screen, where "what to do" is that screen's own job (a basket: check out). Fixed inside the identity and the direction.
|
|
39
|
+
- **The feel** is never fixed here. A never word in the answers is said with the screens; changing the look is `design-identity` or the direction again, on their word.
|
|
40
|
+
|
|
41
|
+
## People, offered once
|
|
42
|
+
|
|
43
|
+
Agents read a screen like a careful stranger, not like the people the product is for. Offer once, with the result:
|
|
44
|
+
|
|
45
|
+
> Want a real check? Show the screen for five seconds to two or three people who might use it, and ask the same four questions. Paste what they say.
|
|
46
|
+
|
|
47
|
+
Their answers outrank the agents'. Record them the same way. A no stands.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# The full build
|
|
2
|
+
|
|
3
|
+
Read by `design-direction` once they pick: the jobs that take a quick screen to a full one. The principles, the moves and the round's checks are in [grid.md](grid.md).
|
|
4
|
+
|
|
5
|
+
Only on what they pick: "more of 3" (the pick, if rough, and the new screens), a mix, or the screen they lean to. A screen made on a picked base is full from its plan. One agent that builds and judges defends its own choices, so each job below has a fresh agent with only what it needs. The plan and the build are the quick round's; then:
|
|
6
|
+
|
|
7
|
+
**3. Critique (a fresh agent per screen, pictures only).** It gets: the base reference (cropped to its screen), the final screen, `layout-diff.mjs`'s `side.png` and `overlay.png` for it (`--mirror` when the layout turned) and the lines its `diff.json` marks off, the translation's capture, 3× crops of every small device, rule, tight gap and edge beside the same crops of the source (made for it: it runs no scripts), each move's source picture, the moves in words, and the contrast report. No rules, no brief, no session; only what the product is, in one line. It answers:
|
|
8
|
+
- **Where is this screen less finished than its reference?** Every spot, small ones included (a gap, an edge, a size, a weight, a colour, a picture, text that cannot be read), each with the place in the reference that shows how it should be. The reference is the standard: what it does on purpose is never a fault.
|
|
9
|
+
- **What changed from the translation that no move names?**
|
|
10
|
+
- **In one line, what made the reference work, and does the screen keep it?**
|
|
11
|
+
- **Anything on the screen that no reference has?**
|
|
12
|
+
- **What on this screen exists only because of this product?** Not its words or pictures but a thing: its ownable, a mark, a number, a form. An empty answer is a fault, listed like any other: a screen as right for another trade has borrowed and added nothing.
|
|
13
|
+
|
|
14
|
+
It lists; it never redesigns.
|
|
15
|
+
|
|
16
|
+
**4. Fix (a fresh agent per screen).** It gets the critic's list, the screen's file and the same pictures, and changes only the spots listed, each toward what the reference does, with what the screen and its references already have; an empty answer to the last question is fixed with the ownable or a thing from the subject's card. Each fix is a new version (`<n>-a.html`, `<n>-b.html`), every one kept: a later fix is not always better. Then capture, `layout-diff.mjs` and contrast again, and a fresh critic again. **It stops when every spot left is small, or after two passes.** A stand-in picture is never a spot: it is listed under what they still supply. A spot is small when it is within the 15% principle 2 keeps, shows only in a 3× crop and never at the screen's own size, and breaks nothing the reference does on purpose; an empty answer to the product question is never small. What is left goes on the sheet as a known fault, in the table, never hidden.
|
|
17
|
+
|
|
18
|
+
Then the round's checks ([grid.md](grid.md)) again on every new or changed screen.
|
|
19
|
+
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Direction for a graphic
|
|
2
|
+
|
|
3
|
+
Read when the product brief's surface is a graphic. Everything in `SKILL.md` and its references holds except what is said here. A piece counts as a screen wherever a skill says screen, and the eight screens are eight pieces.
|
|
4
|
+
|
|
5
|
+
## The size
|
|
6
|
+
|
|
7
|
+
The size is the format in `docs/brief.md`, never phone or desktop. The design brief has no `first seen on` line for a graphic.
|
|
8
|
+
|
|
9
|
+
- **On screen:** the pixels the format gives.
|
|
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
|
+
- **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.
|
|
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
|
+
|
|
15
|
+
## What the pieces carry
|
|
16
|
+
|
|
17
|
+
- **Fill order:** the headline, then the facts in the order the brief lists them (what, when, where, who), then a link or a code if the brief has one, then the ownable. Each piece takes as many as its base carries, from the top, and stops. A fact the brief gives is never left off the chosen piece.
|
|
18
|
+
- **The headline** says the takeaway. A fact the brief marks missing is never invented: it is written in the piece as a stand-in (`data-standin="fact"` with `data-standin-note`) and listed for them.
|
|
19
|
+
- **The primary action is optional.** A link, a QR code or a date to save is on the piece only when the brief gives one.
|
|
20
|
+
- **No navigation.** The direction doc says `navigation: none`.
|
|
21
|
+
- **The rest** (the second language, the small print, other sizes of a set) is written down for `design-prototype`.
|
|
22
|
+
|
|
23
|
+
## Steps that do not run
|
|
24
|
+
|
|
25
|
+
- **The other width, before the yes:** skipped. A set's other sizes are `design-prototype`'s.
|
|
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
|
+
- **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
|
+
|
|
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
|
+
## The doc
|
|
34
|
+
|
|
35
|
+
`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.
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# Building the screens
|
|
2
|
+
|
|
3
|
+
Read by `design-direction`, steps 3 and 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.
|
|
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`:
|
|
10
|
+
|
|
11
|
+
```
|
|
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" }]
|
|
13
|
+
```
|
|
14
|
+
|
|
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.
|
|
21
|
+
|
|
22
|
+
## Five principles
|
|
23
|
+
|
|
24
|
+
Everything below is one of these; decide a case not listed by them.
|
|
25
|
+
|
|
26
|
+
### 1. The base stands unless a move names it
|
|
27
|
+
|
|
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.
|
|
29
|
+
|
|
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.
|
|
35
|
+
|
|
36
|
+
### 2. Every measure is a share of the screen, and is kept
|
|
37
|
+
|
|
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.
|
|
39
|
+
|
|
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.
|
|
44
|
+
|
|
45
|
+
### 3. A borrowed thing keeps its geometry and its why
|
|
46
|
+
|
|
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.
|
|
48
|
+
|
|
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.
|
|
50
|
+
|
|
51
|
+
### 4. A move changes only what it names
|
|
52
|
+
|
|
53
|
+
One or two moves per screen, each borrowed from another reference, spread across the round. A move is one of:
|
|
54
|
+
- **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.
|
|
64
|
+
|
|
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.
|
|
66
|
+
|
|
67
|
+
### 5. Nothing from outside the board
|
|
68
|
+
|
|
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.
|
|
70
|
+
|
|
71
|
+
## Which screens
|
|
72
|
+
|
|
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.
|
|
74
|
+
|
|
75
|
+
## The quick round
|
|
76
|
+
|
|
77
|
+
Each screen is built once and not judged: no critic, no fixer, no device close-ups.
|
|
78
|
+
|
|
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.
|
|
80
|
+
|
|
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`.
|
|
87
|
+
|
|
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:
|
|
92
|
+
```
|
|
93
|
+
node <skill>/scripts/screen-contrast.mjs "file://$PWD/.longbeard/design/direction/screens/1.html" --wait-title ready
|
|
94
|
+
```
|
|
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.
|
|
99
|
+
|
|
100
|
+
## Without fresh agents
|
|
101
|
+
|
|
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
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
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
|
|
110
|
+
```
|
|
111
|
+
|
|
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`.
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Reading the references
|
|
2
|
+
|
|
3
|
+
Read by `design-direction`, step 2. Each reference the screens are built from is a finished design: its sizes, spacing, type and colours were chosen together and work together. Reading it is understanding that system well enough to rebuild it at screen size, and measuring it so the rebuild can be checked. Nothing here is a choice.
|
|
4
|
+
|
|
5
|
+
Write `.longbeard/design/direction/library.json`, one reading per reference (the lead and every like):
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
{
|
|
9
|
+
"lead": "<card name>",
|
|
10
|
+
"references": [{
|
|
11
|
+
"name": "<card name>",
|
|
12
|
+
"likes": [{ "what": "<what they like in it, in their words>", "why": "<what it does for them: the rule for using it>" }],
|
|
13
|
+
"concept": "<what makes it, in one or two sentences: the idea a designer would defend>",
|
|
14
|
+
"move": "<the one move a person would point at: the disc cutting into the title, one word filling the width>",
|
|
15
|
+
"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>",
|
|
16
|
+
"type": { "display": { "face": "…", "by": "page | measured | eye", "kind": "serif | sans | condensed | display | mono | script", "size": 96, "weight": 300, "case": "none", "tracking": "-0.02em", "leading": 0.95, "lines": 2 },
|
|
17
|
+
"small": { "face": "…", "size": 13, "weight": 400, "case": "uppercase", "tracking": "0.12em" }, "scale": 7.4 },
|
|
18
|
+
"spacing": "<the margin, the gaps, how close small text sits to what it belongs to, at 1440>",
|
|
19
|
+
"palette": { "ground": "#…", "ink": "#…", "accent": "#… or null", "more": { "<role>": "#…" } },
|
|
20
|
+
"pictures": "<how pictures are treated: crop, tone (black and white, a duotone, as shot), frame (an arch, a rounded window, full bleed), how many, how big>",
|
|
21
|
+
"motion": { "what": "…", "trigger": "…", "ms": 600, "easing": "…", "character": "…", "by": "page | frames | not seen" },
|
|
22
|
+
"finish": { "css": "…", "by": "page | eye" },
|
|
23
|
+
"picture_kind": "photo | illustration | 3d | mixed",
|
|
24
|
+
"slots": { "headline": { "words": 3, "lines": 2 }, "small": 3, "pictures": 1 },
|
|
25
|
+
"devices": ["<each element that is not content: a disc, a ruled line, a word band, a ring of text>"],
|
|
26
|
+
"measured": { "empty": 62, "pictures": 28, "radius": 12 }
|
|
27
|
+
}]
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Measure first, then look
|
|
32
|
+
|
|
33
|
+
**A live page:** `measure.mjs <link>` lists its fonts, sizes, weights, colours and gradients (`by: page`). It also lists the page's motion (each transition and animation with its property, time, easing and trigger) and its finish (shadows, filters, blends and textures with the share of the screen they cover), read before anything is judged by eye.
|
|
34
|
+
|
|
35
|
+
**A reference that is only a picture** (a shot, a poster, a presentation frame):
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
node <skill>/scripts/measure.mjs .longbeard/design/moodboard/refs/<name>.jpg --lines
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
It reads inside a presentation frame, and gives the ground, the `ink`, the palette (`common`, `loud`), how much is `empty` and how much is `pictures`, and the type: the display line's `px1440`, `weight`, `case`, `box`, the body size, the `scale`, the headline's words and lines, the text `blocks`. `--lines` lists every line it read, with its box: that is the layout's measurements. Sizes are given as px at 1440 wide, which is the size to build at.
|
|
42
|
+
|
|
43
|
+
What it cannot read (text on a photograph, rotated text, script faces, letters that touch) is read by eye with the picture at full size, and says `by: eye`. A number that disagrees with what you plainly see is a misread: use your reading, and say so.
|
|
44
|
+
|
|
45
|
+
**The face, from a picture:** the nearest free face by its measured shape, of the kind you see:
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
node <skill>/scripts/fonts.mjs --shape width=<w>,xheight=<x>,contrast=<c> --kind serif --weight <weight>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Give it every measure the picture gave (`width`, `xheight`, `dark`, `contrast`). Then set the top three in the reference's own words, at its size, beside the reference, and take the one that is plainly its kind (a hairline didone for a hairline didone, never a heavy slab). When it says nothing is close, the face is a stand-in: say so in the reading (`"stand-in": true`), and try `--kind display` too. Never one face for every reference: each is matched on its own.
|
|
52
|
+
|
|
53
|
+
## What each part is for
|
|
54
|
+
|
|
55
|
+
- **`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.
|
|
56
|
+
- **`concept` and `move`:** what must survive every change; the critic and the not-a-copy check judge on them.
|
|
57
|
+
- **`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
|
+
- **`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.
|
|
59
|
+
- **`pictures`:** the treatment the product's pictures get on a screen built from it.
|
|
60
|
+
- **`slots`:** how much text it carries; a screen built on it carries the same, and one small element more at most.
|
|
61
|
+
- **`devices`:** every element that is not content, so each on a screen traces to one.
|
|
62
|
+
|
|
63
|
+
## Motion, finish and picture kind
|
|
64
|
+
|
|
65
|
+
What a reference cannot show is "not seen", never guessed.
|
|
66
|
+
|
|
67
|
+
- **`motion`:** only for the lead and the references a pick is built on, never every like. `what` opens with the kind in the `motion` tag, where there is one; `character` is in the design brief's words. A live page: the page's motion as `measure.mjs` lists it (`by: page`). Motion made by script is listed too, with its time and easing "not seen". Recorded frames: by eye (`by: frames`), an easing they cannot show left "not seen". A still: `{ "by": "not seen" }`. A design brief whose motion is none ignores the field; its pick is never overridden.
|
|
68
|
+
- **`finish`:** a grain, shadow, blend or filter as a recipe that can be pasted: from a live page its own CSS, from a picture by eye. No recipe is "not seen".
|
|
69
|
+
- **`picture_kind`:** recorded only, never borrowed: the product's own pictures decide it, and when it has none of that kind the sheet says so.
|
|
70
|
+
|
|
71
|
+
## The subject
|
|
72
|
+
|
|
73
|
+
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).
|
|
74
|
+
|
|
75
|
+
**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.
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<!--
|
|
3
|
+
One direction screen, to copy to .longbeard/design/direction/screens/<n>.html.
|
|
4
|
+
A screen is one reference rebuilt faithfully with the product's content, then
|
|
5
|
+
changed by one or two moves borrowed from other references (grid.md). Write
|
|
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.
|
|
10
|
+
|
|
11
|
+
WRITE three things:
|
|
12
|
+
- LOOK: the faces and colours this screen uses, by role. Every colour and
|
|
13
|
+
face in the CSS is one of these variables, never a hex or a name, so
|
|
14
|
+
design-identity can try another face or palette from the URL.
|
|
15
|
+
- The CSS and the HTML of the screen.
|
|
16
|
+
- A mark on anything the product does not really have yet: a stand-in
|
|
17
|
+
picture is data-standin="picture", an assumed price, hour, number or name
|
|
18
|
+
is data-standin="fact" (data-standin-note says what is assumed).
|
|
19
|
+
- PROVENANCE: for every face, colour, element and effect on the screen, the
|
|
20
|
+
reference it comes from. Anything that cannot name one does not belong.
|
|
21
|
+
|
|
22
|
+
URL overrides (design-identity, the touch-up): ?face= &body= &weight=
|
|
23
|
+
&ground=%23… &ink=%23… &accent=%23… (accent=none hides it) &size=390x844.
|
|
24
|
+
|
|
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
|
|
27
|
+
live controls over the screen when opened with ?controls, never in a capture
|
|
28
|
+
(no ?controls, or ?capture). Display text is what carries the class "display".
|
|
29
|
+
-->
|
|
30
|
+
<html lang="en">
|
|
31
|
+
<head>
|
|
32
|
+
<meta charset="utf-8">
|
|
33
|
+
<title>screen</title>
|
|
34
|
+
<style>
|
|
35
|
+
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
36
|
+
html, body { width: var(--w); height: var(--h); overflow: hidden; }
|
|
37
|
+
body { background: var(--ground); color: var(--ink); font-family: var(--body-face), system-ui, sans-serif; }
|
|
38
|
+
a { color: inherit; text-decoration: none; }
|
|
39
|
+
.screen { position: relative; width: var(--w); height: var(--h); overflow: hidden; }
|
|
40
|
+
.display { font-family: var(--face), serif; font-weight: var(--weight); }
|
|
41
|
+
/* WRITE: the screen's CSS. Sizes in px at 1440 as measured from its reference; colours and faces only as variables. */
|
|
42
|
+
</style>
|
|
43
|
+
</head>
|
|
44
|
+
<body>
|
|
45
|
+
<div class="screen" id="screen">
|
|
46
|
+
<!-- WRITE: the screen's HTML, with the product's real content and pictures (../../pictures/…). -->
|
|
47
|
+
</div>
|
|
48
|
+
<script>
|
|
49
|
+
// ---------------------------------------------------------------- WRITE: the look
|
|
50
|
+
const LOOK = {
|
|
51
|
+
face: "Display Face", weight: 400, // the display face and its weight
|
|
52
|
+
body: "Body Face", // the face of everything else
|
|
53
|
+
ground: "#f4f1ea", ink: "#141414", // the page, and the text on it
|
|
54
|
+
accent: "#e2501c", // one accent, or null
|
|
55
|
+
more: { /* panel: "#1a1a1a", "panel-ink": "#f4f1ea" : any other colour the screen uses, by role */ },
|
|
56
|
+
css: [], // stylesheets for faces not on Google Fonts
|
|
57
|
+
};
|
|
58
|
+
// ---------------------------------------------------------------- WRITE: provenance
|
|
59
|
+
// Every face, colour, element and effect, with the reference it comes from (card names).
|
|
60
|
+
const PROVENANCE = [
|
|
61
|
+
// { what: "layout: arch photo left, headline over its right edge", from: "base reference" },
|
|
62
|
+
// { what: "the solid accent disc as the only button", from: "another reference" },
|
|
63
|
+
];
|
|
64
|
+
// ---------------------------------------------------------------- WRITE when the screen is chosen: the board's ranges
|
|
65
|
+
// Only what the references on the board measure; a control with no range is left out.
|
|
66
|
+
const CONTROLS = {
|
|
67
|
+
// type: [5.2, 9], // display size over text size: least and most on the board
|
|
68
|
+
// leading: [0.9, 1.3], // the display's line height over its size: least and most
|
|
69
|
+
// accent: [["#f4f1ea", "#e2501c"]], // each reference's ground and accent, as its reading has them
|
|
70
|
+
// radius: [0, 24], // the usual corner in px at 1440: least and most
|
|
71
|
+
};
|
|
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
|
+
</script>
|
|
232
|
+
</body>
|
|
233
|
+
</html>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# The subject's pictures and colours
|
|
2
|
+
|
|
3
|
+
Read by `design-direction`, step 0 and step 2.
|
|
4
|
+
|
|
5
|
+
## Pictures
|
|
6
|
+
|
|
7
|
+
Before the grid: three or four pictures of what the product is about (the bakery's bread and its bench, the climbing gym's wall, the app's real data on a desk). Not other designs, which is the moodboard's job: the product's own world. Every screen from here on uses them, so nothing is judged on grey boxes or on another product's pictures, and their colours become one more palette (step 2).
|
|
8
|
+
|
|
9
|
+
- **Theirs first.** The design brief says whether they have pictures. If they do, ask for three or four, and save them to `.longbeard/design/pictures/`.
|
|
10
|
+
- **None yet:** find stand-ins, a few, never a bulk search. Search the subject, not a mood: the brief's identity nouns, one query per picture you need.
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
node <skill>/scripts/pictures.mjs "sourdough loaf" --out .longbeard/design/pictures --count 2
|
|
14
|
+
node <skill>/scripts/pictures.mjs "flour on a wooden bench" --out .longbeard/design/pictures --count 2 --orientation landscape
|
|
15
|
+
```
|
|
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.
|
|
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
|
+
- **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
|
+
|
|
21
|
+
The pictures are the subject's card on the board (step 1): it is liked, with a why, like any reference, for a picture, a colour or a thing in it. Do not stop to ask: show them on a contact sheet (`contact-sheet.mjs .longbeard/design/pictures/credits.tsv --out <scratch>/pictures`) with the message in step 1, as stand-ins theirs replace. Each screen that uses one marks it `data-standin="picture"`.
|
|
22
|
+
|
|
23
|
+
## Colours
|
|
24
|
+
|
|
25
|
+
A quiet ground, its ink, and an accent when the subject has a second hue of its own, proposed from the subject pictures: one more palette a screen may borrow, so some screens wear the product's own colours. **As a quiet tint or an accent, never as a loud page:** a subject colour is never set stronger than the references set their own pages.
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
node <skill>/scripts/subject-colours.mjs .longbeard/design/pictures --json
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**Then look, and name every colour.** Open its sheet (`--sheet <scratch>/subject.html`, captured), which shows each proposed colour beside the pictures with the places it comes from lit up. Every colour must be something a person sees as the subject and can name: "the crust", "the flour", "the oven's black". A colour that lights up the backdrop, a cloth, a wall or a prop is not the subject's, even when it fills the photo: drop it (`--exclude "#hex"`) and run it again. The script already flags colours that sit mostly at the edges as background and never makes them the signature or the accent; the look is the check it cannot do. Write the name beside each colour wherever it is shown ("crust, lightened to carry white text").
|
|
32
|
+
|
|
33
|
+
Only then it goes in the library as `"subject"`. Never tune them stronger to make a screen livelier: a colour no reference would set a page on is not a direction they chose.
|