@tsparticles/particles
Version:
Minimal tsParticles particles bundle — lightweight particle engine without confetti or fireworks extras. Perfect for pure particle backgrounds. Ready to use components available for React, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Riot.js, In
2 lines (1 loc) • 5.17 kB
JavaScript
!function(s){s.__tsParticlesInternals=s.__tsParticlesInternals||{},s.__tsParticlesInternals.bundles=s.__tsParticlesInternals.bundles||{},s.__tsParticlesInternals.effects=s.__tsParticlesInternals.effects||{},s.__tsParticlesInternals.engine=s.__tsParticlesInternals.engine||{},s.__tsParticlesInternals.interactions=s.__tsParticlesInternals.interactions||{},s.__tsParticlesInternals.palettes=s.__tsParticlesInternals.palettes||{},s.__tsParticlesInternals.paths=s.__tsParticlesInternals.paths||{},s.__tsParticlesInternals.plugins=s.__tsParticlesInternals.plugins||{},s.__tsParticlesInternals.plugins=s.__tsParticlesInternals.plugins||{},s.__tsParticlesInternals.plugins.emittersShapes=s.__tsParticlesInternals.plugins.emittersShapes||{},s.__tsParticlesInternals.presets=s.__tsParticlesInternals.presets||{},s.__tsParticlesInternals.shapes=s.__tsParticlesInternals.shapes||{},s.__tsParticlesInternals.updaters=s.__tsParticlesInternals.updaters||{},s.__tsParticlesInternals.utils=s.__tsParticlesInternals.utils||{},s.__tsParticlesInternals.canvas=s.__tsParticlesInternals.canvas||{},s.__tsParticlesInternals.canvas=s.__tsParticlesInternals.canvas||{},s.__tsParticlesInternals.canvas.utils=s.__tsParticlesInternals.canvas.utils||{},s.__tsParticlesInternals.path=s.__tsParticlesInternals.path||{},s.__tsParticlesInternals.path=s.__tsParticlesInternals.path||{},s.__tsParticlesInternals.path.utils=s.__tsParticlesInternals.path.utils||{};var t="undefined"!=typeof Proxy?function(s){return new Proxy(s,{get:function(s,t){return t in s||(s[t]={}),s[t]}})}:function(s){return s};s.__tsParticlesInternals.bundles=t(s.__tsParticlesInternals.bundles),s.__tsParticlesInternals.effects=t(s.__tsParticlesInternals.effects),s.__tsParticlesInternals.interactions=t(s.__tsParticlesInternals.interactions),s.__tsParticlesInternals.palettes=t(s.__tsParticlesInternals.palettes),s.__tsParticlesInternals.paths=t(s.__tsParticlesInternals.paths),s.__tsParticlesInternals.plugins=t(s.__tsParticlesInternals.plugins),s.__tsParticlesInternals.plugins.emittersShapes=t(s.__tsParticlesInternals.plugins.emittersShapes),s.__tsParticlesInternals.presets=t(s.__tsParticlesInternals.presets),s.__tsParticlesInternals.shapes=t(s.__tsParticlesInternals.shapes),s.__tsParticlesInternals.updaters=t(s.__tsParticlesInternals.updaters),s.__tsParticlesInternals.utils=t(s.__tsParticlesInternals.utils),s.__tsParticlesInternals.canvas=t(s.__tsParticlesInternals.canvas),s.__tsParticlesInternals.path=t(s.__tsParticlesInternals.path)}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(s){s.__tsParticlesInternals=s.__tsParticlesInternals||{},s.__tsParticlesInternals.bundles=s.__tsParticlesInternals.bundles||{},function(s,t,e,n,a,l){"use strict";const r=new Map;async function i(s,t,e,n){const a=r.get(t);if(a instanceof Promise)return a;if(a){if(!a.destroyed)return a;r.delete(t)}const l=(async()=>{const a=function(s,t){return{fullScreen:{enable:!t},particles:{number:{value:s.count??80},color:{value:s.color??"#fff"},links:{enable:s.links??!1,color:s.linksColor??"#fff",distance:s.linksLength??100},collisions:{enable:s.collisions??!1},move:{enable:!0,speed:s.speed??3},opacity:{value:s.opacity??1},shape:{type:s.shape??"circle"},size:{value:s.radius??3}}}}(e,n),l=await s.load({id:t,element:n,options:a});if(!l)return void r.delete(t);const{ParticlesInstance:i}=await Promise.resolve().then(function(){return I}),c=new i(l,t);return r.set(t,c),c})();return r.set(t,l),l}let c=null;async function _(s){return c||(c=async function(s){s.checkVersion("4.5.0"),await s.pluginManager.register(async s=>{await Promise.all([e.loadBasic(s),(async s=>{await n.loadInteractivityPlugin(s),await Promise.all([a.loadParticlesCollisionsInteraction(s),l.loadParticlesLinksInteraction(s)])})(s)])})}(s),c)}async function o(s,e){let n,a;return await _(t.tsParticles),t.isString(s)?(n=s,a=e??{}):(n="particles",a=s??{}),i(t.tsParticles,n,a)}o.create=async(s,e)=>{await _(t.tsParticles);const n=s?.id??"particles";return i(t.tsParticles,n,e??{},s??void 0)},o.init=async()=>{await _(t.tsParticles)},o.version="4.5.0",globalThis.particles=o;const P=globalThis;P.__tsParticlesInternals=P.__tsParticlesInternals??{},P.particles=o;var I=Object.freeze({__proto__:null,ParticlesInstance:class{#s;#t;constructor(s,t){this.#s=s,this.#t=t}get destroyed(){return this.#s.destroyed}destroy(){var s;this.#s.destroy(),s=this.#t,r.delete(s)}pause(){this.#s.pause()}play(){this.#s.play()}stop(){this.#s.stop()}}});s.particles=o}(s.__tsParticlesInternals.bundles.particles=s.__tsParticlesInternals.bundles.particles||{},s.__tsParticlesInternals.engine,s.__tsParticlesInternals.bundles.basic,s.__tsParticlesInternals.plugins.interactivity,s.__tsParticlesInternals.interactions.particlesCollisions,s.__tsParticlesInternals.interactions.particlesLinks)}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:self),globalThis.__tsParticlesInternals=globalThis.__tsParticlesInternals||{},globalThis.__tsParticlesInternals.engine&&globalThis.__tsParticlesInternals.engine.tsParticles||(globalThis.__tsParticlesInternals.engine=globalThis.__tsParticlesInternals.bundles.particles||{});