@logomarks/lookbook 0.5.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 +42 -0
- package/README.md +3 -3
- package/package.json +2 -2
- package/src/fields.d.ts +3 -1
- package/src/fields.js +86 -5
- package/src/fit.js +118 -0
- package/src/live.d.ts +21 -1
- package/src/live.js +16 -1
- 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/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,48 @@ All notable changes to `@logomarks/lookbook` are documented here.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.6.0] — 2026-11-28
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- **A long name fits its card** (`fitName`, `fitNames`, `fitWatch` in `/live`, ./fit.js): a long name in a wide face ran
|
|
13
|
+
off the card's edge (ROSEMARY in Unbounded showed as ROSEMAF on the duo look). Each name is measured against its
|
|
14
|
+
card and, where it would cross the card's edge less a 5% margin, set smaller until it clears: never clipped, never
|
|
15
|
+
wrapped, never larger than its look made it, and fitted from its look's size each time (`data-fs`), so the expanded
|
|
16
|
+
view's bigger copy isn't left small. `liveCards` keeps every name it watches fitted (as cards come, when a card changes
|
|
17
|
+
size, when the web fonts load, and on `watch()`); `fit: false` leaves them. `refit` (a name typed in the toolbar) fits
|
|
18
|
+
the name too. Measured on the preview with long names in Unbounded, Michroma and Syne at 267 px: 25 of 78 names ran
|
|
19
|
+
off before, none after.
|
|
20
|
+
|
|
21
|
+
### Added
|
|
22
|
+
|
|
23
|
+
- **The stark set** (./looks/stark.js), on the 2026-11-28 photos; both at weight 0, dealt only where a wall gives them
|
|
24
|
+
one, like the field and glass cards:
|
|
25
|
+
- `brutal` ("Brutalist poster"): a Swiss poster on the brutalist concrete photos (`brutal-*` in the glass set): the
|
|
26
|
+
photo grey and dark, the mark big in white top left, the name in Michroma capitals the full measure over a hairline
|
|
27
|
+
(sized from its width, `wideEms`, `data-fit="wide"`), the trade and the address under it, an issue number. Still.
|
|
28
|
+
- `sortglitch` ("Glitch card"): a pixel-sorted portrait (`pixelsort-*` in the photos), the mark clean in white, the
|
|
29
|
+
name cut into four or five level slices, one pushed well aside and one in an accent, like the photo's sort bands.
|
|
30
|
+
The slices are empty `<i>`s drawn from `data-t` by `::before`, so the name's text is one word for the toolbar and
|
|
31
|
+
screen readers; `refit` cuts them again for a typed name (`slices()`). While live the slices jump twice and settle
|
|
32
|
+
(CSS, 5 s, `LOOK_LOOP`); the still is where they settle. Downloads as a PNG and a looping video.
|
|
33
|
+
- The acid map takes the new close portraits too: `rimlight-*`, `dithered-*` and `offfocus-*`.
|
|
34
|
+
- `wideEms` moved to ./looks/kit.js (still exported from `/looks`).
|
|
35
|
+
- **Two field cards** after the owner's 2026-11-28 backgrounds, at weight 0 like every field (dealt where a wall gives them
|
|
36
|
+
one), drawn by @arraypress/effects-astro 0.14:
|
|
37
|
+
- `fluidfolds` ("Liquid folds", effect `fluid-folds`): glossy folds of liquid colour on a dark ground, poured enamel or
|
|
38
|
+
long silk dunes, an iridescent rim and a highlight on each crest; five colourways (enamel, cobalt and rose, ember,
|
|
39
|
+
graphite silk, acid), the lockup over a dimmed middle. After his Fluid backgrounds.
|
|
40
|
+
- `reededbokeh` ("Reeded bokeh", effect `fluted-bokeh`): coloured lights out of focus behind upright reeds, a thin
|
|
41
|
+
rainbow at each seam, or behind a wall of glass blocks (one card in four); five colourways (stage, cobalt night,
|
|
42
|
+
amber, signal mix, acid). After his Fluted Glass backgrounds.
|
|
43
|
+
- The dithered gradient (`dithergrad`) deals two new shapes, a soft orb and a glowing pill set off the middle, and five
|
|
44
|
+
three-colour ways after his Dithered Gradient backgrounds (coral dusk, ember and ice, violet heat, mint, daylight).
|
|
45
|
+
|
|
46
|
+
### Dependencies
|
|
47
|
+
|
|
48
|
+
- `@arraypress/effects-astro` ^0.14.0 (the two new fields' effects; publish it first).
|
|
49
|
+
|
|
8
50
|
## [0.5.0] — 2026-11-26
|
|
9
51
|
|
|
10
52
|
### Fixed
|
package/README.md
CHANGED
|
@@ -37,10 +37,10 @@ holoPointer();
|
|
|
37
37
|
|
|
38
38
|
## What's in it
|
|
39
39
|
|
|
40
|
-
- `@logomarks/lookbook`: `lookbook({ brand, faces, accent?, palettes?, weights?, href?, skip? })` gives `card`, `feed` and `backgrounds` (`weights: { asciinoise: 1 }` deals a field card, which is otherwise off: `FIELDS` lists them, live effects-astro backgrounds such as ASCII noise, light leak, dither, cascade grid, flow field, Voronoi mesh, kinetic grid, dithered gradient, Truchet tiles, pixel horizon and reeded
|
|
41
|
-
- `@logomarks/lookbook/looks`: the drawn looks, `LOOK_KINDS`, `LOOK_LABEL`, `LOOK_LOOP` (each moving look's loop, for a video), `LOOK_RATIO`, `LOOK_WEIGHTS`, `retarget` (another mark on a card) and `refit
|
|
40
|
+
- `@logomarks/lookbook`: `lookbook({ brand, faces, accent?, palettes?, weights?, href?, skip? })` gives `card`, `feed` and `backgrounds` (`weights: { asciinoise: 1 }` deals a field card, which is otherwise off: `FIELDS` lists them, live effects-astro backgrounds such as ASCII noise, light leak, dither, cascade grid, flow field, Voronoi mesh, kinetic grid, dithered gradient, Truchet tiles, pixel horizon, reeded glow, liquid folds and reeded bokeh; and `GLASS`, the glass cards, the mark itself drawn live in glass: liquid glass and glass slabs); `shuffled`; the promo cards `headlineCard`, `sponsorCard`, `openSlotCard`; `WEIGHTS`, `KIND_LABEL`, `EVERY`, `ACCENT` (`#C8FF00`) and the look tables.
|
|
41
|
+
- `@logomarks/lookbook/looks`: the drawn looks, `LOOK_KINDS`, `LOOK_LABEL`, `LOOK_LOOP` (each moving look's loop, for a video), `LOOK_RATIO`, `LOOK_WEIGHTS`, `retarget` (another mark on a card) and `refit` (a typed name sized, sliced and fitted again).
|
|
42
42
|
- `@logomarks/lookbook/marks`: a mark's box, ink share, optical size (`opticalVars`), cells and heat field; the box, ink, size and cells are `@logomarks/core`'s, re-exported.
|
|
43
|
-
- `@logomarks/lookbook/live`: `liveCards`, `shaders` (Paper's shaders and the field cards' effects, each loaded when first needed), `smoke` with its presets `SMOKE`, and `
|
|
43
|
+
- `@logomarks/lookbook/live`: `liveCards`, `shaders` (Paper's shaders and the field cards' effects, each loaded when first needed), `smoke` with its presets `SMOKE`, `holoPointer`, and `fitName`, `fitNames` and `fitWatch` (every card's name fitted to its card; `liveCards` runs it on what it watches, `fit: false` turns it off). A page that shows cards without `liveCards` calls `fitWatch(scope)` itself.
|
|
44
44
|
- `wall.css` and `wall-looks.css`: the cards and the drawn looks. They read the page's theme tokens (`--text`, `--muted`, `--border`, `--surface`, `--display`, `--mono`) and the accent `--hi`.
|
|
45
45
|
|
|
46
46
|
The pictures go by their file names: `club-N` the club hall, `club-dancer-N` and `club-crowd-N` its people, portraits (`modern`, `y2k` …) and the rest in `photos`; flowers (`bloom-N`, `dahlia-N`, `iris-N`, `lily-N`, `marigold-N`, `palm-N`) and abstracts in `glass`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@logomarks/lookbook",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "A logomark dressed as a made-up brand, in sixty-odd looks: on a photo, glass, a colour, paper or a live gradient, or the mark itself redrawn (traced, constructed, reeded, pixelated, neon, split-flap, contoured, thermal, liquid chrome, holo foil, ASCII, embroidered, frosted, editorial, liquid glass, glass slabs and more). Pure functions returning HTML, the same on the server and in the browser, with their CSS (motion in CSS only, a still final frame, a Plain mode), an optical size for wide, slim or light marks, and a browser runner that starts only what's near the screen.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"registry": "https://registry.npmjs.org/"
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
|
-
"@arraypress/effects-astro": "^0.
|
|
78
|
+
"@arraypress/effects-astro": "^0.14.0",
|
|
79
79
|
"@arraypress/og-image": "^1.5.1",
|
|
80
80
|
"@arraypress/text": "^2.2.0",
|
|
81
81
|
"@logomarks/core": "^0.2.1"
|
package/src/fields.d.ts
CHANGED
|
@@ -18,7 +18,9 @@ export type FieldKind =
|
|
|
18
18
|
| 'dithergrad'
|
|
19
19
|
| 'truchet'
|
|
20
20
|
| 'pixelhorizon'
|
|
21
|
-
| 'flutedglow'
|
|
21
|
+
| 'flutedglow'
|
|
22
|
+
| 'fluidfolds'
|
|
23
|
+
| 'reededbokeh';
|
|
22
24
|
|
|
23
25
|
/** What a field card is dealt from: the card's seeded pick and random, the accent, and the wall's monospaced face. */
|
|
24
26
|
export type FieldDeal = {
|
package/src/fields.js
CHANGED
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* The field cards: a live background drawn by one of @arraypress/effects-astro's fields (ASCII noise, …), started on
|
|
5
5
|
* screen like a shader card (`./live.js`), the lockup over a quiet middle. Most came from Processing sketches a friend of
|
|
6
|
-
* the owner shared (2026-11-20), modernised in effects-astro; four from reference images the owner collected (2026-11-26)
|
|
6
|
+
* the owner shared (2026-11-20), modernised in effects-astro; four from reference images the owner collected (2026-11-26);
|
|
7
|
+
* two more (liquid folds, reeded bokeh) and the dithered gradient's orb, pill and three-colour ways after his Fluid, Fluted
|
|
8
|
+
* Glass and Dithered Gradient backgrounds (2026-11-28).
|
|
7
9
|
*
|
|
8
10
|
* Each field says which effect draws it, its label, and how a card deals it: the effect's settings, the card's ground
|
|
9
11
|
* and ink, what shows before the effect starts (a CSS `still`, or markup laid `under` the canvas), and whether the name
|
|
@@ -22,6 +24,8 @@ import { gradientStill } from '@arraypress/effects-astro/runtime/dither-gradient
|
|
|
22
24
|
import { truchetStill } from '@arraypress/effects-astro/runtime/truchet-field';
|
|
23
25
|
import { horizonStill } from '@arraypress/effects-astro/runtime/pixel-horizon';
|
|
24
26
|
import { glowStill } from '@arraypress/effects-astro/runtime/fluted-glow';
|
|
27
|
+
import { foldsStill } from '@arraypress/effects-astro/runtime/fluid-folds';
|
|
28
|
+
import { bokehStill } from '@arraypress/effects-astro/runtime/fluted-bokeh';
|
|
25
29
|
|
|
26
30
|
/** The glyphs' face when the wall has no monospaced one. */
|
|
27
31
|
export const MONO_FALLBACK = 'ui-monospace, SFMono-Regular, Menlo, monospace';
|
|
@@ -302,14 +306,21 @@ const gradientInksOf = (accent) => [
|
|
|
302
306
|
['#2A0612', ['#0E5A5A', '#4FE3E8'], '#F4F3EF'], // cyan on maroon
|
|
303
307
|
['#0B0B0B', ['#5A1A08', '#FF3D00'], '#F4F3EF'], // signal
|
|
304
308
|
['#F4F3EF', ['#9AA6C6', '#0038FF'], '#0B0B0B'], // paper
|
|
309
|
+
// after the owner's Dithered Gradient photos (2026-11-28): three colours, dim through a middle to bright
|
|
310
|
+
['#05070D', ['#16245C', '#FF4A3D', '#FFB48A'], '#F4F3EF'], // coral dusk
|
|
311
|
+
['#03060A', ['#0B3A4A', '#FF6A2A', '#7FE3FF'], '#F4F3EF'], // ember and ice
|
|
312
|
+
['#0A0414', ['#3A1A8A', '#FF2F7A', '#FF9A5A'], '#F4F3EF'], // violet heat
|
|
313
|
+
['#020806', ['#0B4A3A', '#24C98A', '#E8FFF4'], '#F4F3EF'], // mint
|
|
314
|
+
['#F4F1EC', ['#F7B8A8', '#FF4A3D', '#2A5BFF'], '#0B0B0B'], // daylight
|
|
305
315
|
];
|
|
306
316
|
|
|
307
|
-
/** dithergrad: a soft gradient drawn only in dots (a wavy horizon, a band of light, a swirl, a pinwheel
|
|
317
|
+
/** dithergrad: a soft gradient drawn only in dots (a wavy horizon, a band of light, a swirl, a pinwheel, falling steps, a soft
|
|
318
|
+
* orb or a glowing pill),
|
|
308
319
|
* square dots an ordered dither thins out or round halftone dots that shrink. */
|
|
309
320
|
function dithergrad({ pick, r, accent }) {
|
|
310
321
|
const [ground, colors, ink] = pick(gradientInksOf(accent));
|
|
311
|
-
const shape = pick(['wave', 'wave', 'band', 'swirl', 'pinwheel', 'steps']);
|
|
312
|
-
const mode = shape === 'band' ? pick(['halftone', 'halftone', 'bayer']) : pick(['bayer', 'bayer', 'halftone']);
|
|
322
|
+
const shape = pick(['wave', 'wave', 'band', 'swirl', 'pinwheel', 'steps', 'orb', 'orb', 'pill']);
|
|
323
|
+
const mode = shape === 'band' || shape === 'orb' || shape === 'pill' ? pick(['halftone', 'halftone', 'bayer']) : pick(['bayer', 'bayer', 'halftone']);
|
|
313
324
|
const cfg = {
|
|
314
325
|
colors,
|
|
315
326
|
background: ground,
|
|
@@ -321,9 +332,12 @@ function dithergrad({ pick, r, accent }) {
|
|
|
321
332
|
...(shape === 'swirl' ? { arms: pick([2, 3]), twist: between(r, 1.5, 2.5), soft: 0.5 } : {}),
|
|
322
333
|
...(shape === 'pinwheel' ? { arms: pick([4, 5, 6]), twist: between(r, 1, 2), soft: 0.4 } : {}),
|
|
323
334
|
...(shape === 'steps' ? { level: between(r, 0.18, 0.24), block: pick([5, 6, 7]) } : {}),
|
|
335
|
+
...(shape === 'orb' ? { size: between(r, 0.3, 0.38), soft: between(r, 0.7, 0.95), centre: pick([[0.5, 0.84], [0.28, 0.2], [0.72, 0.8]]) } : {}),
|
|
336
|
+
...(shape === 'pill' ? { size: between(r, 0.24, 0.3), soft: between(r, 0.65, 0.9), angle: pick([90, 90, 75, 105]), centre: pick([[0.5, 0.84], [0.5, 0.18]]) } : {}),
|
|
324
337
|
rate: between(r, 0.04, 0.07),
|
|
325
338
|
offset: offsetOf(r),
|
|
326
|
-
|
|
339
|
+
// an orb or a pill sits off the middle, so its quiet area is smaller and lighter
|
|
340
|
+
quiet: shape === 'orb' || shape === 'pill' ? { radius: 0.34, depth: 0.85 } : { radius: 0.5, depth: 1 },
|
|
327
341
|
};
|
|
328
342
|
return { cfg, ground, ink, still: gradientStill(cfg) };
|
|
329
343
|
}
|
|
@@ -414,6 +428,71 @@ function flutedglow({ pick, r, accent }) {
|
|
|
414
428
|
return { cfg, ground, ink, still: glowStill(cfg, CARD) };
|
|
415
429
|
}
|
|
416
430
|
|
|
431
|
+
/* ---------- Liquid folds (effects-astro's fluidFolds, after the owner's Fluid backgrounds, 2026-11-28) ---------- */
|
|
432
|
+
|
|
433
|
+
/** Liquid folds' colours: ground, [deep, mid, hot], the lockup's ink. */
|
|
434
|
+
const foldInksOf = (accent) => [
|
|
435
|
+
['#050409', ['#1638FF', '#7B2CFF', '#FF4A3D'], '#F4F3EF'], // enamel
|
|
436
|
+
['#030308', ['#0B2A8A', '#3D6BFF', '#FF3D7A'], '#F4F3EF'], // cobalt and rose
|
|
437
|
+
['#060304', ['#5A0A1A', '#FF3D2A', '#FFB347'], '#F4F3EF'], // ember
|
|
438
|
+
['#040507', ['#2A2E3A', '#8C93A6', '#E8ECF4'], '#F4F3EF'], // graphite silk
|
|
439
|
+
['#030806', ['#0E5A35', accent, '#E8FFE0'], '#F4F3EF'], // acid
|
|
440
|
+
];
|
|
441
|
+
|
|
442
|
+
/** fluidfolds: glossy folds of liquid colour on a dark ground, poured enamel or long silk dunes, the lockup in a dimmed
|
|
443
|
+
* middle. */
|
|
444
|
+
function fluidfolds({ pick, r, accent }) {
|
|
445
|
+
const [ground, colors, ink] = pick(foldInksOf(accent));
|
|
446
|
+
const style = pick(['liquid', 'liquid', 'dunes']);
|
|
447
|
+
const cfg = {
|
|
448
|
+
colors,
|
|
449
|
+
background: ground,
|
|
450
|
+
style,
|
|
451
|
+
scale: style === 'liquid' ? between(r, 1.7, 2.4) : between(r, 1.2, 1.6),
|
|
452
|
+
warp: between(r, 0.7, 1.1),
|
|
453
|
+
gloss: between(r, 0.6, 0.9),
|
|
454
|
+
light: pick([-35, -20, 25, 40]),
|
|
455
|
+
hue: between(r, 0.35, 0.7),
|
|
456
|
+
...(style === 'dunes' ? { level: between(r, 0.42, 0.55) } : {}),
|
|
457
|
+
rate: between(r, 0.025, 0.045),
|
|
458
|
+
seed: Math.round(r() * 1000) / 100,
|
|
459
|
+
quiet: { radius: 0.42, depth: 0.55 },
|
|
460
|
+
};
|
|
461
|
+
return { cfg, ground, ink, still: foldsStill(cfg) };
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
/* ---------- Reeded bokeh (effects-astro's flutedBokeh, after the owner's Fluted Glass backgrounds, 2026-11-28) ---------- */
|
|
465
|
+
|
|
466
|
+
/** Reeded bokeh's colours: ground, the lights' colours, the lockup's ink. */
|
|
467
|
+
const bokehInksOf = (accent) => [
|
|
468
|
+
['#050608', ['#FF4A2A', '#FFB347', '#4FC3FF'], '#F4F3EF'], // stage
|
|
469
|
+
['#04060C', ['#2A6BFF', '#FF3D6A', '#7FE3FF'], '#F4F3EF'], // cobalt night
|
|
470
|
+
['#070403', ['#FF6A2A', '#FFD27A', '#FF3D00'], '#F4F3EF'], // amber
|
|
471
|
+
['#030807', ['#1EC98A', '#FF5A3D', '#3DA9FF'], '#F4F3EF'], // signal mix
|
|
472
|
+
['#050605', [accent, '#4FC3FF', '#F4F3EF'], '#F4F3EF'], // acid
|
|
473
|
+
];
|
|
474
|
+
|
|
475
|
+
/** reededbokeh: coloured lights out of focus behind upright reeded glass (a rainbow at each seam) or a wall of glass
|
|
476
|
+
* blocks, drifting slowly. */
|
|
477
|
+
function reededbokeh({ pick, r, accent }) {
|
|
478
|
+
const [ground, colors, ink] = pick(bokehInksOf(accent));
|
|
479
|
+
const mode = pick(['reeds', 'reeds', 'reeds', 'blocks']);
|
|
480
|
+
const cfg = {
|
|
481
|
+
colors,
|
|
482
|
+
background: ground,
|
|
483
|
+
mode,
|
|
484
|
+
flutes: mode === 'blocks' ? pick([7, 8, 9]) : pick([22, 28, 34, 40]),
|
|
485
|
+
squeeze: mode === 'blocks' ? between(r, 0.25, 0.4) : between(r, 0.22, 0.36),
|
|
486
|
+
dispersion: between(r, 0.25, 0.45),
|
|
487
|
+
streak: mode === 'blocks' ? 0.02 : between(r, 0.04, 0.09),
|
|
488
|
+
lights: pick([4, 5, 6]),
|
|
489
|
+
size: between(r, 0.18, 0.26),
|
|
490
|
+
seed: Math.round(r() * 1000) / 10,
|
|
491
|
+
quiet: { radius: 0.4, depth: 0.5 },
|
|
492
|
+
};
|
|
493
|
+
return { cfg, ground, ink, still: bokehStill(cfg, CARD) };
|
|
494
|
+
}
|
|
495
|
+
|
|
417
496
|
/* ---------- the table ---------- */
|
|
418
497
|
|
|
419
498
|
/** The field cards by kind: the effect that draws each (effects-astro's runtime, by its file name), its label, and its
|
|
@@ -430,6 +509,8 @@ export const FIELDS = {
|
|
|
430
509
|
truchet: { effect: 'truchet-field', label: 'Truchet tiles', deal: truchet },
|
|
431
510
|
pixelhorizon: { effect: 'pixel-horizon', label: 'Pixel horizon', deal: pixelhorizon },
|
|
432
511
|
flutedglow: { effect: 'fluted-glow', label: 'Reeded glow', deal: flutedglow },
|
|
512
|
+
fluidfolds: { effect: 'fluid-folds', label: 'Liquid folds', deal: fluidfolds },
|
|
513
|
+
reededbokeh: { effect: 'fluted-bokeh', label: 'Reeded bokeh', deal: reededbokeh },
|
|
433
514
|
};
|
|
434
515
|
|
|
435
516
|
/** Whether a kind is a field card. */
|
package/src/fit.js
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module @logomarks/lookbook/fit
|
|
3
|
+
*
|
|
4
|
+
* Every card's name fits its card, in the browser. A look sets its name's size for a name of usual length; a long name
|
|
5
|
+
* in a wide face (ROSEMARY in Unbounded, KALEIDOSCOPE in Michroma) ran off the card's edge. `fitName` measures the name
|
|
6
|
+
* against its card and, where it would cross the card's edge (less a small margin), sets it smaller until it clears:
|
|
7
|
+
* never clipped, never wrapped, never larger than its look made it. The size it had is kept (`data-fs`), so a name fitted
|
|
8
|
+
* on a small card and shown again in a large one (the expanded view's copy) starts from its look's size each time.
|
|
9
|
+
*
|
|
10
|
+
* `fitNames` fits every name under an element, `fitWatch` keeps them fitted as cards come, change size, or the web fonts
|
|
11
|
+
* load (`liveCards` runs it on the wall it watches). A width-sized name (the terminal's, the editorial's: `data-fit`,
|
|
12
|
+
* sized in CSS from `--chars`) is fitted too, in case its face measures wider than the estimate.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/** The names a card can show. */
|
|
16
|
+
const NAMES = '.wc-name';
|
|
17
|
+
|
|
18
|
+
/** The card a name is on. */
|
|
19
|
+
const cardOf = (el) => el.closest('.wc, .lv-card');
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The room a name may take: its card's box less a margin each side (5% of the card's width, at least 6 px), so a fitted
|
|
23
|
+
* name never touches the edge.
|
|
24
|
+
*
|
|
25
|
+
* @param card The card.
|
|
26
|
+
*/
|
|
27
|
+
function room(card) {
|
|
28
|
+
const r = card.getBoundingClientRect();
|
|
29
|
+
const m = Math.max(6, r.width * 0.05);
|
|
30
|
+
return { left: r.left + m, right: r.right - m };
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Fits one name to its card: back to its look's size first, then, if it would cross the card's edge, smaller by what
|
|
35
|
+
* it crosses (a centred lockup clears by the same measure as a left-aligned one), up to four passes for a face whose
|
|
36
|
+
* width doesn't scale exactly with its size.
|
|
37
|
+
*
|
|
38
|
+
* @param el The name (`.wc-name`).
|
|
39
|
+
* @returns The scale it was set at (1: as its look made it).
|
|
40
|
+
*/
|
|
41
|
+
export function fitName(el) {
|
|
42
|
+
const card = cardOf(el);
|
|
43
|
+
if (!card) return 1;
|
|
44
|
+
// back to its look's size: what it had in its style before any fitting
|
|
45
|
+
if (el.dataset.fs === undefined) el.dataset.fs = el.style.fontSize || '';
|
|
46
|
+
el.style.fontSize = el.dataset.fs;
|
|
47
|
+
const r0 = el.getBoundingClientRect();
|
|
48
|
+
if (!r0.width || !r0.height) return 1; // hidden (a Plain card's name while the look shows, or the reverse)
|
|
49
|
+
const base = parseFloat(getComputedStyle(el).fontSize);
|
|
50
|
+
if (!base) return 1;
|
|
51
|
+
let k = 1;
|
|
52
|
+
for (let pass = 0; pass < 4; pass++) {
|
|
53
|
+
const { left, right } = room(card);
|
|
54
|
+
const r = el.getBoundingClientRect();
|
|
55
|
+
const over = Math.max(0, left - r.left) + Math.max(0, r.right - right);
|
|
56
|
+
if (over < 0.5) break;
|
|
57
|
+
k *= Math.max(0.2, (r.width - over) / r.width);
|
|
58
|
+
el.style.fontSize = `${(base * k).toFixed(2)}px`;
|
|
59
|
+
}
|
|
60
|
+
return k;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Fits every name under `scope`.
|
|
65
|
+
*
|
|
66
|
+
* @param scope Where to look (the document, a wall, a card).
|
|
67
|
+
*/
|
|
68
|
+
export function fitNames(scope = document) {
|
|
69
|
+
const own = scope instanceof Element && scope.matches(NAMES) ? [scope] : [];
|
|
70
|
+
for (const el of [...own, ...scope.querySelectorAll(NAMES)]) fitName(el);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Keeps the names under `scope` fitted: now, when the web fonts finish loading, when a card changes size, and when
|
|
75
|
+
* cards are added under the `observe` elements.
|
|
76
|
+
*
|
|
77
|
+
* @param scope Where the cards are.
|
|
78
|
+
* @param options `observe`: elements whose new cards are fitted as they come (the wall, the expanded view).
|
|
79
|
+
* @returns Stops watching.
|
|
80
|
+
*/
|
|
81
|
+
export function fitWatch(scope = document, options = {}) {
|
|
82
|
+
const sizes = new WeakMap();
|
|
83
|
+
const ro =
|
|
84
|
+
typeof ResizeObserver === 'function'
|
|
85
|
+
? new ResizeObserver((entries) => {
|
|
86
|
+
for (const e of entries) {
|
|
87
|
+
const w = Math.round(e.contentRect.width);
|
|
88
|
+
if (sizes.get(e.target) === w) continue;
|
|
89
|
+
sizes.set(e.target, w);
|
|
90
|
+
fitNames(e.target);
|
|
91
|
+
}
|
|
92
|
+
})
|
|
93
|
+
: null;
|
|
94
|
+
const seen = new WeakSet();
|
|
95
|
+
const add = (root) => {
|
|
96
|
+
for (const card of root.querySelectorAll('.wc, .lv-card')) {
|
|
97
|
+
if (seen.has(card)) continue;
|
|
98
|
+
seen.add(card);
|
|
99
|
+
ro?.observe(card);
|
|
100
|
+
fitNames(card);
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
add(scope);
|
|
104
|
+
const fonts = typeof document !== 'undefined' ? document.fonts : undefined;
|
|
105
|
+
const again = () => fitNames(scope);
|
|
106
|
+
fonts?.ready.then(again).catch(() => {});
|
|
107
|
+
fonts?.addEventListener?.('loadingdone', again);
|
|
108
|
+
const mos = (options.observe ?? []).map((el) => {
|
|
109
|
+
const mo = new MutationObserver(() => add(el));
|
|
110
|
+
mo.observe(el, { childList: true, subtree: true });
|
|
111
|
+
return mo;
|
|
112
|
+
});
|
|
113
|
+
return () => {
|
|
114
|
+
ro?.disconnect();
|
|
115
|
+
for (const mo of mos) mo.disconnect();
|
|
116
|
+
fonts?.removeEventListener?.('loadingdone', again);
|
|
117
|
+
};
|
|
118
|
+
}
|
package/src/live.d.ts
CHANGED
|
@@ -85,10 +85,12 @@ export type LiveOptions = {
|
|
|
85
85
|
margin?: string;
|
|
86
86
|
/** Cards whose motion never waits its turn (the expanded view's, `.lv-card`). */
|
|
87
87
|
always?: (card: HTMLElement) => boolean;
|
|
88
|
+
/** Keep every card's name fitted to its card (`fitWatch`; true). */
|
|
89
|
+
fit?: boolean;
|
|
88
90
|
};
|
|
89
91
|
/** The watcher `liveCards` returns. */
|
|
90
92
|
export type LiveCards = {
|
|
91
|
-
/** Watches cards not yet watched; lets go of any that left the page (or that Plain hid). */
|
|
93
|
+
/** Watches cards not yet watched; lets go of any that left the page (or that Plain hid); fits the names again. */
|
|
92
94
|
watch: () => void;
|
|
93
95
|
/** Starts the matching cards again (the smoke, when the theme changes). */
|
|
94
96
|
restart: (match: (card: HTMLElement) => boolean) => void;
|
|
@@ -107,3 +109,21 @@ export declare function liveCards(options?: LiveOptions): LiveCards;
|
|
|
107
109
|
* @returns Stops listening.
|
|
108
110
|
*/
|
|
109
111
|
export declare function holoPointer(target?: Window | HTMLElement): Stop;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Fits one card name (`.wc-name`) to its card: back to its look's size, then smaller where it would cross the card's
|
|
115
|
+
* edge less a 5% margin; never clipped, never wrapped, never larger than its look made it.
|
|
116
|
+
*
|
|
117
|
+
* @param el The name.
|
|
118
|
+
* @returns The scale it was set at (1: as its look made it).
|
|
119
|
+
*/
|
|
120
|
+
export declare function fitName(el: HTMLElement): number;
|
|
121
|
+
/** Fits every card name under `scope` (the document). */
|
|
122
|
+
export declare function fitNames(scope?: ParentNode): void;
|
|
123
|
+
/**
|
|
124
|
+
* Keeps every card name under `scope` fitted: now, when the web fonts load, when a card changes size, and when cards
|
|
125
|
+
* are added under `observe`.
|
|
126
|
+
*
|
|
127
|
+
* @returns Stops watching.
|
|
128
|
+
*/
|
|
129
|
+
export declare function fitWatch(scope?: ParentNode, options?: { observe?: Element[] }): Stop;
|
package/src/live.js
CHANGED
|
@@ -26,6 +26,8 @@ const FIELD_EFFECTS = {
|
|
|
26
26
|
'truchet-field': () => import('@arraypress/effects-astro/runtime/truchet-field').then((m) => m.truchetField),
|
|
27
27
|
'pixel-horizon': () => import('@arraypress/effects-astro/runtime/pixel-horizon').then((m) => m.pixelHorizon),
|
|
28
28
|
'fluted-glow': () => import('@arraypress/effects-astro/runtime/fluted-glow').then((m) => m.flutedGlow),
|
|
29
|
+
'fluid-folds': () => import('@arraypress/effects-astro/runtime/fluid-folds').then((m) => m.fluidFolds),
|
|
30
|
+
'fluted-bokeh': () => import('@arraypress/effects-astro/runtime/fluted-bokeh').then((m) => m.flutedBokeh),
|
|
29
31
|
// the glass cards (./glass.js): the mark itself in glass
|
|
30
32
|
'glass-drop': () => import('@arraypress/effects-astro/runtime/glass-drop').then((m) => m.glassDrop),
|
|
31
33
|
'glass-stack': () => import('@arraypress/effects-astro/runtime/glass-stack').then((m) => m.glassStack),
|
|
@@ -67,6 +69,10 @@ function field(card, config) {
|
|
|
67
69
|
};
|
|
68
70
|
}
|
|
69
71
|
import { whenNear } from '@arraypress/effects-astro/runtime/near';
|
|
72
|
+
import { fitNames, fitWatch } from './fit.js';
|
|
73
|
+
|
|
74
|
+
/** Every card's name fitted to its card (./fit.js): `fitName`, `fitNames`, `fitWatch`. */
|
|
75
|
+
export { fitName, fitNames, fitWatch } from './fit.js';
|
|
70
76
|
import { budget } from '@arraypress/effects-astro/runtime/budget';
|
|
71
77
|
|
|
72
78
|
/** The smoke's greys: pale on a dark ground, dark on white (Ink's `dark`). */
|
|
@@ -198,7 +204,16 @@ export function liveCards(options = {}) {
|
|
|
198
204
|
};
|
|
199
205
|
for (const el of options.observe ?? []) new MutationObserver(watch).observe(el, { childList: true, subtree: true });
|
|
200
206
|
watch();
|
|
201
|
-
|
|
207
|
+
// every name fitted to its card, as cards come and change size and when the fonts load (`fit: false` leaves them)
|
|
208
|
+
if (options.fit !== false) fitWatch(scope, { observe: options.observe ?? [] });
|
|
209
|
+
return {
|
|
210
|
+
watch: () => {
|
|
211
|
+
watch();
|
|
212
|
+
// a style change (Plain on or off, a name typed) shows names that were hidden: fit those too
|
|
213
|
+
if (options.fit !== false) fitNames(scope);
|
|
214
|
+
},
|
|
215
|
+
restart,
|
|
216
|
+
};
|
|
202
217
|
}
|
|
203
218
|
|
|
204
219
|
/**
|
package/src/looks/index.d.ts
CHANGED
|
@@ -71,6 +71,8 @@ export declare const LOOK_KINDS: readonly [
|
|
|
71
71
|
'editorial',
|
|
72
72
|
'brandsheet',
|
|
73
73
|
'overprint',
|
|
74
|
+
'brutal',
|
|
75
|
+
'sortglitch',
|
|
74
76
|
];
|
|
75
77
|
/** A drawn look's kind. */
|
|
76
78
|
export type LookKind = (typeof LOOK_KINDS)[number];
|
|
@@ -165,8 +167,9 @@ export declare const ACID: {
|
|
|
165
167
|
*/
|
|
166
168
|
export declare function wideEms(name: string): number;
|
|
167
169
|
/**
|
|
168
|
-
* Refits a name
|
|
169
|
-
*
|
|
170
|
+
* Refits a name after its text changes (a name typed in the Lookbook's toolbar): one sized from its width (`data-fit`:
|
|
171
|
+
* the terminal's, the editorial's, the brutal poster's) is sized again, the glitch card's slices are cut again, and every
|
|
172
|
+
* name is fitted to its card.
|
|
170
173
|
*
|
|
171
174
|
* @param el The name's element.
|
|
172
175
|
*/
|
package/src/looks/index.js
CHANGED
|
@@ -18,12 +18,17 @@
|
|
|
18
18
|
import { escapeHtml } from '@arraypress/text';
|
|
19
19
|
import { hash, rng } from '@arraypress/og-image/palette';
|
|
20
20
|
import { markBox, markCells, heatField } from '../marks.js';
|
|
21
|
-
import { f1, pad2, withLength, def, use, mk, meta, nameB, art, around, framed, pickOf, markUrl } from './kit.js';
|
|
21
|
+
import { f1, pad2, withLength, def, use, mk, meta, nameB, art, around, framed, pickOf, markUrl, wideEms } from './kit.js';
|
|
22
22
|
import { MODERN, retargetModern } from './modern.js';
|
|
23
23
|
import { BLOOM } from './bloom.js';
|
|
24
24
|
import { STREET, retargetStreet } from './street.js';
|
|
25
25
|
import { CLUB } from './club.js';
|
|
26
26
|
import { STUDIO, sansEms } from './studio.js';
|
|
27
|
+
import { STARK, slices } from './stark.js';
|
|
28
|
+
import { fitName } from '../fit.js';
|
|
29
|
+
|
|
30
|
+
/** A name's width in Michroma capitals, in ems (./kit.js): the terminal's and the brutal poster's names are sized from it. */
|
|
31
|
+
export { wideEms };
|
|
27
32
|
|
|
28
33
|
/** The mark as a CSS background image (./kit.js). */
|
|
29
34
|
export { markUrl };
|
|
@@ -85,6 +90,9 @@ export const LOOK_KINDS = [
|
|
|
85
90
|
'editorial',
|
|
86
91
|
'brandsheet',
|
|
87
92
|
'overprint',
|
|
93
|
+
// the stark set, on the 2026-11-28 photos (./stark.js)
|
|
94
|
+
'brutal',
|
|
95
|
+
'sortglitch',
|
|
88
96
|
];
|
|
89
97
|
|
|
90
98
|
/** The animated ones (marked `data-anim`, started on screen). */
|
|
@@ -118,6 +126,7 @@ const ANIMATED = new Set([
|
|
|
118
126
|
'clubpulse',
|
|
119
127
|
'frost',
|
|
120
128
|
'spectral',
|
|
129
|
+
'sortglitch',
|
|
121
130
|
]);
|
|
122
131
|
|
|
123
132
|
/**
|
|
@@ -155,6 +164,7 @@ export const LOOK_LOOP = {
|
|
|
155
164
|
clubpulse: { cycle: 8, speed: 1.4 }, // the mark fades up, four light pulses, it fades: 5.7 s
|
|
156
165
|
frost: { cycle: 12, speed: 2 }, // the three lights drift out and back: 6 s
|
|
157
166
|
spectral: { cycle: 10, speed: 2 }, // the spectrum slides one whole tile: 5 s
|
|
167
|
+
sortglitch: { cycle: 5, speed: 1 }, // the slices hold, jump twice, settle: 5 s
|
|
158
168
|
};
|
|
159
169
|
|
|
160
170
|
/** How often each look is dealt, against the older looks' weights (`WEIGHTS`: photo 3, gradient 3, mono 2 … crop 1, 23
|
|
@@ -207,6 +217,8 @@ export const LOOK_WEIGHTS = {
|
|
|
207
217
|
editorial: 0.4,
|
|
208
218
|
brandsheet: 0.4,
|
|
209
219
|
overprint: 0.4,
|
|
220
|
+
brutal: 0,
|
|
221
|
+
sortglitch: 0,
|
|
210
222
|
};
|
|
211
223
|
|
|
212
224
|
/** Each look's card shape (width / height). */
|
|
@@ -257,6 +269,8 @@ export const LOOK_RATIO = {
|
|
|
257
269
|
editorial: '4 / 5',
|
|
258
270
|
brandsheet: '4 / 5',
|
|
259
271
|
overprint: '1 / 1',
|
|
272
|
+
brutal: '4 / 5',
|
|
273
|
+
sortglitch: '4 / 5',
|
|
260
274
|
};
|
|
261
275
|
|
|
262
276
|
/** Names for the expanded view's background label. */
|
|
@@ -307,6 +321,8 @@ export const LOOK_LABEL = {
|
|
|
307
321
|
editorial: 'Editorial',
|
|
308
322
|
brandsheet: 'Brand sheet',
|
|
309
323
|
overprint: 'Overprint',
|
|
324
|
+
brutal: 'Brutalist poster',
|
|
325
|
+
sortglitch: 'Glitch card',
|
|
310
326
|
};
|
|
311
327
|
|
|
312
328
|
/* ---------- the looks ---------- */
|
|
@@ -817,7 +833,7 @@ function longshadow(c) {
|
|
|
817
833
|
/** The acid set's colours: lime, teal, near-black. */
|
|
818
834
|
export const ACID = { lime: '#c6f432', teal: '#0f8b8d', black: '#0b0f0c' };
|
|
819
835
|
/** Portraits among the wall's photos (the rest are figures at a distance and helmets). */
|
|
820
|
-
const PORTRAITS = /\/(modern|y2k|red-bob|teal-shades|violet-shades|pink-holo|blue-braids)-?\d*\.webp$/;
|
|
836
|
+
const PORTRAITS = /\/(modern|y2k|red-bob|teal-shades|violet-shades|pink-holo|blue-braids|rimlight|dithered|offfocus)-?\d*\.webp$/;
|
|
821
837
|
|
|
822
838
|
/** acidmap: a portrait, black and white, gradient-mapped near-black → teal → lime (an SVG filter on the photo); the mark
|
|
823
839
|
* big in white or lime, the name small in wide-tracked capitals, one line of tight copy. */
|
|
@@ -890,30 +906,25 @@ function outlinewall(c) {
|
|
|
890
906
|
|
|
891
907
|
/* ---------- the terminal set: a crypto / HUD board in the accent (acid lime) on black ---------- */
|
|
892
908
|
|
|
893
|
-
/** Michroma's capitals, in ems (measured): most are about 1, M and W far wider, I a sliver. */
|
|
894
|
-
const WIDE = { M: 1.37, W: 1.63, N: 1.13, I: 0.28, ' ': 0.28, E: 0.88, F: 0.84, J: 0.84, L: 0.81, T: 0.94, '&': 1.19, '-': 0.5 };
|
|
895
|
-
|
|
896
|
-
/**
|
|
897
|
-
* A name's width in ems, set in Michroma capitals (the terminal's name is sized to its measure from this; a count of
|
|
898
|
-
* letters cut MANSARD off at the card's edge).
|
|
899
|
-
*
|
|
900
|
-
* @param name The name.
|
|
901
|
-
*/
|
|
902
|
-
export function wideEms(name) {
|
|
903
|
-
let w = 0;
|
|
904
|
-
for (const ch of name.toUpperCase()) w += WIDE[ch] ?? 1.04;
|
|
905
|
-
return Math.max(4, +w.toFixed(2));
|
|
906
|
-
}
|
|
907
|
-
|
|
908
909
|
/**
|
|
909
|
-
* Refits a name
|
|
910
|
-
*
|
|
910
|
+
* Refits a name after its text changes (a name typed in the Lookbook's toolbar): one sized from its width (`data-fit`:
|
|
911
|
+
* the terminal's, the editorial's, the brutal poster's) is sized again, the glitch card's slices are cut again, and every
|
|
912
|
+
* name is fitted to its card (../fit.js).
|
|
911
913
|
*
|
|
912
914
|
* @param el The name's element.
|
|
913
915
|
*/
|
|
914
916
|
export function refit(el) {
|
|
917
|
+
const text = el.dataset.slices ? (el.firstChild?.nodeType === 3 ? el.firstChild.textContent : el.textContent) ?? '' : (el.textContent ?? '');
|
|
915
918
|
const fit = el.dataset.fit;
|
|
916
|
-
if (fit) el.style.setProperty('--chars', String((fit === 'wide' ? wideEms : sansEms)(
|
|
919
|
+
if (fit) el.style.setProperty('--chars', String((fit === 'wide' ? wideEms : sansEms)(text)));
|
|
920
|
+
// the glitch card's slices, cut again for the new name (setting the name's text took them away)
|
|
921
|
+
if (el.dataset.slices) {
|
|
922
|
+
el.textContent = text;
|
|
923
|
+
el.insertAdjacentHTML('beforeend', slices(el.dataset.slices, text));
|
|
924
|
+
el.style.setProperty('--chars', String(sansEms(text.toUpperCase())));
|
|
925
|
+
}
|
|
926
|
+
// and fitted to its card
|
|
927
|
+
if (typeof window !== 'undefined') fitName(el);
|
|
917
928
|
}
|
|
918
929
|
|
|
919
930
|
/** terminal: a HUD on black: status lines typing in one by one in lime mono, a lime panel with chamfered corners,
|
|
@@ -1008,6 +1019,7 @@ const LOOKS = {
|
|
|
1008
1019
|
...STREET,
|
|
1009
1020
|
...CLUB,
|
|
1010
1021
|
...STUDIO,
|
|
1022
|
+
...STARK,
|
|
1011
1023
|
};
|
|
1012
1024
|
|
|
1013
1025
|
/** Whether a kind is one of the drawn looks. */
|
package/src/looks/kit.d.ts
CHANGED
|
@@ -70,3 +70,11 @@ export declare const pickOf: (c: LookCtx) => <T>(xs: readonly T[]) => T;
|
|
|
70
70
|
* its optical size, capped here (a background can't read `--mk-scale`): no taller than the 448 fit, so it stays clear of
|
|
71
71
|
* the name under it. */
|
|
72
72
|
export declare function markUrl(paths: string, fill: string): string;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* A name's width in ems, set in Michroma capitals (the terminal's and the brutal poster's names are sized to their
|
|
76
|
+
* measure from this).
|
|
77
|
+
*
|
|
78
|
+
* @param name The name.
|
|
79
|
+
*/
|
|
80
|
+
export declare function wideEms(name: string): number;
|
package/src/looks/kit.js
CHANGED
|
@@ -52,3 +52,19 @@ export function markUrl(paths, fill) {
|
|
|
52
52
|
const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 500" preserveAspectRatio="none"><g fill="${fill}" transform="translate(200 250) scale(${(0.4844 * k).toFixed(4)}) translate(-256 -256)">${paths}</g></svg>`;
|
|
53
53
|
return `url('data:image/svg+xml,${encodeURIComponent(svg)}')`;
|
|
54
54
|
}
|
|
55
|
+
|
|
56
|
+
/** Michroma's capitals, in ems (measured): most are about 1, M and W far wider, I a sliver. */
|
|
57
|
+
const WIDE = { M: 1.37, W: 1.63, N: 1.13, I: 0.28, ' ': 0.28, E: 0.88, F: 0.84, J: 0.84, L: 0.81, T: 0.94, '&': 1.19, '-': 0.5 };
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* A name's width in ems, set in Michroma capitals (the terminal's name is sized to its measure from this; a count of
|
|
61
|
+
* letters cut MANSARD off at the card's edge).
|
|
62
|
+
*
|
|
63
|
+
* @param name The name.
|
|
64
|
+
*/
|
|
65
|
+
export function wideEms(name) {
|
|
66
|
+
let w = 0;
|
|
67
|
+
for (const ch of name.toUpperCase()) w += WIDE[ch] ?? 1.04;
|
|
68
|
+
return Math.max(4, +w.toFixed(2));
|
|
69
|
+
}
|
|
70
|
+
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module @logomarks/lookbook/looks/stark
|
|
3
|
+
*
|
|
4
|
+
* The Lookbook's stark set (2026-11-28): brutal (a Swiss poster on the brutalist concrete photos, the name in wide
|
|
5
|
+
* capitals the full measure) and sortglitch (a pixel-sorted portrait, the name cut into level slices pushed aside).
|
|
6
|
+
*/
|
|
7
|
+
import { type LookCtx, type LookOut } from './kit.js';
|
|
8
|
+
/**
|
|
9
|
+
* A name's slices for the glitch card, as `<i>` copies drawn from `data-t` by CSS.
|
|
10
|
+
*
|
|
11
|
+
* @param spec `y0,y1,dx,ink;…` (percent, percent, hundredths of an em, 1 for the accent).
|
|
12
|
+
* @param text The name.
|
|
13
|
+
*/
|
|
14
|
+
export declare function slices(spec: string, text: string): string;
|
|
15
|
+
/** The stark set's looks. */
|
|
16
|
+
export declare const STARK: {
|
|
17
|
+
brutal: (c: LookCtx) => LookOut;
|
|
18
|
+
sortglitch: (c: LookCtx) => LookOut;
|
|
19
|
+
};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module @logomarks/lookbook/looks/stark
|
|
3
|
+
*
|
|
4
|
+
* The Lookbook's stark set (2026-11-28; the owner's new Dropbox graphics, "all three"): brutal and sortglitch, each on
|
|
5
|
+
* one of the new photo series. Same rules as ./index.js (pure HTML strings from the card's seeded random, per-card values
|
|
6
|
+
* as custom properties in `style`, ids under the card's uid, motion in CSS only and only while `is-live`, the still
|
|
7
|
+
* styles the final frame); each look's styles are a block at the end of wall-looks.css.
|
|
8
|
+
*
|
|
9
|
+
* - brutal: a Swiss poster on the brutalist concrete photos (`brutal-*`, the glass set): the photo dark and grey, the
|
|
10
|
+
* mark big in white top left, the name the full measure in a wide face (Michroma, sized from its width like the
|
|
11
|
+
* terminal's), hairlines and small words. Still.
|
|
12
|
+
* - sortglitch: a pixel-sorted portrait (`pixelsort-*`, the photos), the mark clean in white, the name under it cut into
|
|
13
|
+
* level slices pushed sideways like the photo's sort bands; while live the slices jump now and then and settle back.
|
|
14
|
+
* The slices are copies of the name drawn by `::before` from `data-t` (so the name's text is still one word, for the
|
|
15
|
+
* toolbar and screen readers); `slices()` draws them again for a name typed in the toolbar (`refit`).
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { escapeHtml } from '@arraypress/text';
|
|
19
|
+
import { def, meta, mk, pad2, pickOf, wideEms } from './kit.js';
|
|
20
|
+
import { sansEms } from './studio.js';
|
|
21
|
+
|
|
22
|
+
/** The brutalist concrete photos, among the glass backgrounds. */
|
|
23
|
+
const BRUTAL = /\/brutal-\d+\.webp$/;
|
|
24
|
+
/** The pixel-sorted portraits, among the photos. */
|
|
25
|
+
const PIXELSORT = /\/pixelsort-\d+\.webp$/;
|
|
26
|
+
|
|
27
|
+
/** The made-up brand's web address. */
|
|
28
|
+
const host = (c) => `www.${c.name.toLowerCase().replace(/[^a-z0-9]/g, '')}${c.tld}`;
|
|
29
|
+
|
|
30
|
+
/** brutal: the concrete photo in grey, darkened so white reads on it; the mark big top left; the name in wide capitals
|
|
31
|
+
* the full measure at the foot over a hairline, the trade and the address under it, two small words in the top corners. */
|
|
32
|
+
function brutal(c) {
|
|
33
|
+
const no = pad2(1 + Math.floor(c.r() * 48));
|
|
34
|
+
return {
|
|
35
|
+
style: ';--bg:#111;--fg:#fff',
|
|
36
|
+
attrs: '',
|
|
37
|
+
inner:
|
|
38
|
+
`<svg class="wx-def" aria-hidden="true"><defs>${def(c)}</defs></svg>` +
|
|
39
|
+
`<img src="${c.glass(BRUTAL)}" alt="" loading="lazy" decoding="async" />` +
|
|
40
|
+
`<svg class="wx-art wx-brmark" viewBox="0 0 512 512" aria-hidden="true">${mk(`<use href="#${c.uid}-m" />`)}</svg>` +
|
|
41
|
+
`<span class="wx-brname"><b class="wc-name" data-fit="wide" style="--chars:${wideEms(c.name)}">${escapeHtml(c.name)}</b></span>` +
|
|
42
|
+
`<span class="wx-brfoot"><i>${escapeHtml(c.line)}</i><i>${escapeHtml(host(c))}</i></span>` +
|
|
43
|
+
meta('tr', `Nº ${no}`),
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* A name's slices for the glitch card: level bands down it, each pushed sideways (`--dx`, hundredths of an em), one now
|
|
49
|
+
* and then in the accent, as `<i>` copies drawn from `data-t` by CSS. The spec (`data-slices` on the name) keeps the cuts
|
|
50
|
+
* so the toolbar's name is cut the same way.
|
|
51
|
+
*
|
|
52
|
+
* @param spec `y0,y1,dx,ink;…` (percent, percent, hundredths of an em, 1 for the accent).
|
|
53
|
+
* @param text The name.
|
|
54
|
+
*/
|
|
55
|
+
export function slices(spec, text) {
|
|
56
|
+
const t = escapeHtml(text);
|
|
57
|
+
return spec
|
|
58
|
+
.split(';')
|
|
59
|
+
.filter(Boolean)
|
|
60
|
+
.map((s, k) => {
|
|
61
|
+
const [y0, y1, dx, ink] = s.split(',').map(Number);
|
|
62
|
+
return `<i class="wx-sgs${ink ? ' is-ink' : ''}" data-t="${t}" aria-hidden="true" style="--y0:${y0}%;--y1:${y1}%;--dx:${dx};--k:${k}"></i>`;
|
|
63
|
+
})
|
|
64
|
+
.join('');
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** A seeded cut of the name into four or five bands: one pushed well aside (a sort band), one or two nudged, the rest
|
|
68
|
+
* where they are, so the name still reads at a glance; one band in the accent. */
|
|
69
|
+
function cut(r) {
|
|
70
|
+
const n = 4 + Math.floor(r() * 2);
|
|
71
|
+
const ys = [0];
|
|
72
|
+
for (let k = 1; k < n; k++) ys.push(Math.round((k / n) * 100 + (r() - 0.5) * (50 / n)));
|
|
73
|
+
ys.push(100);
|
|
74
|
+
// the big push is never the top or bottom band (a cut through the middle of the letters reads as a glitch; a lip
|
|
75
|
+
// pushed off the top or the foot reads as a misprint)
|
|
76
|
+
const big = 1 + Math.floor(r() * (n - 2));
|
|
77
|
+
const ink = Math.floor(r() * n);
|
|
78
|
+
return ys
|
|
79
|
+
.slice(0, -1)
|
|
80
|
+
.map((y0, k) => {
|
|
81
|
+
const side = r() < 0.5 ? -1 : 1;
|
|
82
|
+
const dx = k === big ? side * (5 + Math.round(r() * 3)) : r() < 0.6 ? 0 : side * (1 + Math.round(r() * 1));
|
|
83
|
+
return `${y0},${ys[k + 1]},${dx},${k === ink ? 1 : 0}`;
|
|
84
|
+
})
|
|
85
|
+
.join(';');
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** sortglitch: a pixel-sorted portrait, a little darker at the foot; the mark clean in white; the name under it cut
|
|
89
|
+
* into level slices pushed aside (one in the accent), jumping now and then while live; a line of copy, a corner word. */
|
|
90
|
+
function sortglitch(c) {
|
|
91
|
+
const spec = cut(c.r);
|
|
92
|
+
const pick = pickOf(c);
|
|
93
|
+
const ink = pick([c.accent, '#ff2e88', '#5ce1ff', '#ff5a1f']);
|
|
94
|
+
return {
|
|
95
|
+
style: `;--bg:#0b0b0c;--fg:#fff;--gl:${ink};--d:-${(c.r() * 4).toFixed(2)}s`,
|
|
96
|
+
attrs: '',
|
|
97
|
+
inner:
|
|
98
|
+
`<svg class="wx-def" aria-hidden="true"><defs>${def(c)}</defs></svg>` +
|
|
99
|
+
`<img src="${c.photo(PIXELSORT)}" alt="" loading="lazy" decoding="async" />` +
|
|
100
|
+
`<svg class="wx-art wx-sgmark" viewBox="0 0 512 512" aria-hidden="true">${mk(`<use href="#${c.uid}-m" />`)}</svg>` +
|
|
101
|
+
`<span class="wx-sgword"><b class="wc-name" data-slices="${spec}" style="${c.type};--chars:${sansEms(c.name.toUpperCase())}">${escapeHtml(c.name)}${slices(spec, c.name)}</b><i>${escapeHtml(c.line)}</i></span>` +
|
|
102
|
+
meta('tl', `SORT/${pad2(1 + Math.floor(c.r() * 99))}`),
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export const STARK = { brutal, sortglitch };
|
|
@@ -4898,3 +4898,191 @@
|
|
|
4898
4898
|
.has-ink .wc-overprint {
|
|
4899
4899
|
--b: var(--lb-ink) !important;
|
|
4900
4900
|
}
|
|
4901
|
+
|
|
4902
|
+
/* ---------- the stark set (../looks/stark.js), on the 2026-11-28 photos ---------- */
|
|
4903
|
+
|
|
4904
|
+
/* brutal: a Swiss poster on the brutalist concrete photos: the photo grey and dark, the mark big in white top left (it
|
|
4905
|
+
grows right and down, away from the edges), the name in wide capitals the full measure over a hairline (Michroma,
|
|
4906
|
+
sized from its width, `--chars`: wideEms), the trade and the address under it, an issue number top right. Still. */
|
|
4907
|
+
.wc-brutal {
|
|
4908
|
+
--mk-o: 32px 32px;
|
|
4909
|
+
--mk-max: 1.2;
|
|
4910
|
+
color: #fff;
|
|
4911
|
+
}
|
|
4912
|
+
|
|
4913
|
+
.wc-brutal > img {
|
|
4914
|
+
filter: grayscale(1) contrast(1.2) brightness(0.56);
|
|
4915
|
+
}
|
|
4916
|
+
|
|
4917
|
+
.wc-brutal::after {
|
|
4918
|
+
content: '';
|
|
4919
|
+
position: absolute;
|
|
4920
|
+
inset: 0;
|
|
4921
|
+
z-index: -1;
|
|
4922
|
+
background: linear-gradient(180deg, rgb(0 0 0 / 0.32), transparent 34%, transparent 52%, rgb(0 0 0 / 0.62));
|
|
4923
|
+
}
|
|
4924
|
+
|
|
4925
|
+
.wc-brutal .wx-brmark {
|
|
4926
|
+
inset: 9% auto auto 7%;
|
|
4927
|
+
width: 40%;
|
|
4928
|
+
height: auto;
|
|
4929
|
+
aspect-ratio: 1;
|
|
4930
|
+
fill: #fff;
|
|
4931
|
+
}
|
|
4932
|
+
|
|
4933
|
+
.wx-brname {
|
|
4934
|
+
position: absolute;
|
|
4935
|
+
right: 7%;
|
|
4936
|
+
bottom: 15%;
|
|
4937
|
+
left: 7%;
|
|
4938
|
+
z-index: 2;
|
|
4939
|
+
padding-top: 0.6em;
|
|
4940
|
+
border-top: 1px solid rgb(255 255 255 / 0.6);
|
|
4941
|
+
container-type: inline-size;
|
|
4942
|
+
}
|
|
4943
|
+
|
|
4944
|
+
.wx .wx-brname b {
|
|
4945
|
+
display: block;
|
|
4946
|
+
font-family: 'Michroma', sans-serif;
|
|
4947
|
+
font-size: min(3.4em, calc(100cqi / var(--chars) / 1.02));
|
|
4948
|
+
font-weight: 400;
|
|
4949
|
+
letter-spacing: 0;
|
|
4950
|
+
line-height: 1;
|
|
4951
|
+
text-transform: uppercase;
|
|
4952
|
+
}
|
|
4953
|
+
|
|
4954
|
+
.wx-brfoot {
|
|
4955
|
+
position: absolute;
|
|
4956
|
+
right: 7%;
|
|
4957
|
+
bottom: 7%;
|
|
4958
|
+
left: 7%;
|
|
4959
|
+
z-index: 2;
|
|
4960
|
+
display: flex;
|
|
4961
|
+
justify-content: space-between;
|
|
4962
|
+
gap: 1em;
|
|
4963
|
+
font-family: 'JetBrains Mono Variable', ui-monospace, monospace;
|
|
4964
|
+
font-size: 0.58em;
|
|
4965
|
+
font-weight: 500;
|
|
4966
|
+
letter-spacing: 0.06em;
|
|
4967
|
+
text-transform: uppercase;
|
|
4968
|
+
white-space: nowrap;
|
|
4969
|
+
opacity: 0.8;
|
|
4970
|
+
}
|
|
4971
|
+
|
|
4972
|
+
/* sortglitch: a pixel-sorted portrait, darker at the foot; the mark clean in white; the name cut into level slices
|
|
4973
|
+
pushed aside like the photo's sort bands (copies drawn from data-t by ::before, each clipped to its band; one in the
|
|
4974
|
+
accent), the name's own text clear under them for its measure and for screen readers. While live the slices jump
|
|
4975
|
+
twice and settle back to where the still shows them. */
|
|
4976
|
+
.wc-sortglitch {
|
|
4977
|
+
--mk-max: 1.2;
|
|
4978
|
+
color: #fff;
|
|
4979
|
+
}
|
|
4980
|
+
|
|
4981
|
+
.wc-sortglitch > img {
|
|
4982
|
+
filter: brightness(0.86) contrast(1.06);
|
|
4983
|
+
}
|
|
4984
|
+
|
|
4985
|
+
.wc-sortglitch::after {
|
|
4986
|
+
content: '';
|
|
4987
|
+
position: absolute;
|
|
4988
|
+
inset: 0;
|
|
4989
|
+
z-index: -1;
|
|
4990
|
+
background: linear-gradient(180deg, transparent 45%, rgb(0 0 0 / 0.66));
|
|
4991
|
+
}
|
|
4992
|
+
|
|
4993
|
+
.wc-sortglitch .wx-sgmark {
|
|
4994
|
+
inset: 11% auto auto 50%;
|
|
4995
|
+
width: 44%;
|
|
4996
|
+
height: auto;
|
|
4997
|
+
aspect-ratio: 1;
|
|
4998
|
+
fill: #fff;
|
|
4999
|
+
translate: -50% 0;
|
|
5000
|
+
filter: drop-shadow(0 6px 24px rgb(0 0 0 / 0.35));
|
|
5001
|
+
}
|
|
5002
|
+
|
|
5003
|
+
.wx-sgword {
|
|
5004
|
+
position: absolute;
|
|
5005
|
+
right: 6%;
|
|
5006
|
+
bottom: 8%;
|
|
5007
|
+
left: 6%;
|
|
5008
|
+
z-index: 2;
|
|
5009
|
+
display: grid;
|
|
5010
|
+
justify-items: center;
|
|
5011
|
+
gap: 0.55em;
|
|
5012
|
+
text-align: center;
|
|
5013
|
+
container-type: inline-size;
|
|
5014
|
+
}
|
|
5015
|
+
|
|
5016
|
+
.wx .wx-sgword b {
|
|
5017
|
+
position: relative;
|
|
5018
|
+
display: inline-block;
|
|
5019
|
+
font-size: min(4.2em, calc(88cqi / var(--chars)));
|
|
5020
|
+
line-height: 1;
|
|
5021
|
+
color: transparent;
|
|
5022
|
+
}
|
|
5023
|
+
|
|
5024
|
+
.wx-sgs {
|
|
5025
|
+
position: absolute;
|
|
5026
|
+
inset: 0;
|
|
5027
|
+
color: #fff;
|
|
5028
|
+
text-align: left;
|
|
5029
|
+
clip-path: inset(var(--y0) 0 calc(100% - var(--y1)) 0);
|
|
5030
|
+
transform: translateX(calc(var(--dx) * 0.01em));
|
|
5031
|
+
pointer-events: none;
|
|
5032
|
+
}
|
|
5033
|
+
|
|
5034
|
+
.wx-sgs::before {
|
|
5035
|
+
content: attr(data-t);
|
|
5036
|
+
}
|
|
5037
|
+
|
|
5038
|
+
.wx-sgs.is-ink {
|
|
5039
|
+
color: var(--gl);
|
|
5040
|
+
}
|
|
5041
|
+
|
|
5042
|
+
.wx-sgword > i {
|
|
5043
|
+
font-family: 'JetBrains Mono Variable', ui-monospace, monospace;
|
|
5044
|
+
font-size: 0.6em;
|
|
5045
|
+
font-weight: 500;
|
|
5046
|
+
letter-spacing: 0.08em;
|
|
5047
|
+
text-transform: uppercase;
|
|
5048
|
+
opacity: 0.8;
|
|
5049
|
+
}
|
|
5050
|
+
|
|
5051
|
+
.wc-sortglitch.is-live .wx-sgs {
|
|
5052
|
+
animation: wx-sg 5s steps(1) infinite;
|
|
5053
|
+
animation-delay: calc(var(--d, 0s) - var(--k) * 0.07s);
|
|
5054
|
+
}
|
|
5055
|
+
|
|
5056
|
+
@keyframes wx-sg {
|
|
5057
|
+
0%,
|
|
5058
|
+
60%,
|
|
5059
|
+
68%,
|
|
5060
|
+
80%,
|
|
5061
|
+
100% {
|
|
5062
|
+
transform: translateX(calc(var(--dx) * 0.01em));
|
|
5063
|
+
}
|
|
5064
|
+
62% {
|
|
5065
|
+
transform: translateX(calc(var(--dx) * -0.03em + 0.05em));
|
|
5066
|
+
}
|
|
5067
|
+
64% {
|
|
5068
|
+
transform: translateX(calc(var(--dx) * 0.025em - 0.04em));
|
|
5069
|
+
}
|
|
5070
|
+
66% {
|
|
5071
|
+
transform: translateX(calc(var(--dx) * 0.02em));
|
|
5072
|
+
}
|
|
5073
|
+
82% {
|
|
5074
|
+
transform: translateX(calc(var(--dx) * -0.02em - 0.02em));
|
|
5075
|
+
}
|
|
5076
|
+
84% {
|
|
5077
|
+
transform: translateX(calc(var(--dx) * 0.015em + 0.03em));
|
|
5078
|
+
}
|
|
5079
|
+
86% {
|
|
5080
|
+
transform: translateX(calc(var(--dx) * 0.01em));
|
|
5081
|
+
}
|
|
5082
|
+
}
|
|
5083
|
+
|
|
5084
|
+
@media (prefers-reduced-motion: reduce) {
|
|
5085
|
+
.wc-sortglitch .wx-sgs {
|
|
5086
|
+
animation: none !important;
|
|
5087
|
+
}
|
|
5088
|
+
}
|