@jonandev/longbeard 0.6.0 → 0.8.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.
@@ -1,64 +1,35 @@
1
1
  #!/usr/bin/env node
2
- // A moodboard of the references. The layout is this file.
3
- // It shows what we saw. It does not paint a brand, a logo, a line, or a stat.
2
+ // A moodboard of the references: every card with a shot, its name, its
3
+ // tagline, 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.
4
5
  //
5
- // Before the pick (so they choose by looking):
6
6
  // node moodboard.mjs .design/board.md --out .design/moodboard.html
7
+ // node moodboard.mjs .design/hunts/pricing/board.md --out .design/hunts/pricing/moodboard.html
7
8
  //
8
- // After the pick (marks the lead, keeps the rest):
9
- // node moodboard.mjs .design/board.md --out .design/moodboard.html \
10
- // --leads "<card name>" --also "<card name>,<card name>" --why "<their reason>"
11
- //
12
- // --also takes every card they also liked. --count is how many references
13
- // they asked to see. --imagery adds the board's imagery tiles; leave it off
14
- // when the look has no pictures in it.
9
+ // A card with `slot: product` stays off: a product page cropped into a tile is noise.
15
10
  import { execSync } from "node:child_process";
16
11
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
17
12
  import { dirname, isAbsolute, relative, resolve } from "node:path";
18
13
 
19
14
  const args = process.argv.slice(2);
20
- const flag = (name) => {
21
- const i = args.indexOf(`--${name}`);
22
- if (i === -1) return "";
23
- const v = args[i + 1] ?? "";
24
- args.splice(i, 2);
25
- return v;
26
- };
27
- const has = (name) => {
28
- const i = args.indexOf(`--${name}`);
29
- if (i === -1) return false;
30
- args.splice(i, 1);
31
- return true;
32
- };
33
-
34
- const outArg = flag("out");
35
- const leadsArg = flag("leads");
36
- const alsoArg = flag("also");
37
- const whyArg = flag("why");
38
- const countArg = flag("count");
39
- const showImagery = has("imagery");
15
+ const outAt = args.indexOf("--out");
16
+ const outArg = outAt === -1 ? "" : (args.splice(outAt, 2)[1] ?? "");
40
17
  const boardArg = args[0];
41
18
  if (!boardArg || !outArg || args.length !== 1) {
42
- console.error(
43
- 'usage: node moodboard.mjs .design/board.md --out .design/moodboard.html [--leads "Name"] [--also "A,B"] [--why "their reason"] [--count 12] [--imagery]',
44
- );
19
+ console.error("usage: node moodboard.mjs .design/board.md --out .design/moodboard.html");
45
20
  process.exit(2);
46
21
  }
47
22
 
48
23
  function projectRoot() {
49
24
  try {
50
- return execSync("git rev-parse --show-toplevel", { encoding: "utf8" }).trim();
25
+ return execSync("git rev-parse --show-toplevel", { encoding: "utf8", stdio: ["ignore", "pipe", "ignore"] }).trim();
51
26
  } catch {
52
27
  return process.cwd();
53
28
  }
54
29
  }
55
30
 
56
- function resolvePath(path) {
57
- if (!path) return "";
58
- if (isAbsolute(path)) return path;
59
- return resolve(projectRoot(), path);
60
- }
61
-
31
+ const root = projectRoot();
32
+ const resolvePath = (path) => (isAbsolute(path) ? path : resolve(root, path));
62
33
  const boardPath = resolvePath(boardArg);
63
34
  const outPath = resolvePath(outArg);
64
35
  if (!existsSync(boardPath)) {
@@ -73,307 +44,47 @@ const esc = (s) =>
73
44
  .replace(/>/g, "&gt;")
74
45
  .replace(/"/g, "&quot;");
75
46
 
76
- const norm = (s) => s.trim().toLowerCase().replace(/\s+/g, " ").replace(/\.$/, "");
77
-
78
47
  function fieldsOf(text) {
79
48
  const fields = {};
80
- let key = null;
81
49
  for (const line of text.split(/\r?\n/)) {
82
50
  const m = line.match(/^- ([a-z][a-z /-]*):\s*(.*)$/i);
83
- if (m) {
84
- key = m[1].toLowerCase();
85
- fields[key] = m[2].trim();
86
- continue;
87
- }
88
- if (key && /^\s+\S/.test(line)) fields[key] = `${fields[key]} ${line.trim()}`.trim();
51
+ if (m) fields[m[1].toLowerCase()] = m[2].trim();
89
52
  }
90
53
  return fields;
91
54
  }
92
55
 
93
- function lum(hex) {
94
- const [r, g, b] = [0, 2, 4]
95
- .map((i) => parseInt(hex.slice(i + 1, i + 3), 16) / 255)
96
- .map((c) => (c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4));
97
- return 0.2126 * r + 0.7152 * g + 0.0722 * b;
98
- }
99
-
100
- function expand(hex) {
101
- const h = hex.replace("#", "");
102
- const full = h.length === 3 ? h.replace(/./g, (c) => c + c) : h;
103
- return `#${full.toLowerCase()}`;
104
- }
105
-
106
- function swatches(colour) {
107
- const found = [];
108
- const re = /#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})(?:\s*(?:→|->)\s*#([0-9a-fA-F]{6}|[0-9a-fA-F]{3}))?/g;
109
- let m;
110
- while ((m = re.exec(colour))) found.push({ index: m.index, end: re.lastIndex, hex: expand(m[2] || m[1]) });
111
- const out = [];
112
- for (let i = 0; i < found.length; i++) {
113
- const end = i + 1 < found.length ? found[i + 1].index : colour.length;
114
- const label = colour
115
- .slice(found[i].end, end)
116
- .replace(/^[\s,;:–\-."']+|[\s,;:–\-."']+$/g, "")
117
- .replace(/\s+/g, " ")
118
- .trim();
119
- if (!out.some((s) => s.hex === found[i].hex)) out.push({ hex: found[i].hex, label });
120
- }
121
- return out.slice(0, 8);
122
- }
123
-
124
- // `faces:` is a list of names. `type:` is prose, so it is only a fallback and
125
- // anything that reads like a sentence is dropped rather than shown as a face.
126
- function facesOf(card) {
127
- const listed = (card.faces || "")
128
- .split(/,|\s+and\s+|\s+&\s+|\s+\+\s+/i)
129
- .map((s) => s.trim())
130
- .filter(Boolean);
131
- if (listed.length) return listed.filter(isFaceName).slice(0, 3);
132
- return (card.type || "")
133
- .split(/,|\s+and\s+|\s+&\s+|\s+\+\s+/i)
134
- .map((s) => s.replace(/\s+for\s+.*/i, "").replace(/^(a pairing of|pairing of|the)\s+/i, "").trim())
135
- .filter(isFaceName)
136
- .slice(0, 2);
137
- }
138
-
139
- function isFaceName(name) {
140
- const words = name.split(/\s+/);
141
- return (
142
- /^[\p{L}\p{N}][\p{L}\p{N} .'’&-]*$/u.test(name) &&
143
- words.length <= 4 &&
144
- !/^(body|headline|display|serif|sans|sans-serif|mono|monospace|text|titles?|labels?)$/i.test(name)
145
- );
146
- }
147
-
148
- function isSans(name) {
149
- return /sans|grotesk|grotesque|gothic|america|aeonik|inter|helvetica|neue|haas|sohne|söhne|geist|satoshi|switzer|untitled/i.test(
150
- name,
151
- );
152
- }
153
-
154
- function cssFamily(name) {
155
- const serif = "'Iowan Old Style', Palatino, 'Palatino Linotype', Georgia, serif";
156
- if (!name) return serif;
157
- // Single quotes, so the value is safe inside a style="" attribute once escaped.
158
- const safe = name.replace(/['"\\<>;{}]/g, "").slice(0, 80);
159
- const fallback = isSans(name) ? "'Helvetica Neue', Helvetica, Arial, sans-serif" : serif;
160
- return `'${safe}', ${fallback}`;
161
- }
162
-
163
- // Optimistic: a face that is on Google Fonts renders for real, one that is not
164
- // falls back. No axes are requested, so a family without 500 still resolves.
165
- function fontsHref(names) {
166
- const families = names
167
- .filter((n) => /^[A-Za-z0-9][A-Za-z0-9 ]*$/.test(n))
168
- .map((n) => `family=${n.trim().replace(/\s+/g, "+")}`);
169
- if (!families.length) return "";
170
- return `https://fonts.googleapis.com/css2?${families.join("&")}&display=swap`;
171
- }
172
-
173
- function webPath(fromFile, absTarget) {
174
- let rel = relative(dirname(fromFile), absTarget).split("\\").join("/");
175
- if (!rel.startsWith(".")) rel = `./${rel}`;
176
- return rel;
177
- }
178
-
179
- function shotSrc(shot) {
180
- if (!shot) return "";
181
- const abs = resolvePath(shot.trim());
182
- if (!existsSync(abs)) {
183
- console.error(`moodboard: missing shot ${shot.trim()}`);
184
- return "";
185
- }
186
- return webPath(outPath, abs);
187
- }
188
-
189
- function href(url) {
190
- const value = (url || "").trim().split(/\s+/)[0] || "";
191
- return /^https?:\/\//i.test(value) ? value : "";
192
- }
193
-
194
56
  const md = readFileSync(boardPath, "utf8");
195
- const readSlice = md.match(/## Read this\s*\n([\s\S]*?)(?=\n## |\n### |\n- kind:|$)/);
196
- const read = readSlice ? fieldsOf(readSlice[1]) : {};
197
-
198
- const cards = [];
199
- const chunks = md.split(/^### /m).slice(1);
200
- for (const chunk of chunks) {
201
- const nl = chunk.indexOf("\n");
202
- const name = (nl === -1 ? chunk : chunk.slice(0, nl)).trim();
203
- const body = nl === -1 ? "" : chunk.slice(nl + 1);
204
- const cut = body.search(/^- kind:/m);
205
- cards.push({ name, ...fieldsOf((cut === -1 ? body : body.slice(0, cut)).split(/^## /m)[0]) });
206
- }
207
-
208
- const leadsName = leadsArg || read.leads || read.primary || "";
209
- const primary = leadsName ? cards.find((c) => norm(c.name) === norm(leadsName)) : null;
210
- if (leadsName && !primary) {
211
- console.error(`moodboard: no card named ${leadsName}`);
212
- process.exit(1);
213
- }
214
- // --also takes every card they said they liked, not only one.
215
- const alsoNames = (alsoArg || (read.also && !/^none$/i.test(read.also.trim()) ? read.also : ""))
216
- .split(",")
217
- .map((s) => s.trim())
218
- .filter(Boolean);
219
- const alsoCards = [];
220
- for (const name of alsoNames) {
221
- const card = cards.find((c) => norm(c.name) === norm(name));
222
- if (card) alsoCards.push(card);
223
- else console.error(`moodboard: no card named ${name}`);
224
- }
225
- const also = alsoCards[0] || null;
226
-
227
- const imagery = [];
228
- {
229
- let inCard = false;
230
- let cur = null;
231
- const push = () => {
232
- if (cur?.kind === "imagery" && cur.shot) imagery.push(cur);
233
- cur = null;
234
- };
235
- for (const line of md.split(/\r?\n/)) {
236
- if (line.startsWith("### ")) {
237
- inCard = true;
238
- push();
239
- continue;
240
- }
241
- if (line.startsWith("## ")) {
242
- inCard = false;
243
- push();
244
- continue;
245
- }
246
- const m = line.match(/^- ([a-z][a-z /-]*):\s*(.*)$/i);
247
- if (m && m[1].toLowerCase() === "kind") {
248
- inCard = false;
249
- push();
250
- cur = { kind: m[2].trim().toLowerCase() };
251
- continue;
252
- }
253
- if (inCard) continue;
254
- if (cur && m) cur[m[1].toLowerCase()] = m[2].trim();
255
- else if (cur && line.trim() === "") push();
256
- }
257
- push();
258
- }
259
-
260
- // Screens and sites close to this subject. A product page cropped into a tile
261
- // reads as noise, and a `form` card is a layout note, not a picture to feel.
262
- // --count is how many references they said they wanted to see.
263
- const MAX_PICTURES = Math.max(2, Math.min(24, Number(countArg) || 12));
264
- const boardHasSlots = cards.some((c) => c.slot);
265
- function showable(card) {
266
- if (!card.shot) return false;
267
- if (boardHasSlots && /product/i.test(card.slot || "")) return false;
268
- if (/^form$/i.test((card.fit || "").trim())) return false;
269
- return true;
270
- }
271
-
272
- const chosen = [];
273
- const add = (card, role) => {
274
- if (!card || chosen.some((c) => c.card === card)) return;
275
- chosen.push({ card, role });
276
- };
277
- if (primary) add(primary, "leads");
278
- for (const card of alsoCards) add(card, "also");
279
- for (const card of cards) {
280
- if (chosen.length >= MAX_PICTURES) break;
281
- if (showable(card)) add(card, "");
282
- }
283
- const pictures = chosen
284
- .filter((c) => c.role || showable(c.card))
285
- .flatMap(({ card, role }) => {
286
- const src = shotSrc(card.shot);
287
- if (!src) return [];
288
- const caption = role === "leads" && whyArg.trim() ? whyArg.trim() : (card.tagline || "").trim();
289
- return [{ src, role, name: card.name, caption, url: href(card.url) }];
290
- })
291
- .slice(0, MAX_PICTURES);
292
-
293
- if (showImagery && imagery.length > 4) console.error(`moodboard: showing 4 of ${imagery.length} imagery`);
294
- const picturesOfPlace = showImagery
295
- ? imagery.slice(0, 4).flatMap((item) => {
296
- const src = shotSrc(item.shot);
297
- return src ? [{ src, caption: (item.shows || "").trim(), url: href(item.url) }] : [];
298
- })
299
- : [];
300
-
301
- // Before the pick there is no lead yet, so the type and the colour tiles read
302
- // the cards on show instead.
303
- const onShow = pictures.map((pic) => cards.find((c) => c.name === pic.name)).filter(Boolean);
304
- const colourCards = [];
305
- if (primary?.colour) colourCards.push({ name: primary.name, colours: swatches(primary.colour).slice(0, 6) });
306
- else {
307
- const from = onShow.find((c) => c.colour);
308
- if (from) colourCards.push({ name: from.name, colours: swatches(from.colour).slice(0, 6), show: true });
309
- }
310
- // The night palette often comes from the `also` card. Show it, or the picture
311
- // and the adaptation disagree.
312
- if (also?.colour && /^register$/i.test((also.fit || "").trim())) {
313
- colourCards.push({ name: also.name, colours: swatches(also.colour).slice(0, 4) });
314
- }
315
- const colourCount = colourCards.reduce((n, c) => n + c.colours.length, 0);
316
-
317
- const seenFaces = [];
318
- const faceCards = primary ? [primary, also && !/^form$/i.test((also.fit || "").trim()) ? also : null] : onShow;
319
- for (const card of faceCards) {
320
- if (!card) continue;
321
- for (const face of facesOf(card)) {
322
- if (!seenFaces.some((f) => norm(f) === norm(face))) seenFaces.push(face);
323
- }
324
- }
325
- const faces = seenFaces.slice(0, 3);
326
- const family = cssFamily(faces[0] || "");
327
- const fonts = fontsHref(faces);
328
- const ink = "#1c1c1a";
57
+ const cards = md
58
+ .split(/^### /m)
59
+ .slice(1)
60
+ .map((chunk) => {
61
+ const nl = chunk.indexOf("\n");
62
+ const name = (nl === -1 ? chunk : chunk.slice(0, nl)).trim();
63
+ return { name, ...fieldsOf((nl === -1 ? "" : chunk.slice(nl + 1)).split(/^## /m)[0]) };
64
+ });
329
65
 
330
66
  const tiles = [];
331
- if (faces.length) {
332
- const names = faces
333
- .map((face) => `<p class="face" style="font-family:${esc(cssFamily(face))}">${esc(face)}</p>`)
334
- .join("");
335
- tiles.push(`<article class="tile type span-${colourCount ? 2 : 6}">
336
- <p class="kicker">Type we saw</p>
337
- <p class="aa">Aa</p>
338
- <div class="faces">${names}</div>
339
- </article>`);
340
- }
341
- if (colourCount) {
342
- const span = faces.length ? 4 : 6;
343
- const rows = colourCards
344
- .filter((group) => group.colours.length)
345
- .map((group, i) => {
346
- const chips = group.colours
347
- .map((s) => {
348
- const edge = lum(s.hex) > 0.86 ? " chip-edge" : "";
349
- return `<div class="swatch"><div class="chip${edge}" style="background:${esc(s.hex)}"></div><p class="hex">${esc(s.hex)}</p>${s.label ? `<p class="role">${esc(s.label)}</p>` : ""}</div>`;
350
- })
351
- .join("");
352
- const label = i === 0 && !group.show ? "" : `<p class="from">${esc(group.name)}</p>`;
353
- return `${label}<div class="swatches">${chips}</div>`;
354
- })
355
- .join("");
356
- tiles.push(`<article class="tile colour span-${span}"><p class="kicker">Colour we saw</p><div class="rows">${rows}</div></article>`);
357
- }
358
- for (const pic of pictures) {
359
- const span = pic.role ? 3 : 2;
360
- const kicker = pic.role === "leads" ? "Leads" : pic.role === "also" ? "Also" : "";
361
- const img = `<img src="${esc(pic.src)}" alt="${esc(pic.name)}" loading="lazy">`;
362
- const frame = pic.url
363
- ? `<a class="frame" href="${esc(pic.url)}" target="_blank" rel="noopener noreferrer">${img}</a>`
364
- : `<div class="frame">${img}</div>`;
365
- tiles.push(`<figure class="tile shot span-${span}${pic.role ? " marked" : ""}">${frame}<figcaption>${kicker ? `<p class="kicker">${esc(kicker)}</p>` : ""}<p class="name">${esc(pic.name)}</p>${pic.caption ? `<p class="line">${esc(pic.caption)}</p>` : ""}</figcaption></figure>`);
366
- }
367
- for (const pic of picturesOfPlace) {
368
- const img = `<img src="${esc(pic.src)}" alt="${esc(pic.caption || "Imagery")}" loading="lazy">`;
369
- const frame = pic.url
370
- ? `<a class="frame" href="${esc(pic.url)}" target="_blank" rel="noopener noreferrer">${img}</a>`
67
+ for (const card of cards) {
68
+ if (!card.shot || /product/i.test(card.slot || "")) continue;
69
+ const abs = resolvePath(card.shot.trim());
70
+ if (!existsSync(abs)) {
71
+ console.error(`moodboard: missing shot ${card.shot.trim()}`);
72
+ continue;
73
+ }
74
+ let src = relative(dirname(outPath), abs).split("\\").join("/");
75
+ if (!src.startsWith(".")) src = `./${src}`;
76
+ // A seed shared in chat has no URL, so its tile has no link.
77
+ const url = (card.url || "").trim().split(/\s+/)[0];
78
+ const img = `<img src="${esc(src)}" alt="${esc(card.name)}" loading="lazy">`;
79
+ const frame = /^https?:\/\//i.test(url)
80
+ ? `<a class="frame" href="${esc(url)}" target="_blank" rel="noopener noreferrer">${img}</a>`
371
81
  : `<div class="frame">${img}</div>`;
372
- tiles.push(`<figure class="tile shot picture span-2">${frame}<figcaption><p class="kicker">Imagery</p>${pic.caption ? `<p class="line">${esc(pic.caption)}</p>` : ""}</figcaption></figure>`);
82
+ const line = card.tagline ? `<p class="line">${esc(card.tagline)}</p>` : "";
83
+ tiles.push(`<figure class="tile">${frame}<figcaption><p class="name">${esc(card.name)}</p>${line}</figcaption></figure>`);
373
84
  }
374
85
 
375
86
  if (!tiles.length) {
376
- console.error("moodboard: nothing on the board to show");
87
+ console.error("moodboard: no card on the board has a shot");
377
88
  process.exit(1);
378
89
  }
379
90
 
@@ -383,129 +94,39 @@ const html = `<!DOCTYPE html>
383
94
  <meta charset="utf-8">
384
95
  <meta name="viewport" content="width=device-width, initial-scale=1">
385
96
  <title>Moodboard</title>
386
- ${fonts ? `<link rel="stylesheet" href="${esc(fonts)}">\n` : ""}<style>
387
- :root {
388
- --display: ${family};
389
- --ink: ${ink};
390
- --paper: #ffffff;
391
- --canvas: #e4e4e2;
392
- --muted: #6f6f6a;
393
- --ui: "Helvetica Neue", Helvetica, Arial, sans-serif;
394
- }
97
+ <style>
98
+ :root { --canvas: #e4e4e2; --paper: #ffffff; --ink: #1c1c1a; --muted: #6f6f6a; }
395
99
  * { box-sizing: border-box; }
396
100
  html { color-scheme: light; }
397
101
  body {
398
102
  margin: 0;
399
- min-height: 100vh;
400
103
  background: var(--canvas);
401
104
  color: var(--ink);
402
- font-family: var(--ui);
105
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
403
106
  -webkit-font-smoothing: antialiased;
404
107
  }
405
- .sheet { max-width: 1200px; margin: 0 auto; padding: 52px 28px 80px; }
108
+ main { max-width: 1200px; margin: 0 auto; padding: 52px 28px 80px; }
406
109
  h1 {
407
110
  margin: 0 0 20px 2px;
408
- font-family: var(--ui);
409
111
  font-size: 11px;
410
112
  font-weight: 600;
411
113
  letter-spacing: 0.18em;
412
114
  text-transform: uppercase;
413
115
  color: var(--muted);
414
116
  }
415
- .grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 22px; align-items: stretch; }
416
- .tile { background: var(--paper); border-radius: 22px; overflow: hidden; min-width: 0; }
417
- .span-2 { grid-column: span 2; }
418
- .span-3 { grid-column: span 3; }
419
- .span-4 { grid-column: span 4; }
420
- .span-6 { grid-column: span 6; }
421
- .kicker {
422
- margin: 0;
423
- font-size: 11px;
424
- font-weight: 600;
425
- letter-spacing: 0.16em;
426
- text-transform: uppercase;
427
- color: var(--muted);
428
- }
429
- .type, .colour { padding: 26px 28px 24px; }
430
- .type {
431
- display: flex;
432
- flex-direction: column;
433
- min-height: 280px;
434
- background: #171717;
435
- color: #f6f5f2;
436
- }
437
- .type .kicker { color: rgba(255, 255, 255, 0.55); }
438
- .aa {
439
- margin: 24px 0 0;
440
- font-family: var(--display);
441
- font-size: 104px;
442
- line-height: 0.78;
443
- letter-spacing: -0.045em;
444
- font-weight: 500;
445
- color: #f6f5f2;
446
- }
447
- .faces { margin-top: 24px; }
448
- .face {
449
- margin: 0;
450
- font-size: 22px;
451
- line-height: 1.25;
452
- letter-spacing: -0.03em;
453
- color: #f6f5f2;
454
- }
455
- .face + .face { margin-top: 4px; font-size: 17px; color: rgba(255, 255, 255, 0.68); }
456
- .colour { display: flex; flex-direction: column; min-height: 280px; }
457
- .rows { margin-top: auto; padding-top: 24px; display: grid; gap: 18px; }
458
- .from {
459
- margin: 0 0 8px;
460
- font-size: 12px;
461
- letter-spacing: 0.02em;
462
- color: var(--muted);
463
- }
464
- .swatches {
465
- display: grid;
466
- grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
467
- gap: 12px 14px;
468
- }
469
- .chip { height: 92px; border-radius: 14px; }
470
- .chip-edge { box-shadow: inset 0 0 0 1px rgba(28, 28, 26, 0.14); }
471
- .hex {
472
- margin: 8px 0 0;
473
- font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
474
- font-size: 11px;
475
- letter-spacing: 0.02em;
476
- color: #3c3c39;
477
- }
478
- .role { margin: 3px 0 0; font-size: 12px; line-height: 1.35; color: var(--muted); }
479
- .shot { margin: 0; display: flex; flex-direction: column; }
480
- .frame {
481
- display: block;
482
- background: #141414;
483
- aspect-ratio: 1;
484
- }
485
- .shot img {
486
- display: block;
487
- width: 100%;
488
- height: 100%;
489
- object-fit: contain;
490
- object-position: center;
491
- }
492
- .shot figcaption { flex: 1; padding: 16px 18px 18px; background: var(--paper); color: var(--ink); }
493
- .shot .name { margin: 6px 0 0; font-size: 15px; line-height: 1.3; letter-spacing: -0.01em; }
494
- .shot .line { margin: 4px 0 0; font-size: 13px; line-height: 1.4; color: var(--muted); }
495
- .shot figcaption .kicker + .name { margin-top: 6px; }
496
- .marked .frame { aspect-ratio: 4 / 3; }
497
- .marked .name { font-family: var(--display); font-size: 22px; letter-spacing: -0.02em; }
498
- .marked .line { font-size: 15px; color: #3a3a38; }
499
- @media (max-width: 900px) {
500
- .sheet { padding: 28px 16px 48px; }
501
- .grid { gap: 16px; }
502
- .tile, .span-2, .span-3, .span-4, .span-6 { grid-column: 1 / -1; }
503
- .aa { font-size: 84px; }
504
- }
117
+ .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
118
+ .tile { margin: 0; display: flex; flex-direction: column; background: var(--paper); border-radius: 22px; overflow: hidden; }
119
+ /* The picture sits inside a square frame, so a tall shot cannot stretch its tile. */
120
+ .frame { position: relative; display: block; aspect-ratio: 1; overflow: hidden; background: #141414; }
121
+ .frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
122
+ figcaption { flex: 1; padding: 16px 18px 18px; }
123
+ .name { margin: 0; font-size: 15px; line-height: 1.3; }
124
+ .line { margin: 4px 0 0; font-size: 13px; line-height: 1.4; color: var(--muted); }
125
+ @media (max-width: 600px) { main { padding: 28px 16px 48px; } .grid { gap: 16px; } }
505
126
  </style>
506
127
  </head>
507
128
  <body>
508
- <main class="sheet">
129
+ <main>
509
130
  <h1>Moodboard</h1>
510
131
  <div class="grid">
511
132
  ${tiles.join("\n ")}
@@ -1,95 +0,0 @@
1
- # Keep the strong ones
2
-
3
- A nominee is not a reference. Open the score (or the shot) and drop anything weak before it hits the board. The keep count is the board. Looking goes past it. A weak pass means fewer keeps, not a lower bar.
4
-
5
- ## Awwwards
6
-
7
- Look at the **Awwwards site page**, not the listing card.
8
-
9
- Keep:
10
-
11
- - Site of the Day, Site of the Month, Developer Award, or Site of the Year, **or**
12
- - Honorable Mention / Nominee only if **overall ≥ 7.5** and **Design ≥ 7.5** (scores are /10).
13
-
14
- Drop:
15
-
16
- - Overall or Design at **6 or below**, and anything with **4s** on Design, Usability, or Creativity.
17
- - Nominee-only with no SOTD/HM and a soft score.
18
- - Gates, password walls, or a hero you cannot actually see.
19
- - A high score whose offer only makes sense for another type of business. Keep that page only when a layout or a component still works once this topic’s pictures and words are in the frame. Do not take its type or its colours.
20
-
21
- Quote jury lines only from that page, and only for sites you kept.
22
-
23
- ## Godly, Land-book, siteinspire
24
-
25
- Curated, not scored. Keep a site if the **live page** has a clear idea (a crop, a component, one arrangement). From another business, that idea has to be a layout or a component that still works on this topic. Drop their type and their colours. Drop generic SaaS: centred headline, three icon cards, soft gradient, Inter.
26
-
27
- ## MaxiBestOf, Recent, Dark Mode Design
28
-
29
- Same test. The **live page** has a clear idea. Click through. The gallery card is not the shot. These galleries do not raise the keep. They are more places to open before you choose.
30
-
31
- - **MaxiBestOf** (maxibestof.one/websites). Prefer MaxiBestof Picks. Sections (maxibestof.one/sections) are pieces — a hero, a pricing block, a footer — not Sites. Fonts can be the type slot when you can name the pairing.
32
- - **Recent** (recent.design/websites). Open the source URL on the item. The poster, the icons, the OG images, and the tools are not sites.
33
- - **Dark Mode Design** (darkmodedesign.com). Open it only when the subject, the register, or the style they asked for is dark. A dark site kept so a light subject has a colour is the wrong card. Drop it.
34
-
35
- ## Supahero
36
-
37
- supahero.io is hero crops. A crop can be the shot for a hero piece when the control is in the frame. For a site, open the live page behind the crop. The grid is not a shot. A crop is never a Site.
38
-
39
- ## Muzli
40
-
41
- muz.li collects other people’s work. Open the original. That page still has to pass its own gate: Awwwards needs the score, Dribbble needs the votes, a live site needs a clear idea. Do not capture the Muzli card or the feed.
42
-
43
- ## Pinterest
44
-
45
- Pins on pinterest.com are pictures, never sites. Keep one when it is a single real page or screen and you can name what is worth taking. Prefer this year when the pin shows a date. A photograph of this subject can be imagery. Drop mood boards, collages, AI mush, and anything you would drop on Dribbble. Do not capture a board or a search grid.
46
-
47
- If Pinterest shows a login wall, write `Pinterest: login wall` under the board’s drops and continue. That counts as the pass.
48
-
49
- ## Dribbble / Behance
50
-
51
- Listing pages are client-rendered (WebFetch returns empty). Shot pages (`/shots/...`) often hit Human Verification in headless Chrome. Use `scripts/dribbble-cards.mjs` on a popular-search listing; take artwork from `cdn.dribbble.com`. Run queries one at a time. A 0-card query is retried after 8 seconds, then after 30 seconds; if it is still 0, write `<query>: 0 cards (rate limit?)` under the board's drops. An empty search and a rate limit look the same from one try.
52
-
53
- **Query for the form, not the word.** A search for the subject’s word returns things that share the word and not the idea: for “writing app”, print-on-demand tees, CV services, tracing worksheets, essay mills, posters, AI assistants. Use a category path and add the form — `/search/shots/popular/product-design?q=writing+app+ui`, `/mobile?q=text+editor+screen`, `/web-design?q=…`.
54
-
55
- **Negative list.** `scripts/dribbble-cards.mjs` drops these by whole word in the slug and title before a thumbnail is fetched, and prints the noise rate on stderr: `t-shirt, tee, merch, apparel, hoodie, resume, cv, cover letter, essay, worksheet, tracing, handwriting practice, alphabet, halloween, christmas, valentine, logo, logotype, branding, brand identity, packaging, poster, book cover, sticker, mockup, chatbot, mood tracker, habit tracker`. A project extends it with `--drop "a,b"` and relaxes it with `--keep "a,b"` (a font hunt keeps `logotype`; a product about moods keeps `mood tracker`). Put the noise rate under the board’s drops. A high rate means the query is wrong: fix the query, do not scroll more. Words that may be the subject itself, like “ai” and “illustration”, are judged on the shot, not filtered on the title.
56
-
57
- Sort this year by **popular** (`timeframe=year`). There is no “most saved/liked” sort on the listing. `scripts/dribbble-cards.mjs` prints `id-slug`, **likes**, **views**, image URL, and title, each count read from the card's own stat element. A count it cannot read is empty — it never guesses one from the title. `score:` uses whichever counts came back: `score: 39 likes, 6k views`, or `score: 5.4k views (likes unavailable)`. Do not put a number on a card that the helper left empty. `timeframe=year` is not strict — older shots appear; when the slug or shot ID reveals a year, record it on the card so an old shot is visible as old.
58
-
59
- A Pinterest pass does not replace this sort. Look through that sort, then the page type, the component, and the element, including other subjects. A whole-look board keeps up to 20 that pass this filter. On a website they lose to a kept live site. On an application they outweigh award sites. A piece hunt keeps 10 after it has opened at least 30. Open more than you keep. The keep does not rise because another gallery was added. If the pass is weak, the board stays short. Do not lower the filter to finish the count.
60
-
61
- Keep if you can name what is worth taking in one line (a crop, a type pairing, a palette, a component, a screen). The shot has to be one people actually saved (or viewed, when that is the only signal).
62
-
63
- Drop: AI mush, fake browser chrome around a 3-card landing, purple gradient on dark, Inter-everywhere, emoji icons, melted type, a shot whose only job is “bakery website mockup.”
64
-
65
- A Dribbble drawing is **imagery**, never a site.
66
-
67
- ## Shipped, or a concept
68
-
69
- A Dribbble shot of a screen is usually a mockup with a few short, curated sample texts. It has never faced a long essay, a phone keyboard, Markdown, empty or error states, or the product’s key feature. Mark every app card `shipped: yes | concept`. Shipped sources first for an app: the product’s own in-app screenshots (App Store listings, press kits, help docs) and shipped-screen galleries such as Mobbin or Refero, which may need the person’s login — write `Mobbin: login wall` under drops and go on. When the lead is a concept, **Read this** says what it does not show (`not shown`).
70
-
71
- For a typography-first brief, a register source outside screens is allowed: book design, publishers, editorial typography. Say on the card why it is the register.
72
-
73
- ## A seed
74
-
75
- A picture the person gave you is a seed. It is not scored, not dropped for being off-gallery, and it is shown on the moodboard like any other tile. It steers queries (“more like this”) and it ranks candidates on the contact sheet.
76
-
77
- ## Unsplash / Wikimedia
78
-
79
- Search **this** subject, not a stock category name. Drop posed lifestyle and fake product. One real place or material beats a pile of similar ones. Download routes: see [shots.md](shots.md).
80
-
81
- A file counts when you can point at a crop where that principle is the subject. If the thing you would leave is what the frame is about, drop it or write the crop. Do not keep ten near-misses to fill a count. The page may use fewer.
82
-
83
- If a pass across these galleries cannot fill the count without lowering these gates, the board stays short. Do not fill it with 4s.
84
-
85
- ## Colour and contrast
86
-
87
- Hexes come from a kept shot, sampled from a **crop of the element** they name — never from a photograph, mockup frame, or presentation background unless that is the role. On the card: `#2c2824 body text`, `#b0563a active-tab dot`.
88
-
89
- Every adapted hex needs a reason: contrast, the `change` twist, this subject's own pictures, or a brand colour they already have. A generic sampled hex — cream paper, warm ink — may be kept exactly as it was sampled when it is not the reference's identity. Moving `#f6f1e7` to `#f4efe4` is the same cream on screen; it is a change nobody can see, not an adaptation. `leave` lists their identity: a brand accent, a licensed face. It is not every hex on the card.
90
-
91
- Before the persist ask, run every adapted text/background pair through `scripts/contrast.mjs` (`"#fg on #bg"`, optional `:large` or `:mark` for 3:1). Body and small text need 4.5:1; large text and non-text marks need 3:1. List each pair with ratio and verdict under **Read this**. A failing colour is adjusted; keep both hexes as `sampled → used`. Card hexes stay what we saw. They are not the brand.
92
-
93
- ## Type licence
94
-
95
- A type pick needs a `licence:` line that covers how this project ships it (bundled in app, self-hosted web, default UI). If it does not cover that use, drop it and name it under drops.