asciify-engine 4.13.0 → 4.14.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/README.md +7 -0
- package/dist/characters-BgG9AZQl.d.cts +72 -0
- package/dist/characters-BgG9AZQl.d.ts +72 -0
- package/dist/core.d.cts +2 -1
- package/dist/core.d.ts +2 -1
- package/dist/field.cjs +1 -1
- package/dist/field.d.cts +6 -0
- package/dist/field.d.ts +6 -0
- package/dist/field.js +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/kit.cjs +1 -1
- package/dist/kit.d.cts +270 -7
- package/dist/kit.d.ts +270 -7
- package/dist/kit.js +1 -1
- package/dist/{model-B0jK31nS.d.cts → model-9SbRVqqI.d.cts} +1 -72
- package/dist/{model-BARiWJks.d.ts → model-DXHhQhxP.d.ts} +1 -72
- package/dist/studio.d.cts +3 -2
- package/dist/studio.d.ts +3 -2
- package/package.json +1 -1
- package/skills/asciify-engine/SKILL.md +74 -48
- package/skills/asciify-engine/references/applying-asciify.md +234 -0
- package/skills/asciify-engine/references/components.md +1 -1
- package/skills/asciify-engine/references/design-matching.md +10 -7
- package/skills/asciify-engine/references/glyph-field.md +3 -0
- package/skills/asciify-engine/references/kit.md +112 -26
- package/skills/asciify-engine/references/media-api.md +2 -2
- package/skills/asciify-engine/references/project-integration.md +1 -1
- package/skills/asciify-engine/references/scenario-prompts.md +1 -1
- package/skills/asciify-engine/references/upgrading.md +1 -1
package/dist/kit.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { GlyphField, GlyphFieldOptions } from './field.cjs';
|
|
2
|
+
import { C as CHARACTER_SETS } from './characters-BgG9AZQl.cjs';
|
|
2
3
|
|
|
3
4
|
/** Options every kit component takes. */
|
|
4
5
|
interface KitOptions {
|
|
@@ -8,14 +9,26 @@ interface KitOptions {
|
|
|
8
9
|
look?: GlyphFieldOptions;
|
|
9
10
|
/** `true` or `false` overrides the visitor's `prefers-reduced-motion`; leave it unset to follow it. */
|
|
10
11
|
reducedMotion?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Mount the field only once the element comes within half a viewport of the screen, and release it (freeing its WebGL context)
|
|
14
|
+
* beyond one. The handle keeps working while released. `false` mounts at once, wherever the element is. Default true.
|
|
15
|
+
*/
|
|
16
|
+
lazy?: boolean;
|
|
17
|
+
/** A still image under the field: shown until the first GPU frame, while the field is released, and in its place without WebGL. */
|
|
18
|
+
poster?: string;
|
|
19
|
+
/** `false` keeps this field's own characters when `setGlobalLook` re-skins the page. Default true. */
|
|
20
|
+
globalLook?: boolean;
|
|
11
21
|
}
|
|
12
22
|
/** The handle every kit component returns. Component handles add their own methods. */
|
|
13
23
|
interface KitHandle<O> {
|
|
14
24
|
/** False when WebGL2 is missing (or the field failed): the HTML is left as it was and drawing methods do nothing. */
|
|
15
25
|
readonly supported: boolean;
|
|
16
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* The underlying GPU field, for anything the kit does not cover. `null` in the fallback. It stays the same object while the
|
|
28
|
+
* field is released off screen; `update`, `setSource`, `play` and `pause` made meanwhile apply when it mounts again.
|
|
29
|
+
*/
|
|
17
30
|
readonly field: GlyphField | null;
|
|
18
|
-
/** Merges options; the next frame draws with them. */
|
|
31
|
+
/** Merges options (`look` key by key); the next frame draws with them. */
|
|
19
32
|
update(options: Partial<O>): void;
|
|
20
33
|
/** Resumes motion after `pause()`. */
|
|
21
34
|
play(): void;
|
|
@@ -50,6 +63,10 @@ interface PaintFrame {
|
|
|
50
63
|
}
|
|
51
64
|
interface SurfaceConfig {
|
|
52
65
|
host: HTMLElement;
|
|
66
|
+
/** The component's options, for `lazy`, `poster` and `globalLook`. Pass the same object to `handle()`. */
|
|
67
|
+
kit?: {
|
|
68
|
+
current: KitOptions;
|
|
69
|
+
};
|
|
53
70
|
/** The field look; ink comes from `ink`, so leave it out here. */
|
|
54
71
|
look: () => GlyphFieldOptions;
|
|
55
72
|
/** CSS colour or custom property for the field ink, given whether the ground is dark. */
|
|
@@ -69,8 +86,12 @@ interface SurfaceConfig {
|
|
|
69
86
|
onTheme?: () => void;
|
|
70
87
|
}
|
|
71
88
|
interface Surface {
|
|
89
|
+
/** The same object across release and remount. */
|
|
72
90
|
readonly field: GlyphField;
|
|
91
|
+
/** The current canvas. A remount swaps in a copy of it, with its attributes and inline styles, in the same place. */
|
|
73
92
|
readonly canvas: HTMLCanvasElement;
|
|
93
|
+
/** True while the field holds a WebGL context. */
|
|
94
|
+
readonly live: boolean;
|
|
74
95
|
/** Starts the frame loop if it is not running. */
|
|
75
96
|
kick(): void;
|
|
76
97
|
/** Re-reads the look and ink, then kicks. */
|
|
@@ -86,7 +107,9 @@ interface Surface {
|
|
|
86
107
|
declare function resolveColor(token: string | undefined, from: Element, fallback?: string): string | null;
|
|
87
108
|
/**
|
|
88
109
|
* Mounts a field over or inside `host` and feeds it a canvas painted each frame. Returns null without WebGL2 or when
|
|
89
|
-
* mounting fails, having changed nothing, so the caller can keep its HTML as the fallback.
|
|
110
|
+
* mounting fails, having changed nothing (but a `poster`), so the caller can keep its HTML as the fallback. The field mounts near
|
|
111
|
+
* the viewport and is released far from it (see `KitOptions.lazy`); every frame paints the component's current state, so a remount
|
|
112
|
+
* picks up where the component is.
|
|
90
113
|
*/
|
|
91
114
|
declare function mountSurface(config: SurfaceConfig): Surface | null;
|
|
92
115
|
|
|
@@ -128,7 +151,7 @@ declare function beam(element: HTMLElement, options?: BeamOptions): BeamHandle;
|
|
|
128
151
|
interface DecodeOptions extends KitOptions {
|
|
129
152
|
/** Text to draw instead of the element's own, centred and as large as fits; `\n` breaks lines. By default the element's text is drawn exactly where the browser lays it out. */
|
|
130
153
|
text?: string;
|
|
131
|
-
/** Total length in ms: the first 30% is drift alone, then the words resolve left to right. Default
|
|
154
|
+
/** Total length in ms: the first 30% is drift alone, then the words resolve left to right. Default 800. */
|
|
132
155
|
duration?: number;
|
|
133
156
|
/** `visible` decodes when the element scrolls into view; `manual` waits for `replay()`. Default `visible`. */
|
|
134
157
|
trigger?: 'visible' | 'manual';
|
|
@@ -154,6 +177,8 @@ interface OdometerOptions extends KitOptions {
|
|
|
154
177
|
stagger?: number;
|
|
155
178
|
/** Glyphs the columns roll through. Default `#%*+=-:`. */
|
|
156
179
|
glyphs?: string;
|
|
180
|
+
/** `text`: crisp text at rest, characters only while a column rolls. `glyph`: the whole figure is drawn in characters. Default `text`. */
|
|
181
|
+
face?: 'text' | 'glyph';
|
|
157
182
|
}
|
|
158
183
|
interface OdometerHandle extends KitHandle<OdometerOptions> {
|
|
159
184
|
/** Shows a new value; only the changed digits roll, leftmost first. */
|
|
@@ -171,12 +196,14 @@ interface ButtonLoadingOptions extends KitOptions {
|
|
|
171
196
|
text?: string;
|
|
172
197
|
/** The element holding the label text. Default: the button itself. Pass it when the button also holds an icon. */
|
|
173
198
|
label?: HTMLElement;
|
|
174
|
-
/** Put a check before the success label. Default true. */
|
|
199
|
+
/** Put a check (a crisp SVG) before the success label. Default true. */
|
|
175
200
|
check?: boolean;
|
|
176
201
|
/** Shake the button on failure (skipped under reduced motion). Default true. */
|
|
177
202
|
shake?: boolean;
|
|
178
203
|
/** A live region to announce each state in. Optional. */
|
|
179
204
|
announce?: HTMLElement;
|
|
205
|
+
/** An icon-only button's icon. Default: the first `svg` when the button has no text. One breathing cell stands in for it while loading, and a check while it shows success. */
|
|
206
|
+
icon?: Element | null;
|
|
180
207
|
}
|
|
181
208
|
type ButtonState = 'idle' | 'loading' | 'success' | 'error';
|
|
182
209
|
interface ButtonLoadingHandle extends KitHandle<ButtonLoadingOptions> {
|
|
@@ -193,6 +220,7 @@ interface ButtonLoadingHandle extends KitHandle<ButtonLoadingOptions> {
|
|
|
193
220
|
/**
|
|
194
221
|
* A button whose label cycles through characters while its request runs, then decodes into the result.
|
|
195
222
|
* The width never changes: it grows to the widest label it has shown and holds there until `destroy()`.
|
|
223
|
+
* An icon-only button keeps its icon: while loading one cell over it breathes through the glyphs, and success swaps in a check.
|
|
196
224
|
*/
|
|
197
225
|
declare function buttonLoading(button: HTMLElement, options?: ButtonLoadingOptions): ButtonLoadingHandle;
|
|
198
226
|
|
|
@@ -362,6 +390,10 @@ interface WordmarkOptions extends KitOptions {
|
|
|
362
390
|
font?: string;
|
|
363
391
|
/** Default 600. */
|
|
364
392
|
fontWeight?: number;
|
|
393
|
+
/** Height of the 1800 px wide canvas the word is set on. A shorter one sets the word larger in a wide element. Default 520. */
|
|
394
|
+
artHeight?: number;
|
|
395
|
+
/** The canvas's accessible name when the word is not the element's own text. Default the word. */
|
|
396
|
+
label?: string;
|
|
365
397
|
}
|
|
366
398
|
interface WordmarkHandle extends KitHandle<WordmarkOptions> {
|
|
367
399
|
/** Sets the word again, as large as fits. */
|
|
@@ -550,6 +582,8 @@ interface LikeBurstOptions extends KitOptions {
|
|
|
550
582
|
limit?: HTMLElement | null;
|
|
551
583
|
/** CSS pixels the field reaches past the button on every side. Default 40; set at mount. */
|
|
552
584
|
outset?: number;
|
|
585
|
+
/** `under` (default) draws between the button's background and its content, so the count and label stay crisp over the sparks; `over` draws above everything. Set at mount. */
|
|
586
|
+
layer?: 'over' | 'under';
|
|
553
587
|
/** Called after a click toggles the button. */
|
|
554
588
|
onChange?: (pressed: boolean) => void;
|
|
555
589
|
}
|
|
@@ -574,6 +608,8 @@ interface BlockChartOptions extends KitOptions {
|
|
|
574
608
|
max?: number;
|
|
575
609
|
/** How long each bar grows, in ms. Default 520. */
|
|
576
610
|
duration?: number;
|
|
611
|
+
/** Grow the bars in the first time the chart comes into view. `false` draws them in place at once, as in a view that is swapped in. Default true. */
|
|
612
|
+
intro?: boolean;
|
|
577
613
|
/** Ms between bars growing. Default 45 for up to 7 bars, else 9. */
|
|
578
614
|
stagger?: number;
|
|
579
615
|
/** Formats values for the screen reader table. Default `toLocaleString()`. */
|
|
@@ -628,6 +664,8 @@ interface SwipeDeckOptions extends KitOptions {
|
|
|
628
664
|
radius?: number;
|
|
629
665
|
/** CSS pixels the field reaches past the deck for the stack and the fling. Default 56; set at mount. */
|
|
630
666
|
outset?: number;
|
|
667
|
+
/** The element that receives `--ascii-lean`, such as the row holding your pass and keep buttons. Default the deck. */
|
|
668
|
+
leanTarget?: HTMLElement | null;
|
|
631
669
|
/** Called after a card leaves: `dir` is 1 for right (keep), -1 for left (pass). */
|
|
632
670
|
onSwipe?: (dir: 1 | -1, index: number, card: HTMLElement) => void;
|
|
633
671
|
}
|
|
@@ -656,6 +694,8 @@ interface CodeInputHandle extends KitHandle<CodeInputOptions> {
|
|
|
656
694
|
verify(ok: boolean): void;
|
|
657
695
|
/** Empties the code and returns to idle. */
|
|
658
696
|
clear(): void;
|
|
697
|
+
/** Enters a whole code, as a paste or an autofill would: the characters resolve one after another. */
|
|
698
|
+
fill(code: string): void;
|
|
659
699
|
readonly value: string;
|
|
660
700
|
readonly state: CodeState;
|
|
661
701
|
}
|
|
@@ -687,6 +727,8 @@ interface ToastStackOptions extends KitOptions {
|
|
|
687
727
|
render?: (toast: Toast, id: number) => HTMLElement;
|
|
688
728
|
/** Accessible name of the list. Default `Notifications`. */
|
|
689
729
|
label?: string;
|
|
730
|
+
/** At rest a comet of characters runs round the newest toast's edge every few seconds, outside its text. Default true. */
|
|
731
|
+
glint?: boolean;
|
|
690
732
|
}
|
|
691
733
|
interface ToastStackHandle extends KitHandle<ToastStackOptions> {
|
|
692
734
|
/** Adds a toast at the front, gathering out of scattered characters. Returns its id. */
|
|
@@ -721,6 +763,8 @@ interface ThinkingOptions extends KitOptions {
|
|
|
721
763
|
stagger?: number;
|
|
722
764
|
/** A dotted rule under the finished answer. Default true. */
|
|
723
765
|
rule?: boolean;
|
|
766
|
+
/** Called on each state change; `seconds` is how long it thought, once known. For a status you render yourself. */
|
|
767
|
+
onState?: (state: ThinkingState, seconds: number) => void;
|
|
724
768
|
}
|
|
725
769
|
interface ThinkingHandle extends KitHandle<ThinkingOptions> {
|
|
726
770
|
/** Clears the answer and thinks again, as for Regenerate. */
|
|
@@ -772,7 +816,7 @@ interface CompareOptions extends KitOptions {
|
|
|
772
816
|
image: string | HTMLImageElement;
|
|
773
817
|
/** Share of the frame showing the photo, from the left, 0–100. Default 50. */
|
|
774
818
|
position?: number;
|
|
775
|
-
/** The handle's accessible name. Default `Photo and ASCII split`. */
|
|
819
|
+
/** The handle's accessible name. Default `Photo and ASCII split`, or your own handle's `aria-label`. */
|
|
776
820
|
label?: string;
|
|
777
821
|
/** Called as the split moves. */
|
|
778
822
|
onChange?: (position: number) => void;
|
|
@@ -839,6 +883,8 @@ interface DropzoneOptions extends KitOptions {
|
|
|
839
883
|
develop?: number;
|
|
840
884
|
/** File name for `download()`. Default `<name>-ascii.png`. */
|
|
841
885
|
filename?: string;
|
|
886
|
+
/** Called on every state change (`empty`, `developing`, `done`) with the image's name, or '' when empty. */
|
|
887
|
+
onState?: (state: DropState, name: string) => void;
|
|
842
888
|
}
|
|
843
889
|
interface DropzoneHandle extends KitHandle<DropzoneOptions> {
|
|
844
890
|
/** Shows an image (a URL, Blob or File), developing it in characters. */
|
|
@@ -904,4 +950,221 @@ interface PullRefreshHandle extends KitHandle<PullRefreshOptions> {
|
|
|
904
950
|
*/
|
|
905
951
|
declare function pullRefresh(element: HTMLElement, options: PullRefreshOptions): PullRefreshHandle;
|
|
906
952
|
|
|
907
|
-
|
|
953
|
+
/** `true` follows the pointer with the preset's own response; the GPU presets also take a named hover. */
|
|
954
|
+
type BackgroundCursor = boolean | 'trail' | 'fluid' | 'lantern';
|
|
955
|
+
/** A named ramp from the engine's character sets, `'dots'`, or your own characters from empty to dense. */
|
|
956
|
+
type BackgroundCharset = keyof typeof CHARACTER_SETS | 'dots' | (string & {});
|
|
957
|
+
interface BackgroundOptions extends KitOptions {
|
|
958
|
+
/** The background to draw, imported by name: `import { background, aurora } from 'asciify-engine/kit'`. */
|
|
959
|
+
preset: BackgroundPreset;
|
|
960
|
+
/** The ink, one colour or one per ground. Wins over `color` and `ink`. Default: the preset's graphite for the ground. */
|
|
961
|
+
palette?: string | {
|
|
962
|
+
light?: string;
|
|
963
|
+
dark?: string;
|
|
964
|
+
};
|
|
965
|
+
/** One ink for both grounds. Same as `ink`. */
|
|
966
|
+
color?: string;
|
|
967
|
+
/** Peaks, heads and signals, for the presets that draw them. Default: the preset's own accent, or one mixed from the ink. */
|
|
968
|
+
accent?: string;
|
|
969
|
+
/** Animation speed, 0–5. Default: the preset's tuned pace (the /backgrounds page's Speed control). */
|
|
970
|
+
speed?: number;
|
|
971
|
+
/** Character size (dot spacing for `halftone`) in CSS pixels. Default: the preset's own. */
|
|
972
|
+
cellSize?: number;
|
|
973
|
+
/** Characters from empty to dense, or a named set (`blocks`, `braille`, `dots`, ...). Default: the preset's own. */
|
|
974
|
+
charset?: BackgroundCharset;
|
|
975
|
+
/** Pointer response. Default: on for the presets that answer the cursor. */
|
|
976
|
+
cursor?: BackgroundCursor;
|
|
977
|
+
/** An element to keep clear: the field fades out around it so text over it stays readable. */
|
|
978
|
+
clear?: HTMLElement | false;
|
|
979
|
+
/** Canvas opacity, 0–1. Default 1 (`fluid` 0.7). */
|
|
980
|
+
opacity?: number;
|
|
981
|
+
/** Ordered dither, 0–1, for the presets that tone with density. Default 0. */
|
|
982
|
+
dither?: number;
|
|
983
|
+
/** `wordField` only: the word drawn. Default `ASCIIFY`. */
|
|
984
|
+
text?: string;
|
|
985
|
+
}
|
|
986
|
+
/** The settings a preset draws with, resolved from the options and the preset's defaults. */
|
|
987
|
+
interface BackgroundSettings {
|
|
988
|
+
speed: number;
|
|
989
|
+
cellSize: number;
|
|
990
|
+
charset: string | undefined;
|
|
991
|
+
cursor: BackgroundCursor;
|
|
992
|
+
clear: HTMLElement | false;
|
|
993
|
+
dither: number;
|
|
994
|
+
accent: string | undefined;
|
|
995
|
+
text: string;
|
|
996
|
+
look: GlyphFieldOptions | undefined;
|
|
997
|
+
}
|
|
998
|
+
/** What `background()` hands a preset when it mounts. Settings and ink are read live, so `update()` needs no remount. */
|
|
999
|
+
interface BackgroundContext {
|
|
1000
|
+
readonly host: HTMLElement;
|
|
1001
|
+
/** The live options, for the GPU presets' lazy mounting, context budget, poster and `globalLook`. */
|
|
1002
|
+
readonly kit: {
|
|
1003
|
+
current: KitOptions;
|
|
1004
|
+
};
|
|
1005
|
+
settings(): BackgroundSettings;
|
|
1006
|
+
/** The chosen ink token for the ground, or undefined for the preset's own default. */
|
|
1007
|
+
ink(dark: boolean): string | undefined;
|
|
1008
|
+
reducedMotion(): boolean | undefined;
|
|
1009
|
+
/** The preset failed after mounting and has already removed itself. */
|
|
1010
|
+
onFail(): void;
|
|
1011
|
+
}
|
|
1012
|
+
interface BackgroundRun {
|
|
1013
|
+
/** The GPU field for field-driven presets; `null` for the canvas templates. */
|
|
1014
|
+
readonly field: GlyphField | null;
|
|
1015
|
+
readonly canvas: HTMLCanvasElement;
|
|
1016
|
+
/** Re-reads settings and ink, and draws. */
|
|
1017
|
+
refresh(): void;
|
|
1018
|
+
play(): void;
|
|
1019
|
+
pause(): void;
|
|
1020
|
+
destroy(): void;
|
|
1021
|
+
}
|
|
1022
|
+
/** One background. Each is its own export, so a page pays only for the presets it imports. */
|
|
1023
|
+
interface BackgroundPreset {
|
|
1024
|
+
readonly id: string;
|
|
1025
|
+
readonly name: string;
|
|
1026
|
+
readonly description: string;
|
|
1027
|
+
/** Default character size in CSS pixels. */
|
|
1028
|
+
readonly cellSize: number;
|
|
1029
|
+
/** Default speed. */
|
|
1030
|
+
readonly speed: number;
|
|
1031
|
+
/** Whether the preset answers the pointer by default. */
|
|
1032
|
+
readonly cursor: boolean;
|
|
1033
|
+
readonly opacity?: number;
|
|
1034
|
+
/** Mounts under the host's content; null when it cannot draw (no 2D canvas, or no WebGL2 for GPU presets). */
|
|
1035
|
+
mount(context: BackgroundContext): BackgroundRun | null;
|
|
1036
|
+
}
|
|
1037
|
+
interface BackgroundHandle extends KitHandle<BackgroundOptions> {
|
|
1038
|
+
/** The preset on screen. */
|
|
1039
|
+
readonly preset: BackgroundPreset;
|
|
1040
|
+
/** Cross-fades to another preset, keeping your options. Speed and size return to the new preset's defaults unless you set them. */
|
|
1041
|
+
setPreset(preset: BackgroundPreset): void;
|
|
1042
|
+
}
|
|
1043
|
+
/** A named set, or your own characters; a custom ramp gains the empty first step the templates expect. */
|
|
1044
|
+
declare function backgroundCharset(charset: string | undefined): string | undefined;
|
|
1045
|
+
/**
|
|
1046
|
+
* An animated ASCII background under an element's content: any of the /backgrounds presets, drawn the same way as on the site.
|
|
1047
|
+
* Canvas templates draw with a 2D canvas; `drift`, `halftone`, `wordField` and `fluid` drive the GPU glyph field.
|
|
1048
|
+
*/
|
|
1049
|
+
declare function background(element: HTMLElement, options: BackgroundOptions): BackgroundHandle;
|
|
1050
|
+
|
|
1051
|
+
/** Characters that drift slowly and stay clear around your content, drawn on the GPU. */
|
|
1052
|
+
declare const drift: BackgroundPreset;
|
|
1053
|
+
|
|
1054
|
+
/** The drifting ground drawn as dots, clear around your content. `cellSize` is the dot spacing. */
|
|
1055
|
+
declare const halftone: BackgroundPreset;
|
|
1056
|
+
|
|
1057
|
+
/** A word becomes the background, drawn by the GPU with a soft wake. Set it with `text`; `look: { scene: 'orb' }` for the orb. */
|
|
1058
|
+
declare const wordField: BackgroundPreset;
|
|
1059
|
+
|
|
1060
|
+
/** Flowing folds with a soft wake behind the cursor: the original Asciify hero, driven through the GPU field. */
|
|
1061
|
+
declare const fluid: BackgroundPreset;
|
|
1062
|
+
|
|
1063
|
+
/** Soft bands of light drift across the page and ripple under the cursor. */
|
|
1064
|
+
declare const aurora: BackgroundPreset;
|
|
1065
|
+
|
|
1066
|
+
/** Fine pools of light that drift like water across stone. */
|
|
1067
|
+
declare const caustics: BackgroundPreset;
|
|
1068
|
+
|
|
1069
|
+
/** Circuit traces with signals running along them. */
|
|
1070
|
+
declare const circuit: BackgroundPreset;
|
|
1071
|
+
|
|
1072
|
+
/** Fine topographic lines with a slow, rolling drift. */
|
|
1073
|
+
declare const contour: BackgroundPreset;
|
|
1074
|
+
|
|
1075
|
+
/** Double helices scroll past with base-pair letters. */
|
|
1076
|
+
declare const dna: BackgroundPreset;
|
|
1077
|
+
|
|
1078
|
+
/** Layered sand ridges with slow-moving light and fine grain. */
|
|
1079
|
+
declare const dune: BackgroundPreset;
|
|
1080
|
+
|
|
1081
|
+
/** Cut-grain lines follow a slow, sculpted current. */
|
|
1082
|
+
declare const etch: BackgroundPreset;
|
|
1083
|
+
|
|
1084
|
+
/** Quiet folded planes catch light along their edges. */
|
|
1085
|
+
declare const facet: BackgroundPreset;
|
|
1086
|
+
|
|
1087
|
+
/** A cellular flame rising from the bottom edge. */
|
|
1088
|
+
declare const fire: BackgroundPreset;
|
|
1089
|
+
|
|
1090
|
+
/** Scan bands roll down a character grid and glitch near the cursor. */
|
|
1091
|
+
declare const grid: BackgroundPreset;
|
|
1092
|
+
|
|
1093
|
+
/** Two fine line fields overlap into broad, shifting bands. */
|
|
1094
|
+
declare const moire: BackgroundPreset;
|
|
1095
|
+
|
|
1096
|
+
/** Every cell shimmers at its own frequencies. */
|
|
1097
|
+
declare const morph: BackgroundPreset;
|
|
1098
|
+
|
|
1099
|
+
/** A slow fractal noise field that warps around the cursor. */
|
|
1100
|
+
declare const noise: BackgroundPreset;
|
|
1101
|
+
|
|
1102
|
+
/** Rings of characters ripple out from the cursor. */
|
|
1103
|
+
declare const pulse: BackgroundPreset;
|
|
1104
|
+
|
|
1105
|
+
/** Columns of falling characters with bright heads. */
|
|
1106
|
+
declare const rain: BackgroundPreset;
|
|
1107
|
+
|
|
1108
|
+
/** Long ribbons that follow a slow flow field. */
|
|
1109
|
+
declare const silk: BackgroundPreset;
|
|
1110
|
+
|
|
1111
|
+
/** A sparse starfield that twinkles, drifts and leans toward the cursor. */
|
|
1112
|
+
declare const stars: BackgroundPreset;
|
|
1113
|
+
|
|
1114
|
+
/** A side-scrolling landscape drawn in density characters. */
|
|
1115
|
+
declare const terrain: BackgroundPreset;
|
|
1116
|
+
|
|
1117
|
+
/** Tall folds of light drifting across a quiet ground. */
|
|
1118
|
+
declare const veil: BackgroundPreset;
|
|
1119
|
+
|
|
1120
|
+
/** A gravity well that spirals characters around the cursor. */
|
|
1121
|
+
declare const voidWell: BackgroundPreset;
|
|
1122
|
+
|
|
1123
|
+
/** An interference field with a soft vortex at the cursor and a slow breath. */
|
|
1124
|
+
declare const wave: BackgroundPreset;
|
|
1125
|
+
|
|
1126
|
+
/** Interlaced threads with a subtle change in tension. */
|
|
1127
|
+
declare const weave: BackgroundPreset;
|
|
1128
|
+
|
|
1129
|
+
/** What a canvas template is drawn with each frame. */
|
|
1130
|
+
interface TemplateFrame {
|
|
1131
|
+
fontSize: number;
|
|
1132
|
+
chars: string | undefined;
|
|
1133
|
+
ditherStrength: number;
|
|
1134
|
+
lightMode: boolean;
|
|
1135
|
+
/** The ink as #rrggbb. */
|
|
1136
|
+
ink: string;
|
|
1137
|
+
/** Your accent as #rrggbb, or undefined for the template's own. */
|
|
1138
|
+
accent: string | undefined;
|
|
1139
|
+
/** Seconds since mount at speed 1, for templates that keep their own clock (Fire). */
|
|
1140
|
+
elapsed: number;
|
|
1141
|
+
speed: number;
|
|
1142
|
+
}
|
|
1143
|
+
type TemplateDraw = (ctx: CanvasRenderingContext2D, width: number, height: number, time: number, mouse: {
|
|
1144
|
+
x: number;
|
|
1145
|
+
y: number;
|
|
1146
|
+
}, frame: TemplateFrame) => void;
|
|
1147
|
+
/**
|
|
1148
|
+
* Runs a canvas template under the host's content exactly as the /backgrounds stage does: the same clock, pointer smoothing,
|
|
1149
|
+
* pixel ratio and frame skipping. `warm` paints extra frames on mount and resize for templates that build up (Fire).
|
|
1150
|
+
*/
|
|
1151
|
+
declare function mountCanvas(context: BackgroundContext, draw: TemplateDraw, warmFrames?: number): BackgroundRun | null;
|
|
1152
|
+
|
|
1153
|
+
/** The page-wide look `setGlobalLook` lays over every glyph field. */
|
|
1154
|
+
interface GlobalLook {
|
|
1155
|
+
/** Characters for every glyph field that keeps none of letters of its own. Empty keeps each field's own. */
|
|
1156
|
+
charset?: string;
|
|
1157
|
+
}
|
|
1158
|
+
/** Re-skins every glyph field on the page at once; `null` gives each field its own characters back. */
|
|
1159
|
+
declare function setGlobalLook(next: GlobalLook | null): void;
|
|
1160
|
+
declare const getGlobalLook: () => GlobalLook | null;
|
|
1161
|
+
/** Calls `listener` after each `setGlobalLook`. Returns the unsubscribe. */
|
|
1162
|
+
declare function subscribeGlobalLook(listener: (look: GlobalLook | null) => void): () => void;
|
|
1163
|
+
/**
|
|
1164
|
+
* At most `n` kit fields hold a WebGL context at once (default 12; browsers drop the oldest past about 16).
|
|
1165
|
+
* Past it the live field farthest off screen is released first, and shows its poster until it is the nearer one again.
|
|
1166
|
+
*/
|
|
1167
|
+
declare function setFieldBudget(n: number): void;
|
|
1168
|
+
declare const getFieldBudget: () => number;
|
|
1169
|
+
|
|
1170
|
+
export { type AccordionHandle, type AccordionImage, type AccordionOptions, type ArtPanelHandle, type ArtPanelOptions, type AsciiVideoHandle, type AsciiVideoOptions, BEAM_PALETTES, type BackgroundCharset, type BackgroundContext, type BackgroundCursor, type BackgroundHandle, type BackgroundOptions, type BackgroundPreset, type BackgroundRun, type BackgroundSettings, type BeamHandle, type BeamMode, type BeamOptions, type BeamPalette, type BlockChartHandle, type BlockChartOptions, type Box, type ButtonLoadingHandle, type ButtonLoadingOptions, type ButtonState, type CodeInputHandle, type CodeInputOptions, type CodeState, type CommandPaletteHandle, type CommandPaletteOptions, type CompareHandle, type CompareOptions, type DecodeHandle, type DecodeOptions, type DisintegrateOptions, type DropState, type DroppedImage, type DropzoneHandle, type DropzoneOptions, type FieldBackgroundHandle, type FieldBackgroundOptions, type FieldPreset, type GenerateState, type GlobalLook, type ImageGenerateHandle, type ImageGenerateOptions, type ImageStream, type ImageUpdate, type KitHandle, type KitOptions, type LikeBurstHandle, type LikeBurstOptions, type LikeMark, type OdometerHandle, type OdometerOptions, type OrbState, PILL_TONES, type PageDissolveHandle, type PageDissolveOptions, type PaintFrame, type PillHandle, type PillOptions, type PillTone, type PricingGlowHandle, type PricingGlowOptions, type PullRefreshHandle, type PullRefreshOptions, type PullState, type SkeletonBlock, type SkeletonHandle, type SkeletonOptions, type SlideToConfirmHandle, type SlideToConfirmOptions, type StatusOrbHandle, type StatusOrbOptions, type StreamState, type StreamTextHandle, type StreamTextOptions, type Surface, type SurfaceConfig, type SwipeDeckHandle, type SwipeDeckOptions, type TabsHandle, type TabsOptions, type TemplateDraw, type TemplateFrame, type ThinkingHandle, type ThinkingOptions, type ThinkingState, type Toast, type ToastStackHandle, type ToastStackOptions, VOICE_PALETTES, type VoiceOrbHandle, type VoiceOrbOptions, type VoicePalette, type VoiceState, type WordmarkHandle, type WordmarkOptions, accordion, artPanel, asciiVideo, aurora, background, backgroundCharset, beam, beamPalette, blockChart, buttonLoading, caustics, circuit, codeInput, commandPalette, compare, contour, decode, disintegrate, dna, drift, dropzone, dune, etch, facet, fieldBackground, fire, fluid, getFieldBudget, getGlobalLook, grid, halftone, imageGenerate, likeBurst, moire, morph, mountCanvas, mountSurface, noise, odometer, pageDissolve, pill, pricingGlow, pullRefresh, pulse, rain, resolveColor, setFieldBudget, setGlobalLook, silk, skeleton, slideToConfirm, stars, statusOrb, streamText, subscribeGlobalLook, swipeDeck, tabs, terrain, thinking, toastStack, veil, voiceOrb, voidWell, wave, weave, wordField, wordmark };
|