@logomarks/lookbook 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +110 -0
- package/README.md +1 -1
- package/package.json +2 -2
- package/src/fields.d.ts +12 -2
- package/src/fields.js +240 -2
- package/src/glass.d.ts +1 -1
- package/src/glass.js +229 -63
- package/src/live.d.ts +4 -2
- package/src/live.js +45 -11
- package/src/looks/blur.d.ts +16 -0
- package/src/looks/blur.js +71 -0
- package/src/looks/exposure.js +139 -0
- package/src/looks/index.d.ts +10 -0
- package/src/looks/index.js +73 -0
- package/src/looks/tone.d.ts +20 -0
- package/src/looks/tone.js +132 -0
- package/src/styles/wall-looks.css +859 -1
- package/src/styles/wall.css +13 -0
- package/src/wall.js +8 -5
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module @logomarks/lookbook/looks/exposure
|
|
3
|
+
*
|
|
4
|
+
* The camera set (2026-11-28; the owner, after the long-exposure looks: "if you think of more styles similar lets add
|
|
5
|
+
* them"): slow, cinematic photo motion on the portraits, each a trick of a camera or a lens, the lockup crisp in the
|
|
6
|
+
* middle as on smear and defocus (./blur.js). Same rules as ./index.js: pure HTML strings from the card's seeded random,
|
|
7
|
+
* per-card values as custom properties in `style`, ids under the card's uid, motion in CSS only and only while
|
|
8
|
+
* `is-live`, the still styling the final frame; the styles are a block at the end of wall-looks.css.
|
|
9
|
+
*
|
|
10
|
+
* A zoom burst (copies scaled out from the face) was tried and left out: in one colour over these dark portraits it
|
|
11
|
+
* read as a soft glow, not a burst.
|
|
12
|
+
*
|
|
13
|
+
* - strobe: a stroboscopic exposure: three or four hard ghosts of the portrait stepped one way, fainter as they go,
|
|
14
|
+
* lit one by one, held, and faded. The still has every ghost lit.
|
|
15
|
+
* - chromadrift: the portrait split into its red, green and blue (each a copy through a colour matrix, screened back
|
|
16
|
+
* together over black, so aligned they make the photo again), the channels drifting slowly apart and back; the still
|
|
17
|
+
* holds a fine colour fringe.
|
|
18
|
+
* - reeded: the portrait seen through upright glass reeds, each strip showing the photo magnified and shifted, a
|
|
19
|
+
* highlight down each reed's edge, the image sliding slowly across behind the glass.
|
|
20
|
+
* - filmburn: a film burn: a warm light leak blooms in from one edge across the portrait and recedes, with film grain
|
|
21
|
+
* and a faint gate flicker. The still is the burn at its height.
|
|
22
|
+
* - haze: heat shimmer: the portrait through a slow turbulence displacement that rises like hot air, the lockup sharp.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
import { escapeHtml } from '@arraypress/text';
|
|
26
|
+
import { def, mk, pickOf } from './kit.js';
|
|
27
|
+
import { sansEms } from './studio.js';
|
|
28
|
+
|
|
29
|
+
/** The portraits the camera set takes: silhouettes, rim lights, off-focus faces, and the earlier lit portraits. */
|
|
30
|
+
export const CAMERA = /\/(silhouette|rimlight|offfocus|modern|y2k|red-bob|teal-shades|violet-shades|pink-holo|blue-braids)-?\d*\.webp$/;
|
|
31
|
+
/** The lit portraits only (the burn and the colour split want light to work with: no silhouettes). */
|
|
32
|
+
export const LIT = /\/(rimlight|offfocus|modern|y2k|red-bob|teal-shades|violet-shades|pink-holo|blue-braids)-?\d*\.webp$/;
|
|
33
|
+
|
|
34
|
+
/** The lockup: the mark and the name on one line in the middle, in white (the name sized from its width), as on ./blur.js. */
|
|
35
|
+
const lockup = (c, cls) =>
|
|
36
|
+
`<span class="wx-bllock ${cls}" style="--chars:${sansEms(c.name)}"><span class="wx-blrow"><svg class="wx-blmark" viewBox="0 0 512 512" aria-hidden="true">${mk(`<use href="#${c.uid}-m" />`)}</svg>` +
|
|
37
|
+
`<b class="wc-name" style="${c.type}">${escapeHtml(c.name)}</b></span></span>`;
|
|
38
|
+
|
|
39
|
+
const img = (src, extra = '') => `<img src="${src}" alt="" loading="lazy" decoding="async"${extra} />`;
|
|
40
|
+
const delay = (c) => `--d:-${(c.r() * 6).toFixed(2)}s`;
|
|
41
|
+
/** A silhouette is dark on light: its copies blend dark; a lit face on dark blends its light. */
|
|
42
|
+
const blendOf = (src) => (/\/silhouette-/.test(src) ? 'darken' : 'lighten');
|
|
43
|
+
|
|
44
|
+
/** strobe: hard ghosts stepped one way, lit one by one. */
|
|
45
|
+
function strobe(c) {
|
|
46
|
+
const pick = pickOf(c);
|
|
47
|
+
const src = c.photo(CAMERA);
|
|
48
|
+
const n = pick([3, 4]);
|
|
49
|
+
const way = pick(['left', 'right']);
|
|
50
|
+
const step = (way === 'left' ? -1 : 1) * (5.5 + c.r() * 2.5);
|
|
51
|
+
const ghosts = Array.from({ length: n }, (_, i) => img(src, ` style="--i:${i + 1};--o:${(0.5 - i * (0.36 / n)).toFixed(2)}"`)).join('');
|
|
52
|
+
return {
|
|
53
|
+
style: `;--bg:#07080a;--fg:#fff;--sx:${step.toFixed(2)}%;--n:${n};--bl:${blendOf(src)};${delay(c)}`,
|
|
54
|
+
attrs: '',
|
|
55
|
+
inner:
|
|
56
|
+
`<svg class="wx-def" aria-hidden="true"><defs>${def(c)}</defs></svg>` +
|
|
57
|
+
img(src) +
|
|
58
|
+
`<span class="wx-stghosts is-${way}" aria-hidden="true">${ghosts}</span>` +
|
|
59
|
+
lockup(c, 'is-strobe'),
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** chromadrift: the photo as three colour channels screened over black, drifting apart and back. */
|
|
64
|
+
const CHANNELS = [
|
|
65
|
+
['r', '1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0'],
|
|
66
|
+
['g', '0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0'],
|
|
67
|
+
['b', '0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0'],
|
|
68
|
+
];
|
|
69
|
+
function chromadrift(c) {
|
|
70
|
+
const pick = pickOf(c);
|
|
71
|
+
const src = c.photo(LIT);
|
|
72
|
+
// the drift's direction: mostly sideways, sometimes on a slant
|
|
73
|
+
const a = pick([0, 0, 0, 20, -20, 90]) * (Math.PI / 180);
|
|
74
|
+
const amt = 1.6 + c.r() * 0.8; // percent of the card, red one way and blue the other
|
|
75
|
+
const filters = CHANNELS.map(([k, m]) => `<filter id="${c.uid}-cd${k}" color-interpolation-filters="sRGB"><feColorMatrix type="matrix" values="${m}" /></filter>`).join('');
|
|
76
|
+
const layers = CHANNELS.map(([k], i) => img(src, ` class="is-${k}" style="--k:${i - 1};filter:url(#${c.uid}-cd${k})"`)).join('');
|
|
77
|
+
return {
|
|
78
|
+
style: `;--bg:#000;--fg:#fff;--cx:${(Math.cos(a) * amt).toFixed(2)}%;--cy:${(Math.sin(a) * amt).toFixed(2)}%;${delay(c)}`,
|
|
79
|
+
attrs: ' data-anim="heavy"',
|
|
80
|
+
inner: `<svg class="wx-def" aria-hidden="true"><defs>${def(c)}${filters}</defs></svg>` + `<span class="wx-cdlayers" aria-hidden="true">${layers}</span>` + lockup(c, 'is-chromadrift'),
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** reeded: upright glass reeds, each a strip showing the photo magnified about its own middle (so neighbouring reeds
|
|
85
|
+
* repeat a little of each other, as reeded glass does), a highlight down each edge, the image sliding slowly behind. */
|
|
86
|
+
function reeded(c) {
|
|
87
|
+
const pick = pickOf(c);
|
|
88
|
+
const src = c.photo(CAMERA);
|
|
89
|
+
const n = pick([7, 9, 11]);
|
|
90
|
+
const mag = 1.14 + c.r() * 0.12; // how much each reed magnifies what's behind it
|
|
91
|
+
const reeds = Array.from({ length: n }, (_, i) => `<i style="--i:${i}">${img(src)}</i>`).join('');
|
|
92
|
+
return {
|
|
93
|
+
style: `;--bg:#07080a;--fg:#fff;--n:${n};--mag:${mag.toFixed(3)};--drift:${(3 + c.r() * 3).toFixed(1)}%;${delay(c)}`,
|
|
94
|
+
attrs: '',
|
|
95
|
+
inner: `<svg class="wx-def" aria-hidden="true"><defs>${def(c)}</defs></svg>` + `<span class="wx-reeds" aria-hidden="true">${reeds}</span>` + lockup(c, 'is-reeded'),
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** filmburn: a warm leak blooming in from an edge, with grain and a gate flicker. */
|
|
100
|
+
function filmburn(c) {
|
|
101
|
+
const pick = pickOf(c);
|
|
102
|
+
const src = c.photo(LIT);
|
|
103
|
+
const edge = pick(['left', 'right', 'top', 'corner']);
|
|
104
|
+
const hue = pick([
|
|
105
|
+
['#ff5a1f', '#ffb347', '#ff2d55'],
|
|
106
|
+
['#ff7a00', '#ffd166', '#e63946'],
|
|
107
|
+
['#ff3d00', '#ff9e40', '#ffd54f'],
|
|
108
|
+
]);
|
|
109
|
+
const grain = `<filter id="${c.uid}-fg" x="0" y="0" width="100%" height="100%"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="2" seed="${Math.floor(c.r() * 90)}" /><feColorMatrix type="saturate" values="0" /></filter>`;
|
|
110
|
+
return {
|
|
111
|
+
style: `;--bg:#07080a;--fg:#fff;--b1:${hue[0]};--b2:${hue[1]};--b3:${hue[2]};${delay(c)}`,
|
|
112
|
+
attrs: '',
|
|
113
|
+
inner:
|
|
114
|
+
`<svg class="wx-def" aria-hidden="true"><defs>${def(c)}${grain}</defs></svg>` +
|
|
115
|
+
img(src, ' class="wx-fbimg"') +
|
|
116
|
+
`<span class="wx-burn is-${edge}" aria-hidden="true"></span>` +
|
|
117
|
+
`<svg class="wx-grain" aria-hidden="true" preserveAspectRatio="none"><rect width="100%" height="100%" filter="url(#${c.uid}-fg)" /></svg>` +
|
|
118
|
+
lockup(c, 'is-filmburn'),
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/** haze: heat shimmer, a turbulence displacement that rises over the portrait. */
|
|
123
|
+
function haze(c) {
|
|
124
|
+
const src = c.photo(CAMERA);
|
|
125
|
+
const f = (0.008 + c.r() * 0.004).toFixed(4);
|
|
126
|
+
const filter = `<filter id="${c.uid}-hz" x="-5%" y="-5%" width="110%" height="110%"><feTurbulence type="fractalNoise" baseFrequency="${f} ${(Number(f) * 4).toFixed(4)}" numOctaves="2" seed="${Math.floor(c.r() * 90)}" /><feDisplacementMap in="SourceGraphic" scale="${(14 + c.r() * 8).toFixed(1)}" xChannelSelector="R" yChannelSelector="G" /></filter>`;
|
|
127
|
+
return {
|
|
128
|
+
style: `;--bg:#07080a;--fg:#fff;${delay(c)}`,
|
|
129
|
+
attrs: ' data-anim="heavy"',
|
|
130
|
+
inner:
|
|
131
|
+
`<svg class="wx-def" aria-hidden="true"><defs>${def(c)}${filter}</defs></svg>` +
|
|
132
|
+
// the filter rides on the frame, which climbs; the photo inside climbs down as much, so the photo holds still
|
|
133
|
+
// and the shimmer rises through it
|
|
134
|
+
`<span class="wx-hzframe" style="filter:url(#${c.uid}-hz)">${img(src, ' class="wx-hzimg"')}</span>` +
|
|
135
|
+
lockup(c, 'is-haze'),
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export const EXPOSURE = { strobe, chromadrift, reeded, filmburn, haze };
|
package/src/looks/index.d.ts
CHANGED
|
@@ -73,6 +73,16 @@ export declare const LOOK_KINDS: readonly [
|
|
|
73
73
|
'overprint',
|
|
74
74
|
'brutal',
|
|
75
75
|
'sortglitch',
|
|
76
|
+
'smear',
|
|
77
|
+
'defocus',
|
|
78
|
+
'strobe',
|
|
79
|
+
'chromadrift',
|
|
80
|
+
'reeded',
|
|
81
|
+
'filmburn',
|
|
82
|
+
'haze',
|
|
83
|
+
'decay',
|
|
84
|
+
'halfscan',
|
|
85
|
+
'tidal',
|
|
76
86
|
];
|
|
77
87
|
/** A drawn look's kind. */
|
|
78
88
|
export type LookKind = (typeof LOOK_KINDS)[number];
|
package/src/looks/index.js
CHANGED
|
@@ -25,6 +25,9 @@ import { STREET, retargetStreet } from './street.js';
|
|
|
25
25
|
import { CLUB } from './club.js';
|
|
26
26
|
import { STUDIO, sansEms } from './studio.js';
|
|
27
27
|
import { STARK, slices } from './stark.js';
|
|
28
|
+
import { BLUR } from './blur.js';
|
|
29
|
+
import { EXPOSURE } from './exposure.js';
|
|
30
|
+
import { TONE } from './tone.js';
|
|
28
31
|
import { fitName } from '../fit.js';
|
|
29
32
|
|
|
30
33
|
/** A name's width in Michroma capitals, in ems (./kit.js): the terminal's and the brutal poster's names are sized from it. */
|
|
@@ -93,6 +96,19 @@ export const LOOK_KINDS = [
|
|
|
93
96
|
// the stark set, on the 2026-11-28 photos (./stark.js)
|
|
94
97
|
'brutal',
|
|
95
98
|
'sortglitch',
|
|
99
|
+
// the long-exposure set, on the silhouette, rim-light and off-focus portraits (./blur.js)
|
|
100
|
+
'smear',
|
|
101
|
+
'defocus',
|
|
102
|
+
// the camera set, slow camera and lens tricks on the portraits (./exposure.js)
|
|
103
|
+
'strobe',
|
|
104
|
+
'chromadrift',
|
|
105
|
+
'reeded',
|
|
106
|
+
'filmburn',
|
|
107
|
+
'haze',
|
|
108
|
+
// the moving photo set (./tone.js): dither decay, a halftone scan, a drifting duotone
|
|
109
|
+
'decay',
|
|
110
|
+
'halfscan',
|
|
111
|
+
'tidal',
|
|
96
112
|
];
|
|
97
113
|
|
|
98
114
|
/** The animated ones (marked `data-anim`, started on screen). */
|
|
@@ -127,6 +143,18 @@ const ANIMATED = new Set([
|
|
|
127
143
|
'frost',
|
|
128
144
|
'spectral',
|
|
129
145
|
'sortglitch',
|
|
146
|
+
'smear',
|
|
147
|
+
'defocus',
|
|
148
|
+
'strobe',
|
|
149
|
+
'chromadrift',
|
|
150
|
+
'reeded',
|
|
151
|
+
'filmburn',
|
|
152
|
+
'haze',
|
|
153
|
+
'decay',
|
|
154
|
+
'halfscan',
|
|
155
|
+
'tidal',
|
|
156
|
+
'brutal',
|
|
157
|
+
'acidmap',
|
|
130
158
|
]);
|
|
131
159
|
|
|
132
160
|
/**
|
|
@@ -165,6 +193,18 @@ export const LOOK_LOOP = {
|
|
|
165
193
|
frost: { cycle: 12, speed: 2 }, // the three lights drift out and back: 6 s
|
|
166
194
|
spectral: { cycle: 10, speed: 2 }, // the spectrum slides one whole tile: 5 s
|
|
167
195
|
sortglitch: { cycle: 5, speed: 1 }, // the slices hold, jump twice, settle: 5 s
|
|
196
|
+
smear: { cycle: 8, speed: 1.4 }, // the trail draws in and stretches out again: 5.7 s
|
|
197
|
+
defocus: { cycle: 8, speed: 1.4 }, // in focus, slowly out, back in: 5.7 s
|
|
198
|
+
strobe: { cycle: 7, speed: 1.2 }, // the ghosts light one by one, hold, go out: 5.8 s
|
|
199
|
+
chromadrift: { cycle: 8, speed: 1.4 }, // the channels drift apart and back: 5.7 s
|
|
200
|
+
reeded: { cycle: 9, speed: 1.5 }, // the photo slides behind the reeds and back: 6 s
|
|
201
|
+
filmburn: { cycle: 9, speed: 1.5 }, // the burn blooms and recedes (the gate flicker 36 times): 6 s
|
|
202
|
+
haze: { cycle: 14, speed: 2.5 }, // the shimmer rises and sinks back: 5.6 s
|
|
203
|
+
decay: { cycle: 10, speed: 1.5 }, // decayed, recovers, breaks off again: 6.7 s
|
|
204
|
+
halfscan: { cycle: 10, speed: 1.5 }, // the band sweeps off, comes round, rests: 6.7 s
|
|
205
|
+
tidal: { cycle: 12, speed: 2 }, // three tones and back, the light passing once: 6 s
|
|
206
|
+
brutal: { cycle: 14, speed: 2.5 }, // the photo pushes in and back, a raking light crosses the concrete once: 5.6 s
|
|
207
|
+
acidmap: { cycle: 12, speed: 2 }, // the portrait drifts in and back, a lime light crosses it once: 6 s
|
|
168
208
|
};
|
|
169
209
|
|
|
170
210
|
/** How often each look is dealt, against the older looks' weights (`WEIGHTS`: photo 3, gradient 3, mono 2 … crop 1, 23
|
|
@@ -219,6 +259,16 @@ export const LOOK_WEIGHTS = {
|
|
|
219
259
|
overprint: 0.4,
|
|
220
260
|
brutal: 0,
|
|
221
261
|
sortglitch: 0,
|
|
262
|
+
smear: 0,
|
|
263
|
+
defocus: 0,
|
|
264
|
+
strobe: 0,
|
|
265
|
+
chromadrift: 0,
|
|
266
|
+
reeded: 0,
|
|
267
|
+
filmburn: 0,
|
|
268
|
+
haze: 0,
|
|
269
|
+
decay: 0,
|
|
270
|
+
halfscan: 0,
|
|
271
|
+
tidal: 0,
|
|
222
272
|
};
|
|
223
273
|
|
|
224
274
|
/** Each look's card shape (width / height). */
|
|
@@ -271,6 +321,16 @@ export const LOOK_RATIO = {
|
|
|
271
321
|
overprint: '1 / 1',
|
|
272
322
|
brutal: '4 / 5',
|
|
273
323
|
sortglitch: '4 / 5',
|
|
324
|
+
smear: '4 / 5',
|
|
325
|
+
defocus: '4 / 5',
|
|
326
|
+
strobe: '4 / 5',
|
|
327
|
+
chromadrift: '4 / 5',
|
|
328
|
+
reeded: '4 / 5',
|
|
329
|
+
filmburn: '4 / 5',
|
|
330
|
+
haze: '4 / 5',
|
|
331
|
+
decay: '4 / 5',
|
|
332
|
+
halfscan: '4 / 5',
|
|
333
|
+
tidal: '4 / 5',
|
|
274
334
|
};
|
|
275
335
|
|
|
276
336
|
/** Names for the expanded view's background label. */
|
|
@@ -323,6 +383,16 @@ export const LOOK_LABEL = {
|
|
|
323
383
|
overprint: 'Overprint',
|
|
324
384
|
brutal: 'Brutalist poster',
|
|
325
385
|
sortglitch: 'Glitch card',
|
|
386
|
+
smear: 'Long exposure',
|
|
387
|
+
defocus: 'Defocus',
|
|
388
|
+
strobe: 'Strobe',
|
|
389
|
+
chromadrift: 'Colour split',
|
|
390
|
+
reeded: 'Reeded glass',
|
|
391
|
+
filmburn: 'Film burn',
|
|
392
|
+
haze: 'Heat haze',
|
|
393
|
+
decay: 'Signal decay',
|
|
394
|
+
halfscan: 'Halftone scan',
|
|
395
|
+
tidal: 'Tone drift',
|
|
326
396
|
};
|
|
327
397
|
|
|
328
398
|
/* ---------- the looks ---------- */
|
|
@@ -1020,6 +1090,9 @@ const LOOKS = {
|
|
|
1020
1090
|
...CLUB,
|
|
1021
1091
|
...STUDIO,
|
|
1022
1092
|
...STARK,
|
|
1093
|
+
...BLUR,
|
|
1094
|
+
...EXPOSURE,
|
|
1095
|
+
...TONE,
|
|
1023
1096
|
};
|
|
1024
1097
|
|
|
1025
1098
|
/** Whether a kind is one of the drawn looks. */
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Lookbook's moving photo set: decay (an acid-mapped portrait breaking into dithered bands dragged sideways and
|
|
3
|
+
* re-forming), halfscan (a band of light that turns the portrait into a halftone screen as it passes) and tidal (a
|
|
4
|
+
* duotone whose wash drifts through three tones under a passing light).
|
|
5
|
+
*/
|
|
6
|
+
import { type LookCtx, type LookOut } from './kit.js';
|
|
7
|
+
|
|
8
|
+
/** Close portraits that take halfscan and tidal. */
|
|
9
|
+
export declare const FACES: RegExp;
|
|
10
|
+
/** The portraits decay takes (the close ones and the already broken ones). */
|
|
11
|
+
export declare const BROKEN: RegExp;
|
|
12
|
+
/** How many dithered bands a decay card lays over its portrait. */
|
|
13
|
+
export declare const BANDS: number;
|
|
14
|
+
/** The tides a tidal card's wash drifts through: three tones each, the first the still. */
|
|
15
|
+
export declare const TIDES: readonly (readonly [string, string, string])[];
|
|
16
|
+
export declare const TONE: {
|
|
17
|
+
decay: (c: LookCtx) => LookOut;
|
|
18
|
+
halfscan: (c: LookCtx) => LookOut;
|
|
19
|
+
tidal: (c: LookCtx) => LookOut;
|
|
20
|
+
};
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module @logomarks/lookbook/looks/tone
|
|
3
|
+
*
|
|
4
|
+
* The Lookbook's moving photo set (2026-11-28; the owner's references: an acid-mapped portrait breaking into dither,
|
|
5
|
+
* "a dithering/deconstructing style look... animated slowly"; a lit portrait, "something clever here halftone
|
|
6
|
+
* animation"; a violet duotone, "animated tones... not all but some"): decay, halfscan and tidal. Same rules as
|
|
7
|
+
* ./index.js (pure HTML strings from the card's seeded random, per-card values as custom properties in `style`, ids under
|
|
8
|
+
* the card's uid, motion in CSS only and only while `is-live`, the still styles the final frame); the styles are a block
|
|
9
|
+
* at the end of wall-looks.css.
|
|
10
|
+
*
|
|
11
|
+
* - decay: a portrait gradient-mapped near-black → teal → lime (the acid map's ramp), and over it five narrow bands of the
|
|
12
|
+
* same photo dithered into teal grain, lime only in the highlights, (an SVG filter: luminance plus noise, posterised to three levels) and
|
|
13
|
+
* dragged sideways (a displacement along x only). While live the signal recovers and decays again (10 s): the bands
|
|
14
|
+
* slide home and fade, then break off again; the still is the decayed frame. The mark big top left, the name in wide
|
|
15
|
+
* tracked capitals and a line of copy at the foot, the trade top right (the acid map's layout).
|
|
16
|
+
* - halfscan: a lit portrait, and a band of light that sweeps across it; under the band the photo turns into a halftone
|
|
17
|
+
* screen, its dots swelling in the highlights and closing in the shadows (CSS: a dot grid multiplied into the blurred
|
|
18
|
+
* photo, then a hard contrast), coloured by the photo itself. The still has the band resting right of the middle.
|
|
19
|
+
* - tidal: a duotone, the photo in greyscale under one wash; the wash drifts slowly through three neighbouring tones
|
|
20
|
+
* (the shadows hold black) and a soft light passes over the face. The still is the first tone, no light.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
import { escapeHtml } from '@arraypress/text';
|
|
24
|
+
import { def, meta, mk, pickOf } from './kit.js';
|
|
25
|
+
import { sansEms } from './studio.js';
|
|
26
|
+
|
|
27
|
+
/** Close portraits that take these looks: the studio portraits and the 2026-11-28 rim lights and off-focus faces. */
|
|
28
|
+
export const FACES = /\/(modern|y2k|red-bob|teal-shades|violet-shades|pink-holo|blue-braids|rimlight|offfocus)-?\d*\.webp$/;
|
|
29
|
+
/** decay also takes the already broken portraits (dithered, pixel-sorted): they decay further. */
|
|
30
|
+
export const BROKEN = /\/(modern|y2k|red-bob|teal-shades|violet-shades|pink-holo|blue-braids|rimlight|offfocus|dithered|pixelsort)-?\d*\.webp$/;
|
|
31
|
+
/** How many dithered bands a decay card lays over its portrait. */
|
|
32
|
+
export const BANDS = 5;
|
|
33
|
+
/** The tides a tidal card's wash drifts through: three neighbouring tones each, the first the still. */
|
|
34
|
+
export const TIDES = [
|
|
35
|
+
['#4a35e0', '#2b3fd1', '#7a2fe0'], // violet, ultramarine, purple
|
|
36
|
+
['#e0352b', '#ff5a1f', '#d81b60'], // red, ember, crimson
|
|
37
|
+
['#0e9f6e', '#0f8b8d', '#3fae2a'], // emerald, teal, leaf
|
|
38
|
+
['#ff4fa3', '#b03ae0', '#ff6a4a'], // pink, orchid, coral
|
|
39
|
+
['#1f6fff', '#00a3c4', '#5a3bff'], // cobalt, cyan, indigo
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
/** The acid ramp (as the acid map): grey, more contrast, then near-black → teal → lime. */
|
|
43
|
+
const RAMP =
|
|
44
|
+
'<feComponentTransfer><feFuncR type="table" tableValues="0.035 0.045 0.06 0.42 0.78" /><feFuncG type="table" tableValues="0.05 0.24 0.55 0.82 0.96" /><feFuncB type="table" tableValues="0.04 0.26 0.55 0.38 0.2" /></feComponentTransfer>';
|
|
45
|
+
const GREY = '<feColorMatrix type="saturate" values="0" />';
|
|
46
|
+
|
|
47
|
+
/** The centred lockup: the mark and the name on one line (the long-exposure set's classes, wall-looks.css). */
|
|
48
|
+
const lockup = (c, cls) =>
|
|
49
|
+
`<span class="wx-bllock ${cls}" style="--chars:${sansEms(c.name)}"><span class="wx-blrow"><svg class="wx-blmark" viewBox="0 0 512 512" aria-hidden="true">${mk(`<use href="#${c.uid}-m" />`)}</svg>` +
|
|
50
|
+
`<b class="wc-name" style="${c.type}">${escapeHtml(c.name)}</b></span></span>`;
|
|
51
|
+
|
|
52
|
+
/** decay: the acid-mapped portrait, and dithered bands of it dragged sideways. */
|
|
53
|
+
function decay(c) {
|
|
54
|
+
const pick = pickOf(c);
|
|
55
|
+
const src = c.photo(BROKEN);
|
|
56
|
+
const seed = Math.round(c.r() * 900);
|
|
57
|
+
// the clean map, and the decayed one: luminance plus noise, posterised to three levels (the grain), mapped to the
|
|
58
|
+
// acid colours, then dragged along x only (a displacement whose y channel is held at the middle)
|
|
59
|
+
const clean = `<filter id="${c.uid}-dc" x="0" y="0" width="100%" height="100%" color-interpolation-filters="sRGB">${GREY}<feComponentTransfer><feFuncR type="linear" slope="1.25" intercept="-0.08" /><feFuncG type="linear" slope="1.25" intercept="-0.08" /><feFuncB type="linear" slope="1.25" intercept="-0.08" /></feComponentTransfer>${RAMP}</filter>`;
|
|
60
|
+
const broke =
|
|
61
|
+
`<filter id="${c.uid}-dd" x="-10%" y="0" width="120%" height="100%" color-interpolation-filters="sRGB">` +
|
|
62
|
+
// grey, lifted (the portraits are dark), then the noise: averaged to grey and stretched so it can tip a pixel
|
|
63
|
+
'<feColorMatrix type="saturate" values="0" /><feComponentTransfer><feFuncR type="linear" slope="1.35" /><feFuncG type="linear" slope="1.35" /><feFuncB type="linear" slope="1.35" /></feComponentTransfer>' +
|
|
64
|
+
'<feComponentTransfer result="grey"><feFuncR type="gamma" exponent="0.8" /><feFuncG type="gamma" exponent="0.8" /><feFuncB type="gamma" exponent="0.8" /></feComponentTransfer>' +
|
|
65
|
+
`<feTurbulence type="fractalNoise" baseFrequency="0.38" numOctaves="1" seed="${seed}" result="n" />` +
|
|
66
|
+
'<feColorMatrix in="n" type="matrix" values="0.33 0.33 0.33 0 0 0.33 0.33 0.33 0 0 0.33 0.33 0.33 0 0 0 0 0 0 1" />' +
|
|
67
|
+
'<feComponentTransfer result="g"><feFuncR type="linear" slope="3.5" intercept="-1.25" /><feFuncG type="linear" slope="3.5" intercept="-1.25" /><feFuncB type="linear" slope="3.5" intercept="-1.25" /></feComponentTransfer>' +
|
|
68
|
+
// photo plus noise, posterised to three levels, the top one rare (lime only in the highlights): the grain; then the acid colours
|
|
69
|
+
'<feComposite in="grey" in2="g" operator="arithmetic" k1="0" k2="1" k3="0.45" k4="-0.2" />' +
|
|
70
|
+
'<feComponentTransfer><feFuncR type="discrete" tableValues="0 0.5 0.5 0.5 1" /><feFuncG type="discrete" tableValues="0 0.5 0.5 0.5 1" /><feFuncB type="discrete" tableValues="0 0.5 0.5 0.5 1" /></feComponentTransfer>' +
|
|
71
|
+
RAMP.replace('<feComponentTransfer>', '<feComponentTransfer result="grain">') +
|
|
72
|
+
// dragged along x only: the map's y channel held at the middle (no shift)
|
|
73
|
+
`<feTurbulence type="fractalNoise" baseFrequency="0.002 0.09" numOctaves="2" seed="${seed + 3}" result="w" />` +
|
|
74
|
+
'<feColorMatrix in="w" type="matrix" values="1 0 0 0 0 0 0 0 0 0.5 0 0 0 0 0 0 0 0 0 1" result="wx" />' +
|
|
75
|
+
'<feDisplacementMap in="grain" in2="wx" scale="30" xChannelSelector="R" yChannelSelector="G" /></filter>';
|
|
76
|
+
// the bands: one in each fifth of the card, narrow, at its own height, each dragged its own way and distance at full
|
|
77
|
+
// decay, so the portrait shows between them
|
|
78
|
+
const bands = Array.from({ length: BANDS }, (_, i) => {
|
|
79
|
+
const hh = 5 + c.r() * 6,
|
|
80
|
+
t = i * (100 / BANDS) + c.r() * (100 / BANDS - hh);
|
|
81
|
+
const dx = (c.r() < 0.5 ? -1 : 1) * (3 + c.r() * 6);
|
|
82
|
+
return `<span class="wx-dcband" style="--t:${t.toFixed(2)};--h:${hh.toFixed(2)};--dx:${dx.toFixed(1)}%;--k:${i}"><img src="${src}" alt="" loading="lazy" decoding="async" style="filter:url(#${c.uid}-dd)" /></span>`;
|
|
83
|
+
}).join('');
|
|
84
|
+
const ink = pick(['#ffffff', '#c6f432']);
|
|
85
|
+
return {
|
|
86
|
+
style: `;--bg:#0b0f0c;--mk:${ink};--d:-${(c.r() * 8).toFixed(2)}s`,
|
|
87
|
+
attrs: ' data-anim="heavy"',
|
|
88
|
+
inner:
|
|
89
|
+
`<svg class="wx-def" aria-hidden="true"><defs>${def(c)}${clean}${broke}</defs></svg>` +
|
|
90
|
+
`<img class="wx-dcbase" src="${src}" alt="" loading="lazy" decoding="async" style="filter:url(#${c.uid}-dc)" />` +
|
|
91
|
+
`<span class="wx-dcbands" aria-hidden="true">${bands}</span>` +
|
|
92
|
+
`<svg class="wx-art wx-dcmark" viewBox="0 0 512 512" aria-hidden="true">${mk(`<use href="#${c.uid}-m" />`)}</svg>` +
|
|
93
|
+
`<span class="wx-amword"><b class="wc-name">${escapeHtml(c.name)}</b><i>${escapeHtml(c.tagline)}</i></span>` +
|
|
94
|
+
meta('tr', escapeHtml(c.line)),
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/** halfscan: the portrait, and a band of light that turns what it crosses into a halftone screen. */
|
|
99
|
+
function halfscan(c) {
|
|
100
|
+
const pick = pickOf(c);
|
|
101
|
+
const src = c.photo(FACES);
|
|
102
|
+
const way = pick(['x', 'x', 'y']);
|
|
103
|
+
const dot = pick([8, 9, 10]);
|
|
104
|
+
return {
|
|
105
|
+
style: `;--bg:#07080a;--fg:#fff;--dot:${dot}px;--d:-${(c.r() * 8).toFixed(2)}s`,
|
|
106
|
+
attrs: ' data-anim="heavy"',
|
|
107
|
+
inner:
|
|
108
|
+
`<svg class="wx-def" aria-hidden="true"><defs>${def(c)}</defs></svg>` +
|
|
109
|
+
`<img class="wx-hsbase" src="${src}" alt="" loading="lazy" decoding="async" />` +
|
|
110
|
+
`<span class="wx-hsscan is-${way}" aria-hidden="true"><span class="wx-hsdots"><img src="${src}" alt="" loading="lazy" decoding="async" /></span>` +
|
|
111
|
+
`<img class="wx-hstint" src="${src}" alt="" loading="lazy" decoding="async" /></span>` +
|
|
112
|
+
lockup(c, 'is-halfscan'),
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/** tidal: the photo in greyscale under a wash that drifts through three tones, a soft light passing over it. */
|
|
117
|
+
function tidal(c) {
|
|
118
|
+
const pick = pickOf(c);
|
|
119
|
+
const src = c.photo(FACES);
|
|
120
|
+
const [w1, w2, w3] = pick(TIDES);
|
|
121
|
+
return {
|
|
122
|
+
style: `;--bg:#07080a;--fg:#fff;--w1:${w1};--w2:${w2};--w3:${w3};--d:-${(c.r() * 10).toFixed(2)}s`,
|
|
123
|
+
attrs: '',
|
|
124
|
+
inner:
|
|
125
|
+
`<svg class="wx-def" aria-hidden="true"><defs>${def(c)}</defs></svg>` +
|
|
126
|
+
`<img class="wx-tdimg" src="${src}" alt="" loading="lazy" decoding="async" />` +
|
|
127
|
+
'<i class="wx-tdwash" aria-hidden="true"></i><i class="wx-tdlight" aria-hidden="true"></i>' +
|
|
128
|
+
lockup(c, 'is-tidal'),
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export const TONE = { decay, halfscan, tidal };
|