@tsparticles/preset-confetti 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 +25 -113
- package/browser/bundle.js +2 -2
- package/browser/index.js +16 -46
- package/browser/options.js +108 -112
- package/browser/package.json +1 -0
- package/cjs/bundle.js +4 -14
- package/cjs/index.js +17 -63
- package/cjs/options.js +109 -114
- package/cjs/package.json +1 -0
- package/esm/bundle.js +2 -2
- package/esm/index.js +16 -46
- package/esm/options.js +108 -112
- package/esm/package.json +1 -0
- package/package.json +19 -23
- package/report.html +4 -4
- package/tsparticles.preset.confetti.bundle.js +3012 -3351
- package/tsparticles.preset.confetti.bundle.min.js +1 -1
- package/tsparticles.preset.confetti.bundle.min.js.LICENSE.txt +1 -8
- package/tsparticles.preset.confetti.js +306 -277
- package/tsparticles.preset.confetti.min.js +1 -1
- package/tsparticles.preset.confetti.min.js.LICENSE.txt +1 -8
- package/types/bundle.d.ts +2 -4
- package/types/index.d.ts +2 -6
- package/types/options.d.ts +2 -3
- package/umd/bundle.js +1 -2
- package/umd/index.js +18 -49
- package/umd/options.js +110 -115
- package/browser/ConfettiOptions.js +0 -100
- package/browser/IConfettiOptions.js +0 -1
- package/cjs/ConfettiOptions.js +0 -104
- package/cjs/IConfettiOptions.js +0 -2
- package/esm/ConfettiOptions.js +0 -100
- package/esm/IConfettiOptions.js +0 -1
- package/types/ConfettiOptions.d.ts +0 -24
- package/types/IConfettiOptions.d.ts +0 -19
- package/umd/ConfettiOptions.js +0 -114
- package/umd/IConfettiOptions.js +0 -12
package/esm/ConfettiOptions.js
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
export class ConfettiOptions {
|
|
2
|
-
constructor() {
|
|
3
|
-
this.angle = 90;
|
|
4
|
-
this.count = 50;
|
|
5
|
-
this.spread = 45;
|
|
6
|
-
this.startVelocity = 45;
|
|
7
|
-
this.decay = 0.9;
|
|
8
|
-
this.gravity = 1;
|
|
9
|
-
this.drift = 0;
|
|
10
|
-
this.ticks = 200;
|
|
11
|
-
this.position = {
|
|
12
|
-
x: 50,
|
|
13
|
-
y: 50,
|
|
14
|
-
};
|
|
15
|
-
this.colors = ["#ffffff", "#ff0000"];
|
|
16
|
-
this.shapes = ["square", "circle"];
|
|
17
|
-
this.scalar = 1;
|
|
18
|
-
this.zIndex = 100;
|
|
19
|
-
this.disableForReducedMotion = true;
|
|
20
|
-
}
|
|
21
|
-
get origin() {
|
|
22
|
-
return {
|
|
23
|
-
x: this.position.x / 100,
|
|
24
|
-
y: this.position.y / 100,
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
set origin(value) {
|
|
28
|
-
this.position.x = value.x * 100;
|
|
29
|
-
this.position.y = value.y * 100;
|
|
30
|
-
}
|
|
31
|
-
get particleCount() {
|
|
32
|
-
return this.count;
|
|
33
|
-
}
|
|
34
|
-
set particleCount(value) {
|
|
35
|
-
this.count = value;
|
|
36
|
-
}
|
|
37
|
-
load(data) {
|
|
38
|
-
var _a, _b;
|
|
39
|
-
if (!data) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
if (data.angle !== undefined) {
|
|
43
|
-
this.angle = data.angle;
|
|
44
|
-
}
|
|
45
|
-
const count = (_a = data.count) !== null && _a !== void 0 ? _a : data.particleCount;
|
|
46
|
-
if (count !== undefined) {
|
|
47
|
-
this.count = count;
|
|
48
|
-
}
|
|
49
|
-
if (data.spread !== undefined) {
|
|
50
|
-
this.spread = data.spread;
|
|
51
|
-
}
|
|
52
|
-
if (data.startVelocity !== undefined) {
|
|
53
|
-
this.startVelocity = data.startVelocity;
|
|
54
|
-
}
|
|
55
|
-
if (data.decay !== undefined) {
|
|
56
|
-
this.decay = data.decay;
|
|
57
|
-
}
|
|
58
|
-
if (data.gravity !== undefined) {
|
|
59
|
-
this.gravity = data.gravity;
|
|
60
|
-
}
|
|
61
|
-
if (data.drift !== undefined) {
|
|
62
|
-
this.drift = data.drift;
|
|
63
|
-
}
|
|
64
|
-
if (data.ticks !== undefined) {
|
|
65
|
-
this.ticks = data.ticks;
|
|
66
|
-
}
|
|
67
|
-
const position = (_b = data.position) !== null && _b !== void 0 ? _b : this.position;
|
|
68
|
-
if ((position === null || position === void 0 ? void 0 : position.x) !== undefined) {
|
|
69
|
-
this.position.x = position.x;
|
|
70
|
-
}
|
|
71
|
-
if ((position === null || position === void 0 ? void 0 : position.y) !== undefined) {
|
|
72
|
-
this.position.y = position.y;
|
|
73
|
-
}
|
|
74
|
-
if (data.colors !== undefined) {
|
|
75
|
-
if (data.colors instanceof Array) {
|
|
76
|
-
this.colors = [...data.colors];
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
this.colors = data.colors;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
if (data.shapes !== undefined) {
|
|
83
|
-
if (data.shapes instanceof Array) {
|
|
84
|
-
this.shapes = [...data.shapes];
|
|
85
|
-
}
|
|
86
|
-
else {
|
|
87
|
-
this.shapes = data.shapes;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
if (data.scalar !== undefined) {
|
|
91
|
-
this.scalar = data.scalar;
|
|
92
|
-
}
|
|
93
|
-
if (data.zIndex !== undefined) {
|
|
94
|
-
this.zIndex = data.zIndex;
|
|
95
|
-
}
|
|
96
|
-
if (data.disableForReducedMotion !== undefined) {
|
|
97
|
-
this.disableForReducedMotion = data.disableForReducedMotion;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
package/esm/IConfettiOptions.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { ICoordinates, IOptionLoader, RecursivePartial, SingleOrMultiple } from "@tsparticles/engine";
|
|
2
|
-
import type { IConfettiOptions } from "./IConfettiOptions";
|
|
3
|
-
export declare class ConfettiOptions implements IConfettiOptions, IOptionLoader<IConfettiOptions> {
|
|
4
|
-
angle: number;
|
|
5
|
-
colors: SingleOrMultiple<string>;
|
|
6
|
-
count: number;
|
|
7
|
-
decay: number;
|
|
8
|
-
disableForReducedMotion: boolean;
|
|
9
|
-
drift: number;
|
|
10
|
-
gravity: number;
|
|
11
|
-
position: ICoordinates;
|
|
12
|
-
scalar: number;
|
|
13
|
-
shapes: SingleOrMultiple<string>;
|
|
14
|
-
spread: number;
|
|
15
|
-
startVelocity: number;
|
|
16
|
-
ticks: number;
|
|
17
|
-
zIndex: number;
|
|
18
|
-
constructor();
|
|
19
|
-
get origin(): ICoordinates;
|
|
20
|
-
set origin(value: ICoordinates);
|
|
21
|
-
get particleCount(): number;
|
|
22
|
-
set particleCount(value: number);
|
|
23
|
-
load(data?: RecursivePartial<IConfettiOptions>): void;
|
|
24
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { ICoordinates, SingleOrMultiple } from "@tsparticles/engine";
|
|
2
|
-
export interface IConfettiOptions {
|
|
3
|
-
angle: number;
|
|
4
|
-
colors: SingleOrMultiple<string>;
|
|
5
|
-
count: number;
|
|
6
|
-
decay: number;
|
|
7
|
-
disableForReducedMotion: boolean;
|
|
8
|
-
drift: number;
|
|
9
|
-
gravity: number;
|
|
10
|
-
origin: ICoordinates;
|
|
11
|
-
particleCount: number;
|
|
12
|
-
position: ICoordinates;
|
|
13
|
-
scalar: number;
|
|
14
|
-
shapes: SingleOrMultiple<string>;
|
|
15
|
-
spread: number;
|
|
16
|
-
startVelocity: number;
|
|
17
|
-
ticks: number;
|
|
18
|
-
zIndex: number;
|
|
19
|
-
}
|
package/umd/ConfettiOptions.js
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
(function (factory) {
|
|
2
|
-
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
-
var v = factory(require, exports);
|
|
4
|
-
if (v !== undefined) module.exports = v;
|
|
5
|
-
}
|
|
6
|
-
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports"], factory);
|
|
8
|
-
}
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.ConfettiOptions = void 0;
|
|
13
|
-
class ConfettiOptions {
|
|
14
|
-
constructor() {
|
|
15
|
-
this.angle = 90;
|
|
16
|
-
this.count = 50;
|
|
17
|
-
this.spread = 45;
|
|
18
|
-
this.startVelocity = 45;
|
|
19
|
-
this.decay = 0.9;
|
|
20
|
-
this.gravity = 1;
|
|
21
|
-
this.drift = 0;
|
|
22
|
-
this.ticks = 200;
|
|
23
|
-
this.position = {
|
|
24
|
-
x: 50,
|
|
25
|
-
y: 50,
|
|
26
|
-
};
|
|
27
|
-
this.colors = ["#ffffff", "#ff0000"];
|
|
28
|
-
this.shapes = ["square", "circle"];
|
|
29
|
-
this.scalar = 1;
|
|
30
|
-
this.zIndex = 100;
|
|
31
|
-
this.disableForReducedMotion = true;
|
|
32
|
-
}
|
|
33
|
-
get origin() {
|
|
34
|
-
return {
|
|
35
|
-
x: this.position.x / 100,
|
|
36
|
-
y: this.position.y / 100,
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
set origin(value) {
|
|
40
|
-
this.position.x = value.x * 100;
|
|
41
|
-
this.position.y = value.y * 100;
|
|
42
|
-
}
|
|
43
|
-
get particleCount() {
|
|
44
|
-
return this.count;
|
|
45
|
-
}
|
|
46
|
-
set particleCount(value) {
|
|
47
|
-
this.count = value;
|
|
48
|
-
}
|
|
49
|
-
load(data) {
|
|
50
|
-
var _a, _b;
|
|
51
|
-
if (!data) {
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
if (data.angle !== undefined) {
|
|
55
|
-
this.angle = data.angle;
|
|
56
|
-
}
|
|
57
|
-
const count = (_a = data.count) !== null && _a !== void 0 ? _a : data.particleCount;
|
|
58
|
-
if (count !== undefined) {
|
|
59
|
-
this.count = count;
|
|
60
|
-
}
|
|
61
|
-
if (data.spread !== undefined) {
|
|
62
|
-
this.spread = data.spread;
|
|
63
|
-
}
|
|
64
|
-
if (data.startVelocity !== undefined) {
|
|
65
|
-
this.startVelocity = data.startVelocity;
|
|
66
|
-
}
|
|
67
|
-
if (data.decay !== undefined) {
|
|
68
|
-
this.decay = data.decay;
|
|
69
|
-
}
|
|
70
|
-
if (data.gravity !== undefined) {
|
|
71
|
-
this.gravity = data.gravity;
|
|
72
|
-
}
|
|
73
|
-
if (data.drift !== undefined) {
|
|
74
|
-
this.drift = data.drift;
|
|
75
|
-
}
|
|
76
|
-
if (data.ticks !== undefined) {
|
|
77
|
-
this.ticks = data.ticks;
|
|
78
|
-
}
|
|
79
|
-
const position = (_b = data.position) !== null && _b !== void 0 ? _b : this.position;
|
|
80
|
-
if ((position === null || position === void 0 ? void 0 : position.x) !== undefined) {
|
|
81
|
-
this.position.x = position.x;
|
|
82
|
-
}
|
|
83
|
-
if ((position === null || position === void 0 ? void 0 : position.y) !== undefined) {
|
|
84
|
-
this.position.y = position.y;
|
|
85
|
-
}
|
|
86
|
-
if (data.colors !== undefined) {
|
|
87
|
-
if (data.colors instanceof Array) {
|
|
88
|
-
this.colors = [...data.colors];
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
this.colors = data.colors;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
if (data.shapes !== undefined) {
|
|
95
|
-
if (data.shapes instanceof Array) {
|
|
96
|
-
this.shapes = [...data.shapes];
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
99
|
-
this.shapes = data.shapes;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
if (data.scalar !== undefined) {
|
|
103
|
-
this.scalar = data.scalar;
|
|
104
|
-
}
|
|
105
|
-
if (data.zIndex !== undefined) {
|
|
106
|
-
this.zIndex = data.zIndex;
|
|
107
|
-
}
|
|
108
|
-
if (data.disableForReducedMotion !== undefined) {
|
|
109
|
-
this.disableForReducedMotion = data.disableForReducedMotion;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
exports.ConfettiOptions = ConfettiOptions;
|
|
114
|
-
});
|
package/umd/IConfettiOptions.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
(function (factory) {
|
|
2
|
-
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
-
var v = factory(require, exports);
|
|
4
|
-
if (v !== undefined) module.exports = v;
|
|
5
|
-
}
|
|
6
|
-
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports"], factory);
|
|
8
|
-
}
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
});
|