@jonandev/longbeard 0.11.0 → 0.11.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.
@@ -1,13 +1,17 @@
1
1
  #!/usr/bin/env node
2
- // A moodboard of the references: every card with a shot, its name, its
3
- // pattern, and a link to its source. The layout is this file. It shows what
4
- // we saw. It does not paint a brand, a logo, a line, or a stat.
2
+ // A moodboard of the references, built to be marked: every card with a shot
3
+ // or recorded frames, grouped by its topic (the part of the product it shows),
4
+ // with Lead, Like and No, a note per tile, and a copy-out for the chat. The
5
+ // layout is this file. It shows what we saw. It does not paint a brand.
6
+ //
7
+ // A card's fields in board.md: link, shot, frames (a folder that
8
+ // capture.mjs --frames wrote, played on hover), topic, pattern, why.
5
9
  //
6
10
  // node moodboard.mjs design-exploration/identity/board.md --out design-exploration/identity/moodboard.html
7
11
  // node moodboard.mjs design-exploration/pricing/board.md --out design-exploration/pricing/moodboard.html
8
12
  import { execSync } from "node:child_process";
9
- import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
10
- import { dirname, isAbsolute, relative, resolve } from "node:path";
13
+ import { existsSync, mkdirSync, readFileSync, readdirSync, statSync, writeFileSync } from "node:fs";
14
+ import { dirname, isAbsolute, join, relative, resolve } from "node:path";
11
15
 
12
16
  const args = process.argv.slice(2);
13
17
  const outAt = args.indexOf("--out");
@@ -40,7 +44,12 @@ const esc = (s) =>
40
44
  .replace(/&/g, "&")
41
45
  .replace(/</g, "&lt;")
42
46
  .replace(/>/g, "&gt;")
43
- .replace(/"/g, "&quot;");
47
+ .replace(/"/g, "&quot;")
48
+ .replace(/'/g, "&#39;");
49
+ const href = (abs) => {
50
+ const src = relative(dirname(outPath), abs).split("\\").join("/");
51
+ return src.startsWith(".") ? src : `./${src}`;
52
+ };
44
53
 
45
54
  function fieldsOf(text) {
46
55
  const fields = {};
@@ -51,6 +60,37 @@ function fieldsOf(text) {
51
60
  return fields;
52
61
  }
53
62
 
63
+ // The parts of a site, in the order a visitor meets them. A topic not here
64
+ // (an app's key screen, say) keeps the order it first appears in on the board.
65
+ const TOPICS = [
66
+ ["Home", /^(home|homepage|landing|hero)$/],
67
+ ["Navigation", /^(nav|navigation|menu|header)$/],
68
+ ["Index", /^(index|listing|list|work|archive|grid|catalogue|catalog)$/],
69
+ ["Case study", /^(case[ -]?stud(y|ies)|project|work detail)$/],
70
+ ["Article", /^(article|editorial|reading|long[ -]?read|story)$/],
71
+ ["Blog", /^(blog|journal|news|notes)$/],
72
+ ["Photography", /^(photo|photos|photography|imagery|image|pictures)$/],
73
+ ["Motion", /^(motion|animation|transition|transitions|interaction)$/],
74
+ ];
75
+ function topicOf(raw) {
76
+ const t = String(raw || "").trim().toLowerCase();
77
+ if (!t) return { label: "Other", rank: 1e6 };
78
+ const at = TOPICS.findIndex(([, re]) => re.test(t));
79
+ if (at !== -1) return { label: TOPICS[at][0], rank: at };
80
+ return { label: t.charAt(0).toUpperCase() + t.slice(1), rank: 1000 };
81
+ }
82
+
83
+ // Frames from capture.mjs --frames: 01-00000ms.jpg, 02-00500ms.jpg…
84
+ function framesOf(folder) {
85
+ const abs = resolvePath(folder.trim().replace(/\/$/, ""));
86
+ if (!existsSync(abs) || !statSync(abs).isDirectory()) return null;
87
+ const files = readdirSync(abs)
88
+ .filter((f) => /\.(jpe?g|png|webp)$/i.test(f))
89
+ .sort();
90
+ if (!files.length) return null;
91
+ return files.map((f, i) => ({ src: href(join(abs, f)), ms: Number(f.match(/(\d+)ms\./)?.[1] ?? i * 500) }));
92
+ }
93
+
54
94
  const md = readFileSync(boardPath, "utf8");
55
95
  const cards = md
56
96
  .split(/^### /m)
@@ -61,31 +101,69 @@ const cards = md
61
101
  return { name, ...fieldsOf((nl === -1 ? "" : chunk.slice(nl + 1)).split(/^## /m)[0]) };
62
102
  });
63
103
 
64
- const tiles = [];
104
+ const sections = new Map();
105
+ let n = 0;
65
106
  for (const card of cards) {
66
- if (!card.shot) continue;
67
- const abs = resolvePath(card.shot.trim());
68
- if (!existsSync(abs)) {
69
- console.error(`moodboard: missing shot ${card.shot.trim()}`);
70
- continue;
107
+ const frames = card.frames ? framesOf(card.frames) : null;
108
+ if (card.frames && !frames) console.error(`moodboard: no frames in ${card.frames.trim()}`);
109
+ let poster = "";
110
+ if (card.shot) {
111
+ const abs = resolvePath(card.shot.trim());
112
+ if (existsSync(abs)) poster = href(abs);
113
+ else console.error(`moodboard: missing shot ${card.shot.trim()}`);
71
114
  }
72
- let src = relative(dirname(outPath), abs).split("\\").join("/");
73
- if (!src.startsWith(".")) src = `./${src}`;
74
- // A seed shared in chat has no URL, so its tile has no link.
115
+ if (!poster && frames) poster = frames[frames.length - 1].src;
116
+ if (!poster) continue;
117
+ const id = `m${++n}`;
118
+ const topic = topicOf(card.topic);
119
+ // A seed shared in chat has no URL, so its name is not a link.
75
120
  const url = (card.link || "").trim().split(/\s+/)[0];
76
- const img = `<img src="${esc(src)}" alt="${esc(card.name)}" loading="lazy">`;
77
- const frame = /^https?:\/\//i.test(url)
78
- ? `<a class="frame" href="${esc(url)}" target="_blank" rel="noopener noreferrer">${img}</a>`
79
- : `<div class="frame">${img}</div>`;
121
+ const name = /^https?:\/\//i.test(url)
122
+ ? `<a class="name" href="${esc(url)}" target="_blank" rel="noopener noreferrer">${esc(card.name)}</a>`
123
+ : `<span class="name">${esc(card.name)}</span>`;
80
124
  const line = card.pattern ? `<p class="line">${esc(card.pattern)}</p>` : "";
81
- tiles.push(`<figure class="tile">${frame}<figcaption><p class="name">${esc(card.name)}</p>${line}</figcaption></figure>`);
125
+ const play = frames
126
+ ? `<button type="button" class="play" aria-label="Play ${esc(card.name)}">Play</button><span class="clock"></span>`
127
+ : "";
128
+ const tile = `<figure class="tile" data-id="${id}" data-title="${esc(card.name)}" data-topic="${esc(topic.label)}"${
129
+ frames ? ` data-frames="${esc(JSON.stringify(frames))}"` : ""
130
+ }>
131
+ <div class="frame"><a class="open" href="${esc(poster)}" target="_blank" rel="noopener" aria-label="Open the shot of ${esc(card.name)}"><img src="${esc(poster)}" alt="${esc(card.name)}" loading="lazy"></a><span class="id">${id}</span>${play}</div>
132
+ <figcaption>
133
+ ${name}${line}
134
+ <div class="marks" role="group" aria-label="Mark ${esc(card.name)}">
135
+ <button type="button" data-mark="lead" aria-pressed="false">Lead</button>
136
+ <button type="button" data-mark="like" aria-pressed="false">Like</button>
137
+ <button type="button" data-mark="no" aria-pressed="false">No</button>
138
+ </div>
139
+ <input class="why" type="text" placeholder="Note (optional)" aria-label="Note on ${esc(card.name)}">
140
+ </figcaption>
141
+ </figure>`;
142
+ if (!sections.has(topic.label)) sections.set(topic.label, { rank: topic.rank, order: sections.size, tiles: [] });
143
+ sections.get(topic.label).tiles.push(tile);
82
144
  }
83
145
 
84
- if (!tiles.length) {
85
- console.error("moodboard: no card on the board has a shot");
146
+ if (!n) {
147
+ console.error("moodboard: no card on the board has a shot or frames");
86
148
  process.exit(1);
87
149
  }
88
150
 
151
+ const ordered = [...sections.entries()].sort(([, a], [, b]) => a.rank - b.rank || a.order - b.order);
152
+ const slug = (s) => `t-${s.toLowerCase().replace(/[^a-z0-9]+/g, "-")}`;
153
+ const jump = ordered
154
+ .map(([label, s]) => `<a href="#${slug(label)}">${esc(label)} <span>${s.tiles.length}</span></a>`)
155
+ .join("");
156
+ const body = ordered
157
+ .map(
158
+ ([label, s]) => `<section id="${slug(label)}">
159
+ <h2>${esc(label)} <span>${s.tiles.length}</span></h2>
160
+ <div class="grid">
161
+ ${s.tiles.join("\n ")}
162
+ </div>
163
+ </section>`,
164
+ )
165
+ .join("\n ");
166
+
89
167
  const html = `<!DOCTYPE html>
90
168
  <html lang="en">
91
169
  <head>
@@ -93,47 +171,206 @@ const html = `<!DOCTYPE html>
93
171
  <meta name="viewport" content="width=device-width, initial-scale=1">
94
172
  <title>Moodboard</title>
95
173
  <style>
96
- :root { --canvas: #e4e4e2; --paper: #ffffff; --ink: #1c1c1a; --muted: #6f6f6a; }
174
+ :root { --canvas: #e4e4e2; --paper: #ffffff; --ink: #1c1c1a; --muted: #6f6f6a; --line: #c8c8c4; --lead: #8a5a00; --like: #1f7a3a; --no: #b3261e; }
97
175
  * { box-sizing: border-box; }
98
- html { color-scheme: light; }
99
- body {
100
- margin: 0;
101
- background: var(--canvas);
102
- color: var(--ink);
103
- font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
104
- -webkit-font-smoothing: antialiased;
105
- }
106
- main { max-width: 1200px; margin: 0 auto; padding: 52px 28px 80px; }
107
- h1 {
108
- margin: 0 0 20px 2px;
109
- font-size: 11px;
110
- font-weight: 600;
111
- letter-spacing: 0.18em;
112
- text-transform: uppercase;
113
- color: var(--muted);
114
- }
115
- .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
116
- .tile { margin: 0; display: flex; flex-direction: column; background: var(--paper); border-radius: 22px; overflow: hidden; }
117
- /* The picture sits inside a square frame, so a tall shot cannot stretch its tile. */
118
- .frame { position: relative; display: block; aspect-ratio: 1; overflow: hidden; background: #141414; }
119
- .frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
120
- figcaption { flex: 1; padding: 16px 18px 18px; }
121
- .name { margin: 0; font-size: 15px; line-height: 1.3; }
122
- .line { margin: 4px 0 0; font-size: 13px; line-height: 1.4; color: var(--muted); }
123
- @media (max-width: 600px) { main { padding: 28px 16px 48px; } .grid { gap: 16px; } }
176
+ html { color-scheme: light; scroll-padding-top: 64px; }
177
+ body { margin: 0; background: var(--canvas); color: var(--ink); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
178
+ main { max-width: 1400px; margin: 0 auto; padding: 0 24px 300px; }
179
+ header { position: sticky; top: 0; z-index: 2; background: var(--canvas); padding: 20px 2px 12px; }
180
+ h1 { margin: 0 0 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
181
+ .how { margin: 0 0 12px; font-size: 14px; color: var(--muted); }
182
+ nav { display: flex; flex-wrap: wrap; gap: 8px; }
183
+ nav a, .filters button { font-size: 13px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); text-decoration: none; cursor: pointer; font-family: inherit; }
184
+ nav a span, h2 span { color: var(--muted); }
185
+ .filters { display: flex; gap: 8px; margin-top: 8px; }
186
+ .filters button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
187
+ section { margin-top: 28px; }
188
+ section[hidden] { display: none; }
189
+ h2 { margin: 0 0 12px 2px; font-size: 18px; font-weight: 600; }
190
+ .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
191
+ .tile { margin: 0; display: flex; flex-direction: column; background: var(--paper); border-radius: 18px; overflow: hidden; outline: 3px solid transparent; outline-offset: -3px; }
192
+ .tile[hidden] { display: none; }
193
+ .tile[data-state="lead"] { outline-color: var(--lead); }
194
+ .tile[data-state="like"] { outline-color: var(--like); }
195
+ .tile[data-state="no"] .frame img { opacity: 0.3; filter: grayscale(1); }
196
+ /* A tall page shows its top, where a person starts; the picture opens in full. */
197
+ .frame { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #141414; }
198
+ .frame .open { position: absolute; inset: 0; display: block; }
199
+ .frame img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
200
+ .id, .clock, .play { position: absolute; font-size: 11px; font-weight: 600; padding: 3px 7px; border-radius: 6px; background: rgba(0,0,0,0.65); color: #fff; }
201
+ .id { top: 8px; left: 8px; pointer-events: none; }
202
+ .play { bottom: 8px; left: 8px; border: 0; cursor: pointer; font-family: inherit; }
203
+ .clock { bottom: 8px; right: 8px; pointer-events: none; }
204
+ .clock:empty { display: none; }
205
+ figcaption { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 12px 14px 14px; }
206
+ .name { font-size: 15px; line-height: 1.3; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
207
+ a.name:hover { text-decoration: underline; }
208
+ .line { margin: -4px 0 0; font-size: 13px; line-height: 1.4; color: var(--muted); }
209
+ .marks { display: flex; gap: 6px; margin-top: auto; }
210
+ .marks button { flex: 1; font: inherit; font-size: 13px; font-weight: 600; padding: 7px 0; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; }
211
+ .marks button[data-mark="lead"][aria-pressed="true"] { background: var(--lead); border-color: var(--lead); color: #fff; }
212
+ .marks button[data-mark="like"][aria-pressed="true"] { background: var(--like); border-color: var(--like); color: #fff; }
213
+ .marks button[data-mark="no"][aria-pressed="true"] { background: var(--no); border-color: var(--no); color: #fff; }
214
+ button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid #2f6fdb; outline-offset: 2px; }
215
+ .why { font: inherit; font-size: 13px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; width: 100%; }
216
+ .bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 3; background: var(--paper); border-top: 1px solid var(--line); box-shadow: 0 -6px 24px rgba(0,0,0,0.08); }
217
+ .bar-in { max-width: 1400px; margin: 0 auto; padding: 14px 24px 16px; display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 14px; align-items: start; }
218
+ .bar label { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
219
+ .bar textarea { width: 100%; font: 13px/1.4 ui-monospace, Menlo, monospace; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; resize: vertical; height: 96px; }
220
+ #note { font-family: inherit; font-size: 14px; }
221
+ #out { background: #f6f6f4; }
222
+ .side { display: flex; flex-direction: column; gap: 8px; padding-top: 22px; min-width: 150px; }
223
+ #count { font-size: 13px; color: var(--muted); }
224
+ #copy { font: inherit; font-size: 14px; font-weight: 600; padding: 10px 16px; border-radius: 10px; border: 0; background: var(--ink); color: var(--paper); cursor: pointer; }
225
+ @media (max-width: 800px) { .bar-in { grid-template-columns: 1fr; } .side { padding-top: 0; } main { padding-bottom: 480px; } header { position: static; } }
124
226
  </style>
125
227
  </head>
126
228
  <body>
127
229
  <main>
128
- <h1>Moodboard</h1>
129
- <div class="grid">
130
- ${tiles.join("\n ")}
131
- </div>
230
+ <header>
231
+ <h1>Moodboard</h1>
232
+ <p class="how">Lead what should set the tone for its part (one per part), Like what belongs, No what feels wrong. Add a note where you have one. The picture opens the shot, the name opens the source, and Play runs recorded motion.</p>
233
+ <nav aria-label="Parts">${jump}</nav>
234
+ <div class="filters" role="group" aria-label="Show">
235
+ <button type="button" data-show="all" aria-pressed="true">All</button>
236
+ <button type="button" data-show="open" aria-pressed="false">Not marked</button>
237
+ <button type="button" data-show="marked" aria-pressed="false">Marked</button>
238
+ </div>
239
+ </header>
240
+ ${body}
132
241
  </main>
242
+ <div class="bar">
243
+ <div class="bar-in">
244
+ <div><label for="note">Overall, in your words (optional)</label><textarea id="note" placeholder="What the board says, what is missing, what to leave behind"></textarea></div>
245
+ <div><label for="out">Copy this into the chat</label><textarea id="out" readonly></textarea></div>
246
+ <div class="side"><span id="count"></span><button type="button" id="copy">Copy picks</button></div>
247
+ </div>
248
+ </div>
249
+ <script>
250
+ (() => {
251
+ const key = "longbeard-moodboard:" + location.pathname;
252
+ const tiles = [...document.querySelectorAll(".tile")];
253
+ const note = document.getElementById("note");
254
+ const out = document.getElementById("out");
255
+ const count = document.getElementById("count");
256
+ let saved = {};
257
+ try { saved = JSON.parse(localStorage.getItem(key) || "{}"); } catch (e) { saved = {}; }
258
+ // Saved by id and title, so a card dropped and the board rebuilt never moves a mark.
259
+ const tag = (t) => t.dataset.id + "|" + t.dataset.title;
260
+ const marks = saved.marks || {};
261
+ const notes = saved.notes || {};
262
+ note.value = saved.note || "";
263
+ for (const t of tiles) {
264
+ if (marks[tag(t)]) t.dataset.state = marks[tag(t)];
265
+ t.querySelector(".why").value = notes[tag(t)] || "";
266
+ }
267
+ let show = "all";
268
+ const short = (s) => (s.length > 48 ? s.slice(0, 47) + "…" : s);
269
+ const label = (t) => t.dataset.id + " " + short(t.dataset.title) + " (" + t.dataset.topic + ")";
270
+ const list = (state) => tiles.filter((t) => t.dataset.state === state).map(label);
271
+ function render() {
272
+ const lines = ["Moodboard picks", "lead: " + (list("lead").join("; ") || "none"), "like: " + (list("like").join("; ") || "none"), "no: " + (list("no").join("; ") || "none")];
273
+ const written = tiles.filter((t) => t.querySelector(".why").value.trim());
274
+ if (written.length) {
275
+ lines.push("notes:");
276
+ for (const t of written) lines.push("- " + t.dataset.id + " " + short(t.dataset.title) + ": " + t.querySelector(".why").value.trim().replace(/\\s+/g, " "));
277
+ }
278
+ if (note.value.trim()) lines.push("note: " + note.value.trim().replace(/\\s+/g, " "));
279
+ out.value = lines.join("\\n");
280
+ const marked = tiles.filter((t) => t.dataset.state).length;
281
+ count.textContent = list("lead").length + " lead · " + list("like").length + " like · " + list("no").length + " no · " + (tiles.length - marked) + " open";
282
+ const keepMarks = {};
283
+ const keepNotes = {};
284
+ for (const t of tiles) {
285
+ const s = t.dataset.state || "";
286
+ for (const b of t.querySelectorAll(".marks button")) b.setAttribute("aria-pressed", b.dataset.mark === s ? "true" : "false");
287
+ t.hidden = !(show === "all" || (show === "open" ? !s : !!s));
288
+ if (s) keepMarks[tag(t)] = s;
289
+ const w = t.querySelector(".why").value;
290
+ if (w.trim()) keepNotes[tag(t)] = w;
291
+ }
292
+ for (const sec of document.querySelectorAll("section")) sec.hidden = ![...sec.querySelectorAll(".tile")].some((t) => !t.hidden);
293
+ try { localStorage.setItem(key, JSON.stringify({ marks: keepMarks, notes: keepNotes, note: note.value })); } catch (e) {}
294
+ }
295
+ for (const t of tiles) {
296
+ for (const b of t.querySelectorAll(".marks button")) {
297
+ b.addEventListener("click", () => {
298
+ const mark = b.dataset.mark;
299
+ if (t.dataset.state === mark) delete t.dataset.state;
300
+ else {
301
+ // One lead per part: a new lead turns the old one into a like.
302
+ if (mark === "lead") for (const o of tiles) if (o !== t && o.dataset.topic === t.dataset.topic && o.dataset.state === "lead") o.dataset.state = "like";
303
+ t.dataset.state = mark;
304
+ }
305
+ render();
306
+ });
307
+ }
308
+ t.querySelector(".why").addEventListener("input", render);
309
+ }
310
+ for (const b of document.querySelectorAll(".filters button")) {
311
+ b.addEventListener("click", () => {
312
+ show = b.dataset.show;
313
+ for (const o of document.querySelectorAll(".filters button")) o.setAttribute("aria-pressed", o === b ? "true" : "false");
314
+ render();
315
+ });
316
+ }
317
+ note.addEventListener("input", render);
318
+ // Recorded frames play at the times they were taken, on hover or on Play.
319
+ for (const t of tiles) {
320
+ if (!t.dataset.frames) continue;
321
+ const frames = JSON.parse(t.dataset.frames);
322
+ const img = t.querySelector(".frame img");
323
+ const clock = t.querySelector(".clock");
324
+ const button = t.querySelector(".play");
325
+ const poster = img.getAttribute("src");
326
+ let timer = 0;
327
+ let playing = false;
328
+ for (const f of frames) new Image().src = f.src;
329
+ const stop = () => {
330
+ clearTimeout(timer);
331
+ playing = false;
332
+ img.src = poster;
333
+ clock.textContent = "";
334
+ button.textContent = "Play";
335
+ };
336
+ const step = (i) => {
337
+ img.src = frames[i].src;
338
+ clock.textContent = (frames[i].ms / 1000).toFixed(1) + " s";
339
+ const next = (i + 1) % frames.length;
340
+ const wait = next ? Math.max(80, frames[next].ms - frames[i].ms) : 1200;
341
+ timer = setTimeout(() => step(next), wait);
342
+ };
343
+ const start = () => {
344
+ if (playing) return;
345
+ playing = true;
346
+ button.textContent = "Stop";
347
+ step(0);
348
+ };
349
+ button.addEventListener("click", () => (playing ? stop() : start()));
350
+ // Hover plays only for people who have not asked for less motion; Play always works.
351
+ if (!matchMedia("(prefers-reduced-motion: reduce)").matches) {
352
+ t.querySelector(".frame").addEventListener("mouseenter", start);
353
+ t.querySelector(".frame").addEventListener("mouseleave", stop);
354
+ }
355
+ }
356
+ // The text box is the real path: the clipboard API can be refused on a file:// page.
357
+ document.getElementById("copy").addEventListener("click", async (e) => {
358
+ out.focus();
359
+ out.select();
360
+ let ok = false;
361
+ try { await navigator.clipboard.writeText(out.value); ok = true; } catch (err) {}
362
+ if (!ok) { try { ok = document.execCommand("copy"); } catch (err) {} }
363
+ e.target.textContent = ok ? "Copied" : "Selected, press Cmd/Ctrl+C";
364
+ setTimeout(() => { e.target.textContent = "Copy picks"; }, 1800);
365
+ });
366
+ render();
367
+ })();
368
+ </script>
133
369
  </body>
134
370
  </html>
135
371
  `;
136
372
 
137
373
  mkdirSync(dirname(outPath), { recursive: true });
138
374
  writeFileSync(outPath, html);
375
+ console.error(`moodboard: ${n} tiles in ${ordered.length} parts`);
139
376
  console.log(outArg);
@@ -11,7 +11,7 @@ description: >
11
11
 
12
12
  # Idea
13
13
 
14
- One file comes out: `docs/brief.md`, about 500 words, one page. Every later stage reads it: `design-direction` for the people, surface and identity nouns, `design` for the key screens, `to-spec` for the flows. No stage asks for these again, so the brief has to settle them.
14
+ One file comes out: `docs/brief.md`, about 500 words, one page. Every later stage reads it: `design-direction` for the people, surface, position and identity nouns, `design` for the key screens, `to-spec` for the flows. No stage asks for these again, so the brief has to settle them.
15
15
 
16
16
  The brief says what and for whom, never how. No framework, database, host or library. Those are Architecture's.
17
17
 
@@ -26,12 +26,13 @@ Look at the repo. Do not ask what is there.
26
26
 
27
27
  ## New idea
28
28
 
29
- Load Matt's `grilling` and run it. The design tree is the brief's sections below. Start with the frontier: a working name, problem, who it is for, surface. Flows, screens and scope hang off those. A working name is enough; it can change.
29
+ Load Matt's `grilling` and run it. The design tree is the brief's sections below. Start with the frontier: a working name, problem, who it is for, surface. Flows, screens, position and scope hang off those. A working name is enough; it can change.
30
30
 
31
31
  - One round per message, numbered, a recommended answer on each, as `grilling` says.
32
32
  - Recommend from the idea itself. A one-line idea still has a likely person and a likely first flow: propose them, they correct.
33
+ - Position comes from what they do today instead. Name those alternatives, then recommend the one thing this product is remembered for. Most people have not thought about it, so propose it; they correct.
33
34
  - A section they do not care about gets your recommendation and a "yes" settles it. Never leave one blank.
34
- - Stop asking when every section has an answer. Then say the brief in chat in six lines (problem, for, flows, surface, v1, out) and ask "Write `docs/brief.md`?" Write on yes.
35
+ - Stop asking when every section has an answer. Then say the brief in chat in seven lines (problem, for, flows, surface, remembered for, v1, out) and ask "Write `docs/brief.md`?" Write on yes.
35
36
 
36
37
  ## Existing project
37
38
 
@@ -76,6 +77,11 @@ Read the brief. Grill only what changes and what hangs off it: a new surface reo
76
77
  ## Constraints
77
78
  - <What is fixed: devices, offline, languages, accessibility needs, a deadline, a budget. Not tech choices.>
78
79
 
80
+ ## Position
81
+ - against: <what they use today instead, by name: "the phone's notes app, a paper logbook">
82
+ - remembered for: <one concrete thing someone would describe to a friend: "the tide line that runs down every entry". Not a value word>
83
+ - personality: <three adjectives>. Says: "<a line it would say>". Never: "<a line it would never say>"
84
+
79
85
  ## Identity nouns
80
86
  <4–8 concrete nouns from the product's world: the things, places, tools and materials its people know. "Tide, buoy, logbook, brass", not "trust, speed, simple".>
81
87
 
@@ -85,6 +91,7 @@ Read the brief. Grill only what changes and what hangs off it: a new surface reo
85
91
 
86
92
  - Every section has content. "None" is an answer. A guess is not.
87
93
  - **Changes** is added under Out of scope by the first Change, never before.
94
+ - Position is concrete. "Fast, simple, trustworthy" says nothing every rival would not say. `remembered for` is a thing you could point at on a screen or in a sentence; `against` names real products or habits.
88
95
  - Content is real: the longest names the people will type, the likely numbers, the real empty case. `design` uses them as copy.
89
96
  - Over a page means a flow is really two products, or a section is doing Architecture's job. Cut it.
90
97
 
@@ -102,5 +109,5 @@ Do not start it until they say so.
102
109
 
103
110
  - Pick a stack, or write a requirement as one ("uses Postgres").
104
111
  - Ask a question the repo or the idea already answers.
105
- - Write the brief before they confirm the six-line summary.
112
+ - Write the brief before they confirm the seven-line summary.
106
113
  - Edit the brief for a feature. Features get specs.