@arraypress/effects-astro 0.9.0 → 0.11.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/AGENTS.md +1 -1
- package/COMPONENTS.md +160 -0
- package/LICENSE +2 -2
- package/package.json +1 -1
- package/src/components/AsciiNoise.astro +37 -0
- package/src/components/CascadeGrid.astro +41 -0
- package/src/components/DitherField.astro +41 -0
- package/src/components/FlowField.astro +38 -0
- package/src/components/KineticGrid.astro +38 -0
- package/src/components/LightLeak.astro +39 -0
- package/src/components/VoronoiMesh.astro +39 -0
- package/src/index.d.ts +15 -0
- package/src/index.js +8 -0
- package/src/runtime/ascii-noise.d.ts +75 -0
- package/src/runtime/ascii-noise.js +276 -0
- package/src/runtime/cascade-grid.d.ts +112 -0
- package/src/runtime/cascade-grid.js +423 -0
- package/src/runtime/dither-field.d.ts +74 -0
- package/src/runtime/dither-field.js +442 -0
- package/src/runtime/flow-field.d.ts +117 -0
- package/src/runtime/flow-field.js +516 -0
- package/src/runtime/hash-noise.d.ts +14 -0
- package/src/runtime/hash-noise.js +169 -0
- package/src/runtime/kinetic-grid.d.ts +88 -0
- package/src/runtime/kinetic-grid.js +487 -0
- package/src/runtime/light-leak.d.ts +72 -0
- package/src/runtime/light-leak.js +408 -0
- package/src/runtime/voronoi-mesh.d.ts +101 -0
- package/src/runtime/voronoi-mesh.js +610 -0
package/AGENTS.md
CHANGED
|
@@ -10,7 +10,7 @@ Pick by what is asked for:
|
|
|
10
10
|
|
|
11
11
|
| Asked for | Use |
|
|
12
12
|
|---|---|
|
|
13
|
-
| An animated, colourful background for a page or hero | `<LightField>` (liquid light), `<FlutedGlass>` (light, gallery-white or dark), `<AsciiRain>` (techy, dark), `<DotGrid>` (quiet, minimal), `<SignalLines>` / `<WaveBars>` (audio) |
|
|
13
|
+
| An animated, colourful background for a page or hero | `<LightField>` (liquid light), `<FlutedGlass>` (light, gallery-white or dark), `<AsciiRain>` (techy, dark), `<AsciiNoise>` (drifting blobs of monospace type; techy, terminal, studio), `<LightLeak>` (a soft drifting colour field), `<DitherField>` (dithered dots, ripples from a corner), `<CascadeGrid>` (a hex or dot spectrogram), `<FlowField>` (fine trails on a flow; Canvas), `<VoronoiMesh>` (thin nested cell lines), `<KineticGrid>` (a wire grid rain ripples), `<DotGrid>` (quiet, minimal), `<SignalLines>` / `<WaveBars>` (audio) |
|
|
14
14
|
| Ink in water, a lit fluid background, or a hero whose colours a palette switcher changes | `<InkField palette="…">` (Lumetri, Forest, Cadmium, Peacock, Vermillion, Barbie, Uranium, Azure, Ruby, Ultramarine, Saffron, Crimson); `setColors(el, INK_PALETTES[name].colors, INK_PALETTES[name].glint)` recolours it live |
|
|
15
15
|
| Something to play with: ink, smoke, liquid, "interactive" | `<Ink>` over a section, or `<LightField>` (it has the fluid under it), or `<DotGrid>` (click ripples) |
|
|
16
16
|
| A soft gradient that drifts (a card, a hero, a section) — "grainy gradient", "mesh", "aurora" | `<LiveGradient colors={[…]}>` (lazy by default; `liveGradient(colors)` for HTML made in a script) |
|
package/COMPONENTS.md
CHANGED
|
@@ -4,6 +4,38 @@ Every component in `@arraypress/effects-astro`, with every prop. Generated from
|
|
|
4
4
|
|
|
5
5
|
Import each from its own path: `import Name from '@arraypress/effects-astro/Name.astro'`.
|
|
6
6
|
|
|
7
|
+
## `<AsciiNoise>`
|
|
8
|
+
|
|
9
|
+
AsciiNoise: a field of slow noise drawn as a grid of monospace characters, soft-edged blobs of type drifting and morphing, the quiet cells in one colour and the loud in another. See src/runtime/ascii-noise.js.
|
|
10
|
+
|
|
11
|
+
```astro
|
|
12
|
+
<section class="hero" style="position: relative; background: #0b0b0b">
|
|
13
|
+
<AsciiNoise glyphs="shade" colors={['#2c3a0a', '#c8ff00']} quiet={{ x: 0.3, y: 0.5, radius: 0.6, depth: 0.9 }} />
|
|
14
|
+
<h1>…</h1>
|
|
15
|
+
</section>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
| Prop | Type | |
|
|
19
|
+
|---|---|---|
|
|
20
|
+
| `colors` | `string[]` | Two CSS hex colours: the quietest cells' and the loudest's. Default a dim grey and white. |
|
|
21
|
+
| `palette` | `PaletteName \| (string & {})` | A shared palette by name (`PALETTES`, any case), when there are no `colors`: its first and last colours. |
|
|
22
|
+
| `background` | `string` | A CSS hex colour to fill behind the type; none leaves the canvas clear there. |
|
|
23
|
+
| `glyphs` | `keyof typeof NOISE_RAMPS \| (string & {})` | A ramp (`ascii`, `shade`, `digits`, `rise`, `quads`, `bars`, `arrows`, `letters`, `dense`, or a set of `GLYPH_SETS`) or the characters, quietest first. Default `ascii`. |
|
|
24
|
+
| `cell` | `number` | A character cell's height in CSS px. Default 14. |
|
|
25
|
+
| `cols` | `number` | Cells across instead, whatever the width (overrides `cell`). |
|
|
26
|
+
| `aspect` | `number` | A cell's width over its height. Default 0.6. |
|
|
27
|
+
| `scale` | `number` | How many noise features span the width (higher is busier). Default 2.45. |
|
|
28
|
+
| `contrast` | `number` | How hard the edges are: higher pushes cells to empty or full. Default 6. |
|
|
29
|
+
| `brightness` | `number` | Shifts the whole field; lower leaves more cells empty. Default -0.1. |
|
|
30
|
+
| `drift` | `[number, number]` | How fast the sample window pans, widths a second, x and y. Default [0.036, 0.012]. |
|
|
31
|
+
| `evolve` | `number` | How fast the shapes morph. Default 0.24. |
|
|
32
|
+
| `offset` | `[number, number]` | Where the sample window starts, so two cards differ. Default [0, 0]. |
|
|
33
|
+
| `speed` | `number` | Plays every clock faster or slower; 0 for one still frame. Default 1. |
|
|
34
|
+
| `quiet` | `{ x?: number; y?: number; radius?: number; depth?: number } \| null` | An area kept quiet: centre (0–1 from the top left), radius (share of the height), depth (0–1). |
|
|
35
|
+
| `font` | `string` | The font family the glyphs are drawn in (a monospace stack by default); it is loaded first. |
|
|
36
|
+
| `fixed` | `boolean` | Fill the viewport (position: fixed). Default false. |
|
|
37
|
+
| `class` | `string` | Classes for the element. |
|
|
38
|
+
|
|
7
39
|
## `<AsciiRain>`
|
|
8
40
|
|
|
9
41
|
AsciiRain: data rain on a rippling surface, drawn in text characters, with red and blue fringes at the glyph edges. The pointer ripples the surface and a click sends a ring out. See src/runtime/ascii-rain.js.
|
|
@@ -66,6 +98,23 @@ BorderSweep: a light travelling round an element's outline, on hover and focus o
|
|
|
66
98
|
| `still` | `'ring' \| 'none'` | What reduced motion shows: `ring` a still lit edge where the light would run, `none` nothing. Default `ring`. |
|
|
67
99
|
| `class` | `string` | Classes for the element. |
|
|
68
100
|
|
|
101
|
+
## `<CascadeGrid>`
|
|
102
|
+
|
|
103
|
+
CascadeGrid: a grid of hexagons or dots that behaves like a scrolling spectrogram, each column showing the same made-up spectrum a little later than the last, so waves cascade across it and the cells swell from idle specks to reactive shapes. See src/runtime/cascade-grid.js.
|
|
104
|
+
|
|
105
|
+
```astro
|
|
106
|
+
<section class="hero" style="position: relative; background: #0b0b0b">
|
|
107
|
+
<CascadeGrid colors={['#2a2a2a', '#c8ff00']} background="#0b0b0b" quiet={{ radius: 0.5, depth: 0.95 }} />
|
|
108
|
+
<h1>…</h1>
|
|
109
|
+
</section>
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
| Prop | Type | |
|
|
113
|
+
|---|---|---|
|
|
114
|
+
| `fixed` | `boolean` | Fill the viewport (position: fixed). Default false. |
|
|
115
|
+
| `lazy` | `boolean \| string` | Run only while near the screen, giving its WebGL context back when away: for pages with many effects. Default false. |
|
|
116
|
+
| `class` | `string` | Classes for the element. |
|
|
117
|
+
|
|
69
118
|
## `<Caustics>`
|
|
70
119
|
|
|
71
120
|
Caustics: sunlight through rippling water onto a pool floor, a bright, shifting net of light over an aqua ground, with a faint rainbow at the edges of its lines. The pointer stirs the water where it is; faint tiles can lie on the floor. See src/runtime/caustics.js.
|
|
@@ -140,6 +189,23 @@ Cursor: a custom cursor for the whole page: a dot at the pointer and a ring that
|
|
|
140
189
|
| `size` | `number` | The ring's size at rest, px. Default 32. |
|
|
141
190
|
| `blend` | `string` | Blend with the page: `difference` inverts what is under it, readable on any ground. Default `difference`. |
|
|
142
191
|
|
|
192
|
+
## `<DitherField>`
|
|
193
|
+
|
|
194
|
+
DitherField: a field of slow noise drawn in square dots, Bayer-dithered at its edges into a solid, colour-banded core, with ripples running out from a corner, bent into shore-wave shapes. See src/runtime/dither-field.js.
|
|
195
|
+
|
|
196
|
+
```astro
|
|
197
|
+
<section class="hero" style="position: relative; background: #0b0b0b">
|
|
198
|
+
<DitherField background="#0b0b0b" colors={['#3d4d0a', '#c8ff00']} quiet={{ x: 0.3, y: 0.5, radius: 0.6, depth: 1 }} />
|
|
199
|
+
<h1>…</h1>
|
|
200
|
+
</section>
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
| Prop | Type | |
|
|
204
|
+
|---|---|---|
|
|
205
|
+
| `fixed` | `boolean` | Fill the viewport (position: fixed). Default false. |
|
|
206
|
+
| `lazy` | `boolean \| string` | Run only while near the screen (true, or how near as a CSS length), giving its WebGL context back when away: for pages with many effects. Default false. |
|
|
207
|
+
| `class` | `string` | Classes for the element. |
|
|
208
|
+
|
|
143
209
|
## `<DotGrid>`
|
|
144
210
|
|
|
145
211
|
DotGrid: a sea of dots you can drop stones into. A slow current moves through a fixed grid of dots, a swell sits under the pointer, and a click sends a widening ripple across, lifting and pushing the dots. See src/runtime/dot-grid.js.
|
|
@@ -202,6 +268,38 @@ FitText: one line of text sized to exactly span its parent's content width, what
|
|
|
202
268
|
| `as` | `HTMLTag` | The element to render. Default `div`. |
|
|
203
269
|
| `class` | `string` | Classes for the element. |
|
|
204
270
|
|
|
271
|
+
## `<FlowField>`
|
|
272
|
+
|
|
273
|
+
FlowField: hundreds of short, fine trails riding a slowly evolving noise flow, born, gathering into streams and fading, white on black by default; how many there are, how fast they go and how heavy the lines are drift slowly. See src/runtime/flow-field.js.
|
|
274
|
+
|
|
275
|
+
```astro
|
|
276
|
+
<section class="hero" style="position: relative">
|
|
277
|
+
<FlowField colors={['#c8ff00', '#39ff88']} background="#0b0b0b" quiet={{ radius: 0.5, depth: 0.85 }} />
|
|
278
|
+
<h1>…</h1>
|
|
279
|
+
</section>
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
| Prop | Type | |
|
|
283
|
+
|---|---|---|
|
|
284
|
+
| `colors` | `string[]` | The trails' colours, CSS hex, blended in Oklab along each trail's life (or by its speed). Default white. |
|
|
285
|
+
| `palette` | `PaletteName \| (string & {})` | A shared palette by name (`PALETTES`, any case), when there are no `colors`. |
|
|
286
|
+
| `background` | `string` | The ground, CSS hex: filled every frame, so the canvas is opaque. Default `#000000`. |
|
|
287
|
+
| `colorBy` | `'life' \| 'speed' \| 'random'` | What picks a trail's colour along `colors`: its age, how fast it travels, or one colour each at random. Default `life`. |
|
|
288
|
+
| `density` | `number` | Trails per 100 × 100 CSS px, on average. Default 12. |
|
|
289
|
+
| `length` | `number` | How much of its path a trail shows behind it, seconds. Default 0.5. |
|
|
290
|
+
| `weight` | `number` | Line width, CSS px. Default 0.7. |
|
|
291
|
+
| `opacity` | `number` | A trail head's opacity, 0–1; the tail fades from it. Default 0.75. |
|
|
292
|
+
| `pace` | `number` | How fast trails travel, CSS px a second, on average. Default 110. |
|
|
293
|
+
| `scale` | `number` | How many noise features span the element (across √(width × height)); higher is busier. Default 2. |
|
|
294
|
+
| `evolve` | `number` | How fast the field changes, noise units a second. Default 0.15. |
|
|
295
|
+
| `life` | `number` | A trail's average life, seconds (each lives half to one and a half times it). Default 4. |
|
|
296
|
+
| `vary` | `number` | How far the slow drives swing density, pace, weight and evolution, 0–1; 0 holds them. Default 0.7. |
|
|
297
|
+
| `speed` | `number` | Plays every clock faster or slower; 0 for one still frame. Default 1. |
|
|
298
|
+
| `seed` | `number` | Which field and which trails: the same seed draws the same. Default 1. |
|
|
299
|
+
| `quiet` | `{ x?: number; y?: number; radius?: number; depth?: number } \| null` | An area with fewer, fainter trails: centre (0–1 from the top left), radius (share of the height), depth (0–1). |
|
|
300
|
+
| `fixed` | `boolean` | Fill the viewport, behind the page (position: fixed, z-index -1). Default false. |
|
|
301
|
+
| `class` | `string` | Classes for the element. |
|
|
302
|
+
|
|
205
303
|
## `<FlutedGlass>`
|
|
206
304
|
|
|
207
305
|
FlutedGlass: a pane of slanted fluted glass over soft blooms of colour, the main one following the pointer. Each rib bends what is behind it and fringes it with a thin rainbow. See src/runtime/fluted-glass.js.
|
|
@@ -528,6 +626,35 @@ IsoCity: a small isometric city in flat-shaded low poly, with cars driving its s
|
|
|
528
626
|
| `fixed` | `boolean` | Fill the viewport, behind the page (position: fixed, z-index -1). Default false. |
|
|
529
627
|
| `class` | `string` | Classes for the element. |
|
|
530
628
|
|
|
629
|
+
## `<KineticGrid>`
|
|
630
|
+
|
|
631
|
+
KineticGrid: a fine wireframe grid that ripples where drops land, the rings spreading and settling, brighter where a wire is stretched, with thin bright ring pulses lighting the wire segments they cross. See src/runtime/kinetic-grid.js.
|
|
632
|
+
|
|
633
|
+
```astro
|
|
634
|
+
<section class="hero" style="position: relative">
|
|
635
|
+
<KineticGrid colors={['#c8ff00', '#ffffff']} background="#0b0b0b" quiet={{ x: 0.3, y: 0.5, radius: 0.6, depth: 0.85 }} />
|
|
636
|
+
<h1>…</h1>
|
|
637
|
+
</section>
|
|
638
|
+
```
|
|
639
|
+
|
|
640
|
+
| Prop | Type | |
|
|
641
|
+
|---|---|---|
|
|
642
|
+
| `colors` | `string[]` | Two CSS hex colours: the wires' and the pulses'. Default the sketch's blue and white. |
|
|
643
|
+
| `palette` | `PaletteName \| (string & {})` | A shared palette by name (`PALETTES`, any case), when there are no `colors`: its first colour for the wires, its glint for the pulses. |
|
|
644
|
+
| `background` | `string` | The ground, a CSS hex colour (opaque, so the canvas covers what is under it); `transparent` leaves it clear. Default '#0a0a0a'. |
|
|
645
|
+
| `cols` | `number` | Grid cells across, whatever the width (cells are square). Default 48. |
|
|
646
|
+
| `width` | `number` | A wire's width, CSS px. Default 1. |
|
|
647
|
+
| `rest` | `number` | How bright a wire at rest is, 0–1; stretched wires brighten to full. Default 0.35. |
|
|
648
|
+
| `drops` | `number` | Drops alive at once, 0–6 (each slot lands a new one about every five seconds). Default 4. |
|
|
649
|
+
| `strength` | `number` | How far the ripples push the wires, 0–1.6 (past that they fold). Default 1. |
|
|
650
|
+
| `size` | `number` | The ripples' scale: wavelength, reach and speed together, 0.5–2. Default 1. |
|
|
651
|
+
| `pulses` | `number` | Ring pulses alive at once, 0–4 (each slot about every two and a half seconds). Default 3. |
|
|
652
|
+
| `speed` | `number` | Plays the clock faster or slower; 0 for one still frame. Default 1. |
|
|
653
|
+
| `offset` | `number` | Seeds where and when drops land, so two cards differ. Default 0. |
|
|
654
|
+
| `quiet` | `{ x?: number; y?: number; radius?: number; depth?: number } \| null` | An area kept calm and dim: centre (0–1 from the top left), radius (share of the height), depth (0–1). |
|
|
655
|
+
| `fixed` | `boolean` | Fill the viewport (position: fixed). Default false. |
|
|
656
|
+
| `class` | `string` | Classes for the element. |
|
|
657
|
+
|
|
531
658
|
## `<LightField>`
|
|
532
659
|
|
|
533
660
|
LightField: liquid light in three colours, bending around the pointer, with a real fluid under it that the pointer stirs and a click drops ink into. See src/runtime/light-field.js for how it is drawn.
|
|
@@ -553,6 +680,23 @@ LightField: liquid light in three colours, bending around the pointer, with a re
|
|
|
553
680
|
| `background` | `string` | The colour under the light, and under the fallback gradient. Default `#08080a`. |
|
|
554
681
|
| `class` | `string` | Classes for the element. |
|
|
555
682
|
|
|
683
|
+
## `<LightLeak>`
|
|
684
|
+
|
|
685
|
+
LightLeak: a soft, slow colour field, a lava lamp or a light leak: drifting fBm blobs under a gentle warp, mixed through four colours (darkest first) in Oklab, with a breath too slow to see as one. See src/runtime/light-leak.js.
|
|
686
|
+
|
|
687
|
+
```astro
|
|
688
|
+
<section class="hero" style="position: relative">
|
|
689
|
+
<LightLeak colors={['#0b0b0b', '#1a2a8c', '#0038ff', '#ff5c64']} quiet={{ radius: 0.5, depth: 0.8 }} />
|
|
690
|
+
<h1>…</h1>
|
|
691
|
+
</section>
|
|
692
|
+
```
|
|
693
|
+
|
|
694
|
+
| Prop | Type | |
|
|
695
|
+
|---|---|---|
|
|
696
|
+
| `fixed` | `boolean` | Fill the viewport (position: fixed). Default false. |
|
|
697
|
+
| `lazy` | `boolean \| string` | Run only while near the screen (true, or a CSS length), giving its WebGL context back when away: for a wall of cards. Default false. |
|
|
698
|
+
| `class` | `string` | Classes for the element. |
|
|
699
|
+
|
|
556
700
|
## `<LiquidMetal>`
|
|
557
701
|
|
|
558
702
|
LiquidMetal: a logo or a word made of liquid chrome. At rest it is a polished slab of metal reflecting a slowly turning studio; the pointer dents it and sends ripples across it, a stroke parts it, a click splashes it (a crater, a ring wave, droplets that fall and crawl back), and surface tension pulls it back into shape with a last wobble. See src/runtime/liquid-metal.js.
|
|
@@ -1312,6 +1456,22 @@ VariableType: a headline in a variable font whose letters swell under the pointe
|
|
|
1312
1456
|
| `as` | `HTMLTag` | The element to render. Default `div`. |
|
|
1313
1457
|
| `class` | `string` | Classes for the element. |
|
|
1314
1458
|
|
|
1459
|
+
## `<VoronoiMesh>`
|
|
1460
|
+
|
|
1461
|
+
VoronoiMesh: a Voronoi mesh in thin lines on a ground, in two nested tiers: macro cells whose seeds orbit slowly, and inner cells inside each that pulse outward from its seed. Pale lines on deep maroon by default. See src/runtime/voronoi-mesh.js.
|
|
1462
|
+
|
|
1463
|
+
```astro
|
|
1464
|
+
<section class="hero" style="position: relative">
|
|
1465
|
+
<VoronoiMesh cells={8} quiet={{ x: 0.3, y: 0.5, radius: 0.7, depth: 0.8 }} />
|
|
1466
|
+
<h1>…</h1>
|
|
1467
|
+
</section>
|
|
1468
|
+
```
|
|
1469
|
+
|
|
1470
|
+
| Prop | Type | |
|
|
1471
|
+
|---|---|---|
|
|
1472
|
+
| `fixed` | `boolean` | Fill the viewport (position: fixed). Default false. |
|
|
1473
|
+
| `class` | `string` | Classes for the element. |
|
|
1474
|
+
|
|
1315
1475
|
## `<VoxelLogo>`
|
|
1316
1476
|
|
|
1317
1477
|
VoxelLogo: a logo or character built of cubes, rocking slowly in perspective and turning towards the pointer, outlined where cubes meet and dithered down to two inks. With `markers`, tracking markers ring it. See src/runtime/voxel-logo.js.
|
package/LICENSE
CHANGED
|
@@ -78,8 +78,8 @@ SOFTWARE.
|
|
|
78
78
|
|
|
79
79
|
---
|
|
80
80
|
|
|
81
|
-
The
|
|
82
|
-
"Hash without Sine" (https://www.shadertoy.com/view/4djSRW):
|
|
81
|
+
The hashes in src/runtime/shader-backgrounds/grain-gradient.js,
|
|
82
|
+
src/runtime/hash-noise.js and src/runtime/light-leak.js are Dave Hoskins' "Hash without Sine" (https://www.shadertoy.com/view/4djSRW):
|
|
83
83
|
|
|
84
84
|
Copyright (c) 2014 David Hoskins
|
|
85
85
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arraypress/effects-astro",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "GPU effects for Astro sites, as components: liquid light with a real fluid under it, ink in water, and outline text a spotlight fills. Plain WebGL, no third-party dependencies, with the fallbacks a theme needs (reduced motion, no WebGL, touch screens, off-screen pausing).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
/**
|
|
3
|
+
* AsciiNoise: a field of slow noise drawn as a grid of monospace
|
|
4
|
+
* characters, soft-edged blobs of type drifting and morphing, the quiet
|
|
5
|
+
* cells in one colour and the loud in another. See
|
|
6
|
+
* src/runtime/ascii-noise.js.
|
|
7
|
+
*
|
|
8
|
+
* Fills its nearest positioned ancestor, or the viewport with `fixed`.
|
|
9
|
+
* Clear where the cells are empty (or `background`), so it lays over any
|
|
10
|
+
* ground. Without WebGL nothing is drawn.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* <section class="hero" style="position: relative; background: #0b0b0b">
|
|
14
|
+
* <AsciiNoise glyphs="shade" colors={['#2c3a0a', '#c8ff00']} quiet={{ x: 0.3, y: 0.5, radius: 0.6, depth: 0.9 }} />
|
|
15
|
+
* <h1>…</h1>
|
|
16
|
+
* </section>
|
|
17
|
+
*/
|
|
18
|
+
import EffectCanvas from './EffectCanvas.astro';
|
|
19
|
+
import type { AsciiNoiseConfig } from '../runtime/ascii-noise.js';
|
|
20
|
+
|
|
21
|
+
interface Props extends AsciiNoiseConfig {
|
|
22
|
+
/** Fill the viewport (position: fixed). Default false. */
|
|
23
|
+
fixed?: boolean;
|
|
24
|
+
class?: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const { fixed = false, class: className, ...config } = Astro.props;
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
<EffectCanvas name="ascii-noise" config={config} fixed={fixed} class={className} />
|
|
31
|
+
|
|
32
|
+
<script>
|
|
33
|
+
import { mount } from '../runtime/mount.js';
|
|
34
|
+
import { asciiNoise } from '../runtime/ascii-noise.js';
|
|
35
|
+
|
|
36
|
+
mount('[data-effect-ascii-noise]', asciiNoise);
|
|
37
|
+
</script>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
/**
|
|
3
|
+
* CascadeGrid: a grid of hexagons or dots that behaves like a scrolling
|
|
4
|
+
* spectrogram, each column showing the same made-up spectrum a little
|
|
5
|
+
* later than the last, so waves cascade across it and the cells swell
|
|
6
|
+
* from idle specks to reactive shapes. See src/runtime/cascade-grid.js.
|
|
7
|
+
*
|
|
8
|
+
* Fills its nearest positioned ancestor, or the viewport with `fixed`.
|
|
9
|
+
* Clear between the cells (or `background`), so it lays over any ground.
|
|
10
|
+
* Without WebGL it shows the grid at rest when it can (a `pitch` and a
|
|
11
|
+
* `background`), else the `background` colour.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* <section class="hero" style="position: relative; background: #0b0b0b">
|
|
15
|
+
* <CascadeGrid colors={['#2a2a2a', '#c8ff00']} background="#0b0b0b" quiet={{ radius: 0.5, depth: 0.95 }} />
|
|
16
|
+
* <h1>…</h1>
|
|
17
|
+
* </section>
|
|
18
|
+
*/
|
|
19
|
+
import EffectCanvas from './EffectCanvas.astro';
|
|
20
|
+
import { cascadeStill, type CascadeGridConfig } from '../runtime/cascade-grid.js';
|
|
21
|
+
|
|
22
|
+
interface Props extends CascadeGridConfig {
|
|
23
|
+
/** Fill the viewport (position: fixed). Default false. */
|
|
24
|
+
fixed?: boolean;
|
|
25
|
+
/** Run only while near the screen, giving its WebGL context back when away: for pages with many effects. Default false. */
|
|
26
|
+
lazy?: boolean | string;
|
|
27
|
+
class?: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const { fixed = false, lazy = false, class: className, ...config } = Astro.props;
|
|
31
|
+
const still = config.background ? cascadeStill(config) : undefined;
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
<EffectCanvas name="cascade-grid" config={config} fixed={fixed} lazy={lazy} background={still} class={className} />
|
|
35
|
+
|
|
36
|
+
<script>
|
|
37
|
+
import { mount } from '../runtime/mount.js';
|
|
38
|
+
import { cascadeGrid } from '../runtime/cascade-grid.js';
|
|
39
|
+
|
|
40
|
+
mount('[data-effect-cascade-grid]', cascadeGrid);
|
|
41
|
+
</script>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
/**
|
|
3
|
+
* DitherField: a field of slow noise drawn in square dots, Bayer-dithered
|
|
4
|
+
* at its edges into a solid, colour-banded core, with ripples running out
|
|
5
|
+
* from a corner, bent into shore-wave shapes. See
|
|
6
|
+
* src/runtime/dither-field.js.
|
|
7
|
+
*
|
|
8
|
+
* Fills its nearest positioned ancestor, or the viewport with `fixed`.
|
|
9
|
+
* Clear where there are no dots (or `background`), so it lays over any
|
|
10
|
+
* ground; with a `background`, the element shows a still of the field
|
|
11
|
+
* until the shader starts and without WebGL.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* <section class="hero" style="position: relative; background: #0b0b0b">
|
|
15
|
+
* <DitherField background="#0b0b0b" colors={['#3d4d0a', '#c8ff00']} quiet={{ x: 0.3, y: 0.5, radius: 0.6, depth: 1 }} />
|
|
16
|
+
* <h1>…</h1>
|
|
17
|
+
* </section>
|
|
18
|
+
*/
|
|
19
|
+
import EffectCanvas from './EffectCanvas.astro';
|
|
20
|
+
import { ditherStill, type DitherFieldConfig } from '../runtime/dither-field.js';
|
|
21
|
+
|
|
22
|
+
interface Props extends DitherFieldConfig {
|
|
23
|
+
/** Fill the viewport (position: fixed). Default false. */
|
|
24
|
+
fixed?: boolean;
|
|
25
|
+
/** Run only while near the screen (true, or how near as a CSS length), giving its WebGL context back when away: for pages with many effects. Default false. */
|
|
26
|
+
lazy?: boolean | string;
|
|
27
|
+
class?: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const { fixed = false, lazy = false, class: className, ...config } = Astro.props;
|
|
31
|
+
const still = config.background ? ditherStill(config) : undefined;
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
<EffectCanvas name="dither-field" config={config} fixed={fixed} lazy={lazy} background={still} pixelated class={className} />
|
|
35
|
+
|
|
36
|
+
<script>
|
|
37
|
+
import { mount } from '../runtime/mount.js';
|
|
38
|
+
import { ditherField } from '../runtime/dither-field.js';
|
|
39
|
+
|
|
40
|
+
mount('[data-effect-dither-field]', ditherField);
|
|
41
|
+
</script>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
/**
|
|
3
|
+
* FlowField: hundreds of short, fine trails riding a slowly evolving
|
|
4
|
+
* noise flow, born, gathering into streams and fading, white on black by
|
|
5
|
+
* default; how many there are, how fast they go and how heavy the lines
|
|
6
|
+
* are drift slowly. See src/runtime/flow-field.js.
|
|
7
|
+
*
|
|
8
|
+
* Opaque: it fills its `background` every frame, so it is the whole
|
|
9
|
+
* background of what it fills (its nearest positioned ancestor, or the
|
|
10
|
+
* viewport with `fixed`). Canvas 2D, so it needs no WebGL; one settled
|
|
11
|
+
* still frame with reduced motion. `setColors` recolours it live.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* <section class="hero" style="position: relative">
|
|
15
|
+
* <FlowField colors={['#c8ff00', '#39ff88']} background="#0b0b0b" quiet={{ radius: 0.5, depth: 0.85 }} />
|
|
16
|
+
* <h1>…</h1>
|
|
17
|
+
* </section>
|
|
18
|
+
*/
|
|
19
|
+
import EffectCanvas from './EffectCanvas.astro';
|
|
20
|
+
import type { FlowFieldConfig } from '../runtime/flow-field.js';
|
|
21
|
+
|
|
22
|
+
interface Props extends FlowFieldConfig {
|
|
23
|
+
/** Fill the viewport, behind the page (position: fixed, z-index -1). Default false. */
|
|
24
|
+
fixed?: boolean;
|
|
25
|
+
class?: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const { fixed = false, class: className, ...config } = Astro.props;
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
<EffectCanvas name="flow-field" config={config} fixed={fixed} class={className} behind background={config.background ?? '#000000'} />
|
|
32
|
+
|
|
33
|
+
<script>
|
|
34
|
+
import { mount } from '../runtime/mount.js';
|
|
35
|
+
import { flowField } from '../runtime/flow-field.js';
|
|
36
|
+
|
|
37
|
+
mount('[data-effect-flow-field]', flowField);
|
|
38
|
+
</script>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
/**
|
|
3
|
+
* KineticGrid: a fine wireframe grid that ripples where drops land, the
|
|
4
|
+
* rings spreading and settling, brighter where a wire is stretched, with
|
|
5
|
+
* thin bright ring pulses lighting the wire segments they cross. See
|
|
6
|
+
* src/runtime/kinetic-grid.js.
|
|
7
|
+
*
|
|
8
|
+
* Fills its nearest positioned ancestor, or the viewport with `fixed`.
|
|
9
|
+
* Paints its own ground (`background`; `transparent` lays it over the
|
|
10
|
+
* section's). Without WebGL the ground shows.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* <section class="hero" style="position: relative">
|
|
14
|
+
* <KineticGrid colors={['#c8ff00', '#ffffff']} background="#0b0b0b" quiet={{ x: 0.3, y: 0.5, radius: 0.6, depth: 0.85 }} />
|
|
15
|
+
* <h1>…</h1>
|
|
16
|
+
* </section>
|
|
17
|
+
*/
|
|
18
|
+
import EffectCanvas from './EffectCanvas.astro';
|
|
19
|
+
import type { KineticGridConfig } from '../runtime/kinetic-grid.js';
|
|
20
|
+
|
|
21
|
+
interface Props extends KineticGridConfig {
|
|
22
|
+
/** Fill the viewport (position: fixed). Default false. */
|
|
23
|
+
fixed?: boolean;
|
|
24
|
+
class?: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const { fixed = false, class: className, ...config } = Astro.props;
|
|
28
|
+
const ground = config.background ?? '#0a0a0a';
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
<EffectCanvas name="kinetic-grid" config={config} fixed={fixed} class={className} background={ground === 'transparent' ? undefined : ground} />
|
|
32
|
+
|
|
33
|
+
<script>
|
|
34
|
+
import { mount } from '../runtime/mount.js';
|
|
35
|
+
import { kineticGrid } from '../runtime/kinetic-grid.js';
|
|
36
|
+
|
|
37
|
+
mount('[data-effect-kinetic-grid]', kineticGrid);
|
|
38
|
+
</script>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
/**
|
|
3
|
+
* LightLeak: a soft, slow colour field, a lava lamp or a light leak:
|
|
4
|
+
* drifting fBm blobs under a gentle warp, mixed through four colours
|
|
5
|
+
* (darkest first) in Oklab, with a breath too slow to see as one. See
|
|
6
|
+
* src/runtime/light-leak.js.
|
|
7
|
+
*
|
|
8
|
+
* Fills its nearest positioned ancestor, or the viewport with `fixed`.
|
|
9
|
+
* Opaque. Shows a still of its first frame (`lightLeakStill`) before the
|
|
10
|
+
* shader starts and without WebGL.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* <section class="hero" style="position: relative">
|
|
14
|
+
* <LightLeak colors={['#0b0b0b', '#1a2a8c', '#0038ff', '#ff5c64']} quiet={{ radius: 0.5, depth: 0.8 }} />
|
|
15
|
+
* <h1>…</h1>
|
|
16
|
+
* </section>
|
|
17
|
+
*/
|
|
18
|
+
import EffectCanvas from './EffectCanvas.astro';
|
|
19
|
+
import { lightLeakStill, type LightLeakConfig } from '../runtime/light-leak.js';
|
|
20
|
+
|
|
21
|
+
interface Props extends LightLeakConfig {
|
|
22
|
+
/** Fill the viewport (position: fixed). Default false. */
|
|
23
|
+
fixed?: boolean;
|
|
24
|
+
/** Run only while near the screen (true, or a CSS length), giving its WebGL context back when away: for a wall of cards. Default false. */
|
|
25
|
+
lazy?: boolean | string;
|
|
26
|
+
class?: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const { fixed = false, lazy = false, class: className, ...config } = Astro.props;
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
<EffectCanvas name="light-leak" config={config} fixed={fixed} lazy={lazy} background={lightLeakStill(config, 16 / 9)} class={className} />
|
|
33
|
+
|
|
34
|
+
<script>
|
|
35
|
+
import { mount } from '../runtime/mount.js';
|
|
36
|
+
import { lightLeak } from '../runtime/light-leak.js';
|
|
37
|
+
|
|
38
|
+
mount('[data-effect-light-leak]', lightLeak);
|
|
39
|
+
</script>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
/**
|
|
3
|
+
* VoronoiMesh: a Voronoi mesh in thin lines on a ground, in two nested
|
|
4
|
+
* tiers: macro cells whose seeds orbit slowly, and inner cells inside each
|
|
5
|
+
* that pulse outward from its seed. Pale lines on deep maroon by default.
|
|
6
|
+
* See src/runtime/voronoi-mesh.js.
|
|
7
|
+
*
|
|
8
|
+
* Fills its nearest positioned ancestor, or the viewport with `fixed`.
|
|
9
|
+
* Opaque (its `background`), which the element shows before the shader
|
|
10
|
+
* starts and without WebGL; `meshStill` in the runtime makes an SVG still
|
|
11
|
+
* of the same frame for a box of known size (a card).
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* <section class="hero" style="position: relative">
|
|
15
|
+
* <VoronoiMesh cells={8} quiet={{ x: 0.3, y: 0.5, radius: 0.7, depth: 0.8 }} />
|
|
16
|
+
* <h1>…</h1>
|
|
17
|
+
* </section>
|
|
18
|
+
*/
|
|
19
|
+
import EffectCanvas from './EffectCanvas.astro';
|
|
20
|
+
import { MESH_DEFAULTS, type VoronoiMeshConfig } from '../runtime/voronoi-mesh.js';
|
|
21
|
+
|
|
22
|
+
interface Props extends VoronoiMeshConfig {
|
|
23
|
+
/** Fill the viewport (position: fixed). Default false. */
|
|
24
|
+
fixed?: boolean;
|
|
25
|
+
class?: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const { fixed = false, class: className, ...config } = Astro.props;
|
|
29
|
+
const ground = config.background ?? MESH_DEFAULTS.background;
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
<EffectCanvas name="voronoi-mesh" config={config} fixed={fixed} background={ground} class={className} />
|
|
33
|
+
|
|
34
|
+
<script>
|
|
35
|
+
import { mount } from '../runtime/mount.js';
|
|
36
|
+
import { voronoiMesh } from '../runtime/voronoi-mesh.js';
|
|
37
|
+
|
|
38
|
+
mount('[data-effect-voronoi-mesh]', voronoiMesh);
|
|
39
|
+
</script>
|
package/src/index.d.ts
CHANGED
|
@@ -6,6 +6,21 @@ export { spotlight } from './runtime/spotlight.js';
|
|
|
6
6
|
export type { SpotlightConfig } from './runtime/spotlight.js';
|
|
7
7
|
export { asciiRain } from './runtime/ascii-rain.js';
|
|
8
8
|
export type { AsciiRainConfig } from './runtime/ascii-rain.js';
|
|
9
|
+
export { asciiNoise, asciiCells, noiseField, noiseColors, rampOf, NOISE_RAMPS, NOISE_DEFAULTS } from './runtime/ascii-noise.js';
|
|
10
|
+
export type { AsciiNoiseConfig } from './runtime/ascii-noise.js';
|
|
11
|
+
export { lightLeak, lightLeakStill } from './runtime/light-leak.js';
|
|
12
|
+
export { ditherField, ditherStill } from './runtime/dither-field.js';
|
|
13
|
+
export { cascadeGrid, cascadeStill } from './runtime/cascade-grid.js';
|
|
14
|
+
export { flowField } from './runtime/flow-field.js';
|
|
15
|
+
export { voronoiMesh, meshStill } from './runtime/voronoi-mesh.js';
|
|
16
|
+
export { kineticGrid, gridStill } from './runtime/kinetic-grid.js';
|
|
17
|
+
export { hash33, grad, gnoise, GLSL_HASH33, GLSL_GRADIENT_NOISE, GLSL_NOISE_FIELD } from './runtime/hash-noise.js';
|
|
18
|
+
export type { LightLeakConfig } from './runtime/light-leak.js';
|
|
19
|
+
export type { DitherFieldConfig } from './runtime/dither-field.js';
|
|
20
|
+
export type { CascadeGridConfig } from './runtime/cascade-grid.js';
|
|
21
|
+
export type { FlowFieldConfig } from './runtime/flow-field.js';
|
|
22
|
+
export type { VoronoiMeshConfig } from './runtime/voronoi-mesh.js';
|
|
23
|
+
export type { KineticGridConfig } from './runtime/kinetic-grid.js';
|
|
9
24
|
export { glassGlyph } from './runtime/glass-glyph.js';
|
|
10
25
|
export type { GlassGlyphConfig } from './runtime/glass-glyph.js';
|
|
11
26
|
export { flutedGlass } from './runtime/fluted-glass.js';
|
package/src/index.js
CHANGED
|
@@ -15,6 +15,14 @@ export { lightField } from './runtime/light-field.js';
|
|
|
15
15
|
export { ink } from './runtime/ink.js';
|
|
16
16
|
export { spotlight } from './runtime/spotlight.js';
|
|
17
17
|
export { asciiRain } from './runtime/ascii-rain.js';
|
|
18
|
+
export { asciiNoise, asciiCells, noiseField, noiseColors, rampOf, NOISE_RAMPS, NOISE_DEFAULTS } from './runtime/ascii-noise.js';
|
|
19
|
+
export { lightLeak, lightLeakStill } from './runtime/light-leak.js';
|
|
20
|
+
export { ditherField, ditherStill } from './runtime/dither-field.js';
|
|
21
|
+
export { cascadeGrid, cascadeStill } from './runtime/cascade-grid.js';
|
|
22
|
+
export { flowField } from './runtime/flow-field.js';
|
|
23
|
+
export { voronoiMesh, meshStill } from './runtime/voronoi-mesh.js';
|
|
24
|
+
export { kineticGrid, gridStill } from './runtime/kinetic-grid.js';
|
|
25
|
+
export { hash33, grad, gnoise, GLSL_HASH33, GLSL_GRADIENT_NOISE, GLSL_NOISE_FIELD } from './runtime/hash-noise.js';
|
|
18
26
|
export { glassGlyph } from './runtime/glass-glyph.js';
|
|
19
27
|
export { flutedGlass } from './runtime/fluted-glass.js';
|
|
20
28
|
export { particleLogo } from './runtime/particle-logo.js';
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { PaletteName } from './palettes.js';
|
|
2
|
+
|
|
3
|
+
export interface AsciiNoiseConfig {
|
|
4
|
+
/** Two CSS hex colours: the quietest cells' and the loudest's. Default a dim grey and white. */
|
|
5
|
+
colors?: string[];
|
|
6
|
+
/** A shared palette by name (`PALETTES`, any case), when there are no `colors`: its first and last colours. */
|
|
7
|
+
palette?: PaletteName | (string & {});
|
|
8
|
+
/** A CSS hex colour to fill behind the type; none leaves the canvas clear there. */
|
|
9
|
+
background?: string;
|
|
10
|
+
/** A ramp (`ascii`, `shade`, `digits`, `rise`, `quads`, `bars`, `arrows`, `letters`, `dense`, or a set of `GLYPH_SETS`) or the characters, quietest first. Default `ascii`. */
|
|
11
|
+
glyphs?: keyof typeof NOISE_RAMPS | (string & {});
|
|
12
|
+
/** A character cell's height in CSS px. Default 14. */
|
|
13
|
+
cell?: number;
|
|
14
|
+
/** Cells across instead, whatever the width (overrides `cell`). */
|
|
15
|
+
cols?: number;
|
|
16
|
+
/** A cell's width over its height. Default 0.6. */
|
|
17
|
+
aspect?: number;
|
|
18
|
+
/** How many noise features span the width (higher is busier). Default 2.45. */
|
|
19
|
+
scale?: number;
|
|
20
|
+
/** How hard the edges are: higher pushes cells to empty or full. Default 6. */
|
|
21
|
+
contrast?: number;
|
|
22
|
+
/** Shifts the whole field; lower leaves more cells empty. Default -0.1. */
|
|
23
|
+
brightness?: number;
|
|
24
|
+
/** How fast the sample window pans, widths a second, x and y. Default [0.036, 0.012]. */
|
|
25
|
+
drift?: [number, number];
|
|
26
|
+
/** How fast the shapes morph. Default 0.24. */
|
|
27
|
+
evolve?: number;
|
|
28
|
+
/** Where the sample window starts, so two cards differ. Default [0, 0]. */
|
|
29
|
+
offset?: [number, number];
|
|
30
|
+
/** Plays every clock faster or slower; 0 for one still frame. Default 1. */
|
|
31
|
+
speed?: number;
|
|
32
|
+
/** An area kept quiet: centre (0–1 from the top left), radius (share of the height), depth (0–1). */
|
|
33
|
+
quiet?: { x?: number; y?: number; radius?: number; depth?: number } | null;
|
|
34
|
+
/** The font family the glyphs are drawn in (a monospace stack by default); it is loaded first. */
|
|
35
|
+
font?: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** The ramps, each quietest first. A ramp starting with a space leaves quiet cells empty. */
|
|
39
|
+
export declare const NOISE_RAMPS: {
|
|
40
|
+
readonly ascii: string;
|
|
41
|
+
readonly shade: string;
|
|
42
|
+
readonly digits: string;
|
|
43
|
+
readonly rise: string;
|
|
44
|
+
readonly quads: string;
|
|
45
|
+
readonly bars: string;
|
|
46
|
+
readonly arrows: string;
|
|
47
|
+
readonly letters: string;
|
|
48
|
+
readonly dense: string;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/** The settings' defaults, shared by the shader and `asciiCells`. */
|
|
52
|
+
export declare const NOISE_DEFAULTS: {
|
|
53
|
+
glyphs: string;
|
|
54
|
+
scale: number;
|
|
55
|
+
contrast: number;
|
|
56
|
+
brightness: number;
|
|
57
|
+
drift: [number, number];
|
|
58
|
+
evolve: number;
|
|
59
|
+
aspect: number;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
/** A ramp's characters, quietest first (at least two). */
|
|
63
|
+
export declare function rampOf(glyphs?: string): string[];
|
|
64
|
+
|
|
65
|
+
/** The field: five octaves of gradient noise, each warped by the sum so far; 0–1. */
|
|
66
|
+
export declare function noiseField(x: number, y: number, evo: number, wt: number): number;
|
|
67
|
+
|
|
68
|
+
/** One frame as ramp indices: what the shader draws, cell for cell, on a target exactly `cols` by `rows` cells. */
|
|
69
|
+
export declare function asciiCells(config: AsciiNoiseConfig, cols: number, rows: number, time?: number): number[][];
|
|
70
|
+
|
|
71
|
+
/** The two colours as the shader takes them: the quietest cells' and the loudest's. */
|
|
72
|
+
export declare function noiseColors(config: AsciiNoiseConfig): [string, string];
|
|
73
|
+
|
|
74
|
+
/** Starts the noise on an element (its first canvas is drawn into). Returns a function that stops it. */
|
|
75
|
+
export declare function asciiNoise(el: HTMLElement, config: AsciiNoiseConfig): () => void;
|