@tsparticles/updater-opacity 4.1.3 → 4.2.1

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,4 +1,5 @@
1
- import { getRandom, getRangeValue, initParticleNumericAnimationValue, percentDenominator, updateAnimation, } from "@tsparticles/engine";
1
+ import { getRandom, getRangeValue, loadOptionProperty, percentDenominator, } from "@tsparticles/engine";
2
+ import { initParticleNumericAnimationValue, updateAnimation } from "@tsparticles/animation-utils";
2
3
  import { Opacity } from "./Options/Classes/Opacity.js";
3
4
  export class OpacityUpdater {
4
5
  #container;
@@ -31,10 +32,7 @@ export class OpacityUpdater {
31
32
  (particle.opacity.loops ?? none) < (particle.opacity.maxLoops ?? none))));
32
33
  }
33
34
  loadOptions(options, ...sources) {
34
- options.opacity ??= new Opacity();
35
- for (const source of sources) {
36
- options.opacity.load(source?.opacity);
37
- }
35
+ loadOptionProperty(options, "opacity", Opacity, ...sources);
38
36
  }
39
37
  reset(particle) {
40
38
  if (!particle.opacity) {
@@ -1,12 +1,8 @@
1
1
  import { RangedAnimationValueWithRandom, isNull } from "@tsparticles/engine";
2
2
  import { OpacityAnimation } from "./OpacityAnimation.js";
3
3
  export class Opacity extends RangedAnimationValueWithRandom {
4
- animation;
5
- constructor() {
6
- super();
7
- this.animation = new OpacityAnimation();
8
- this.value = 1;
9
- }
4
+ animation = new OpacityAnimation();
5
+ value = 1;
10
6
  load(data) {
11
7
  if (isNull(data)) {
12
8
  return;
@@ -1,18 +1,11 @@
1
- import { DestroyType, RangedAnimationOptions, isNull, } from "@tsparticles/engine";
1
+ import { DestroyType, RangedAnimationOptions, isNull, loadProperty, } from "@tsparticles/engine";
2
2
  export class OpacityAnimation extends RangedAnimationOptions {
3
- destroy;
4
- constructor() {
5
- super();
6
- this.destroy = DestroyType.none;
7
- this.speed = 2;
8
- }
3
+ destroy = DestroyType.none;
9
4
  load(data) {
10
5
  super.load(data);
11
6
  if (isNull(data)) {
12
7
  return;
13
8
  }
14
- if (data.destroy !== undefined) {
15
- this.destroy = data.destroy;
16
- }
9
+ loadProperty(this, "destroy", data.destroy);
17
10
  }
18
11
  }
package/browser/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { OpacityUpdater } from "./OpacityUpdater.js";
2
2
  export async function loadOpacityUpdater(engine) {
3
- engine.checkVersion("4.1.3");
3
+ engine.checkVersion("4.2.1");
4
4
  await engine.pluginManager.register(e => {
5
5
  e.pluginManager.addParticleUpdater("opacity", container => {
6
6
  return Promise.resolve(new OpacityUpdater(container));
@@ -1,5 +1,5 @@
1
1
  export async function loadOpacityUpdater(engine) {
2
- engine.checkVersion("4.1.3");
2
+ engine.checkVersion("4.2.1");
3
3
  await engine.pluginManager.register(e => {
4
4
  e.pluginManager.addParticleUpdater("opacity", async (container) => {
5
5
  const { OpacityUpdater } = await import("./OpacityUpdater.js");
@@ -1,4 +1,5 @@
1
- import { getRandom, getRangeValue, initParticleNumericAnimationValue, percentDenominator, updateAnimation, } from "@tsparticles/engine";
1
+ import { getRandom, getRangeValue, loadOptionProperty, percentDenominator, } from "@tsparticles/engine";
2
+ import { initParticleNumericAnimationValue, updateAnimation } from "@tsparticles/animation-utils";
2
3
  import { Opacity } from "./Options/Classes/Opacity.js";
3
4
  export class OpacityUpdater {
4
5
  #container;
@@ -31,10 +32,7 @@ export class OpacityUpdater {
31
32
  (particle.opacity.loops ?? none) < (particle.opacity.maxLoops ?? none))));
32
33
  }
33
34
  loadOptions(options, ...sources) {
34
- options.opacity ??= new Opacity();
35
- for (const source of sources) {
36
- options.opacity.load(source?.opacity);
37
- }
35
+ loadOptionProperty(options, "opacity", Opacity, ...sources);
38
36
  }
39
37
  reset(particle) {
40
38
  if (!particle.opacity) {
@@ -1,12 +1,8 @@
1
1
  import { RangedAnimationValueWithRandom, isNull } from "@tsparticles/engine";
2
2
  import { OpacityAnimation } from "./OpacityAnimation.js";
3
3
  export class Opacity extends RangedAnimationValueWithRandom {
4
- animation;
5
- constructor() {
6
- super();
7
- this.animation = new OpacityAnimation();
8
- this.value = 1;
9
- }
4
+ animation = new OpacityAnimation();
5
+ value = 1;
10
6
  load(data) {
11
7
  if (isNull(data)) {
12
8
  return;
@@ -1,18 +1,11 @@
1
- import { DestroyType, RangedAnimationOptions, isNull, } from "@tsparticles/engine";
1
+ import { DestroyType, RangedAnimationOptions, isNull, loadProperty, } from "@tsparticles/engine";
2
2
  export class OpacityAnimation extends RangedAnimationOptions {
3
- destroy;
4
- constructor() {
5
- super();
6
- this.destroy = DestroyType.none;
7
- this.speed = 2;
8
- }
3
+ destroy = DestroyType.none;
9
4
  load(data) {
10
5
  super.load(data);
11
6
  if (isNull(data)) {
12
7
  return;
13
8
  }
14
- if (data.destroy !== undefined) {
15
- this.destroy = data.destroy;
16
- }
9
+ loadProperty(this, "destroy", data.destroy);
17
10
  }
18
11
  }
package/cjs/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { OpacityUpdater } from "./OpacityUpdater.js";
2
2
  export async function loadOpacityUpdater(engine) {
3
- engine.checkVersion("4.1.3");
3
+ engine.checkVersion("4.2.1");
4
4
  await engine.pluginManager.register(e => {
5
5
  e.pluginManager.addParticleUpdater("opacity", container => {
6
6
  return Promise.resolve(new OpacityUpdater(container));
package/cjs/index.lazy.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export async function loadOpacityUpdater(engine) {
2
- engine.checkVersion("4.1.3");
2
+ engine.checkVersion("4.2.1");
3
3
  await engine.pluginManager.register(e => {
4
4
  e.pluginManager.addParticleUpdater("opacity", async (container) => {
5
5
  const { OpacityUpdater } = await import("./OpacityUpdater.js");
@@ -1,4 +1,5 @@
1
- import { getRandom, getRangeValue, initParticleNumericAnimationValue, percentDenominator, updateAnimation, } from "@tsparticles/engine";
1
+ import { getRandom, getRangeValue, loadOptionProperty, percentDenominator, } from "@tsparticles/engine";
2
+ import { initParticleNumericAnimationValue, updateAnimation } from "@tsparticles/animation-utils";
2
3
  import { Opacity } from "./Options/Classes/Opacity.js";
3
4
  export class OpacityUpdater {
4
5
  #container;
@@ -31,10 +32,7 @@ export class OpacityUpdater {
31
32
  (particle.opacity.loops ?? none) < (particle.opacity.maxLoops ?? none))));
32
33
  }
33
34
  loadOptions(options, ...sources) {
34
- options.opacity ??= new Opacity();
35
- for (const source of sources) {
36
- options.opacity.load(source?.opacity);
37
- }
35
+ loadOptionProperty(options, "opacity", Opacity, ...sources);
38
36
  }
39
37
  reset(particle) {
40
38
  if (!particle.opacity) {
@@ -1,12 +1,8 @@
1
1
  import { RangedAnimationValueWithRandom, isNull } from "@tsparticles/engine";
2
2
  import { OpacityAnimation } from "./OpacityAnimation.js";
3
3
  export class Opacity extends RangedAnimationValueWithRandom {
4
- animation;
5
- constructor() {
6
- super();
7
- this.animation = new OpacityAnimation();
8
- this.value = 1;
9
- }
4
+ animation = new OpacityAnimation();
5
+ value = 1;
10
6
  load(data) {
11
7
  if (isNull(data)) {
12
8
  return;
@@ -1,18 +1,11 @@
1
- import { DestroyType, RangedAnimationOptions, isNull, } from "@tsparticles/engine";
1
+ import { DestroyType, RangedAnimationOptions, isNull, loadProperty, } from "@tsparticles/engine";
2
2
  export class OpacityAnimation extends RangedAnimationOptions {
3
- destroy;
4
- constructor() {
5
- super();
6
- this.destroy = DestroyType.none;
7
- this.speed = 2;
8
- }
3
+ destroy = DestroyType.none;
9
4
  load(data) {
10
5
  super.load(data);
11
6
  if (isNull(data)) {
12
7
  return;
13
8
  }
14
- if (data.destroy !== undefined) {
15
- this.destroy = data.destroy;
16
- }
9
+ loadProperty(this, "destroy", data.destroy);
17
10
  }
18
11
  }
package/esm/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { OpacityUpdater } from "./OpacityUpdater.js";
2
2
  export async function loadOpacityUpdater(engine) {
3
- engine.checkVersion("4.1.3");
3
+ engine.checkVersion("4.2.1");
4
4
  await engine.pluginManager.register(e => {
5
5
  e.pluginManager.addParticleUpdater("opacity", container => {
6
6
  return Promise.resolve(new OpacityUpdater(container));
package/esm/index.lazy.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export async function loadOpacityUpdater(engine) {
2
- engine.checkVersion("4.1.3");
2
+ engine.checkVersion("4.2.1");
3
3
  await engine.pluginManager.register(e => {
4
4
  e.pluginManager.addParticleUpdater("opacity", async (container) => {
5
5
  const { OpacityUpdater } = await import("./OpacityUpdater.js");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsparticles/updater-opacity",
3
- "version": "4.1.3",
3
+ "version": "4.2.1",
4
4
  "description": "tsParticles particles opacity updater",
5
5
  "homepage": "https://particles.js.org",
6
6
  "repository": {
@@ -92,8 +92,11 @@
92
92
  },
93
93
  "./package.json": "./package.json"
94
94
  },
95
+ "dependencies": {
96
+ "@tsparticles/animation-utils": "4.2.1"
97
+ },
95
98
  "peerDependencies": {
96
- "@tsparticles/engine": "4.1.3"
99
+ "@tsparticles/engine": "4.2.1"
97
100
  },
98
101
  "publishConfig": {
99
102
  "access": "public"
package/report.html CHANGED
@@ -4930,7 +4930,7 @@ var drawChart = (function (exports) {
4930
4930
  </script>
4931
4931
  <script>
4932
4932
  /*<!--*/
4933
- const data = {"version":2,"tree":{"name":"root","children":[{"name":"tsparticles.updater.opacity.js","children":[{"name":"dist/browser","children":[{"name":"Options/Classes","children":[{"uid":"b4877abc-1","name":"OpacityAnimation.js"},{"uid":"b4877abc-3","name":"Opacity.js"}]},{"uid":"b4877abc-5","name":"OpacityUpdater.js"},{"uid":"b4877abc-7","name":"index.js"},{"uid":"b4877abc-9","name":"browser.js"}]}]}],"isRoot":true},"nodeParts":{"b4877abc-1":{"renderedLength":467,"gzipLength":0,"brotliLength":0,"metaUid":"b4877abc-0"},"b4877abc-3":{"renderedLength":515,"gzipLength":0,"brotliLength":0,"metaUid":"b4877abc-2"},"b4877abc-5":{"renderedLength":2008,"gzipLength":0,"brotliLength":0,"metaUid":"b4877abc-4"},"b4877abc-7":{"renderedLength":314,"gzipLength":0,"brotliLength":0,"metaUid":"b4877abc-6"},"b4877abc-9":{"renderedLength":179,"gzipLength":0,"brotliLength":0,"metaUid":"b4877abc-8"}},"nodeMetas":{"b4877abc-0":{"id":"/dist/browser/Options/Classes/OpacityAnimation.js","moduleParts":{"tsparticles.updater.opacity.js":"b4877abc-1"},"imported":[{"uid":"b4877abc-10"}],"importedBy":[{"uid":"b4877abc-2"}]},"b4877abc-2":{"id":"/dist/browser/Options/Classes/Opacity.js","moduleParts":{"tsparticles.updater.opacity.js":"b4877abc-3"},"imported":[{"uid":"b4877abc-10"},{"uid":"b4877abc-0"}],"importedBy":[{"uid":"b4877abc-4"}]},"b4877abc-4":{"id":"/dist/browser/OpacityUpdater.js","moduleParts":{"tsparticles.updater.opacity.js":"b4877abc-5"},"imported":[{"uid":"b4877abc-10"},{"uid":"b4877abc-2"}],"importedBy":[{"uid":"b4877abc-6"}]},"b4877abc-6":{"id":"/dist/browser/index.js","moduleParts":{"tsparticles.updater.opacity.js":"b4877abc-7"},"imported":[{"uid":"b4877abc-4"}],"importedBy":[{"uid":"b4877abc-8"}]},"b4877abc-8":{"id":"/dist/browser/browser.js","moduleParts":{"tsparticles.updater.opacity.js":"b4877abc-9"},"imported":[{"uid":"b4877abc-6"}],"importedBy":[],"isEntry":true},"b4877abc-10":{"id":"@tsparticles/engine","moduleParts":{},"imported":[],"importedBy":[{"uid":"b4877abc-4"},{"uid":"b4877abc-2"},{"uid":"b4877abc-0"}],"isExternal":true}},"env":{"rollup":"4.60.4"},"options":{"gzip":false,"brotli":false,"sourcemap":false}};
4933
+ const data = {"version":2,"tree":{"name":"root","children":[{"name":"tsparticles.updater.opacity.js","children":[{"name":"dist/browser","children":[{"name":"Options/Classes","children":[{"uid":"e207a38e-1","name":"OpacityAnimation.js"},{"uid":"e207a38e-3","name":"Opacity.js"}]},{"uid":"e207a38e-5","name":"OpacityUpdater.js"},{"uid":"e207a38e-7","name":"index.js"},{"uid":"e207a38e-9","name":"browser.js"}]}]}],"isRoot":true},"nodeParts":{"e207a38e-1":{"renderedLength":317,"gzipLength":0,"brotliLength":0,"metaUid":"e207a38e-0"},"e207a38e-3":{"renderedLength":423,"gzipLength":0,"brotliLength":0,"metaUid":"e207a38e-2"},"e207a38e-5":{"renderedLength":1944,"gzipLength":0,"brotliLength":0,"metaUid":"e207a38e-4"},"e207a38e-7":{"renderedLength":314,"gzipLength":0,"brotliLength":0,"metaUid":"e207a38e-6"},"e207a38e-9":{"renderedLength":179,"gzipLength":0,"brotliLength":0,"metaUid":"e207a38e-8"}},"nodeMetas":{"e207a38e-0":{"id":"/dist/browser/Options/Classes/OpacityAnimation.js","moduleParts":{"tsparticles.updater.opacity.js":"e207a38e-1"},"imported":[{"uid":"e207a38e-10"}],"importedBy":[{"uid":"e207a38e-2"}]},"e207a38e-2":{"id":"/dist/browser/Options/Classes/Opacity.js","moduleParts":{"tsparticles.updater.opacity.js":"e207a38e-3"},"imported":[{"uid":"e207a38e-10"},{"uid":"e207a38e-0"}],"importedBy":[{"uid":"e207a38e-4"}]},"e207a38e-4":{"id":"/dist/browser/OpacityUpdater.js","moduleParts":{"tsparticles.updater.opacity.js":"e207a38e-5"},"imported":[{"uid":"e207a38e-10"},{"uid":"e207a38e-11"},{"uid":"e207a38e-2"}],"importedBy":[{"uid":"e207a38e-6"}]},"e207a38e-6":{"id":"/dist/browser/index.js","moduleParts":{"tsparticles.updater.opacity.js":"e207a38e-7"},"imported":[{"uid":"e207a38e-4"}],"importedBy":[{"uid":"e207a38e-8"}]},"e207a38e-8":{"id":"/dist/browser/browser.js","moduleParts":{"tsparticles.updater.opacity.js":"e207a38e-9"},"imported":[{"uid":"e207a38e-6"}],"importedBy":[],"isEntry":true},"e207a38e-10":{"id":"@tsparticles/engine","moduleParts":{},"imported":[],"importedBy":[{"uid":"e207a38e-4"},{"uid":"e207a38e-2"},{"uid":"e207a38e-0"}],"isExternal":true},"e207a38e-11":{"id":"@tsparticles/animation-utils","moduleParts":{},"imported":[],"importedBy":[{"uid":"e207a38e-4"}],"isExternal":true}},"env":{"rollup":"4.62.0"},"options":{"gzip":false,"brotli":false,"sourcemap":false}};
4934
4934
 
4935
4935
  const run = () => {
4936
4936
  const width = window.innerWidth;
@@ -1,36 +1,25 @@
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
- /* Updater v4.1.3 */
2
+ /* Updater v4.2.1 */
3
3
  (function (global, factory) {
4
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tsparticles/engine')) :
5
- typeof define === 'function' && define.amd ? define(['exports', '@tsparticles/engine'], factory) :
6
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.__tsParticlesInternals = global.__tsParticlesInternals || {}, global.__tsParticlesInternals.updaters = global.__tsParticlesInternals.updaters || {}, global.__tsParticlesInternals.updaters.opacity = global.__tsParticlesInternals.updaters.opacity || {}), global.__tsParticlesInternals.engine));
7
- })(this, (function (exports, engine) { 'use strict';
4
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tsparticles/engine'), require('@tsparticles/animation-utils')) :
5
+ typeof define === 'function' && define.amd ? define(['exports', '@tsparticles/engine', '@tsparticles/animation-utils'], factory) :
6
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.__tsParticlesInternals = global.__tsParticlesInternals || {}, global.__tsParticlesInternals.updaters = global.__tsParticlesInternals.updaters || {}, global.__tsParticlesInternals.updaters.opacity = global.__tsParticlesInternals.updaters.opacity || {}), global.__tsParticlesInternals.engine, global.__tsParticlesInternals.animation.utils));
7
+ })(this, (function (exports, engine, animationUtils) { 'use strict';
8
8
 
9
9
  class OpacityAnimation extends engine.RangedAnimationOptions {
10
- destroy;
11
- constructor() {
12
- super();
13
- this.destroy = engine.DestroyType.none;
14
- this.speed = 2;
15
- }
10
+ destroy = engine.DestroyType.none;
16
11
  load(data) {
17
12
  super.load(data);
18
13
  if (engine.isNull(data)) {
19
14
  return;
20
15
  }
21
- if (data.destroy !== undefined) {
22
- this.destroy = data.destroy;
23
- }
16
+ engine.loadProperty(this, "destroy", data.destroy);
24
17
  }
25
18
  }
26
19
 
27
20
  class Opacity extends engine.RangedAnimationValueWithRandom {
28
- animation;
29
- constructor() {
30
- super();
31
- this.animation = new OpacityAnimation();
32
- this.value = 1;
33
- }
21
+ animation = new OpacityAnimation();
22
+ value = 1;
34
23
  load(data) {
35
24
  if (engine.isNull(data)) {
36
25
  return;
@@ -53,7 +42,7 @@
53
42
  if (!opacityOptions) {
54
43
  return;
55
44
  }
56
- particle.opacity = engine.initParticleNumericAnimationValue(opacityOptions, pxRatio);
45
+ particle.opacity = animationUtils.initParticleNumericAnimationValue(opacityOptions, pxRatio);
57
46
  const opacityAnimation = opacityOptions.animation;
58
47
  if (opacityAnimation.enable) {
59
48
  particle.opacity.velocity =
@@ -74,10 +63,7 @@
74
63
  (particle.opacity.loops ?? none) < (particle.opacity.maxLoops ?? none))));
75
64
  }
76
65
  loadOptions(options, ...sources) {
77
- options.opacity ??= new Opacity();
78
- for (const source of sources) {
79
- options.opacity.load(source?.opacity);
80
- }
66
+ engine.loadOptionProperty(options, "opacity", Opacity, ...sources);
81
67
  }
82
68
  reset(particle) {
83
69
  if (!particle.opacity) {
@@ -90,12 +76,12 @@
90
76
  if (!this.isEnabled(particle) || !particle.opacity || !particle.options.opacity) {
91
77
  return;
92
78
  }
93
- engine.updateAnimation(particle, particle.opacity, true, particle.options.opacity.animation.destroy, delta);
79
+ animationUtils.updateAnimation(particle, particle.opacity, true, particle.options.opacity.animation.destroy, delta);
94
80
  }
95
81
  }
96
82
 
97
83
  async function loadOpacityUpdater(engine) {
98
- engine.checkVersion("4.1.3");
84
+ engine.checkVersion("4.2.1");
99
85
  await engine.pluginManager.register(e => {
100
86
  e.pluginManager.addParticleUpdater("opacity", container => {
101
87
  return Promise.resolve(new OpacityUpdater(container));
@@ -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")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/engine"],s):s(((t="undefined"!=typeof globalThis?globalThis:t||self).__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.updaters.opacity=t.__tsParticlesInternals.updaters.opacity||{}),t.__tsParticlesInternals.engine)}(this,function(t,s){"use strict";class e extends s.RangedAnimationOptions{destroy;constructor(){super(),this.destroy=s.DestroyType.none,this.speed=2}load(t){super.load(t),s.isNull(t)||void 0!==t.destroy&&(this.destroy=t.destroy)}}class a extends s.RangedAnimationValueWithRandom{animation;constructor(){super(),this.animation=new e,this.value=1}load(t){if(s.isNull(t))return;super.load(t);const e=t.animation;void 0!==e&&this.animation.load(e)}}class n{#t;constructor(t){this.#t=t}init(t){const e=t.options.opacity;if(!e)return;t.opacity=s.initParticleNumericAnimationValue(e,1);const a=e.animation;a.enable&&(t.opacity.velocity=s.getRangeValue(a.speed)/s.percentDenominator*this.#t.retina.reduceFactor,a.sync||(t.opacity.velocity*=s.getRandom()))}isEnabled(t){return!t.destroyed&&!t.spawning&&!!t.opacity&&t.opacity.enable&&((t.opacity.maxLoops??0)<=0||(t.opacity.maxLoops??0)>0&&(t.opacity.loops??0)<(t.opacity.maxLoops??0))}loadOptions(t,...s){t.opacity??=new a;for(const e of s)t.opacity.load(e?.opacity)}reset(t){t.opacity&&(t.opacity.time=0,t.opacity.loops=0)}update(t,e){this.isEnabled(t)&&t.opacity&&t.options.opacity&&s.updateAnimation(t,t.opacity,!0,t.options.opacity.animation.destroy,e)}}async function r(t){t.checkVersion("4.1.3"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("opacity",t=>Promise.resolve(new n(t)))})}const i=globalThis;i.__tsParticlesInternals=i.__tsParticlesInternals??{},i.loadOpacityUpdater=r,t.loadOpacityUpdater=r}),Object.assign(globalThis.window||globalThis,{loadOpacityUpdater:(globalThis.__tsParticlesInternals.updaters.opacity||{}).loadOpacityUpdater}),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/animation-utils")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/engine","@tsparticles/animation-utils"],s):s(((t="undefined"!=typeof globalThis?globalThis:t||self).__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.updaters.opacity=t.__tsParticlesInternals.updaters.opacity||{}),t.__tsParticlesInternals.engine,t.__tsParticlesInternals.animation.utils)}(this,function(t,s,e){"use strict";class a extends s.RangedAnimationOptions{destroy=s.DestroyType.none;load(t){super.load(t),s.isNull(t)||s.loadProperty(this,"destroy",t.destroy)}}class n extends s.RangedAnimationValueWithRandom{animation=new a;value=1;load(t){if(s.isNull(t))return;super.load(t);const e=t.animation;void 0!==e&&this.animation.load(e)}}class l{#t;constructor(t){this.#t=t}init(t){const a=t.options.opacity;if(!a)return;t.opacity=e.initParticleNumericAnimationValue(a,1);const n=a.animation;n.enable&&(t.opacity.velocity=s.getRangeValue(n.speed)/s.percentDenominator*this.#t.retina.reduceFactor,n.sync||(t.opacity.velocity*=s.getRandom()))}isEnabled(t){return!t.destroyed&&!t.spawning&&!!t.opacity&&t.opacity.enable&&((t.opacity.maxLoops??0)<=0||(t.opacity.maxLoops??0)>0&&(t.opacity.loops??0)<(t.opacity.maxLoops??0))}loadOptions(t,...e){s.loadOptionProperty(t,"opacity",n,...e)}reset(t){t.opacity&&(t.opacity.time=0,t.opacity.loops=0)}update(t,s){this.isEnabled(t)&&t.opacity&&t.options.opacity&&e.updateAnimation(t,t.opacity,!0,t.options.opacity.animation.destroy,s)}}async function i(t){t.checkVersion("4.2.1"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("opacity",t=>Promise.resolve(new l(t)))})}const r=globalThis;r.__tsParticlesInternals=r.__tsParticlesInternals??{},r.loadOpacityUpdater=i,t.loadOpacityUpdater=i}),Object.assign(globalThis.window||globalThis,{loadOpacityUpdater:(globalThis.__tsParticlesInternals.updaters.opacity||{}).loadOpacityUpdater}),delete(globalThis.window||globalThis).tsparticlesInternalExports;
@@ -3,6 +3,6 @@ import type { IOpacity } from "../Interfaces/IOpacity.js";
3
3
  import { OpacityAnimation } from "./OpacityAnimation.js";
4
4
  export declare class Opacity extends RangedAnimationValueWithRandom implements IOpacity, IOptionLoader<IOpacity> {
5
5
  readonly animation: OpacityAnimation;
6
- constructor();
6
+ value: number;
7
7
  load(data?: RecursivePartial<IOpacity>): void;
8
8
  }
@@ -2,6 +2,5 @@ import { DestroyType, type IOptionLoader, RangedAnimationOptions, type Recursive
2
2
  import type { IOpacityAnimation } from "../Interfaces/IOpacityAnimation.js";
3
3
  export declare class OpacityAnimation extends RangedAnimationOptions implements IOpacityAnimation, IOptionLoader<IOpacityAnimation> {
4
4
  destroy: DestroyType | keyof typeof DestroyType;
5
- constructor();
6
5
  load(data?: RecursivePartial<IOpacityAnimation>): void;
7
6
  }