fancy-ui-vue 0.3.0 → 0.4.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 +9 -6
- package/dist/components/animated-testimonials/AnimatedTestimonials.vue.js +23 -12
- package/dist/components/bg-falling-stars/FallingStarsBg.vue.js +10 -1
- package/dist/components/bg-falling-stars/bg-falling-stars-core.d.ts +6 -0
- package/dist/components/bg-falling-stars/bg-falling-stars-core.js +24 -2
- package/dist/components/bg-stars/StarsBackground.vue.js +1 -1
- package/dist/components/bg-stars/StarsBackground.vue2.js +13 -1
- package/dist/components/bg-stars/bg-stars-core.d.ts +6 -0
- package/dist/components/bg-stars/bg-stars-core.js +21 -1
- package/dist/components/book/Book.vue.js +5 -83
- package/dist/components/book/Book.vue2.js +82 -1
- package/dist/components/box-reveal/BoxReveal.vue.js +5 -47
- package/dist/components/box-reveal/BoxReveal.vue2.js +48 -1
- package/dist/components/compare/StarField.vue.js +1 -1
- package/dist/components/container-text-flip/ContainerTextFlip.vue.js +1 -1
- package/dist/components/container-text-flip/ContainerTextFlip.vue2.js +14 -5
- package/dist/components/flickering-grid/FlickeringGrid.vue.js +19 -1
- package/dist/components/flickering-grid/flickering-grid-core.d.ts +6 -0
- package/dist/components/flickering-grid/flickering-grid-core.js +30 -1
- package/dist/components/flip-words/FlipWords.vue.js +1 -1
- package/dist/components/flip-words/FlipWords.vue2.js +14 -7
- package/dist/components/hyper-text/HyperText.vue.js +6 -97
- package/dist/components/hyper-text/HyperText.vue2.js +101 -0
- package/dist/components/letter-pullup/LetterPullup.vue.js +6 -38
- package/dist/components/letter-pullup/LetterPullup.vue2.js +40 -0
- package/dist/components/logo-cloud/AnimatedLogoCloud.vue.js +1 -1
- package/dist/components/magnetic-field/MagnetPuck.vue.d.ts +51 -0
- package/dist/components/magnetic-field/MagnetPuck.vue.js +7 -0
- package/dist/components/magnetic-field/MagnetPuck.vue2.js +191 -0
- package/dist/components/magnetic-field/MagneticField.vue.d.ts +39 -0
- package/dist/components/magnetic-field/MagneticField.vue.js +7 -0
- package/dist/components/magnetic-field/MagneticField.vue2.js +157 -0
- package/dist/components/magnetic-field/MagneticItem.vue.d.ts +28 -0
- package/dist/components/magnetic-field/MagneticItem.vue.js +7 -0
- package/dist/components/magnetic-field/MagneticItem.vue2.js +72 -0
- package/dist/components/magnetic-field/index.d.ts +10 -0
- package/dist/components/magnetic-field/magnetic-field-core.d.ts +163 -0
- package/dist/components/magnetic-field/magnetic-field-core.js +534 -0
- package/dist/components/magnetic-field/magnetic-field-source.d.ts +58 -0
- package/dist/components/magnetic-field/magnetic-field-source.js +58 -0
- package/dist/components/magnetic-field/types.d.ts +14 -0
- package/dist/components/magnetic-field/types.js +5 -0
- package/dist/components/matrix-rain/MatrixRain.vue.js +20 -1
- package/dist/components/matrix-rain/matrix-rain-core.d.ts +6 -0
- package/dist/components/matrix-rain/matrix-rain-core.js +28 -6
- package/dist/components/noise-reveal/NoiseReveal.vue.js +7 -0
- package/dist/components/noise-reveal/noise-reveal-core.js +23 -7
- package/dist/components/pixel-scene/PixelScene.vue.d.ts +60 -0
- package/dist/components/pixel-scene/PixelScene.vue.js +184 -0
- package/dist/components/pixel-scene/PixelScene.vue2.js +4 -0
- package/dist/components/pixel-scene/index.d.ts +4 -0
- package/dist/components/pixel-scene/pixel-scene-core.d.ts +256 -0
- package/dist/components/pixel-scene/pixel-scene-core.js +878 -0
- package/dist/components/pixel-scene/pixel-scene-hdr.d.ts +68 -0
- package/dist/components/pixel-scene/pixel-scene-hdr.js +312 -0
- package/dist/components/pixel-scene/pixel-scene-scenes.d.ts +31 -0
- package/dist/components/pixel-scene/pixel-scene-scenes.js +1074 -0
- package/dist/components/ripple/Ripple.vue.js +1 -1
- package/dist/components/ripple/Ripple.vue2.js +6 -1
- package/dist/components/sparkles/Sparkles.vue.js +10 -1
- package/dist/components/sparkles/sparkles-core.d.ts +6 -0
- package/dist/components/sparkles/sparkles-core.js +26 -2
- package/dist/components/sparkles-text/SparklesText.vue.js +6 -88
- package/dist/components/sparkles-text/SparklesText.vue2.js +100 -0
- package/dist/components/story-thread/StoryNode.vue.d.ts +11 -0
- package/dist/components/story-thread/StoryNode.vue.js +7 -0
- package/dist/components/story-thread/StoryNode.vue2.js +23 -0
- package/dist/components/story-thread/StoryThread.vue.d.ts +56 -0
- package/dist/components/story-thread/StoryThread.vue.js +7 -0
- package/dist/components/story-thread/StoryThread.vue2.js +103 -0
- package/dist/components/story-thread/index.d.ts +5 -0
- package/dist/components/story-thread/story-thread-core.d.ts +119 -0
- package/dist/components/story-thread/story-thread-core.js +491 -0
- package/dist/components/story-thread/types.d.ts +1 -0
- package/dist/components/sun-switch/SunSwitch.vue.d.ts +61 -0
- package/dist/components/sun-switch/SunSwitch.vue.js +7 -0
- package/dist/components/sun-switch/SunSwitch.vue2.js +559 -0
- package/dist/components/sun-switch/index.d.ts +4 -0
- package/dist/components/sun-switch/pixel-wave-core.d.ts +82 -0
- package/dist/components/sun-switch/pixel-wave-core.js +508 -0
- package/dist/components/sun-switch/sun-switch-core.d.ts +251 -0
- package/dist/components/sun-switch/sun-switch-core.js +546 -0
- package/dist/components/sun-switch/sun-switch-hdr.d.ts +70 -0
- package/dist/components/sun-switch/sun-switch-hdr.js +311 -0
- package/dist/components/terminal-text/TerminalText.vue.js +1 -1
- package/dist/components/terminal-text/TerminalText.vue2.js +36 -4
- package/dist/components/text-generate-effect/TextGenerateEffect.vue.js +5 -72
- package/dist/components/text-generate-effect/TextGenerateEffect.vue2.js +74 -1
- package/dist/components/text-reveal-card/TextRevealCard.vue.js +5 -101
- package/dist/components/text-reveal-card/TextRevealCard.vue2.js +98 -1
- package/dist/components/text-reveal-card/TextRevealStars.vue.js +1 -1
- package/dist/components/text-reveal-card/TextRevealStars.vue2.js +29 -12
- package/dist/components/tracing-beam/TracingBeam.vue.d.ts +20 -1
- package/dist/components/tracing-beam/TracingBeam.vue.js +5 -164
- package/dist/components/tracing-beam/TracingBeam.vue2.js +168 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +361 -338
- package/dist/styles.css +731 -89
- package/package.json +1 -1
- package/dist/components/hyper-text/HyperText.vue3.js +0 -5
- package/dist/components/letter-pullup/LetterPullup.vue3.js +0 -5
- package/dist/components/sparkles-text/SparklesText.vue3.js +0 -5
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PixelScene core — the framework-free engine, byte-identical in the Svelte,
|
|
3
|
+
* React and Vue trees (see shared-cores.json).
|
|
4
|
+
*
|
|
5
|
+
* A picture is a grid of square cells. Every frame a scene painter fills the
|
|
6
|
+
* grid through `writeCell` (the `put()` grammar below), `pixelHalos` adds the
|
|
7
|
+
* dithered light cells around emitters, and `paintGrid` draws one square dot
|
|
8
|
+
* per cell into a 2D canvas: sparse ink dots outside the lens, full colour
|
|
9
|
+
* under it, lit cells in colour everywhere. Cells with `glow > 0` are handed
|
|
10
|
+
* to the optional HDR layer through `onFrame`.
|
|
11
|
+
*
|
|
12
|
+
* First the pure helpers (hash, Bayer, noise, packed colours), then the grid,
|
|
13
|
+
* the lens, the painter, and `createPixelScene`, the engine that owns the
|
|
14
|
+
* canvas, the rAF loop, the pointer listeners and every observer. No
|
|
15
|
+
* framework imports, and nothing touches `window` or `document` at module
|
|
16
|
+
* scope, so the file is safe to import on the server.
|
|
17
|
+
*
|
|
18
|
+
* Colours are packed `0xRRGGBB` integers (`-1` = empty cell). Scenes may still
|
|
19
|
+
* pass `"#hex"` literals; `parseColour` caches them. No CSS string is built
|
|
20
|
+
* per cell.
|
|
21
|
+
*
|
|
22
|
+
* Compiles under `noUncheckedIndexedAccess`. The `!` assertions are in bounds
|
|
23
|
+
* by construction (indices come from loops over the arrays' own sizes).
|
|
24
|
+
*/
|
|
25
|
+
/** 4×4 ordered-dither thresholds, centred in (0, 1). */
|
|
26
|
+
export declare const BAYER: readonly number[];
|
|
27
|
+
/** Ordered-dither threshold of a cell, one of 16 levels in (0, 1). */
|
|
28
|
+
export declare function bayer(x: number, y: number): number;
|
|
29
|
+
/** Deterministic hash of a cell and a seed, in [0, 1). */
|
|
30
|
+
export declare function hash(x: number, y: number, s?: number): number;
|
|
31
|
+
export declare function clamp(v: number, a: number, b: number): number;
|
|
32
|
+
/** Smoothstep on [0, 1], clamped. */
|
|
33
|
+
export declare function smooth(t: number): number;
|
|
34
|
+
/** 1D value noise in [0, 1). */
|
|
35
|
+
export declare function noise1(x: number, seed: number): number;
|
|
36
|
+
/** Two octaves of value noise: a ridge line `amp` tall over `scale` cells. */
|
|
37
|
+
export declare function ridge(x: number, seed: number, scale: number, amp: number): number;
|
|
38
|
+
/** A colour as scenes write it: a `"#hex"` / `rgb()` string or a packed int. */
|
|
39
|
+
export type Colour = string | number;
|
|
40
|
+
/** `#rgb`, `#rrggbb` or `rgb()` → `0xRRGGBB`; a packed int passes through; anything else → -1. */
|
|
41
|
+
export declare function parseColour(c: Colour): number;
|
|
42
|
+
/** Linear mix of two colours, channels truncated as the prototype's `rgb()` did. */
|
|
43
|
+
export declare function mixHex(a: Colour, b: Colour, t: number): number;
|
|
44
|
+
/** Gradient through `[position, colour]` stops at `t` in [0, 1]. */
|
|
45
|
+
export declare function grad(stops: readonly (readonly [number, Colour])[], t: number): number;
|
|
46
|
+
/** Packed colour → cached `#rrggbb`. */
|
|
47
|
+
export declare function cssOf(c: number): string;
|
|
48
|
+
/** sRGB channel 0–255 → linear light 0–1 (lookup table). */
|
|
49
|
+
export declare function srgbToLinear(c8: number): number;
|
|
50
|
+
/** Linear light → extended-sRGB encoded value; keeps going above 1 for HDR. */
|
|
51
|
+
export declare function encodeExt(v: number): number;
|
|
52
|
+
export interface PixelGrid {
|
|
53
|
+
cols: number;
|
|
54
|
+
rows: number;
|
|
55
|
+
/** -1 = empty, else 0xRRGGBB — what the lens shows. */
|
|
56
|
+
color: Int32Array;
|
|
57
|
+
/** Dot alpha outside the lens (0 = no dot). */
|
|
58
|
+
inkA: Float32Array;
|
|
59
|
+
/** 1 = colour shown outside the lens too. */
|
|
60
|
+
lit: Uint8Array;
|
|
61
|
+
/** HDR multiple of SDR white, 0 = SDR only. */
|
|
62
|
+
glow: Float32Array;
|
|
63
|
+
/** Emitter halo radius in cells (0 = not an emitter). */
|
|
64
|
+
halo: Float32Array;
|
|
65
|
+
/** Halo colour override for the HDR layer, -1 = none. */
|
|
66
|
+
hcol: Int32Array;
|
|
67
|
+
/**
|
|
68
|
+
* Soft golden halo radius in cells, HDR only (0 = none). The one exception to
|
|
69
|
+
* the hard-square rule, kept for the lit windows of houses.
|
|
70
|
+
*/
|
|
71
|
+
soft: Float32Array;
|
|
72
|
+
/** Flat `[x, y, colour, glow, haloCells] × n`. */
|
|
73
|
+
emitters: number[];
|
|
74
|
+
/**
|
|
75
|
+
* The copy corner, in cells from the top-left (0 = none): lens cells inside
|
|
76
|
+
* it are not boosted, so text over the picture keeps SDR contrast. Set by
|
|
77
|
+
* the painter each frame.
|
|
78
|
+
*/
|
|
79
|
+
copyW: number;
|
|
80
|
+
copyH: number;
|
|
81
|
+
/** Centre of the sun (or moon) in cells, -1 when the frame has none. Set by the painter. */
|
|
82
|
+
sunX: number;
|
|
83
|
+
sunY: number;
|
|
84
|
+
}
|
|
85
|
+
export declare const INK_ALPHA_NIGHT = 0.6;
|
|
86
|
+
export declare const INK_ALPHA_DAY = 0.85;
|
|
87
|
+
/** Glow of every cell revealed by the lens. */
|
|
88
|
+
export declare const LENS_BOOST = 1.6;
|
|
89
|
+
/** Glow of a cell written with `l = true`. */
|
|
90
|
+
export declare const LIT_GLOW = 1.5;
|
|
91
|
+
/** Highest glow a cell may carry (≈ 1000 nits over a 203-nit SDR white). */
|
|
92
|
+
export declare const GLOW_PEAK = 4.9;
|
|
93
|
+
export declare const MAX_CELLS = 72000;
|
|
94
|
+
export declare const MAX_DPR = 2;
|
|
95
|
+
/** Backing-store budget per canvas, device px (2048²): past it the backing drops to DPR 1. */
|
|
96
|
+
export declare const MAX_BACKING_PX = 4200000;
|
|
97
|
+
export declare const MIN_CELL = 4;
|
|
98
|
+
export declare const MAX_CELL = 32;
|
|
99
|
+
export declare function createGrid(cols: number, rows: number): PixelGrid;
|
|
100
|
+
export declare function clearGrid(g: PixelGrid): void;
|
|
101
|
+
/**
|
|
102
|
+
* The prototype's `put()`. `a` is the dot alpha outside the lens. `l`: false =
|
|
103
|
+
* plain cell, true = lit (colour outside the lens, glow {@link LIT_GLOW}),
|
|
104
|
+
* number = lit and HDR at that multiple of SDR white (clamped to
|
|
105
|
+
* {@link GLOW_PEAK}). `hl > 0` with a numeric `l` registers an emitter whose
|
|
106
|
+
* dithered halo `pixelHalos` adds. Out-of-bounds cells are ignored.
|
|
107
|
+
*/
|
|
108
|
+
export declare function writeCell(g: PixelGrid, x: number, y: number, c: Colour, a?: number, l?: boolean | number, hl?: number): void;
|
|
109
|
+
/**
|
|
110
|
+
* Around every emitter, light neighbouring cells as hard squares, Bayer
|
|
111
|
+
* dithered so density and brightness fall with distance. No blur anywhere.
|
|
112
|
+
*/
|
|
113
|
+
export declare function pixelHalos(g: PixelGrid): void;
|
|
114
|
+
/** Duration of a day / night wave, ms (ease in-out cubic). */
|
|
115
|
+
export declare const WAVE_MS = 1300;
|
|
116
|
+
/** Thickness of the dithered halo that leads the wave front, in cells. */
|
|
117
|
+
export declare const WAVE_HALO_CELLS = 9;
|
|
118
|
+
/** Width of the dithered HDR glow on each side of the halo band, in cells. */
|
|
119
|
+
export declare const WAVE_GLOW_CELLS = 7;
|
|
120
|
+
/** Halo colours from the sparse outer fringe to the dense inner rim. */
|
|
121
|
+
export declare const WAVE_PALETTE: readonly number[];
|
|
122
|
+
export declare function easeInOutCubic(t: number): number;
|
|
123
|
+
/** Glow of a halo cell at depth D (1 = inner rim, 0 = outer fringe). */
|
|
124
|
+
export declare function waveGlow(D: number): number;
|
|
125
|
+
/**
|
|
126
|
+
* Glow of a cell in the band around the halo, `d` in [0, 1) from the halo edge
|
|
127
|
+
* outward, or 0 when the Bayer threshold leaves it dark: density `(1 − d)^1.7`.
|
|
128
|
+
*/
|
|
129
|
+
export declare function waveBandGlow(x: number, y: number, d: number, inner: boolean): number;
|
|
130
|
+
/** Radius (cells) at which a front from (ox, oy) has passed every cell, halo included. */
|
|
131
|
+
export declare function waveCover(ox: number, oy: number, cols: number, rows: number): number;
|
|
132
|
+
/**
|
|
133
|
+
* Composites one wave frame into `cur` (the old picture): cells the front has
|
|
134
|
+
* passed (`dist < R − halo`) take `next`'s content, the halo band is
|
|
135
|
+
* Bayer-dithered with `D^0.7` and lit at {@link waveGlow} (SDR inside the copy
|
|
136
|
+
* corner), the rest keeps the old picture. Emitters follow their side.
|
|
137
|
+
* `side[i]` is set to 1 for cells on the new side, 0 elsewhere.
|
|
138
|
+
*/
|
|
139
|
+
export declare function composeWave(cur: PixelGrid, next: PixelGrid, side: Uint8Array, ox: number, oy: number, R: number): void;
|
|
140
|
+
export interface Lens {
|
|
141
|
+
x: number;
|
|
142
|
+
y: number;
|
|
143
|
+
tx: number;
|
|
144
|
+
ty: number;
|
|
145
|
+
r: number;
|
|
146
|
+
tr: number;
|
|
147
|
+
}
|
|
148
|
+
export declare function createLens(): Lens;
|
|
149
|
+
/**
|
|
150
|
+
* Moves the lens toward its target, frame-rate independent (`k = 1 − 0.6^(dt/16.667)`;
|
|
151
|
+
* the radius opens 1.3× and closes 0.7× as fast). `snap` jumps to the target.
|
|
152
|
+
* Returns whether it is still moving.
|
|
153
|
+
*/
|
|
154
|
+
export declare function stepLens(l: Lens, dt: number, snap: boolean): boolean;
|
|
155
|
+
/** Whether a cell is revealed: inside the radius, with a Bayer-dithered rim. */
|
|
156
|
+
export declare function inLens(l: Lens, x: number, y: number): boolean;
|
|
157
|
+
export interface PaintParams {
|
|
158
|
+
/** Grid pitch in CSS px. */
|
|
159
|
+
cell: number;
|
|
160
|
+
/** Dot edge in CSS px. */
|
|
161
|
+
dot: number;
|
|
162
|
+
dpr: number;
|
|
163
|
+
/** Resting dot colour, any canvas colour string. */
|
|
164
|
+
ink: string;
|
|
165
|
+
night: boolean;
|
|
166
|
+
/** During a wave: cells with `side[i] === 1` use `sideInk` at the ink alpha of `sideNight`. */
|
|
167
|
+
side?: Uint8Array | null;
|
|
168
|
+
sideNight?: boolean;
|
|
169
|
+
sideInk?: string;
|
|
170
|
+
/** Fills the canvas before the dots (the scene owns its background); null = transparent. */
|
|
171
|
+
surface?: string | null;
|
|
172
|
+
/** During a wave: whole cells on the new side are filled with it (a grid-aligned staircase). */
|
|
173
|
+
sideSurface?: string | null;
|
|
174
|
+
/** Backing-store size to clear, device px (defaults to `ctx.canvas`). */
|
|
175
|
+
width?: number;
|
|
176
|
+
height?: number;
|
|
177
|
+
}
|
|
178
|
+
/** Device-pixel origin of cell `x` (or row `y`); the HDR layer uses the same expression. */
|
|
179
|
+
export declare function cellOrigin(x: number, cell: number, dpr: number): number;
|
|
180
|
+
/**
|
|
181
|
+
* One 2D pass over the grid. Raises the glow of lens cells to at least
|
|
182
|
+
* {@link LENS_BOOST} (mutates `g.glow`, as the HDR layer reads it next),
|
|
183
|
+
* except inside the copy corner (`g.copyW × g.copyH`).
|
|
184
|
+
*/
|
|
185
|
+
export declare function paintGrid(ctx: CanvasRenderingContext2D, g: PixelGrid, lens: Lens, p: PaintParams): void;
|
|
186
|
+
/**
|
|
187
|
+
* Clamps `cell` to [4, 32] and `dot` to [1, cell], then grows the cell on big
|
|
188
|
+
* boxes so the grid stays under {@link MAX_CELLS}; the dot keeps its ratio.
|
|
189
|
+
*/
|
|
190
|
+
export declare function effectiveCell(cssW: number, cssH: number, cell: number, dot: number): {
|
|
191
|
+
cell: number;
|
|
192
|
+
dot: number;
|
|
193
|
+
};
|
|
194
|
+
/**
|
|
195
|
+
* The backing-store DPR for a box: the device DPR (already capped at
|
|
196
|
+
* {@link MAX_DPR}), or 1 when that would exceed {@link MAX_BACKING_PX}. The
|
|
197
|
+
* canvas is then upscaled with `image-rendering: pixelated`, so the squares
|
|
198
|
+
* stay hard.
|
|
199
|
+
*/
|
|
200
|
+
export declare function backingDpr(cssW: number, cssH: number, deviceDpr: number): number;
|
|
201
|
+
/** Paints one frame of a scene into the grid. Must be synchronous. */
|
|
202
|
+
export type ScenePainter = (t: number, g: PixelGrid, night: boolean) => void;
|
|
203
|
+
/** What the HDR layer reads after each painted frame (device px, live views — read synchronously). */
|
|
204
|
+
export interface PixelSceneFrame {
|
|
205
|
+
cols: number;
|
|
206
|
+
rows: number;
|
|
207
|
+
/** Backing-store size, device px. */
|
|
208
|
+
width: number;
|
|
209
|
+
height: number;
|
|
210
|
+
/** `cell × dpr`; a cell's origin is `round(x · cellCss · dpr)`. */
|
|
211
|
+
pitch: number;
|
|
212
|
+
/** Dot edge, device px: `round(dot · dpr)`. */
|
|
213
|
+
size: number;
|
|
214
|
+
cellCss: number;
|
|
215
|
+
dpr: number;
|
|
216
|
+
/** True when the backing is below the device resolution (see {@link backingDpr}). */
|
|
217
|
+
pixelated?: boolean;
|
|
218
|
+
color: Int32Array;
|
|
219
|
+
glow: Float32Array;
|
|
220
|
+
hcol: Int32Array;
|
|
221
|
+
/** Soft halo radius per cell, in cells (see {@link PixelGrid.soft}). */
|
|
222
|
+
soft: Float32Array;
|
|
223
|
+
}
|
|
224
|
+
export interface PixelSceneElements {
|
|
225
|
+
host: HTMLElement;
|
|
226
|
+
canvas: HTMLCanvasElement;
|
|
227
|
+
}
|
|
228
|
+
export interface PixelSceneOptions {
|
|
229
|
+
painter: ScenePainter;
|
|
230
|
+
night?: boolean;
|
|
231
|
+
cell?: number;
|
|
232
|
+
dot?: number;
|
|
233
|
+
lens?: boolean;
|
|
234
|
+
lensRadius?: number;
|
|
235
|
+
ink?: string;
|
|
236
|
+
paused?: boolean;
|
|
237
|
+
/** Animate a change of `night` as a wave from the sun (default true; never under reduced motion). */
|
|
238
|
+
wave?: boolean;
|
|
239
|
+
/** `[day, night]` background painted by the canvas; null = transparent (the host shows). */
|
|
240
|
+
surfaces?: readonly [string, string] | null;
|
|
241
|
+
/** `[day, night]` dot colours; null = `ink`. */
|
|
242
|
+
inks?: readonly [string, string] | null;
|
|
243
|
+
/** Override for tests; default = the live `prefers-reduced-motion` query. */
|
|
244
|
+
reducedMotion?: boolean;
|
|
245
|
+
/** HDR hook; a throwing callback is dropped and the 2D picture keeps going. */
|
|
246
|
+
onFrame?: ((f: PixelSceneFrame) => void) | null;
|
|
247
|
+
}
|
|
248
|
+
export interface PixelSceneEngine {
|
|
249
|
+
/** Absent or undefined keys are left untouched; `onFrame: null` clears the hook. */
|
|
250
|
+
setOptions(next: Partial<PixelSceneOptions>): void;
|
|
251
|
+
resize(): void;
|
|
252
|
+
destroy(): void;
|
|
253
|
+
}
|
|
254
|
+
export declare function normalizeLensRadius(r: number | undefined): number;
|
|
255
|
+
/** null when there is no 2D context (server, jsdom) — the component then keeps an inert canvas. */
|
|
256
|
+
export declare function createPixelScene(el: PixelSceneElements, options: PixelSceneOptions): PixelSceneEngine | null;
|