@tsparticles/confetti 3.3.0 → 3.4.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/browser/confetti.js +65 -2
- package/cjs/confetti.js +80 -17
- package/esm/confetti.js +65 -2
- package/package.json +17 -17
- package/report.html +1 -1
- package/tsparticles.confetti.bundle.js +1214 -302
- package/tsparticles.confetti.bundle.min.js +1 -1
- package/tsparticles.confetti.bundle.min.js.LICENSE.txt +1 -1
- package/tsparticles.confetti.js +6 -36
- package/tsparticles.confetti.min.js +1 -1
- package/tsparticles.confetti.min.js.LICENSE.txt +1 -1
- package/types/confetti.d.ts +2 -0
- package/umd/confetti.js +81 -42
- package/2043.min.js +0 -2
- package/2043.min.js.LICENSE.txt +0 -1
- package/2112.min.js +0 -2
- package/2112.min.js.LICENSE.txt +0 -1
- package/2136.min.js +0 -2
- package/2136.min.js.LICENSE.txt +0 -1
- package/2284.min.js +0 -2
- package/2284.min.js.LICENSE.txt +0 -1
- package/2370.min.js +0 -2
- package/2370.min.js.LICENSE.txt +0 -1
- package/2497.min.js +0 -2
- package/2497.min.js.LICENSE.txt +0 -1
- package/286.min.js +0 -2
- package/286.min.js.LICENSE.txt +0 -1
- package/3237.min.js +0 -2
- package/3237.min.js.LICENSE.txt +0 -1
- package/335.min.js +0 -2
- package/335.min.js.LICENSE.txt +0 -1
- package/3416.min.js +0 -2
- package/3416.min.js.LICENSE.txt +0 -1
- package/344.min.js +0 -2
- package/344.min.js.LICENSE.txt +0 -1
- package/357.min.js +0 -2
- package/357.min.js.LICENSE.txt +0 -1
- package/3622.min.js +0 -2
- package/3622.min.js.LICENSE.txt +0 -1
- package/3632.min.js +0 -2
- package/3632.min.js.LICENSE.txt +0 -1
- package/3695.min.js +0 -2
- package/3695.min.js.LICENSE.txt +0 -1
- package/401.min.js +0 -2
- package/401.min.js.LICENSE.txt +0 -1
- package/4036.min.js +0 -2
- package/4036.min.js.LICENSE.txt +0 -1
- package/4154.min.js +0 -2
- package/4154.min.js.LICENSE.txt +0 -1
- package/4264.min.js +0 -2
- package/4264.min.js.LICENSE.txt +0 -1
- package/4302.min.js +0 -2
- package/4302.min.js.LICENSE.txt +0 -1
- package/439.min.js +0 -2
- package/439.min.js.LICENSE.txt +0 -1
- package/449.min.js +0 -2
- package/449.min.js.LICENSE.txt +0 -1
- package/4512.min.js +0 -2
- package/4512.min.js.LICENSE.txt +0 -1
- package/4924.min.js +0 -2
- package/4924.min.js.LICENSE.txt +0 -1
- package/5201.min.js +0 -2
- package/5201.min.js.LICENSE.txt +0 -1
- package/5369.min.js +0 -2
- package/5369.min.js.LICENSE.txt +0 -1
- package/561.min.js +0 -2
- package/561.min.js.LICENSE.txt +0 -1
- package/5775.min.js +0 -2
- package/5775.min.js.LICENSE.txt +0 -1
- package/5808.min.js +0 -2
- package/5808.min.js.LICENSE.txt +0 -1
- package/5814.min.js +0 -2
- package/5814.min.js.LICENSE.txt +0 -1
- package/6119.min.js +0 -2
- package/6119.min.js.LICENSE.txt +0 -1
- package/6493.min.js +0 -2
- package/6493.min.js.LICENSE.txt +0 -1
- package/6520.min.js +0 -2
- package/6520.min.js.LICENSE.txt +0 -1
- package/66.min.js +0 -2
- package/66.min.js.LICENSE.txt +0 -1
- package/6732.min.js +0 -2
- package/6732.min.js.LICENSE.txt +0 -1
- package/6735.min.js +0 -2
- package/6735.min.js.LICENSE.txt +0 -1
- package/6974.min.js +0 -2
- package/6974.min.js.LICENSE.txt +0 -1
- package/705.min.js +0 -2
- package/705.min.js.LICENSE.txt +0 -1
- package/7306.min.js +0 -2
- package/7306.min.js.LICENSE.txt +0 -1
- package/7528.min.js +0 -2
- package/7528.min.js.LICENSE.txt +0 -1
- package/7774.min.js +0 -2
- package/7774.min.js.LICENSE.txt +0 -1
- package/8125.min.js +0 -2
- package/8125.min.js.LICENSE.txt +0 -1
- package/8155.min.js +0 -2
- package/8155.min.js.LICENSE.txt +0 -1
- package/823.min.js +0 -2
- package/823.min.js.LICENSE.txt +0 -1
- package/8469.min.js +0 -2
- package/8469.min.js.LICENSE.txt +0 -1
- package/8656.min.js +0 -2
- package/8656.min.js.LICENSE.txt +0 -1
- package/8746.min.js +0 -2
- package/8746.min.js.LICENSE.txt +0 -1
- package/9151.min.js +0 -2
- package/9151.min.js.LICENSE.txt +0 -1
- package/94.min.js +0 -2
- package/94.min.js.LICENSE.txt +0 -1
- package/9487.min.js +0 -2
- package/9487.min.js.LICENSE.txt +0 -1
- package/9581.min.js +0 -2
- package/9581.min.js.LICENSE.txt +0 -1
- package/9946.min.js +0 -2
- package/9946.min.js.LICENSE.txt +0 -1
- package/basic_dist_browser_index_js.js +0 -30
- package/engine_dist_browser_Core_Container_js.js +0 -100
- package/move_base_dist_browser_BaseMover_js.js +0 -40
- package/move_base_dist_browser_index_js.js +0 -30
- package/plugins_emitters_dist_browser_EmitterInstance_js.js +0 -30
- package/plugins_emitters_dist_browser_EmittersPlugin_js.js +0 -90
- package/plugins_emitters_dist_browser_Emitters_js.js +0 -30
- package/plugins_emitters_dist_browser_ShapeManager_js.js +0 -30
- package/plugins_emitters_dist_browser_index_js.js +0 -100
- package/plugins_motion_dist_browser_MotionInstance_js.js +0 -30
- package/plugins_motion_dist_browser_MotionPlugin_js.js +0 -50
- package/plugins_motion_dist_browser_index_js.js +0 -30
- package/shapes_cards_dist_browser_ClubDrawer_js.js +0 -40
- package/shapes_cards_dist_browser_DiamondDrawer_js.js +0 -40
- package/shapes_cards_dist_browser_HeartDrawer_js.js +0 -40
- package/shapes_cards_dist_browser_SpadeDrawer_js.js +0 -40
- package/shapes_cards_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_emoji_dist_browser_EmojiDrawer_js.js +0 -40
- package/shapes_emoji_dist_browser_index_js.js +0 -40
- package/shapes_heart_dist_browser_HeartDrawer_js.js +0 -40
- package/shapes_heart_dist_browser_index_js.js +0 -30
- package/shapes_image_dist_browser_GifUtils_Utils_js.js +0 -50
- package/shapes_image_dist_browser_ImageDrawer_js.js +0 -30
- package/shapes_image_dist_browser_ImagePreloader_js.js +0 -40
- package/shapes_image_dist_browser_index_js.js +0 -40
- package/shapes_polygon_dist_browser_PolygonDrawer_js.js +0 -50
- package/shapes_polygon_dist_browser_TriangleDrawer_js.js +0 -50
- package/shapes_polygon_dist_browser_index_js.js +0 -30
- package/shapes_square_dist_browser_SquareDrawer_js.js +0 -40
- package/shapes_square_dist_browser_index_js.js +0 -30
- package/shapes_star_dist_browser_StarDrawer_js.js +0 -40
- package/shapes_star_dist_browser_index_js.js +0 -30
- package/updaters_color_dist_browser_ColorUpdater_js.js +0 -30
- package/updaters_color_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_roll_dist_browser_RollUpdater_js.js +0 -60
- package/updaters_roll_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_tilt_dist_browser_TiltUpdater_js.js +0 -50
- package/updaters_tilt_dist_browser_index_js.js +0 -30
- package/updaters_wobble_dist_browser_WobbleUpdater_js.js +0 -60
- package/updaters_wobble_dist_browser_index_js.js +0 -30
package/browser/confetti.js
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
import { isSsr, isString, millisecondsToSeconds, tsParticles, } from "@tsparticles/engine";
|
|
2
|
+
import { loadEmittersPlugin } from "@tsparticles/plugin-emitters";
|
|
2
3
|
import { ConfettiOptions } from "./ConfettiOptions.js";
|
|
4
|
+
import { loadBasic } from "@tsparticles/basic";
|
|
5
|
+
import { loadCardsShape } from "@tsparticles/shape-cards";
|
|
6
|
+
import { loadEmojiShape } from "@tsparticles/shape-emoji";
|
|
7
|
+
import { loadHeartShape } from "@tsparticles/shape-heart";
|
|
8
|
+
import { loadImageShape } from "@tsparticles/shape-image";
|
|
9
|
+
import { loadLifeUpdater } from "@tsparticles/updater-life";
|
|
10
|
+
import { loadMotionPlugin } from "@tsparticles/plugin-motion";
|
|
11
|
+
import { loadPolygonShape } from "@tsparticles/shape-polygon";
|
|
12
|
+
import { loadRollUpdater } from "@tsparticles/updater-roll";
|
|
13
|
+
import { loadRotateUpdater } from "@tsparticles/updater-rotate";
|
|
14
|
+
import { loadSquareShape } from "@tsparticles/shape-square";
|
|
15
|
+
import { loadStarShape } from "@tsparticles/shape-star";
|
|
16
|
+
import { loadTiltUpdater } from "@tsparticles/updater-tilt";
|
|
17
|
+
import { loadWobbleUpdater } from "@tsparticles/updater-wobble";
|
|
3
18
|
const defaultGravity = 9.81, sizeFactor = 5, speedFactor = 3, decayOffset = 1, disableRotate = 0, disableTilt = 0;
|
|
4
19
|
let initialized = false;
|
|
5
20
|
let initializing = false;
|
|
@@ -9,7 +24,7 @@ async function initPlugins(engine) {
|
|
|
9
24
|
return;
|
|
10
25
|
}
|
|
11
26
|
if (initializing) {
|
|
12
|
-
return new Promise(
|
|
27
|
+
return new Promise(resolve => {
|
|
13
28
|
const timeout = 100, interval = setInterval(() => {
|
|
14
29
|
if (!initialized) {
|
|
15
30
|
return;
|
|
@@ -20,7 +35,6 @@ async function initPlugins(engine) {
|
|
|
20
35
|
});
|
|
21
36
|
}
|
|
22
37
|
initializing = true;
|
|
23
|
-
const { loadEmittersPlugin } = await import("@tsparticles/plugin-emitters"), { loadMotionPlugin } = await import("@tsparticles/plugin-motion"), { loadCardsShape } = await import("@tsparticles/shape-cards"), { loadHeartShape } = await import("@tsparticles/shape-heart"), { loadImageShape } = await import("@tsparticles/shape-image"), { loadPolygonShape } = await import("@tsparticles/shape-polygon"), { loadSquareShape } = await import("@tsparticles/shape-square"), { loadStarShape } = await import("@tsparticles/shape-star"), { loadEmojiShape } = await import("@tsparticles/shape-emoji"), { loadRotateUpdater } = await import("@tsparticles/updater-rotate"), { loadLifeUpdater } = await import("@tsparticles/updater-life"), { loadRollUpdater } = await import("@tsparticles/updater-roll"), { loadTiltUpdater } = await import("@tsparticles/updater-tilt"), { loadWobbleUpdater } = await import("@tsparticles/updater-wobble"), { loadBasic } = await import("@tsparticles/basic");
|
|
24
38
|
await loadEmittersPlugin(engine, false);
|
|
25
39
|
await loadMotionPlugin(engine, false);
|
|
26
40
|
await loadCardsShape(engine, false);
|
|
@@ -104,6 +118,52 @@ async function setConfetti(params) {
|
|
|
104
118
|
decay: decayOffset - actualOptions.decay,
|
|
105
119
|
direction: -actualOptions.angle,
|
|
106
120
|
},
|
|
121
|
+
rotate: {
|
|
122
|
+
value: actualOptions.flat
|
|
123
|
+
? disableRotate
|
|
124
|
+
: {
|
|
125
|
+
min: 0,
|
|
126
|
+
max: 360,
|
|
127
|
+
},
|
|
128
|
+
direction: "random",
|
|
129
|
+
animation: {
|
|
130
|
+
enable: !actualOptions.flat,
|
|
131
|
+
speed: 60,
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
tilt: {
|
|
135
|
+
direction: "random",
|
|
136
|
+
enable: !actualOptions.flat,
|
|
137
|
+
value: actualOptions.flat
|
|
138
|
+
? disableTilt
|
|
139
|
+
: {
|
|
140
|
+
min: 0,
|
|
141
|
+
max: 360,
|
|
142
|
+
},
|
|
143
|
+
animation: {
|
|
144
|
+
enable: true,
|
|
145
|
+
speed: 60,
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
roll: {
|
|
149
|
+
darken: {
|
|
150
|
+
enable: true,
|
|
151
|
+
value: 25,
|
|
152
|
+
},
|
|
153
|
+
enable: !actualOptions.flat,
|
|
154
|
+
speed: {
|
|
155
|
+
min: 15,
|
|
156
|
+
max: 25,
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
wobble: {
|
|
160
|
+
distance: 30,
|
|
161
|
+
enable: !actualOptions.flat,
|
|
162
|
+
speed: {
|
|
163
|
+
min: -15,
|
|
164
|
+
max: 15,
|
|
165
|
+
},
|
|
166
|
+
},
|
|
107
167
|
},
|
|
108
168
|
});
|
|
109
169
|
return;
|
|
@@ -285,6 +345,9 @@ confetti.create = async (canvas, options) => {
|
|
|
285
345
|
});
|
|
286
346
|
};
|
|
287
347
|
};
|
|
348
|
+
confetti.init = async () => {
|
|
349
|
+
await initPlugins(tsParticles);
|
|
350
|
+
};
|
|
288
351
|
confetti.version = tsParticles.version;
|
|
289
352
|
if (!isSsr()) {
|
|
290
353
|
window.confetti = confetti;
|
package/cjs/confetti.js
CHANGED
|
@@ -2,7 +2,22 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.confetti = void 0;
|
|
4
4
|
const engine_1 = require("@tsparticles/engine");
|
|
5
|
+
const plugin_emitters_1 = require("@tsparticles/plugin-emitters");
|
|
5
6
|
const ConfettiOptions_js_1 = require("./ConfettiOptions.js");
|
|
7
|
+
const basic_1 = require("@tsparticles/basic");
|
|
8
|
+
const shape_cards_1 = require("@tsparticles/shape-cards");
|
|
9
|
+
const shape_emoji_1 = require("@tsparticles/shape-emoji");
|
|
10
|
+
const shape_heart_1 = require("@tsparticles/shape-heart");
|
|
11
|
+
const shape_image_1 = require("@tsparticles/shape-image");
|
|
12
|
+
const updater_life_1 = require("@tsparticles/updater-life");
|
|
13
|
+
const plugin_motion_1 = require("@tsparticles/plugin-motion");
|
|
14
|
+
const shape_polygon_1 = require("@tsparticles/shape-polygon");
|
|
15
|
+
const updater_roll_1 = require("@tsparticles/updater-roll");
|
|
16
|
+
const updater_rotate_1 = require("@tsparticles/updater-rotate");
|
|
17
|
+
const shape_square_1 = require("@tsparticles/shape-square");
|
|
18
|
+
const shape_star_1 = require("@tsparticles/shape-star");
|
|
19
|
+
const updater_tilt_1 = require("@tsparticles/updater-tilt");
|
|
20
|
+
const updater_wobble_1 = require("@tsparticles/updater-wobble");
|
|
6
21
|
const defaultGravity = 9.81, sizeFactor = 5, speedFactor = 3, decayOffset = 1, disableRotate = 0, disableTilt = 0;
|
|
7
22
|
let initialized = false;
|
|
8
23
|
let initializing = false;
|
|
@@ -12,7 +27,7 @@ async function initPlugins(engine) {
|
|
|
12
27
|
return;
|
|
13
28
|
}
|
|
14
29
|
if (initializing) {
|
|
15
|
-
return new Promise(
|
|
30
|
+
return new Promise(resolve => {
|
|
16
31
|
const timeout = 100, interval = setInterval(() => {
|
|
17
32
|
if (!initialized) {
|
|
18
33
|
return;
|
|
@@ -23,22 +38,21 @@ async function initPlugins(engine) {
|
|
|
23
38
|
});
|
|
24
39
|
}
|
|
25
40
|
initializing = true;
|
|
26
|
-
|
|
27
|
-
await
|
|
28
|
-
await
|
|
29
|
-
await
|
|
30
|
-
await
|
|
31
|
-
await
|
|
32
|
-
await
|
|
33
|
-
await
|
|
34
|
-
await
|
|
35
|
-
await
|
|
36
|
-
await
|
|
37
|
-
await
|
|
38
|
-
await
|
|
39
|
-
await
|
|
40
|
-
await
|
|
41
|
-
await loadBasic(engine);
|
|
41
|
+
await (0, plugin_emitters_1.loadEmittersPlugin)(engine, false);
|
|
42
|
+
await (0, plugin_motion_1.loadMotionPlugin)(engine, false);
|
|
43
|
+
await (0, shape_cards_1.loadCardsShape)(engine, false);
|
|
44
|
+
await (0, shape_heart_1.loadHeartShape)(engine, false);
|
|
45
|
+
await (0, shape_image_1.loadImageShape)(engine, false);
|
|
46
|
+
await (0, shape_polygon_1.loadPolygonShape)(engine, false);
|
|
47
|
+
await (0, shape_square_1.loadSquareShape)(engine, false);
|
|
48
|
+
await (0, shape_star_1.loadStarShape)(engine, false);
|
|
49
|
+
await (0, shape_emoji_1.loadEmojiShape)(engine, false);
|
|
50
|
+
await (0, updater_rotate_1.loadRotateUpdater)(engine, false);
|
|
51
|
+
await (0, updater_life_1.loadLifeUpdater)(engine, false);
|
|
52
|
+
await (0, updater_roll_1.loadRollUpdater)(engine, false);
|
|
53
|
+
await (0, updater_tilt_1.loadTiltUpdater)(engine, false);
|
|
54
|
+
await (0, updater_wobble_1.loadWobbleUpdater)(engine, false);
|
|
55
|
+
await (0, basic_1.loadBasic)(engine);
|
|
42
56
|
initializing = false;
|
|
43
57
|
initialized = true;
|
|
44
58
|
}
|
|
@@ -107,6 +121,52 @@ async function setConfetti(params) {
|
|
|
107
121
|
decay: decayOffset - actualOptions.decay,
|
|
108
122
|
direction: -actualOptions.angle,
|
|
109
123
|
},
|
|
124
|
+
rotate: {
|
|
125
|
+
value: actualOptions.flat
|
|
126
|
+
? disableRotate
|
|
127
|
+
: {
|
|
128
|
+
min: 0,
|
|
129
|
+
max: 360,
|
|
130
|
+
},
|
|
131
|
+
direction: "random",
|
|
132
|
+
animation: {
|
|
133
|
+
enable: !actualOptions.flat,
|
|
134
|
+
speed: 60,
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
tilt: {
|
|
138
|
+
direction: "random",
|
|
139
|
+
enable: !actualOptions.flat,
|
|
140
|
+
value: actualOptions.flat
|
|
141
|
+
? disableTilt
|
|
142
|
+
: {
|
|
143
|
+
min: 0,
|
|
144
|
+
max: 360,
|
|
145
|
+
},
|
|
146
|
+
animation: {
|
|
147
|
+
enable: true,
|
|
148
|
+
speed: 60,
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
roll: {
|
|
152
|
+
darken: {
|
|
153
|
+
enable: true,
|
|
154
|
+
value: 25,
|
|
155
|
+
},
|
|
156
|
+
enable: !actualOptions.flat,
|
|
157
|
+
speed: {
|
|
158
|
+
min: 15,
|
|
159
|
+
max: 25,
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
wobble: {
|
|
163
|
+
distance: 30,
|
|
164
|
+
enable: !actualOptions.flat,
|
|
165
|
+
speed: {
|
|
166
|
+
min: -15,
|
|
167
|
+
max: 15,
|
|
168
|
+
},
|
|
169
|
+
},
|
|
110
170
|
},
|
|
111
171
|
});
|
|
112
172
|
return;
|
|
@@ -289,6 +349,9 @@ confetti.create = async (canvas, options) => {
|
|
|
289
349
|
});
|
|
290
350
|
};
|
|
291
351
|
};
|
|
352
|
+
confetti.init = async () => {
|
|
353
|
+
await initPlugins(engine_1.tsParticles);
|
|
354
|
+
};
|
|
292
355
|
confetti.version = engine_1.tsParticles.version;
|
|
293
356
|
if (!(0, engine_1.isSsr)()) {
|
|
294
357
|
window.confetti = confetti;
|
package/esm/confetti.js
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
import { isSsr, isString, millisecondsToSeconds, tsParticles, } from "@tsparticles/engine";
|
|
2
|
+
import { loadEmittersPlugin } from "@tsparticles/plugin-emitters";
|
|
2
3
|
import { ConfettiOptions } from "./ConfettiOptions.js";
|
|
4
|
+
import { loadBasic } from "@tsparticles/basic";
|
|
5
|
+
import { loadCardsShape } from "@tsparticles/shape-cards";
|
|
6
|
+
import { loadEmojiShape } from "@tsparticles/shape-emoji";
|
|
7
|
+
import { loadHeartShape } from "@tsparticles/shape-heart";
|
|
8
|
+
import { loadImageShape } from "@tsparticles/shape-image";
|
|
9
|
+
import { loadLifeUpdater } from "@tsparticles/updater-life";
|
|
10
|
+
import { loadMotionPlugin } from "@tsparticles/plugin-motion";
|
|
11
|
+
import { loadPolygonShape } from "@tsparticles/shape-polygon";
|
|
12
|
+
import { loadRollUpdater } from "@tsparticles/updater-roll";
|
|
13
|
+
import { loadRotateUpdater } from "@tsparticles/updater-rotate";
|
|
14
|
+
import { loadSquareShape } from "@tsparticles/shape-square";
|
|
15
|
+
import { loadStarShape } from "@tsparticles/shape-star";
|
|
16
|
+
import { loadTiltUpdater } from "@tsparticles/updater-tilt";
|
|
17
|
+
import { loadWobbleUpdater } from "@tsparticles/updater-wobble";
|
|
3
18
|
const defaultGravity = 9.81, sizeFactor = 5, speedFactor = 3, decayOffset = 1, disableRotate = 0, disableTilt = 0;
|
|
4
19
|
let initialized = false;
|
|
5
20
|
let initializing = false;
|
|
@@ -9,7 +24,7 @@ async function initPlugins(engine) {
|
|
|
9
24
|
return;
|
|
10
25
|
}
|
|
11
26
|
if (initializing) {
|
|
12
|
-
return new Promise(
|
|
27
|
+
return new Promise(resolve => {
|
|
13
28
|
const timeout = 100, interval = setInterval(() => {
|
|
14
29
|
if (!initialized) {
|
|
15
30
|
return;
|
|
@@ -20,7 +35,6 @@ async function initPlugins(engine) {
|
|
|
20
35
|
});
|
|
21
36
|
}
|
|
22
37
|
initializing = true;
|
|
23
|
-
const { loadEmittersPlugin } = await import("@tsparticles/plugin-emitters"), { loadMotionPlugin } = await import("@tsparticles/plugin-motion"), { loadCardsShape } = await import("@tsparticles/shape-cards"), { loadHeartShape } = await import("@tsparticles/shape-heart"), { loadImageShape } = await import("@tsparticles/shape-image"), { loadPolygonShape } = await import("@tsparticles/shape-polygon"), { loadSquareShape } = await import("@tsparticles/shape-square"), { loadStarShape } = await import("@tsparticles/shape-star"), { loadEmojiShape } = await import("@tsparticles/shape-emoji"), { loadRotateUpdater } = await import("@tsparticles/updater-rotate"), { loadLifeUpdater } = await import("@tsparticles/updater-life"), { loadRollUpdater } = await import("@tsparticles/updater-roll"), { loadTiltUpdater } = await import("@tsparticles/updater-tilt"), { loadWobbleUpdater } = await import("@tsparticles/updater-wobble"), { loadBasic } = await import("@tsparticles/basic");
|
|
24
38
|
await loadEmittersPlugin(engine, false);
|
|
25
39
|
await loadMotionPlugin(engine, false);
|
|
26
40
|
await loadCardsShape(engine, false);
|
|
@@ -104,6 +118,52 @@ async function setConfetti(params) {
|
|
|
104
118
|
decay: decayOffset - actualOptions.decay,
|
|
105
119
|
direction: -actualOptions.angle,
|
|
106
120
|
},
|
|
121
|
+
rotate: {
|
|
122
|
+
value: actualOptions.flat
|
|
123
|
+
? disableRotate
|
|
124
|
+
: {
|
|
125
|
+
min: 0,
|
|
126
|
+
max: 360,
|
|
127
|
+
},
|
|
128
|
+
direction: "random",
|
|
129
|
+
animation: {
|
|
130
|
+
enable: !actualOptions.flat,
|
|
131
|
+
speed: 60,
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
tilt: {
|
|
135
|
+
direction: "random",
|
|
136
|
+
enable: !actualOptions.flat,
|
|
137
|
+
value: actualOptions.flat
|
|
138
|
+
? disableTilt
|
|
139
|
+
: {
|
|
140
|
+
min: 0,
|
|
141
|
+
max: 360,
|
|
142
|
+
},
|
|
143
|
+
animation: {
|
|
144
|
+
enable: true,
|
|
145
|
+
speed: 60,
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
roll: {
|
|
149
|
+
darken: {
|
|
150
|
+
enable: true,
|
|
151
|
+
value: 25,
|
|
152
|
+
},
|
|
153
|
+
enable: !actualOptions.flat,
|
|
154
|
+
speed: {
|
|
155
|
+
min: 15,
|
|
156
|
+
max: 25,
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
wobble: {
|
|
160
|
+
distance: 30,
|
|
161
|
+
enable: !actualOptions.flat,
|
|
162
|
+
speed: {
|
|
163
|
+
min: -15,
|
|
164
|
+
max: 15,
|
|
165
|
+
},
|
|
166
|
+
},
|
|
107
167
|
},
|
|
108
168
|
});
|
|
109
169
|
return;
|
|
@@ -285,6 +345,9 @@ confetti.create = async (canvas, options) => {
|
|
|
285
345
|
});
|
|
286
346
|
};
|
|
287
347
|
};
|
|
348
|
+
confetti.init = async () => {
|
|
349
|
+
await initPlugins(tsParticles);
|
|
350
|
+
};
|
|
288
351
|
confetti.version = tsParticles.version;
|
|
289
352
|
if (!isSsr()) {
|
|
290
353
|
window.confetti = confetti;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/confetti",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.0",
|
|
4
4
|
"description": "Easily create highly customizable particle animations and use them as animated backgrounds for your website. Ready to use components available also for React, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Riot.js, Inferno.",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -99,22 +99,22 @@
|
|
|
99
99
|
"./package.json": "./package.json"
|
|
100
100
|
},
|
|
101
101
|
"dependencies": {
|
|
102
|
-
"@tsparticles/basic": "^3.
|
|
103
|
-
"@tsparticles/engine": "^3.
|
|
104
|
-
"@tsparticles/plugin-emitters": "^3.
|
|
105
|
-
"@tsparticles/plugin-motion": "^3.
|
|
106
|
-
"@tsparticles/shape-cards": "^3.
|
|
107
|
-
"@tsparticles/shape-emoji": "^3.
|
|
108
|
-
"@tsparticles/shape-heart": "^3.
|
|
109
|
-
"@tsparticles/shape-image": "^3.
|
|
110
|
-
"@tsparticles/shape-polygon": "^3.
|
|
111
|
-
"@tsparticles/shape-square": "^3.
|
|
112
|
-
"@tsparticles/shape-star": "^3.
|
|
113
|
-
"@tsparticles/updater-life": "^3.
|
|
114
|
-
"@tsparticles/updater-roll": "^3.
|
|
115
|
-
"@tsparticles/updater-rotate": "^3.
|
|
116
|
-
"@tsparticles/updater-tilt": "^3.
|
|
117
|
-
"@tsparticles/updater-wobble": "^3.
|
|
102
|
+
"@tsparticles/basic": "^3.4.0",
|
|
103
|
+
"@tsparticles/engine": "^3.4.0",
|
|
104
|
+
"@tsparticles/plugin-emitters": "^3.4.0",
|
|
105
|
+
"@tsparticles/plugin-motion": "^3.4.0",
|
|
106
|
+
"@tsparticles/shape-cards": "^3.4.0",
|
|
107
|
+
"@tsparticles/shape-emoji": "^3.4.0",
|
|
108
|
+
"@tsparticles/shape-heart": "^3.4.0",
|
|
109
|
+
"@tsparticles/shape-image": "^3.4.0",
|
|
110
|
+
"@tsparticles/shape-polygon": "^3.4.0",
|
|
111
|
+
"@tsparticles/shape-square": "^3.4.0",
|
|
112
|
+
"@tsparticles/shape-star": "^3.4.0",
|
|
113
|
+
"@tsparticles/updater-life": "^3.4.0",
|
|
114
|
+
"@tsparticles/updater-roll": "^3.4.0",
|
|
115
|
+
"@tsparticles/updater-rotate": "^3.4.0",
|
|
116
|
+
"@tsparticles/updater-tilt": "^3.4.0",
|
|
117
|
+
"@tsparticles/updater-wobble": "^3.4.0"
|
|
118
118
|
},
|
|
119
119
|
"publishConfig": {
|
|
120
120
|
"access": "public"
|
package/report.html
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8"/>
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
6
|
-
<title>@tsparticles/confetti [
|
|
6
|
+
<title>@tsparticles/confetti [13 May 2024 at 00:17]</title>
|
|
7
7
|
<link rel="shortcut icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAABrVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+O1foceMD///+J0/qK1Pr7/v8Xdr/9///W8P4UdL7L7P0Scr2r4Pyj3vwad8D5/f/2/f+55f3E6f34+/2H0/ojfMKpzOd0rNgQcb3F3O/j9f7c8v6g3Pz0/P/w+v/q+P7n9v6T1/uQ1vuE0vqLut/y+v+Z2fvt+f+15Pzv9fuc2/vR7v2V2Pvd6/bg9P7I6/285/2y4/yp3/zp8vk8i8kqgMT7/P31+fyv4vxGkcz6/P6/6P3j7vfS5PNnpNUxhcbO7f7F6v3O4vHK3/DA2u631Ouy0eqXweKJud5wqthfoNMMbLvY8f73+v2dxeR8sNtTmdDx9/zX6PSjyeaCtd1YnNGX2PuQveCGt95Nls42h8dLlM3F4vBtAAAAM3RSTlMAAyOx0/sKBvik8opWGBMOAe3l1snDm2E9LSb06eHcu5JpHbarfHZCN9CBb08zzkdNS0kYaptYAAAFV0lEQVRYw92X51/aYBDHHS2O2qqttVbrqNq9m+TJIAYIShBkWwqIiCgoWvfeq7Z2/s29hyQNyUcR7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