@tsparticles/fireworks 3.0.0-beta.0 → 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 +1 @@
1
- /*! tsParticles Fireworks v3.0.0-beta.0 by Matteo Bruni */
1
+ /*! tsParticles Fireworks v3.0.0-beta.2 by Matteo Bruni */
@@ -4,18 +4,18 @@
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.0.0-beta.0
7
+ * v3.0.0-beta.2
8
8
  */
9
9
  (function webpackUniversalModuleDefinition(root, factory) {
10
10
  if(typeof exports === 'object' && typeof module === 'object')
11
- module.exports = factory(require("@tsparticles/engine"), require("@tsparticles/updater-destroy"), require("@tsparticles/plugin-emitters"), require("@tsparticles/updater-life"), require("@tsparticles/shape-line"), require("@tsparticles/plugin-sounds"), require("@tsparticles/updater-stroke-color"), 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"));
11
+ module.exports = factory(require("@tsparticles/engine"), 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/updater-destroy"), require("@tsparticles/plugin-emitters"), require("@tsparticles/updater-life"), require("@tsparticles/shape-line"), require("@tsparticles/plugin-sounds"), require("@tsparticles/updater-stroke-color"));
12
12
  else if(typeof define === 'function' && define.amd)
13
- define(["@tsparticles/engine", "@tsparticles/updater-destroy", "@tsparticles/plugin-emitters", "@tsparticles/updater-life", "@tsparticles/shape-line", "@tsparticles/plugin-sounds", "@tsparticles/updater-stroke-color", "@tsparticles/move-base", "@tsparticles/shape-circle", "@tsparticles/updater-color", "@tsparticles/updater-opacity", "@tsparticles/updater-out-modes", "@tsparticles/updater-size"], factory);
13
+ define(["@tsparticles/engine", "@tsparticles/move-base", "@tsparticles/shape-circle", "@tsparticles/updater-color", "@tsparticles/updater-opacity", "@tsparticles/updater-out-modes", "@tsparticles/updater-size", "@tsparticles/updater-destroy", "@tsparticles/plugin-emitters", "@tsparticles/updater-life", "@tsparticles/shape-line", "@tsparticles/plugin-sounds", "@tsparticles/updater-stroke-color"], factory);
14
14
  else {
15
- var a = typeof exports === 'object' ? factory(require("@tsparticles/engine"), require("@tsparticles/updater-destroy"), require("@tsparticles/plugin-emitters"), require("@tsparticles/updater-life"), require("@tsparticles/shape-line"), require("@tsparticles/plugin-sounds"), require("@tsparticles/updater-stroke-color"), 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")) : factory(root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"]);
15
+ var a = typeof exports === 'object' ? factory(require("@tsparticles/engine"), 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/updater-destroy"), require("@tsparticles/plugin-emitters"), require("@tsparticles/updater-life"), require("@tsparticles/shape-line"), require("@tsparticles/plugin-sounds"), require("@tsparticles/updater-stroke-color")) : factory(root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"]);
16
16
  for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
17
17
  }
18
- })(this, (__WEBPACK_EXTERNAL_MODULE__533__, __WEBPACK_EXTERNAL_MODULE__344__, __WEBPACK_EXTERNAL_MODULE__68__, __WEBPACK_EXTERNAL_MODULE__84__, __WEBPACK_EXTERNAL_MODULE__137__, __WEBPACK_EXTERNAL_MODULE__490__, __WEBPACK_EXTERNAL_MODULE__204__, __WEBPACK_EXTERNAL_MODULE__619__, __WEBPACK_EXTERNAL_MODULE__163__, __WEBPACK_EXTERNAL_MODULE__501__, __WEBPACK_EXTERNAL_MODULE__686__, __WEBPACK_EXTERNAL_MODULE__290__, __WEBPACK_EXTERNAL_MODULE__2__) => {
18
+ })(this, (__WEBPACK_EXTERNAL_MODULE__533__, __WEBPACK_EXTERNAL_MODULE__619__, __WEBPACK_EXTERNAL_MODULE__163__, __WEBPACK_EXTERNAL_MODULE__501__, __WEBPACK_EXTERNAL_MODULE__686__, __WEBPACK_EXTERNAL_MODULE__290__, __WEBPACK_EXTERNAL_MODULE__2__, __WEBPACK_EXTERNAL_MODULE__344__, __WEBPACK_EXTERNAL_MODULE__68__, __WEBPACK_EXTERNAL_MODULE__84__, __WEBPACK_EXTERNAL_MODULE__137__, __WEBPACK_EXTERNAL_MODULE__490__, __WEBPACK_EXTERNAL_MODULE__204__) => {
19
19
  return /******/ (() => { // webpackBootstrap
20
20
  /******/ "use strict";
21
21
  /******/ var __webpack_modules__ = ({
@@ -258,7 +258,7 @@ var updater_opacity_root_window_ = __webpack_require__(686);
258
258
  var updater_out_modes_root_window_ = __webpack_require__(290);
259
259
  // EXTERNAL MODULE: external {"commonjs":"@tsparticles/updater-size","commonjs2":"@tsparticles/updater-size","amd":"@tsparticles/updater-size","root":"window"}
260
260
  var updater_size_root_window_ = __webpack_require__(2);
261
- ;// CONCATENATED MODULE: ../basic/dist/esm/index.js
261
+ ;// CONCATENATED MODULE: ../basic/dist/browser/index.js
262
262
 
263
263
 
264
264
 
@@ -282,7 +282,7 @@ var plugin_emitters_root_window_ = __webpack_require__(68);
282
282
  var updater_life_root_window_ = __webpack_require__(84);
283
283
  // EXTERNAL MODULE: external {"commonjs":"@tsparticles/shape-line","commonjs2":"@tsparticles/shape-line","amd":"@tsparticles/shape-line","root":"window"}
284
284
  var shape_line_root_window_ = __webpack_require__(137);
285
- ;// CONCATENATED MODULE: ../../updaters/rotate/dist/esm/Options/Classes/RotateAnimation.js
285
+ ;// CONCATENATED MODULE: ../../updaters/rotate/dist/browser/Options/Classes/RotateAnimation.js
286
286
 
287
287
  class RotateAnimation {
288
288
  constructor() {
@@ -309,7 +309,7 @@ class RotateAnimation {
309
309
  }
310
310
  }
311
311
  }
312
- ;// CONCATENATED MODULE: ../../updaters/rotate/dist/esm/Options/Classes/Rotate.js
312
+ ;// CONCATENATED MODULE: ../../updaters/rotate/dist/browser/Options/Classes/Rotate.js
313
313
 
314
314
 
315
315
  class Rotate extends engine_root_window_.ValueWithRandom {
@@ -334,7 +334,7 @@ class Rotate extends engine_root_window_.ValueWithRandom {
334
334
  }
335
335
  }
336
336
  }
337
- ;// CONCATENATED MODULE: ../../updaters/rotate/dist/esm/RotateUpdater.js
337
+ ;// CONCATENATED MODULE: ../../updaters/rotate/dist/browser/RotateUpdater.js
338
338
 
339
339
 
340
340
  function updateRotate(particle, delta) {
@@ -430,7 +430,7 @@ class RotateUpdater {
430
430
  particle.rotation = particle.rotate?.value ?? 0;
431
431
  }
432
432
  }
433
- ;// CONCATENATED MODULE: ../../updaters/rotate/dist/esm/index.js
433
+ ;// CONCATENATED MODULE: ../../updaters/rotate/dist/browser/index.js
434
434
 
435
435
  async function loadRotateUpdater(engine, refresh = true) {
436
436
  await engine.addParticleUpdater("rotate", container => new RotateUpdater(container), refresh);
@@ -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/updater-destroy"),require("@tsparticles/plugin-emitters"),require("@tsparticles/updater-life"),require("@tsparticles/shape-line"),require("@tsparticles/plugin-sounds"),require("@tsparticles/updater-stroke-color"),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"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine","@tsparticles/updater-destroy","@tsparticles/plugin-emitters","@tsparticles/updater-life","@tsparticles/shape-line","@tsparticles/plugin-sounds","@tsparticles/updater-stroke-color","@tsparticles/move-base","@tsparticles/shape-circle","@tsparticles/updater-color","@tsparticles/updater-opacity","@tsparticles/updater-out-modes","@tsparticles/updater-size"],t);else{var a="object"==typeof exports?t(require("@tsparticles/engine"),require("@tsparticles/updater-destroy"),require("@tsparticles/plugin-emitters"),require("@tsparticles/updater-life"),require("@tsparticles/shape-line"),require("@tsparticles/plugin-sounds"),require("@tsparticles/updater-stroke-color"),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")):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);for(var i in a)("object"==typeof exports?exports:e)[i]=a[i]}}(this,((e,t,a,i,s,r,o,n,l,c,p,d,u)=>(()=>{"use strict";var h={533:t=>{t.exports=e},619:e=>{e.exports=n},68:e=>{e.exports=a},490:e=>{e.exports=r},163:e=>{e.exports=l},137:e=>{e.exports=s},501:e=>{e.exports=c},344:e=>{e.exports=t},84:e=>{e.exports=i},686:e=>{e.exports=p},290:e=>{e.exports=d},2:e=>{e.exports=u},204:e=>{e.exports=o}},m={};function v(e){var t=m[e];if(void 0!==t)return t.exports;var a=m[e]={exports:{}};return h[e](a,a.exports,v),a.exports}v.d=(e,t)=>{for(var a in t)v.o(t,a)&&!v.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},v.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),v.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var y={};return(()=>{v.r(y),v.d(y,{fireworks:()=>P});var e=v(533);class t{constructor(){this.brightness={min:-30,max:30},this.colors=["#ff595e","#ffca3a","#8ac926","#1982c4","#6a4c93"],this.gravity=5,this.minHeight={min:10,max:30},this.rate=20,this.saturation={min:-30,max:30},this.sounds=!0,this.speed={min:5,max:15},this.splitCount={min:75,max:150}}load(t){t&&(void 0!==t.colors&&((0,e.isArray)(t.colors)?this.colors=[...t.colors]:this.colors=t.colors),void 0!==t.brightness&&(this.brightness=(0,e.setRangeValue)(t.brightness)),void 0!==t.gravity&&(this.gravity=(0,e.setRangeValue)(t.gravity)),void 0!==t.minHeight&&(this.minHeight=(0,e.setRangeValue)(t.minHeight)),void 0!==t.rate&&(this.rate=(0,e.setRangeValue)(t.rate)),void 0!==t.saturation&&(this.saturation=(0,e.setRangeValue)(t.saturation)),void 0!==t.sounds&&(this.sounds=t.sounds),void 0!==t.speed&&(this.speed=(0,e.setRangeValue)(t.speed)),void 0!==t.splitCount&&(this.splitCount=(0,e.setRangeValue)(t.splitCount)))}}var a=v(619),i=v(163),s=v(501),r=v(686),o=v(290),n=v(2);var l=v(344),c=v(68),p=v(84),d=v(137);class u{constructor(){this.enable=!1,this.speed=0,this.decay=0,this.sync=!1}load(t){t&&(void 0!==t.enable&&(this.enable=t.enable),void 0!==t.speed&&(this.speed=(0,e.setRangeValue)(t.speed)),void 0!==t.decay&&(this.decay=(0,e.setRangeValue)(t.decay)),void 0!==t.sync&&(this.sync=t.sync))}}class h extends e.ValueWithRandom{constructor(){super(),this.animation=new u,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 m{constructor(e){this.container=e}init(t){const a=t.options.rotate;if(!a)return;t.rotate={enable:a.animation.enable,value:(0,e.getRangeValue)(a.value)*Math.PI/180},t.pathRotation=a.path;let i=a.direction;if("random"===i){i=Math.floor(2*(0,e.getRandom)())>0?"counter-clockwise":"clockwise"}switch(i){case"counter-clockwise":case"counterClockwise":t.rotate.status="decreasing";break;case"clockwise":t.rotate.status="increasing"}const s=a.animation;s.enable&&(t.rotate.decay=1-(0,e.getRangeValue)(s.decay),t.rotate.velocity=(0,e.getRangeValue)(s.speed)/360*this.container.retina.reduceFactor,s.sync||(t.rotate.velocity*=(0,e.getRandom)())),t.rotation=t.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 h);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 s=i.animation,r=(a.velocity??0)*t.factor,o=2*Math.PI,n=a.decay??1;s.enable&&("increasing"===a.status?(a.value+=r,a.value>o&&(a.value-=o)):(a.value-=r,a.value<0&&(a.value+=o)),a.velocity&&1!==n&&(a.velocity*=n))}(e,t),e.rotation=e.rotate?.value??0)}}var g=v(490),w=v(204);let f=!1,b=!1;const x=e=>"line"===e.data.particle.shape;class q{constructor(e){this._container=e}pause(){this._container.pause()}play(){this._container.play()}stop(){this._container.stop()}}async function R(){if(!f){if(b)return new Promise((e=>{const t=setInterval((()=>{f&&(clearInterval(t),e())}),100)}));b=!0,await(0,c.loadEmittersPlugin)(e.tsParticles,!1),await(0,g.loadSoundsPlugin)(e.tsParticles,!1),await(0,d.loadLineShape)(e.tsParticles,!1),await async function(e,t=!0){await e.addParticleUpdater("rotate",(e=>new m(e)),t)}(e.tsParticles,!1),await(0,l.loadDestroyUpdater)(e.tsParticles,!1),await(0,p.loadLifeUpdater)(e.tsParticles,!1),await(0,w.loadStrokeColorUpdater)(e.tsParticles,!1),await async function(e,t=!0){await(0,a.loadBaseMover)(e,!1),await(0,i.loadCircleShape)(e,!1),await(0,s.loadColorUpdater)(e,!1),await(0,r.loadOpacityUpdater)(e,!1),await(0,o.loadOutModesUpdater)(e,!1),await(0,n.loadSizeUpdater)(e,!1),await e.refresh(t)}(e.tsParticles,!1),b=!1,f=!0}}async function P(a,i){let s;await R();const r=new t;(0,e.isString)(a)?(s=a,r.load(i)):(s="fireworks",r.load(a));const o={detectRetina:!0,background:{color:"#000"},fpsLimit:120,emitters:{direction:"top",life:{count:0,duration:.1,delay:.1},rate:{delay:(0,e.isNumber)(r.rate)?1/r.rate:{min:1/(0,e.getRangeMin)(r.rate),max:1/(0,e.getRangeMax)(r.rate)},quantity:1},size:{width:100,height:0},position:{y:100,x:50}},particles:{number:{value:0},color:{value:r.colors},destroy:{mode:"split",bounds:{top:(0,e.setRangeValue)(r.minHeight)},split:{sizeOffset:!1,count:1,factor:{value:.333333},rate:{value:r.splitCount},colorOffset:{s:r.saturation,l:r.brightness},particles:{stroke:{width:0},number:{value:0},opacity:{value:{min:.1,max:1},animation:{enable:!0,speed:.7,sync:!1,startValue:"max",destroy:"min"}},shape:{type:"circle"},size:{value:{min:1,max:2},animation:{enable:!0,speed:5,count:1,sync:!1,startValue:"min",destroy:"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,e.setRangeValue)(r.gravity)},speed:(0,e.setRangeValue)(r.speed),direction:"none",outModes:"destroy"}}}},life:{count:1},shape:{type:"line",options:{line:{cap:"round"}}},size:{value:{min:.1,max:50},animation:{enable:!0,sync:!0,speed:90,startValue:"max",destroy:"min"}},stroke:{color:{value:"#ffffff"},width:.5},rotate:{path:!0},move:{enable:!0,gravity:{acceleration:15,enable:!0,inverse:!0,maxSpeed:100},speed:{min:10,max:20},outModes:{default:"destroy",top:"none"},trail:{fill:{color:"#000"},enable:!0,length:10}}},sounds:{enable:r.sounds,events:[{event:"particleRemoved",filter:x,audio:["https://particles.js.org/audio/explosion0.mp3","https://particles.js.org/audio/explosion1.mp3","https://particles.js.org/audio/explosion2.mp3"]}],volume:50}},n=await e.tsParticles.load({id:s,options:o});if(n)return new q(n)}P.version=e.tsParticles.version,(0,e.isSsr)()||(window.fireworks=P)})(),y})()));
2
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/engine"),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/updater-destroy"),require("@tsparticles/plugin-emitters"),require("@tsparticles/updater-life"),require("@tsparticles/shape-line"),require("@tsparticles/plugin-sounds"),require("@tsparticles/updater-stroke-color"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine","@tsparticles/move-base","@tsparticles/shape-circle","@tsparticles/updater-color","@tsparticles/updater-opacity","@tsparticles/updater-out-modes","@tsparticles/updater-size","@tsparticles/updater-destroy","@tsparticles/plugin-emitters","@tsparticles/updater-life","@tsparticles/shape-line","@tsparticles/plugin-sounds","@tsparticles/updater-stroke-color"],t);else{var a="object"==typeof exports?t(require("@tsparticles/engine"),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/updater-destroy"),require("@tsparticles/plugin-emitters"),require("@tsparticles/updater-life"),require("@tsparticles/shape-line"),require("@tsparticles/plugin-sounds"),require("@tsparticles/updater-stroke-color")):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);for(var i in a)("object"==typeof exports?exports:e)[i]=a[i]}}(this,((e,t,a,i,s,r,o,n,l,c,p,d,u)=>(()=>{"use strict";var h={533:t=>{t.exports=e},619:e=>{e.exports=t},68:e=>{e.exports=l},490:e=>{e.exports=d},163:e=>{e.exports=a},137:e=>{e.exports=p},501:e=>{e.exports=i},344:e=>{e.exports=n},84:e=>{e.exports=c},686:e=>{e.exports=s},290:e=>{e.exports=r},2:e=>{e.exports=o},204:e=>{e.exports=u}},m={};function v(e){var t=m[e];if(void 0!==t)return t.exports;var a=m[e]={exports:{}};return h[e](a,a.exports,v),a.exports}v.d=(e,t)=>{for(var a in t)v.o(t,a)&&!v.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},v.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),v.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var y={};return(()=>{v.r(y),v.d(y,{fireworks:()=>P});var e=v(533);class t{constructor(){this.brightness={min:-30,max:30},this.colors=["#ff595e","#ffca3a","#8ac926","#1982c4","#6a4c93"],this.gravity=5,this.minHeight={min:10,max:30},this.rate=20,this.saturation={min:-30,max:30},this.sounds=!0,this.speed={min:5,max:15},this.splitCount={min:75,max:150}}load(t){t&&(void 0!==t.colors&&((0,e.isArray)(t.colors)?this.colors=[...t.colors]:this.colors=t.colors),void 0!==t.brightness&&(this.brightness=(0,e.setRangeValue)(t.brightness)),void 0!==t.gravity&&(this.gravity=(0,e.setRangeValue)(t.gravity)),void 0!==t.minHeight&&(this.minHeight=(0,e.setRangeValue)(t.minHeight)),void 0!==t.rate&&(this.rate=(0,e.setRangeValue)(t.rate)),void 0!==t.saturation&&(this.saturation=(0,e.setRangeValue)(t.saturation)),void 0!==t.sounds&&(this.sounds=t.sounds),void 0!==t.speed&&(this.speed=(0,e.setRangeValue)(t.speed)),void 0!==t.splitCount&&(this.splitCount=(0,e.setRangeValue)(t.splitCount)))}}var a=v(619),i=v(163),s=v(501),r=v(686),o=v(290),n=v(2);var l=v(344),c=v(68),p=v(84),d=v(137);class u{constructor(){this.enable=!1,this.speed=0,this.decay=0,this.sync=!1}load(t){t&&(void 0!==t.enable&&(this.enable=t.enable),void 0!==t.speed&&(this.speed=(0,e.setRangeValue)(t.speed)),void 0!==t.decay&&(this.decay=(0,e.setRangeValue)(t.decay)),void 0!==t.sync&&(this.sync=t.sync))}}class h extends e.ValueWithRandom{constructor(){super(),this.animation=new u,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 m{constructor(e){this.container=e}init(t){const a=t.options.rotate;if(!a)return;t.rotate={enable:a.animation.enable,value:(0,e.getRangeValue)(a.value)*Math.PI/180},t.pathRotation=a.path;let i=a.direction;if("random"===i){i=Math.floor(2*(0,e.getRandom)())>0?"counter-clockwise":"clockwise"}switch(i){case"counter-clockwise":case"counterClockwise":t.rotate.status="decreasing";break;case"clockwise":t.rotate.status="increasing"}const s=a.animation;s.enable&&(t.rotate.decay=1-(0,e.getRangeValue)(s.decay),t.rotate.velocity=(0,e.getRangeValue)(s.speed)/360*this.container.retina.reduceFactor,s.sync||(t.rotate.velocity*=(0,e.getRandom)())),t.rotation=t.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 h);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 s=i.animation,r=(a.velocity??0)*t.factor,o=2*Math.PI,n=a.decay??1;s.enable&&("increasing"===a.status?(a.value+=r,a.value>o&&(a.value-=o)):(a.value-=r,a.value<0&&(a.value+=o)),a.velocity&&1!==n&&(a.velocity*=n))}(e,t),e.rotation=e.rotate?.value??0)}}var g=v(490),w=v(204);let f=!1,b=!1;const x=e=>"line"===e.data.particle.shape;class q{constructor(e){this._container=e}pause(){this._container.pause()}play(){this._container.play()}stop(){this._container.stop()}}async function R(){if(!f){if(b)return new Promise((e=>{const t=setInterval((()=>{f&&(clearInterval(t),e())}),100)}));b=!0,await(0,c.loadEmittersPlugin)(e.tsParticles,!1),await(0,g.loadSoundsPlugin)(e.tsParticles,!1),await(0,d.loadLineShape)(e.tsParticles,!1),await async function(e,t=!0){await e.addParticleUpdater("rotate",(e=>new m(e)),t)}(e.tsParticles,!1),await(0,l.loadDestroyUpdater)(e.tsParticles,!1),await(0,p.loadLifeUpdater)(e.tsParticles,!1),await(0,w.loadStrokeColorUpdater)(e.tsParticles,!1),await async function(e,t=!0){await(0,a.loadBaseMover)(e,!1),await(0,i.loadCircleShape)(e,!1),await(0,s.loadColorUpdater)(e,!1),await(0,r.loadOpacityUpdater)(e,!1),await(0,o.loadOutModesUpdater)(e,!1),await(0,n.loadSizeUpdater)(e,!1),await e.refresh(t)}(e.tsParticles,!1),b=!1,f=!0}}async function P(a,i){let s;await R();const r=new t;(0,e.isString)(a)?(s=a,r.load(i)):(s="fireworks",r.load(a));const o={detectRetina:!0,background:{color:"#000"},fpsLimit:120,emitters:{direction:"top",life:{count:0,duration:.1,delay:.1},rate:{delay:(0,e.isNumber)(r.rate)?1/r.rate:{min:1/(0,e.getRangeMin)(r.rate),max:1/(0,e.getRangeMax)(r.rate)},quantity:1},size:{width:100,height:0},position:{y:100,x:50}},particles:{number:{value:0},color:{value:r.colors},destroy:{mode:"split",bounds:{top:(0,e.setRangeValue)(r.minHeight)},split:{sizeOffset:!1,count:1,factor:{value:.333333},rate:{value:r.splitCount},colorOffset:{s:r.saturation,l:r.brightness},particles:{stroke:{width:0},number:{value:0},opacity:{value:{min:.1,max:1},animation:{enable:!0,speed:.7,sync:!1,startValue:"max",destroy:"min"}},shape:{type:"circle"},size:{value:{min:1,max:2},animation:{enable:!0,speed:5,count:1,sync:!1,startValue:"min",destroy:"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,e.setRangeValue)(r.gravity)},speed:(0,e.setRangeValue)(r.speed),direction:"none",outModes:"destroy"}}}},life:{count:1},shape:{type:"line",options:{line:{cap:"round"}}},size:{value:{min:.1,max:50},animation:{enable:!0,sync:!0,speed:90,startValue:"max",destroy:"min"}},stroke:{color:{value:"#ffffff"},width:.5},rotate:{path:!0},move:{enable:!0,gravity:{acceleration:15,enable:!0,inverse:!0,maxSpeed:100},speed:{min:10,max:20},outModes:{default:"destroy",top:"none"},trail:{fill:{color:"#000"},enable:!0,length:10}}},sounds:{enable:r.sounds,events:[{event:"particleRemoved",filter:x,audio:["https://particles.js.org/audio/explosion0.mp3","https://particles.js.org/audio/explosion1.mp3","https://particles.js.org/audio/explosion2.mp3"]}],volume:50}},n=await e.tsParticles.load({id:s,options:o});if(n)return new q(n)}P.version=e.tsParticles.version,(0,e.isSsr)()||(window.fireworks=P)})(),y})()));
@@ -1 +1 @@
1
- /*! tsParticles Fireworks v3.0.0-beta.0 by Matteo Bruni */
1
+ /*! tsParticles Fireworks v3.0.0-beta.2 by Matteo Bruni */
@@ -1,5 +1,5 @@
1
1
  import { type IOptionLoader, type RangeValue, type RecursivePartial, type SingleOrMultiple } from "@tsparticles/engine";
2
- import type { IFireworkOptions } from "./IFireworkOptions";
2
+ import type { IFireworkOptions } from "./IFireworkOptions.js";
3
3
  export declare class FireworkOptions implements IFireworkOptions, IOptionLoader<IFireworkOptions> {
4
4
  brightness: RangeValue;
5
5
  colors: SingleOrMultiple<string>;
@@ -1,5 +1,5 @@
1
1
  import { type Container, type RecursivePartial } from "@tsparticles/engine";
2
- import type { IFireworkOptions } from "./IFireworkOptions";
2
+ import type { IFireworkOptions } from "./IFireworkOptions.js";
3
3
  declare global {
4
4
  interface Window {
5
5
  fireworks: ((idOrOptions: string | RecursivePartial<IFireworkOptions>, sourceOptions?: RecursivePartial<IFireworkOptions>) => Promise<FireworksInstance | undefined>) & {
package/types/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { IFireworkOptions } from "./IFireworkOptions";
1
+ import type { IFireworkOptions } from "./IFireworkOptions.js";
2
2
  import type { RecursivePartial } from "@tsparticles/engine";
3
3
  export type FireworkOptions = RecursivePartial<IFireworkOptions>;
4
- export * from "./fireworks";
4
+ export * from "./fireworks.js";
package/umd/fireworks.js CHANGED
@@ -4,14 +4,14 @@
4
4
  if (v !== undefined) module.exports = v;
5
5
  }
6
6
  else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "@tsparticles/engine", "./FireworkOptions", "@tsparticles/basic", "@tsparticles/updater-destroy", "@tsparticles/plugin-emitters", "@tsparticles/updater-life", "@tsparticles/shape-line", "@tsparticles/updater-rotate", "@tsparticles/plugin-sounds", "@tsparticles/updater-stroke-color"], factory);
7
+ define(["require", "exports", "@tsparticles/engine", "./FireworkOptions.js", "@tsparticles/basic", "@tsparticles/updater-destroy", "@tsparticles/plugin-emitters", "@tsparticles/updater-life", "@tsparticles/shape-line", "@tsparticles/updater-rotate", "@tsparticles/plugin-sounds", "@tsparticles/updater-stroke-color"], factory);
8
8
  }
9
9
  })(function (require, exports) {
10
10
  "use strict";
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.fireworks = void 0;
13
13
  const engine_1 = require("@tsparticles/engine");
14
- const FireworkOptions_1 = require("./FireworkOptions");
14
+ const FireworkOptions_js_1 = require("./FireworkOptions.js");
15
15
  const basic_1 = require("@tsparticles/basic");
16
16
  const updater_destroy_1 = require("@tsparticles/updater-destroy");
17
17
  const plugin_emitters_1 = require("@tsparticles/plugin-emitters");
@@ -70,7 +70,7 @@
70
70
  async function fireworks(idOrOptions, sourceOptions) {
71
71
  await initPlugins();
72
72
  let id;
73
- const options = new FireworkOptions_1.FireworkOptions();
73
+ const options = new FireworkOptions_js_1.FireworkOptions();
74
74
  if ((0, engine_1.isString)(idOrOptions)) {
75
75
  id = idOrOptions;
76
76
  options.load(sourceOptions);
package/umd/index.js CHANGED
@@ -18,10 +18,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
18
18
  if (v !== undefined) module.exports = v;
19
19
  }
20
20
  else if (typeof define === "function" && define.amd) {
21
- define(["require", "exports", "./fireworks"], factory);
21
+ define(["require", "exports", "./fireworks.js"], factory);
22
22
  }
23
23
  })(function (require, exports) {
24
24
  "use strict";
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- __exportStar(require("./fireworks"), exports);
26
+ __exportStar(require("./fireworks.js"), exports);
27
27
  });