@tsparticles/preset-squares 3.0.2 → 3.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.
@@ -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.0.2
7
+ * v3.2.0
8
8
  */
9
9
  (function webpackUniversalModuleDefinition(root, factory) {
10
10
  if(typeof exports === 'object' && typeof module === 'object')
@@ -126,7 +126,61 @@ __webpack_require__.d(__webpack_exports__, {
126
126
  var plugin_emitters_root_window_ = __webpack_require__(68);
127
127
  // EXTERNAL MODULE: external {"commonjs":"@tsparticles/engine","commonjs2":"@tsparticles/engine","amd":"@tsparticles/engine","root":"window"}
128
128
  var engine_root_window_ = __webpack_require__(533);
129
- ;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-rotate@3.0.3/node_modules/@tsparticles/updater-rotate/browser/Options/Classes/RotateAnimation.js
129
+ ;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+plugin-hex-color@3.7.1/node_modules/@tsparticles/plugin-hex-color/browser/HexColorManager.js
130
+ var RgbIndexes;
131
+ (function (RgbIndexes) {
132
+ RgbIndexes[RgbIndexes["r"] = 1] = "r";
133
+ RgbIndexes[RgbIndexes["g"] = 2] = "g";
134
+ RgbIndexes[RgbIndexes["b"] = 3] = "b";
135
+ RgbIndexes[RgbIndexes["a"] = 4] = "a";
136
+ })(RgbIndexes || (RgbIndexes = {}));
137
+ const shorthandHexRegex = /^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i, hexRegex = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i, hexRadix = 16, defaultAlpha = 1, alphaFactor = 0xff;
138
+ class HexColorManager {
139
+ constructor() {
140
+ this.key = "hex";
141
+ this.stringPrefix = "#";
142
+ }
143
+ handleColor(color) {
144
+ return this._parseString(color.value);
145
+ }
146
+ handleRangeColor(color) {
147
+ return this._parseString(color.value);
148
+ }
149
+ parseString(input) {
150
+ return this._parseString(input);
151
+ }
152
+ _parseString(hexColor) {
153
+ if (typeof hexColor !== "string") {
154
+ return;
155
+ }
156
+ if (!hexColor?.startsWith(this.stringPrefix)) {
157
+ return;
158
+ }
159
+ const hexFixed = hexColor.replace(shorthandHexRegex, (_, r, g, b, a) => {
160
+ return r + r + g + g + b + b + (a !== undefined ? a + a : "");
161
+ }), result = hexRegex.exec(hexFixed);
162
+ return result
163
+ ? {
164
+ a: result[RgbIndexes.a] !== undefined
165
+ ? parseInt(result[RgbIndexes.a], hexRadix) / alphaFactor
166
+ : defaultAlpha,
167
+ b: parseInt(result[RgbIndexes.b], hexRadix),
168
+ g: parseInt(result[RgbIndexes.g], hexRadix),
169
+ r: parseInt(result[RgbIndexes.r], hexRadix),
170
+ }
171
+ : undefined;
172
+ }
173
+ }
174
+
175
+ ;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+plugin-hex-color@3.7.1/node_modules/@tsparticles/plugin-hex-color/browser/index.js
176
+
177
+
178
+ async function loadHexColorPlugin(engine, refresh = true) {
179
+ (0,engine_root_window_.assertValidVersion)(engine, "3.7.1");
180
+ await engine.addColorManager(new HexColorManager(), refresh);
181
+ }
182
+
183
+ ;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-rotate@3.7.1/node_modules/@tsparticles/updater-rotate/browser/Options/Classes/RotateAnimation.js
130
184
 
131
185
  class RotateAnimation {
132
186
  constructor() {
@@ -136,7 +190,7 @@ class RotateAnimation {
136
190
  this.sync = false;
137
191
  }
138
192
  load(data) {
139
- if (!data) {
193
+ if ((0,engine_root_window_.isNull)(data)) {
140
194
  return;
141
195
  }
142
196
  if (data.enable !== undefined) {
@@ -154,19 +208,19 @@ class RotateAnimation {
154
208
  }
155
209
  }
156
210
 
157
- ;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-rotate@3.0.3/node_modules/@tsparticles/updater-rotate/browser/Options/Classes/Rotate.js
211
+ ;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-rotate@3.7.1/node_modules/@tsparticles/updater-rotate/browser/Options/Classes/Rotate.js
158
212
 
159
213
 
160
214
  class Rotate extends engine_root_window_.ValueWithRandom {
161
215
  constructor() {
162
216
  super();
163
217
  this.animation = new RotateAnimation();
164
- this.direction = "clockwise";
218
+ this.direction = engine_root_window_.RotateDirection.clockwise;
165
219
  this.path = false;
166
220
  this.value = 0;
167
221
  }
168
222
  load(data) {
169
- if (!data) {
223
+ if ((0,engine_root_window_.isNull)(data)) {
170
224
  return;
171
225
  }
172
226
  super.load(data);
@@ -180,37 +234,10 @@ class Rotate extends engine_root_window_.ValueWithRandom {
180
234
  }
181
235
  }
182
236
 
183
- ;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-rotate@3.0.3/node_modules/@tsparticles/updater-rotate/browser/RotateUpdater.js
237
+ ;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-rotate@3.7.1/node_modules/@tsparticles/updater-rotate/browser/RotateUpdater.js
184
238
 
185
239
 
186
- function updateRotate(particle, delta) {
187
- const rotate = particle.rotate, rotateOptions = particle.options.rotate;
188
- if (!rotate || !rotateOptions) {
189
- return;
190
- }
191
- const rotateAnimation = rotateOptions.animation, speed = (rotate.velocity ?? 0) * delta.factor, max = 2 * Math.PI, decay = rotate.decay ?? 1;
192
- if (!rotateAnimation.enable) {
193
- return;
194
- }
195
- switch (rotate.status) {
196
- case "increasing":
197
- rotate.value += speed;
198
- if (rotate.value > max) {
199
- rotate.value -= max;
200
- }
201
- break;
202
- case "decreasing":
203
- default:
204
- rotate.value -= speed;
205
- if (rotate.value < 0) {
206
- rotate.value += max;
207
- }
208
- break;
209
- }
210
- if (rotate.velocity && decay !== 1) {
211
- rotate.velocity *= decay;
212
- }
213
- }
240
+ const RotateUpdater_double = 2, doublePI = Math.PI * RotateUpdater_double, identity = 1, doublePIDeg = 360;
214
241
  class RotateUpdater {
215
242
  constructor(container) {
216
243
  this.container = container;
@@ -222,28 +249,30 @@ class RotateUpdater {
222
249
  }
223
250
  particle.rotate = {
224
251
  enable: rotateOptions.animation.enable,
225
- value: ((0,engine_root_window_.getRangeValue)(rotateOptions.value) * Math.PI) / 180,
252
+ value: (0,engine_root_window_.degToRad)((0,engine_root_window_.getRangeValue)(rotateOptions.value)),
253
+ min: 0,
254
+ max: doublePI,
226
255
  };
227
256
  particle.pathRotation = rotateOptions.path;
228
257
  let rotateDirection = rotateOptions.direction;
229
- if (rotateDirection === "random") {
230
- const index = Math.floor((0,engine_root_window_.getRandom)() * 2);
231
- rotateDirection = index > 0 ? "counter-clockwise" : "clockwise";
258
+ if (rotateDirection === engine_root_window_.RotateDirection.random) {
259
+ const index = Math.floor((0,engine_root_window_.getRandom)() * RotateUpdater_double), minIndex = 0;
260
+ rotateDirection = index > minIndex ? engine_root_window_.RotateDirection.counterClockwise : engine_root_window_.RotateDirection.clockwise;
232
261
  }
233
262
  switch (rotateDirection) {
234
- case "counter-clockwise":
263
+ case engine_root_window_.RotateDirection.counterClockwise:
235
264
  case "counterClockwise":
236
- particle.rotate.status = "decreasing";
265
+ particle.rotate.status = engine_root_window_.AnimationStatus.decreasing;
237
266
  break;
238
- case "clockwise":
239
- particle.rotate.status = "increasing";
267
+ case engine_root_window_.RotateDirection.clockwise:
268
+ particle.rotate.status = engine_root_window_.AnimationStatus.increasing;
240
269
  break;
241
270
  }
242
271
  const rotateAnimation = rotateOptions.animation;
243
272
  if (rotateAnimation.enable) {
244
- particle.rotate.decay = 1 - (0,engine_root_window_.getRangeValue)(rotateAnimation.decay);
273
+ particle.rotate.decay = identity - (0,engine_root_window_.getRangeValue)(rotateAnimation.decay);
245
274
  particle.rotate.velocity =
246
- ((0,engine_root_window_.getRangeValue)(rotateAnimation.speed) / 360) * this.container.retina.reduceFactor;
275
+ ((0,engine_root_window_.getRangeValue)(rotateAnimation.speed) / doublePIDeg) * this.container.retina.reduceFactor;
247
276
  if (!rotateAnimation.sync) {
248
277
  particle.rotate.velocity *= (0,engine_root_window_.getRandom)();
249
278
  }
@@ -255,7 +284,7 @@ class RotateUpdater {
255
284
  if (!rotate) {
256
285
  return false;
257
286
  }
258
- return !particle.destroyed && !particle.spawning && rotate.animation.enable && !rotate.path;
287
+ return !particle.destroyed && !particle.spawning && (!!rotate.value || rotate.animation.enable || rotate.path);
259
288
  }
260
289
  loadOptions(options, ...sources) {
261
290
  if (!options.rotate) {
@@ -269,15 +298,23 @@ class RotateUpdater {
269
298
  if (!this.isEnabled(particle)) {
270
299
  return;
271
300
  }
272
- updateRotate(particle, delta);
273
- particle.rotation = particle.rotate?.value ?? 0;
301
+ particle.isRotating = !!particle.rotate;
302
+ if (!particle.rotate) {
303
+ return;
304
+ }
305
+ (0,engine_root_window_.updateAnimation)(particle, particle.rotate, false, engine_root_window_.DestroyType.none, delta);
306
+ particle.rotation = particle.rotate.value;
274
307
  }
275
308
  }
276
309
 
277
- ;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-rotate@3.0.3/node_modules/@tsparticles/updater-rotate/browser/index.js
310
+ ;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-rotate@3.7.1/node_modules/@tsparticles/updater-rotate/browser/index.js
311
+
278
312
 
279
313
  async function loadRotateUpdater(engine, refresh = true) {
280
- await engine.addParticleUpdater("rotate", (container) => new RotateUpdater(container), refresh);
314
+ (0,engine_root_window_.assertValidVersion)(engine, "3.7.1");
315
+ await engine.addParticleUpdater("rotate", container => {
316
+ return Promise.resolve(new RotateUpdater(container));
317
+ }, refresh);
281
318
  }
282
319
 
283
320
  // EXTERNAL MODULE: external {"commonjs":"@tsparticles/updater-size","commonjs2":"@tsparticles/updater-size","amd":"@tsparticles/updater-size","root":"window"}
@@ -287,6 +324,7 @@ var shape_square_root_window_ = __webpack_require__(652);
287
324
  // EXTERNAL MODULE: external {"commonjs":"@tsparticles/updater-stroke-color","commonjs2":"@tsparticles/updater-stroke-color","amd":"@tsparticles/updater-stroke-color","root":"window"}
288
325
  var updater_stroke_color_root_window_ = __webpack_require__(204);
289
326
  ;// CONCATENATED MODULE: ./dist/browser/options.js
327
+
290
328
  const options = {
291
329
  particles: {
292
330
  stroke: {
@@ -305,7 +343,7 @@ const options = {
305
343
  },
306
344
  rotate: {
307
345
  value: 0,
308
- direction: "counter-clockwise",
346
+ direction: engine_root_window_.RotateDirection.counterClockwise,
309
347
  animation: {
310
348
  enable: true,
311
349
  speed: 2,
@@ -319,10 +357,10 @@ const options = {
319
357
  },
320
358
  animation: {
321
359
  enable: true,
322
- startValue: "min",
360
+ startValue: engine_root_window_.StartValueType.min,
323
361
  speed: 60,
324
362
  sync: true,
325
- destroy: "max"
363
+ destroy: engine_root_window_.DestroyType.max
326
364
  }
327
365
  }
328
366
  },
@@ -347,13 +385,16 @@ const options = {
347
385
 
348
386
 
349
387
 
388
+
350
389
  async function loadSquaresPreset(engine, refresh = true) {
390
+ await loadHexColorPlugin(engine, false);
351
391
  await (0,plugin_emitters_root_window_.loadEmittersPlugin)(engine, false);
352
392
  await (0,shape_square_root_window_.loadSquareShape)(engine, false);
353
393
  await loadRotateUpdater(engine, false);
354
394
  await (0,updater_size_root_window_.loadSizeUpdater)(engine, false);
355
395
  await (0,updater_stroke_color_root_window_.loadStrokeColorUpdater)(engine, false);
356
- await engine.addPreset("squares", options, refresh);
396
+ await engine.addPreset("squares", options, false);
397
+ await engine.refresh(refresh);
357
398
  }
358
399
  })();
359
400
 
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see tsparticles.preset.squares.min.js.LICENSE.txt */
2
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/plugin-emitters"),require("@tsparticles/engine"),require("@tsparticles/updater-size"),require("@tsparticles/shape-square"),require("@tsparticles/updater-stroke-color"));else if("function"==typeof define&&define.amd)define(["@tsparticles/plugin-emitters","@tsparticles/engine","@tsparticles/updater-size","@tsparticles/shape-square","@tsparticles/updater-stroke-color"],t);else{var a="object"==typeof exports?t(require("@tsparticles/plugin-emitters"),require("@tsparticles/engine"),require("@tsparticles/updater-size"),require("@tsparticles/shape-square"),require("@tsparticles/updater-stroke-color")):t(e.window,e.window,e.window,e.window,e.window);for(var o in a)("object"==typeof exports?exports:e)[o]=a[o]}}(this,((e,t,a,o,r)=>(()=>{"use strict";var i={533:e=>{e.exports=t},68:t=>{t.exports=e},652:e=>{e.exports=o},2:e=>{e.exports=a},204:e=>{e.exports=r}},s={};function n(e){var t=s[e];if(void 0!==t)return t.exports;var a=s[e]={exports:{}};return i[e](a,a.exports,n),a.exports}n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var c={};return(()=>{n.r(c),n.d(c,{loadSquaresPreset:()=>u});var e=n(68),t=n(533);class a{constructor(){this.enable=!1,this.speed=0,this.decay=0,this.sync=!1}load(e){e&&(void 0!==e.enable&&(this.enable=e.enable),void 0!==e.speed&&(this.speed=(0,t.setRangeValue)(e.speed)),void 0!==e.decay&&(this.decay=(0,t.setRangeValue)(e.decay)),void 0!==e.sync&&(this.sync=e.sync))}}class o extends t.ValueWithRandom{constructor(){super(),this.animation=new a,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 r{constructor(e){this.container=e}init(e){const a=e.options.rotate;if(!a)return;e.rotate={enable:a.animation.enable,value:(0,t.getRangeValue)(a.value)*Math.PI/180},e.pathRotation=a.path;let o=a.direction;if("random"===o){o=Math.floor(2*(0,t.getRandom)())>0?"counter-clockwise":"clockwise"}switch(o){case"counter-clockwise":case"counterClockwise":e.rotate.status="decreasing";break;case"clockwise":e.rotate.status="increasing"}const r=a.animation;r.enable&&(e.rotate.decay=1-(0,t.getRangeValue)(r.decay),e.rotate.velocity=(0,t.getRangeValue)(r.speed)/360*this.container.retina.reduceFactor,r.sync||(e.rotate.velocity*=(0,t.getRandom)())),e.rotation=e.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 o);for(const a of t)e.rotate.load(a?.rotate)}update(e,t){this.isEnabled(e)&&(!function(e,t){const a=e.rotate,o=e.options.rotate;if(!a||!o)return;const r=o.animation,i=(a.velocity??0)*t.factor,s=2*Math.PI,n=a.decay??1;r.enable&&("increasing"===a.status?(a.value+=i,a.value>s&&(a.value-=s)):(a.value-=i,a.value<0&&(a.value+=s)),a.velocity&&1!==n&&(a.velocity*=n))}(e,t),e.rotation=e.rotate?.value??0)}}var i=n(2),s=n(652),l=n(204);const d={particles:{stroke:{width:5,color:{value:["#5bc0eb","#fde74c","#9bc53d","#e55934","#fa7921","#2FF3E0","#F8D210","#FA26A0","#F51720"]}},shape:{type:"square",options:{square:{fill:!1}}},rotate:{value:0,direction:"counter-clockwise",animation:{enable:!0,speed:2,sync:!0}},size:{value:{min:1,max:500},animation:{enable:!0,startValue:"min",speed:60,sync:!0,destroy:"max"}}},background:{color:"#000"},emitters:{position:{y:50,x:50},rate:{delay:1,quantity:1}}};async function u(t,a=!0){await(0,e.loadEmittersPlugin)(t,!1),await(0,s.loadSquareShape)(t,!1),await async function(e,t=!0){await e.addParticleUpdater("rotate",(e=>new r(e)),t)}(t,!1),await(0,i.loadSizeUpdater)(t,!1),await(0,l.loadStrokeColorUpdater)(t,!1),await t.addPreset("squares",d,a)}})(),c})()));
2
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/plugin-emitters"),require("@tsparticles/engine"),require("@tsparticles/updater-size"),require("@tsparticles/shape-square"),require("@tsparticles/updater-stroke-color"));else if("function"==typeof define&&define.amd)define(["@tsparticles/plugin-emitters","@tsparticles/engine","@tsparticles/updater-size","@tsparticles/shape-square","@tsparticles/updater-stroke-color"],t);else{var a="object"==typeof exports?t(require("@tsparticles/plugin-emitters"),require("@tsparticles/engine"),require("@tsparticles/updater-size"),require("@tsparticles/shape-square"),require("@tsparticles/updater-stroke-color")):t(e.window,e.window,e.window,e.window,e.window);for(var r in a)("object"==typeof exports?exports:e)[r]=a[r]}}(this,((e,t,a,r,i)=>(()=>{"use strict";var o={533:e=>{e.exports=t},68:t=>{t.exports=e},652:e=>{e.exports=r},2:e=>{e.exports=a},204:e=>{e.exports=i}},s={};function n(e){var t=s[e];if(void 0!==t)return t.exports;var a=s[e]={exports:{}};return o[e](a,a.exports,n),a.exports}n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var c={};return(()=>{n.r(c),n.d(c,{loadSquaresPreset:()=>g});var e,t=n(68),a=n(533);!function(e){e[e.r=1]="r",e[e.g=2]="g",e[e.b=3]="b",e[e.a=4]="a"}(e||(e={}));const r=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i,i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i;class o{constructor(){this.key="hex",this.stringPrefix="#"}handleColor(e){return this._parseString(e.value)}handleRangeColor(e){return this._parseString(e.value)}parseString(e){return this._parseString(e)}_parseString(t){if("string"!=typeof t)return;if(!t?.startsWith(this.stringPrefix))return;const a=t.replace(r,((e,t,a,r,i)=>t+t+a+a+r+r+(void 0!==i?i+i:""))),o=i.exec(a);return o?{a:void 0!==o[e.a]?parseInt(o[e.a],16)/255:1,b:parseInt(o[e.b],16),g:parseInt(o[e.g],16),r:parseInt(o[e.r],16)}:void 0}}class s{constructor(){this.enable=!1,this.speed=0,this.decay=0,this.sync=!1}load(e){(0,a.isNull)(e)||(void 0!==e.enable&&(this.enable=e.enable),void 0!==e.speed&&(this.speed=(0,a.setRangeValue)(e.speed)),void 0!==e.decay&&(this.decay=(0,a.setRangeValue)(e.decay)),void 0!==e.sync&&(this.sync=e.sync))}}class l extends a.ValueWithRandom{constructor(){super(),this.animation=new s,this.direction=a.RotateDirection.clockwise,this.path=!1,this.value=0}load(e){(0,a.isNull)(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))}}const d=2*Math.PI;class p{constructor(e){this.container=e}init(e){const t=e.options.rotate;if(!t)return;e.rotate={enable:t.animation.enable,value:(0,a.degToRad)((0,a.getRangeValue)(t.value)),min:0,max:d},e.pathRotation=t.path;let r=t.direction;if(r===a.RotateDirection.random){r=Math.floor(2*(0,a.getRandom)())>0?a.RotateDirection.counterClockwise:a.RotateDirection.clockwise}switch(r){case a.RotateDirection.counterClockwise:case"counterClockwise":e.rotate.status=a.AnimationStatus.decreasing;break;case a.RotateDirection.clockwise:e.rotate.status=a.AnimationStatus.increasing}const i=t.animation;i.enable&&(e.rotate.decay=1-(0,a.getRangeValue)(i.decay),e.rotate.velocity=(0,a.getRangeValue)(i.speed)/360*this.container.retina.reduceFactor,i.sync||(e.rotate.velocity*=(0,a.getRandom)())),e.rotation=e.rotate.value}isEnabled(e){const t=e.options.rotate;return!!t&&(!e.destroyed&&!e.spawning&&(!!t.value||t.animation.enable||t.path))}loadOptions(e,...t){e.rotate||(e.rotate=new l);for(const a of t)e.rotate.load(a?.rotate)}update(e,t){this.isEnabled(e)&&(e.isRotating=!!e.rotate,e.rotate&&((0,a.updateAnimation)(e,e.rotate,!1,a.DestroyType.none,t),e.rotation=e.rotate.value))}}var u=n(2),h=n(652),f=n(204);const y={particles:{stroke:{width:5,color:{value:["#5bc0eb","#fde74c","#9bc53d","#e55934","#fa7921","#2FF3E0","#F8D210","#FA26A0","#F51720"]}},shape:{type:"square",options:{square:{fill:!1}}},rotate:{value:0,direction:a.RotateDirection.counterClockwise,animation:{enable:!0,speed:2,sync:!0}},size:{value:{min:1,max:500},animation:{enable:!0,startValue:a.StartValueType.min,speed:60,sync:!0,destroy:a.DestroyType.max}}},background:{color:"#000"},emitters:{position:{y:50,x:50},rate:{delay:1,quantity:1}}};async function g(e,r=!0){await async function(e,t=!0){(0,a.assertValidVersion)(e,"3.7.1"),await e.addColorManager(new o,t)}(e,!1),await(0,t.loadEmittersPlugin)(e,!1),await(0,h.loadSquareShape)(e,!1),await async function(e,t=!0){(0,a.assertValidVersion)(e,"3.7.1"),await e.addParticleUpdater("rotate",(e=>Promise.resolve(new p(e))),t)}(e,!1),await(0,u.loadSizeUpdater)(e,!1),await(0,f.loadStrokeColorUpdater)(e,!1),await e.addPreset("squares",y,!1),await e.refresh(r)}})(),c})()));
@@ -1 +1 @@
1
- /*! tsParticles undefined Preset v3.0.2 by Matteo Bruni */
1
+ /*! tsParticles undefined Preset v3.2.0 by Matteo Bruni */
package/umd/bundle.js CHANGED
@@ -14,5 +14,4 @@
14
14
  Object.defineProperty(exports, "loadSquaresPreset", { enumerable: true, get: function () { return index_js_1.loadSquaresPreset; } });
15
15
  const engine_1 = require("@tsparticles/engine");
16
16
  Object.defineProperty(exports, "tsParticles", { enumerable: true, get: function () { return engine_1.tsParticles; } });
17
- void (0, index_js_1.loadSquaresPreset)(engine_1.tsParticles);
18
17
  });
package/umd/index.js CHANGED
@@ -4,25 +4,28 @@
4
4
  if (v !== undefined) module.exports = v;
5
5
  }
6
6
  else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "@tsparticles/plugin-emitters", "@tsparticles/updater-rotate", "@tsparticles/updater-size", "@tsparticles/shape-square", "@tsparticles/updater-stroke-color", "./options.js"], factory);
7
+ define(["require", "exports", "@tsparticles/plugin-emitters", "@tsparticles/plugin-hex-color", "@tsparticles/updater-rotate", "@tsparticles/updater-size", "@tsparticles/shape-square", "@tsparticles/updater-stroke-color", "./options.js"], factory);
8
8
  }
9
9
  })(function (require, exports) {
10
10
  "use strict";
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.loadSquaresPreset = void 0;
13
13
  const plugin_emitters_1 = require("@tsparticles/plugin-emitters");
14
+ const plugin_hex_color_1 = require("@tsparticles/plugin-hex-color");
14
15
  const updater_rotate_1 = require("@tsparticles/updater-rotate");
15
16
  const updater_size_1 = require("@tsparticles/updater-size");
16
17
  const shape_square_1 = require("@tsparticles/shape-square");
17
18
  const updater_stroke_color_1 = require("@tsparticles/updater-stroke-color");
18
19
  const options_js_1 = require("./options.js");
19
20
  async function loadSquaresPreset(engine, refresh = true) {
21
+ await (0, plugin_hex_color_1.loadHexColorPlugin)(engine, false);
20
22
  await (0, plugin_emitters_1.loadEmittersPlugin)(engine, false);
21
23
  await (0, shape_square_1.loadSquareShape)(engine, false);
22
24
  await (0, updater_rotate_1.loadRotateUpdater)(engine, false);
23
25
  await (0, updater_size_1.loadSizeUpdater)(engine, false);
24
26
  await (0, updater_stroke_color_1.loadStrokeColorUpdater)(engine, false);
25
- await engine.addPreset("squares", options_js_1.options, refresh);
27
+ await engine.addPreset("squares", options_js_1.options, false);
28
+ await engine.refresh(refresh);
26
29
  }
27
30
  exports.loadSquaresPreset = loadSquaresPreset;
28
31
  });
package/umd/options.js CHANGED
@@ -4,12 +4,13 @@
4
4
  if (v !== undefined) module.exports = v;
5
5
  }
6
6
  else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports"], factory);
7
+ define(["require", "exports", "@tsparticles/engine"], factory);
8
8
  }
9
9
  })(function (require, exports) {
10
10
  "use strict";
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.options = void 0;
13
+ const engine_1 = require("@tsparticles/engine");
13
14
  exports.options = {
14
15
  particles: {
15
16
  stroke: {
@@ -38,7 +39,7 @@
38
39
  },
39
40
  rotate: {
40
41
  value: 0,
41
- direction: "counter-clockwise",
42
+ direction: engine_1.RotateDirection.counterClockwise,
42
43
  animation: {
43
44
  enable: true,
44
45
  speed: 2,
@@ -49,10 +50,10 @@
49
50
  value: { min: 1, max: 500 },
50
51
  animation: {
51
52
  enable: true,
52
- startValue: "min",
53
+ startValue: engine_1.StartValueType.min,
53
54
  speed: 60,
54
55
  sync: true,
55
- destroy: "max",
56
+ destroy: engine_1.DestroyType.max,
56
57
  },
57
58
  },
58
59
  },