UNPKG

6.51 kBJavaScriptView Raw
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-angle"),require("tsparticles-move-base"),require("tsparticles-shape-circle"),require("tsparticles-updater-color"),require("tsparticles-updater-destroy"),require("tsparticles-plugin-emitters"),require("tsparticles-updater-life"),require("tsparticles-shape-line"),require("tsparticles-updater-opacity"),require("tsparticles-updater-out-modes"),require("tsparticles-updater-size"),require("tsparticles-plugin-sounds"),require("tsparticles-updater-stroke-color"));else if("function"==typeof define&&define.amd)define(["tsparticles-engine","tsparticles-updater-angle","tsparticles-move-base","tsparticles-shape-circle","tsparticles-updater-color","tsparticles-updater-destroy","tsparticles-plugin-emitters","tsparticles-updater-life","tsparticles-shape-line","tsparticles-updater-opacity","tsparticles-updater-out-modes","tsparticles-updater-size","tsparticles-plugin-sounds","tsparticles-updater-stroke-color"],t);else{var s="object"==typeof exports?t(require("tsparticles-engine"),require("tsparticles-updater-angle"),require("tsparticles-move-base"),require("tsparticles-shape-circle"),require("tsparticles-updater-color"),require("tsparticles-updater-destroy"),require("tsparticles-plugin-emitters"),require("tsparticles-updater-life"),require("tsparticles-shape-line"),require("tsparticles-updater-opacity"),require("tsparticles-updater-out-modes"),require("tsparticles-updater-size"),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,e.window);for(var r in s)("object"==typeof exports?exports:e)[r]=s[r]}}(this,((e,t,s,r,a,i,o,l,n,p,u,c,d,m)=>(()=>{"use strict";var g={961:t=>{t.exports=e},565:e=>{e.exports=s},716:e=>{e.exports=o},415:e=>{e.exports=d},851:e=>{e.exports=r},598:e=>{e.exports=n},490:e=>{e.exports=t},613:e=>{e.exports=a},731:e=>{e.exports=i},86:e=>{e.exports=l},515:e=>{e.exports=p},509:e=>{e.exports=u},694:e=>{e.exports=c},226:e=>{e.exports=m}},f={};function h(e){var t=f[e];if(void 0!==t)return t.exports;var s=f[e]={exports:{}};return g[e](s,s.exports,h),s.exports}h.d=(e,t)=>{for(var s in t)h.o(t,s)&&!h.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},h.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),h.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var y={};return(()=>{h.r(y),h.d(y,{fireworks:()=>b});var e=h(961);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&&(t.colors instanceof Array?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 s=h(490),r=h(565),a=h(851),i=h(613),o=h(731),l=h(716),n=h(86),p=h(598),u=h(515),c=h(509),d=h(694),m=h(415),g=h(226);let f=!1,v=!1;const w=e=>"line"===e.data.particle.shape;class x{constructor(e){this._container=e}pause(){this._container.pause()}play(){this._container.play()}stop(){this._container.stop()}}async function b(h,y){let b;await async function(){if(!f){if(v)return new Promise((e=>{const t=setInterval((()=>{f&&(clearInterval(t),e())}),100)}));v=!0,await(0,r.loadBaseMover)(e.tsParticles),await(0,l.loadEmittersPlugin)(e.tsParticles),await(0,m.loadSoundsPlugin)(e.tsParticles),await(0,a.loadCircleShape)(e.tsParticles),await(0,p.loadLineShape)(e.tsParticles),await(0,s.loadAngleUpdater)(e.tsParticles),await(0,i.loadColorUpdater)(e.tsParticles),await(0,o.loadDestroyUpdater)(e.tsParticles),await(0,n.loadLifeUpdater)(e.tsParticles),await(0,u.loadOpacityUpdater)(e.tsParticles),await(0,c.loadOutModesUpdater)(e.tsParticles),await(0,d.loadSizeUpdater)(e.tsParticles),await(0,g.loadStrokeColorUpdater)(e.tsParticles),v=!1,f=!0}}();const q=new t;"string"==typeof h?(b=h,q.load(y)):(b="fireworks",q.load(h));const P={detectRetina:!0,background:{color:"#000"},fpsLimit:120,emitters:{direction:"top",life:{count:0,duration:.1,delay:.1},rate:{delay:"number"==typeof q.rate?1/q.rate:{min:1/(0,e.getRangeMin)(q.rate),max:1/(0,e.getRangeMax)(q.rate)},quantity:1},size:{width:100,height:0},position:{y:100,x:50}},particles:{number:{value:0},color:{value:q.colors},destroy:{mode:"split",bounds:{top:(0,e.setRangeValue)(q.minHeight)},split:{sizeOffset:!1,count:1,factor:{value:.333333},rate:{value:q.splitCount},colorOffset:{s:q.saturation,l:q.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)(q.gravity)},speed:(0,e.setRangeValue)(q.speed),direction:"none",outModes:"destroy"}}}},life:{count:1},shape:{type:"line"},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:{fillColor:"#000",enable:!0,length:10}}},sounds:{enable:q.sounds,events:[{event:"particleRemoved",filter:w,audio:["https://particles.js.org/audio/explosion0.mp3","https://particles.js.org/audio/explosion1.mp3","https://particles.js.org/audio/explosion2.mp3"]}],volume:50}},R=await e.tsParticles.load(b,P);if(R)return new x(R)}})(),y})()));
\No newline at end of file