@tsparticles/preset-confetti 3.0.0-alpha.1 → 3.0.0-beta.2

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/cjs/options.js CHANGED
@@ -1,135 +1,130 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.loadOptions = void 0;
4
- const ConfettiOptions_1 = require("./ConfettiOptions");
5
- const loadOptions = (confettiOptions) => {
6
- const actualOptions = new ConfettiOptions_1.ConfettiOptions();
7
- actualOptions.load(confettiOptions);
8
- return {
9
- fullScreen: {
10
- enable: true,
11
- zIndex: actualOptions.zIndex,
3
+ exports.options = void 0;
4
+ exports.options = {
5
+ fullScreen: {
6
+ enable: true,
7
+ zIndex: 100,
8
+ },
9
+ fpsLimit: 120,
10
+ particles: {
11
+ number: {
12
+ value: 0,
12
13
  },
13
- fpsLimit: 120,
14
- particles: {
15
- number: {
16
- value: 0,
17
- },
18
- color: {
19
- value: actualOptions.colors,
14
+ color: {
15
+ value: ["#26ccff", "#a25afd", "#ff5e7e", "#88ff5a", "#fcff42", "#ffa62d", "#ff36ff"],
16
+ },
17
+ shape: {
18
+ type: ["square", "circle"],
19
+ },
20
+ opacity: {
21
+ value: { min: 0, max: 1 },
22
+ animation: {
23
+ enable: true,
24
+ speed: 0.5,
25
+ startValue: "max",
26
+ destroy: "min",
20
27
  },
21
- shape: {
22
- type: actualOptions.shapes,
28
+ },
29
+ size: {
30
+ value: 5,
31
+ },
32
+ links: {
33
+ enable: false,
34
+ },
35
+ life: {
36
+ duration: {
37
+ sync: true,
38
+ value: 20 / 6,
23
39
  },
24
- opacity: {
25
- value: { min: 0, max: 1 },
26
- animation: {
27
- enable: true,
28
- speed: 0.5,
29
- startValue: "max",
30
- destroy: "min",
31
- },
40
+ count: 1,
41
+ },
42
+ move: {
43
+ angle: {
44
+ value: 45,
45
+ offset: 0,
32
46
  },
33
- size: {
34
- value: 5 * actualOptions.scalar,
47
+ drift: 0,
48
+ enable: true,
49
+ gravity: {
50
+ enable: true,
51
+ acceleration: 9.81,
35
52
  },
36
- links: {
37
- enable: false,
53
+ speed: 45,
54
+ decay: 0.1,
55
+ direction: -90,
56
+ random: true,
57
+ straight: false,
58
+ outModes: {
59
+ default: "none",
60
+ bottom: "destroy",
38
61
  },
39
- life: {
40
- duration: {
41
- sync: true,
42
- value: actualOptions.ticks / 60,
43
- },
44
- count: 1,
62
+ },
63
+ rotate: {
64
+ value: {
65
+ min: 0,
66
+ max: 360,
45
67
  },
46
- move: {
47
- angle: {
48
- value: actualOptions.spread,
49
- offset: 0,
50
- },
51
- drift: {
52
- min: -actualOptions.drift,
53
- max: actualOptions.drift,
54
- },
68
+ direction: "random",
69
+ animation: {
55
70
  enable: true,
56
- gravity: {
57
- enable: true,
58
- acceleration: actualOptions.gravity * 9.81,
59
- },
60
- speed: actualOptions.startVelocity,
61
- decay: 1 - actualOptions.decay,
62
- direction: -actualOptions.angle,
63
- random: true,
64
- straight: false,
65
- outModes: {
66
- default: "none",
67
- bottom: "destroy",
68
- },
71
+ speed: 60,
69
72
  },
70
- rotate: {
71
- value: {
72
- min: 0,
73
- max: 360,
74
- },
75
- direction: "random",
76
- animation: {
77
- enable: true,
78
- speed: 60,
79
- },
73
+ },
74
+ tilt: {
75
+ direction: "random",
76
+ enable: true,
77
+ value: {
78
+ min: 0,
79
+ max: 360,
80
80
  },
81
- tilt: {
82
- direction: "random",
81
+ animation: {
83
82
  enable: true,
84
- value: {
85
- min: 0,
86
- max: 360,
87
- },
88
- animation: {
89
- enable: true,
90
- speed: 60,
91
- },
83
+ speed: 60,
92
84
  },
93
- roll: {
94
- darken: {
95
- enable: true,
96
- value: 25,
97
- },
85
+ },
86
+ roll: {
87
+ darken: {
98
88
  enable: true,
99
- speed: {
100
- min: 15,
101
- max: 25,
102
- },
89
+ value: 25,
103
90
  },
104
- wobble: {
105
- distance: 30,
106
- enable: true,
107
- speed: {
108
- min: -15,
109
- max: 15,
110
- },
91
+ enable: true,
92
+ speed: {
93
+ min: 15,
94
+ max: 25,
111
95
  },
112
96
  },
113
- detectRetina: true,
114
- motion: {
115
- disable: actualOptions.disableForReducedMotion,
116
- },
117
- emitters: {
118
- startCount: actualOptions.count,
119
- position: actualOptions.position,
120
- size: {
121
- width: 0,
122
- height: 0,
123
- },
124
- rate: {
125
- delay: 0,
126
- quantity: 0,
127
- },
128
- life: {
129
- duration: 0.1,
130
- count: 1,
97
+ wobble: {
98
+ distance: 30,
99
+ enable: true,
100
+ speed: {
101
+ min: -15,
102
+ max: 15,
131
103
  },
132
104
  },
133
- };
105
+ },
106
+ detectRetina: true,
107
+ motion: {
108
+ disable: true,
109
+ },
110
+ emitters: {
111
+ name: "confetti",
112
+ startCount: 50,
113
+ position: {
114
+ x: 50,
115
+ y: 50,
116
+ },
117
+ size: {
118
+ width: 0,
119
+ height: 0,
120
+ },
121
+ rate: {
122
+ delay: 0,
123
+ quantity: 0,
124
+ },
125
+ life: {
126
+ duration: 0.1,
127
+ count: 1,
128
+ },
129
+ },
134
130
  };
135
- exports.loadOptions = loadOptions;
@@ -0,0 +1 @@
1
+ { "type": "commonjs" }
package/esm/bundle.js CHANGED
@@ -1,6 +1,6 @@
1
- import { confetti, loadConfettiPreset } from "./index";
1
+ import { loadConfettiPreset } from "./index";
2
2
  import { tsParticles } from "@tsparticles/engine";
3
3
  (async () => {
4
4
  await loadConfettiPreset(tsParticles);
5
5
  })();
6
- export { confetti, loadConfettiPreset, tsParticles };
6
+ export { loadConfettiPreset, tsParticles };
package/esm/index.js CHANGED
@@ -1,55 +1,25 @@
1
- import { getRandom, tsParticles } from "@tsparticles/engine";
2
- import { loadAngleUpdater } from "@tsparticles/updater-angle";
3
- import { loadBaseMover } from "@tsparticles/move-base";
4
- import { loadCircleShape } from "@tsparticles/shape-circle";
5
- import { loadColorUpdater } from "@tsparticles/updater-color";
1
+ import { loadBasic } from "@tsparticles/basic";
6
2
  import { loadEmittersPlugin } from "@tsparticles/plugin-emitters";
7
3
  import { loadLifeUpdater } from "@tsparticles/updater-life";
8
4
  import { loadMotionPlugin } from "@tsparticles/plugin-motion";
9
- import { loadOpacityUpdater } from "@tsparticles/updater-opacity";
10
- import { loadOptions } from "./options";
11
- import { loadOutModesUpdater } from "@tsparticles/updater-out-modes";
12
5
  import { loadRollUpdater } from "@tsparticles/updater-roll";
13
- import { loadSizeUpdater } from "@tsparticles/updater-size";
6
+ import { loadRotateUpdater } from "@tsparticles/updater-rotate";
14
7
  import { loadSquareShape } from "@tsparticles/shape-square";
15
8
  import { loadTiltUpdater } from "@tsparticles/updater-tilt";
16
9
  import { loadWobbleUpdater } from "@tsparticles/updater-wobble";
17
- async function loadPreset(engine, confettiOptions, override = false) {
18
- await loadBaseMover(engine);
19
- await loadCircleShape(engine);
20
- await loadSquareShape(engine);
21
- await loadColorUpdater(engine);
22
- await loadSizeUpdater(engine);
23
- await loadOpacityUpdater(engine);
24
- await loadOutModesUpdater(engine);
25
- await loadEmittersPlugin(engine);
26
- await loadMotionPlugin(engine);
27
- await loadWobbleUpdater(engine);
28
- await loadRollUpdater(engine);
29
- await loadAngleUpdater(engine);
30
- await loadTiltUpdater(engine);
31
- await loadLifeUpdater(engine);
32
- await engine.addPreset("confetti", loadOptions(confettiOptions), override);
10
+ import { options } from "./options";
11
+ async function loadPreset(engine, refresh = true) {
12
+ await loadBasic(engine, false);
13
+ await loadSquareShape(engine, false);
14
+ await loadEmittersPlugin(engine, false);
15
+ await loadMotionPlugin(engine, false);
16
+ await loadWobbleUpdater(engine, false);
17
+ await loadRollUpdater(engine, false);
18
+ await loadRotateUpdater(engine, false);
19
+ await loadTiltUpdater(engine, false);
20
+ await loadLifeUpdater(engine, false);
21
+ await engine.addPreset("confetti", options, refresh);
33
22
  }
34
- export async function loadConfettiPreset(main) {
35
- await loadPreset(main, {}, true);
36
- }
37
- export async function confetti(idOrOptions, confettiOptions) {
38
- let options;
39
- let id;
40
- if (typeof idOrOptions === "string") {
41
- id = idOrOptions;
42
- options = confettiOptions !== null && confettiOptions !== void 0 ? confettiOptions : {};
43
- }
44
- else {
45
- id = `tsparticles_${Math.floor(getRandom() * 1000)}`;
46
- options = idOrOptions;
47
- }
48
- await loadPreset(tsParticles, options, true);
49
- await tsParticles.load({
50
- id,
51
- options: {
52
- preset: "confetti",
53
- },
54
- });
23
+ export async function loadConfettiPreset(engine) {
24
+ await loadPreset(engine);
55
25
  }
package/esm/options.js CHANGED
@@ -1,131 +1,127 @@
1
- import { ConfettiOptions } from "./ConfettiOptions";
2
- export const loadOptions = (confettiOptions) => {
3
- const actualOptions = new ConfettiOptions();
4
- actualOptions.load(confettiOptions);
5
- return {
6
- fullScreen: {
7
- enable: true,
8
- zIndex: actualOptions.zIndex,
1
+ export const options = {
2
+ fullScreen: {
3
+ enable: true,
4
+ zIndex: 100,
5
+ },
6
+ fpsLimit: 120,
7
+ particles: {
8
+ number: {
9
+ value: 0,
9
10
  },
10
- fpsLimit: 120,
11
- particles: {
12
- number: {
13
- value: 0,
14
- },
15
- color: {
16
- value: actualOptions.colors,
11
+ color: {
12
+ value: ["#26ccff", "#a25afd", "#ff5e7e", "#88ff5a", "#fcff42", "#ffa62d", "#ff36ff"],
13
+ },
14
+ shape: {
15
+ type: ["square", "circle"],
16
+ },
17
+ opacity: {
18
+ value: { min: 0, max: 1 },
19
+ animation: {
20
+ enable: true,
21
+ speed: 0.5,
22
+ startValue: "max",
23
+ destroy: "min",
17
24
  },
18
- shape: {
19
- type: actualOptions.shapes,
25
+ },
26
+ size: {
27
+ value: 5,
28
+ },
29
+ links: {
30
+ enable: false,
31
+ },
32
+ life: {
33
+ duration: {
34
+ sync: true,
35
+ value: 20 / 6,
20
36
  },
21
- opacity: {
22
- value: { min: 0, max: 1 },
23
- animation: {
24
- enable: true,
25
- speed: 0.5,
26
- startValue: "max",
27
- destroy: "min",
28
- },
37
+ count: 1,
38
+ },
39
+ move: {
40
+ angle: {
41
+ value: 45,
42
+ offset: 0,
29
43
  },
30
- size: {
31
- value: 5 * actualOptions.scalar,
44
+ drift: 0,
45
+ enable: true,
46
+ gravity: {
47
+ enable: true,
48
+ acceleration: 9.81,
32
49
  },
33
- links: {
34
- enable: false,
50
+ speed: 45,
51
+ decay: 0.1,
52
+ direction: -90,
53
+ random: true,
54
+ straight: false,
55
+ outModes: {
56
+ default: "none",
57
+ bottom: "destroy",
35
58
  },
36
- life: {
37
- duration: {
38
- sync: true,
39
- value: actualOptions.ticks / 60,
40
- },
41
- count: 1,
59
+ },
60
+ rotate: {
61
+ value: {
62
+ min: 0,
63
+ max: 360,
42
64
  },
43
- move: {
44
- angle: {
45
- value: actualOptions.spread,
46
- offset: 0,
47
- },
48
- drift: {
49
- min: -actualOptions.drift,
50
- max: actualOptions.drift,
51
- },
65
+ direction: "random",
66
+ animation: {
52
67
  enable: true,
53
- gravity: {
54
- enable: true,
55
- acceleration: actualOptions.gravity * 9.81,
56
- },
57
- speed: actualOptions.startVelocity,
58
- decay: 1 - actualOptions.decay,
59
- direction: -actualOptions.angle,
60
- random: true,
61
- straight: false,
62
- outModes: {
63
- default: "none",
64
- bottom: "destroy",
65
- },
68
+ speed: 60,
66
69
  },
67
- rotate: {
68
- value: {
69
- min: 0,
70
- max: 360,
71
- },
72
- direction: "random",
73
- animation: {
74
- enable: true,
75
- speed: 60,
76
- },
70
+ },
71
+ tilt: {
72
+ direction: "random",
73
+ enable: true,
74
+ value: {
75
+ min: 0,
76
+ max: 360,
77
77
  },
78
- tilt: {
79
- direction: "random",
78
+ animation: {
80
79
  enable: true,
81
- value: {
82
- min: 0,
83
- max: 360,
84
- },
85
- animation: {
86
- enable: true,
87
- speed: 60,
88
- },
80
+ speed: 60,
89
81
  },
90
- roll: {
91
- darken: {
92
- enable: true,
93
- value: 25,
94
- },
82
+ },
83
+ roll: {
84
+ darken: {
95
85
  enable: true,
96
- speed: {
97
- min: 15,
98
- max: 25,
99
- },
86
+ value: 25,
100
87
  },
101
- wobble: {
102
- distance: 30,
103
- enable: true,
104
- speed: {
105
- min: -15,
106
- max: 15,
107
- },
88
+ enable: true,
89
+ speed: {
90
+ min: 15,
91
+ max: 25,
108
92
  },
109
93
  },
110
- detectRetina: true,
111
- motion: {
112
- disable: actualOptions.disableForReducedMotion,
113
- },
114
- emitters: {
115
- startCount: actualOptions.count,
116
- position: actualOptions.position,
117
- size: {
118
- width: 0,
119
- height: 0,
120
- },
121
- rate: {
122
- delay: 0,
123
- quantity: 0,
124
- },
125
- life: {
126
- duration: 0.1,
127
- count: 1,
94
+ wobble: {
95
+ distance: 30,
96
+ enable: true,
97
+ speed: {
98
+ min: -15,
99
+ max: 15,
128
100
  },
129
101
  },
130
- };
102
+ },
103
+ detectRetina: true,
104
+ motion: {
105
+ disable: true,
106
+ },
107
+ emitters: {
108
+ name: "confetti",
109
+ startCount: 50,
110
+ position: {
111
+ x: 50,
112
+ y: 50,
113
+ },
114
+ size: {
115
+ width: 0,
116
+ height: 0,
117
+ },
118
+ rate: {
119
+ delay: 0,
120
+ quantity: 0,
121
+ },
122
+ life: {
123
+ duration: 0.1,
124
+ count: 1,
125
+ },
126
+ },
131
127
  };
@@ -0,0 +1 @@
1
+ { "type": "module" }
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@tsparticles/preset-confetti",
3
- "version": "3.0.0-alpha.1",
3
+ "version": "3.0.0-beta.2",
4
4
  "description": "tsParticles confetti preset",
5
5
  "homepage": "https://particles.js.org",
6
6
  "repository": {
7
7
  "type": "git",
8
- "url": "git+https://github.com/matteobruni/tsparticles.git",
8
+ "url": "git+https://github.com/tsparticles/presets.git",
9
9
  "directory": "presets/confetti"
10
10
  },
11
11
  "keywords": [
@@ -60,18 +60,22 @@
60
60
  "confettijs",
61
61
  "fireworksjs",
62
62
  "canvas-confetti",
63
- "tsparticles-preset"
63
+ "@tsparticles/preset"
64
64
  ],
65
65
  "author": "Matteo Bruni <matteo.bruni@me.com>",
66
66
  "license": "MIT",
67
67
  "bugs": {
68
- "url": "https://github.com/matteobruni/tsparticles/issues"
68
+ "url": "https://github.com/tsparticles/presets/issues"
69
69
  },
70
70
  "funding": [
71
71
  {
72
72
  "type": "github",
73
73
  "url": "https://github.com/sponsors/matteobruni"
74
74
  },
75
+ {
76
+ "type": "github",
77
+ "url": "https://github.com/sponsors/tsparticles"
78
+ },
75
79
  {
76
80
  "type": "buymeacoffee",
77
81
  "url": "https://www.buymeacoffee.com/matteobruni"
@@ -82,24 +86,16 @@
82
86
  "unpkg": "tsparticles.preset.confetti.min.js",
83
87
  "module": "esm/index.js",
84
88
  "types": "types/index.d.ts",
85
- "publishConfig": {
86
- "access": "public"
87
- },
88
89
  "dependencies": {
89
- "@tsparticles/engine": "^3.0.0-alpha.1",
90
- "@tsparticles/move-base": "^3.0.0-alpha.1",
91
- "@tsparticles/plugin-emitters": "^3.0.0-alpha.1",
92
- "@tsparticles/plugin-motion": "^3.0.0-alpha.1",
93
- "@tsparticles/shape-circle": "^3.0.0-alpha.1",
94
- "@tsparticles/shape-square": "^3.0.0-alpha.1",
95
- "@tsparticles/updater-angle": "^3.0.0-alpha.1",
96
- "@tsparticles/updater-color": "^3.0.0-alpha.1",
97
- "@tsparticles/updater-life": "^3.0.0-alpha.1",
98
- "@tsparticles/updater-opacity": "^3.0.0-alpha.1",
99
- "@tsparticles/updater-out-modes": "^3.0.0-alpha.1",
100
- "@tsparticles/updater-roll": "^3.0.0-alpha.1",
101
- "@tsparticles/updater-size": "^3.0.0-alpha.1",
102
- "@tsparticles/updater-tilt": "^3.0.0-alpha.1",
103
- "@tsparticles/updater-wobble": "^3.0.0-alpha.1"
90
+ "@tsparticles/basic": "^3.0.0-beta.4",
91
+ "@tsparticles/engine": "^3.0.0-beta.4",
92
+ "@tsparticles/plugin-emitters": "^3.0.0-beta.4",
93
+ "@tsparticles/plugin-motion": "^3.0.0-beta.4",
94
+ "@tsparticles/shape-square": "^3.0.0-beta.4",
95
+ "@tsparticles/updater-life": "^3.0.0-beta.4",
96
+ "@tsparticles/updater-roll": "^3.0.0-beta.4",
97
+ "@tsparticles/updater-rotate": "^3.0.0-beta.4",
98
+ "@tsparticles/updater-tilt": "^3.0.0-beta.4",
99
+ "@tsparticles/updater-wobble": "^3.0.0-beta.4"
104
100
  }
105
- }
101
+ }