@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
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,116 @@ 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
|
+
|
|
9
|
+
## [0.6.1] — 2026-11-28
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- **Every card on screen moves** (the owner, on the full preview: "about 50% on that page are not moving... everything
|
|
14
|
+
should have some flare"). Measured on the preview with every new look and field (two screenshots 1.5 s apart, a screen
|
|
15
|
+
at a time, headless Chrome): 85 of 155 cards in view moved before, 125 of 155 after; the rest were live loops caught
|
|
16
|
+
in a hold (the glitch card's slices, the film burn) or behind the sticky header, and 20 shader cards now draw at once
|
|
17
|
+
where ten could.
|
|
18
|
+
- The shader, gradient and field cards share one WebGL context (effects-astro's `shareContexts`, called by `shaders()`),
|
|
19
|
+
so the browser's cap of about sixteen contexts no longer stops them: `shaders()` and `liveCards`' `gl` now run every
|
|
20
|
+
card on screen (they ran ten).
|
|
21
|
+
- The costly looks take turns in larger groups: `heavyCap()` lets ten move at once on a desktop with eight cores or
|
|
22
|
+
more, four on a mid machine, one on a phone (it was two, one on a phone), each starting a beat after the last.
|
|
23
|
+
- The caustics card's still is the net of light (an SVG filter's lit noise ridges with a warm and a cool fringe), not a
|
|
24
|
+
plain gradient; the rain card's is its photo soft behind the glass with beads on it (it showed black before the
|
|
25
|
+
effect started).
|
|
26
|
+
- The Brutalist poster and the acid map move while live: a slow push into the photo and a light crossing it once a
|
|
27
|
+
loop (`LOOK_LOOP` 14 s and 12 s); the still is the photo at rest.
|
|
28
|
+
- The pixel horizon's blocks roll again more often (1.3–1.7 a second, from 0.6), so its band visibly changes.
|
|
29
|
+
|
|
30
|
+
### Changed
|
|
31
|
+
|
|
32
|
+
- **The glass cards are real glass over a photo** (the owner: "need improved a lot to have proper refraction and look like
|
|
33
|
+
actual glass"). Both refract a calm abstract from the glass set (`GLASS_PHOTOS`: fluid, liquid, ribbon, waves, sunset,
|
|
34
|
+
dusk, spheres, swirl), soft round the glass and sharp through it. Liquid glass is the mark's own shape in clear, lightly
|
|
35
|
+
tinted glass that lands as a drop and holds (no melting to a flat mark), its top swelling slowly, the light drifting,
|
|
36
|
+
a shadow under it; glass slabs are thick tinted lenses. The stills are the photo with the photo again through the
|
|
37
|
+
mark, magnified and tinted, with a dark band and a white hairline at the rim and the bevel's highlight (liquid glass),
|
|
38
|
+
or through tinted bands (glass slabs). Glass deals now get `glass` (the wall's glass-set picker) and may return a
|
|
39
|
+
`still` CSS background.
|
|
40
|
+
|
|
41
|
+
### Added
|
|
42
|
+
|
|
43
|
+
- **The light set** (field cards, all at weight 0; the owner, 2026-11-28: "any other looks like lightleaks that can be
|
|
44
|
+
done realistically? if it's going to look shite, don't do it"; each judged against real photographs of the effect):
|
|
45
|
+
- **Lens flare** (`lensflare`, effects-astro's `lensFlare`): an anamorphic flare from a light near the top or the
|
|
46
|
+
foot, its long streak across the card (blue, amber, teal or violet), ghosts drifting on the line through the centre.
|
|
47
|
+
- **Caustics** (`caustics`, effects-astro's `caustics`): sunlight through rippling water on a pool floor (tiled or
|
|
48
|
+
plain, a lagoon, a pool at dusk), the net's edges in rainbow, a calmer middle for the lockup; the pointer leaves it.
|
|
49
|
+
- **Rain on glass** (`rainglass`, effects-astro's `rainOnGlass`): rain on a window in front of a club, off-focus or
|
|
50
|
+
rim-lit photo, the beads holding it sharp and upside down, drops sliding down in fits and starts. A field's deal now
|
|
51
|
+
takes `photo` too (a photo the recent cards haven't shown), beside `glass`.
|
|
52
|
+
- **Sun through blinds** (`sunblinds`, effects-astro's `sunWall`): low sun through venetian blinds on a plaster wall
|
|
53
|
+
(warm, white, clay, lilac, sage), the patch thrown to one side so the lockup sits at its edge, the bars falling away
|
|
54
|
+
behind it.
|
|
55
|
+
- **Prism light** (`prismlight`, the same effect): a patch of low sun and beside it in the shade the short spectrum a
|
|
56
|
+
glass edge throws.
|
|
57
|
+
- Tried and left as they are: water caustics and rain on glass were already effects-astro effects, only wired
|
|
58
|
+
here; a separate light-through-blinds look was checked against `sunshadow` (leaf shadows, a CSS look), which it
|
|
59
|
+
doesn't repeat.
|
|
60
|
+
- **The pattern card drifts** (the owner: "can't this be animated texture/background that moves slowly"): while live
|
|
61
|
+
its wallpaper slides up the diagonal by exactly one tile (100 across and 100 down, turned with the pattern's -14°)
|
|
62
|
+
every 28 s, so it repeats without a jump; the paper is drawn a tile larger each way so no edge shows; the still is the
|
|
63
|
+
paper at rest; reduced motion stops it. A wall kind, not a drawn look, so it has no video loop (as `jitter` and `crt`).
|
|
64
|
+
|
|
65
|
+
- **The moving photo set** (`./looks/tone.js`, all at weight 0, after the owner's references of 2026-11-28):
|
|
66
|
+
- **Signal decay** (`decay`): a portrait gradient-mapped near-black → teal → lime, and five narrow bands of it (one in
|
|
67
|
+
each fifth of the card, the face showing between them) dithered into teal grain, lime only in the highlights, (an SVG filter: luminance plus noise, posterised to three levels) and dragged
|
|
68
|
+
sideways along x only. While live the signal recovers and breaks off again (10 s); the still is the decayed frame.
|
|
69
|
+
The acid map's layout: the mark big top left, the name and a line of copy at the foot. Costly (`data-anim="heavy"`).
|
|
70
|
+
- **Halftone scan** (`halfscan`): a band of light sweeps across (or down) a lit portrait and turns what it crosses into
|
|
71
|
+
a halftone screen of the same photo whose dots follow the tone (a dot grid multiplied into the blurred photo over a
|
|
72
|
+
floor, so even the shadows take a fine dot, then a hard contrast), coloured by the photo on a dark ground; the still rests the band right of the middle. Costly.
|
|
73
|
+
- **Tone drift** (`tidal`): a duotone whose wash drifts slowly through three neighbouring tones (the shadows hold
|
|
74
|
+
black) while a soft light passes over the face; the still is the first tone. For a share of duotone cards: deal it
|
|
75
|
+
beside `duo` at a weight.
|
|
76
|
+
- **Paint drip** (`paintdrip`, a glass-table card: the mark itself drawn live; effects-astro 0.15's `paintDrip`), after the
|
|
77
|
+
owner's spray-stencil reference: the mark sprayed in paint on a lit, grained ground (acid on concrete, signal on
|
|
78
|
+
black, pink on pale concrete, white on cobalt, cyan on charcoal, black on acid), the name in the paint's colour;
|
|
79
|
+
drips pool on the mark's outer lower silhouette (never inside a counter or off a stripe end within it), run down with
|
|
80
|
+
real physics (a bead at the head, the body thinning, slowing as the paint is spent), stop above the name and dry, then
|
|
81
|
+
fade and run again (about 9 s). Its still (the page before the canvas starts, `?still`, exports) is the resting frame:
|
|
82
|
+
the drips at full length, drawn from the same seeded plan the canvas runs (the anchors are read off the mark's
|
|
83
|
+
coverage when the card is dealt and handed to the effect).
|
|
84
|
+
- **Bokeh drift** (`photobokeh`, a field card; effects-astro 0.15's `photoBokeh`): a flower photo from the glass set
|
|
85
|
+
(blooms, dahlias, irises, lilies, marigolds) racking its focus near to far and back, a few large soft lights (filled
|
|
86
|
+
glows, no ring) tinted from its highlights and brighter where they cross them drifting slowly up through it, the
|
|
87
|
+
lockup sharp in front. Its still is the photo. A field's deal
|
|
88
|
+
may now take a glass photo (`glass` in `FieldDeal`), kept among the recent backgrounds.
|
|
89
|
+
- Both at weight 0; they need `@arraypress/effects-astro` ^0.15.0 (publish it first).
|
|
90
|
+
- **Two long-exposure looks** (`./looks/blur.js`, after the owner's reference of a silhouette trailing light streaks),
|
|
91
|
+
both on the silhouette, rim-light and off-focus portraits, the lockup crisp in the middle on one line, at weight 0:
|
|
92
|
+
- `smear` (Long exposure): the portrait and five copies pushed left, right or up in steps, each blurred along the
|
|
93
|
+
push only (an SVG `feGaussianBlur` per copy) and fainter as it goes; a silhouette drags dark (`darken`), a lit face
|
|
94
|
+
drags its light (`lighten`). While live the trail draws in and stretches out again (8 s); the still is full stretch.
|
|
95
|
+
Marked `data-anim="heavy"`, so it takes turns.
|
|
96
|
+
- `defocus` (Defocus): the portrait slowly out of focus and back (8 s), the still in focus.
|
|
97
|
+
- **The camera set** (`./looks/exposure.js`): five more slow camera and lens tricks on the portraits, after the
|
|
98
|
+
long-exposure looks (the owner: "if you think of more styles similar lets add them"), the lockup crisp in the middle
|
|
99
|
+
as on smear and defocus, each at weight 0:
|
|
100
|
+
- `strobe` (Strobe): three or four hard ghosts of the portrait stepped left or right, fainter as they go, lit one by
|
|
101
|
+
one, held and put out together (7 s); the still has every ghost lit.
|
|
102
|
+
- `chromadrift` (Colour split): the portrait as its red, green and blue, each a copy through an `feColorMatrix`,
|
|
103
|
+
screened back together over black (aligned, they are the photo), red and blue drifting apart and back (8 s); the
|
|
104
|
+
still holds a fine fringe. Lit portraits only. Heavy.
|
|
105
|
+
- `reeded` (Reeded glass): the portrait through 7, 9 or 11 upright glass reeds, each a strip showing the photo
|
|
106
|
+
magnified about its own middle, a light and a dark edge down each; the photo slides behind the glass and back (9 s).
|
|
107
|
+
- `filmburn` (Film burn): a warm light leak blooms in from an edge or the corner and recedes (9 s), with film grain
|
|
108
|
+
(`feTurbulence`) and a faint gate flicker. Lit portraits only.
|
|
109
|
+
- `haze` (Heat haze): a slow turbulence displacement (`feTurbulence` + `feDisplacementMap`) rising through the
|
|
110
|
+
portrait and sinking back (7 s each way); the displaced frame reaches past the card so its edge stays clean. Heavy.
|
|
111
|
+
- Tried and left out: a zoom burst (copies scaled out from the face), which read as a soft glow, not a burst.
|
|
112
|
+
|
|
113
|
+
### Fixed
|
|
114
|
+
|
|
115
|
+
- Four fields moved too slowly to see (one cycle every 20–40 s read as a still on the page): Liquid folds, Reeded bokeh,
|
|
116
|
+
Reeded glow and the dithered gradient are dealt two to five times faster. Their stills are unchanged.
|
|
117
|
+
|
|
8
118
|
## [0.6.0] — 2026-11-28
|
|
9
119
|
|
|
10
120
|
### Fixed
|
package/README.md
CHANGED
|
@@ -37,7 +37,7 @@ 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, reeded glow, liquid folds and
|
|
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, reeded bokeh and bokeh drift (a flower photo racking its focus); and `GLASS`, the cards that draw the mark itself live: liquid glass, glass slabs and paint drip (the mark sprayed, its paint running)); `shuffled`; the promo cards `headlineCard`, `sponsorCard`, `openSlotCard`; `WEIGHTS`, `KIND_LABEL`, `EVERY`, `ACCENT` (`#C8FF00`) and the look tables.
|
|
41
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
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.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@logomarks/lookbook",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
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.15.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
|
@@ -20,14 +20,24 @@ export type FieldKind =
|
|
|
20
20
|
| 'pixelhorizon'
|
|
21
21
|
| 'flutedglow'
|
|
22
22
|
| 'fluidfolds'
|
|
23
|
-
| 'reededbokeh'
|
|
23
|
+
| 'reededbokeh'
|
|
24
|
+
| 'photobokeh'
|
|
25
|
+
| 'lensflare'
|
|
26
|
+
| 'caustics'
|
|
27
|
+
| 'rainglass'
|
|
28
|
+
| 'sunblinds'
|
|
29
|
+
| 'prismlight';
|
|
24
30
|
|
|
25
|
-
/** What a field card is dealt from: the card's seeded pick and random, the accent,
|
|
31
|
+
/** What a field card is dealt from: the card's seeded pick and random, the accent, the wall's monospaced face, and a
|
|
32
|
+
* glass background (abstracts and flowers) or a photo the recent cards haven't shown, of those whose file names match
|
|
33
|
+
* `only`. */
|
|
26
34
|
export type FieldDeal = {
|
|
27
35
|
pick: <T>(xs: readonly T[]) => T;
|
|
28
36
|
r: () => number;
|
|
29
37
|
accent: string;
|
|
30
38
|
mono: Face | undefined;
|
|
39
|
+
glass: (only?: RegExp) => string;
|
|
40
|
+
photo: (only?: RegExp) => string;
|
|
31
41
|
};
|
|
32
42
|
|
|
33
43
|
/** A dealt field card: the effect's settings, the card's ground and ink, its still (a CSS background, or markup laid
|
package/src/fields.js
CHANGED
|
@@ -24,8 +24,12 @@ import { gradientStill } from '@arraypress/effects-astro/runtime/dither-gradient
|
|
|
24
24
|
import { truchetStill } from '@arraypress/effects-astro/runtime/truchet-field';
|
|
25
25
|
import { horizonStill } from '@arraypress/effects-astro/runtime/pixel-horizon';
|
|
26
26
|
import { glowStill } from '@arraypress/effects-astro/runtime/fluted-glow';
|
|
27
|
+
import { photoBokehStill } from '@arraypress/effects-astro/runtime/photo-bokeh';
|
|
27
28
|
import { foldsStill } from '@arraypress/effects-astro/runtime/fluid-folds';
|
|
28
29
|
import { bokehStill } from '@arraypress/effects-astro/runtime/fluted-bokeh';
|
|
30
|
+
import { flareStill } from '@arraypress/effects-astro/runtime/lens-flare';
|
|
31
|
+
import { causticTones } from '@arraypress/effects-astro/runtime/caustics';
|
|
32
|
+
import { sunWallStill } from '@arraypress/effects-astro/runtime/sun-wall';
|
|
29
33
|
|
|
30
34
|
/** The glyphs' face when the wall has no monospaced one. */
|
|
31
35
|
export const MONO_FALLBACK = 'ui-monospace, SFMono-Regular, Menlo, monospace';
|
|
@@ -334,7 +338,8 @@ function dithergrad({ pick, r, accent }) {
|
|
|
334
338
|
...(shape === 'steps' ? { level: between(r, 0.18, 0.24), block: pick([5, 6, 7]) } : {}),
|
|
335
339
|
...(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
340
|
...(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]]) } : {}),
|
|
337
|
-
|
|
341
|
+
// fast enough to see it move (0.04–0.07 read as a still: the owner, 2026-11-28, "nothing else moves")
|
|
342
|
+
rate: between(r, 0.09, 0.13),
|
|
338
343
|
offset: offsetOf(r),
|
|
339
344
|
// an orb or a pill sits off the middle, so its quiet area is smaller and lighter
|
|
340
345
|
quiet: shape === 'orb' || shape === 'pill' ? { radius: 0.34, depth: 0.85 } : { radius: 0.5, depth: 1 },
|
|
@@ -392,6 +397,8 @@ function pixelhorizon({ pick, r, accent }) {
|
|
|
392
397
|
// the frontier kept under the lockup's name (the lockup's middle sits at about 0.45 across from any side)
|
|
393
398
|
level: between(r, 0.2, 0.27),
|
|
394
399
|
spread: between(r, 0.2, 0.3),
|
|
400
|
+
// blocks roll again more often than the effect's 0.6 a second: at that the band read as a still (2026-11-28)
|
|
401
|
+
rate: between(r, 1.3, 1.7),
|
|
395
402
|
seed: Math.round(r() * 1000),
|
|
396
403
|
quiet: { radius: 0.42, depth: 1 },
|
|
397
404
|
};
|
|
@@ -422,6 +429,7 @@ function flutedglow({ pick, r, accent }) {
|
|
|
422
429
|
...(shape === 'ring' ? { size: between(r, 0.28, 0.33) } : {}),
|
|
423
430
|
...(shape === 'orb' ? { size: between(r, 0.36, 0.44), centre: pick([[0.3, 0.75], [0.7, 0.25], [0.5, 0.82]]) } : {}),
|
|
424
431
|
...(shape === 'rise' ? { size: between(r, 0.5, 0.6) } : {}),
|
|
432
|
+
rate: between(r, 0.09, 0.12), // the effect's 0.05 read as a still (2026-11-28)
|
|
425
433
|
seed: Math.round(r() * 1000) / 100,
|
|
426
434
|
quiet: shape === 'ring' ? { radius: 0.2, depth: 0.5 } : { radius: 0.35, depth: 0.55 },
|
|
427
435
|
};
|
|
@@ -454,7 +462,8 @@ function fluidfolds({ pick, r, accent }) {
|
|
|
454
462
|
light: pick([-35, -20, 25, 40]),
|
|
455
463
|
hue: between(r, 0.35, 0.7),
|
|
456
464
|
...(style === 'dunes' ? { level: between(r, 0.42, 0.55) } : {}),
|
|
457
|
-
|
|
465
|
+
// the folds' phase runs in noise units, not turns: 0.025–0.045 read as a still (2026-11-28)
|
|
466
|
+
rate: between(r, 0.14, 0.2),
|
|
458
467
|
seed: Math.round(r() * 1000) / 100,
|
|
459
468
|
quiet: { radius: 0.42, depth: 0.55 },
|
|
460
469
|
};
|
|
@@ -487,6 +496,7 @@ function reededbokeh({ pick, r, accent }) {
|
|
|
487
496
|
streak: mode === 'blocks' ? 0.02 : between(r, 0.04, 0.09),
|
|
488
497
|
lights: pick([4, 5, 6]),
|
|
489
498
|
size: between(r, 0.18, 0.26),
|
|
499
|
+
rate: between(r, 0.1, 0.14), // the effect's 0.04 read as a still (2026-11-28)
|
|
490
500
|
seed: Math.round(r() * 1000) / 10,
|
|
491
501
|
quiet: { radius: 0.4, depth: 0.5 },
|
|
492
502
|
};
|
|
@@ -495,6 +505,228 @@ function reededbokeh({ pick, r, accent }) {
|
|
|
495
505
|
|
|
496
506
|
/* ---------- the table ---------- */
|
|
497
507
|
|
|
508
|
+
/* ---------- Bokeh drift (effects-astro's photoBokeh, after the owner's flower photos, 2026-11-28) ---------- */
|
|
509
|
+
|
|
510
|
+
/** The flower photos a bokeh card racks its focus across (the glass set's blooms, dahlias, irises and lilies). */
|
|
511
|
+
const BOKEH_PHOTOS = /\/(bloom|dahlia|iris|lily|marigold)-\d+\.webp$/;
|
|
512
|
+
|
|
513
|
+
/** photobokeh: a flower photo racking its focus near to far and back, soft lights tinted from its highlights drifting
|
|
514
|
+
* up through it, the lockup sharp in front. */
|
|
515
|
+
function photobokeh({ pick, r, glass }) {
|
|
516
|
+
const src = glass(BOKEH_PHOTOS);
|
|
517
|
+
const cfg = {
|
|
518
|
+
src,
|
|
519
|
+
blur: between(r, 0.024, 0.036),
|
|
520
|
+
rate: between(r, 0.08, 0.12),
|
|
521
|
+
near: between(r, 0.45, 0.7),
|
|
522
|
+
discs: pick([4, 5, 6]),
|
|
523
|
+
size: between(r, 0.09, 0.14),
|
|
524
|
+
glow: between(r, 0.5, 0.7),
|
|
525
|
+
shape: pick(['round', 'round', 'blades']),
|
|
526
|
+
drift: between(r, 0.018, 0.028),
|
|
527
|
+
seed: Math.round(r() * 1000) / 100,
|
|
528
|
+
quiet: { radius: 0.34, depth: 0.5 },
|
|
529
|
+
};
|
|
530
|
+
return { cfg, ground: '#0B0B0B', ink: '#F4F3EF', still: photoBokehStill(cfg) };
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
/* ---------- the light set (2026-11-28, the owner: "any other looks like lightleaks that can be done realistically?"):
|
|
534
|
+
an anamorphic lens flare, pool caustics, rain on a window, and sunlight on a wall through blinds or a prism ---------- */
|
|
535
|
+
|
|
536
|
+
/** Lens flare cards: ground, streak (the coating's colour), the ghosts' main tint. */
|
|
537
|
+
const FLARE_INKS = [
|
|
538
|
+
['#030406', '#4F8DFF', '#FFB36B'], // the classic blue streak
|
|
539
|
+
['#060403', '#FFA24A', '#4FD1FF'], // amber
|
|
540
|
+
['#020605', '#3AD7C8', '#FF7AB8'], // teal
|
|
541
|
+
['#050308', '#9B7BFF', '#FFD36B'], // violet
|
|
542
|
+
];
|
|
543
|
+
|
|
544
|
+
/** lensflare: an anamorphic flare from a light near an edge, its long blue streak across the card, ghosts drifting on
|
|
545
|
+
* the line through the centre; the lockup in the quiet middle. */
|
|
546
|
+
function lensflare({ pick, r }) {
|
|
547
|
+
const [ground, streak, ghost] = pick(FLARE_INKS);
|
|
548
|
+
const top = r() < 0.65;
|
|
549
|
+
const cfg = {
|
|
550
|
+
background: ground,
|
|
551
|
+
streak,
|
|
552
|
+
ghost,
|
|
553
|
+
source: [between(r, 0.18, 0.82), top ? between(r, 0.18, 0.3) : between(r, 0.7, 0.8)],
|
|
554
|
+
length: between(r, 1.3, 1.8),
|
|
555
|
+
width: between(r, 0.005, 0.008),
|
|
556
|
+
power: between(r, 0.85, 1.05),
|
|
557
|
+
ghosts: pick([4, 5, 6]),
|
|
558
|
+
drift: between(r, 0.05, 0.08),
|
|
559
|
+
rate: between(r, 0.05, 0.08),
|
|
560
|
+
seed: Math.round(r() * 1000) / 100,
|
|
561
|
+
quiet: { radius: 0.3, depth: 0.45 },
|
|
562
|
+
};
|
|
563
|
+
return { cfg, ground, ink: '#F4F3EF', still: flareStill(cfg) };
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
/** Caustics cards' water: the colours (deep, floor, light) and whether the pool has tiles. */
|
|
567
|
+
const CAUSTIC_WATERS = [
|
|
568
|
+
[['#06323F', '#1C8CA0', '#E9FBFF'], true], // a pool, tiled
|
|
569
|
+
[['#052B36', '#1693A6', '#F2FFFF'], false], // a pool, plain
|
|
570
|
+
[['#0A2A24', '#2E8F79', '#F4FFE8'], false], // a lagoon
|
|
571
|
+
[['#06142E', '#1F4F8F', '#DCEBFF'], true], // a pool at dusk
|
|
572
|
+
];
|
|
573
|
+
|
|
574
|
+
/** caustics: sunlight through rippling water on a pool floor, a bright net with rainbow edges, the floor deepening to
|
|
575
|
+
* its sides; the lockup over a calmer middle. */
|
|
576
|
+
function caustics({ pick, r }) {
|
|
577
|
+
const [colors, tiles] = pick(CAUSTIC_WATERS);
|
|
578
|
+
const cfg = {
|
|
579
|
+
colors,
|
|
580
|
+
tiles,
|
|
581
|
+
scale: between(r, 0.9, 1.3),
|
|
582
|
+
speed: between(r, 0.7, 1),
|
|
583
|
+
intensity: between(r, 0.75, 0.95),
|
|
584
|
+
interactive: false,
|
|
585
|
+
quiet: { radius: 0.36, depth: 0.6 },
|
|
586
|
+
};
|
|
587
|
+
const t = causticTones(cfg);
|
|
588
|
+
return {
|
|
589
|
+
cfg,
|
|
590
|
+
ground: t.background,
|
|
591
|
+
ink: '#F4F3EF',
|
|
592
|
+
still: `radial-gradient(ellipse at 50% 50%, ${t.floor}, ${t.deep} 70%, ${t.background})`,
|
|
593
|
+
under: causticStill(cfg, t, Math.floor(r() * 997)),
|
|
594
|
+
};
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
/**
|
|
598
|
+
* A caustics card's still: the bright net of light on the pool floor, drawn by an SVG filter (fractal noise whose
|
|
599
|
+
* ridges, a narrow band either side of its middle value, are lit), soft at its edges, a warm and a cool fringe
|
|
600
|
+
* offset either side as the water's rainbow edges, the tiles faint under it.
|
|
601
|
+
* Close to the live frame, so the canvas fades in over it without a jump.
|
|
602
|
+
*
|
|
603
|
+
* @param cfg The card's caustic settings.
|
|
604
|
+
* @param t Its tones (`causticTones`).
|
|
605
|
+
* @param seed The noise's seed.
|
|
606
|
+
*/
|
|
607
|
+
function causticStill(cfg, t, seed) {
|
|
608
|
+
const id = `wlk-cst${seed}`;
|
|
609
|
+
const f = (0.0105 / cfg.scale).toFixed(4);
|
|
610
|
+
// the ridge: a table lit only where the noise is near its middle
|
|
611
|
+
const ridge = '0 0 0 0 0 .35 1 .35 0 0 0 0 0';
|
|
612
|
+
const net = (dx, color, op) =>
|
|
613
|
+
`<g filter="url(#${id})" transform="translate(${dx} 0)" opacity="${op}"><rect width="400" height="500" fill="${color}" /></g>`;
|
|
614
|
+
const tiles = cfg.tiles
|
|
615
|
+
? `<pattern id="${id}t" width="50" height="50" patternUnits="userSpaceOnUse"><path d="M50 0H0V50" fill="none" stroke="${t.deep}" stroke-width="2" opacity="0.5" /></pattern><rect width="400" height="500" fill="url(#${id}t)" />`
|
|
616
|
+
: '';
|
|
617
|
+
return (
|
|
618
|
+
`<svg class="wc-noise wc-caustic" viewBox="0 0 400 500" preserveAspectRatio="xMidYMid slice" aria-hidden="true">` +
|
|
619
|
+
`<defs><filter id="${id}" x="0" y="0" width="100%" height="100%" color-interpolation-filters="sRGB">` +
|
|
620
|
+
`<feTurbulence type="fractalNoise" baseFrequency="${f}" numOctaves="2" seed="${seed}" result="n" />` +
|
|
621
|
+
`<feComponentTransfer in="n" result="r"><feFuncA type="table" tableValues="${ridge}" /><feFuncR type="table" tableValues="${ridge}" /></feComponentTransfer>` +
|
|
622
|
+
`<feColorMatrix in="r" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0" result="m" />` +
|
|
623
|
+
`<feGaussianBlur in="m" stdDeviation=".7" result="b" />` +
|
|
624
|
+
`<feComposite in="SourceGraphic" in2="b" operator="in" /></filter></defs>` +
|
|
625
|
+
tiles +
|
|
626
|
+
net(-2.5, '#ffb38a', 0.45) +
|
|
627
|
+
net(2.5, '#7ad7ff', 0.45) +
|
|
628
|
+
net(0, t.light ?? '#ffffff', 0.8) +
|
|
629
|
+
`</svg>`
|
|
630
|
+
);
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
/** The photos rain runs down the glass in front of: the club, the off-focus and rim-lit portraits, the flowers. */
|
|
634
|
+
const RAIN_PHOTOS = /\/(club-\d+|offfocus-\d+|rimlight-\d+)\.webp$/;
|
|
635
|
+
|
|
636
|
+
/** rainglass: rain on a window in front of a photo, beads holding it sharp and upside down, drops sliding down in fits
|
|
637
|
+
* and starts, the photo soft behind the fogged glass. */
|
|
638
|
+
function rainglass({ pick, r, photo }) {
|
|
639
|
+
const src = photo(RAIN_PHOTOS);
|
|
640
|
+
const cfg = {
|
|
641
|
+
src,
|
|
642
|
+
rain: between(r, 0.45, 0.7),
|
|
643
|
+
blur: between(r, 0.55, 0.75),
|
|
644
|
+
fog: between(r, 0.35, 0.55),
|
|
645
|
+
bokeh: between(r, 0.2, 0.35),
|
|
646
|
+
speed: between(r, 0.8, 1.1),
|
|
647
|
+
interactive: false,
|
|
648
|
+
};
|
|
649
|
+
return { cfg, ground: '#0B0B0B', ink: '#F4F3EF', still: `#0B0B0B`, under: rainStill(src, r) };
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
/**
|
|
653
|
+
* A rain card's still: the photo soft behind fogged glass, and beads on the glass, each a small lens: a highlight up
|
|
654
|
+
* and to the left, clear in the middle, a dark rim. The live frame fades in over it.
|
|
655
|
+
*
|
|
656
|
+
* @param src The photo.
|
|
657
|
+
* @param r The card's random.
|
|
658
|
+
*/
|
|
659
|
+
function rainStill(src, r) {
|
|
660
|
+
const id = `wlk-rst${Math.floor(r() * 1e6)}`;
|
|
661
|
+
const beads = [];
|
|
662
|
+
for (let k = 0; k < 22; k++) {
|
|
663
|
+
const x = Math.round(r() * 400), y = Math.round(r() * 500);
|
|
664
|
+
// keep the middle (the lockup) clearer
|
|
665
|
+
if (Math.hypot((x - 200) / 400, (y - 250) / 500) < 0.18 && r() < 0.8) continue;
|
|
666
|
+
beads.push(`<circle cx="${x}" cy="${y}" r="${(2 + r() * r() * 9).toFixed(1)}"/>`);
|
|
667
|
+
}
|
|
668
|
+
return (
|
|
669
|
+
`<svg class="wc-noise wc-rain" viewBox="0 0 400 500" preserveAspectRatio="xMidYMid slice" aria-hidden="true">` +
|
|
670
|
+
`<defs><filter id="${id}b" x="-5%" y="-5%" width="110%" height="110%"><feGaussianBlur stdDeviation="9"/></filter>` +
|
|
671
|
+
`<radialGradient id="${id}d" fx="0.35" fy="0.3"><stop stop-color="#fff" stop-opacity=".75"/><stop offset=".25" stop-color="#cfe0ee" stop-opacity=".18"/><stop offset=".8" stop-opacity=".15"/><stop offset="1" stop-opacity=".55"/></radialGradient></defs>` +
|
|
672
|
+
`<image href="${escapeHtml(src)}" width="400" height="500" preserveAspectRatio="xMidYMid slice" filter="url(#${id}b)"/>` +
|
|
673
|
+
`<rect width="400" height="500" fill="#a3b8cc" fill-opacity="0.12"/><g fill="url(#${id}d)">${beads.join('')}</g></svg>`
|
|
674
|
+
);
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
/** Sunlit walls: the paint, the sun's colour. */
|
|
678
|
+
const WALLS = [
|
|
679
|
+
['#D8C3A5', '#FFE2B0'], // warm plaster
|
|
680
|
+
['#ECE6DC', '#FFE9C4'], // white plaster
|
|
681
|
+
['#C9A48A', '#FFD9A8'], // clay
|
|
682
|
+
['#B9A7C9', '#FFE6C9'], // lilac
|
|
683
|
+
['#A9B8AE', '#FFEBC6'], // sage
|
|
684
|
+
];
|
|
685
|
+
|
|
686
|
+
/** sunblinds: low sun through venetian blinds on a plaster wall, hard bars softening with the throw, creeping. */
|
|
687
|
+
function sunblinds({ pick, r }) {
|
|
688
|
+
const [wall, sun] = pick(WALLS);
|
|
689
|
+
const cfg = {
|
|
690
|
+
mode: 'blinds',
|
|
691
|
+
wall,
|
|
692
|
+
sun,
|
|
693
|
+
angle: pick([-28, -22, -14, 14, 22, 28]),
|
|
694
|
+
slats: pick([10, 12, 14]),
|
|
695
|
+
open: between(r, 0.5, 0.62),
|
|
696
|
+
soft: between(r, 0.45, 0.7),
|
|
697
|
+
patch: [r() < 0.5 ? between(r, 0.2, 0.26) : between(r, 0.74, 0.8), between(r, 0.4, 0.5)],
|
|
698
|
+
size: [between(r, 0.5, 0.6), between(r, 0.66, 0.8)],
|
|
699
|
+
drift: between(r, 0.04, 0.06),
|
|
700
|
+
rate: between(r, 0.08, 0.11),
|
|
701
|
+
seed: Math.round(r() * 1000) / 100,
|
|
702
|
+
// the bars fall away behind the lockup, as if it sat just in the patch's shade
|
|
703
|
+
quiet: { radius: 0.32, depth: 0.85 },
|
|
704
|
+
};
|
|
705
|
+
return { cfg, ground: wall, ink: '#F4F3EF', still: sunWallStill(cfg) };
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
/** prismlight: a patch of low sun on a wall, and beside it in the shade the short spectrum a glass edge throws. */
|
|
709
|
+
function prismlight({ pick, r }) {
|
|
710
|
+
const [wall, sun] = pick(WALLS);
|
|
711
|
+
const left = r() < 0.5;
|
|
712
|
+
const cfg = {
|
|
713
|
+
mode: 'prism',
|
|
714
|
+
wall,
|
|
715
|
+
sun,
|
|
716
|
+
angle: pick([-14, -8, 8, 14, 20]),
|
|
717
|
+
soft: between(r, 0.15, 0.3),
|
|
718
|
+
patch: [left ? between(r, 0.26, 0.34) : between(r, 0.62, 0.7), between(r, 0.38, 0.48)],
|
|
719
|
+
size: [between(r, 0.36, 0.44), between(r, 0.5, 0.62)],
|
|
720
|
+
band: between(r, 0.075, 0.1),
|
|
721
|
+
bow: between(r, 0.03, 0.07),
|
|
722
|
+
drift: between(r, 0.03, 0.05),
|
|
723
|
+
rate: between(r, 0.08, 0.11),
|
|
724
|
+
seed: Math.round(r() * 1000) / 100,
|
|
725
|
+
quiet: { radius: 0.24, depth: 0.45 },
|
|
726
|
+
};
|
|
727
|
+
return { cfg, ground: wall, ink: '#F4F3EF', still: sunWallStill(cfg) };
|
|
728
|
+
}
|
|
729
|
+
|
|
498
730
|
/** The field cards by kind: the effect that draws each (effects-astro's runtime, by its file name), its label, and its
|
|
499
731
|
* deal. */
|
|
500
732
|
export const FIELDS = {
|
|
@@ -511,6 +743,12 @@ export const FIELDS = {
|
|
|
511
743
|
flutedglow: { effect: 'fluted-glow', label: 'Reeded glow', deal: flutedglow },
|
|
512
744
|
fluidfolds: { effect: 'fluid-folds', label: 'Liquid folds', deal: fluidfolds },
|
|
513
745
|
reededbokeh: { effect: 'fluted-bokeh', label: 'Reeded bokeh', deal: reededbokeh },
|
|
746
|
+
photobokeh: { effect: 'photo-bokeh', label: 'Bokeh drift', deal: photobokeh },
|
|
747
|
+
lensflare: { effect: 'lens-flare', label: 'Lens flare', deal: lensflare },
|
|
748
|
+
caustics: { effect: 'caustics', label: 'Caustics', deal: caustics },
|
|
749
|
+
rainglass: { effect: 'rain-on-glass', label: 'Rain on glass', deal: rainglass },
|
|
750
|
+
sunblinds: { effect: 'sun-wall', label: 'Sun through blinds', deal: sunblinds },
|
|
751
|
+
prismlight: { effect: 'sun-wall', label: 'Prism light', deal: prismlight },
|
|
514
752
|
};
|
|
515
753
|
|
|
516
754
|
/** Whether a kind is a field card. */
|
package/src/glass.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
/** The glass cards' kinds. */
|
|
9
|
-
export type GlassKind = 'glassdrop' | 'glassstack';
|
|
9
|
+
export type GlassKind = 'glassdrop' | 'glassstack' | 'paintdrip';
|
|
10
10
|
|
|
11
11
|
/** What a glass card is dealt from: the card's seeded pick and random, the accent, the mark's paths and the card's id. */
|
|
12
12
|
export type GlassDeal = {
|