@basmilius/sparkle 2.0.0 → 2.1.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/dist/index.d.mts +1192 -14
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +4552 -370
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
- package/src/aurora/consts.ts +3 -0
- package/src/aurora/index.ts +4 -0
- package/src/aurora/layer.ts +152 -0
- package/src/aurora/simulation.ts +19 -0
- package/src/aurora/types.ts +13 -0
- package/src/balloons/consts.ts +3 -0
- package/src/balloons/index.ts +6 -0
- package/src/balloons/layer.ts +138 -0
- package/src/balloons/particle.ts +110 -0
- package/src/balloons/simulation.ts +19 -0
- package/src/balloons/types.ts +14 -0
- package/src/bubbles/consts.ts +3 -0
- package/src/bubbles/index.ts +4 -0
- package/src/bubbles/layer.ts +233 -0
- package/src/bubbles/simulation.ts +20 -0
- package/src/bubbles/types.ts +21 -0
- package/src/canvas.ts +20 -1
- package/src/color.ts +10 -0
- package/src/confetti/consts.ts +13 -13
- package/src/confetti/index.ts +6 -0
- package/src/confetti/layer.ts +152 -0
- package/src/confetti/particle.ts +105 -0
- package/src/confetti/shapes.ts +104 -0
- package/src/confetti/simulation.ts +9 -203
- package/src/confetti/types.ts +4 -1
- package/src/distance.ts +1 -1
- package/src/donuts/consts.ts +19 -0
- package/src/donuts/donut.ts +12 -0
- package/src/donuts/index.ts +3 -0
- package/src/donuts/layer.ts +270 -0
- package/src/donuts/simulation.ts +25 -0
- package/src/fireflies/consts.ts +3 -0
- package/src/fireflies/index.ts +6 -0
- package/src/fireflies/layer.ts +152 -0
- package/src/fireflies/particle.ts +124 -0
- package/src/fireflies/simulation.ts +18 -0
- package/src/fireflies/types.ts +17 -0
- package/src/firepit/consts.ts +3 -0
- package/src/firepit/index.ts +4 -0
- package/src/firepit/layer.ts +174 -0
- package/src/firepit/simulation.ts +17 -0
- package/src/firepit/types.ts +20 -0
- package/src/fireworks/explosion.ts +8 -8
- package/src/fireworks/firework.ts +9 -8
- package/src/fireworks/index.ts +6 -2
- package/src/fireworks/layer.ts +452 -0
- package/src/fireworks/simulation.ts +9 -484
- package/src/fireworks/spark.ts +7 -7
- package/src/glitter/consts.ts +13 -0
- package/src/glitter/index.ts +4 -0
- package/src/glitter/layer.ts +173 -0
- package/src/glitter/simulation.ts +19 -0
- package/src/glitter/types.ts +23 -0
- package/src/index.ts +28 -0
- package/src/lanterns/consts.ts +13 -0
- package/src/lanterns/index.ts +4 -0
- package/src/lanterns/layer.ts +166 -0
- package/src/lanterns/simulation.ts +17 -0
- package/src/lanterns/types.ts +14 -0
- package/src/layer.ts +24 -0
- package/src/layered.ts +185 -0
- package/src/leaves/consts.ts +16 -0
- package/src/leaves/index.ts +4 -0
- package/src/leaves/layer.ts +251 -0
- package/src/leaves/simulation.ts +18 -0
- package/src/leaves/types.ts +16 -0
- package/src/lightning/consts.ts +3 -0
- package/src/lightning/index.ts +6 -0
- package/src/lightning/layer.ts +41 -0
- package/src/lightning/simulation.ts +17 -0
- package/src/lightning/system.ts +196 -0
- package/src/lightning/types.ts +12 -0
- package/src/matrix/consts.ts +5 -0
- package/src/matrix/index.ts +4 -0
- package/src/matrix/layer.ts +146 -0
- package/src/matrix/simulation.ts +18 -0
- package/src/matrix/types.ts +8 -0
- package/src/orbits/consts.ts +13 -0
- package/src/orbits/index.ts +4 -0
- package/src/orbits/layer.ts +183 -0
- package/src/orbits/simulation.ts +19 -0
- package/src/orbits/types.ts +16 -0
- package/src/particles/consts.ts +3 -0
- package/src/particles/index.ts +4 -0
- package/src/particles/layer.ts +317 -0
- package/src/particles/simulation.ts +26 -0
- package/src/particles/types.ts +10 -0
- package/src/petals/consts.ts +13 -0
- package/src/petals/index.ts +4 -0
- package/src/petals/layer.ts +158 -0
- package/src/petals/simulation.ts +18 -0
- package/src/petals/types.ts +15 -0
- package/src/plasma/consts.ts +3 -0
- package/src/plasma/index.ts +4 -0
- package/src/plasma/layer.ts +92 -0
- package/src/plasma/simulation.ts +17 -0
- package/src/plasma/types.ts +5 -0
- package/src/rain/consts.ts +3 -0
- package/src/rain/index.ts +6 -0
- package/src/rain/layer.ts +172 -0
- package/src/rain/particle.ts +132 -0
- package/src/rain/simulation.ts +21 -0
- package/src/rain/types.ts +22 -0
- package/src/sandstorm/consts.ts +3 -0
- package/src/sandstorm/index.ts +4 -0
- package/src/sandstorm/layer.ts +135 -0
- package/src/sandstorm/simulation.ts +18 -0
- package/src/sandstorm/types.ts +10 -0
- package/src/shooting-stars/index.ts +3 -0
- package/src/shooting-stars/system.ts +149 -0
- package/src/shooting-stars/types.ts +10 -0
- package/src/simulation-canvas.ts +47 -0
- package/src/snow/consts.ts +2 -2
- package/src/snow/index.ts +1 -0
- package/src/snow/layer.ts +263 -0
- package/src/snow/simulation.ts +4 -288
- package/src/sparklers/consts.ts +3 -0
- package/src/sparklers/index.ts +6 -0
- package/src/sparklers/layer.ts +174 -0
- package/src/sparklers/particle.ts +89 -0
- package/src/sparklers/simulation.ts +30 -0
- package/src/sparklers/types.ts +13 -0
- package/src/stars/consts.ts +3 -0
- package/src/stars/index.ts +4 -0
- package/src/stars/layer.ts +133 -0
- package/src/stars/simulation.ts +22 -0
- package/src/stars/types.ts +12 -0
- package/src/streamers/consts.ts +14 -0
- package/src/streamers/index.ts +4 -0
- package/src/streamers/layer.ts +211 -0
- package/src/streamers/simulation.ts +16 -0
- package/src/streamers/types.ts +14 -0
- package/src/trail.ts +140 -0
- package/src/waves/consts.ts +3 -0
- package/src/waves/index.ts +4 -0
- package/src/waves/layer.ts +167 -0
- package/src/waves/simulation.ts +18 -0
- package/src/waves/types.ts +9 -0
- package/src/wormhole/consts.ts +3 -0
- package/src/wormhole/index.ts +4 -0
- package/src/wormhole/layer.ts +181 -0
- package/src/wormhole/simulation.ts +17 -0
- package/src/wormhole/types.ts +10 -0
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,32 @@
|
|
|
1
|
+
//#region src/layer.d.ts
|
|
2
|
+
type EdgeFadeSide = number | [number, number];
|
|
3
|
+
type EdgeFade = {
|
|
4
|
+
readonly top?: EdgeFadeSide;
|
|
5
|
+
readonly bottom?: EdgeFadeSide;
|
|
6
|
+
readonly left?: EdgeFadeSide;
|
|
7
|
+
readonly right?: EdgeFadeSide;
|
|
8
|
+
};
|
|
9
|
+
declare abstract class SimulationLayer {
|
|
10
|
+
fade: EdgeFade | null;
|
|
11
|
+
abstract tick(dt: number, width: number, height: number): void;
|
|
12
|
+
abstract draw(ctx: CanvasRenderingContext2D, width: number, height: number): void;
|
|
13
|
+
onResize(_width: number, _height: number): void;
|
|
14
|
+
onMount(_canvas: HTMLCanvasElement): void;
|
|
15
|
+
onUnmount(_canvas: HTMLCanvasElement): void;
|
|
16
|
+
withFade(fade: EdgeFade): this;
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
1
19
|
//#region src/canvas.d.ts
|
|
2
20
|
declare class LimitedFrameRateCanvas {
|
|
3
21
|
#private;
|
|
22
|
+
static get globalSpeed(): number;
|
|
23
|
+
static set globalSpeed(value: number);
|
|
4
24
|
get canvas(): HTMLCanvasElement;
|
|
5
25
|
get context(): CanvasRenderingContext2D;
|
|
6
26
|
get delta(): number;
|
|
7
27
|
get deltaFactor(): number;
|
|
28
|
+
get speed(): number;
|
|
29
|
+
set speed(value: number);
|
|
8
30
|
get frameRate(): number;
|
|
9
31
|
get isSmall(): boolean;
|
|
10
32
|
get isTicking(): boolean;
|
|
@@ -22,12 +44,184 @@ declare class LimitedFrameRateCanvas {
|
|
|
22
44
|
onVisibilityChange(): void;
|
|
23
45
|
}
|
|
24
46
|
//#endregion
|
|
47
|
+
//#region src/simulation-canvas.d.ts
|
|
48
|
+
declare class SimulationCanvas extends LimitedFrameRateCanvas {
|
|
49
|
+
#private;
|
|
50
|
+
constructor(canvas: HTMLCanvasElement, simulation: SimulationLayer, frameRate?: number, options?: CanvasRenderingContext2DSettings);
|
|
51
|
+
start(): void;
|
|
52
|
+
destroy(): void;
|
|
53
|
+
draw(): void;
|
|
54
|
+
tick(): void;
|
|
55
|
+
onResize(): void;
|
|
56
|
+
}
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region src/aurora/simulation.d.ts
|
|
59
|
+
interface AuroraSimulationConfig {
|
|
60
|
+
readonly bands?: number;
|
|
61
|
+
readonly colors?: string[];
|
|
62
|
+
readonly speed?: number;
|
|
63
|
+
readonly intensity?: number;
|
|
64
|
+
readonly waveAmplitude?: number;
|
|
65
|
+
readonly verticalPosition?: number;
|
|
66
|
+
readonly scale?: number;
|
|
67
|
+
readonly canvasOptions?: CanvasRenderingContext2DSettings;
|
|
68
|
+
}
|
|
69
|
+
declare class AuroraSimulation extends SimulationCanvas {
|
|
70
|
+
constructor(canvas: HTMLCanvasElement, config?: AuroraSimulationConfig);
|
|
71
|
+
}
|
|
72
|
+
//#endregion
|
|
73
|
+
//#region src/aurora/layer.d.ts
|
|
74
|
+
declare class AuroraLayer extends SimulationLayer {
|
|
75
|
+
#private;
|
|
76
|
+
constructor(config?: AuroraSimulationConfig);
|
|
77
|
+
tick(dt: number, width: number, height: number): void;
|
|
78
|
+
draw(ctx: CanvasRenderingContext2D, width: number, height: number): void;
|
|
79
|
+
}
|
|
80
|
+
//#endregion
|
|
81
|
+
//#region src/aurora/types.d.ts
|
|
82
|
+
type AuroraBand = {
|
|
83
|
+
x: number;
|
|
84
|
+
baseY: number;
|
|
85
|
+
height: number;
|
|
86
|
+
sigma: number;
|
|
87
|
+
phase1: number;
|
|
88
|
+
phase2: number;
|
|
89
|
+
amplitude1: number;
|
|
90
|
+
frequency1: number;
|
|
91
|
+
speed: number;
|
|
92
|
+
hue: number;
|
|
93
|
+
opacity: number;
|
|
94
|
+
};
|
|
95
|
+
//#endregion
|
|
96
|
+
//#region src/color.d.ts
|
|
97
|
+
declare function parseColor(fillStyle: string): {
|
|
98
|
+
r: number;
|
|
99
|
+
g: number;
|
|
100
|
+
b: number;
|
|
101
|
+
a: number;
|
|
102
|
+
};
|
|
103
|
+
//#endregion
|
|
104
|
+
//#region src/balloons/simulation.d.ts
|
|
105
|
+
interface BalloonSimulationConfig {
|
|
106
|
+
readonly count?: number;
|
|
107
|
+
readonly colors?: string[];
|
|
108
|
+
readonly sizeRange?: [number, number];
|
|
109
|
+
readonly speed?: number;
|
|
110
|
+
readonly driftAmount?: number;
|
|
111
|
+
readonly stringLength?: number;
|
|
112
|
+
readonly scale?: number;
|
|
113
|
+
readonly canvasOptions?: CanvasRenderingContext2DSettings;
|
|
114
|
+
}
|
|
115
|
+
declare class BalloonSimulation extends SimulationCanvas {
|
|
116
|
+
constructor(canvas: HTMLCanvasElement, config?: BalloonSimulationConfig);
|
|
117
|
+
}
|
|
118
|
+
//#endregion
|
|
119
|
+
//#region src/balloons/layer.d.ts
|
|
120
|
+
declare class BalloonLayer extends SimulationLayer {
|
|
121
|
+
#private;
|
|
122
|
+
constructor(config?: BalloonSimulationConfig);
|
|
123
|
+
tick(dt: number, width: number, height: number): void;
|
|
124
|
+
draw(ctx: CanvasRenderingContext2D, width: number, height: number): void;
|
|
125
|
+
}
|
|
126
|
+
//#endregion
|
|
127
|
+
//#region src/point.d.ts
|
|
128
|
+
type Point = {
|
|
129
|
+
x: number;
|
|
130
|
+
y: number;
|
|
131
|
+
};
|
|
132
|
+
//#endregion
|
|
133
|
+
//#region src/balloons/particle.d.ts
|
|
134
|
+
interface BalloonParticleConfig {
|
|
135
|
+
readonly driftAmp?: number;
|
|
136
|
+
readonly driftFreq?: number;
|
|
137
|
+
readonly driftPhase?: number;
|
|
138
|
+
readonly radiusX?: number;
|
|
139
|
+
readonly radiusY?: number;
|
|
140
|
+
readonly riseSpeed?: number;
|
|
141
|
+
readonly rotationSpeed?: number;
|
|
142
|
+
readonly scale?: number;
|
|
143
|
+
readonly stringLength?: number;
|
|
144
|
+
}
|
|
145
|
+
declare class BalloonParticle {
|
|
146
|
+
#private;
|
|
147
|
+
get isDone(): boolean;
|
|
148
|
+
get position(): Point;
|
|
149
|
+
constructor(position: Point, color: [number, number, number], config?: BalloonParticleConfig);
|
|
150
|
+
draw(ctx: CanvasRenderingContext2D): void;
|
|
151
|
+
tick(dt?: number): void;
|
|
152
|
+
}
|
|
153
|
+
//#endregion
|
|
154
|
+
//#region src/balloons/types.d.ts
|
|
155
|
+
type Balloon = {
|
|
156
|
+
x: number;
|
|
157
|
+
y: number;
|
|
158
|
+
radiusX: number;
|
|
159
|
+
radiusY: number;
|
|
160
|
+
color: [number, number, number];
|
|
161
|
+
driftPhase: number;
|
|
162
|
+
driftFreq: number;
|
|
163
|
+
driftAmp: number;
|
|
164
|
+
riseSpeed: number;
|
|
165
|
+
rotation: number;
|
|
166
|
+
rotationSpeed: number;
|
|
167
|
+
stringLength: number;
|
|
168
|
+
};
|
|
169
|
+
//#endregion
|
|
170
|
+
//#region src/bubbles/simulation.d.ts
|
|
171
|
+
interface BubbleSimulationConfig {
|
|
172
|
+
readonly count?: number;
|
|
173
|
+
readonly sizeRange?: [number, number];
|
|
174
|
+
readonly speed?: number;
|
|
175
|
+
readonly popOnClick?: boolean;
|
|
176
|
+
readonly popRadius?: number;
|
|
177
|
+
readonly colors?: string[];
|
|
178
|
+
readonly wobbleAmount?: number;
|
|
179
|
+
readonly scale?: number;
|
|
180
|
+
readonly canvasOptions?: CanvasRenderingContext2DSettings;
|
|
181
|
+
}
|
|
182
|
+
declare class BubbleSimulation extends SimulationCanvas {
|
|
183
|
+
constructor(canvas: HTMLCanvasElement, config?: BubbleSimulationConfig);
|
|
184
|
+
}
|
|
185
|
+
//#endregion
|
|
186
|
+
//#region src/bubbles/layer.d.ts
|
|
187
|
+
declare class BubbleLayer extends SimulationLayer {
|
|
188
|
+
#private;
|
|
189
|
+
constructor(config?: BubbleSimulationConfig);
|
|
190
|
+
onMount(canvas: HTMLCanvasElement): void;
|
|
191
|
+
onUnmount(canvas: HTMLCanvasElement): void;
|
|
192
|
+
tick(dt: number, width: number, height: number): void;
|
|
193
|
+
draw(ctx: CanvasRenderingContext2D, width: number, height: number): void;
|
|
194
|
+
}
|
|
195
|
+
//#endregion
|
|
196
|
+
//#region src/bubbles/types.d.ts
|
|
197
|
+
type Bubble = {
|
|
198
|
+
x: number;
|
|
199
|
+
y: number;
|
|
200
|
+
radius: number;
|
|
201
|
+
speed: number;
|
|
202
|
+
hue: number;
|
|
203
|
+
wobblePhase: number;
|
|
204
|
+
wobbleFreq: number;
|
|
205
|
+
wobbleAmp: number;
|
|
206
|
+
opacity: number;
|
|
207
|
+
};
|
|
208
|
+
type PopParticle = {
|
|
209
|
+
x: number;
|
|
210
|
+
y: number;
|
|
211
|
+
vx: number;
|
|
212
|
+
vy: number;
|
|
213
|
+
alpha: number;
|
|
214
|
+
size: number;
|
|
215
|
+
decay: number;
|
|
216
|
+
};
|
|
217
|
+
//#endregion
|
|
25
218
|
//#region src/confetti/types.d.ts
|
|
26
219
|
type Config = {
|
|
27
220
|
readonly angle: number;
|
|
28
221
|
readonly colors: string[];
|
|
29
222
|
readonly decay: number;
|
|
30
223
|
readonly gravity: number;
|
|
224
|
+
readonly palette: Palette;
|
|
31
225
|
readonly particles: number;
|
|
32
226
|
readonly shapes: Shape[];
|
|
33
227
|
readonly spread: number;
|
|
@@ -36,48 +230,800 @@ type Config = {
|
|
|
36
230
|
readonly x: number;
|
|
37
231
|
readonly y: number;
|
|
38
232
|
};
|
|
39
|
-
type
|
|
233
|
+
type Palette = "classic" | "pastel" | "vibrant" | "warm";
|
|
234
|
+
type Shape = "bowtie" | "circle" | "crescent" | "diamond" | "heart" | "hexagon" | "ribbon" | "ring" | "square" | "star" | "triangle";
|
|
40
235
|
//#endregion
|
|
41
236
|
//#region src/confetti/simulation.d.ts
|
|
42
237
|
interface ConfettiSimulationConfig {
|
|
43
238
|
readonly scale?: number;
|
|
44
239
|
readonly canvasOptions?: CanvasRenderingContext2DSettings;
|
|
45
240
|
}
|
|
46
|
-
declare class ConfettiSimulation extends
|
|
241
|
+
declare class ConfettiSimulation extends SimulationCanvas {
|
|
47
242
|
#private;
|
|
48
243
|
constructor(canvas: HTMLCanvasElement, config?: ConfettiSimulationConfig);
|
|
49
244
|
fire(config: Partial<Config>): void;
|
|
50
|
-
draw(): void;
|
|
51
|
-
tick(): void;
|
|
52
|
-
onResize(): void;
|
|
53
245
|
}
|
|
54
246
|
//#endregion
|
|
55
|
-
//#region src/
|
|
56
|
-
|
|
247
|
+
//#region src/confetti/layer.d.ts
|
|
248
|
+
declare class ConfettiLayer extends SimulationLayer {
|
|
249
|
+
#private;
|
|
250
|
+
constructor(config?: ConfettiSimulationConfig);
|
|
251
|
+
onResize(width: number, height: number): void;
|
|
252
|
+
fire(config: Partial<Config>): void;
|
|
253
|
+
get hasParticles(): boolean;
|
|
254
|
+
tick(dt: number, _width: number, _height: number): void;
|
|
255
|
+
draw(ctx: CanvasRenderingContext2D, width: number, height: number): void;
|
|
256
|
+
}
|
|
257
|
+
//#endregion
|
|
258
|
+
//#region src/confetti/particle.d.ts
|
|
259
|
+
interface ConfettiParticleConfig {
|
|
260
|
+
readonly decay?: number;
|
|
261
|
+
readonly gravity?: number;
|
|
262
|
+
readonly scale?: number;
|
|
263
|
+
readonly spread?: number;
|
|
264
|
+
readonly startVelocity?: number;
|
|
265
|
+
readonly ticks?: number;
|
|
266
|
+
}
|
|
267
|
+
declare class ConfettiParticle {
|
|
268
|
+
#private;
|
|
269
|
+
get isDead(): boolean;
|
|
270
|
+
get position(): Point;
|
|
271
|
+
constructor(position: Point, direction: number, shape: Shape, color: string, config?: ConfettiParticleConfig);
|
|
272
|
+
draw(ctx: CanvasRenderingContext2D): void;
|
|
273
|
+
tick(dt?: number): void;
|
|
274
|
+
}
|
|
275
|
+
//#endregion
|
|
276
|
+
//#region src/confetti/consts.d.ts
|
|
277
|
+
declare const PALETTES: Record<Palette, string[]>;
|
|
278
|
+
//#endregion
|
|
279
|
+
//#region src/confetti/shapes.d.ts
|
|
280
|
+
declare const SHAPE_PATHS: Record<Shape, Path2D>;
|
|
281
|
+
//#endregion
|
|
282
|
+
//#region src/donuts/simulation.d.ts
|
|
283
|
+
interface DonutSimulationConfig {
|
|
284
|
+
readonly background?: string;
|
|
285
|
+
readonly canvasOptions?: CanvasRenderingContext2DSettings;
|
|
286
|
+
readonly collisionPadding?: number;
|
|
287
|
+
readonly colors?: string[];
|
|
288
|
+
readonly count?: number;
|
|
289
|
+
readonly mouseAvoidance?: boolean;
|
|
290
|
+
readonly mouseAvoidanceRadius?: number;
|
|
291
|
+
readonly mouseAvoidanceStrength?: number;
|
|
292
|
+
readonly radiusRange?: [number, number];
|
|
293
|
+
readonly repulsionStrength?: number;
|
|
294
|
+
readonly rotationSpeedRange?: [number, number];
|
|
295
|
+
readonly scale?: number;
|
|
296
|
+
readonly speedRange?: [number, number];
|
|
297
|
+
readonly thickness?: number;
|
|
298
|
+
}
|
|
299
|
+
declare class DonutSimulation extends SimulationCanvas {
|
|
300
|
+
constructor(canvas: HTMLCanvasElement, config?: DonutSimulationConfig);
|
|
301
|
+
}
|
|
302
|
+
//#endregion
|
|
303
|
+
//#region src/donuts/layer.d.ts
|
|
304
|
+
declare class DonutLayer extends SimulationLayer {
|
|
305
|
+
#private;
|
|
306
|
+
constructor(config?: DonutSimulationConfig);
|
|
307
|
+
onResize(width: number, height: number): void;
|
|
308
|
+
onMount(canvas: HTMLCanvasElement): void;
|
|
309
|
+
onUnmount(canvas: HTMLCanvasElement): void;
|
|
310
|
+
tick(dt: number, width: number, height: number): void;
|
|
311
|
+
draw(ctx: CanvasRenderingContext2D, width: number, height: number): void;
|
|
312
|
+
}
|
|
313
|
+
//#endregion
|
|
314
|
+
//#region src/fireflies/simulation.d.ts
|
|
315
|
+
interface FireflySimulationConfig {
|
|
316
|
+
readonly count?: number;
|
|
317
|
+
readonly color?: string;
|
|
318
|
+
readonly size?: number;
|
|
319
|
+
readonly speed?: number;
|
|
320
|
+
readonly glowSpeed?: number;
|
|
321
|
+
readonly scale?: number;
|
|
322
|
+
readonly canvasOptions?: CanvasRenderingContext2DSettings;
|
|
323
|
+
}
|
|
324
|
+
declare class FireflySimulation extends SimulationCanvas {
|
|
325
|
+
constructor(canvas: HTMLCanvasElement, config?: FireflySimulationConfig);
|
|
326
|
+
}
|
|
327
|
+
//#endregion
|
|
328
|
+
//#region src/fireflies/layer.d.ts
|
|
329
|
+
declare class FireflyLayer extends SimulationLayer {
|
|
330
|
+
#private;
|
|
331
|
+
constructor(config?: FireflySimulationConfig);
|
|
332
|
+
tick(dt: number, _width: number, _height: number): void;
|
|
333
|
+
draw(ctx: CanvasRenderingContext2D, width: number, height: number): void;
|
|
334
|
+
}
|
|
335
|
+
//#endregion
|
|
336
|
+
//#region src/fireflies/particle.d.ts
|
|
337
|
+
interface FireflyParticleConfig {
|
|
338
|
+
readonly glowSpeed?: number;
|
|
339
|
+
readonly scale?: number;
|
|
340
|
+
readonly size?: number;
|
|
341
|
+
readonly speed?: number;
|
|
342
|
+
}
|
|
343
|
+
declare function createFireflySprite(color: string, size?: number): HTMLCanvasElement;
|
|
344
|
+
declare class FireflyParticle {
|
|
345
|
+
#private;
|
|
346
|
+
get position(): {
|
|
347
|
+
x: number;
|
|
348
|
+
y: number;
|
|
349
|
+
};
|
|
350
|
+
constructor(x: number, y: number, bounds: {
|
|
351
|
+
width: number;
|
|
352
|
+
height: number;
|
|
353
|
+
}, sprite: HTMLCanvasElement, config?: FireflyParticleConfig);
|
|
354
|
+
draw(ctx: CanvasRenderingContext2D): void;
|
|
355
|
+
tick(dt?: number): void;
|
|
356
|
+
}
|
|
357
|
+
//#endregion
|
|
358
|
+
//#region src/fireflies/types.d.ts
|
|
359
|
+
type Firefly = {
|
|
57
360
|
x: number;
|
|
58
361
|
y: number;
|
|
362
|
+
size: number;
|
|
363
|
+
phase: number;
|
|
364
|
+
glowSpeed: number;
|
|
365
|
+
freqX1: number;
|
|
366
|
+
freqX2: number;
|
|
367
|
+
freqY1: number;
|
|
368
|
+
freqY2: number;
|
|
369
|
+
phaseX1: number;
|
|
370
|
+
phaseX2: number;
|
|
371
|
+
phaseY1: number;
|
|
372
|
+
phaseY2: number;
|
|
373
|
+
amplitudeX: number;
|
|
374
|
+
amplitudeY: number;
|
|
375
|
+
};
|
|
376
|
+
//#endregion
|
|
377
|
+
//#region src/firepit/simulation.d.ts
|
|
378
|
+
interface FirepitSimulationConfig {
|
|
379
|
+
readonly embers?: number;
|
|
380
|
+
readonly flameWidth?: number;
|
|
381
|
+
readonly flameHeight?: number;
|
|
382
|
+
readonly intensity?: number;
|
|
383
|
+
readonly scale?: number;
|
|
384
|
+
readonly canvasOptions?: CanvasRenderingContext2DSettings;
|
|
385
|
+
}
|
|
386
|
+
declare class FirepitSimulation extends SimulationCanvas {
|
|
387
|
+
constructor(canvas: HTMLCanvasElement, config?: FirepitSimulationConfig);
|
|
388
|
+
}
|
|
389
|
+
//#endregion
|
|
390
|
+
//#region src/firepit/layer.d.ts
|
|
391
|
+
declare class FirepitLayer extends SimulationLayer {
|
|
392
|
+
#private;
|
|
393
|
+
constructor(config?: FirepitSimulationConfig);
|
|
394
|
+
tick(dt: number, _width: number, _height: number): void;
|
|
395
|
+
draw(ctx: CanvasRenderingContext2D, width: number, height: number): void;
|
|
396
|
+
}
|
|
397
|
+
//#endregion
|
|
398
|
+
//#region src/firepit/types.d.ts
|
|
399
|
+
type Ember = {
|
|
400
|
+
x: number;
|
|
401
|
+
y: number;
|
|
402
|
+
vx: number;
|
|
403
|
+
vy: number;
|
|
404
|
+
size: number;
|
|
405
|
+
life: number;
|
|
406
|
+
maxLife: number;
|
|
407
|
+
brightness: number;
|
|
408
|
+
flicker: number;
|
|
409
|
+
};
|
|
410
|
+
type FlameLayer = {
|
|
411
|
+
x: number;
|
|
412
|
+
phase: number;
|
|
413
|
+
speed: number;
|
|
414
|
+
amplitude: number;
|
|
415
|
+
width: number;
|
|
416
|
+
height: number;
|
|
59
417
|
};
|
|
60
418
|
//#endregion
|
|
61
419
|
//#region src/fireworks/types.d.ts
|
|
62
420
|
type ExplosionType = "peony" | "chrysanthemum" | "willow" | "ring" | "palm" | "crackle" | "crossette" | "dahlia" | "brocade" | "horsetail" | "strobe" | "heart" | "spiral" | "flower";
|
|
63
421
|
type FireworkVariant = ExplosionType | "saturn" | "concentric";
|
|
64
422
|
type ParticleShape = "line" | "circle" | "star" | "diamond";
|
|
423
|
+
interface ExplosionConfig {
|
|
424
|
+
readonly particleCount: [number, number];
|
|
425
|
+
readonly speed: [number, number];
|
|
426
|
+
readonly friction: number;
|
|
427
|
+
readonly gravity: number;
|
|
428
|
+
readonly decay: [number, number];
|
|
429
|
+
readonly trailMemory: number;
|
|
430
|
+
readonly hueVariation: number;
|
|
431
|
+
readonly brightness: [number, number];
|
|
432
|
+
readonly lineWidthScale: number;
|
|
433
|
+
readonly shape: ParticleShape;
|
|
434
|
+
readonly sparkle: boolean;
|
|
435
|
+
readonly strobe: boolean;
|
|
436
|
+
readonly spread3d: boolean;
|
|
437
|
+
readonly glowSize: number;
|
|
438
|
+
}
|
|
65
439
|
interface FireworkSimulationConfig {
|
|
66
440
|
readonly scale?: number;
|
|
67
441
|
readonly autoSpawn?: boolean;
|
|
68
442
|
readonly canvasOptions?: CanvasRenderingContext2DSettings;
|
|
69
443
|
}
|
|
70
444
|
declare const FIREWORK_VARIANTS: FireworkVariant[];
|
|
445
|
+
declare const EXPLOSION_CONFIGS: Record<ExplosionType, ExplosionConfig>;
|
|
446
|
+
//#endregion
|
|
447
|
+
//#region src/fireworks/explosion.d.ts
|
|
448
|
+
declare class Explosion {
|
|
449
|
+
#private;
|
|
450
|
+
get angle(): number;
|
|
451
|
+
get hue(): number;
|
|
452
|
+
get isDead(): boolean;
|
|
453
|
+
get position(): Point;
|
|
454
|
+
get type(): ExplosionType;
|
|
455
|
+
constructor(position: Point, hue: number, lineWidth: number, type: ExplosionType, scale?: number, angle?: number, speed?: number, vz?: number);
|
|
456
|
+
checkCrackle(): boolean;
|
|
457
|
+
checkSplit(): boolean;
|
|
458
|
+
draw(ctx: CanvasRenderingContext2D): void;
|
|
459
|
+
tick(dt: number): void;
|
|
460
|
+
}
|
|
461
|
+
//#endregion
|
|
462
|
+
//#region src/fireworks/spark.d.ts
|
|
463
|
+
declare class Spark {
|
|
464
|
+
#private;
|
|
465
|
+
get isDead(): boolean;
|
|
466
|
+
get position(): Point;
|
|
467
|
+
constructor(position: Point, hue: number, velocityX?: number, velocityY?: number);
|
|
468
|
+
draw(ctx: CanvasRenderingContext2D): void;
|
|
469
|
+
tick(dt: number): void;
|
|
470
|
+
}
|
|
471
|
+
//#endregion
|
|
472
|
+
//#region src/fireworks/firework.d.ts
|
|
473
|
+
declare class Firework extends EventTarget {
|
|
474
|
+
#private;
|
|
475
|
+
get position(): Point;
|
|
476
|
+
get hue(): number;
|
|
477
|
+
constructor(start: Point, target: Point, hue: number, tailWidth: number, baseSize: number);
|
|
478
|
+
collectSparks(): Spark[];
|
|
479
|
+
draw(ctx: CanvasRenderingContext2D): void;
|
|
480
|
+
tick(dt: number): void;
|
|
481
|
+
}
|
|
482
|
+
//#endregion
|
|
483
|
+
//#region src/fireworks/layer.d.ts
|
|
484
|
+
declare class FireworkLayer extends SimulationLayer {
|
|
485
|
+
#private;
|
|
486
|
+
constructor(config?: FireworkSimulationConfig);
|
|
487
|
+
onResize(width: number, height: number): void;
|
|
488
|
+
fireExplosion(variant: FireworkVariant, position?: Point): void;
|
|
489
|
+
tick(dt: number, width: number, height: number): void;
|
|
490
|
+
draw(ctx: CanvasRenderingContext2D, width: number, height: number): void;
|
|
491
|
+
}
|
|
71
492
|
//#endregion
|
|
72
493
|
//#region src/fireworks/simulation.d.ts
|
|
73
|
-
declare class FireworkSimulation extends
|
|
494
|
+
declare class FireworkSimulation extends SimulationCanvas {
|
|
74
495
|
#private;
|
|
75
496
|
constructor(canvas: HTMLCanvasElement, config?: FireworkSimulationConfig);
|
|
76
|
-
draw(): void;
|
|
77
497
|
fireExplosion(variant: FireworkVariant, position?: Point): void;
|
|
498
|
+
}
|
|
499
|
+
//#endregion
|
|
500
|
+
//#region src/glitter/simulation.d.ts
|
|
501
|
+
interface GlitterSimulationConfig {
|
|
502
|
+
readonly count?: number;
|
|
503
|
+
readonly colors?: string[];
|
|
504
|
+
readonly size?: number;
|
|
505
|
+
readonly speed?: number;
|
|
506
|
+
readonly groundLevel?: number;
|
|
507
|
+
readonly maxSettled?: number;
|
|
508
|
+
readonly scale?: number;
|
|
509
|
+
readonly canvasOptions?: CanvasRenderingContext2DSettings;
|
|
510
|
+
}
|
|
511
|
+
declare class GlitterSimulation extends SimulationCanvas {
|
|
512
|
+
constructor(canvas: HTMLCanvasElement, config?: GlitterSimulationConfig);
|
|
513
|
+
}
|
|
514
|
+
//#endregion
|
|
515
|
+
//#region src/glitter/layer.d.ts
|
|
516
|
+
declare class GlitterLayer extends SimulationLayer {
|
|
517
|
+
#private;
|
|
518
|
+
constructor(config?: GlitterSimulationConfig);
|
|
519
|
+
tick(dt: number, _width: number, _height: number): void;
|
|
520
|
+
draw(ctx: CanvasRenderingContext2D, width: number, height: number): void;
|
|
521
|
+
}
|
|
522
|
+
//#endregion
|
|
523
|
+
//#region src/glitter/types.d.ts
|
|
524
|
+
type FallingGlitter = {
|
|
525
|
+
x: number;
|
|
526
|
+
y: number;
|
|
527
|
+
vy: number;
|
|
528
|
+
size: number;
|
|
529
|
+
rotation: number;
|
|
530
|
+
rotationSpeed: number;
|
|
531
|
+
flipAngle: number;
|
|
532
|
+
flipSpeed: number;
|
|
533
|
+
sparkle: number;
|
|
534
|
+
colorIndex: number;
|
|
535
|
+
settled: boolean;
|
|
536
|
+
};
|
|
537
|
+
type SettledGlitter = {
|
|
538
|
+
x: number;
|
|
539
|
+
y: number;
|
|
540
|
+
size: number;
|
|
541
|
+
rotation: number;
|
|
542
|
+
sparklePhase: number;
|
|
543
|
+
sparkleSpeed: number;
|
|
544
|
+
colorIndex: number;
|
|
545
|
+
};
|
|
546
|
+
//#endregion
|
|
547
|
+
//#region src/lanterns/simulation.d.ts
|
|
548
|
+
interface LanternSimulationConfig {
|
|
549
|
+
readonly count?: number;
|
|
550
|
+
readonly colors?: string[];
|
|
551
|
+
readonly size?: number;
|
|
552
|
+
readonly speed?: number;
|
|
553
|
+
readonly scale?: number;
|
|
554
|
+
readonly canvasOptions?: CanvasRenderingContext2DSettings;
|
|
555
|
+
}
|
|
556
|
+
declare class LanternSimulation extends SimulationCanvas {
|
|
557
|
+
constructor(canvas: HTMLCanvasElement, config?: LanternSimulationConfig);
|
|
558
|
+
}
|
|
559
|
+
//#endregion
|
|
560
|
+
//#region src/lanterns/layer.d.ts
|
|
561
|
+
declare class LanternLayer extends SimulationLayer {
|
|
562
|
+
#private;
|
|
563
|
+
constructor(config?: LanternSimulationConfig);
|
|
564
|
+
tick(dt: number, width: number, height: number): void;
|
|
565
|
+
draw(ctx: CanvasRenderingContext2D, width: number, height: number): void;
|
|
566
|
+
}
|
|
567
|
+
//#endregion
|
|
568
|
+
//#region src/lanterns/types.d.ts
|
|
569
|
+
type Lantern = {
|
|
570
|
+
x: number;
|
|
571
|
+
y: number;
|
|
572
|
+
vx: number;
|
|
573
|
+
vy: number;
|
|
574
|
+
size: number;
|
|
575
|
+
glowPhase: number;
|
|
576
|
+
glowSpeed: number;
|
|
577
|
+
swayPhase: number;
|
|
578
|
+
swaySpeed: number;
|
|
579
|
+
swayAmplitude: number;
|
|
580
|
+
colorIndex: number;
|
|
581
|
+
opacity: number;
|
|
582
|
+
};
|
|
583
|
+
//#endregion
|
|
584
|
+
//#region src/layered.d.ts
|
|
585
|
+
declare class LayeredSimulation extends LimitedFrameRateCanvas {
|
|
586
|
+
#private;
|
|
587
|
+
constructor(canvas: HTMLCanvasElement, frameRate?: number, options?: CanvasRenderingContext2DSettings);
|
|
588
|
+
add(layer: SimulationLayer): this;
|
|
589
|
+
start(): void;
|
|
590
|
+
destroy(): void;
|
|
591
|
+
draw(): void;
|
|
78
592
|
tick(): void;
|
|
593
|
+
onResize(): void;
|
|
594
|
+
}
|
|
595
|
+
//#endregion
|
|
596
|
+
//#region src/leaves/simulation.d.ts
|
|
597
|
+
interface LeafSimulationConfig {
|
|
598
|
+
readonly count?: number;
|
|
599
|
+
readonly colors?: string[];
|
|
600
|
+
readonly size?: number;
|
|
601
|
+
readonly speed?: number;
|
|
602
|
+
readonly wind?: number;
|
|
603
|
+
readonly scale?: number;
|
|
604
|
+
readonly canvasOptions?: CanvasRenderingContext2DSettings;
|
|
605
|
+
}
|
|
606
|
+
declare class LeafSimulation extends SimulationCanvas {
|
|
607
|
+
constructor(canvas: HTMLCanvasElement, config?: LeafSimulationConfig);
|
|
608
|
+
}
|
|
609
|
+
//#endregion
|
|
610
|
+
//#region src/leaves/layer.d.ts
|
|
611
|
+
declare class LeafLayer extends SimulationLayer {
|
|
612
|
+
#private;
|
|
613
|
+
constructor(config?: LeafSimulationConfig);
|
|
614
|
+
onResize(_width: number, height: number): void;
|
|
615
|
+
tick(dt: number, _width: number, height: number): void;
|
|
616
|
+
draw(ctx: CanvasRenderingContext2D, width: number, height: number): void;
|
|
617
|
+
}
|
|
618
|
+
//#endregion
|
|
619
|
+
//#region src/leaves/types.d.ts
|
|
620
|
+
type Leaf = {
|
|
621
|
+
x: number;
|
|
622
|
+
y: number;
|
|
623
|
+
size: number;
|
|
624
|
+
depth: number;
|
|
625
|
+
rotation: number;
|
|
626
|
+
rotationSpeed: number;
|
|
627
|
+
flipAngle: number;
|
|
628
|
+
flipSpeed: number;
|
|
629
|
+
swingAmplitude: number;
|
|
630
|
+
swingFrequency: number;
|
|
631
|
+
swingOffset: number;
|
|
632
|
+
fallSpeed: number;
|
|
633
|
+
shape: number;
|
|
634
|
+
colorIndex: number;
|
|
635
|
+
};
|
|
636
|
+
//#endregion
|
|
637
|
+
//#region src/lightning/simulation.d.ts
|
|
638
|
+
interface LightningSimulationConfig {
|
|
639
|
+
readonly frequency?: number;
|
|
640
|
+
readonly color?: string;
|
|
641
|
+
readonly branches?: boolean;
|
|
642
|
+
readonly flash?: boolean;
|
|
643
|
+
readonly scale?: number;
|
|
644
|
+
readonly canvasOptions?: CanvasRenderingContext2DSettings;
|
|
645
|
+
}
|
|
646
|
+
declare class LightningSimulation extends SimulationCanvas {
|
|
647
|
+
constructor(canvas: HTMLCanvasElement, config?: LightningSimulationConfig);
|
|
648
|
+
}
|
|
649
|
+
//#endregion
|
|
650
|
+
//#region src/lightning/layer.d.ts
|
|
651
|
+
declare class LightningLayer extends SimulationLayer {
|
|
652
|
+
#private;
|
|
653
|
+
constructor(config?: LightningSimulationConfig);
|
|
654
|
+
tick(dt: number, _width: number, _height: number): void;
|
|
655
|
+
draw(ctx: CanvasRenderingContext2D, width: number, height: number): void;
|
|
79
656
|
}
|
|
80
657
|
//#endregion
|
|
658
|
+
//#region src/lightning/system.d.ts
|
|
659
|
+
interface LightningSystemConfig {
|
|
660
|
+
readonly frequency?: number;
|
|
661
|
+
readonly color?: [number, number, number];
|
|
662
|
+
readonly branches?: boolean;
|
|
663
|
+
readonly flash?: boolean;
|
|
664
|
+
readonly scale?: number;
|
|
665
|
+
readonly groundLevel?: number;
|
|
666
|
+
}
|
|
667
|
+
declare class LightningSystem {
|
|
668
|
+
#private;
|
|
669
|
+
get flashAlpha(): number;
|
|
670
|
+
constructor(config: LightningSystemConfig, rng: () => number);
|
|
671
|
+
tick(dt: number): void;
|
|
672
|
+
draw(ctx: CanvasRenderingContext2D, width: number, height: number): void;
|
|
673
|
+
}
|
|
674
|
+
//#endregion
|
|
675
|
+
//#region src/lightning/types.d.ts
|
|
676
|
+
type LightningBranch = {
|
|
677
|
+
segments: {
|
|
678
|
+
x: number;
|
|
679
|
+
y: number;
|
|
680
|
+
}[];
|
|
681
|
+
alpha: number;
|
|
682
|
+
};
|
|
683
|
+
type LightningBolt = {
|
|
684
|
+
segments: {
|
|
685
|
+
x: number;
|
|
686
|
+
y: number;
|
|
687
|
+
}[];
|
|
688
|
+
branches: LightningBranch[];
|
|
689
|
+
alpha: number;
|
|
690
|
+
lifetime: number;
|
|
691
|
+
ticksAlive: number;
|
|
692
|
+
};
|
|
693
|
+
//#endregion
|
|
694
|
+
//#region src/matrix/simulation.d.ts
|
|
695
|
+
interface MatrixSimulationConfig {
|
|
696
|
+
readonly columns?: number;
|
|
697
|
+
readonly speed?: number;
|
|
698
|
+
readonly color?: string;
|
|
699
|
+
readonly fontSize?: number;
|
|
700
|
+
readonly trailLength?: number;
|
|
701
|
+
readonly scale?: number;
|
|
702
|
+
readonly canvasOptions?: CanvasRenderingContext2DSettings;
|
|
703
|
+
}
|
|
704
|
+
declare class MatrixSimulation extends SimulationCanvas {
|
|
705
|
+
constructor(canvas: HTMLCanvasElement, config?: MatrixSimulationConfig);
|
|
706
|
+
}
|
|
707
|
+
//#endregion
|
|
708
|
+
//#region src/matrix/layer.d.ts
|
|
709
|
+
declare class MatrixLayer extends SimulationLayer {
|
|
710
|
+
#private;
|
|
711
|
+
constructor(config?: MatrixSimulationConfig);
|
|
712
|
+
onResize(width: number, height: number): void;
|
|
713
|
+
tick(dt: number, width: number, height: number): void;
|
|
714
|
+
draw(ctx: CanvasRenderingContext2D, width: number, height: number): void;
|
|
715
|
+
}
|
|
716
|
+
//#endregion
|
|
717
|
+
//#region src/matrix/types.d.ts
|
|
718
|
+
type MatrixColumn = {
|
|
719
|
+
x: number;
|
|
720
|
+
y: number;
|
|
721
|
+
speed: number;
|
|
722
|
+
chars: string[];
|
|
723
|
+
length: number;
|
|
724
|
+
headBrightness: number;
|
|
725
|
+
};
|
|
726
|
+
//#endregion
|
|
727
|
+
//#region src/orbits/simulation.d.ts
|
|
728
|
+
interface OrbitSimulationConfig {
|
|
729
|
+
readonly centers?: number;
|
|
730
|
+
readonly orbitersPerCenter?: number;
|
|
731
|
+
readonly speed?: number;
|
|
732
|
+
readonly colors?: string[];
|
|
733
|
+
readonly trailLength?: number;
|
|
734
|
+
readonly showCenters?: boolean;
|
|
735
|
+
readonly scale?: number;
|
|
736
|
+
readonly canvasOptions?: CanvasRenderingContext2DSettings;
|
|
737
|
+
}
|
|
738
|
+
declare class OrbitSimulation extends SimulationCanvas {
|
|
739
|
+
constructor(canvas: HTMLCanvasElement, config?: OrbitSimulationConfig);
|
|
740
|
+
}
|
|
741
|
+
//#endregion
|
|
742
|
+
//#region src/orbits/layer.d.ts
|
|
743
|
+
declare class OrbitLayer extends SimulationLayer {
|
|
744
|
+
#private;
|
|
745
|
+
constructor(config?: OrbitSimulationConfig);
|
|
746
|
+
onResize(_width: number, _height: number): void;
|
|
747
|
+
tick(dt: number, width: number, height: number): void;
|
|
748
|
+
draw(ctx: CanvasRenderingContext2D, width: number, height: number): void;
|
|
749
|
+
}
|
|
750
|
+
//#endregion
|
|
751
|
+
//#region src/orbits/types.d.ts
|
|
752
|
+
type OrbitalCenter = {
|
|
753
|
+
x: number;
|
|
754
|
+
y: number;
|
|
755
|
+
};
|
|
756
|
+
type Orbiter = {
|
|
757
|
+
centerIndex: number;
|
|
758
|
+
angle: number;
|
|
759
|
+
angularSpeed: number;
|
|
760
|
+
radiusX: number;
|
|
761
|
+
radiusY: number;
|
|
762
|
+
tilt: number;
|
|
763
|
+
size: number;
|
|
764
|
+
color: string;
|
|
765
|
+
trail: {
|
|
766
|
+
x: number;
|
|
767
|
+
y: number;
|
|
768
|
+
}[];
|
|
769
|
+
};
|
|
770
|
+
//#endregion
|
|
771
|
+
//#region src/particles/types.d.ts
|
|
772
|
+
type ParticleMouseMode = "attract" | "repel" | "connect" | "none";
|
|
773
|
+
type NetworkParticle = {
|
|
774
|
+
x: number;
|
|
775
|
+
y: number;
|
|
776
|
+
vx: number;
|
|
777
|
+
vy: number;
|
|
778
|
+
radius: number;
|
|
779
|
+
baseSpeed: number;
|
|
780
|
+
};
|
|
781
|
+
//#endregion
|
|
782
|
+
//#region src/particles/simulation.d.ts
|
|
783
|
+
interface ParticleSimulationConfig {
|
|
784
|
+
readonly count?: number;
|
|
785
|
+
readonly color?: string;
|
|
786
|
+
readonly lineColor?: string;
|
|
787
|
+
readonly size?: [number, number];
|
|
788
|
+
readonly speed?: [number, number];
|
|
789
|
+
readonly connectionDistance?: number;
|
|
790
|
+
readonly lineWidth?: number;
|
|
791
|
+
readonly mouseMode?: ParticleMouseMode;
|
|
792
|
+
readonly mouseRadius?: number;
|
|
793
|
+
readonly mouseStrength?: number;
|
|
794
|
+
readonly particleForces?: boolean;
|
|
795
|
+
readonly glow?: boolean;
|
|
796
|
+
readonly background?: string | null;
|
|
797
|
+
readonly scale?: number;
|
|
798
|
+
readonly canvasOptions?: CanvasRenderingContext2DSettings;
|
|
799
|
+
}
|
|
800
|
+
declare class ParticleSimulation extends SimulationCanvas {
|
|
801
|
+
constructor(canvas: HTMLCanvasElement, config?: ParticleSimulationConfig);
|
|
802
|
+
}
|
|
803
|
+
//#endregion
|
|
804
|
+
//#region src/particles/layer.d.ts
|
|
805
|
+
declare class ParticleLayer extends SimulationLayer {
|
|
806
|
+
#private;
|
|
807
|
+
constructor(config?: ParticleSimulationConfig);
|
|
808
|
+
onResize(width: number, height: number): void;
|
|
809
|
+
onMount(canvas: HTMLCanvasElement): void;
|
|
810
|
+
onUnmount(canvas: HTMLCanvasElement): void;
|
|
811
|
+
tick(dt: number, width: number, height: number): void;
|
|
812
|
+
draw(ctx: CanvasRenderingContext2D, width: number, height: number): void;
|
|
813
|
+
}
|
|
814
|
+
//#endregion
|
|
815
|
+
//#region src/petals/simulation.d.ts
|
|
816
|
+
interface PetalSimulationConfig {
|
|
817
|
+
readonly count?: number;
|
|
818
|
+
readonly colors?: string[];
|
|
819
|
+
readonly size?: number;
|
|
820
|
+
readonly speed?: number;
|
|
821
|
+
readonly wind?: number;
|
|
822
|
+
readonly scale?: number;
|
|
823
|
+
readonly canvasOptions?: CanvasRenderingContext2DSettings;
|
|
824
|
+
}
|
|
825
|
+
declare class PetalSimulation extends SimulationCanvas {
|
|
826
|
+
constructor(canvas: HTMLCanvasElement, config?: PetalSimulationConfig);
|
|
827
|
+
}
|
|
828
|
+
//#endregion
|
|
829
|
+
//#region src/petals/layer.d.ts
|
|
830
|
+
declare class PetalLayer extends SimulationLayer {
|
|
831
|
+
#private;
|
|
832
|
+
constructor(config?: PetalSimulationConfig);
|
|
833
|
+
tick(dt: number, _width: number, height: number): void;
|
|
834
|
+
draw(ctx: CanvasRenderingContext2D, width: number, height: number): void;
|
|
835
|
+
}
|
|
836
|
+
//#endregion
|
|
837
|
+
//#region src/petals/types.d.ts
|
|
838
|
+
type Petal = {
|
|
839
|
+
x: number;
|
|
840
|
+
y: number;
|
|
841
|
+
size: number;
|
|
842
|
+
depth: number;
|
|
843
|
+
rotation: number;
|
|
844
|
+
rotationSpeed: number;
|
|
845
|
+
flipAngle: number;
|
|
846
|
+
flipSpeed: number;
|
|
847
|
+
swingAmplitude: number;
|
|
848
|
+
swingFrequency: number;
|
|
849
|
+
swingOffset: number;
|
|
850
|
+
fallSpeed: number;
|
|
851
|
+
colorIndex: number;
|
|
852
|
+
};
|
|
853
|
+
//#endregion
|
|
854
|
+
//#region src/plasma/types.d.ts
|
|
855
|
+
type PlasmaColor = {
|
|
856
|
+
r: number;
|
|
857
|
+
g: number;
|
|
858
|
+
b: number;
|
|
859
|
+
};
|
|
860
|
+
//#endregion
|
|
861
|
+
//#region src/plasma/simulation.d.ts
|
|
862
|
+
interface PlasmaSimulationConfig {
|
|
863
|
+
readonly speed?: number;
|
|
864
|
+
readonly scale?: number;
|
|
865
|
+
readonly resolution?: number;
|
|
866
|
+
readonly palette?: PlasmaColor[];
|
|
867
|
+
readonly canvasOptions?: CanvasRenderingContext2DSettings;
|
|
868
|
+
}
|
|
869
|
+
declare class PlasmaSimulation extends SimulationCanvas {
|
|
870
|
+
constructor(canvas: HTMLCanvasElement, config?: PlasmaSimulationConfig);
|
|
871
|
+
}
|
|
872
|
+
//#endregion
|
|
873
|
+
//#region src/plasma/layer.d.ts
|
|
874
|
+
declare class PlasmaLayer extends SimulationLayer {
|
|
875
|
+
#private;
|
|
876
|
+
constructor(config?: PlasmaSimulationConfig);
|
|
877
|
+
tick(dt: number, _width: number, _height: number): void;
|
|
878
|
+
draw(ctx: CanvasRenderingContext2D, width: number, height: number): void;
|
|
879
|
+
}
|
|
880
|
+
//#endregion
|
|
881
|
+
//#region src/rain/types.d.ts
|
|
882
|
+
type RainVariant = "drizzle" | "downpour" | "thunderstorm";
|
|
883
|
+
type Raindrop = {
|
|
884
|
+
x: number;
|
|
885
|
+
y: number;
|
|
886
|
+
vx: number;
|
|
887
|
+
vy: number;
|
|
888
|
+
length: number;
|
|
889
|
+
speed: number;
|
|
890
|
+
depth: number;
|
|
891
|
+
opacity: number;
|
|
892
|
+
};
|
|
893
|
+
type Splash = {
|
|
894
|
+
x: number;
|
|
895
|
+
y: number;
|
|
896
|
+
vx: number;
|
|
897
|
+
vy: number;
|
|
898
|
+
alpha: number;
|
|
899
|
+
size: number;
|
|
900
|
+
gravity: number;
|
|
901
|
+
};
|
|
902
|
+
//#endregion
|
|
903
|
+
//#region src/rain/simulation.d.ts
|
|
904
|
+
interface RainSimulationConfig {
|
|
905
|
+
readonly variant?: RainVariant;
|
|
906
|
+
readonly drops?: number;
|
|
907
|
+
readonly wind?: number;
|
|
908
|
+
readonly speed?: number;
|
|
909
|
+
readonly splashes?: boolean;
|
|
910
|
+
readonly color?: string;
|
|
911
|
+
readonly groundLevel?: number;
|
|
912
|
+
readonly scale?: number;
|
|
913
|
+
readonly canvasOptions?: CanvasRenderingContext2DSettings;
|
|
914
|
+
}
|
|
915
|
+
declare class RainSimulation extends SimulationCanvas {
|
|
916
|
+
constructor(canvas: HTMLCanvasElement, config?: RainSimulationConfig);
|
|
917
|
+
}
|
|
918
|
+
//#endregion
|
|
919
|
+
//#region src/rain/layer.d.ts
|
|
920
|
+
declare class RainLayer extends SimulationLayer {
|
|
921
|
+
#private;
|
|
922
|
+
constructor(config?: RainSimulationConfig);
|
|
923
|
+
tick(dt: number, width: number, height: number): void;
|
|
924
|
+
draw(ctx: CanvasRenderingContext2D, width: number, height: number): void;
|
|
925
|
+
}
|
|
926
|
+
//#endregion
|
|
927
|
+
//#region src/rain/particle.d.ts
|
|
928
|
+
interface RaindropParticleConfig {
|
|
929
|
+
readonly depth?: number;
|
|
930
|
+
readonly groundY?: number;
|
|
931
|
+
readonly length?: number;
|
|
932
|
+
readonly scale?: number;
|
|
933
|
+
}
|
|
934
|
+
interface SplashParticleConfig {
|
|
935
|
+
readonly gravity?: number;
|
|
936
|
+
readonly scale?: number;
|
|
937
|
+
readonly size?: number;
|
|
938
|
+
}
|
|
939
|
+
declare class RaindropParticle {
|
|
940
|
+
#private;
|
|
941
|
+
get isDead(): boolean;
|
|
942
|
+
get position(): Point;
|
|
943
|
+
constructor(position: Point, velocity: Point, color: [number, number, number], config?: RaindropParticleConfig);
|
|
944
|
+
draw(ctx: CanvasRenderingContext2D): void;
|
|
945
|
+
tick(dt?: number): void;
|
|
946
|
+
}
|
|
947
|
+
declare class SplashParticle {
|
|
948
|
+
#private;
|
|
949
|
+
get isDead(): boolean;
|
|
950
|
+
get position(): Point;
|
|
951
|
+
constructor(position: Point, velocity: Point, color: [number, number, number], config?: SplashParticleConfig);
|
|
952
|
+
static burst(position: Point, color: [number, number, number], config?: SplashParticleConfig): SplashParticle[];
|
|
953
|
+
draw(ctx: CanvasRenderingContext2D): void;
|
|
954
|
+
tick(dt?: number): void;
|
|
955
|
+
}
|
|
956
|
+
//#endregion
|
|
957
|
+
//#region src/sandstorm/simulation.d.ts
|
|
958
|
+
interface SandstormSimulationConfig {
|
|
959
|
+
readonly count?: number;
|
|
960
|
+
readonly wind?: number;
|
|
961
|
+
readonly turbulence?: number;
|
|
962
|
+
readonly color?: string;
|
|
963
|
+
readonly hazeOpacity?: number;
|
|
964
|
+
readonly scale?: number;
|
|
965
|
+
readonly canvasOptions?: CanvasRenderingContext2DSettings;
|
|
966
|
+
}
|
|
967
|
+
declare class SandstormSimulation extends SimulationCanvas {
|
|
968
|
+
constructor(canvas: HTMLCanvasElement, config?: SandstormSimulationConfig);
|
|
969
|
+
}
|
|
970
|
+
//#endregion
|
|
971
|
+
//#region src/sandstorm/layer.d.ts
|
|
972
|
+
declare class SandstormLayer extends SimulationLayer {
|
|
973
|
+
#private;
|
|
974
|
+
constructor(config?: SandstormSimulationConfig);
|
|
975
|
+
tick(dt: number, width: number, height: number): void;
|
|
976
|
+
draw(ctx: CanvasRenderingContext2D, width: number, height: number): void;
|
|
977
|
+
}
|
|
978
|
+
//#endregion
|
|
979
|
+
//#region src/sandstorm/types.d.ts
|
|
980
|
+
type SandGrain = {
|
|
981
|
+
x: number;
|
|
982
|
+
y: number;
|
|
983
|
+
vx: number;
|
|
984
|
+
vy: number;
|
|
985
|
+
size: number;
|
|
986
|
+
depth: number;
|
|
987
|
+
opacity: number;
|
|
988
|
+
turbulenceOffset: number;
|
|
989
|
+
};
|
|
990
|
+
//#endregion
|
|
991
|
+
//#region src/shooting-stars/system.d.ts
|
|
992
|
+
interface ShootingStarSystemConfig {
|
|
993
|
+
readonly interval: [number, number];
|
|
994
|
+
readonly color?: [number, number, number];
|
|
995
|
+
readonly trailLength?: number;
|
|
996
|
+
readonly trailAlphaFactor?: number;
|
|
997
|
+
readonly speed?: number;
|
|
998
|
+
readonly scale?: number;
|
|
999
|
+
readonly alphaMin?: number;
|
|
1000
|
+
readonly alphaRange?: number;
|
|
1001
|
+
readonly decayMin?: number;
|
|
1002
|
+
readonly decayRange?: number;
|
|
1003
|
+
readonly verticalFade?: [number, number];
|
|
1004
|
+
}
|
|
1005
|
+
declare class ShootingStarSystem {
|
|
1006
|
+
#private;
|
|
1007
|
+
constructor(config: ShootingStarSystemConfig, rng: () => number);
|
|
1008
|
+
tick(dt: number, width: number, height: number): void;
|
|
1009
|
+
draw(ctx: CanvasRenderingContext2D): void;
|
|
1010
|
+
}
|
|
1011
|
+
//#endregion
|
|
1012
|
+
//#region src/shooting-stars/types.d.ts
|
|
1013
|
+
type ShootingStar = {
|
|
1014
|
+
x: number;
|
|
1015
|
+
y: number;
|
|
1016
|
+
vx: number;
|
|
1017
|
+
vy: number;
|
|
1018
|
+
alpha: number;
|
|
1019
|
+
size: number;
|
|
1020
|
+
decay: number;
|
|
1021
|
+
trail: {
|
|
1022
|
+
x: number;
|
|
1023
|
+
y: number;
|
|
1024
|
+
}[];
|
|
1025
|
+
};
|
|
1026
|
+
//#endregion
|
|
81
1027
|
//#region src/snow/simulation.d.ts
|
|
82
1028
|
interface SnowSimulationConfig {
|
|
83
1029
|
readonly fillStyle?: string;
|
|
@@ -87,12 +1033,244 @@ interface SnowSimulationConfig {
|
|
|
87
1033
|
readonly speed?: number;
|
|
88
1034
|
readonly canvasOptions?: CanvasRenderingContext2DSettings;
|
|
89
1035
|
}
|
|
90
|
-
declare class SnowSimulation extends
|
|
91
|
-
#private;
|
|
1036
|
+
declare class SnowSimulation extends SimulationCanvas {
|
|
92
1037
|
constructor(canvas: HTMLCanvasElement, config?: SnowSimulationConfig);
|
|
93
|
-
draw(): void;
|
|
94
|
-
tick(): void;
|
|
95
1038
|
}
|
|
96
1039
|
//#endregion
|
|
97
|
-
|
|
1040
|
+
//#region src/snow/layer.d.ts
|
|
1041
|
+
declare class SnowLayer extends SimulationLayer {
|
|
1042
|
+
#private;
|
|
1043
|
+
constructor(config?: SnowSimulationConfig);
|
|
1044
|
+
onResize(_width: number, height: number): void;
|
|
1045
|
+
tick(dt: number, _width: number, height: number): void;
|
|
1046
|
+
draw(ctx: CanvasRenderingContext2D, width: number, height: number): void;
|
|
1047
|
+
}
|
|
1048
|
+
//#endregion
|
|
1049
|
+
//#region src/sparklers/simulation.d.ts
|
|
1050
|
+
interface SparklerSimulationConfig {
|
|
1051
|
+
readonly emitRate?: number;
|
|
1052
|
+
readonly maxSparks?: number;
|
|
1053
|
+
readonly colors?: string[];
|
|
1054
|
+
readonly speed?: [number, number];
|
|
1055
|
+
readonly friction?: number;
|
|
1056
|
+
readonly gravity?: number;
|
|
1057
|
+
readonly decay?: [number, number];
|
|
1058
|
+
readonly trailLength?: number;
|
|
1059
|
+
readonly hoverMode?: boolean;
|
|
1060
|
+
readonly scale?: number;
|
|
1061
|
+
readonly canvasOptions?: CanvasRenderingContext2DSettings;
|
|
1062
|
+
}
|
|
1063
|
+
declare class SparklerSimulation extends SimulationCanvas {
|
|
1064
|
+
#private;
|
|
1065
|
+
constructor(canvas: HTMLCanvasElement, config?: SparklerSimulationConfig);
|
|
1066
|
+
setPosition(x: number, y: number): void;
|
|
1067
|
+
}
|
|
1068
|
+
//#endregion
|
|
1069
|
+
//#region src/sparklers/layer.d.ts
|
|
1070
|
+
declare class SparklerLayer extends SimulationLayer {
|
|
1071
|
+
#private;
|
|
1072
|
+
constructor(config?: SparklerSimulationConfig);
|
|
1073
|
+
setPosition(x: number, y: number): void;
|
|
1074
|
+
onMount(canvas: HTMLCanvasElement): void;
|
|
1075
|
+
onUnmount(canvas: HTMLCanvasElement): void;
|
|
1076
|
+
tick(dt: number, width: number, height: number): void;
|
|
1077
|
+
draw(ctx: CanvasRenderingContext2D, width: number, height: number): void;
|
|
1078
|
+
}
|
|
1079
|
+
//#endregion
|
|
1080
|
+
//#region src/sparklers/particle.d.ts
|
|
1081
|
+
interface SparklerParticleConfig {
|
|
1082
|
+
readonly decay?: number;
|
|
1083
|
+
readonly friction?: number;
|
|
1084
|
+
readonly gravity?: number;
|
|
1085
|
+
readonly scale?: number;
|
|
1086
|
+
readonly size?: number;
|
|
1087
|
+
readonly trailLength?: number;
|
|
1088
|
+
}
|
|
1089
|
+
declare class SparklerParticle {
|
|
1090
|
+
#private;
|
|
1091
|
+
get isDead(): boolean;
|
|
1092
|
+
get position(): Point;
|
|
1093
|
+
constructor(position: Point, velocity: Point, color: [number, number, number], config?: SparklerParticleConfig);
|
|
1094
|
+
draw(ctx: CanvasRenderingContext2D): void;
|
|
1095
|
+
tick(dt?: number): void;
|
|
1096
|
+
}
|
|
1097
|
+
//#endregion
|
|
1098
|
+
//#region src/sparklers/types.d.ts
|
|
1099
|
+
type SparklerSpark = {
|
|
1100
|
+
x: number;
|
|
1101
|
+
y: number;
|
|
1102
|
+
vx: number;
|
|
1103
|
+
vy: number;
|
|
1104
|
+
alpha: number;
|
|
1105
|
+
color: [number, number, number];
|
|
1106
|
+
size: number;
|
|
1107
|
+
decay: number;
|
|
1108
|
+
trail: Point[];
|
|
1109
|
+
};
|
|
1110
|
+
//#endregion
|
|
1111
|
+
//#region src/stars/types.d.ts
|
|
1112
|
+
type StarMode = "sky" | "shooting" | "both";
|
|
1113
|
+
type Star = {
|
|
1114
|
+
x: number;
|
|
1115
|
+
y: number;
|
|
1116
|
+
size: number;
|
|
1117
|
+
twinklePhase: number;
|
|
1118
|
+
twinkleSpeed: number;
|
|
1119
|
+
brightness: number;
|
|
1120
|
+
};
|
|
1121
|
+
//#endregion
|
|
1122
|
+
//#region src/stars/simulation.d.ts
|
|
1123
|
+
interface StarSimulationConfig {
|
|
1124
|
+
readonly mode?: StarMode;
|
|
1125
|
+
readonly starCount?: number;
|
|
1126
|
+
readonly shootingInterval?: [number, number];
|
|
1127
|
+
readonly shootingSpeed?: number;
|
|
1128
|
+
readonly twinkleSpeed?: number;
|
|
1129
|
+
readonly color?: string;
|
|
1130
|
+
readonly shootingColor?: string;
|
|
1131
|
+
readonly trailLength?: number;
|
|
1132
|
+
readonly scale?: number;
|
|
1133
|
+
readonly verticalFade?: [number, number];
|
|
1134
|
+
readonly canvasOptions?: CanvasRenderingContext2DSettings;
|
|
1135
|
+
}
|
|
1136
|
+
declare class StarSimulation extends SimulationCanvas {
|
|
1137
|
+
constructor(canvas: HTMLCanvasElement, config?: StarSimulationConfig);
|
|
1138
|
+
}
|
|
1139
|
+
//#endregion
|
|
1140
|
+
//#region src/stars/layer.d.ts
|
|
1141
|
+
declare class StarLayer extends SimulationLayer {
|
|
1142
|
+
#private;
|
|
1143
|
+
constructor(config?: StarSimulationConfig);
|
|
1144
|
+
tick(dt: number, width: number, height: number): void;
|
|
1145
|
+
draw(ctx: CanvasRenderingContext2D, width: number, height: number): void;
|
|
1146
|
+
}
|
|
1147
|
+
//#endregion
|
|
1148
|
+
//#region src/streamers/simulation.d.ts
|
|
1149
|
+
interface StreamerSimulationConfig {
|
|
1150
|
+
readonly count?: number;
|
|
1151
|
+
readonly colors?: string[];
|
|
1152
|
+
readonly speed?: number;
|
|
1153
|
+
readonly scale?: number;
|
|
1154
|
+
readonly canvasOptions?: CanvasRenderingContext2DSettings;
|
|
1155
|
+
}
|
|
1156
|
+
declare class StreamerSimulation extends SimulationCanvas {
|
|
1157
|
+
constructor(canvas: HTMLCanvasElement, config?: StreamerSimulationConfig);
|
|
1158
|
+
}
|
|
1159
|
+
//#endregion
|
|
1160
|
+
//#region src/streamers/layer.d.ts
|
|
1161
|
+
declare class StreamerLayer extends SimulationLayer {
|
|
1162
|
+
#private;
|
|
1163
|
+
constructor(config?: StreamerSimulationConfig);
|
|
1164
|
+
onResize(width: number, height: number): void;
|
|
1165
|
+
tick(dt: number, width: number, height: number): void;
|
|
1166
|
+
draw(ctx: CanvasRenderingContext2D, width: number, height: number): void;
|
|
1167
|
+
}
|
|
1168
|
+
//#endregion
|
|
1169
|
+
//#region src/streamers/types.d.ts
|
|
1170
|
+
type Streamer = {
|
|
1171
|
+
x: number;
|
|
1172
|
+
y: number;
|
|
1173
|
+
length: number;
|
|
1174
|
+
width: number;
|
|
1175
|
+
segments: {
|
|
1176
|
+
x: number;
|
|
1177
|
+
y: number;
|
|
1178
|
+
}[];
|
|
1179
|
+
fallSpeed: number;
|
|
1180
|
+
swayPhase: number;
|
|
1181
|
+
swaySpeed: number;
|
|
1182
|
+
swayAmplitude: number;
|
|
1183
|
+
color: string;
|
|
1184
|
+
curl: number;
|
|
1185
|
+
depth: number;
|
|
1186
|
+
};
|
|
1187
|
+
//#endregion
|
|
1188
|
+
//#region src/trail.d.ts
|
|
1189
|
+
interface TrailConfig {
|
|
1190
|
+
readonly acceleration?: number;
|
|
1191
|
+
readonly brightness?: number;
|
|
1192
|
+
readonly glow?: number;
|
|
1193
|
+
readonly hue?: number;
|
|
1194
|
+
readonly length?: number;
|
|
1195
|
+
readonly speed?: number;
|
|
1196
|
+
readonly width?: number;
|
|
1197
|
+
}
|
|
1198
|
+
declare class Trail {
|
|
1199
|
+
#private;
|
|
1200
|
+
get hue(): number;
|
|
1201
|
+
get isDone(): boolean;
|
|
1202
|
+
get position(): Point;
|
|
1203
|
+
collectSparks(): Spark[];
|
|
1204
|
+
constructor(start: Point, end: Point, config?: TrailConfig);
|
|
1205
|
+
draw(ctx: CanvasRenderingContext2D): void;
|
|
1206
|
+
tick(dt?: number): void;
|
|
1207
|
+
}
|
|
1208
|
+
//#endregion
|
|
1209
|
+
//#region src/waves/simulation.d.ts
|
|
1210
|
+
interface WaveSimulationConfig {
|
|
1211
|
+
readonly layers?: number;
|
|
1212
|
+
readonly speed?: number;
|
|
1213
|
+
readonly colors?: string[];
|
|
1214
|
+
readonly foamColor?: string;
|
|
1215
|
+
readonly foamAmount?: number;
|
|
1216
|
+
readonly scale?: number;
|
|
1217
|
+
readonly canvasOptions?: CanvasRenderingContext2DSettings;
|
|
1218
|
+
}
|
|
1219
|
+
declare class WaveSimulation extends SimulationCanvas {
|
|
1220
|
+
constructor(canvas: HTMLCanvasElement, config?: WaveSimulationConfig);
|
|
1221
|
+
}
|
|
1222
|
+
//#endregion
|
|
1223
|
+
//#region src/waves/layer.d.ts
|
|
1224
|
+
declare class WaveLayer extends SimulationLayer {
|
|
1225
|
+
#private;
|
|
1226
|
+
constructor(config?: WaveSimulationConfig);
|
|
1227
|
+
tick(dt: number, width: number, height: number): void;
|
|
1228
|
+
draw(ctx: CanvasRenderingContext2D, width: number, height: number): void;
|
|
1229
|
+
}
|
|
1230
|
+
//#endregion
|
|
1231
|
+
//#region src/waves/types.d.ts
|
|
1232
|
+
type Wave = {
|
|
1233
|
+
amplitude: number;
|
|
1234
|
+
frequency: number;
|
|
1235
|
+
speed: number;
|
|
1236
|
+
phase: number;
|
|
1237
|
+
baseY: number;
|
|
1238
|
+
color: string;
|
|
1239
|
+
foamThreshold: number;
|
|
1240
|
+
};
|
|
1241
|
+
//#endregion
|
|
1242
|
+
//#region src/wormhole/types.d.ts
|
|
1243
|
+
type WormholeDirection = "inward" | "outward";
|
|
1244
|
+
type WormholeParticle = {
|
|
1245
|
+
angle: number;
|
|
1246
|
+
distance: number;
|
|
1247
|
+
speed: number;
|
|
1248
|
+
size: number;
|
|
1249
|
+
brightness: number;
|
|
1250
|
+
trail: number;
|
|
1251
|
+
};
|
|
1252
|
+
//#endregion
|
|
1253
|
+
//#region src/wormhole/simulation.d.ts
|
|
1254
|
+
interface WormholeSimulationConfig {
|
|
1255
|
+
readonly count?: number;
|
|
1256
|
+
readonly speed?: number;
|
|
1257
|
+
readonly color?: string;
|
|
1258
|
+
readonly direction?: WormholeDirection;
|
|
1259
|
+
readonly scale?: number;
|
|
1260
|
+
readonly canvasOptions?: CanvasRenderingContext2DSettings;
|
|
1261
|
+
}
|
|
1262
|
+
declare class WormholeSimulation extends SimulationCanvas {
|
|
1263
|
+
constructor(canvas: HTMLCanvasElement, config?: WormholeSimulationConfig);
|
|
1264
|
+
}
|
|
1265
|
+
//#endregion
|
|
1266
|
+
//#region src/wormhole/layer.d.ts
|
|
1267
|
+
declare class WormholeLayer extends SimulationLayer {
|
|
1268
|
+
#private;
|
|
1269
|
+
constructor(config?: WormholeSimulationConfig);
|
|
1270
|
+
onResize(width: number, height: number): void;
|
|
1271
|
+
tick(dt: number, width: number, height: number): void;
|
|
1272
|
+
draw(ctx: CanvasRenderingContext2D, width: number, height: number): void;
|
|
1273
|
+
}
|
|
1274
|
+
//#endregion
|
|
1275
|
+
export { AuroraBand, AuroraLayer, AuroraSimulation, AuroraSimulationConfig, Balloon, BalloonLayer, BalloonParticle, BalloonParticleConfig, BalloonSimulation, BalloonSimulationConfig, Bubble, BubbleLayer, BubbleSimulation, BubbleSimulationConfig, ConfettiLayer, ConfettiParticle, type ConfettiParticleConfig, type Shape as ConfettiShape, ConfettiSimulation, type ConfettiSimulationConfig, DonutLayer, DonutSimulation, DonutSimulationConfig, EXPLOSION_CONFIGS, EdgeFade, EdgeFadeSide, Ember, Explosion, ExplosionConfig, ExplosionType, FIREWORK_VARIANTS, FallingGlitter, Firefly, FireflyLayer, FireflyParticle, FireflyParticleConfig, FireflySimulation, FireflySimulationConfig, FirepitLayer, FirepitSimulation, FirepitSimulationConfig, Firework, FireworkLayer, FireworkSimulation, FireworkSimulationConfig, FireworkVariant, FlameLayer, GlitterLayer, GlitterSimulation, GlitterSimulationConfig, Lantern, LanternLayer, LanternSimulation, LanternSimulationConfig, LayeredSimulation, Leaf, LeafLayer, LeafSimulation, LeafSimulationConfig, LightningBolt, LightningBranch, LightningLayer, LightningSimulation, LightningSimulationConfig, LightningSystem, LightningSystemConfig, LimitedFrameRateCanvas, MatrixColumn, MatrixLayer, MatrixSimulation, MatrixSimulationConfig, NetworkParticle, OrbitLayer, OrbitSimulation, OrbitSimulationConfig, OrbitalCenter, Orbiter, PALETTES, type Palette, ParticleLayer, ParticleMouseMode, ParticleShape, ParticleSimulation, ParticleSimulationConfig, Petal, PetalLayer, PetalSimulation, PetalSimulationConfig, PlasmaColor, PlasmaLayer, PlasmaSimulation, PlasmaSimulationConfig, PopParticle, RainLayer, RainSimulation, RainSimulationConfig, RainVariant, Raindrop, RaindropParticle, RaindropParticleConfig, SHAPE_PATHS, SandGrain, SandstormLayer, SandstormSimulation, SandstormSimulationConfig, SettledGlitter, type ShootingStar, ShootingStarSystem, ShootingStarSystemConfig, SimulationCanvas, SimulationLayer, SnowLayer, SnowSimulation, SnowSimulationConfig, Spark, SparklerLayer, SparklerParticle, SparklerParticleConfig, SparklerSimulation, SparklerSimulationConfig, SparklerSpark, Splash, SplashParticle, SplashParticleConfig, Star, StarLayer, StarMode, StarSimulation, StarSimulationConfig, Streamer, StreamerLayer, StreamerSimulation, StreamerSimulationConfig, Trail, TrailConfig, Wave, WaveLayer, WaveSimulation, WaveSimulationConfig, WormholeDirection, WormholeLayer, WormholeParticle, WormholeSimulation, WormholeSimulationConfig, createFireflySprite, parseColor };
|
|
98
1276
|
//# sourceMappingURL=index.d.mts.map
|