@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.
@@ -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
- }
@@ -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
- });
@@ -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
- });