@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
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see tsparticles.preset.confetti.min.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/
|
|
2
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/move-base"),require("@tsparticles/shape-circle"),require("@tsparticles/updater-color"),require("@tsparticles/updater-opacity"),require("@tsparticles/updater-out-modes"),require("@tsparticles/updater-size"),require("@tsparticles/plugin-emitters"),require("@tsparticles/updater-life"),require("@tsparticles/plugin-motion"),require("@tsparticles/updater-roll"),require("@tsparticles/engine"),require("@tsparticles/shape-square"),require("@tsparticles/updater-tilt"),require("@tsparticles/updater-wobble"));else if("function"==typeof define&&define.amd)define(["@tsparticles/move-base","@tsparticles/shape-circle","@tsparticles/updater-color","@tsparticles/updater-opacity","@tsparticles/updater-out-modes","@tsparticles/updater-size","@tsparticles/plugin-emitters","@tsparticles/updater-life","@tsparticles/plugin-motion","@tsparticles/updater-roll","@tsparticles/engine","@tsparticles/shape-square","@tsparticles/updater-tilt","@tsparticles/updater-wobble"],t);else{var a="object"==typeof exports?t(require("@tsparticles/move-base"),require("@tsparticles/shape-circle"),require("@tsparticles/updater-color"),require("@tsparticles/updater-opacity"),require("@tsparticles/updater-out-modes"),require("@tsparticles/updater-size"),require("@tsparticles/plugin-emitters"),require("@tsparticles/updater-life"),require("@tsparticles/plugin-motion"),require("@tsparticles/updater-roll"),require("@tsparticles/engine"),require("@tsparticles/shape-square"),require("@tsparticles/updater-tilt"),require("@tsparticles/updater-wobble")):t(e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window);for(var i in a)("object"==typeof exports?exports:e)[i]=a[i]}}(this,((e,t,a,i,r,o,s,n,l,c,p,d,u,f)=>(()=>{"use strict";var w={533:e=>{e.exports=p},619:t=>{t.exports=e},68:e=>{e.exports=s},82:e=>{e.exports=l},163:e=>{e.exports=t},652:e=>{e.exports=d},501:e=>{e.exports=a},84:e=>{e.exports=n},686:e=>{e.exports=i},290:e=>{e.exports=r},734:e=>{e.exports=c},2:e=>{e.exports=o},448:e=>{e.exports=u},83:e=>{e.exports=f}},m={};function b(e){var t=m[e];if(void 0!==t)return t.exports;var a=m[e]={exports:{}};return w[e](a,a.exports,b),a.exports}b.d=(e,t)=>{for(var a in t)b.o(t,a)&&!b.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},b.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),b.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var v={};return(()=>{b.r(v),b.d(v,{loadConfettiPreset:()=>q});var e=b(619),t=b(163),a=b(501),i=b(686),r=b(290),o=b(2);var s=b(68),n=b(84),l=b(82),c=b(734),p=b(533);class d{constructor(){this.enable=!1,this.speed=0,this.decay=0,this.sync=!1}load(e){e&&(void 0!==e.enable&&(this.enable=e.enable),void 0!==e.speed&&(this.speed=(0,p.setRangeValue)(e.speed)),void 0!==e.decay&&(this.decay=(0,p.setRangeValue)(e.decay)),void 0!==e.sync&&(this.sync=e.sync))}}class u extends p.ValueWithRandom{constructor(){super(),this.animation=new d,this.direction="clockwise",this.path=!1,this.value=0}load(e){e&&(super.load(e),void 0!==e.direction&&(this.direction=e.direction),this.animation.load(e.animation),void 0!==e.path&&(this.path=e.path))}}class f{constructor(e){this.container=e}init(e){const t=e.options.rotate;if(!t)return;e.rotate={enable:t.animation.enable,value:(0,p.getRangeValue)(t.value)*Math.PI/180},e.pathRotation=t.path;let a=t.direction;if("random"===a){a=Math.floor(2*(0,p.getRandom)())>0?"counter-clockwise":"clockwise"}switch(a){case"counter-clockwise":case"counterClockwise":e.rotate.status="decreasing";break;case"clockwise":e.rotate.status="increasing"}const i=t.animation;i.enable&&(e.rotate.decay=1-(0,p.getRangeValue)(i.decay),e.rotate.velocity=(0,p.getRangeValue)(i.speed)/360*this.container.retina.reduceFactor,i.sync||(e.rotate.velocity*=(0,p.getRandom)())),e.rotation=e.rotate.value}isEnabled(e){const t=e.options.rotate;return!!t&&(!e.destroyed&&!e.spawning&&t.animation.enable&&!t.path)}loadOptions(e,...t){e.rotate||(e.rotate=new u);for(const a of t)e.rotate.load(a?.rotate)}update(e,t){this.isEnabled(e)&&(!function(e,t){const a=e.rotate,i=e.options.rotate;if(!a||!i)return;const r=i.animation,o=(a.velocity??0)*t.factor,s=2*Math.PI,n=a.decay??1;r.enable&&("increasing"===a.status?(a.value+=o,a.value>s&&(a.value-=s)):(a.value-=o,a.value<0&&(a.value+=s)),a.velocity&&1!==n&&(a.velocity*=n))}(e,t),e.rotation=e.rotate?.value??0)}}var w=b(652),m=b(448),y=b(83);const h={fullScreen:{enable:!0,zIndex:100},fpsLimit:120,particles:{number:{value:0},color:{value:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"]},shape:{type:["square","circle"]},opacity:{value:{min:0,max:1},animation:{enable:!0,speed:.5,startValue:"max",destroy:"min"}},size:{value:5},links:{enable:!1},life:{duration:{sync:!0,value:20/6},count:1},move:{angle:{value:45,offset:0},drift:0,enable:!0,gravity:{enable:!0,acceleration:9.81},speed:45,decay:.1,direction:-90,random:!0,straight:!1,outModes:{default:"none",bottom:"destroy"}},rotate:{value:{min:0,max:360},direction:"random",animation:{enable:!0,speed:60}},tilt:{direction:"random",enable:!0,value:{min:0,max:360},animation:{enable:!0,speed:60}},roll:{darken:{enable:!0,value:25},enable:!0,speed:{min:15,max:25}},wobble:{distance:30,enable:!0,speed:{min:-15,max:15}}},detectRetina:!0,motion:{disable:!0},emitters:{name:"confetti",startCount:50,position:{x:50,y:50},size:{width:0,height:0},rate:{delay:0,quantity:0},life:{duration:.1,count:1}}};async function g(p,d=!0){await async function(s,n=!0){await(0,e.loadBaseMover)(s,!1),await(0,t.loadCircleShape)(s,!1),await(0,a.loadColorUpdater)(s,!1),await(0,i.loadOpacityUpdater)(s,!1),await(0,r.loadOutModesUpdater)(s,!1),await(0,o.loadSizeUpdater)(s,!1),await s.refresh(n)}(p,!1),await(0,w.loadSquareShape)(p,!1),await(0,s.loadEmittersPlugin)(p,!1),await(0,l.loadMotionPlugin)(p,!1),await(0,y.loadWobbleUpdater)(p,!1),await(0,c.loadRollUpdater)(p,!1),await async function(e,t=!0){await e.addParticleUpdater("rotate",(e=>new f(e)),t)}(p,!1),await(0,m.loadTiltUpdater)(p,!1),await(0,n.loadLifeUpdater)(p,!1),await p.addPreset("confetti",h,d)}async function q(e){await g(e)}})(),v})()));
|
|
@@ -1,8 +1 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Author : Matteo Bruni
|
|
3
|
-
* MIT license: https://opensource.org/licenses/MIT
|
|
4
|
-
* Demo / Generator : https://particles.js.org/
|
|
5
|
-
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
|
-
* How to use? : Check the GitHub README
|
|
7
|
-
* v3.0.0-alpha.1
|
|
8
|
-
*/
|
|
1
|
+
/*! tsParticles Confetti Preset v3.0.0-beta.1 by Matteo Bruni */
|
package/types/bundle.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { ConfettiOptions } from "./index";
|
|
1
|
+
import { loadConfettiPreset } from "./index";
|
|
3
2
|
import { tsParticles } from "@tsparticles/engine";
|
|
4
|
-
export
|
|
5
|
-
export { confetti, loadConfettiPreset, tsParticles };
|
|
3
|
+
export { loadConfettiPreset, tsParticles };
|
package/types/index.d.ts
CHANGED
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
import type { Engine
|
|
2
|
-
|
|
3
|
-
export declare function loadConfettiPreset(main: Engine): Promise<void>;
|
|
4
|
-
export type ConfettiOptions = RecursivePartial<IConfettiOptions>;
|
|
5
|
-
export type ConfettiFirstParam = string | ConfettiOptions;
|
|
6
|
-
export declare function confetti(idOrOptions: ConfettiFirstParam, confettiOptions?: RecursivePartial<IConfettiOptions>): Promise<void>;
|
|
1
|
+
import type { Engine } from "@tsparticles/engine";
|
|
2
|
+
export declare function loadConfettiPreset(engine: Engine): Promise<void>;
|
package/types/options.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import type { ISourceOptions
|
|
2
|
-
|
|
3
|
-
export declare const loadOptions: (confettiOptions: RecursivePartial<IConfettiOptions>) => ISourceOptions;
|
|
1
|
+
import type { ISourceOptions } from "@tsparticles/engine";
|
|
2
|
+
export declare const options: ISourceOptions;
|
package/umd/bundle.js
CHANGED
|
@@ -9,9 +9,8 @@
|
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.tsParticles = exports.loadConfettiPreset =
|
|
12
|
+
exports.tsParticles = exports.loadConfettiPreset = void 0;
|
|
13
13
|
const index_1 = require("./index");
|
|
14
|
-
Object.defineProperty(exports, "confetti", { enumerable: true, get: function () { return index_1.confetti; } });
|
|
15
14
|
Object.defineProperty(exports, "loadConfettiPreset", { enumerable: true, get: function () { return index_1.loadConfettiPreset; } });
|
|
16
15
|
const engine_1 = require("@tsparticles/engine");
|
|
17
16
|
Object.defineProperty(exports, "tsParticles", { enumerable: true, get: function () { return engine_1.tsParticles; } });
|
package/umd/index.js
CHANGED
|
@@ -4,67 +4,36 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "@tsparticles/
|
|
7
|
+
define(["require", "exports", "@tsparticles/basic", "@tsparticles/plugin-emitters", "@tsparticles/updater-life", "@tsparticles/plugin-motion", "@tsparticles/updater-roll", "@tsparticles/updater-rotate", "@tsparticles/shape-square", "@tsparticles/updater-tilt", "@tsparticles/updater-wobble", "./options"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
13
|
-
const
|
|
14
|
-
const updater_angle_1 = require("@tsparticles/updater-angle");
|
|
15
|
-
const move_base_1 = require("@tsparticles/move-base");
|
|
16
|
-
const shape_circle_1 = require("@tsparticles/shape-circle");
|
|
17
|
-
const updater_color_1 = require("@tsparticles/updater-color");
|
|
12
|
+
exports.loadConfettiPreset = void 0;
|
|
13
|
+
const basic_1 = require("@tsparticles/basic");
|
|
18
14
|
const plugin_emitters_1 = require("@tsparticles/plugin-emitters");
|
|
19
15
|
const updater_life_1 = require("@tsparticles/updater-life");
|
|
20
16
|
const plugin_motion_1 = require("@tsparticles/plugin-motion");
|
|
21
|
-
const updater_opacity_1 = require("@tsparticles/updater-opacity");
|
|
22
|
-
const options_1 = require("./options");
|
|
23
|
-
const updater_out_modes_1 = require("@tsparticles/updater-out-modes");
|
|
24
17
|
const updater_roll_1 = require("@tsparticles/updater-roll");
|
|
25
|
-
const
|
|
18
|
+
const updater_rotate_1 = require("@tsparticles/updater-rotate");
|
|
26
19
|
const shape_square_1 = require("@tsparticles/shape-square");
|
|
27
20
|
const updater_tilt_1 = require("@tsparticles/updater-tilt");
|
|
28
21
|
const updater_wobble_1 = require("@tsparticles/updater-wobble");
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
await (0,
|
|
32
|
-
await (0, shape_square_1.loadSquareShape)(engine);
|
|
33
|
-
await (0,
|
|
34
|
-
await (0,
|
|
35
|
-
await (0,
|
|
36
|
-
await (0,
|
|
37
|
-
await (0,
|
|
38
|
-
await (0,
|
|
39
|
-
await (0,
|
|
40
|
-
await (
|
|
41
|
-
await (0, updater_angle_1.loadAngleUpdater)(engine);
|
|
42
|
-
await (0, updater_tilt_1.loadTiltUpdater)(engine);
|
|
43
|
-
await (0, updater_life_1.loadLifeUpdater)(engine);
|
|
44
|
-
await engine.addPreset("confetti", (0, options_1.loadOptions)(confettiOptions), override);
|
|
22
|
+
const options_1 = require("./options");
|
|
23
|
+
async function loadPreset(engine, refresh = true) {
|
|
24
|
+
await (0, basic_1.loadBasic)(engine, false);
|
|
25
|
+
await (0, shape_square_1.loadSquareShape)(engine, false);
|
|
26
|
+
await (0, plugin_emitters_1.loadEmittersPlugin)(engine, false);
|
|
27
|
+
await (0, plugin_motion_1.loadMotionPlugin)(engine, false);
|
|
28
|
+
await (0, updater_wobble_1.loadWobbleUpdater)(engine, false);
|
|
29
|
+
await (0, updater_roll_1.loadRollUpdater)(engine, false);
|
|
30
|
+
await (0, updater_rotate_1.loadRotateUpdater)(engine, false);
|
|
31
|
+
await (0, updater_tilt_1.loadTiltUpdater)(engine, false);
|
|
32
|
+
await (0, updater_life_1.loadLifeUpdater)(engine, false);
|
|
33
|
+
await engine.addPreset("confetti", options_1.options, refresh);
|
|
45
34
|
}
|
|
46
|
-
async function loadConfettiPreset(
|
|
47
|
-
await loadPreset(
|
|
35
|
+
async function loadConfettiPreset(engine) {
|
|
36
|
+
await loadPreset(engine);
|
|
48
37
|
}
|
|
49
38
|
exports.loadConfettiPreset = loadConfettiPreset;
|
|
50
|
-
async function confetti(idOrOptions, confettiOptions) {
|
|
51
|
-
let options;
|
|
52
|
-
let id;
|
|
53
|
-
if (typeof idOrOptions === "string") {
|
|
54
|
-
id = idOrOptions;
|
|
55
|
-
options = confettiOptions !== null && confettiOptions !== void 0 ? confettiOptions : {};
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
id = `tsparticles_${Math.floor((0, engine_1.getRandom)() * 1000)}`;
|
|
59
|
-
options = idOrOptions;
|
|
60
|
-
}
|
|
61
|
-
await loadPreset(engine_1.tsParticles, options, true);
|
|
62
|
-
await engine_1.tsParticles.load({
|
|
63
|
-
id,
|
|
64
|
-
options: {
|
|
65
|
-
preset: "confetti",
|
|
66
|
-
},
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
exports.confetti = confetti;
|
|
70
39
|
});
|
package/umd/options.js
CHANGED
|
@@ -4,142 +4,137 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports"
|
|
7
|
+
define(["require", "exports"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
exports.options = void 0;
|
|
13
|
+
exports.options = {
|
|
14
|
+
fullScreen: {
|
|
15
|
+
enable: true,
|
|
16
|
+
zIndex: 100,
|
|
17
|
+
},
|
|
18
|
+
fpsLimit: 120,
|
|
19
|
+
particles: {
|
|
20
|
+
number: {
|
|
21
|
+
value: 0,
|
|
21
22
|
},
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
color: {
|
|
24
|
+
value: ["#26ccff", "#a25afd", "#ff5e7e", "#88ff5a", "#fcff42", "#ffa62d", "#ff36ff"],
|
|
25
|
+
},
|
|
26
|
+
shape: {
|
|
27
|
+
type: ["square", "circle"],
|
|
28
|
+
},
|
|
29
|
+
opacity: {
|
|
30
|
+
value: { min: 0, max: 1 },
|
|
31
|
+
animation: {
|
|
32
|
+
enable: true,
|
|
33
|
+
speed: 0.5,
|
|
34
|
+
startValue: "max",
|
|
35
|
+
destroy: "min",
|
|
29
36
|
},
|
|
30
|
-
|
|
31
|
-
|
|
37
|
+
},
|
|
38
|
+
size: {
|
|
39
|
+
value: 5,
|
|
40
|
+
},
|
|
41
|
+
links: {
|
|
42
|
+
enable: false,
|
|
43
|
+
},
|
|
44
|
+
life: {
|
|
45
|
+
duration: {
|
|
46
|
+
sync: true,
|
|
47
|
+
value: 20 / 6,
|
|
32
48
|
},
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
destroy: "min",
|
|
40
|
-
},
|
|
49
|
+
count: 1,
|
|
50
|
+
},
|
|
51
|
+
move: {
|
|
52
|
+
angle: {
|
|
53
|
+
value: 45,
|
|
54
|
+
offset: 0,
|
|
41
55
|
},
|
|
42
|
-
|
|
43
|
-
|
|
56
|
+
drift: 0,
|
|
57
|
+
enable: true,
|
|
58
|
+
gravity: {
|
|
59
|
+
enable: true,
|
|
60
|
+
acceleration: 9.81,
|
|
44
61
|
},
|
|
45
|
-
|
|
46
|
-
|
|
62
|
+
speed: 45,
|
|
63
|
+
decay: 0.1,
|
|
64
|
+
direction: -90,
|
|
65
|
+
random: true,
|
|
66
|
+
straight: false,
|
|
67
|
+
outModes: {
|
|
68
|
+
default: "none",
|
|
69
|
+
bottom: "destroy",
|
|
47
70
|
},
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
count: 1,
|
|
71
|
+
},
|
|
72
|
+
rotate: {
|
|
73
|
+
value: {
|
|
74
|
+
min: 0,
|
|
75
|
+
max: 360,
|
|
54
76
|
},
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
value: actualOptions.spread,
|
|
58
|
-
offset: 0,
|
|
59
|
-
},
|
|
60
|
-
drift: {
|
|
61
|
-
min: -actualOptions.drift,
|
|
62
|
-
max: actualOptions.drift,
|
|
63
|
-
},
|
|
77
|
+
direction: "random",
|
|
78
|
+
animation: {
|
|
64
79
|
enable: true,
|
|
65
|
-
|
|
66
|
-
enable: true,
|
|
67
|
-
acceleration: actualOptions.gravity * 9.81,
|
|
68
|
-
},
|
|
69
|
-
speed: actualOptions.startVelocity,
|
|
70
|
-
decay: 1 - actualOptions.decay,
|
|
71
|
-
direction: -actualOptions.angle,
|
|
72
|
-
random: true,
|
|
73
|
-
straight: false,
|
|
74
|
-
outModes: {
|
|
75
|
-
default: "none",
|
|
76
|
-
bottom: "destroy",
|
|
77
|
-
},
|
|
80
|
+
speed: 60,
|
|
78
81
|
},
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
enable: true,
|
|
87
|
-
speed: 60,
|
|
88
|
-
},
|
|
82
|
+
},
|
|
83
|
+
tilt: {
|
|
84
|
+
direction: "random",
|
|
85
|
+
enable: true,
|
|
86
|
+
value: {
|
|
87
|
+
min: 0,
|
|
88
|
+
max: 360,
|
|
89
89
|
},
|
|
90
|
-
|
|
91
|
-
direction: "random",
|
|
90
|
+
animation: {
|
|
92
91
|
enable: true,
|
|
93
|
-
|
|
94
|
-
min: 0,
|
|
95
|
-
max: 360,
|
|
96
|
-
},
|
|
97
|
-
animation: {
|
|
98
|
-
enable: true,
|
|
99
|
-
speed: 60,
|
|
100
|
-
},
|
|
92
|
+
speed: 60,
|
|
101
93
|
},
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
value: 25,
|
|
106
|
-
},
|
|
94
|
+
},
|
|
95
|
+
roll: {
|
|
96
|
+
darken: {
|
|
107
97
|
enable: true,
|
|
108
|
-
|
|
109
|
-
min: 15,
|
|
110
|
-
max: 25,
|
|
111
|
-
},
|
|
98
|
+
value: 25,
|
|
112
99
|
},
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
min: -15,
|
|
118
|
-
max: 15,
|
|
119
|
-
},
|
|
100
|
+
enable: true,
|
|
101
|
+
speed: {
|
|
102
|
+
min: 15,
|
|
103
|
+
max: 25,
|
|
120
104
|
},
|
|
121
105
|
},
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
position: actualOptions.position,
|
|
129
|
-
size: {
|
|
130
|
-
width: 0,
|
|
131
|
-
height: 0,
|
|
132
|
-
},
|
|
133
|
-
rate: {
|
|
134
|
-
delay: 0,
|
|
135
|
-
quantity: 0,
|
|
136
|
-
},
|
|
137
|
-
life: {
|
|
138
|
-
duration: 0.1,
|
|
139
|
-
count: 1,
|
|
106
|
+
wobble: {
|
|
107
|
+
distance: 30,
|
|
108
|
+
enable: true,
|
|
109
|
+
speed: {
|
|
110
|
+
min: -15,
|
|
111
|
+
max: 15,
|
|
140
112
|
},
|
|
141
113
|
},
|
|
142
|
-
}
|
|
114
|
+
},
|
|
115
|
+
detectRetina: true,
|
|
116
|
+
motion: {
|
|
117
|
+
disable: true,
|
|
118
|
+
},
|
|
119
|
+
emitters: {
|
|
120
|
+
name: "confetti",
|
|
121
|
+
startCount: 50,
|
|
122
|
+
position: {
|
|
123
|
+
x: 50,
|
|
124
|
+
y: 50,
|
|
125
|
+
},
|
|
126
|
+
size: {
|
|
127
|
+
width: 0,
|
|
128
|
+
height: 0,
|
|
129
|
+
},
|
|
130
|
+
rate: {
|
|
131
|
+
delay: 0,
|
|
132
|
+
quantity: 0,
|
|
133
|
+
},
|
|
134
|
+
life: {
|
|
135
|
+
duration: 0.1,
|
|
136
|
+
count: 1,
|
|
137
|
+
},
|
|
138
|
+
},
|
|
143
139
|
};
|
|
144
|
-
exports.loadOptions = loadOptions;
|
|
145
140
|
});
|
|
@@ -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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/cjs/ConfettiOptions.js
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ConfettiOptions = void 0;
|
|
4
|
-
class ConfettiOptions {
|
|
5
|
-
constructor() {
|
|
6
|
-
this.angle = 90;
|
|
7
|
-
this.count = 50;
|
|
8
|
-
this.spread = 45;
|
|
9
|
-
this.startVelocity = 45;
|
|
10
|
-
this.decay = 0.9;
|
|
11
|
-
this.gravity = 1;
|
|
12
|
-
this.drift = 0;
|
|
13
|
-
this.ticks = 200;
|
|
14
|
-
this.position = {
|
|
15
|
-
x: 50,
|
|
16
|
-
y: 50,
|
|
17
|
-
};
|
|
18
|
-
this.colors = ["#ffffff", "#ff0000"];
|
|
19
|
-
this.shapes = ["square", "circle"];
|
|
20
|
-
this.scalar = 1;
|
|
21
|
-
this.zIndex = 100;
|
|
22
|
-
this.disableForReducedMotion = true;
|
|
23
|
-
}
|
|
24
|
-
get origin() {
|
|
25
|
-
return {
|
|
26
|
-
x: this.position.x / 100,
|
|
27
|
-
y: this.position.y / 100,
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
set origin(value) {
|
|
31
|
-
this.position.x = value.x * 100;
|
|
32
|
-
this.position.y = value.y * 100;
|
|
33
|
-
}
|
|
34
|
-
get particleCount() {
|
|
35
|
-
return this.count;
|
|
36
|
-
}
|
|
37
|
-
set particleCount(value) {
|
|
38
|
-
this.count = value;
|
|
39
|
-
}
|
|
40
|
-
load(data) {
|
|
41
|
-
var _a, _b;
|
|
42
|
-
if (!data) {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
if (data.angle !== undefined) {
|
|
46
|
-
this.angle = data.angle;
|
|
47
|
-
}
|
|
48
|
-
const count = (_a = data.count) !== null && _a !== void 0 ? _a : data.particleCount;
|
|
49
|
-
if (count !== undefined) {
|
|
50
|
-
this.count = count;
|
|
51
|
-
}
|
|
52
|
-
if (data.spread !== undefined) {
|
|
53
|
-
this.spread = data.spread;
|
|
54
|
-
}
|
|
55
|
-
if (data.startVelocity !== undefined) {
|
|
56
|
-
this.startVelocity = data.startVelocity;
|
|
57
|
-
}
|
|
58
|
-
if (data.decay !== undefined) {
|
|
59
|
-
this.decay = data.decay;
|
|
60
|
-
}
|
|
61
|
-
if (data.gravity !== undefined) {
|
|
62
|
-
this.gravity = data.gravity;
|
|
63
|
-
}
|
|
64
|
-
if (data.drift !== undefined) {
|
|
65
|
-
this.drift = data.drift;
|
|
66
|
-
}
|
|
67
|
-
if (data.ticks !== undefined) {
|
|
68
|
-
this.ticks = data.ticks;
|
|
69
|
-
}
|
|
70
|
-
const position = (_b = data.position) !== null && _b !== void 0 ? _b : this.position;
|
|
71
|
-
if ((position === null || position === void 0 ? void 0 : position.x) !== undefined) {
|
|
72
|
-
this.position.x = position.x;
|
|
73
|
-
}
|
|
74
|
-
if ((position === null || position === void 0 ? void 0 : position.y) !== undefined) {
|
|
75
|
-
this.position.y = position.y;
|
|
76
|
-
}
|
|
77
|
-
if (data.colors !== undefined) {
|
|
78
|
-
if (data.colors instanceof Array) {
|
|
79
|
-
this.colors = [...data.colors];
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
this.colors = data.colors;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
if (data.shapes !== undefined) {
|
|
86
|
-
if (data.shapes instanceof Array) {
|
|
87
|
-
this.shapes = [...data.shapes];
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
this.shapes = data.shapes;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
if (data.scalar !== undefined) {
|
|
94
|
-
this.scalar = data.scalar;
|
|
95
|
-
}
|
|
96
|
-
if (data.zIndex !== undefined) {
|
|
97
|
-
this.zIndex = data.zIndex;
|
|
98
|
-
}
|
|
99
|
-
if (data.disableForReducedMotion !== undefined) {
|
|
100
|
-
this.disableForReducedMotion = data.disableForReducedMotion;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
exports.ConfettiOptions = ConfettiOptions;
|
package/cjs/IConfettiOptions.js
DELETED