@tsparticles/ribbons 4.1.2 → 4.2.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,5 +1,5 @@
1
1
  (function(g){g.__tsParticlesInternals=g.__tsParticlesInternals||{};g.__tsParticlesInternals.bundles=g.__tsParticlesInternals.bundles||{};g.__tsParticlesInternals.effects=g.__tsParticlesInternals.effects||{};g.__tsParticlesInternals.engine=g.__tsParticlesInternals.engine||{};g.__tsParticlesInternals.interactions=g.__tsParticlesInternals.interactions||{};g.__tsParticlesInternals.palettes=g.__tsParticlesInternals.palettes||{};g.__tsParticlesInternals.paths=g.__tsParticlesInternals.paths||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins.emittersShapes=g.__tsParticlesInternals.plugins.emittersShapes||{};g.__tsParticlesInternals.presets=g.__tsParticlesInternals.presets||{};g.__tsParticlesInternals.shapes=g.__tsParticlesInternals.shapes||{};g.__tsParticlesInternals.updaters=g.__tsParticlesInternals.updaters||{};g.__tsParticlesInternals.utils=g.__tsParticlesInternals.utils||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas.utils=g.__tsParticlesInternals.canvas.utils||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path.utils=g.__tsParticlesInternals.path.utils||{};var __tsProxyFactory=typeof Proxy!=="undefined"?function(obj){return new Proxy(obj,{get:function(target,key){if(!(key in target)){target[key]={};}return target[key];}});}:function(obj){return obj;};g.__tsParticlesInternals.bundles=__tsProxyFactory(g.__tsParticlesInternals.bundles);g.__tsParticlesInternals.effects=__tsProxyFactory(g.__tsParticlesInternals.effects);g.__tsParticlesInternals.interactions=__tsProxyFactory(g.__tsParticlesInternals.interactions);g.__tsParticlesInternals.palettes=__tsProxyFactory(g.__tsParticlesInternals.palettes);g.__tsParticlesInternals.paths=__tsProxyFactory(g.__tsParticlesInternals.paths);g.__tsParticlesInternals.plugins=__tsProxyFactory(g.__tsParticlesInternals.plugins);g.__tsParticlesInternals.plugins.emittersShapes=__tsProxyFactory(g.__tsParticlesInternals.plugins.emittersShapes);g.__tsParticlesInternals.presets=__tsProxyFactory(g.__tsParticlesInternals.presets);g.__tsParticlesInternals.shapes=__tsProxyFactory(g.__tsParticlesInternals.shapes);g.__tsParticlesInternals.updaters=__tsProxyFactory(g.__tsParticlesInternals.updaters);g.__tsParticlesInternals.utils=__tsProxyFactory(g.__tsParticlesInternals.utils);g.__tsParticlesInternals.canvas=__tsProxyFactory(g.__tsParticlesInternals.canvas);g.__tsParticlesInternals.path=__tsProxyFactory(g.__tsParticlesInternals.path);g.tsparticlesInternalExports=g.tsparticlesInternalExports||{};})(typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:this);
2
- /* tsParticles v4.1.2 */
2
+ /* tsParticles v4.2.0 */
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tsparticles/engine'), require('@tsparticles/basic'), require('@tsparticles/plugin-emitters/plugin'), require('@tsparticles/plugin-emitters-shape-square'), require('@tsparticles/updater-life'), require('@tsparticles/plugin-motion'), require('@tsparticles/shape-ribbon')) :
5
5
  typeof define === 'function' && define.amd ? define(['exports', '@tsparticles/engine', '@tsparticles/basic', '@tsparticles/plugin-emitters/plugin', '@tsparticles/plugin-emitters-shape-square', '@tsparticles/updater-life', '@tsparticles/plugin-motion', '@tsparticles/shape-ribbon'], factory) :
@@ -7,32 +7,23 @@
7
7
  })(this, (function (exports, engine, basic, plugin, pluginEmittersShapeSquare, updaterLife, pluginMotion, shapeRibbon) { 'use strict';
8
8
 
9
9
  class RibbonsOptions {
10
- angle;
11
10
  colors;
12
11
  count;
13
12
  disableForReducedMotion;
14
- drift;
15
13
  emitterSize;
16
- position;
14
+ positionX;
17
15
  ribbonOptions;
18
16
  scalar;
19
- spread;
20
17
  ticks;
21
18
  zIndex;
22
19
  constructor() {
23
- this.angle = 90;
24
20
  this.count = 5;
25
- this.spread = 0;
26
- this.drift = 0;
27
21
  this.emitterSize = {
28
22
  width: 100,
29
23
  height: 0,
30
24
  };
25
+ this.positionX = 50;
31
26
  this.ticks = 200;
32
- this.position = {
33
- x: 50,
34
- y: 0,
35
- };
36
27
  this.colors = ["#FF0055", "#00D1FF", "#FFD23F", "#61FF7E", "#B284FF"];
37
28
  this.ribbonOptions = {
38
29
  angle: 45,
@@ -63,13 +54,12 @@
63
54
  }
64
55
  get origin() {
65
56
  return {
66
- x: this.position.x / engine.percentDenominator,
67
- y: this.position.y / engine.percentDenominator,
57
+ x: this.positionX / engine.percentDenominator,
58
+ y: 0,
68
59
  };
69
60
  }
70
61
  set origin(value) {
71
- this.position.x = value.x * engine.percentDenominator;
72
- this.position.y = value.y * engine.percentDenominator;
62
+ this.positionX = value.x * engine.percentDenominator;
73
63
  }
74
64
  get particleCount() {
75
65
  return this.count;
@@ -77,26 +67,24 @@
77
67
  set particleCount(value) {
78
68
  this.count = value;
79
69
  }
70
+ get position() {
71
+ return {
72
+ x: this.positionX,
73
+ y: 0,
74
+ };
75
+ }
76
+ set position(value) {
77
+ this.positionX = value.x;
78
+ }
80
79
  load(data) {
81
80
  if (engine.isNull(data)) {
82
81
  return;
83
82
  }
84
- if (data.angle !== undefined) {
85
- this.angle = data.angle;
86
- }
87
83
  const count = data.count ?? data.particleCount;
88
84
  if (count !== undefined) {
89
85
  this.count = count;
90
86
  }
91
- if (data.spread !== undefined) {
92
- this.spread = data.spread;
93
- }
94
- if (data.drift !== undefined) {
95
- this.drift = data.drift;
96
- }
97
- if (data.ticks !== undefined) {
98
- this.ticks = data.ticks;
99
- }
87
+ engine.loadProperty(this, "ticks", data.ticks);
100
88
  if (data.emitterSize) {
101
89
  if (data.emitterSize.width !== undefined) {
102
90
  this.emitterSize.width = data.emitterSize.width;
@@ -105,20 +93,20 @@
105
93
  this.emitterSize.height = data.emitterSize.height;
106
94
  }
107
95
  }
108
- const origin = data.origin;
109
- if (origin && !data.position) {
110
- data.position = {
111
- x: origin.x === undefined ? undefined : origin.x * engine.percentDenominator,
112
- y: origin.y === undefined ? undefined : origin.y * engine.percentDenominator,
113
- };
114
- }
115
- const position = data.position;
116
- if (position) {
117
- if (position.x !== undefined) {
118
- this.position.x = position.x;
96
+ engine.loadProperty(this, "positionX", data.positionX);
97
+ if (data.positionX === undefined) {
98
+ const origin = data.origin;
99
+ if (origin && !data.position) {
100
+ data.position = {
101
+ x: origin.x === undefined ? undefined : origin.x * engine.percentDenominator,
102
+ y: 0,
103
+ };
119
104
  }
120
- if (position.y !== undefined) {
121
- this.position.y = position.y;
105
+ const position = data.position;
106
+ if (position) {
107
+ if (position.x !== undefined) {
108
+ this.positionX = position.x;
109
+ }
122
110
  }
123
111
  }
124
112
  if (data.colors !== undefined) {
@@ -132,15 +120,9 @@
132
120
  if (data.ribbonOptions !== undefined) {
133
121
  this.ribbonOptions = engine.deepExtend({}, data.ribbonOptions);
134
122
  }
135
- if (data.scalar !== undefined) {
136
- this.scalar = data.scalar;
137
- }
138
- if (data.zIndex !== undefined) {
139
- this.zIndex = data.zIndex;
140
- }
141
- if (data.disableForReducedMotion !== undefined) {
142
- this.disableForReducedMotion = data.disableForReducedMotion;
143
- }
123
+ engine.loadProperty(this, "scalar", data.scalar);
124
+ engine.loadProperty(this, "zIndex", data.zIndex);
125
+ engine.loadProperty(this, "disableForReducedMotion", data.disableForReducedMotion);
144
126
  }
145
127
  }
146
128
 
@@ -149,7 +131,7 @@
149
131
  await container.addEmitter?.({
150
132
  startCount: actualOptions.count,
151
133
  position: {
152
- x: actualOptions.position.x,
134
+ x: actualOptions.positionX,
153
135
  y: emitterTop,
154
136
  },
155
137
  shape: {
@@ -289,7 +271,7 @@
289
271
  name: "ribbons",
290
272
  startCount: actualOptions.count,
291
273
  position: {
292
- x: actualOptions.position.x,
274
+ x: actualOptions.positionX,
293
275
  y: emitterTop,
294
276
  },
295
277
  shape: {
@@ -341,7 +323,7 @@
341
323
 
342
324
  let initPromise = null;
343
325
  async function doInitPlugins(engine) {
344
- engine.checkVersion("4.1.2");
326
+ engine.checkVersion("4.2.0");
345
327
  await engine.pluginManager.register(async (e) => {
346
328
  const emittersRegister = async (engine) => {
347
329
  await plugin.loadEmittersPluginSimple(engine);
@@ -408,7 +390,7 @@
408
390
  ribbons.init = async () => {
409
391
  await initPlugins(engine.tsParticles);
410
392
  };
411
- ribbons.version = "4.1.2";
393
+ ribbons.version = "4.2.0";
412
394
  globalThis.ribbons = ribbons;
413
395
 
414
396
  const globalObject = globalThis;
@@ -1 +1 @@
1
- !function(t){t.__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.bundles=t.__tsParticlesInternals.bundles||{},t.__tsParticlesInternals.effects=t.__tsParticlesInternals.effects||{},t.__tsParticlesInternals.engine=t.__tsParticlesInternals.engine||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.palettes=t.__tsParticlesInternals.palettes||{},t.__tsParticlesInternals.paths=t.__tsParticlesInternals.paths||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins.emittersShapes=t.__tsParticlesInternals.plugins.emittersShapes||{},t.__tsParticlesInternals.presets=t.__tsParticlesInternals.presets||{},t.__tsParticlesInternals.shapes=t.__tsParticlesInternals.shapes||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.utils=t.__tsParticlesInternals.utils||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas.utils=t.__tsParticlesInternals.canvas.utils||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path.utils=t.__tsParticlesInternals.path.utils||{};var s="undefined"!=typeof Proxy?function(t){return new Proxy(t,{get:function(t,s){return s in t||(t[s]={}),t[s]}})}:function(t){return t};t.__tsParticlesInternals.bundles=s(t.__tsParticlesInternals.bundles),t.__tsParticlesInternals.effects=s(t.__tsParticlesInternals.effects),t.__tsParticlesInternals.interactions=s(t.__tsParticlesInternals.interactions),t.__tsParticlesInternals.palettes=s(t.__tsParticlesInternals.palettes),t.__tsParticlesInternals.paths=s(t.__tsParticlesInternals.paths),t.__tsParticlesInternals.plugins=s(t.__tsParticlesInternals.plugins),t.__tsParticlesInternals.plugins.emittersShapes=s(t.__tsParticlesInternals.plugins.emittersShapes),t.__tsParticlesInternals.presets=s(t.__tsParticlesInternals.presets),t.__tsParticlesInternals.shapes=s(t.__tsParticlesInternals.shapes),t.__tsParticlesInternals.updaters=s(t.__tsParticlesInternals.updaters),t.__tsParticlesInternals.utils=s(t.__tsParticlesInternals.utils),t.__tsParticlesInternals.canvas=s(t.__tsParticlesInternals.canvas),t.__tsParticlesInternals.path=s(t.__tsParticlesInternals.path),t.tsparticlesInternalExports=t.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t,s){"object"==typeof exports&&"undefined"!=typeof module?s(exports,require("@tsparticles/engine"),require("@tsparticles/basic"),require("@tsparticles/plugin-emitters/plugin"),require("@tsparticles/plugin-emitters-shape-square"),require("@tsparticles/updater-life"),require("@tsparticles/plugin-motion"),require("@tsparticles/shape-ribbon")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/engine","@tsparticles/basic","@tsparticles/plugin-emitters/plugin","@tsparticles/plugin-emitters-shape-square","@tsparticles/updater-life","@tsparticles/plugin-motion","@tsparticles/shape-ribbon"],s):s(((t="undefined"!=typeof globalThis?globalThis:t||self).__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.bundles=t.__tsParticlesInternals.bundles||{},t.__tsParticlesInternals.bundles.ribbons=t.__tsParticlesInternals.bundles.ribbons||{}),t.__tsParticlesInternals.engine,t.__tsParticlesInternals.bundles.basic,t.__tsParticlesInternals.plugins["emitters/plugin"],t.__tsParticlesInternals.plugins.emittersShapes.square,t.__tsParticlesInternals.updaters.life,t.__tsParticlesInternals.plugins.motion,t.__tsParticlesInternals.shapes.ribbon)}(this,function(t,s,e,i,n,a,r,l){"use strict";class o{angle;colors;count;disableForReducedMotion;drift;emitterSize;position;ribbonOptions;scalar;spread;ticks;zIndex;constructor(){this.angle=90,this.count=5,this.spread=0,this.drift=0,this.emitterSize={width:100,height:0},this.ticks=200,this.position={x:50,y:0},this.colors=["#FF0055","#00D1FF","#FFD23F","#61FF7E","#B284FF"],this.ribbonOptions={angle:45,darken:{enable:!0,value:30},count:60,drag:.02,mass:1,oscillationDistance:{min:100,max:140},oscillationSpeed:{min:3,max:5},particleDist:8,velocityInherit:{min:4,max:6}},this.scalar=1,this.zIndex=100,this.disableForReducedMotion=!0}get origin(){return{x:this.position.x/s.percentDenominator,y:this.position.y/s.percentDenominator}}set origin(t){this.position.x=t.x*s.percentDenominator,this.position.y=t.y*s.percentDenominator}get particleCount(){return this.count}set particleCount(t){this.count=t}load(t){if(s.isNull(t))return;void 0!==t.angle&&(this.angle=t.angle);const e=t.count??t.particleCount;void 0!==e&&(this.count=e),void 0!==t.spread&&(this.spread=t.spread),void 0!==t.drift&&(this.drift=t.drift),void 0!==t.ticks&&(this.ticks=t.ticks),t.emitterSize&&(void 0!==t.emitterSize.width&&(this.emitterSize.width=t.emitterSize.width),void 0!==t.emitterSize.height&&(this.emitterSize.height=t.emitterSize.height));const i=t.origin;i&&!t.position&&(t.position={x:void 0===i.x?void 0:i.x*s.percentDenominator,y:void 0===i.y?void 0:i.y*s.percentDenominator});const n=t.position;n&&(void 0!==n.x&&(this.position.x=n.x),void 0!==n.y&&(this.position.y=n.y)),void 0!==t.colors&&(s.isArray(t.colors)?this.colors=[...t.colors]:this.colors=t.colors),void 0!==t.ribbonOptions&&(this.ribbonOptions=s.deepExtend({},t.ribbonOptions)),void 0!==t.scalar&&(this.scalar=t.scalar),void 0!==t.zIndex&&(this.zIndex=t.zIndex),void 0!==t.disableForReducedMotion&&(this.disableForReducedMotion=t.disableForReducedMotion)}}const c=new Map;async function _(t,s){const e=new o;e.load(s.options);let i=c.get(s.id);i instanceof Promise&&(await i,i=c.get(s.id));const n=i;if(n&&!n.destroyed){const t=n;if("addEmitter"in t)return await async function(t,s){await(t.addEmitter?.({startCount:s.count,position:{x:s.position.x,y:0},shape:{type:"square"},size:{width:s.emitterSize.width,height:s.emitterSize.height},rate:{delay:0,quantity:0},life:{duration:.1,count:1},particles:{paint:{fill:{color:{value:s.colors},enable:!0}},shape:{type:"ribbon",options:{ribbon:s.ribbonOptions}},life:{count:1},size:{value:8*s.scalar},move:{direction:"bottom",enable:!0,outModes:{top:"none",default:"destroy"},speed:{min:4,max:6}},roll:{enable:!1},rotate:{value:0,move:!1,animation:{enable:!1}},tilt:{enable:!1},wobble:{enable:!1}}}))}(t,e),n}const a=(async()=>{const i=function(t,s){return{fullScreen:{enable:!s.canvas,zIndex:t.zIndex},fpsLimit:120,particles:{number:{value:0},paint:{fill:{color:{value:t.colors},enable:!0}},shape:{type:"ribbon",options:{ribbon:t.ribbonOptions}},size:{value:8*t.scalar},links:{enable:!1},life:{count:1},move:{direction:"bottom",enable:!0,outModes:{top:"none",default:"destroy"},speed:{min:4,max:6}},roll:{enable:!1},rotate:{value:0,move:!1,animation:{enable:!1}},tilt:{enable:!1},wobble:{enable:!1}},motion:{disable:t.disableForReducedMotion},emitters:{name:"ribbons",startCount:t.count,position:{x:t.position.x,y:0},shape:{type:"square"},size:{width:t.emitterSize.width,height:t.emitterSize.height},rate:{delay:0,quantity:0},life:{duration:.1,count:1}}}}(e,s),n=await t.load({id:s.id,element:s.canvas,options:i});return c.set(s.id,n),n})();return c.set(s.id,a),a}let p=null;async function d(t){return p||(p=async function(t){t.checkVersion("4.1.2"),await t.pluginManager.register(async t=>{await Promise.all([e.loadBasic(t),r.loadMotionPlugin(t),(async t=>{await i.loadEmittersPluginSimple(t),await n.loadEmittersShapeSquare(t)})(t),l.loadRibbonShape(t),a.loadLifeUpdater(t)])})}(t),p)}async function u(t,e){let i,n;return await d(s.tsParticles),s.isString(t)?(n=t,i=e??{}):(n="ribbons",i=t??{}),_(s.tsParticles,{id:n,options:i})}u.create=async(t,e={})=>{await d(s.tsParticles);const i=t?.getAttribute("id")??"ribbons";return t?.setAttribute("id",i),await _(s.tsParticles,{id:i,canvas:t??void 0,options:e}),async(n,a)=>{let r,l;return s.isString(n)?(l=n,r=a??e):(l=i,r=n??{}),_(s.tsParticles,{id:l,canvas:t??void 0,options:r})}},u.init=async()=>{await d(s.tsParticles)},u.version="4.1.2",globalThis.ribbons=u;globalThis.ribbons=u,t.ribbons=u}),globalThis.__tsParticlesInternals=globalThis.__tsParticlesInternals||{},globalThis.__tsParticlesInternals.engine&&globalThis.__tsParticlesInternals.engine.tsParticles||(globalThis.__tsParticlesInternals.engine=globalThis.__tsParticlesInternals.bundles.ribbons||{}),delete(globalThis.window||globalThis).tsparticlesInternalExports;
1
+ !function(t){t.__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.bundles=t.__tsParticlesInternals.bundles||{},t.__tsParticlesInternals.effects=t.__tsParticlesInternals.effects||{},t.__tsParticlesInternals.engine=t.__tsParticlesInternals.engine||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.palettes=t.__tsParticlesInternals.palettes||{},t.__tsParticlesInternals.paths=t.__tsParticlesInternals.paths||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins.emittersShapes=t.__tsParticlesInternals.plugins.emittersShapes||{},t.__tsParticlesInternals.presets=t.__tsParticlesInternals.presets||{},t.__tsParticlesInternals.shapes=t.__tsParticlesInternals.shapes||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.utils=t.__tsParticlesInternals.utils||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas.utils=t.__tsParticlesInternals.canvas.utils||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path.utils=t.__tsParticlesInternals.path.utils||{};var s="undefined"!=typeof Proxy?function(t){return new Proxy(t,{get:function(t,s){return s in t||(t[s]={}),t[s]}})}:function(t){return t};t.__tsParticlesInternals.bundles=s(t.__tsParticlesInternals.bundles),t.__tsParticlesInternals.effects=s(t.__tsParticlesInternals.effects),t.__tsParticlesInternals.interactions=s(t.__tsParticlesInternals.interactions),t.__tsParticlesInternals.palettes=s(t.__tsParticlesInternals.palettes),t.__tsParticlesInternals.paths=s(t.__tsParticlesInternals.paths),t.__tsParticlesInternals.plugins=s(t.__tsParticlesInternals.plugins),t.__tsParticlesInternals.plugins.emittersShapes=s(t.__tsParticlesInternals.plugins.emittersShapes),t.__tsParticlesInternals.presets=s(t.__tsParticlesInternals.presets),t.__tsParticlesInternals.shapes=s(t.__tsParticlesInternals.shapes),t.__tsParticlesInternals.updaters=s(t.__tsParticlesInternals.updaters),t.__tsParticlesInternals.utils=s(t.__tsParticlesInternals.utils),t.__tsParticlesInternals.canvas=s(t.__tsParticlesInternals.canvas),t.__tsParticlesInternals.path=s(t.__tsParticlesInternals.path),t.tsparticlesInternalExports=t.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t,s){"object"==typeof exports&&"undefined"!=typeof module?s(exports,require("@tsparticles/engine"),require("@tsparticles/basic"),require("@tsparticles/plugin-emitters/plugin"),require("@tsparticles/plugin-emitters-shape-square"),require("@tsparticles/updater-life"),require("@tsparticles/plugin-motion"),require("@tsparticles/shape-ribbon")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/engine","@tsparticles/basic","@tsparticles/plugin-emitters/plugin","@tsparticles/plugin-emitters-shape-square","@tsparticles/updater-life","@tsparticles/plugin-motion","@tsparticles/shape-ribbon"],s):s(((t="undefined"!=typeof globalThis?globalThis:t||self).__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.bundles=t.__tsParticlesInternals.bundles||{},t.__tsParticlesInternals.bundles.ribbons=t.__tsParticlesInternals.bundles.ribbons||{}),t.__tsParticlesInternals.engine,t.__tsParticlesInternals.bundles.basic,t.__tsParticlesInternals.plugins["emitters/plugin"],t.__tsParticlesInternals.plugins.emittersShapes.square,t.__tsParticlesInternals.updaters.life,t.__tsParticlesInternals.plugins.motion,t.__tsParticlesInternals.shapes.ribbon)}(this,function(t,s,e,i,n,a,r,l){"use strict";class o{colors;count;disableForReducedMotion;emitterSize;positionX;ribbonOptions;scalar;ticks;zIndex;constructor(){this.count=5,this.emitterSize={width:100,height:0},this.positionX=50,this.ticks=200,this.colors=["#FF0055","#00D1FF","#FFD23F","#61FF7E","#B284FF"],this.ribbonOptions={angle:45,darken:{enable:!0,value:30},count:60,drag:.02,mass:1,oscillationDistance:{min:100,max:140},oscillationSpeed:{min:3,max:5},particleDist:8,velocityInherit:{min:4,max:6}},this.scalar=1,this.zIndex=100,this.disableForReducedMotion=!0}get origin(){return{x:this.positionX/s.percentDenominator,y:0}}set origin(t){this.positionX=t.x*s.percentDenominator}get particleCount(){return this.count}set particleCount(t){this.count=t}get position(){return{x:this.positionX,y:0}}set position(t){this.positionX=t.x}load(t){if(s.isNull(t))return;const e=t.count??t.particleCount;if(void 0!==e&&(this.count=e),s.loadProperty(this,"ticks",t.ticks),t.emitterSize&&(void 0!==t.emitterSize.width&&(this.emitterSize.width=t.emitterSize.width),void 0!==t.emitterSize.height&&(this.emitterSize.height=t.emitterSize.height)),s.loadProperty(this,"positionX",t.positionX),void 0===t.positionX){const e=t.origin;e&&!t.position&&(t.position={x:void 0===e.x?void 0:e.x*s.percentDenominator,y:0});const i=t.position;i&&void 0!==i.x&&(this.positionX=i.x)}void 0!==t.colors&&(s.isArray(t.colors)?this.colors=[...t.colors]:this.colors=t.colors),void 0!==t.ribbonOptions&&(this.ribbonOptions=s.deepExtend({},t.ribbonOptions)),s.loadProperty(this,"scalar",t.scalar),s.loadProperty(this,"zIndex",t.zIndex),s.loadProperty(this,"disableForReducedMotion",t.disableForReducedMotion)}}const c=new Map;async function _(t,s){const e=new o;e.load(s.options);let i=c.get(s.id);i instanceof Promise&&(await i,i=c.get(s.id));const n=i;if(n&&!n.destroyed){const t=n;if("addEmitter"in t)return await async function(t,s){await(t.addEmitter?.({startCount:s.count,position:{x:s.positionX,y:0},shape:{type:"square"},size:{width:s.emitterSize.width,height:s.emitterSize.height},rate:{delay:0,quantity:0},life:{duration:.1,count:1},particles:{paint:{fill:{color:{value:s.colors},enable:!0}},shape:{type:"ribbon",options:{ribbon:s.ribbonOptions}},life:{count:1},size:{value:8*s.scalar},move:{direction:"bottom",enable:!0,outModes:{top:"none",default:"destroy"},speed:{min:4,max:6}},roll:{enable:!1},rotate:{value:0,move:!1,animation:{enable:!1}},tilt:{enable:!1},wobble:{enable:!1}}}))}(t,e),n}const a=(async()=>{const i=function(t,s){return{fullScreen:{enable:!s.canvas,zIndex:t.zIndex},fpsLimit:120,particles:{number:{value:0},paint:{fill:{color:{value:t.colors},enable:!0}},shape:{type:"ribbon",options:{ribbon:t.ribbonOptions}},size:{value:8*t.scalar},links:{enable:!1},life:{count:1},move:{direction:"bottom",enable:!0,outModes:{top:"none",default:"destroy"},speed:{min:4,max:6}},roll:{enable:!1},rotate:{value:0,move:!1,animation:{enable:!1}},tilt:{enable:!1},wobble:{enable:!1}},motion:{disable:t.disableForReducedMotion},emitters:{name:"ribbons",startCount:t.count,position:{x:t.positionX,y:0},shape:{type:"square"},size:{width:t.emitterSize.width,height:t.emitterSize.height},rate:{delay:0,quantity:0},life:{duration:.1,count:1}}}}(e,s),n=await t.load({id:s.id,element:s.canvas,options:i});return c.set(s.id,n),n})();return c.set(s.id,a),a}let p=null;async function u(t){return p||(p=async function(t){t.checkVersion("4.2.0"),await t.pluginManager.register(async t=>{await Promise.all([e.loadBasic(t),r.loadMotionPlugin(t),(async t=>{await i.loadEmittersPluginSimple(t),await n.loadEmittersShapeSquare(t)})(t),l.loadRibbonShape(t),a.loadLifeUpdater(t)])})}(t),p)}async function d(t,e){let i,n;return await u(s.tsParticles),s.isString(t)?(n=t,i=e??{}):(n="ribbons",i=t??{}),_(s.tsParticles,{id:n,options:i})}d.create=async(t,e={})=>{await u(s.tsParticles);const i=t?.getAttribute("id")??"ribbons";return t?.setAttribute("id",i),await _(s.tsParticles,{id:i,canvas:t??void 0,options:e}),async(n,a)=>{let r,l;return s.isString(n)?(l=n,r=a??e):(l=i,r=n??{}),_(s.tsParticles,{id:l,canvas:t??void 0,options:r})}},d.init=async()=>{await u(s.tsParticles)},d.version="4.2.0",globalThis.ribbons=d;globalThis.ribbons=d,t.ribbons=d}),globalThis.__tsParticlesInternals=globalThis.__tsParticlesInternals||{},globalThis.__tsParticlesInternals.engine&&globalThis.__tsParticlesInternals.engine.tsParticles||(globalThis.__tsParticlesInternals.engine=globalThis.__tsParticlesInternals.bundles.ribbons||{}),delete(globalThis.window||globalThis).tsparticlesInternalExports;
@@ -1,17 +1,15 @@
1
1
  import type { ICoordinates, IDimension, IShapeValues, SingleOrMultiple } from "@tsparticles/engine";
2
2
  export interface IRibbonsOptions {
3
- angle: number;
4
3
  colors: SingleOrMultiple<string>;
5
4
  count: number;
6
5
  disableForReducedMotion: boolean;
7
- drift: number;
8
6
  emitterSize: IDimension;
9
7
  origin: ICoordinates;
10
8
  particleCount: number;
11
9
  position: ICoordinates;
10
+ positionX: number;
12
11
  ribbonOptions: SingleOrMultiple<IShapeValues>;
13
12
  scalar: number;
14
- spread: number;
15
13
  ticks: number;
16
14
  zIndex: number;
17
15
  }
@@ -1,16 +1,13 @@
1
1
  import { type ICoordinates, type IDimension, type IOptionLoader, type IShapeValues, type RecursivePartial, type SingleOrMultiple } from "@tsparticles/engine";
2
2
  import type { IRibbonsOptions } from "./IRibbonsOptions.js";
3
3
  export declare class RibbonsOptions implements IRibbonsOptions, IOptionLoader<IRibbonsOptions> {
4
- angle: number;
5
4
  colors: SingleOrMultiple<string>;
6
5
  count: number;
7
6
  disableForReducedMotion: boolean;
8
- drift: number;
9
7
  emitterSize: IDimension;
10
- position: ICoordinates;
8
+ positionX: number;
11
9
  ribbonOptions: SingleOrMultiple<IShapeValues>;
12
10
  scalar: number;
13
- spread: number;
14
11
  ticks: number;
15
12
  zIndex: number;
16
13
  constructor();
@@ -18,5 +15,7 @@ export declare class RibbonsOptions implements IRibbonsOptions, IOptionLoader<IR
18
15
  set origin(value: ICoordinates);
19
16
  get particleCount(): number;
20
17
  set particleCount(value: number);
18
+ get position(): ICoordinates;
19
+ set position(value: ICoordinates);
21
20
  load(data?: RecursivePartial<IRibbonsOptions>): void;
22
21
  }