@tsparticles/preset-fireworks 3.0.0-alpha.1 → 3.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -32
- package/browser/bundle.js +1 -3
- package/browser/index.js +12 -22
- package/browser/options.js +3 -1
- package/browser/package.json +1 -0
- package/cjs/bundle.js +1 -12
- package/cjs/index.js +12 -33
- package/cjs/options.js +3 -1
- package/cjs/package.json +1 -0
- package/esm/bundle.js +1 -3
- package/esm/index.js +12 -22
- package/esm/options.js +3 -1
- package/esm/package.json +1 -0
- package/package.json +17 -21
- package/report.html +4 -4
- package/tsparticles.preset.fireworks.bundle.js +3149 -3304
- package/tsparticles.preset.fireworks.bundle.min.js +1 -1
- package/tsparticles.preset.fireworks.bundle.min.js.LICENSE.txt +1 -8
- package/tsparticles.preset.fireworks.js +198 -44
- package/tsparticles.preset.fireworks.min.js +1 -1
- package/tsparticles.preset.fireworks.min.js.LICENSE.txt +1 -8
- package/types/index.d.ts +1 -1
- package/types/options.d.ts +1 -1
- package/umd/bundle.js +1 -3
- package/umd/index.js +13 -23
- package/umd/options.js +3 -1
|
@@ -1,8 +1 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Author : Matteo Bruni
|
|
3
|
-
* MIT license: https://opensource.org/licenses/MIT
|
|
4
|
-
* Demo / Generator : https://particles.js.org/
|
|
5
|
-
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
|
-
* How to use? : Check the GitHub README
|
|
7
|
-
* v3.0.0-alpha.1
|
|
8
|
-
*/
|
|
1
|
+
/*! tsParticles Fireworks Preset v3.0.0-beta.1 by Matteo Bruni */
|
|
@@ -4,18 +4,18 @@
|
|
|
4
4
|
* Demo / Generator : https://particles.js.org/
|
|
5
5
|
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
6
|
* How to use? : Check the GitHub README
|
|
7
|
-
* v3.0.0-
|
|
7
|
+
* v3.0.0-beta.1
|
|
8
8
|
*/
|
|
9
9
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
10
10
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
11
|
-
module.exports = factory(require("@tsparticles/
|
|
11
|
+
module.exports = factory(require("@tsparticles/move-base"), require("@tsparticles/shape-circle"), require("@tsparticles/updater-color"), require("@tsparticles/updater-opacity"), require("@tsparticles/updater-out-modes"), require("@tsparticles/updater-size"), require("@tsparticles/updater-destroy"), require("@tsparticles/plugin-emitters"), require("@tsparticles/updater-life"), require("@tsparticles/shape-line"), require("@tsparticles/engine"), require("@tsparticles/plugin-sounds"), require("@tsparticles/updater-stroke-color"));
|
|
12
12
|
else if(typeof define === 'function' && define.amd)
|
|
13
|
-
define(["@tsparticles/
|
|
13
|
+
define(["@tsparticles/move-base", "@tsparticles/shape-circle", "@tsparticles/updater-color", "@tsparticles/updater-opacity", "@tsparticles/updater-out-modes", "@tsparticles/updater-size", "@tsparticles/updater-destroy", "@tsparticles/plugin-emitters", "@tsparticles/updater-life", "@tsparticles/shape-line", "@tsparticles/engine", "@tsparticles/plugin-sounds", "@tsparticles/updater-stroke-color"], factory);
|
|
14
14
|
else {
|
|
15
|
-
var a = typeof exports === 'object' ? factory(require("@tsparticles/
|
|
15
|
+
var a = typeof exports === 'object' ? factory(require("@tsparticles/move-base"), require("@tsparticles/shape-circle"), require("@tsparticles/updater-color"), require("@tsparticles/updater-opacity"), require("@tsparticles/updater-out-modes"), require("@tsparticles/updater-size"), require("@tsparticles/updater-destroy"), require("@tsparticles/plugin-emitters"), require("@tsparticles/updater-life"), require("@tsparticles/shape-line"), require("@tsparticles/engine"), require("@tsparticles/plugin-sounds"), require("@tsparticles/updater-stroke-color")) : factory(root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"]);
|
|
16
16
|
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
|
|
17
17
|
}
|
|
18
|
-
})(this, (
|
|
18
|
+
})(this, (__WEBPACK_EXTERNAL_MODULE__619__, __WEBPACK_EXTERNAL_MODULE__163__, __WEBPACK_EXTERNAL_MODULE__501__, __WEBPACK_EXTERNAL_MODULE__686__, __WEBPACK_EXTERNAL_MODULE__290__, __WEBPACK_EXTERNAL_MODULE__2__, __WEBPACK_EXTERNAL_MODULE__344__, __WEBPACK_EXTERNAL_MODULE__68__, __WEBPACK_EXTERNAL_MODULE__84__, __WEBPACK_EXTERNAL_MODULE__137__, __WEBPACK_EXTERNAL_MODULE__533__, __WEBPACK_EXTERNAL_MODULE__490__, __WEBPACK_EXTERNAL_MODULE__204__) => {
|
|
19
19
|
return /******/ (() => { // webpackBootstrap
|
|
20
20
|
/******/ "use strict";
|
|
21
21
|
/******/ var __webpack_modules__ = ({
|
|
@@ -62,13 +62,6 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__137__;
|
|
|
62
62
|
|
|
63
63
|
/***/ }),
|
|
64
64
|
|
|
65
|
-
/***/ 71:
|
|
66
|
-
/***/ ((module) => {
|
|
67
|
-
|
|
68
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE__71__;
|
|
69
|
-
|
|
70
|
-
/***/ }),
|
|
71
|
-
|
|
72
65
|
/***/ 501:
|
|
73
66
|
/***/ ((module) => {
|
|
74
67
|
|
|
@@ -182,17 +175,38 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
182
175
|
|
|
183
176
|
// EXPORTS
|
|
184
177
|
__webpack_require__.d(__webpack_exports__, {
|
|
185
|
-
|
|
178
|
+
loadFireworksPreset: () => (/* binding */ loadFireworksPreset)
|
|
186
179
|
});
|
|
187
180
|
|
|
188
|
-
// EXTERNAL MODULE: external {"commonjs":"@tsparticles/updater-angle","commonjs2":"@tsparticles/updater-angle","amd":"@tsparticles/updater-angle","root":"window"}
|
|
189
|
-
var updater_angle_root_window_ = __webpack_require__(71);
|
|
190
181
|
// EXTERNAL MODULE: external {"commonjs":"@tsparticles/move-base","commonjs2":"@tsparticles/move-base","amd":"@tsparticles/move-base","root":"window"}
|
|
191
182
|
var move_base_root_window_ = __webpack_require__(619);
|
|
192
183
|
// EXTERNAL MODULE: external {"commonjs":"@tsparticles/shape-circle","commonjs2":"@tsparticles/shape-circle","amd":"@tsparticles/shape-circle","root":"window"}
|
|
193
184
|
var shape_circle_root_window_ = __webpack_require__(163);
|
|
194
185
|
// EXTERNAL MODULE: external {"commonjs":"@tsparticles/updater-color","commonjs2":"@tsparticles/updater-color","amd":"@tsparticles/updater-color","root":"window"}
|
|
195
186
|
var updater_color_root_window_ = __webpack_require__(501);
|
|
187
|
+
// EXTERNAL MODULE: external {"commonjs":"@tsparticles/updater-opacity","commonjs2":"@tsparticles/updater-opacity","amd":"@tsparticles/updater-opacity","root":"window"}
|
|
188
|
+
var updater_opacity_root_window_ = __webpack_require__(686);
|
|
189
|
+
// EXTERNAL MODULE: external {"commonjs":"@tsparticles/updater-out-modes","commonjs2":"@tsparticles/updater-out-modes","amd":"@tsparticles/updater-out-modes","root":"window"}
|
|
190
|
+
var updater_out_modes_root_window_ = __webpack_require__(290);
|
|
191
|
+
// EXTERNAL MODULE: external {"commonjs":"@tsparticles/updater-size","commonjs2":"@tsparticles/updater-size","amd":"@tsparticles/updater-size","root":"window"}
|
|
192
|
+
var updater_size_root_window_ = __webpack_require__(2);
|
|
193
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+basic@3.0.0-beta.1/node_modules/@tsparticles/basic/browser/index.js
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
async function loadBasic(engine, refresh = true) {
|
|
201
|
+
await (0,move_base_root_window_.loadBaseMover)(engine, false);
|
|
202
|
+
await (0,shape_circle_root_window_.loadCircleShape)(engine, false);
|
|
203
|
+
await (0,updater_color_root_window_.loadColorUpdater)(engine, false);
|
|
204
|
+
await (0,updater_opacity_root_window_.loadOpacityUpdater)(engine, false);
|
|
205
|
+
await (0,updater_out_modes_root_window_.loadOutModesUpdater)(engine, false);
|
|
206
|
+
await (0,updater_size_root_window_.loadSizeUpdater)(engine, false);
|
|
207
|
+
await engine.refresh(refresh);
|
|
208
|
+
}
|
|
209
|
+
|
|
196
210
|
// EXTERNAL MODULE: external {"commonjs":"@tsparticles/updater-destroy","commonjs2":"@tsparticles/updater-destroy","amd":"@tsparticles/updater-destroy","root":"window"}
|
|
197
211
|
var updater_destroy_root_window_ = __webpack_require__(344);
|
|
198
212
|
// EXTERNAL MODULE: external {"commonjs":"@tsparticles/plugin-emitters","commonjs2":"@tsparticles/plugin-emitters","amd":"@tsparticles/plugin-emitters","root":"window"}
|
|
@@ -201,18 +215,166 @@ var plugin_emitters_root_window_ = __webpack_require__(68);
|
|
|
201
215
|
var updater_life_root_window_ = __webpack_require__(84);
|
|
202
216
|
// EXTERNAL MODULE: external {"commonjs":"@tsparticles/shape-line","commonjs2":"@tsparticles/shape-line","amd":"@tsparticles/shape-line","root":"window"}
|
|
203
217
|
var shape_line_root_window_ = __webpack_require__(137);
|
|
204
|
-
// EXTERNAL MODULE: external {"commonjs":"@tsparticles/
|
|
205
|
-
var
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
218
|
+
// EXTERNAL MODULE: external {"commonjs":"@tsparticles/engine","commonjs2":"@tsparticles/engine","amd":"@tsparticles/engine","root":"window"}
|
|
219
|
+
var engine_root_window_ = __webpack_require__(533);
|
|
220
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-rotate@3.0.0-beta.1/node_modules/@tsparticles/updater-rotate/browser/Options/Classes/RotateAnimation.js
|
|
221
|
+
|
|
222
|
+
class RotateAnimation {
|
|
223
|
+
constructor() {
|
|
224
|
+
this.enable = false;
|
|
225
|
+
this.speed = 0;
|
|
226
|
+
this.decay = 0;
|
|
227
|
+
this.sync = false;
|
|
228
|
+
}
|
|
229
|
+
load(data) {
|
|
230
|
+
if (!data) {
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
if (data.enable !== undefined) {
|
|
234
|
+
this.enable = data.enable;
|
|
235
|
+
}
|
|
236
|
+
if (data.speed !== undefined) {
|
|
237
|
+
this.speed = (0,engine_root_window_.setRangeValue)(data.speed);
|
|
238
|
+
}
|
|
239
|
+
if (data.decay !== undefined) {
|
|
240
|
+
this.decay = (0,engine_root_window_.setRangeValue)(data.decay);
|
|
241
|
+
}
|
|
242
|
+
if (data.sync !== undefined) {
|
|
243
|
+
this.sync = data.sync;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-rotate@3.0.0-beta.1/node_modules/@tsparticles/updater-rotate/browser/Options/Classes/Rotate.js
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
class Rotate extends engine_root_window_.ValueWithRandom {
|
|
252
|
+
constructor() {
|
|
253
|
+
super();
|
|
254
|
+
this.animation = new RotateAnimation();
|
|
255
|
+
this.direction = "clockwise";
|
|
256
|
+
this.path = false;
|
|
257
|
+
this.value = 0;
|
|
258
|
+
}
|
|
259
|
+
load(data) {
|
|
260
|
+
if (!data) {
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
super.load(data);
|
|
264
|
+
if (data.direction !== undefined) {
|
|
265
|
+
this.direction = data.direction;
|
|
266
|
+
}
|
|
267
|
+
this.animation.load(data.animation);
|
|
268
|
+
if (data.path !== undefined) {
|
|
269
|
+
this.path = data.path;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-rotate@3.0.0-beta.1/node_modules/@tsparticles/updater-rotate/browser/RotateUpdater.js
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
function updateRotate(particle, delta) {
|
|
278
|
+
const rotate = particle.rotate, rotateOptions = particle.options.rotate;
|
|
279
|
+
if (!rotate || !rotateOptions) {
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
const rotateAnimation = rotateOptions.animation, speed = (rotate.velocity ?? 0) * delta.factor, max = 2 * Math.PI, decay = rotate.decay ?? 1;
|
|
283
|
+
if (!rotateAnimation.enable) {
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
switch (rotate.status) {
|
|
287
|
+
case "increasing":
|
|
288
|
+
rotate.value += speed;
|
|
289
|
+
if (rotate.value > max) {
|
|
290
|
+
rotate.value -= max;
|
|
291
|
+
}
|
|
292
|
+
break;
|
|
293
|
+
case "decreasing":
|
|
294
|
+
default:
|
|
295
|
+
rotate.value -= speed;
|
|
296
|
+
if (rotate.value < 0) {
|
|
297
|
+
rotate.value += max;
|
|
298
|
+
}
|
|
299
|
+
break;
|
|
300
|
+
}
|
|
301
|
+
if (rotate.velocity && decay !== 1) {
|
|
302
|
+
rotate.velocity *= decay;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
class RotateUpdater {
|
|
306
|
+
constructor(container) {
|
|
307
|
+
this.container = container;
|
|
308
|
+
}
|
|
309
|
+
init(particle) {
|
|
310
|
+
const rotateOptions = particle.options.rotate;
|
|
311
|
+
if (!rotateOptions) {
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
particle.rotate = {
|
|
315
|
+
enable: rotateOptions.animation.enable,
|
|
316
|
+
value: ((0,engine_root_window_.getRangeValue)(rotateOptions.value) * Math.PI) / 180,
|
|
317
|
+
};
|
|
318
|
+
particle.pathRotation = rotateOptions.path;
|
|
319
|
+
let rotateDirection = rotateOptions.direction;
|
|
320
|
+
if (rotateDirection === "random") {
|
|
321
|
+
const index = Math.floor((0,engine_root_window_.getRandom)() * 2);
|
|
322
|
+
rotateDirection = index > 0 ? "counter-clockwise" : "clockwise";
|
|
323
|
+
}
|
|
324
|
+
switch (rotateDirection) {
|
|
325
|
+
case "counter-clockwise":
|
|
326
|
+
case "counterClockwise":
|
|
327
|
+
particle.rotate.status = "decreasing";
|
|
328
|
+
break;
|
|
329
|
+
case "clockwise":
|
|
330
|
+
particle.rotate.status = "increasing";
|
|
331
|
+
break;
|
|
332
|
+
}
|
|
333
|
+
const rotateAnimation = rotateOptions.animation;
|
|
334
|
+
if (rotateAnimation.enable) {
|
|
335
|
+
particle.rotate.decay = 1 - (0,engine_root_window_.getRangeValue)(rotateAnimation.decay);
|
|
336
|
+
particle.rotate.velocity =
|
|
337
|
+
((0,engine_root_window_.getRangeValue)(rotateAnimation.speed) / 360) * this.container.retina.reduceFactor;
|
|
338
|
+
if (!rotateAnimation.sync) {
|
|
339
|
+
particle.rotate.velocity *= (0,engine_root_window_.getRandom)();
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
particle.rotation = particle.rotate.value;
|
|
343
|
+
}
|
|
344
|
+
isEnabled(particle) {
|
|
345
|
+
const rotate = particle.options.rotate;
|
|
346
|
+
if (!rotate) {
|
|
347
|
+
return false;
|
|
348
|
+
}
|
|
349
|
+
return !particle.destroyed && !particle.spawning && rotate.animation.enable && !rotate.path;
|
|
350
|
+
}
|
|
351
|
+
loadOptions(options, ...sources) {
|
|
352
|
+
if (!options.rotate) {
|
|
353
|
+
options.rotate = new Rotate();
|
|
354
|
+
}
|
|
355
|
+
for (const source of sources) {
|
|
356
|
+
options.rotate.load(source?.rotate);
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
update(particle, delta) {
|
|
360
|
+
if (!this.isEnabled(particle)) {
|
|
361
|
+
return;
|
|
362
|
+
}
|
|
363
|
+
updateRotate(particle, delta);
|
|
364
|
+
particle.rotation = particle.rotate?.value ?? 0;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-rotate@3.0.0-beta.1/node_modules/@tsparticles/updater-rotate/browser/index.js
|
|
369
|
+
|
|
370
|
+
async function loadRotateUpdater(engine, refresh = true) {
|
|
371
|
+
await engine.addParticleUpdater("rotate", (container) => new RotateUpdater(container), refresh);
|
|
372
|
+
}
|
|
373
|
+
|
|
210
374
|
// EXTERNAL MODULE: external {"commonjs":"@tsparticles/plugin-sounds","commonjs2":"@tsparticles/plugin-sounds","amd":"@tsparticles/plugin-sounds","root":"window"}
|
|
211
375
|
var plugin_sounds_root_window_ = __webpack_require__(490);
|
|
212
376
|
// EXTERNAL MODULE: external {"commonjs":"@tsparticles/updater-stroke-color","commonjs2":"@tsparticles/updater-stroke-color","amd":"@tsparticles/updater-stroke-color","root":"window"}
|
|
213
377
|
var updater_stroke_color_root_window_ = __webpack_require__(204);
|
|
214
|
-
// EXTERNAL MODULE: external {"commonjs":"@tsparticles/engine","commonjs2":"@tsparticles/engine","amd":"@tsparticles/engine","root":"window"}
|
|
215
|
-
var engine_root_window_ = __webpack_require__(533);
|
|
216
378
|
;// CONCATENATED MODULE: ./dist/browser/options.js
|
|
217
379
|
|
|
218
380
|
const explodeSoundCheck = args => {
|
|
@@ -416,7 +578,9 @@ const options = {
|
|
|
416
578
|
top: "none"
|
|
417
579
|
},
|
|
418
580
|
trail: {
|
|
419
|
-
|
|
581
|
+
fill: {
|
|
582
|
+
color: "#000"
|
|
583
|
+
},
|
|
420
584
|
enable: true,
|
|
421
585
|
length: 10
|
|
422
586
|
}
|
|
@@ -442,26 +606,16 @@ const options = {
|
|
|
442
606
|
|
|
443
607
|
|
|
444
608
|
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
await (0,
|
|
452
|
-
await (0,
|
|
453
|
-
await (0,
|
|
454
|
-
await (
|
|
455
|
-
await (0,shape_line_root_window_.loadLineShape)(engine);
|
|
456
|
-
await (0,updater_angle_root_window_.loadAngleUpdater)(engine);
|
|
457
|
-
await (0,updater_color_root_window_.loadColorUpdater)(engine);
|
|
458
|
-
await (0,updater_destroy_root_window_.loadDestroyUpdater)(engine);
|
|
459
|
-
await (0,updater_life_root_window_.loadLifeUpdater)(engine);
|
|
460
|
-
await (0,updater_opacity_root_window_.loadOpacityUpdater)(engine);
|
|
461
|
-
await (0,updater_out_modes_root_window_.loadOutModesUpdater)(engine);
|
|
462
|
-
await (0,updater_size_root_window_.loadSizeUpdater)(engine);
|
|
463
|
-
await (0,updater_stroke_color_root_window_.loadStrokeColorUpdater)(engine);
|
|
464
|
-
await engine.addPreset("fireworks", options);
|
|
609
|
+
async function loadFireworksPreset(engine, refresh = true) {
|
|
610
|
+
await loadBasic(engine, false);
|
|
611
|
+
await (0,plugin_emitters_root_window_.loadEmittersPlugin)(engine, false);
|
|
612
|
+
await (0,plugin_sounds_root_window_.loadSoundsPlugin)(engine, false);
|
|
613
|
+
await (0,shape_line_root_window_.loadLineShape)(engine, false);
|
|
614
|
+
await loadRotateUpdater(engine, false);
|
|
615
|
+
await (0,updater_destroy_root_window_.loadDestroyUpdater)(engine, false);
|
|
616
|
+
await (0,updater_life_root_window_.loadLifeUpdater)(engine, false);
|
|
617
|
+
await (0,updater_stroke_color_root_window_.loadStrokeColorUpdater)(engine, false);
|
|
618
|
+
await engine.addPreset("fireworks", options, refresh);
|
|
465
619
|
}
|
|
466
620
|
})();
|
|
467
621
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see tsparticles.preset.fireworks.min.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/
|
|
2
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/move-base"),require("@tsparticles/shape-circle"),require("@tsparticles/updater-color"),require("@tsparticles/updater-opacity"),require("@tsparticles/updater-out-modes"),require("@tsparticles/updater-size"),require("@tsparticles/updater-destroy"),require("@tsparticles/plugin-emitters"),require("@tsparticles/updater-life"),require("@tsparticles/shape-line"),require("@tsparticles/engine"),require("@tsparticles/plugin-sounds"),require("@tsparticles/updater-stroke-color"));else if("function"==typeof define&&define.amd)define(["@tsparticles/move-base","@tsparticles/shape-circle","@tsparticles/updater-color","@tsparticles/updater-opacity","@tsparticles/updater-out-modes","@tsparticles/updater-size","@tsparticles/updater-destroy","@tsparticles/plugin-emitters","@tsparticles/updater-life","@tsparticles/shape-line","@tsparticles/engine","@tsparticles/plugin-sounds","@tsparticles/updater-stroke-color"],t);else{var a="object"==typeof exports?t(require("@tsparticles/move-base"),require("@tsparticles/shape-circle"),require("@tsparticles/updater-color"),require("@tsparticles/updater-opacity"),require("@tsparticles/updater-out-modes"),require("@tsparticles/updater-size"),require("@tsparticles/updater-destroy"),require("@tsparticles/plugin-emitters"),require("@tsparticles/updater-life"),require("@tsparticles/shape-line"),require("@tsparticles/engine"),require("@tsparticles/plugin-sounds"),require("@tsparticles/updater-stroke-color")):t(e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window);for(var i in a)("object"==typeof exports?exports:e)[i]=a[i]}}(this,((e,t,a,i,r,o,s,n,l,c,p,d,u)=>(()=>{"use strict";var m={533:e=>{e.exports=p},619:t=>{t.exports=e},68:e=>{e.exports=n},490:e=>{e.exports=d},163:e=>{e.exports=t},137:e=>{e.exports=c},501:e=>{e.exports=a},344:e=>{e.exports=s},84:e=>{e.exports=l},686:e=>{e.exports=i},290:e=>{e.exports=r},2:e=>{e.exports=o},204:e=>{e.exports=u}},y={};function f(e){var t=y[e];if(void 0!==t)return t.exports;var a=y[e]={exports:{}};return m[e](a,a.exports,f),a.exports}f.d=(e,t)=>{for(var a in t)f.o(t,a)&&!f.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},f.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),f.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var v={};return(()=>{f.r(v),f.d(v,{loadFireworksPreset:()=>x});var e=f(619),t=f(163),a=f(501),i=f(686),r=f(290),o=f(2);var s=f(344),n=f(68),l=f(84),c=f(137),p=f(533);class d{constructor(){this.enable=!1,this.speed=0,this.decay=0,this.sync=!1}load(e){e&&(void 0!==e.enable&&(this.enable=e.enable),void 0!==e.speed&&(this.speed=(0,p.setRangeValue)(e.speed)),void 0!==e.decay&&(this.decay=(0,p.setRangeValue)(e.decay)),void 0!==e.sync&&(this.sync=e.sync))}}class u extends p.ValueWithRandom{constructor(){super(),this.animation=new d,this.direction="clockwise",this.path=!1,this.value=0}load(e){e&&(super.load(e),void 0!==e.direction&&(this.direction=e.direction),this.animation.load(e.animation),void 0!==e.path&&(this.path=e.path))}}class m{constructor(e){this.container=e}init(e){const t=e.options.rotate;if(!t)return;e.rotate={enable:t.animation.enable,value:(0,p.getRangeValue)(t.value)*Math.PI/180},e.pathRotation=t.path;let a=t.direction;if("random"===a){a=Math.floor(2*(0,p.getRandom)())>0?"counter-clockwise":"clockwise"}switch(a){case"counter-clockwise":case"counterClockwise":e.rotate.status="decreasing";break;case"clockwise":e.rotate.status="increasing"}const i=t.animation;i.enable&&(e.rotate.decay=1-(0,p.getRangeValue)(i.decay),e.rotate.velocity=(0,p.getRangeValue)(i.speed)/360*this.container.retina.reduceFactor,i.sync||(e.rotate.velocity*=(0,p.getRandom)())),e.rotation=e.rotate.value}isEnabled(e){const t=e.options.rotate;return!!t&&(!e.destroyed&&!e.spawning&&t.animation.enable&&!t.path)}loadOptions(e,...t){e.rotate||(e.rotate=new u);for(const a of t)e.rotate.load(a?.rotate)}update(e,t){this.isEnabled(e)&&(!function(e,t){const a=e.rotate,i=e.options.rotate;if(!a||!i)return;const r=i.animation,o=(a.velocity??0)*t.factor,s=2*Math.PI,n=a.decay??1;r.enable&&("increasing"===a.status?(a.value+=o,a.value>s&&(a.value-=s)):(a.value-=o,a.value<0&&(a.value+=s)),a.velocity&&1!==n&&(a.velocity*=n))}(e,t),e.rotation=e.rotate?.value??0)}}var y=f(490),w=f(204);const h=(e,t,a)=>{const i=e.max>a?e.max-a:0;let r=(0,p.setRangeValue)(e);i&&(r=(0,p.setRangeValue)(e.min-i,a));const o=e.min<t?e.min:0;return o&&(r=(0,p.setRangeValue)(0,e.max+o)),r},g={detectRetina:!0,background:{color:"#000"},fpsLimit:120,emitters:{direction:"top",life:{count:0,duration:.1,delay:.1},rate:{delay:.05,quantity:1},size:{width:100,height:0},position:{y:100,x:50}},particles:{number:{value:0},destroy:{mode:"split",bounds:{top:{min:10,max:30}},split:{sizeOffset:!1,count:1,factor:{value:.333333},rate:{value:{min:75,max:150}},particles:["#ff595e","#ffca3a","#8ac926","#1982c4","#6a4c93"].map((e=>{const t=(0,p.stringToRgb)(e);if(!t)return;const a=(0,p.rgbToHsl)(t),i=h({min:a.s-30,max:a.s+30},0,100),r=h({min:a.l-30,max:a.l+30},0,100);return{color:{value:{h:a.h,s:i,l:r}},stroke:{width:0},number:{value:0},opacity:{value:{min:.1,max:1},animation:{enable:!0,speed:.7,sync:!1,startValue:"max",destroy:"min"}},shape:{type:"circle"},size:{value:{min:1,max:2},animation:{enable:!0,speed:5,count:1,sync:!1,startValue:"min",destroy:"none"}},life:{count:1,duration:{value:{min:1,max:2}}},move:{decay:{min:.075,max:.1},enable:!0,gravity:{enable:!0,inverse:!1,acceleration:5},speed:{min:5,max:15},direction:"none",outModes:"destroy"}}})).filter((e=>void 0!==e))}},life:{count:1},shape:{type:"line"},size:{value:{min:.1,max:50},animation:{enable:!0,sync:!0,speed:90,startValue:"max",destroy:"min"}},stroke:{color:{value:"#ffffff"},width:1},rotate:{path:!0},move:{enable:!0,gravity:{acceleration:15,enable:!0,inverse:!0,maxSpeed:100},speed:{min:10,max:20},outModes:{default:"destroy",top:"none"},trail:{fill:{color:"#000"},enable:!0,length:10}}},sounds:{enable:!0,events:[{event:"particleRemoved",filter:e=>"line"===e.data.particle.shape,audio:["https://particles.js.org/audio/explosion0.mp3","https://particles.js.org/audio/explosion1.mp3","https://particles.js.org/audio/explosion2.mp3"]}],volume:50}};async function x(p,d=!0){await async function(s,n=!0){await(0,e.loadBaseMover)(s,!1),await(0,t.loadCircleShape)(s,!1),await(0,a.loadColorUpdater)(s,!1),await(0,i.loadOpacityUpdater)(s,!1),await(0,r.loadOutModesUpdater)(s,!1),await(0,o.loadSizeUpdater)(s,!1),await s.refresh(n)}(p,!1),await(0,n.loadEmittersPlugin)(p,!1),await(0,y.loadSoundsPlugin)(p,!1),await(0,c.loadLineShape)(p,!1),await async function(e,t=!0){await e.addParticleUpdater("rotate",(e=>new m(e)),t)}(p,!1),await(0,s.loadDestroyUpdater)(p,!1),await(0,l.loadLifeUpdater)(p,!1),await(0,w.loadStrokeColorUpdater)(p,!1),await p.addPreset("fireworks",g,d)}})(),v})()));
|
|
@@ -1,8 +1 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Author : Matteo Bruni
|
|
3
|
-
* MIT license: https://opensource.org/licenses/MIT
|
|
4
|
-
* Demo / Generator : https://particles.js.org/
|
|
5
|
-
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
|
-
* How to use? : Check the GitHub README
|
|
7
|
-
* v3.0.0-alpha.1
|
|
8
|
-
*/
|
|
1
|
+
/*! tsParticles Fireworks Preset v3.0.0-beta.1 by Matteo Bruni */
|
package/types/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Engine } from "@tsparticles/engine";
|
|
2
|
-
export declare function loadFireworksPreset(engine: Engine): Promise<void>;
|
|
2
|
+
export declare function loadFireworksPreset(engine: Engine, refresh?: boolean): Promise<void>;
|
package/types/options.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ISourceOptions } from "@tsparticles/engine";
|
|
2
2
|
export declare const options: ISourceOptions;
|
package/umd/bundle.js
CHANGED
|
@@ -14,7 +14,5 @@
|
|
|
14
14
|
Object.defineProperty(exports, "loadFireworksPreset", { enumerable: true, get: function () { return _1.loadFireworksPreset; } });
|
|
15
15
|
const engine_1 = require("@tsparticles/engine");
|
|
16
16
|
Object.defineProperty(exports, "tsParticles", { enumerable: true, get: function () { return engine_1.tsParticles; } });
|
|
17
|
-
(
|
|
18
|
-
await (0, _1.loadFireworksPreset)(engine_1.tsParticles);
|
|
19
|
-
})();
|
|
17
|
+
(0, _1.loadFireworksPreset)(engine_1.tsParticles);
|
|
20
18
|
});
|
package/umd/index.js
CHANGED
|
@@ -4,41 +4,31 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "@tsparticles/
|
|
7
|
+
define(["require", "exports", "@tsparticles/basic", "@tsparticles/updater-destroy", "@tsparticles/plugin-emitters", "@tsparticles/updater-life", "@tsparticles/shape-line", "@tsparticles/updater-rotate", "@tsparticles/plugin-sounds", "@tsparticles/updater-stroke-color", "./options"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.loadFireworksPreset = void 0;
|
|
13
|
-
const
|
|
14
|
-
const move_base_1 = require("@tsparticles/move-base");
|
|
15
|
-
const shape_circle_1 = require("@tsparticles/shape-circle");
|
|
16
|
-
const updater_color_1 = require("@tsparticles/updater-color");
|
|
13
|
+
const basic_1 = require("@tsparticles/basic");
|
|
17
14
|
const updater_destroy_1 = require("@tsparticles/updater-destroy");
|
|
18
15
|
const plugin_emitters_1 = require("@tsparticles/plugin-emitters");
|
|
19
16
|
const updater_life_1 = require("@tsparticles/updater-life");
|
|
20
17
|
const shape_line_1 = require("@tsparticles/shape-line");
|
|
21
|
-
const
|
|
22
|
-
const updater_out_modes_1 = require("@tsparticles/updater-out-modes");
|
|
23
|
-
const updater_size_1 = require("@tsparticles/updater-size");
|
|
18
|
+
const updater_rotate_1 = require("@tsparticles/updater-rotate");
|
|
24
19
|
const plugin_sounds_1 = require("@tsparticles/plugin-sounds");
|
|
25
20
|
const updater_stroke_color_1 = require("@tsparticles/updater-stroke-color");
|
|
26
21
|
const options_1 = require("./options");
|
|
27
|
-
async function loadFireworksPreset(engine) {
|
|
28
|
-
await (0,
|
|
29
|
-
await (0, plugin_emitters_1.loadEmittersPlugin)(engine);
|
|
30
|
-
await (0, plugin_sounds_1.loadSoundsPlugin)(engine);
|
|
31
|
-
await (0,
|
|
32
|
-
await (0,
|
|
33
|
-
await (0,
|
|
34
|
-
await (0,
|
|
35
|
-
await (0,
|
|
36
|
-
await (
|
|
37
|
-
await (0, updater_opacity_1.loadOpacityUpdater)(engine);
|
|
38
|
-
await (0, updater_out_modes_1.loadOutModesUpdater)(engine);
|
|
39
|
-
await (0, updater_size_1.loadSizeUpdater)(engine);
|
|
40
|
-
await (0, updater_stroke_color_1.loadStrokeColorUpdater)(engine);
|
|
41
|
-
await engine.addPreset("fireworks", options_1.options);
|
|
22
|
+
async function loadFireworksPreset(engine, refresh = true) {
|
|
23
|
+
await (0, basic_1.loadBasic)(engine, false);
|
|
24
|
+
await (0, plugin_emitters_1.loadEmittersPlugin)(engine, false);
|
|
25
|
+
await (0, plugin_sounds_1.loadSoundsPlugin)(engine, false);
|
|
26
|
+
await (0, shape_line_1.loadLineShape)(engine, false);
|
|
27
|
+
await (0, updater_rotate_1.loadRotateUpdater)(engine, false);
|
|
28
|
+
await (0, updater_destroy_1.loadDestroyUpdater)(engine, false);
|
|
29
|
+
await (0, updater_life_1.loadLifeUpdater)(engine, false);
|
|
30
|
+
await (0, updater_stroke_color_1.loadStrokeColorUpdater)(engine, false);
|
|
31
|
+
await engine.addPreset("fireworks", options_1.options, refresh);
|
|
42
32
|
}
|
|
43
33
|
exports.loadFireworksPreset = loadFireworksPreset;
|
|
44
34
|
});
|