@tsparticles/fireworks 3.6.0-beta.1 → 3.6.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.
@@ -1 +1 @@
1
- /*! tsParticles Fireworks v3.6.0-beta.1 by Matteo Bruni */
1
+ /*! tsParticles Fireworks v3.6.0 by Matteo Bruni */
@@ -4,7 +4,7 @@
4
4
  * Demo / Generator : https://particles.js.org/
5
5
  * GitHub : https://www.github.com/matteobruni/tsparticles
6
6
  * How to use? : Check the GitHub README
7
- * v3.6.0-beta.1
7
+ * v3.6.0
8
8
  */
9
9
  /*
10
10
  * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
@@ -34,7 +34,7 @@ return /******/ (() => { // webpackBootstrap
34
34
  \*****************************************/
35
35
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
36
36
 
37
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ FireworkOptions: () => (/* binding */ FireworkOptions)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n\nclass FireworkOptions {\n constructor() {\n this.background = \"none\";\n this.brightness = {\n min: -30,\n max: 30\n };\n this.colors = [\"#ff595e\", \"#ffca3a\", \"#8ac926\", \"#1982c4\", \"#6a4c93\"];\n this.gravity = 5;\n this.minHeight = {\n min: 10,\n max: 30\n };\n this.rate = 10;\n this.saturation = {\n min: -30,\n max: 30\n };\n this.sounds = true;\n this.speed = {\n min: 5,\n max: 15\n };\n this.splitCount = {\n min: 75,\n max: 150\n };\n }\n load(data) {\n if (!data) {\n return;\n }\n if (data.background !== undefined) {\n this.background = data.background;\n }\n if (data.colors !== undefined) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isArray)(data.colors)) {\n this.colors = [...data.colors];\n } else {\n this.colors = data.colors;\n }\n }\n if (data.brightness !== undefined) {\n this.brightness = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.brightness);\n }\n if (data.gravity !== undefined) {\n this.gravity = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.gravity);\n }\n if (data.minHeight !== undefined) {\n this.minHeight = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.minHeight);\n }\n if (data.rate !== undefined) {\n this.rate = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.rate);\n }\n if (data.saturation !== undefined) {\n this.saturation = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.saturation);\n }\n if (data.sounds !== undefined) {\n this.sounds = data.sounds;\n }\n if (data.speed !== undefined) {\n this.speed = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.speed);\n }\n if (data.splitCount !== undefined) {\n this.splitCount = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.splitCount);\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/fireworks/./dist/browser/FireworkOptions.js?");
37
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ FireworkOptions: () => (/* binding */ FireworkOptions)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n\nclass FireworkOptions {\n constructor() {\n this.background = \"none\";\n this.brightness = {\n min: -30,\n max: 30\n };\n this.colors = [\"#ff595e\", \"#ffca3a\", \"#8ac926\", \"#1982c4\", \"#6a4c93\"];\n this.gravity = 5;\n this.minHeight = {\n min: 10,\n max: 30\n };\n this.rate = 10;\n this.saturation = {\n min: -30,\n max: 30\n };\n this.sounds = true;\n this.speed = {\n min: 5,\n max: 15\n };\n this.splitCount = {\n min: 75,\n max: 150\n };\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n if (data.background !== undefined) {\n this.background = data.background;\n }\n if (data.colors !== undefined) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isArray)(data.colors)) {\n this.colors = [...data.colors];\n } else {\n this.colors = data.colors;\n }\n }\n if (data.brightness !== undefined) {\n this.brightness = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.brightness);\n }\n if (data.gravity !== undefined) {\n this.gravity = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.gravity);\n }\n if (data.minHeight !== undefined) {\n this.minHeight = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.minHeight);\n }\n if (data.rate !== undefined) {\n this.rate = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.rate);\n }\n if (data.saturation !== undefined) {\n this.saturation = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.saturation);\n }\n if (data.sounds !== undefined) {\n this.sounds = data.sounds;\n }\n if (data.speed !== undefined) {\n this.speed = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.speed);\n }\n if (data.splitCount !== undefined) {\n this.splitCount = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.splitCount);\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/fireworks/./dist/browser/FireworkOptions.js?");
38
38
 
39
39
  /***/ }),
40
40
 
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see tsparticles.fireworks.min.js.LICENSE.txt */
2
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/engine"),require("@tsparticles/basic"),require("@tsparticles/updater-destroy"),require("@tsparticles/plugin-emitters"),require("@tsparticles/plugin-emitters-shape-square"),require("@tsparticles/updater-life"),require("@tsparticles/updater-rotate"),require("@tsparticles/plugin-sounds"),require("@tsparticles/effect-trail"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine","@tsparticles/basic","@tsparticles/updater-destroy","@tsparticles/plugin-emitters","@tsparticles/plugin-emitters-shape-square","@tsparticles/updater-life","@tsparticles/updater-rotate","@tsparticles/plugin-sounds","@tsparticles/effect-trail"],t);else{var i="object"==typeof exports?t(require("@tsparticles/engine"),require("@tsparticles/basic"),require("@tsparticles/updater-destroy"),require("@tsparticles/plugin-emitters"),require("@tsparticles/plugin-emitters-shape-square"),require("@tsparticles/updater-life"),require("@tsparticles/updater-rotate"),require("@tsparticles/plugin-sounds"),require("@tsparticles/effect-trail")):t(e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window);for(var s in i)("object"==typeof exports?exports:e)[s]=i[s]}}(this,((e,t,i,s,r,a,o,n,l)=>(()=>{var p={145:e=>{e.exports=t},637:e=>{e.exports=l},303:t=>{t.exports=e},526:e=>{e.exports=s},140:e=>{e.exports=r},933:e=>{e.exports=n},173:e=>{e.exports=i},75:e=>{e.exports=a},668:e=>{e.exports=o}},u={};function c(e){var t=u[e];if(void 0!==t)return t.exports;var i=u[e]={exports:{}};return p[e](i,i.exports,c),i.exports}c.d=(e,t)=>{for(var i in t)c.o(t,i)&&!c.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),c.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var d={};c.r(d),c.d(d,{fireworks:()=>M});var m=c(303);class f{constructor(){this.background="none",this.brightness={min:-30,max:30},this.colors=["#ff595e","#ffca3a","#8ac926","#1982c4","#6a4c93"],this.gravity=5,this.minHeight={min:10,max:30},this.rate=10,this.saturation={min:-30,max:30},this.sounds=!0,this.speed={min:5,max:15},this.splitCount={min:75,max:150}}load(e){e&&(void 0!==e.background&&(this.background=e.background),void 0!==e.colors&&((0,m.isArray)(e.colors)?this.colors=[...e.colors]:this.colors=e.colors),void 0!==e.brightness&&(this.brightness=(0,m.setRangeValue)(e.brightness)),void 0!==e.gravity&&(this.gravity=(0,m.setRangeValue)(e.gravity)),void 0!==e.minHeight&&(this.minHeight=(0,m.setRangeValue)(e.minHeight)),void 0!==e.rate&&(this.rate=(0,m.setRangeValue)(e.rate)),void 0!==e.saturation&&(this.saturation=(0,m.setRangeValue)(e.saturation)),void 0!==e.sounds&&(this.sounds=e.sounds),void 0!==e.speed&&(this.speed=(0,m.setRangeValue)(e.speed)),void 0!==e.splitCount&&(this.splitCount=(0,m.setRangeValue)(e.splitCount)))}}var g=c(145),y=c(173),h=c(526),v=c(140),w=c(75),x=c(668),b=c(933),q=c(637);let P=!1,R=!1;const S=e=>{const t=e.data;return"circle"===t.particle.shape&&!!t.particle.splitCount&&t.particle.splitCount<2};class V{constructor(e){this._container=e}pause(){this._container.pause()}play(){this._container.play()}stop(){this._container.stop()}}async function j(){if(!P){if(R)return new Promise((e=>{const t=setInterval((()=>{P&&(clearInterval(t),e())}),100)}));R=!0,await(0,h.loadEmittersPlugin)(m.tsParticles,!1),await(0,v.loadEmittersShapeSquare)(m.tsParticles,!1),await(0,b.loadSoundsPlugin)(m.tsParticles,!1),await(0,x.loadRotateUpdater)(m.tsParticles,!1),await(0,y.loadDestroyUpdater)(m.tsParticles,!1),await(0,w.loadLifeUpdater)(m.tsParticles,!1),await(0,q.loadTrailEffect)(m.tsParticles,!1),await(0,g.loadBasic)(m.tsParticles,!1),R=!1,P=!0}}async function k(e,t,i){await j();const s=new f;s.load(t);const r=function(e,t){return{detectRetina:!0,background:{color:e.background},fullScreen:{enable:!!t},fpsLimit:60,emitters:{direction:m.MoveDirection.top,life:{count:0,duration:.1,delay:.1},rate:{delay:(0,m.isNumber)(e.rate)?1/e.rate:{min:1/(0,m.getRangeMin)(e.rate),max:1/(0,m.getRangeMax)(e.rate)},quantity:1},size:{width:100,height:0},position:{y:100,x:50}},particles:{number:{value:0},color:{value:"#fff"},destroy:{mode:"split",bounds:{top:(0,m.setRangeValue)(e.minHeight)},split:{sizeOffset:!1,count:1,factor:{value:.333333},rate:{value:e.splitCount},colorOffset:{s:e.saturation,l:e.brightness},particles:{color:{value:e.colors},number:{value:0},opacity:{value:{min:.1,max:1},animation:{enable:!0,speed:1,sync:!1,startValue:m.StartValueType.max,destroy:m.DestroyType.min}},effect:{type:"trail",options:{trail:{length:{min:5,max:10}}}},shape:{type:"circle"},size:{value:{min:1,max:2},animation:{enable:!0,speed:5,count:1,sync:!1,startValue:m.StartValueType.min,destroy:m.DestroyType.none}},life:{count:1,duration:{value:{min:.25,max:.5}}},move:{decay:{min:.05,max:.1},enable:!0,gravity:{enable:!0,inverse:!1,acceleration:(0,m.setRangeValue)(e.gravity)},speed:(0,m.setRangeValue)(e.speed),direction:"none",outModes:m.OutMode.destroy}}}},life:{count:1},effect:{type:"trail",options:{trail:{length:{min:10,max:30},minWidth:1,maxWidth:1}}},shape:{type:"circle"},size:{value:1},opacity:{value:.5},rotate:{path:!0},move:{enable:!0,gravity:{acceleration:15,enable:!0,inverse:!0,maxSpeed:100},speed:{min:10,max:20},outModes:{default:m.OutMode.destroy,top:m.OutMode.none}}},sounds:{enable:e.sounds,events:[{event:m.EventType.particleRemoved,filter:S,audio:["https://particles.js.org/audio/explosion0.mp3","https://particles.js.org/audio/explosion1.mp3","https://particles.js.org/audio/explosion2.mp3"]}],volume:50}}}(s,i),a=await m.tsParticles.load({id:e,element:i,options:r});if(a)return new V(a)}async function M(e,t){let i,s;return(0,m.isString)(e)?(i=e,s=t??{}):(i="fireworks",s=e??{}),k(i,s)}return M.create=async(e,t)=>k(e.id??"fireworks",t??{},e),M.init=async()=>{await j()},M.version=m.tsParticles.version,(0,m.isSsr)()||(window.fireworks=M),d})()));
2
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/engine"),require("@tsparticles/basic"),require("@tsparticles/updater-destroy"),require("@tsparticles/plugin-emitters"),require("@tsparticles/plugin-emitters-shape-square"),require("@tsparticles/updater-life"),require("@tsparticles/updater-rotate"),require("@tsparticles/plugin-sounds"),require("@tsparticles/effect-trail"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine","@tsparticles/basic","@tsparticles/updater-destroy","@tsparticles/plugin-emitters","@tsparticles/plugin-emitters-shape-square","@tsparticles/updater-life","@tsparticles/updater-rotate","@tsparticles/plugin-sounds","@tsparticles/effect-trail"],t);else{var i="object"==typeof exports?t(require("@tsparticles/engine"),require("@tsparticles/basic"),require("@tsparticles/updater-destroy"),require("@tsparticles/plugin-emitters"),require("@tsparticles/plugin-emitters-shape-square"),require("@tsparticles/updater-life"),require("@tsparticles/updater-rotate"),require("@tsparticles/plugin-sounds"),require("@tsparticles/effect-trail")):t(e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window);for(var s in i)("object"==typeof exports?exports:e)[s]=i[s]}}(this,((e,t,i,s,r,a,o,n,l)=>(()=>{var p={145:e=>{e.exports=t},637:e=>{e.exports=l},303:t=>{t.exports=e},526:e=>{e.exports=s},140:e=>{e.exports=r},933:e=>{e.exports=n},173:e=>{e.exports=i},75:e=>{e.exports=a},668:e=>{e.exports=o}},u={};function c(e){var t=u[e];if(void 0!==t)return t.exports;var i=u[e]={exports:{}};return p[e](i,i.exports,c),i.exports}c.d=(e,t)=>{for(var i in t)c.o(t,i)&&!c.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),c.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var d={};c.r(d),c.d(d,{fireworks:()=>M});var m=c(303);class f{constructor(){this.background="none",this.brightness={min:-30,max:30},this.colors=["#ff595e","#ffca3a","#8ac926","#1982c4","#6a4c93"],this.gravity=5,this.minHeight={min:10,max:30},this.rate=10,this.saturation={min:-30,max:30},this.sounds=!0,this.speed={min:5,max:15},this.splitCount={min:75,max:150}}load(e){(0,m.isNull)(e)||(void 0!==e.background&&(this.background=e.background),void 0!==e.colors&&((0,m.isArray)(e.colors)?this.colors=[...e.colors]:this.colors=e.colors),void 0!==e.brightness&&(this.brightness=(0,m.setRangeValue)(e.brightness)),void 0!==e.gravity&&(this.gravity=(0,m.setRangeValue)(e.gravity)),void 0!==e.minHeight&&(this.minHeight=(0,m.setRangeValue)(e.minHeight)),void 0!==e.rate&&(this.rate=(0,m.setRangeValue)(e.rate)),void 0!==e.saturation&&(this.saturation=(0,m.setRangeValue)(e.saturation)),void 0!==e.sounds&&(this.sounds=e.sounds),void 0!==e.speed&&(this.speed=(0,m.setRangeValue)(e.speed)),void 0!==e.splitCount&&(this.splitCount=(0,m.setRangeValue)(e.splitCount)))}}var g=c(145),y=c(173),h=c(526),v=c(140),w=c(75),x=c(668),b=c(933),q=c(637);let P=!1,R=!1;const S=e=>{const t=e.data;return"circle"===t.particle.shape&&!!t.particle.splitCount&&t.particle.splitCount<2};class V{constructor(e){this._container=e}pause(){this._container.pause()}play(){this._container.play()}stop(){this._container.stop()}}async function j(){if(!P){if(R)return new Promise((e=>{const t=setInterval((()=>{P&&(clearInterval(t),e())}),100)}));R=!0,await(0,h.loadEmittersPlugin)(m.tsParticles,!1),await(0,v.loadEmittersShapeSquare)(m.tsParticles,!1),await(0,b.loadSoundsPlugin)(m.tsParticles,!1),await(0,x.loadRotateUpdater)(m.tsParticles,!1),await(0,y.loadDestroyUpdater)(m.tsParticles,!1),await(0,w.loadLifeUpdater)(m.tsParticles,!1),await(0,q.loadTrailEffect)(m.tsParticles,!1),await(0,g.loadBasic)(m.tsParticles,!1),R=!1,P=!0}}async function k(e,t,i){await j();const s=new f;s.load(t);const r=function(e,t){return{detectRetina:!0,background:{color:e.background},fullScreen:{enable:!!t},fpsLimit:60,emitters:{direction:m.MoveDirection.top,life:{count:0,duration:.1,delay:.1},rate:{delay:(0,m.isNumber)(e.rate)?1/e.rate:{min:1/(0,m.getRangeMin)(e.rate),max:1/(0,m.getRangeMax)(e.rate)},quantity:1},size:{width:100,height:0},position:{y:100,x:50}},particles:{number:{value:0},color:{value:"#fff"},destroy:{mode:"split",bounds:{top:(0,m.setRangeValue)(e.minHeight)},split:{sizeOffset:!1,count:1,factor:{value:.333333},rate:{value:e.splitCount},colorOffset:{s:e.saturation,l:e.brightness},particles:{color:{value:e.colors},number:{value:0},opacity:{value:{min:.1,max:1},animation:{enable:!0,speed:1,sync:!1,startValue:m.StartValueType.max,destroy:m.DestroyType.min}},effect:{type:"trail",options:{trail:{length:{min:5,max:10}}}},shape:{type:"circle"},size:{value:{min:1,max:2},animation:{enable:!0,speed:5,count:1,sync:!1,startValue:m.StartValueType.min,destroy:m.DestroyType.none}},life:{count:1,duration:{value:{min:.25,max:.5}}},move:{decay:{min:.05,max:.1},enable:!0,gravity:{enable:!0,inverse:!1,acceleration:(0,m.setRangeValue)(e.gravity)},speed:(0,m.setRangeValue)(e.speed),direction:"none",outModes:m.OutMode.destroy}}}},life:{count:1},effect:{type:"trail",options:{trail:{length:{min:10,max:30},minWidth:1,maxWidth:1}}},shape:{type:"circle"},size:{value:1},opacity:{value:.5},rotate:{path:!0},move:{enable:!0,gravity:{acceleration:15,enable:!0,inverse:!0,maxSpeed:100},speed:{min:10,max:20},outModes:{default:m.OutMode.destroy,top:m.OutMode.none}}},sounds:{enable:e.sounds,events:[{event:m.EventType.particleRemoved,filter:S,audio:["https://particles.js.org/audio/explosion0.mp3","https://particles.js.org/audio/explosion1.mp3","https://particles.js.org/audio/explosion2.mp3"]}],volume:50}}}(s,i),a=await m.tsParticles.load({id:e,element:i,options:r});if(a)return new V(a)}async function M(e,t){let i,s;return(0,m.isString)(e)?(i=e,s=t??{}):(i="fireworks",s=e??{}),k(i,s)}return M.create=async(e,t)=>k(e.id??"fireworks",t??{},e),M.init=async()=>{await j()},M.version=m.tsParticles.version,(0,m.isSsr)()||(window.fireworks=M),d})()));
@@ -1 +1 @@
1
- /*! tsParticles Fireworks v3.6.0-beta.1 by Matteo Bruni */
1
+ /*! tsParticles Fireworks v3.6.0 by Matteo Bruni */
@@ -37,7 +37,7 @@
37
37
  };
38
38
  }
39
39
  load(data) {
40
- if (!data) {
40
+ if ((0, engine_1.isNull)(data)) {
41
41
  return;
42
42
  }
43
43
  if (data.background !== undefined) {