@logomarks/lookbook 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +66 -0
- package/README.md +3 -3
- package/package.json +3 -3
- package/src/fields.d.ts +3 -1
- package/src/fields.js +86 -5
- package/src/fit.js +118 -0
- package/src/glass.d.ts +32 -0
- package/src/glass.js +154 -0
- package/src/index.d.ts +2 -0
- package/src/index.js +2 -0
- package/src/live.d.ts +25 -1
- package/src/live.js +36 -3
- package/src/looks/index.d.ts +5 -2
- package/src/looks/index.js +32 -20
- package/src/looks/kit.d.ts +8 -0
- package/src/looks/kit.js +16 -0
- package/src/looks/stark.d.ts +19 -0
- package/src/looks/stark.js +106 -0
- package/src/styles/wall-looks.css +188 -0
- package/src/styles/wall.css +34 -3
- package/src/wall.d.ts +2 -0
- package/src/wall.js +14 -2
package/src/wall.js
CHANGED
|
@@ -16,6 +16,7 @@ import { opticalStyle } from './marks.js';
|
|
|
16
16
|
import { BLOOM_KINDS, bloomFits } from './looks/bloom.js';
|
|
17
17
|
import { CLUB_KINDS, CLUB_PHOTOS, clubFits } from './looks/club.js';
|
|
18
18
|
import { FIELDS, isField, MONO_FALLBACK } from './fields.js';
|
|
19
|
+
import { GLASS, isGlass, glassFoot } from './glass.js';
|
|
19
20
|
|
|
20
21
|
/** The one accent: acid lime. Every lime the looks print is this, unless `lookbook({ accent })` says otherwise. */
|
|
21
22
|
export const ACCENT = '#C8FF00';
|
|
@@ -100,6 +101,7 @@ const RATIO = {
|
|
|
100
101
|
gradient: '4 / 5',
|
|
101
102
|
shader: '4 / 5',
|
|
102
103
|
...Object.fromEntries(Object.keys(FIELDS).map((k) => [k, '4 / 5'])),
|
|
104
|
+
...Object.fromEntries(Object.keys(GLASS).map((k) => [k, '4 / 5'])),
|
|
103
105
|
...LOOK_RATIO,
|
|
104
106
|
};
|
|
105
107
|
/** How often each look is dealt (relative). The older looks keep the shares they had as a list (photo and gradient 3 in
|
|
@@ -123,12 +125,14 @@ export const WEIGHTS = {
|
|
|
123
125
|
// the field cards are dealt only where a wall gives them a weight (`lookbook({ weights })`), so the walls made before
|
|
124
126
|
// they came deal as they did
|
|
125
127
|
...Object.fromEntries(Object.keys(FIELDS).map((k) => [k, 0])),
|
|
128
|
+
// the glass cards too (2026-11-26)
|
|
129
|
+
...Object.fromEntries(Object.keys(GLASS).map((k) => [k, 0])),
|
|
126
130
|
...LOOK_WEIGHTS,
|
|
127
131
|
};
|
|
128
132
|
|
|
129
133
|
/** Names for the looks here whose id doesn't read as one (the others are their id, capitalised; the drawn looks'
|
|
130
134
|
* are `LOOK_LABEL`). */
|
|
131
|
-
export const KIND_LABEL = Object.fromEntries(Object.entries(FIELDS).map(([k, f]) => [k, f.label]));
|
|
135
|
+
export const KIND_LABEL = Object.fromEntries([...Object.entries(FIELDS), ...Object.entries(GLASS)].map(([k, f]) => [k, f.label]));
|
|
132
136
|
|
|
133
137
|
/** The live backgrounds a shader card can have: Paper's shaders (vendored in the effects library), the calm looks
|
|
134
138
|
* picked from its presets (2026-11-12: the rainbow colour panels, the white-hot smoke ring, the grey ink and Paper's
|
|
@@ -391,6 +395,14 @@ export function lookbook(options) {
|
|
|
391
395
|
const face = f.mono ? (MONO?.[0] ?? MONO_FALLBACK) : null;
|
|
392
396
|
const nameType = f.mono && MONO ? `font-family:${MONO[0]};font-weight:${MONO[1]};letter-spacing:${MONO[2]};text-transform:${MONO[3]}` : type;
|
|
393
397
|
inner = `${f.under ?? ''}<canvas class="wc-fx" aria-hidden="true"></canvas><span class="wc-lockup is-stack">${svg()}<b class="wc-name" style="${nameType}">${escapeHtml(name)}</b><i${face ? ` style="font-family:${face}"` : ''}>${escapeHtml(line)}</i></span>`;
|
|
398
|
+
} else if (isGlass(kind)) {
|
|
399
|
+
// a glass card (./glass.js): the mark itself drawn live in glass, started on screen like a field card, the name
|
|
400
|
+
// under it; what shows before it starts is the still mark, laid where the effect draws it
|
|
401
|
+
const glass = GLASS[kind];
|
|
402
|
+
const g = glass.deal({ pick, r, accent, paths: m.paths, uid });
|
|
403
|
+
attrs = ` data-shader="${escapeHtml(JSON.stringify({ effect: glass.effect, ...g.cfg }))}"`;
|
|
404
|
+
style += `;--bg:${g.ground};--fg:${g.ink}`;
|
|
405
|
+
inner = `${g.under}<canvas class="wc-fx" aria-hidden="true"></canvas>${glassFoot(name, line, type)}`;
|
|
394
406
|
} else if (kind === 'tone') {
|
|
395
407
|
const [bg, tint] = pick(TONES);
|
|
396
408
|
style += `;--bg:${bg};--accent:${tint}`;
|
|
@@ -406,7 +418,7 @@ export function lookbook(options) {
|
|
|
406
418
|
const plain = `<span class="wc-plain">${mark}<b class="wc-name">${escapeHtml(name)}</b></span>`;
|
|
407
419
|
const [w, h] = RATIO[kind].split('/').map(Number);
|
|
408
420
|
return {
|
|
409
|
-
html: `<a class="wc wc-${kind}${isLook(kind) ? ' wx' : isField(kind) ? ' wc-field' : ''}" href="${href(m)}" style="${style}"${attrs}>${inner}${plain}<span class="wc-tag">${escapeHtml(m.name)} <em>→</em></span></a>`,
|
|
421
|
+
html: `<a class="wc wc-${kind}${isLook(kind) ? ' wx' : isField(kind) ? ' wc-field' : isGlass(kind) ? ' wc-field wc-glass' : ''}" href="${href(m)}" style="${style}"${attrs}>${inner}${plain}<span class="wc-tag">${escapeHtml(m.name)} <em>→</em></span></a>`,
|
|
410
422
|
h: h / w,
|
|
411
423
|
brand,
|
|
412
424
|
used: { kinds: [kind], names: [name], lines: [line], photos: photo ? [photo] : [] },
|