@tsparticles/preset-fireworks 3.1.0 → 4.0.0-alpha.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/125.min.js +2 -0
- package/125.min.js.LICENSE.txt +1 -0
- package/171.min.js +2 -0
- package/171.min.js.LICENSE.txt +1 -0
- package/213.min.js +2 -0
- package/213.min.js.LICENSE.txt +1 -0
- package/22.min.js +2 -0
- package/22.min.js.LICENSE.txt +1 -0
- package/226.min.js +2 -0
- package/226.min.js.LICENSE.txt +1 -0
- package/237.min.js +2 -0
- package/237.min.js.LICENSE.txt +1 -0
- package/264.min.js +2 -0
- package/264.min.js.LICENSE.txt +1 -0
- package/267.min.js +2 -0
- package/267.min.js.LICENSE.txt +1 -0
- package/280.min.js +2 -0
- package/280.min.js.LICENSE.txt +1 -0
- package/283.min.js +2 -0
- package/283.min.js.LICENSE.txt +1 -0
- package/301.min.js +2 -0
- package/301.min.js.LICENSE.txt +1 -0
- package/313.min.js +2 -0
- package/313.min.js.LICENSE.txt +1 -0
- package/319.min.js +2 -0
- package/319.min.js.LICENSE.txt +1 -0
- package/349.min.js +2 -0
- package/349.min.js.LICENSE.txt +1 -0
- package/389.min.js +2 -0
- package/389.min.js.LICENSE.txt +1 -0
- package/397.min.js +2 -0
- package/397.min.js.LICENSE.txt +1 -0
- package/418.min.js +2 -0
- package/418.min.js.LICENSE.txt +1 -0
- package/453.min.js +2 -0
- package/453.min.js.LICENSE.txt +1 -0
- package/455.min.js +2 -0
- package/455.min.js.LICENSE.txt +1 -0
- package/459.min.js +2 -0
- package/459.min.js.LICENSE.txt +1 -0
- package/477.min.js +2 -0
- package/477.min.js.LICENSE.txt +1 -0
- package/481.min.js +2 -0
- package/481.min.js.LICENSE.txt +1 -0
- package/488.min.js +2 -0
- package/488.min.js.LICENSE.txt +1 -0
- package/49.min.js +2 -0
- package/49.min.js.LICENSE.txt +1 -0
- package/509.min.js +2 -0
- package/509.min.js.LICENSE.txt +1 -0
- package/527.min.js +2 -0
- package/527.min.js.LICENSE.txt +1 -0
- package/541.min.js +2 -0
- package/541.min.js.LICENSE.txt +1 -0
- package/597.min.js +2 -0
- package/597.min.js.LICENSE.txt +1 -0
- package/633.min.js +2 -0
- package/633.min.js.LICENSE.txt +1 -0
- package/637.min.js +2 -0
- package/637.min.js.LICENSE.txt +1 -0
- package/669.min.js +2 -0
- package/669.min.js.LICENSE.txt +1 -0
- package/751.min.js +2 -0
- package/751.min.js.LICENSE.txt +1 -0
- package/802.min.js +2 -0
- package/802.min.js.LICENSE.txt +1 -0
- package/803.min.js +2 -0
- package/803.min.js.LICENSE.txt +1 -0
- package/819.min.js +2 -0
- package/819.min.js.LICENSE.txt +1 -0
- package/829.min.js +2 -0
- package/829.min.js.LICENSE.txt +1 -0
- package/890.min.js +2 -0
- package/890.min.js.LICENSE.txt +1 -0
- package/908.min.js +2 -0
- package/908.min.js.LICENSE.txt +1 -0
- package/926.min.js +2 -0
- package/926.min.js.LICENSE.txt +1 -0
- package/98.min.js +2 -0
- package/98.min.js.LICENSE.txt +1 -0
- package/README.md +1 -1
- package/browser/bundle.js +2 -3
- package/browser/index.js +18 -22
- package/browser/options.js +254 -187
- package/cjs/bundle.js +2 -7
- package/cjs/index.js +18 -26
- package/cjs/options.js +254 -190
- package/dist_browser_options_js.js +30 -0
- package/esm/bundle.js +2 -3
- package/esm/index.js +18 -22
- package/esm/options.js +254 -187
- package/node_modules_pnpm_tsparticles_basic_4_0_0-alpha_2_node_modules_tsparticles_basic_browser_index_js.js +30 -0
- package/node_modules_pnpm_tsparticles_effect-trail_4_0_0-alpha_2_node_modules_tsparticles_effect-trai-3395e5.js +30 -0
- package/node_modules_pnpm_tsparticles_effect-trail_4_0_0-alpha_2_node_modules_tsparticles_effect-trai-8c7216.js +30 -0
- package/node_modules_pnpm_tsparticles_move-base_4_0_0-alpha_2_node_modules_tsparticles_move-base_brow-7d79eb.js +40 -0
- package/node_modules_pnpm_tsparticles_move-base_4_0_0-alpha_2_node_modules_tsparticles_move-base_brow-fb148a.js +30 -0
- package/node_modules_pnpm_tsparticles_plugin-emitters-shape-square_4_0_0-alpha_2_node_modules_tsparti-cafd8c.js +30 -0
- package/node_modules_pnpm_tsparticles_plugin-emitters-shape-square_4_0_0-alpha_2_node_modules_tsparti-cf2f58.js +70 -0
- package/node_modules_pnpm_tsparticles_plugin-emitters_4_0_0-alpha_2_node_modules_tsparticles_plugin-e-122a51.js +30 -0
- package/node_modules_pnpm_tsparticles_plugin-emitters_4_0_0-alpha_2_node_modules_tsparticles_plugin-e-6bd6f8.js +50 -0
- package/node_modules_pnpm_tsparticles_plugin-hex-color_4_0_0-alpha_2_node_modules_tsparticles_plugin--91288b.js +30 -0
- package/node_modules_pnpm_tsparticles_plugin-hex-color_4_0_0-alpha_2_node_modules_tsparticles_plugin--d06b2a.js +30 -0
- package/node_modules_pnpm_tsparticles_plugin-hsl-color_4_0_0-alpha_2_node_modules_tsparticles_plugin--70976c.js +30 -0
- package/node_modules_pnpm_tsparticles_plugin-hsl-color_4_0_0-alpha_2_node_modules_tsparticles_plugin--e141e9.js +30 -0
- package/node_modules_pnpm_tsparticles_plugin-rgb-color_4_0_0-alpha_2_node_modules_tsparticles_plugin--60c9df.js +30 -0
- package/node_modules_pnpm_tsparticles_plugin-rgb-color_4_0_0-alpha_2_node_modules_tsparticles_plugin--732407.js +30 -0
- package/node_modules_pnpm_tsparticles_plugin-sounds_4_0_0-alpha_2_node_modules_tsparticles_plugin-sou-6e6a34.js +30 -0
- package/node_modules_pnpm_tsparticles_shape-circle_4_0_0-alpha_2_node_modules_tsparticles_shape-circl-c98489.js +40 -0
- package/node_modules_pnpm_tsparticles_shape-circle_4_0_0-alpha_2_node_modules_tsparticles_shape-circl-ce96e8.js +30 -0
- package/node_modules_pnpm_tsparticles_shape-line_4_0_0-alpha_2_node_modules_tsparticles_shape-line_br-01d607.js +30 -0
- package/node_modules_pnpm_tsparticles_shape-line_4_0_0-alpha_2_node_modules_tsparticles_shape-line_br-eb7b65.js +40 -0
- package/node_modules_pnpm_tsparticles_updater-color_4_0_0-alpha_2_node_modules_tsparticles_updater-co-210bd6.js +30 -0
- package/node_modules_pnpm_tsparticles_updater-color_4_0_0-alpha_2_node_modules_tsparticles_updater-co-6ff909.js +30 -0
- package/node_modules_pnpm_tsparticles_updater-destroy_4_0_0-alpha_2_node_modules_tsparticles_updater--cef2d9.js +100 -0
- package/node_modules_pnpm_tsparticles_updater-destroy_4_0_0-alpha_2_node_modules_tsparticles_updater--f71d4c.js +30 -0
- package/node_modules_pnpm_tsparticles_updater-life_4_0_0-alpha_2_node_modules_tsparticles_updater-lif-50f821.js +30 -0
- package/node_modules_pnpm_tsparticles_updater-life_4_0_0-alpha_2_node_modules_tsparticles_updater-lif-dbf90f.js +70 -0
- package/node_modules_pnpm_tsparticles_updater-opacity_4_0_0-alpha_2_node_modules_tsparticles_updater--4e8c57.js +30 -0
- package/node_modules_pnpm_tsparticles_updater-opacity_4_0_0-alpha_2_node_modules_tsparticles_updater--ac14ff.js +30 -0
- package/node_modules_pnpm_tsparticles_updater-out-modes_4_0_0-alpha_2_node_modules_tsparticles_update-cd317f.js +30 -0
- package/node_modules_pnpm_tsparticles_updater-rotate_4_0_0-alpha_2_node_modules_tsparticles_updater-r-0de212.js +30 -0
- package/node_modules_pnpm_tsparticles_updater-rotate_4_0_0-alpha_2_node_modules_tsparticles_updater-r-e97427.js +50 -0
- package/node_modules_pnpm_tsparticles_updater-size_4_0_0-alpha_2_node_modules_tsparticles_updater-siz-53e0fe.js +30 -0
- package/node_modules_pnpm_tsparticles_updater-size_4_0_0-alpha_2_node_modules_tsparticles_updater-siz-aaa117.js +30 -0
- package/node_modules_pnpm_tsparticles_updater-stroke-color_4_0_0-alpha_2_node_modules_tsparticles_upd-74b323.js +30 -0
- package/node_modules_pnpm_tsparticles_updater-stroke-color_4_0_0-alpha_2_node_modules_tsparticles_upd-ca004c.js +30 -0
- package/package.json +30 -13
- package/report.html +5 -4
- package/tsparticles.preset.fireworks.bundle.js +770 -2539
- package/tsparticles.preset.fireworks.bundle.min.js +1 -1
- package/tsparticles.preset.fireworks.bundle.min.js.LICENSE.txt +1 -1
- package/tsparticles.preset.fireworks.js +306 -57
- package/tsparticles.preset.fireworks.min.js +1 -1
- package/tsparticles.preset.fireworks.min.js.LICENSE.txt +1 -1
- package/types/bundle.d.ts +2 -3
- package/types/index.d.ts +1 -1
- package/types/options.d.ts +2 -1
- package/umd/bundle.js +2 -2
- package/umd/index.js +54 -25
- package/umd/options.js +255 -187
- package/vendors-node_modules_pnpm_tsparticles_engine_4_0_0-alpha_2_node_modules_tsparticles_engine_br-9c0a0f.js +100 -0
- package/vendors-node_modules_pnpm_tsparticles_plugin-emitters_4_0_0-alpha_2_node_modules_tsparticles_-1e60b5.js +110 -0
- package/vendors-node_modules_pnpm_tsparticles_plugin-sounds_4_0_0-alpha_2_node_modules_tsparticles_pl-a36589.js +140 -0
- package/vendors-node_modules_pnpm_tsparticles_updater-out-modes_4_0_0-alpha_2_node_modules_tsparticle-124574.js +80 -0
package/browser/index.js
CHANGED
|
@@ -1,23 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { loadEmittersPlugin }
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
await loadLifeUpdater(engine, false);
|
|
20
|
-
await loadStrokeColorUpdater(engine, false);
|
|
21
|
-
await engine.addPreset("fireworks", options, false);
|
|
22
|
-
await engine.refresh(refresh);
|
|
1
|
+
export function loadFireworksPreset(engine) {
|
|
2
|
+
engine.register(async (e) => {
|
|
3
|
+
const { loadBasic } = await import("@tsparticles/basic"), { loadEmittersPlugin } = await import("@tsparticles/plugin-emitters"), { loadTrailEffect } = await import("@tsparticles/effect-trail"), { loadEmittersShapeSquare } = await import("@tsparticles/plugin-emitters-shape-square"), { loadHexColorPlugin } = await import("@tsparticles/plugin-hex-color"), { loadHslColorPlugin } = await import("@tsparticles/plugin-hsl-color"), { loadRgbColorPlugin } = await import("@tsparticles/plugin-rgb-color"), { loadSoundsPlugin } = await import("@tsparticles/plugin-sounds"), { loadLineShape } = await import("@tsparticles/shape-line"), { loadRotateUpdater } = await import("@tsparticles/updater-rotate"), { loadDestroyUpdater } = await import("@tsparticles/updater-destroy"), { loadLifeUpdater } = await import("@tsparticles/updater-life"), { loadStrokeColorUpdater } = await import("@tsparticles/updater-stroke-color"), { initOptions, presetName } = await import("./options.js");
|
|
4
|
+
loadBasic(e);
|
|
5
|
+
loadHexColorPlugin(e);
|
|
6
|
+
loadHslColorPlugin(e);
|
|
7
|
+
loadRgbColorPlugin(e);
|
|
8
|
+
loadEmittersPlugin(e);
|
|
9
|
+
loadTrailEffect(e);
|
|
10
|
+
loadEmittersShapeSquare(e);
|
|
11
|
+
loadSoundsPlugin(e);
|
|
12
|
+
loadLineShape(e);
|
|
13
|
+
loadRotateUpdater(e);
|
|
14
|
+
loadDestroyUpdater(e);
|
|
15
|
+
loadLifeUpdater(e);
|
|
16
|
+
loadStrokeColorUpdater(e);
|
|
17
|
+
e.addPreset(presetName, initOptions(), false);
|
|
18
|
+
});
|
|
23
19
|
}
|
package/browser/options.js
CHANGED
|
@@ -1,211 +1,278 @@
|
|
|
1
|
-
import { DestroyType, EventType, MoveDirection, OutMode, StartValueType, rgbToHsl, setRangeValue,
|
|
2
|
-
const
|
|
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
|
-
|
|
1
|
+
import { DestroyType, EventType, MoveDirection, OutMode, StartValueType, defaultAlpha, getLogger, none, rgbToHsl, setRangeValue, } from "@tsparticles/engine";
|
|
2
|
+
export const presetName = "fireworks";
|
|
3
|
+
export function initOptions() {
|
|
4
|
+
const explodeSoundCheck = (args) => {
|
|
5
|
+
const data = args.data;
|
|
6
|
+
return data.particle.options.move.gravity.inverse;
|
|
7
|
+
}, fixRange = (value, min, max) => {
|
|
8
|
+
const minValue = 0, diffSMax = value.max > max ? value.max - max : minValue;
|
|
9
|
+
let res = setRangeValue(value);
|
|
10
|
+
if (diffSMax) {
|
|
11
|
+
res = setRangeValue(value.min - diffSMax, max);
|
|
12
|
+
}
|
|
13
|
+
const diffSMin = value.min < min ? value.min : minValue;
|
|
14
|
+
if (diffSMin) {
|
|
15
|
+
res = setRangeValue(minValue, value.max + diffSMin);
|
|
16
|
+
}
|
|
17
|
+
return res;
|
|
18
|
+
}, hexToRgba = (hex) => {
|
|
19
|
+
let hexValue = hex;
|
|
20
|
+
const shortRegex = /^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i;
|
|
21
|
+
if (shortRegex.test(hexValue)) {
|
|
22
|
+
hexValue = hexValue.replace(shortRegex, (_m, r, g, b, a) => r + r + g + g + b + b + (a ? a + a : ""));
|
|
23
|
+
}
|
|
24
|
+
const regex = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i, result = regex.exec(hexValue);
|
|
25
|
+
if (!result) {
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
result.shift();
|
|
29
|
+
const indexes = {
|
|
30
|
+
a: 3,
|
|
31
|
+
b: 2,
|
|
32
|
+
g: 1,
|
|
33
|
+
r: 0,
|
|
34
|
+
}, values = {
|
|
35
|
+
a: result[indexes.a],
|
|
36
|
+
b: result[indexes.b],
|
|
37
|
+
g: result[indexes.g],
|
|
38
|
+
r: result[indexes.r],
|
|
39
|
+
}, hexRadix = 16;
|
|
40
|
+
return {
|
|
41
|
+
r: values.r ? Number.parseInt(values.r, hexRadix) : none,
|
|
42
|
+
g: values.g ? Number.parseInt(values.g, hexRadix) : none,
|
|
43
|
+
b: values.b ? Number.parseInt(values.b, hexRadix) : none,
|
|
44
|
+
a: values.a ? Number.parseInt(values.a, hexRadix) : defaultAlpha,
|
|
45
|
+
};
|
|
46
|
+
}, fireworksOptions = [
|
|
47
|
+
"#FF0000",
|
|
48
|
+
"#FF2A00",
|
|
49
|
+
"#FF5500",
|
|
50
|
+
"#FF8000",
|
|
51
|
+
"#FFAA00",
|
|
52
|
+
"#FFD400",
|
|
53
|
+
"#FFFF00",
|
|
54
|
+
"#D4FF00",
|
|
55
|
+
"#AAFF00",
|
|
56
|
+
"#80FF00",
|
|
57
|
+
"#55FF00",
|
|
58
|
+
"#2AFF00",
|
|
59
|
+
"#00FF00",
|
|
60
|
+
"#00FF2A",
|
|
61
|
+
"#00FF55",
|
|
62
|
+
"#00FF80",
|
|
63
|
+
"#00FFAA",
|
|
64
|
+
"#00FFD4",
|
|
65
|
+
"#00FFFF",
|
|
66
|
+
"#00D4FF",
|
|
67
|
+
"#00AAFF",
|
|
68
|
+
"#0080FF",
|
|
69
|
+
"#0055FF",
|
|
70
|
+
"#002AFF",
|
|
71
|
+
"#0000FF",
|
|
72
|
+
"#2A00FF",
|
|
73
|
+
"#5500FF",
|
|
74
|
+
"#8000FF",
|
|
75
|
+
"#AA00FF",
|
|
76
|
+
"#D400FF",
|
|
77
|
+
"#FF00FF",
|
|
78
|
+
"#FF00D4",
|
|
79
|
+
"#FF00AA",
|
|
80
|
+
"#FF0080",
|
|
81
|
+
"#FF0055",
|
|
82
|
+
"#FF002A",
|
|
83
|
+
]
|
|
84
|
+
.map(color => {
|
|
85
|
+
const rgb = hexToRgba(color);
|
|
86
|
+
if (!rgb) {
|
|
87
|
+
getLogger().log("color not found", color);
|
|
88
|
+
return undefined;
|
|
89
|
+
}
|
|
90
|
+
const hsl = rgbToHsl(rgb), sOffset = 30, lOffset = 30, sBounds = {
|
|
91
|
+
min: 0,
|
|
92
|
+
max: 100,
|
|
93
|
+
}, lBounds = {
|
|
94
|
+
min: 0,
|
|
95
|
+
max: 100,
|
|
96
|
+
}, sRange = fixRange({ min: hsl.s - sOffset, max: hsl.s + sOffset }, sBounds.min, sBounds.max), lRange = fixRange({ min: hsl.l - lOffset, max: hsl.l + lOffset }, lBounds.min, lBounds.max);
|
|
97
|
+
getLogger().log(hsl.h, sRange, lRange);
|
|
98
|
+
return {
|
|
99
|
+
color: {
|
|
100
|
+
value: {
|
|
101
|
+
h: hsl.h,
|
|
102
|
+
s: sRange,
|
|
103
|
+
l: lRange,
|
|
104
|
+
},
|
|
49
105
|
},
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
speed: 0.7,
|
|
53
|
-
sync: false,
|
|
54
|
-
startValue: StartValueType.max,
|
|
55
|
-
destroy: DestroyType.min,
|
|
106
|
+
stroke: {
|
|
107
|
+
width: 0,
|
|
56
108
|
},
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
type: "circle",
|
|
60
|
-
},
|
|
61
|
-
size: {
|
|
62
|
-
value: { min: 1, max: 2 },
|
|
63
|
-
animation: {
|
|
64
|
-
enable: true,
|
|
65
|
-
speed: 5,
|
|
66
|
-
count: 1,
|
|
67
|
-
sync: false,
|
|
68
|
-
startValue: StartValueType.min,
|
|
69
|
-
destroy: DestroyType.none,
|
|
109
|
+
number: {
|
|
110
|
+
value: 0,
|
|
70
111
|
},
|
|
71
|
-
|
|
72
|
-
life: {
|
|
73
|
-
count: 1,
|
|
74
|
-
duration: {
|
|
112
|
+
opacity: {
|
|
75
113
|
value: {
|
|
76
|
-
min: 1,
|
|
77
|
-
max:
|
|
114
|
+
min: 0.1,
|
|
115
|
+
max: 1,
|
|
116
|
+
},
|
|
117
|
+
animation: {
|
|
118
|
+
enable: true,
|
|
119
|
+
speed: 0.7,
|
|
120
|
+
sync: false,
|
|
121
|
+
startValue: StartValueType.max,
|
|
122
|
+
destroy: DestroyType.min,
|
|
78
123
|
},
|
|
79
124
|
},
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
decay: { min: 0.075, max: 0.1 },
|
|
83
|
-
enable: true,
|
|
84
|
-
gravity: {
|
|
85
|
-
enable: true,
|
|
86
|
-
inverse: false,
|
|
87
|
-
acceleration: 5,
|
|
125
|
+
shape: {
|
|
126
|
+
type: "circle",
|
|
88
127
|
},
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
delay: 0.05,
|
|
111
|
-
quantity: 1,
|
|
112
|
-
},
|
|
113
|
-
size: {
|
|
114
|
-
width: 100,
|
|
115
|
-
height: 0,
|
|
116
|
-
},
|
|
117
|
-
position: {
|
|
118
|
-
y: 100,
|
|
119
|
-
x: 50,
|
|
120
|
-
},
|
|
121
|
-
},
|
|
122
|
-
particles: {
|
|
123
|
-
number: {
|
|
124
|
-
value: 0,
|
|
125
|
-
},
|
|
126
|
-
destroy: {
|
|
127
|
-
mode: "split",
|
|
128
|
-
bounds: {
|
|
129
|
-
top: { min: 10, max: 30 },
|
|
128
|
+
effect: {
|
|
129
|
+
type: "trail",
|
|
130
|
+
options: {
|
|
131
|
+
trail: {
|
|
132
|
+
length: {
|
|
133
|
+
min: 5,
|
|
134
|
+
max: 10,
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
size: {
|
|
140
|
+
value: { min: 1, max: 2 },
|
|
141
|
+
animation: {
|
|
142
|
+
enable: true,
|
|
143
|
+
speed: 5,
|
|
144
|
+
count: 1,
|
|
145
|
+
sync: false,
|
|
146
|
+
startValue: StartValueType.min,
|
|
147
|
+
destroy: DestroyType.none,
|
|
148
|
+
},
|
|
130
149
|
},
|
|
131
|
-
|
|
132
|
-
sizeOffset: false,
|
|
150
|
+
life: {
|
|
133
151
|
count: 1,
|
|
134
|
-
|
|
135
|
-
value:
|
|
152
|
+
duration: {
|
|
153
|
+
value: {
|
|
154
|
+
min: 1,
|
|
155
|
+
max: 2,
|
|
156
|
+
},
|
|
136
157
|
},
|
|
137
|
-
|
|
138
|
-
|
|
158
|
+
},
|
|
159
|
+
move: {
|
|
160
|
+
decay: { min: 0.075, max: 0.1 },
|
|
161
|
+
enable: true,
|
|
162
|
+
gravity: {
|
|
163
|
+
enable: true,
|
|
164
|
+
inverse: false,
|
|
165
|
+
acceleration: 5,
|
|
139
166
|
},
|
|
140
|
-
|
|
167
|
+
speed: { min: 5, max: 15 },
|
|
168
|
+
direction: "none",
|
|
169
|
+
outModes: OutMode.destroy,
|
|
141
170
|
},
|
|
171
|
+
};
|
|
172
|
+
})
|
|
173
|
+
.filter(t => t !== undefined);
|
|
174
|
+
return {
|
|
175
|
+
detectRetina: true,
|
|
176
|
+
background: {
|
|
177
|
+
color: "#000",
|
|
142
178
|
},
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
size: {
|
|
150
|
-
value: {
|
|
151
|
-
min: 0.1,
|
|
152
|
-
max: 50,
|
|
179
|
+
fpsLimit: 120,
|
|
180
|
+
emitters: {
|
|
181
|
+
direction: MoveDirection.top,
|
|
182
|
+
rate: {
|
|
183
|
+
delay: 0.3,
|
|
184
|
+
quantity: 1,
|
|
153
185
|
},
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
speed: 90,
|
|
158
|
-
startValue: StartValueType.max,
|
|
159
|
-
destroy: DestroyType.min,
|
|
186
|
+
size: {
|
|
187
|
+
width: 100,
|
|
188
|
+
height: 0,
|
|
160
189
|
},
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
value: "#ffffff",
|
|
190
|
+
position: {
|
|
191
|
+
y: 100,
|
|
192
|
+
x: 50,
|
|
165
193
|
},
|
|
166
|
-
width: 1,
|
|
167
194
|
},
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
move: {
|
|
172
|
-
enable: true,
|
|
173
|
-
gravity: {
|
|
174
|
-
acceleration: 15,
|
|
175
|
-
enable: true,
|
|
176
|
-
inverse: true,
|
|
177
|
-
maxSpeed: 100,
|
|
195
|
+
particles: {
|
|
196
|
+
number: {
|
|
197
|
+
value: 0,
|
|
178
198
|
},
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
199
|
+
destroy: {
|
|
200
|
+
mode: "split",
|
|
201
|
+
bounds: {
|
|
202
|
+
top: { min: 15, max: 35 },
|
|
203
|
+
},
|
|
204
|
+
split: {
|
|
205
|
+
sizeOffset: false,
|
|
206
|
+
count: 1,
|
|
207
|
+
factor: {
|
|
208
|
+
value: 0.333333,
|
|
209
|
+
},
|
|
210
|
+
rate: {
|
|
211
|
+
value: { min: 75, max: 150 },
|
|
212
|
+
},
|
|
213
|
+
particles: fireworksOptions,
|
|
214
|
+
},
|
|
182
215
|
},
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
216
|
+
life: {
|
|
217
|
+
count: 1,
|
|
218
|
+
},
|
|
219
|
+
shape: {
|
|
220
|
+
type: "circle",
|
|
186
221
|
},
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
222
|
+
effect: {
|
|
223
|
+
type: "trail",
|
|
224
|
+
options: {
|
|
225
|
+
trail: {
|
|
226
|
+
length: {
|
|
227
|
+
min: 5,
|
|
228
|
+
max: 15,
|
|
229
|
+
},
|
|
230
|
+
minWidth: 1,
|
|
231
|
+
maxWidth: 1,
|
|
232
|
+
},
|
|
190
233
|
},
|
|
234
|
+
},
|
|
235
|
+
size: {
|
|
236
|
+
value: 1,
|
|
237
|
+
},
|
|
238
|
+
stroke: {
|
|
239
|
+
color: {
|
|
240
|
+
value: "#ffffff",
|
|
241
|
+
},
|
|
242
|
+
width: 1,
|
|
243
|
+
},
|
|
244
|
+
move: {
|
|
191
245
|
enable: true,
|
|
192
|
-
|
|
246
|
+
gravity: {
|
|
247
|
+
acceleration: 15,
|
|
248
|
+
enable: true,
|
|
249
|
+
inverse: true,
|
|
250
|
+
maxSpeed: 100,
|
|
251
|
+
},
|
|
252
|
+
speed: {
|
|
253
|
+
min: 10,
|
|
254
|
+
max: 20,
|
|
255
|
+
},
|
|
256
|
+
outModes: {
|
|
257
|
+
default: OutMode.destroy,
|
|
258
|
+
top: OutMode.none,
|
|
259
|
+
},
|
|
193
260
|
},
|
|
194
261
|
},
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
}
|
|
211
|
-
}
|
|
262
|
+
sounds: {
|
|
263
|
+
enable: true,
|
|
264
|
+
events: [
|
|
265
|
+
{
|
|
266
|
+
event: EventType.particleRemoved,
|
|
267
|
+
filter: explodeSoundCheck,
|
|
268
|
+
audio: [
|
|
269
|
+
"https://particles.js.org/audio/explosion0.mp3",
|
|
270
|
+
"https://particles.js.org/audio/explosion1.mp3",
|
|
271
|
+
"https://particles.js.org/audio/explosion2.mp3",
|
|
272
|
+
],
|
|
273
|
+
},
|
|
274
|
+
],
|
|
275
|
+
volume: 50,
|
|
276
|
+
},
|
|
277
|
+
};
|
|
278
|
+
}
|
package/cjs/bundle.js
CHANGED
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.tsParticles = exports.loadFireworksPreset = void 0;
|
|
4
|
-
const index_js_1 = require("./index.js");
|
|
5
|
-
Object.defineProperty(exports, "loadFireworksPreset", { enumerable: true, get: function () { return index_js_1.loadFireworksPreset; } });
|
|
6
|
-
const engine_1 = require("@tsparticles/engine");
|
|
7
|
-
Object.defineProperty(exports, "tsParticles", { enumerable: true, get: function () { return engine_1.tsParticles; } });
|
|
1
|
+
export { loadFireworksPreset } from "./index.js";
|
|
2
|
+
export { tsParticles } from "@tsparticles/engine";
|
package/cjs/index.js
CHANGED
|
@@ -1,27 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
await (0, shape_line_1.loadLineShape)(engine, false);
|
|
20
|
-
await (0, updater_rotate_1.loadRotateUpdater)(engine, false);
|
|
21
|
-
await (0, updater_destroy_1.loadDestroyUpdater)(engine, false);
|
|
22
|
-
await (0, updater_life_1.loadLifeUpdater)(engine, false);
|
|
23
|
-
await (0, updater_stroke_color_1.loadStrokeColorUpdater)(engine, false);
|
|
24
|
-
await engine.addPreset("fireworks", options_js_1.options, false);
|
|
25
|
-
await engine.refresh(refresh);
|
|
1
|
+
export function loadFireworksPreset(engine) {
|
|
2
|
+
engine.register(async (e) => {
|
|
3
|
+
const { loadBasic } = await import("@tsparticles/basic"), { loadEmittersPlugin } = await import("@tsparticles/plugin-emitters"), { loadTrailEffect } = await import("@tsparticles/effect-trail"), { loadEmittersShapeSquare } = await import("@tsparticles/plugin-emitters-shape-square"), { loadHexColorPlugin } = await import("@tsparticles/plugin-hex-color"), { loadHslColorPlugin } = await import("@tsparticles/plugin-hsl-color"), { loadRgbColorPlugin } = await import("@tsparticles/plugin-rgb-color"), { loadSoundsPlugin } = await import("@tsparticles/plugin-sounds"), { loadLineShape } = await import("@tsparticles/shape-line"), { loadRotateUpdater } = await import("@tsparticles/updater-rotate"), { loadDestroyUpdater } = await import("@tsparticles/updater-destroy"), { loadLifeUpdater } = await import("@tsparticles/updater-life"), { loadStrokeColorUpdater } = await import("@tsparticles/updater-stroke-color"), { initOptions, presetName } = await import("./options.js");
|
|
4
|
+
loadBasic(e);
|
|
5
|
+
loadHexColorPlugin(e);
|
|
6
|
+
loadHslColorPlugin(e);
|
|
7
|
+
loadRgbColorPlugin(e);
|
|
8
|
+
loadEmittersPlugin(e);
|
|
9
|
+
loadTrailEffect(e);
|
|
10
|
+
loadEmittersShapeSquare(e);
|
|
11
|
+
loadSoundsPlugin(e);
|
|
12
|
+
loadLineShape(e);
|
|
13
|
+
loadRotateUpdater(e);
|
|
14
|
+
loadDestroyUpdater(e);
|
|
15
|
+
loadLifeUpdater(e);
|
|
16
|
+
loadStrokeColorUpdater(e);
|
|
17
|
+
e.addPreset(presetName, initOptions(), false);
|
|
18
|
+
});
|
|
26
19
|
}
|
|
27
|
-
exports.loadFireworksPreset = loadFireworksPreset;
|