@tsparticles/fireworks 4.0.0-beta.8 → 4.0.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/README.md +98 -45
- package/browser/browser.js +5 -0
- package/browser/bundle.js +4 -0
- package/browser/fireworks.js +32 -216
- package/browser/fireworks.lazy.js +64 -0
- package/browser/index.lazy.js +1 -0
- package/browser/types.js +1 -0
- package/browser/utils.js +195 -0
- package/cjs/browser.js +5 -0
- package/cjs/bundle.js +4 -0
- package/cjs/fireworks.js +32 -216
- package/cjs/fireworks.lazy.js +64 -0
- package/cjs/index.lazy.js +1 -0
- package/cjs/types.js +1 -0
- package/cjs/utils.js +195 -0
- package/esm/browser.js +5 -0
- package/esm/bundle.js +4 -0
- package/esm/fireworks.js +32 -216
- package/esm/fireworks.lazy.js +64 -0
- package/esm/index.lazy.js +1 -0
- package/esm/types.js +1 -0
- package/esm/utils.js +195 -0
- package/package.json +19 -12
- package/report.html +4949 -94
- package/tsparticles.fireworks.bundle.js +9132 -977
- package/tsparticles.fireworks.bundle.min.js +1 -2
- package/tsparticles.fireworks.js +395 -467
- package/tsparticles.fireworks.min.js +1 -2
- package/types/browser.d.ts +1 -0
- package/types/fireworks.d.ts +3 -6
- package/types/fireworks.lazy.d.ts +17 -0
- package/types/index.lazy.d.ts +4 -0
- package/types/types.d.ts +6 -0
- package/types/utils.d.ts +6 -0
- package/1241.min.js +0 -1
- package/1581.min.js +0 -1
- package/2049.min.js +0 -1
- package/2066.min.js +0 -1
- package/2127.min.js +0 -1
- package/218.min.js +0 -1
- package/2191.min.js +0 -1
- package/2270.min.js +0 -1
- package/2556.min.js +0 -1
- package/2602.min.js +0 -1
- package/2760.min.js +0 -1
- package/2865.min.js +0 -33
- package/3047.min.js +0 -1
- package/3073.min.js +0 -1
- package/3384.min.js +0 -1
- package/3443.min.js +0 -1
- package/3583.min.js +0 -1
- package/374.min.js +0 -1
- package/382.min.js +0 -1
- package/4068.min.js +0 -1
- package/4186.min.js +0 -1
- package/4217.min.js +0 -1
- package/4427.min.js +0 -1
- package/4519.min.js +0 -1
- package/4626.min.js +0 -1
- package/5048.min.js +0 -1
- package/5218.min.js +0 -1
- package/5294.min.js +0 -1
- package/5344.min.js +0 -1
- package/5445.min.js +0 -1
- package/5492.min.js +0 -1
- package/5629.min.js +0 -1
- package/5675.min.js +0 -1
- package/6055.min.js +0 -1
- package/6067.min.js +0 -1
- package/6099.min.js +0 -1
- package/6171.min.js +0 -1
- package/648.min.js +0 -1
- package/6602.min.js +0 -1
- package/6943.min.js +0 -1
- package/6996.min.js +0 -1
- package/7162.min.js +0 -1
- package/7698.min.js +0 -1
- package/7711.min.js +0 -1
- package/7757.min.js +0 -1
- package/7792.min.js +0 -1
- package/8272.min.js +0 -1
- package/8386.min.js +0 -1
- package/8529.min.js +0 -1
- package/8607.min.js +0 -1
- package/8656.min.js +0 -1
- package/8731.min.js +0 -1
- package/9407.min.js +0 -1
- package/9674.min.js +0 -1
- package/basic_dist_browser_index_js.js +0 -30
- package/dist_browser_FireworksInstance_js.js +0 -30
- package/engine_dist_browser_Core_Container_js.js +0 -100
- package/plugins_blend_dist_browser_BlendPluginInstance_js.js +0 -30
- package/plugins_blend_dist_browser_BlendPlugin_js.js +0 -40
- package/plugins_blend_dist_browser_index_js.js +0 -30
- package/plugins_colors_hex_dist_browser_HexColorManager_js.js +0 -30
- package/plugins_colors_hex_dist_browser_index_js.js +0 -30
- package/plugins_colors_hsl_dist_browser_HslColorManager_js.js +0 -30
- package/plugins_colors_hsl_dist_browser_index_js.js +0 -30
- package/plugins_colors_rgb_dist_browser_RgbColorManager_js.js +0 -30
- package/plugins_colors_rgb_dist_browser_index_js.js +0 -30
- package/plugins_emittersShapes_square_dist_browser_EmittersSquareShapeGenerator_js.js +0 -100
- package/plugins_emittersShapes_square_dist_browser_index_js.js +0 -30
- package/plugins_emitters_dist_browser_EmitterInstance_js.js +0 -30
- package/plugins_emitters_dist_browser_EmittersInstancesManager_js.js +0 -100
- package/plugins_emitters_dist_browser_EmittersInteractor_js.js +0 -210
- package/plugins_emitters_dist_browser_EmittersPluginInstance_js.js +0 -30
- package/plugins_emitters_dist_browser_EmittersPlugin_js.js +0 -100
- package/plugins_emitters_dist_browser_ShapeManager_js.js +0 -30
- package/plugins_emitters_dist_browser_addEmittersShapesManager_js.js +0 -30
- package/plugins_emitters_dist_browser_getEmittersInstancesManager_js.js +0 -30
- package/plugins_emitters_dist_browser_index_js.js +0 -80
- package/plugins_emitters_dist_browser_plugin_js.js +0 -50
- package/plugins_interactivity_dist_browser_InteractivityPluginInstance_js.js +0 -50
- package/plugins_interactivity_dist_browser_InteractivityPlugin_js.js +0 -70
- package/plugins_interactivity_dist_browser_index_js.js +0 -120
- package/plugins_move_dist_browser_MovePluginInstance_js.js +0 -40
- package/plugins_move_dist_browser_MovePlugin_js.js +0 -30
- package/plugins_move_dist_browser_index_js.js +0 -30
- package/plugins_sounds_dist_browser_SoundsPluginInstance_js.js +0 -40
- package/plugins_sounds_dist_browser_SoundsPlugin_js.js +0 -130
- package/plugins_sounds_dist_browser_index_js.js +0 -30
- package/shapes_circle_dist_browser_CircleDrawer_js.js +0 -40
- package/shapes_circle_dist_browser_index_js.js +0 -30
- package/shapes_line_dist_browser_LineDrawer_js.js +0 -40
- package/shapes_line_dist_browser_index_js.js +0 -30
- package/updaters_destroy_dist_browser_DestroyUpdater_js.js +0 -100
- package/updaters_destroy_dist_browser_index_js.js +0 -30
- package/updaters_fillColor_dist_browser_FillColorUpdater_js.js +0 -30
- package/updaters_fillColor_dist_browser_index_js.js +0 -30
- package/updaters_life_dist_browser_LifeUpdater_js.js +0 -70
- package/updaters_life_dist_browser_index_js.js +0 -30
- package/updaters_opacity_dist_browser_OpacityUpdater_js.js +0 -30
- package/updaters_opacity_dist_browser_index_js.js +0 -30
- package/updaters_outModes_dist_browser_OutOfCanvasUpdater_js.js +0 -80
- package/updaters_outModes_dist_browser_index_js.js +0 -30
- package/updaters_rotate_dist_browser_RotateUpdater_js.js +0 -50
- package/updaters_rotate_dist_browser_index_js.js +0 -30
- package/updaters_size_dist_browser_SizeUpdater_js.js +0 -30
- package/updaters_size_dist_browser_index_js.js +0 -30
- package/updaters_strokeColor_dist_browser_StrokeColorUpdater_js.js +0 -30
- package/updaters_strokeColor_dist_browser_index_js.js +0 -30
package/tsparticles.fireworks.js
CHANGED
|
@@ -1,467 +1,395 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
(
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
(
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
(
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
(
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ fireworks: () => (/* binding */ fireworks)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _FireworkOptions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./FireworkOptions.js */ \"./dist/browser/FireworkOptions.js\");\n\n\nlet initialized = false, initializing = false;\nconst explodeSoundCheck = (args)=>{\n const data = args.data;\n return data?.particle?.options.move.gravity.enable ?? false;\n};\nasync function initPlugins(engine) {\n if (initialized) {\n return;\n }\n if (initializing) {\n return new Promise((resolve)=>{\n const timeout = 100, interval = setInterval(()=>{\n if (!initialized) {\n return;\n }\n clearInterval(interval);\n resolve();\n }, timeout);\n });\n }\n initializing = true;\n engine.checkVersion(\"4.0.0-beta.8\");\n await engine.pluginManager.register(async (e)=>{\n const [{ loadBasic }, { loadLineShape }, { loadBlendPlugin }, { loadEmittersPluginSimple }, { loadEmittersShapeSquare }, { loadSoundsPlugin }, { loadRotateUpdater }, { loadDestroyUpdater }, { loadLifeUpdater }, { loadStrokeColorUpdater }] = await Promise.all([\n Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! @tsparticles/basic */ \"@tsparticles/basic\", 19)),\n Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! @tsparticles/shape-line */ \"@tsparticles/shape-line\", 19)),\n Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! @tsparticles/plugin-blend */ \"@tsparticles/plugin-blend\", 19)),\n Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! @tsparticles/plugin-emitters/plugin */ \"@tsparticles/plugin-emitters/plugin\", 19)),\n Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! @tsparticles/plugin-emitters-shape-square */ \"@tsparticles/plugin-emitters-shape-square\", 19)),\n Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! @tsparticles/plugin-sounds */ \"@tsparticles/plugin-sounds\", 19)),\n Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! @tsparticles/updater-rotate */ \"@tsparticles/updater-rotate\", 19)),\n Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! @tsparticles/updater-destroy */ \"@tsparticles/updater-destroy\", 19)),\n Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! @tsparticles/updater-life */ \"@tsparticles/updater-life\", 19)),\n Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! @tsparticles/updater-stroke-color */ \"@tsparticles/updater-stroke-color\", 19))\n ]);\n await Promise.all([\n loadBasic(e),\n loadLineShape(e),\n loadBlendPlugin(e),\n (async ()=>{\n await loadEmittersPluginSimple(e);\n await loadEmittersShapeSquare(e);\n })(),\n loadSoundsPlugin(e),\n loadRotateUpdater(e),\n loadDestroyUpdater(e),\n loadLifeUpdater(e),\n loadStrokeColorUpdater(e)\n ]);\n });\n initializing = false;\n initialized = true;\n}\nfunction getOptions(options, canvas) {\n const identity = 1;\n return {\n detectRetina: true,\n background: {\n color: options.background\n },\n blend: {\n enable: true,\n mode: \"lighter\"\n },\n fullScreen: {\n enable: !canvas\n },\n fpsLimit: 60,\n emitters: {\n direction: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.MoveDirection.top,\n life: {\n count: 0,\n duration: 0.1,\n delay: 0.1\n },\n rate: {\n delay: (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNumber)(options.rate) ? identity / options.rate : {\n min: identity / (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeMin)(options.rate),\n max: identity / (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeMax)(options.rate)\n },\n quantity: 1\n },\n size: {\n width: 100,\n height: 0\n },\n position: {\n y: 100,\n x: 50\n }\n },\n particles: {\n number: {\n value: 0\n },\n stroke: {\n color: {\n value: options.colors\n },\n width: 2\n },\n destroy: {\n mode: \"split\",\n bounds: {\n top: (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(options.minHeight)\n },\n split: {\n count: 1,\n factor: {\n value: 0.333333\n },\n rate: {\n value: options.splitCount\n },\n strokeColorOffset: {\n s: options.saturation,\n l: options.brightness\n },\n particles: {\n group: \"split\",\n number: {\n value: 0\n },\n opacity: {\n value: {\n min: 0.1,\n max: 1\n },\n animation: {\n enable: true,\n speed: {\n min: 2,\n max: 4\n },\n sync: true,\n startValue: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.StartValueType.max,\n destroy: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.DestroyType.min,\n count: 1\n }\n },\n size: {\n value: {\n min: 5,\n max: 10\n }\n },\n life: {\n count: 1,\n duration: {\n value: {\n min: 0.5,\n max: 1\n }\n }\n },\n move: {\n decay: 0.05,\n enable: true,\n gravity: {\n enable: false\n },\n speed: {\n min: 10,\n max: 25\n },\n direction: \"outside\",\n outModes: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OutMode.destroy\n }\n }\n }\n },\n life: {\n count: 1\n },\n shape: {\n type: \"line\",\n options: {\n line: {\n cap: \"round\"\n }\n }\n },\n size: {\n value: {\n min: 10,\n max: 20\n }\n },\n rotate: {\n path: true\n },\n move: {\n enable: true,\n gravity: {\n acceleration: (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(options.gravity),\n enable: true,\n inverse: true,\n maxSpeed: 150\n },\n speed: (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(options.speed),\n outModes: {\n default: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OutMode.destroy,\n top: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OutMode.none\n }\n }\n },\n sounds: {\n enable: options.sounds,\n events: [\n {\n event: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.EventType.particleRemoved,\n filter: explodeSoundCheck,\n audio: [\n \"https://particles.js.org/audio/explosion0.mp3\",\n \"https://particles.js.org/audio/explosion1.mp3\",\n \"https://particles.js.org/audio/explosion2.mp3\"\n ]\n }\n ],\n volume: 50\n }\n };\n}\nasync function getFireworksInstance(id, sourceOptions, canvas) {\n await initPlugins(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.tsParticles);\n const options = new _FireworkOptions_js__WEBPACK_IMPORTED_MODULE_1__.FireworkOptions();\n options.load(sourceOptions);\n const particlesOptions = getOptions(options, canvas), container = await _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.tsParticles.load({\n id,\n element: canvas,\n options: particlesOptions\n });\n if (!container) {\n return;\n }\n const { FireworksInstance } = await __webpack_require__.e(/*! import() */ \"dist_browser_FireworksInstance_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./FireworksInstance.js */ \"./dist/browser/FireworksInstance.js\"));\n return new FireworksInstance(container);\n}\nasync function fireworks(idOrOptions, sourceOptions) {\n let id, options;\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isString)(idOrOptions)) {\n id = idOrOptions;\n options = sourceOptions ?? {};\n } else {\n id = \"fireworks\";\n options = idOrOptions ?? {};\n }\n return getFireworksInstance(id, options);\n}\nfireworks.create = async (canvas, options)=>{\n const id = canvas.id || \"fireworks\";\n return getFireworksInstance(id, options ?? {}, canvas);\n};\nfireworks.init = async ()=>{\n await initPlugins(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.tsParticles);\n};\nfireworks.version = \"4.0.0-beta.8\";\nglobalThis.fireworks = fireworks;\n\n\n//# sourceURL=webpack://@tsparticles/fireworks/./dist/browser/fireworks.js?\n}");
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
/******/ var loadingEnded = (event) => {
|
|
397
|
-
/******/ if(__webpack_require__.o(installedChunks, chunkId)) {
|
|
398
|
-
/******/ installedChunkData = installedChunks[chunkId];
|
|
399
|
-
/******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined;
|
|
400
|
-
/******/ if(installedChunkData) {
|
|
401
|
-
/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
|
|
402
|
-
/******/ var realSrc = event && event.target && event.target.src;
|
|
403
|
-
/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
|
|
404
|
-
/******/ error.name = 'ChunkLoadError';
|
|
405
|
-
/******/ error.type = errorType;
|
|
406
|
-
/******/ error.request = realSrc;
|
|
407
|
-
/******/ installedChunkData[1](error);
|
|
408
|
-
/******/ }
|
|
409
|
-
/******/ }
|
|
410
|
-
/******/ };
|
|
411
|
-
/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId);
|
|
412
|
-
/******/ }
|
|
413
|
-
/******/ }
|
|
414
|
-
/******/ }
|
|
415
|
-
/******/ };
|
|
416
|
-
/******/
|
|
417
|
-
/******/ // no prefetching
|
|
418
|
-
/******/
|
|
419
|
-
/******/ // no preloaded
|
|
420
|
-
/******/
|
|
421
|
-
/******/ // no HMR
|
|
422
|
-
/******/
|
|
423
|
-
/******/ // no HMR manifest
|
|
424
|
-
/******/
|
|
425
|
-
/******/ // no on chunks loaded
|
|
426
|
-
/******/
|
|
427
|
-
/******/ // install a JSONP callback for chunk loading
|
|
428
|
-
/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
|
|
429
|
-
/******/ var [chunkIds, moreModules, runtime] = data;
|
|
430
|
-
/******/ // add "moreModules" to the modules object,
|
|
431
|
-
/******/ // then flag all "chunkIds" as loaded and fire callback
|
|
432
|
-
/******/ var moduleId, chunkId, i = 0;
|
|
433
|
-
/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
|
|
434
|
-
/******/ for(moduleId in moreModules) {
|
|
435
|
-
/******/ if(__webpack_require__.o(moreModules, moduleId)) {
|
|
436
|
-
/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
|
|
437
|
-
/******/ }
|
|
438
|
-
/******/ }
|
|
439
|
-
/******/ if(runtime) var result = runtime(__webpack_require__);
|
|
440
|
-
/******/ }
|
|
441
|
-
/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
|
|
442
|
-
/******/ for(;i < chunkIds.length; i++) {
|
|
443
|
-
/******/ chunkId = chunkIds[i];
|
|
444
|
-
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
|
|
445
|
-
/******/ installedChunks[chunkId][0]();
|
|
446
|
-
/******/ }
|
|
447
|
-
/******/ installedChunks[chunkId] = 0;
|
|
448
|
-
/******/ }
|
|
449
|
-
/******/
|
|
450
|
-
/******/ }
|
|
451
|
-
/******/
|
|
452
|
-
/******/ var chunkLoadingGlobal = this["webpackChunk_tsparticles_fireworks"] = this["webpackChunk_tsparticles_fireworks"] || [];
|
|
453
|
-
/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
|
|
454
|
-
/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
|
|
455
|
-
/******/ })();
|
|
456
|
-
/******/
|
|
457
|
-
/************************************************************************/
|
|
458
|
-
/******/
|
|
459
|
-
/******/ // startup
|
|
460
|
-
/******/ // Load entry module and return exports
|
|
461
|
-
/******/ // This entry module can't be inlined because the eval devtool is used.
|
|
462
|
-
/******/ var __webpack_exports__ = __webpack_require__("./dist/browser/index.js");
|
|
463
|
-
/******/
|
|
464
|
-
/******/ return __webpack_exports__;
|
|
465
|
-
/******/ })()
|
|
466
|
-
;
|
|
467
|
-
});
|
|
1
|
+
(function(g){g.__tsParticlesInternals=g.__tsParticlesInternals||{};g.__tsParticlesInternals.bundles=g.__tsParticlesInternals.bundles||{};g.__tsParticlesInternals.effects=g.__tsParticlesInternals.effects||{};g.__tsParticlesInternals.engine=g.__tsParticlesInternals.engine||{};g.__tsParticlesInternals.interactions=g.__tsParticlesInternals.interactions||{};g.__tsParticlesInternals.palettes=g.__tsParticlesInternals.palettes||{};g.__tsParticlesInternals.paths=g.__tsParticlesInternals.paths||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins.emittersShapes=g.__tsParticlesInternals.plugins.emittersShapes||{};g.__tsParticlesInternals.presets=g.__tsParticlesInternals.presets||{};g.__tsParticlesInternals.shapes=g.__tsParticlesInternals.shapes||{};g.__tsParticlesInternals.updaters=g.__tsParticlesInternals.updaters||{};g.__tsParticlesInternals.utils=g.__tsParticlesInternals.utils||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas.utils=g.__tsParticlesInternals.canvas.utils||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path.utils=g.__tsParticlesInternals.path.utils||{};var __tsProxyFactory=typeof Proxy!=="undefined"?function(obj){return new Proxy(obj,{get:function(target,key){if(!(key in target)){target[key]={};}return target[key];}});}:function(obj){return obj;};g.__tsParticlesInternals.bundles=__tsProxyFactory(g.__tsParticlesInternals.bundles);g.__tsParticlesInternals.effects=__tsProxyFactory(g.__tsParticlesInternals.effects);g.__tsParticlesInternals.interactions=__tsProxyFactory(g.__tsParticlesInternals.interactions);g.__tsParticlesInternals.palettes=__tsProxyFactory(g.__tsParticlesInternals.palettes);g.__tsParticlesInternals.paths=__tsProxyFactory(g.__tsParticlesInternals.paths);g.__tsParticlesInternals.plugins=__tsProxyFactory(g.__tsParticlesInternals.plugins);g.__tsParticlesInternals.plugins.emittersShapes=__tsProxyFactory(g.__tsParticlesInternals.plugins.emittersShapes);g.__tsParticlesInternals.presets=__tsProxyFactory(g.__tsParticlesInternals.presets);g.__tsParticlesInternals.shapes=__tsProxyFactory(g.__tsParticlesInternals.shapes);g.__tsParticlesInternals.updaters=__tsProxyFactory(g.__tsParticlesInternals.updaters);g.__tsParticlesInternals.utils=__tsProxyFactory(g.__tsParticlesInternals.utils);g.__tsParticlesInternals.canvas=__tsProxyFactory(g.__tsParticlesInternals.canvas);g.__tsParticlesInternals.path=__tsProxyFactory(g.__tsParticlesInternals.path);g.tsparticlesInternalExports=g.tsparticlesInternalExports||{};})(typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:this);
|
|
2
|
+
/* tsParticles v4.0.0 */
|
|
3
|
+
(function (global, factory) {
|
|
4
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tsparticles/engine'), require('@tsparticles/basic'), require('@tsparticles/plugin-blend'), require('@tsparticles/updater-destroy'), require('@tsparticles/plugin-emitters/plugin'), require('@tsparticles/plugin-emitters-shape-square'), require('@tsparticles/updater-life'), require('@tsparticles/shape-line'), require('@tsparticles/updater-paint'), require('@tsparticles/updater-rotate'), require('@tsparticles/plugin-sounds')) :
|
|
5
|
+
typeof define === 'function' && define.amd ? define(['exports', '@tsparticles/engine', '@tsparticles/basic', '@tsparticles/plugin-blend', '@tsparticles/updater-destroy', '@tsparticles/plugin-emitters/plugin', '@tsparticles/plugin-emitters-shape-square', '@tsparticles/updater-life', '@tsparticles/shape-line', '@tsparticles/updater-paint', '@tsparticles/updater-rotate', '@tsparticles/plugin-sounds'], factory) :
|
|
6
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.__tsParticlesInternals = global.__tsParticlesInternals || {}, global.__tsParticlesInternals.bundles = global.__tsParticlesInternals.bundles || {}, global.__tsParticlesInternals.bundles.fireworks = global.__tsParticlesInternals.bundles.fireworks || {}), global.__tsParticlesInternals.engine, global.__tsParticlesInternals.bundles.basic, global.__tsParticlesInternals.plugins.blend, global.__tsParticlesInternals.updaters.destroy, global.__tsParticlesInternals.plugins["emitters/plugin"], global.__tsParticlesInternals.plugins.emittersShapes.square, global.__tsParticlesInternals.updaters.life, global.__tsParticlesInternals.shapes.line, global.__tsParticlesInternals.updaters.paint, global.__tsParticlesInternals.updaters.rotate, global.__tsParticlesInternals.plugins.sounds));
|
|
7
|
+
})(this, (function (exports, engine, basic, pluginBlend, updaterDestroy, plugin, pluginEmittersShapeSquare, updaterLife, shapeLine, updaterPaint, updaterRotate, pluginSounds) { 'use strict';
|
|
8
|
+
|
|
9
|
+
class FireworkOptions {
|
|
10
|
+
background;
|
|
11
|
+
brightness;
|
|
12
|
+
colors;
|
|
13
|
+
gravity;
|
|
14
|
+
minHeight;
|
|
15
|
+
rate;
|
|
16
|
+
saturation;
|
|
17
|
+
sounds;
|
|
18
|
+
speed;
|
|
19
|
+
splitCount;
|
|
20
|
+
constructor() {
|
|
21
|
+
this.background = "none";
|
|
22
|
+
this.brightness = {
|
|
23
|
+
min: -30,
|
|
24
|
+
max: 30,
|
|
25
|
+
};
|
|
26
|
+
this.colors = [
|
|
27
|
+
"#FF0000",
|
|
28
|
+
"#FF2A00",
|
|
29
|
+
"#FF5500",
|
|
30
|
+
"#FF8000",
|
|
31
|
+
"#FFAA00",
|
|
32
|
+
"#FFD400",
|
|
33
|
+
"#FFFF00",
|
|
34
|
+
"#D4FF00",
|
|
35
|
+
"#AAFF00",
|
|
36
|
+
"#80FF00",
|
|
37
|
+
"#55FF00",
|
|
38
|
+
"#2AFF00",
|
|
39
|
+
"#00FF00",
|
|
40
|
+
"#00FF2A",
|
|
41
|
+
"#00FF55",
|
|
42
|
+
"#00FF80",
|
|
43
|
+
"#00FFAA",
|
|
44
|
+
"#00FFD4",
|
|
45
|
+
"#00FFFF",
|
|
46
|
+
"#00D4FF",
|
|
47
|
+
"#00AAFF",
|
|
48
|
+
"#0080FF",
|
|
49
|
+
"#0055FF",
|
|
50
|
+
"#002AFF",
|
|
51
|
+
"#0000FF",
|
|
52
|
+
"#2A00FF",
|
|
53
|
+
"#5500FF",
|
|
54
|
+
"#8000FF",
|
|
55
|
+
"#AA00FF",
|
|
56
|
+
"#D400FF",
|
|
57
|
+
"#FF00FF",
|
|
58
|
+
"#FF00D4",
|
|
59
|
+
"#FF00AA",
|
|
60
|
+
"#FF0080",
|
|
61
|
+
"#FF0055",
|
|
62
|
+
"#FF002A",
|
|
63
|
+
];
|
|
64
|
+
this.gravity = 30;
|
|
65
|
+
this.minHeight = {
|
|
66
|
+
min: 10,
|
|
67
|
+
max: 30,
|
|
68
|
+
};
|
|
69
|
+
this.rate = 10;
|
|
70
|
+
this.saturation = {
|
|
71
|
+
min: -30,
|
|
72
|
+
max: 30,
|
|
73
|
+
};
|
|
74
|
+
this.sounds = true;
|
|
75
|
+
this.speed = { min: 20, max: 40 };
|
|
76
|
+
this.splitCount = 100;
|
|
77
|
+
}
|
|
78
|
+
load(data) {
|
|
79
|
+
if (engine.isNull(data)) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (data.background !== undefined) {
|
|
83
|
+
this.background = data.background;
|
|
84
|
+
}
|
|
85
|
+
if (data.colors !== undefined) {
|
|
86
|
+
if (engine.isArray(data.colors)) {
|
|
87
|
+
this.colors = [...data.colors];
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
this.colors = data.colors;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
if (data.brightness !== undefined) {
|
|
94
|
+
this.brightness = engine.setRangeValue(data.brightness);
|
|
95
|
+
}
|
|
96
|
+
if (data.gravity !== undefined) {
|
|
97
|
+
this.gravity = engine.setRangeValue(data.gravity);
|
|
98
|
+
}
|
|
99
|
+
if (data.minHeight !== undefined) {
|
|
100
|
+
this.minHeight = engine.setRangeValue(data.minHeight);
|
|
101
|
+
}
|
|
102
|
+
if (data.rate !== undefined) {
|
|
103
|
+
this.rate = engine.setRangeValue(data.rate);
|
|
104
|
+
}
|
|
105
|
+
if (data.saturation !== undefined) {
|
|
106
|
+
this.saturation = engine.setRangeValue(data.saturation);
|
|
107
|
+
}
|
|
108
|
+
if (data.sounds !== undefined) {
|
|
109
|
+
this.sounds = data.sounds;
|
|
110
|
+
}
|
|
111
|
+
if (data.speed !== undefined) {
|
|
112
|
+
this.speed = engine.setRangeValue(data.speed);
|
|
113
|
+
}
|
|
114
|
+
if (data.splitCount !== undefined) {
|
|
115
|
+
this.splitCount = engine.setRangeValue(data.splitCount);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const instances = new Map();
|
|
121
|
+
const explodeSoundCheck = (args) => {
|
|
122
|
+
const data = args.data;
|
|
123
|
+
return data?.particle?.options.move.gravity.enable ?? false;
|
|
124
|
+
};
|
|
125
|
+
function getOptions(options, canvas) {
|
|
126
|
+
const identity = 1;
|
|
127
|
+
return {
|
|
128
|
+
detectRetina: true,
|
|
129
|
+
background: {
|
|
130
|
+
color: options.background,
|
|
131
|
+
},
|
|
132
|
+
blend: {
|
|
133
|
+
enable: true,
|
|
134
|
+
mode: "lighter",
|
|
135
|
+
},
|
|
136
|
+
fullScreen: {
|
|
137
|
+
enable: !canvas,
|
|
138
|
+
},
|
|
139
|
+
fpsLimit: 60,
|
|
140
|
+
emitters: {
|
|
141
|
+
direction: engine.MoveDirection.top,
|
|
142
|
+
life: {
|
|
143
|
+
count: 0,
|
|
144
|
+
duration: 0.1,
|
|
145
|
+
delay: 0.1,
|
|
146
|
+
},
|
|
147
|
+
rate: {
|
|
148
|
+
delay: engine.isNumber(options.rate)
|
|
149
|
+
? identity / options.rate
|
|
150
|
+
: { min: identity / engine.getRangeMin(options.rate), max: identity / engine.getRangeMax(options.rate) },
|
|
151
|
+
quantity: 1,
|
|
152
|
+
},
|
|
153
|
+
size: {
|
|
154
|
+
width: 100,
|
|
155
|
+
height: 0,
|
|
156
|
+
},
|
|
157
|
+
position: {
|
|
158
|
+
y: 100,
|
|
159
|
+
x: 50,
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
particles: {
|
|
163
|
+
number: {
|
|
164
|
+
value: 0,
|
|
165
|
+
},
|
|
166
|
+
paint: {
|
|
167
|
+
fill: {
|
|
168
|
+
enable: false,
|
|
169
|
+
},
|
|
170
|
+
stroke: {
|
|
171
|
+
color: {
|
|
172
|
+
value: options.colors,
|
|
173
|
+
},
|
|
174
|
+
width: 2,
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
destroy: {
|
|
178
|
+
mode: "split",
|
|
179
|
+
bounds: {
|
|
180
|
+
top: engine.setRangeValue(options.minHeight),
|
|
181
|
+
},
|
|
182
|
+
split: {
|
|
183
|
+
count: 1,
|
|
184
|
+
factor: {
|
|
185
|
+
value: 0.333333,
|
|
186
|
+
},
|
|
187
|
+
rate: {
|
|
188
|
+
value: options.splitCount,
|
|
189
|
+
},
|
|
190
|
+
strokeColorOffset: {
|
|
191
|
+
s: options.saturation,
|
|
192
|
+
l: options.brightness,
|
|
193
|
+
},
|
|
194
|
+
particles: {
|
|
195
|
+
group: "split",
|
|
196
|
+
number: {
|
|
197
|
+
value: 0,
|
|
198
|
+
},
|
|
199
|
+
opacity: {
|
|
200
|
+
value: {
|
|
201
|
+
min: 0.1,
|
|
202
|
+
max: 1,
|
|
203
|
+
},
|
|
204
|
+
animation: {
|
|
205
|
+
enable: true,
|
|
206
|
+
speed: { min: 2, max: 4 },
|
|
207
|
+
sync: true,
|
|
208
|
+
startValue: engine.StartValueType.max,
|
|
209
|
+
destroy: engine.DestroyType.min,
|
|
210
|
+
count: 1,
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
size: {
|
|
214
|
+
value: { min: 5, max: 10 },
|
|
215
|
+
},
|
|
216
|
+
life: {
|
|
217
|
+
count: 1,
|
|
218
|
+
duration: {
|
|
219
|
+
value: {
|
|
220
|
+
min: 0.5,
|
|
221
|
+
max: 1,
|
|
222
|
+
},
|
|
223
|
+
},
|
|
224
|
+
},
|
|
225
|
+
move: {
|
|
226
|
+
decay: 0.05,
|
|
227
|
+
enable: true,
|
|
228
|
+
gravity: {
|
|
229
|
+
enable: false,
|
|
230
|
+
},
|
|
231
|
+
speed: {
|
|
232
|
+
min: 10,
|
|
233
|
+
max: 25,
|
|
234
|
+
},
|
|
235
|
+
direction: "outside",
|
|
236
|
+
outModes: engine.OutMode.destroy,
|
|
237
|
+
},
|
|
238
|
+
},
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
life: {
|
|
242
|
+
count: 1,
|
|
243
|
+
},
|
|
244
|
+
shape: {
|
|
245
|
+
type: "line",
|
|
246
|
+
options: {
|
|
247
|
+
line: {
|
|
248
|
+
cap: "round",
|
|
249
|
+
},
|
|
250
|
+
},
|
|
251
|
+
},
|
|
252
|
+
size: {
|
|
253
|
+
value: { min: 10, max: 20 },
|
|
254
|
+
},
|
|
255
|
+
rotate: {
|
|
256
|
+
path: true,
|
|
257
|
+
},
|
|
258
|
+
move: {
|
|
259
|
+
enable: true,
|
|
260
|
+
gravity: {
|
|
261
|
+
acceleration: engine.setRangeValue(options.gravity),
|
|
262
|
+
enable: true,
|
|
263
|
+
inverse: true,
|
|
264
|
+
maxSpeed: 150,
|
|
265
|
+
},
|
|
266
|
+
speed: engine.setRangeValue(options.speed),
|
|
267
|
+
outModes: {
|
|
268
|
+
default: engine.OutMode.destroy,
|
|
269
|
+
top: engine.OutMode.none,
|
|
270
|
+
},
|
|
271
|
+
},
|
|
272
|
+
},
|
|
273
|
+
sounds: {
|
|
274
|
+
enable: options.sounds,
|
|
275
|
+
events: [
|
|
276
|
+
{
|
|
277
|
+
event: engine.EventType.particleRemoved,
|
|
278
|
+
filter: explodeSoundCheck,
|
|
279
|
+
audio: [
|
|
280
|
+
"https://particles.js.org/audio/explosion0.mp3",
|
|
281
|
+
"https://particles.js.org/audio/explosion1.mp3",
|
|
282
|
+
"https://particles.js.org/audio/explosion2.mp3",
|
|
283
|
+
],
|
|
284
|
+
},
|
|
285
|
+
],
|
|
286
|
+
volume: 50,
|
|
287
|
+
},
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
async function getFireworksInstance(engine, id, sourceOptions, canvas) {
|
|
291
|
+
const existing = instances.get(id);
|
|
292
|
+
if (existing instanceof Promise) {
|
|
293
|
+
return existing;
|
|
294
|
+
}
|
|
295
|
+
if (existing) {
|
|
296
|
+
return existing;
|
|
297
|
+
}
|
|
298
|
+
const create = async () => {
|
|
299
|
+
const options = new FireworkOptions();
|
|
300
|
+
options.load(sourceOptions);
|
|
301
|
+
const particlesOptions = getOptions(options, canvas), container = await engine.load({ id, element: canvas, options: particlesOptions });
|
|
302
|
+
if (!container) {
|
|
303
|
+
instances.delete(id);
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
const { FireworksInstance } = await Promise.resolve().then(function () { return FireworksInstance$1; }), instance = new FireworksInstance(container);
|
|
307
|
+
instances.set(id, instance);
|
|
308
|
+
return instance;
|
|
309
|
+
}, createPromise = create();
|
|
310
|
+
instances.set(id, createPromise);
|
|
311
|
+
return createPromise;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
let initPromise = null;
|
|
315
|
+
async function doInitPlugins(engine) {
|
|
316
|
+
engine.checkVersion("4.0.0");
|
|
317
|
+
await engine.pluginManager.register(async (e) => {
|
|
318
|
+
const loadEmittersForFireworks = async (e) => {
|
|
319
|
+
await plugin.loadEmittersPluginSimple(e);
|
|
320
|
+
await pluginEmittersShapeSquare.loadEmittersShapeSquare(e);
|
|
321
|
+
};
|
|
322
|
+
await Promise.all([
|
|
323
|
+
basic.loadBasic(e),
|
|
324
|
+
shapeLine.loadLineShape(e),
|
|
325
|
+
pluginBlend.loadBlendPlugin(e),
|
|
326
|
+
loadEmittersForFireworks(e),
|
|
327
|
+
pluginSounds.loadSoundsPlugin(e),
|
|
328
|
+
updaterRotate.loadRotateUpdater(e),
|
|
329
|
+
updaterDestroy.loadDestroyUpdater(e),
|
|
330
|
+
updaterLife.loadLifeUpdater(e),
|
|
331
|
+
updaterPaint.loadPaintUpdater(e),
|
|
332
|
+
]);
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
async function initPlugins(engine) {
|
|
336
|
+
if (initPromise) {
|
|
337
|
+
return initPromise;
|
|
338
|
+
}
|
|
339
|
+
initPromise = doInitPlugins(engine);
|
|
340
|
+
return initPromise;
|
|
341
|
+
}
|
|
342
|
+
async function fireworks(idOrOptions, sourceOptions) {
|
|
343
|
+
await initPlugins(engine.tsParticles);
|
|
344
|
+
let id, options;
|
|
345
|
+
if (engine.isString(idOrOptions)) {
|
|
346
|
+
id = idOrOptions;
|
|
347
|
+
options = sourceOptions ?? {};
|
|
348
|
+
}
|
|
349
|
+
else {
|
|
350
|
+
id = "fireworks";
|
|
351
|
+
options = idOrOptions ?? {};
|
|
352
|
+
}
|
|
353
|
+
return getFireworksInstance(engine.tsParticles, id, options);
|
|
354
|
+
}
|
|
355
|
+
fireworks.create = async (canvas, options) => {
|
|
356
|
+
await initPlugins(engine.tsParticles);
|
|
357
|
+
const id = canvas?.id ?? "fireworks";
|
|
358
|
+
return getFireworksInstance(engine.tsParticles, id, options ?? {}, canvas ?? undefined);
|
|
359
|
+
};
|
|
360
|
+
fireworks.init = async () => {
|
|
361
|
+
await initPlugins(engine.tsParticles);
|
|
362
|
+
};
|
|
363
|
+
fireworks.version = "4.0.0";
|
|
364
|
+
globalThis.fireworks = fireworks;
|
|
365
|
+
|
|
366
|
+
const globalObject = globalThis;
|
|
367
|
+
globalObject.__tsParticlesInternals = globalObject.__tsParticlesInternals ?? {};
|
|
368
|
+
globalObject.fireworks = fireworks;
|
|
369
|
+
|
|
370
|
+
class FireworksInstance {
|
|
371
|
+
_container;
|
|
372
|
+
constructor(container) {
|
|
373
|
+
this._container = container;
|
|
374
|
+
}
|
|
375
|
+
pause() {
|
|
376
|
+
this._container.pause();
|
|
377
|
+
}
|
|
378
|
+
play() {
|
|
379
|
+
this._container.play();
|
|
380
|
+
}
|
|
381
|
+
stop() {
|
|
382
|
+
this._container.stop();
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
var FireworksInstance$1 = /*#__PURE__*/Object.freeze({
|
|
387
|
+
__proto__: null,
|
|
388
|
+
FireworksInstance: FireworksInstance
|
|
389
|
+
});
|
|
390
|
+
|
|
391
|
+
exports.fireworks = fireworks;
|
|
392
|
+
|
|
393
|
+
}));
|
|
394
|
+
Object.assign(globalThis.window || globalThis, { fireworks: (globalThis.__tsParticlesInternals.bundles.fireworks || {}).fireworks });
|
|
395
|
+
delete (globalThis.window || globalThis).tsparticlesInternalExports;
|