@tsparticles/updater-roll 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,20 +1,13 @@
1
- import { OptionsColor, isNull, setRangeValue, } from "@tsparticles/engine";
1
+ import { OptionsColor, isNull, loadProperty, loadRangeProperty, } from "@tsparticles/engine";
2
2
  import { RollLight } from "./RollLight.js";
3
3
  import { RollMode } from "../../RollMode.js";
4
4
  export class Roll {
5
5
  backColor;
6
- darken;
7
- enable;
8
- enlighten;
9
- mode;
10
- speed;
11
- constructor() {
12
- this.darken = new RollLight();
13
- this.enable = false;
14
- this.enlighten = new RollLight();
15
- this.mode = RollMode.vertical;
16
- this.speed = 25;
17
- }
6
+ darken = new RollLight();
7
+ enable = false;
8
+ enlighten = new RollLight();
9
+ mode = RollMode.vertical;
10
+ speed = 25;
18
11
  load(data) {
19
12
  if (isNull(data)) {
20
13
  return;
@@ -23,15 +16,9 @@ export class Roll {
23
16
  this.backColor = OptionsColor.create(this.backColor, data.backColor);
24
17
  }
25
18
  this.darken.load(data.darken);
26
- if (data.enable !== undefined) {
27
- this.enable = data.enable;
28
- }
19
+ loadProperty(this, "enable", data.enable);
29
20
  this.enlighten.load(data.enlighten);
30
- if (data.mode !== undefined) {
31
- this.mode = data.mode;
32
- }
33
- if (data.speed !== undefined) {
34
- this.speed = setRangeValue(data.speed);
35
- }
21
+ loadProperty(this, "mode", data.mode);
22
+ loadRangeProperty(this, "speed", data.speed);
36
23
  }
37
24
  }
@@ -1,20 +1,12 @@
1
- import { isNull, setRangeValue } from "@tsparticles/engine";
1
+ import { isNull, loadProperty, loadRangeProperty, } from "@tsparticles/engine";
2
2
  export class RollLight {
3
- enable;
4
- value;
5
- constructor() {
6
- this.enable = false;
7
- this.value = 0;
8
- }
3
+ enable = false;
4
+ value = 0;
9
5
  load(data) {
10
6
  if (isNull(data)) {
11
7
  return;
12
8
  }
13
- if (data.enable !== undefined) {
14
- this.enable = data.enable;
15
- }
16
- if (data.value !== undefined) {
17
- this.value = setRangeValue(data.value);
18
- }
9
+ loadProperty(this, "enable", data.enable);
10
+ loadRangeProperty(this, "value", data.value);
19
11
  }
20
12
  }
@@ -1,3 +1,4 @@
1
+ import { loadOptionProperty, } from "@tsparticles/engine";
1
2
  import { initParticle, updateRoll } from "./Utils.js";
2
3
  import { Roll } from "./Options/Classes/Roll.js";
3
4
  export class RollUpdater {
@@ -20,10 +21,7 @@ export class RollUpdater {
20
21
  return !particle.destroyed && !particle.spawning && !!roll?.enable;
21
22
  }
22
23
  loadOptions(options, ...sources) {
23
- options.roll ??= new Roll();
24
- for (const source of sources) {
25
- options.roll.load(source?.roll);
26
- }
24
+ loadOptionProperty(options, "roll", Roll, ...sources);
27
25
  }
28
26
  update(particle, delta) {
29
27
  if (!this.isEnabled(particle)) {
package/browser/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { RollUpdater } from "./RollUpdater.js";
2
2
  export async function loadRollUpdater(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("roll", () => {
6
6
  return Promise.resolve(new RollUpdater(e.pluginManager));
@@ -1,5 +1,5 @@
1
1
  export async function loadRollUpdater(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("roll", async () => {
5
5
  const { RollUpdater } = await import("./RollUpdater.js");
@@ -1,20 +1,13 @@
1
- import { OptionsColor, isNull, setRangeValue, } from "@tsparticles/engine";
1
+ import { OptionsColor, isNull, loadProperty, loadRangeProperty, } from "@tsparticles/engine";
2
2
  import { RollLight } from "./RollLight.js";
3
3
  import { RollMode } from "../../RollMode.js";
4
4
  export class Roll {
5
5
  backColor;
6
- darken;
7
- enable;
8
- enlighten;
9
- mode;
10
- speed;
11
- constructor() {
12
- this.darken = new RollLight();
13
- this.enable = false;
14
- this.enlighten = new RollLight();
15
- this.mode = RollMode.vertical;
16
- this.speed = 25;
17
- }
6
+ darken = new RollLight();
7
+ enable = false;
8
+ enlighten = new RollLight();
9
+ mode = RollMode.vertical;
10
+ speed = 25;
18
11
  load(data) {
19
12
  if (isNull(data)) {
20
13
  return;
@@ -23,15 +16,9 @@ export class Roll {
23
16
  this.backColor = OptionsColor.create(this.backColor, data.backColor);
24
17
  }
25
18
  this.darken.load(data.darken);
26
- if (data.enable !== undefined) {
27
- this.enable = data.enable;
28
- }
19
+ loadProperty(this, "enable", data.enable);
29
20
  this.enlighten.load(data.enlighten);
30
- if (data.mode !== undefined) {
31
- this.mode = data.mode;
32
- }
33
- if (data.speed !== undefined) {
34
- this.speed = setRangeValue(data.speed);
35
- }
21
+ loadProperty(this, "mode", data.mode);
22
+ loadRangeProperty(this, "speed", data.speed);
36
23
  }
37
24
  }
@@ -1,20 +1,12 @@
1
- import { isNull, setRangeValue } from "@tsparticles/engine";
1
+ import { isNull, loadProperty, loadRangeProperty, } from "@tsparticles/engine";
2
2
  export class RollLight {
3
- enable;
4
- value;
5
- constructor() {
6
- this.enable = false;
7
- this.value = 0;
8
- }
3
+ enable = false;
4
+ value = 0;
9
5
  load(data) {
10
6
  if (isNull(data)) {
11
7
  return;
12
8
  }
13
- if (data.enable !== undefined) {
14
- this.enable = data.enable;
15
- }
16
- if (data.value !== undefined) {
17
- this.value = setRangeValue(data.value);
18
- }
9
+ loadProperty(this, "enable", data.enable);
10
+ loadRangeProperty(this, "value", data.value);
19
11
  }
20
12
  }
@@ -1,3 +1,4 @@
1
+ import { loadOptionProperty, } from "@tsparticles/engine";
1
2
  import { initParticle, updateRoll } from "./Utils.js";
2
3
  import { Roll } from "./Options/Classes/Roll.js";
3
4
  export class RollUpdater {
@@ -20,10 +21,7 @@ export class RollUpdater {
20
21
  return !particle.destroyed && !particle.spawning && !!roll?.enable;
21
22
  }
22
23
  loadOptions(options, ...sources) {
23
- options.roll ??= new Roll();
24
- for (const source of sources) {
25
- options.roll.load(source?.roll);
26
- }
24
+ loadOptionProperty(options, "roll", Roll, ...sources);
27
25
  }
28
26
  update(particle, delta) {
29
27
  if (!this.isEnabled(particle)) {
package/cjs/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { RollUpdater } from "./RollUpdater.js";
2
2
  export async function loadRollUpdater(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("roll", () => {
6
6
  return Promise.resolve(new RollUpdater(e.pluginManager));
package/cjs/index.lazy.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export async function loadRollUpdater(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("roll", async () => {
5
5
  const { RollUpdater } = await import("./RollUpdater.js");
@@ -1,20 +1,13 @@
1
- import { OptionsColor, isNull, setRangeValue, } from "@tsparticles/engine";
1
+ import { OptionsColor, isNull, loadProperty, loadRangeProperty, } from "@tsparticles/engine";
2
2
  import { RollLight } from "./RollLight.js";
3
3
  import { RollMode } from "../../RollMode.js";
4
4
  export class Roll {
5
5
  backColor;
6
- darken;
7
- enable;
8
- enlighten;
9
- mode;
10
- speed;
11
- constructor() {
12
- this.darken = new RollLight();
13
- this.enable = false;
14
- this.enlighten = new RollLight();
15
- this.mode = RollMode.vertical;
16
- this.speed = 25;
17
- }
6
+ darken = new RollLight();
7
+ enable = false;
8
+ enlighten = new RollLight();
9
+ mode = RollMode.vertical;
10
+ speed = 25;
18
11
  load(data) {
19
12
  if (isNull(data)) {
20
13
  return;
@@ -23,15 +16,9 @@ export class Roll {
23
16
  this.backColor = OptionsColor.create(this.backColor, data.backColor);
24
17
  }
25
18
  this.darken.load(data.darken);
26
- if (data.enable !== undefined) {
27
- this.enable = data.enable;
28
- }
19
+ loadProperty(this, "enable", data.enable);
29
20
  this.enlighten.load(data.enlighten);
30
- if (data.mode !== undefined) {
31
- this.mode = data.mode;
32
- }
33
- if (data.speed !== undefined) {
34
- this.speed = setRangeValue(data.speed);
35
- }
21
+ loadProperty(this, "mode", data.mode);
22
+ loadRangeProperty(this, "speed", data.speed);
36
23
  }
37
24
  }
@@ -1,20 +1,12 @@
1
- import { isNull, setRangeValue } from "@tsparticles/engine";
1
+ import { isNull, loadProperty, loadRangeProperty, } from "@tsparticles/engine";
2
2
  export class RollLight {
3
- enable;
4
- value;
5
- constructor() {
6
- this.enable = false;
7
- this.value = 0;
8
- }
3
+ enable = false;
4
+ value = 0;
9
5
  load(data) {
10
6
  if (isNull(data)) {
11
7
  return;
12
8
  }
13
- if (data.enable !== undefined) {
14
- this.enable = data.enable;
15
- }
16
- if (data.value !== undefined) {
17
- this.value = setRangeValue(data.value);
18
- }
9
+ loadProperty(this, "enable", data.enable);
10
+ loadRangeProperty(this, "value", data.value);
19
11
  }
20
12
  }
@@ -1,3 +1,4 @@
1
+ import { loadOptionProperty, } from "@tsparticles/engine";
1
2
  import { initParticle, updateRoll } from "./Utils.js";
2
3
  import { Roll } from "./Options/Classes/Roll.js";
3
4
  export class RollUpdater {
@@ -20,10 +21,7 @@ export class RollUpdater {
20
21
  return !particle.destroyed && !particle.spawning && !!roll?.enable;
21
22
  }
22
23
  loadOptions(options, ...sources) {
23
- options.roll ??= new Roll();
24
- for (const source of sources) {
25
- options.roll.load(source?.roll);
26
- }
24
+ loadOptionProperty(options, "roll", Roll, ...sources);
27
25
  }
28
26
  update(particle, delta) {
29
27
  if (!this.isEnabled(particle)) {
package/esm/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { RollUpdater } from "./RollUpdater.js";
2
2
  export async function loadRollUpdater(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("roll", () => {
6
6
  return Promise.resolve(new RollUpdater(e.pluginManager));
package/esm/index.lazy.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export async function loadRollUpdater(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("roll", async () => {
5
5
  const { RollUpdater } = await import("./RollUpdater.js");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsparticles/updater-roll",
3
- "version": "4.1.3",
3
+ "version": "4.2.1",
4
4
  "description": "tsParticles particles roll updater",
5
5
  "homepage": "https://particles.js.org",
6
6
  "repository": {
@@ -93,7 +93,7 @@
93
93
  "./package.json": "./package.json"
94
94
  },
95
95
  "peerDependencies": {
96
- "@tsparticles/engine": "4.1.3"
96
+ "@tsparticles/engine": "4.2.1"
97
97
  },
98
98
  "publishConfig": {
99
99
  "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.roll.js","children":[{"name":"dist/browser","children":[{"uid":"f885c28c-1","name":"RollMode.js"},{"uid":"f885c28c-3","name":"Utils.js"},{"name":"Options/Classes","children":[{"uid":"f885c28c-5","name":"RollLight.js"},{"uid":"f885c28c-7","name":"Roll.js"}]},{"uid":"f885c28c-9","name":"RollUpdater.js"},{"uid":"f885c28c-11","name":"index.js"},{"uid":"f885c28c-13","name":"browser.js"}]}]}],"isRoot":true},"nodeParts":{"f885c28c-1":{"renderedLength":206,"gzipLength":0,"brotliLength":0,"metaUid":"f885c28c-0"},"f885c28c-3":{"renderedLength":2125,"gzipLength":0,"brotliLength":0,"metaUid":"f885c28c-2"},"f885c28c-5":{"renderedLength":484,"gzipLength":0,"brotliLength":0,"metaUid":"f885c28c-4"},"f885c28c-7":{"renderedLength":1023,"gzipLength":0,"brotliLength":0,"metaUid":"f885c28c-6"},"f885c28c-9":{"renderedLength":1146,"gzipLength":0,"brotliLength":0,"metaUid":"f885c28c-8"},"f885c28c-11":{"renderedLength":304,"gzipLength":0,"brotliLength":0,"metaUid":"f885c28c-10"},"f885c28c-13":{"renderedLength":173,"gzipLength":0,"brotliLength":0,"metaUid":"f885c28c-12"}},"nodeMetas":{"f885c28c-0":{"id":"/dist/browser/RollMode.js","moduleParts":{"tsparticles.updater.roll.js":"f885c28c-1"},"imported":[],"importedBy":[{"uid":"f885c28c-2"},{"uid":"f885c28c-6"}]},"f885c28c-2":{"id":"/dist/browser/Utils.js","moduleParts":{"tsparticles.updater.roll.js":"f885c28c-3"},"imported":[{"uid":"f885c28c-14"},{"uid":"f885c28c-0"}],"importedBy":[{"uid":"f885c28c-8"}]},"f885c28c-4":{"id":"/dist/browser/Options/Classes/RollLight.js","moduleParts":{"tsparticles.updater.roll.js":"f885c28c-5"},"imported":[{"uid":"f885c28c-14"}],"importedBy":[{"uid":"f885c28c-6"}]},"f885c28c-6":{"id":"/dist/browser/Options/Classes/Roll.js","moduleParts":{"tsparticles.updater.roll.js":"f885c28c-7"},"imported":[{"uid":"f885c28c-14"},{"uid":"f885c28c-4"},{"uid":"f885c28c-0"}],"importedBy":[{"uid":"f885c28c-8"}]},"f885c28c-8":{"id":"/dist/browser/RollUpdater.js","moduleParts":{"tsparticles.updater.roll.js":"f885c28c-9"},"imported":[{"uid":"f885c28c-2"},{"uid":"f885c28c-6"}],"importedBy":[{"uid":"f885c28c-10"}]},"f885c28c-10":{"id":"/dist/browser/index.js","moduleParts":{"tsparticles.updater.roll.js":"f885c28c-11"},"imported":[{"uid":"f885c28c-8"}],"importedBy":[{"uid":"f885c28c-12"}]},"f885c28c-12":{"id":"/dist/browser/browser.js","moduleParts":{"tsparticles.updater.roll.js":"f885c28c-13"},"imported":[{"uid":"f885c28c-10"}],"importedBy":[],"isEntry":true},"f885c28c-14":{"id":"@tsparticles/engine","moduleParts":{},"imported":[],"importedBy":[{"uid":"f885c28c-2"},{"uid":"f885c28c-6"},{"uid":"f885c28c-4"}],"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.roll.js","children":[{"name":"dist/browser","children":[{"uid":"6a819b8a-1","name":"RollMode.js"},{"uid":"6a819b8a-3","name":"Utils.js"},{"name":"Options/Classes","children":[{"uid":"6a819b8a-5","name":"RollLight.js"},{"uid":"6a819b8a-7","name":"Roll.js"}]},{"uid":"6a819b8a-9","name":"RollUpdater.js"},{"uid":"6a819b8a-11","name":"index.js"},{"uid":"6a819b8a-13","name":"browser.js"}]}]}],"isRoot":true},"nodeParts":{"6a819b8a-1":{"renderedLength":206,"gzipLength":0,"brotliLength":0,"metaUid":"6a819b8a-0"},"6a819b8a-3":{"renderedLength":2125,"gzipLength":0,"brotliLength":0,"metaUid":"6a819b8a-2"},"6a819b8a-5":{"renderedLength":305,"gzipLength":0,"brotliLength":0,"metaUid":"6a819b8a-4"},"6a819b8a-7":{"renderedLength":730,"gzipLength":0,"brotliLength":0,"metaUid":"6a819b8a-6"},"6a819b8a-9":{"renderedLength":1072,"gzipLength":0,"brotliLength":0,"metaUid":"6a819b8a-8"},"6a819b8a-11":{"renderedLength":304,"gzipLength":0,"brotliLength":0,"metaUid":"6a819b8a-10"},"6a819b8a-13":{"renderedLength":173,"gzipLength":0,"brotliLength":0,"metaUid":"6a819b8a-12"}},"nodeMetas":{"6a819b8a-0":{"id":"/dist/browser/RollMode.js","moduleParts":{"tsparticles.updater.roll.js":"6a819b8a-1"},"imported":[],"importedBy":[{"uid":"6a819b8a-2"},{"uid":"6a819b8a-6"}]},"6a819b8a-2":{"id":"/dist/browser/Utils.js","moduleParts":{"tsparticles.updater.roll.js":"6a819b8a-3"},"imported":[{"uid":"6a819b8a-14"},{"uid":"6a819b8a-0"}],"importedBy":[{"uid":"6a819b8a-8"}]},"6a819b8a-4":{"id":"/dist/browser/Options/Classes/RollLight.js","moduleParts":{"tsparticles.updater.roll.js":"6a819b8a-5"},"imported":[{"uid":"6a819b8a-14"}],"importedBy":[{"uid":"6a819b8a-6"}]},"6a819b8a-6":{"id":"/dist/browser/Options/Classes/Roll.js","moduleParts":{"tsparticles.updater.roll.js":"6a819b8a-7"},"imported":[{"uid":"6a819b8a-14"},{"uid":"6a819b8a-4"},{"uid":"6a819b8a-0"}],"importedBy":[{"uid":"6a819b8a-8"}]},"6a819b8a-8":{"id":"/dist/browser/RollUpdater.js","moduleParts":{"tsparticles.updater.roll.js":"6a819b8a-9"},"imported":[{"uid":"6a819b8a-14"},{"uid":"6a819b8a-2"},{"uid":"6a819b8a-6"}],"importedBy":[{"uid":"6a819b8a-10"}]},"6a819b8a-10":{"id":"/dist/browser/index.js","moduleParts":{"tsparticles.updater.roll.js":"6a819b8a-11"},"imported":[{"uid":"6a819b8a-8"}],"importedBy":[{"uid":"6a819b8a-12"}]},"6a819b8a-12":{"id":"/dist/browser/browser.js","moduleParts":{"tsparticles.updater.roll.js":"6a819b8a-13"},"imported":[{"uid":"6a819b8a-10"}],"importedBy":[],"isEntry":true},"6a819b8a-14":{"id":"@tsparticles/engine","moduleParts":{},"imported":[],"importedBy":[{"uid":"6a819b8a-8"},{"uid":"6a819b8a-2"},{"uid":"6a819b8a-6"},{"uid":"6a819b8a-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,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
- /* Updater v4.1.3 */
2
+ /* Updater v4.2.1 */
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tsparticles/engine')) :
5
5
  typeof define === 'function' && define.amd ? define(['exports', '@tsparticles/engine'], factory) :
@@ -69,39 +69,24 @@
69
69
  }
70
70
 
71
71
  class RollLight {
72
- enable;
73
- value;
74
- constructor() {
75
- this.enable = false;
76
- this.value = 0;
77
- }
72
+ enable = false;
73
+ value = 0;
78
74
  load(data) {
79
75
  if (engine.isNull(data)) {
80
76
  return;
81
77
  }
82
- if (data.enable !== undefined) {
83
- this.enable = data.enable;
84
- }
85
- if (data.value !== undefined) {
86
- this.value = engine.setRangeValue(data.value);
87
- }
78
+ engine.loadProperty(this, "enable", data.enable);
79
+ engine.loadRangeProperty(this, "value", data.value);
88
80
  }
89
81
  }
90
82
 
91
83
  class Roll {
92
84
  backColor;
93
- darken;
94
- enable;
95
- enlighten;
96
- mode;
97
- speed;
98
- constructor() {
99
- this.darken = new RollLight();
100
- this.enable = false;
101
- this.enlighten = new RollLight();
102
- this.mode = RollMode.vertical;
103
- this.speed = 25;
104
- }
85
+ darken = new RollLight();
86
+ enable = false;
87
+ enlighten = new RollLight();
88
+ mode = RollMode.vertical;
89
+ speed = 25;
105
90
  load(data) {
106
91
  if (engine.isNull(data)) {
107
92
  return;
@@ -110,16 +95,10 @@
110
95
  this.backColor = engine.OptionsColor.create(this.backColor, data.backColor);
111
96
  }
112
97
  this.darken.load(data.darken);
113
- if (data.enable !== undefined) {
114
- this.enable = data.enable;
115
- }
98
+ engine.loadProperty(this, "enable", data.enable);
116
99
  this.enlighten.load(data.enlighten);
117
- if (data.mode !== undefined) {
118
- this.mode = data.mode;
119
- }
120
- if (data.speed !== undefined) {
121
- this.speed = engine.setRangeValue(data.speed);
122
- }
100
+ engine.loadProperty(this, "mode", data.mode);
101
+ engine.loadRangeProperty(this, "speed", data.speed);
123
102
  }
124
103
  }
125
104
 
@@ -143,10 +122,7 @@
143
122
  return !particle.destroyed && !particle.spawning && !!roll?.enable;
144
123
  }
145
124
  loadOptions(options, ...sources) {
146
- options.roll ??= new Roll();
147
- for (const source of sources) {
148
- options.roll.load(source?.roll);
149
- }
125
+ engine.loadOptionProperty(options, "roll", Roll, ...sources);
150
126
  }
151
127
  update(particle, delta) {
152
128
  if (!this.isEnabled(particle)) {
@@ -157,7 +133,7 @@
157
133
  }
158
134
 
159
135
  async function loadRollUpdater(engine) {
160
- engine.checkVersion("4.1.3");
136
+ engine.checkVersion("4.2.1");
161
137
  await engine.pluginManager.register(e => {
162
138
  e.pluginManager.addParticleUpdater("roll", () => {
163
139
  return Promise.resolve(new RollUpdater(e.pluginManager));
@@ -1 +1 @@
1
- !function(e){e.__tsParticlesInternals=e.__tsParticlesInternals||{},e.__tsParticlesInternals.bundles=e.__tsParticlesInternals.bundles||{},e.__tsParticlesInternals.effects=e.__tsParticlesInternals.effects||{},e.__tsParticlesInternals.engine=e.__tsParticlesInternals.engine||{},e.__tsParticlesInternals.interactions=e.__tsParticlesInternals.interactions||{},e.__tsParticlesInternals.palettes=e.__tsParticlesInternals.palettes||{},e.__tsParticlesInternals.paths=e.__tsParticlesInternals.paths||{},e.__tsParticlesInternals.plugins=e.__tsParticlesInternals.plugins||{},e.__tsParticlesInternals.plugins=e.__tsParticlesInternals.plugins||{},e.__tsParticlesInternals.plugins.emittersShapes=e.__tsParticlesInternals.plugins.emittersShapes||{},e.__tsParticlesInternals.presets=e.__tsParticlesInternals.presets||{},e.__tsParticlesInternals.shapes=e.__tsParticlesInternals.shapes||{},e.__tsParticlesInternals.updaters=e.__tsParticlesInternals.updaters||{},e.__tsParticlesInternals.utils=e.__tsParticlesInternals.utils||{},e.__tsParticlesInternals.canvas=e.__tsParticlesInternals.canvas||{},e.__tsParticlesInternals.canvas=e.__tsParticlesInternals.canvas||{},e.__tsParticlesInternals.canvas.utils=e.__tsParticlesInternals.canvas.utils||{},e.__tsParticlesInternals.path=e.__tsParticlesInternals.path||{},e.__tsParticlesInternals.path=e.__tsParticlesInternals.path||{},e.__tsParticlesInternals.path.utils=e.__tsParticlesInternals.path.utils||{};var t="undefined"!=typeof Proxy?function(e){return new Proxy(e,{get:function(e,t){return t in e||(e[t]={}),e[t]}})}:function(e){return e};e.__tsParticlesInternals.bundles=t(e.__tsParticlesInternals.bundles),e.__tsParticlesInternals.effects=t(e.__tsParticlesInternals.effects),e.__tsParticlesInternals.interactions=t(e.__tsParticlesInternals.interactions),e.__tsParticlesInternals.palettes=t(e.__tsParticlesInternals.palettes),e.__tsParticlesInternals.paths=t(e.__tsParticlesInternals.paths),e.__tsParticlesInternals.plugins=t(e.__tsParticlesInternals.plugins),e.__tsParticlesInternals.plugins.emittersShapes=t(e.__tsParticlesInternals.plugins.emittersShapes),e.__tsParticlesInternals.presets=t(e.__tsParticlesInternals.presets),e.__tsParticlesInternals.shapes=t(e.__tsParticlesInternals.shapes),e.__tsParticlesInternals.updaters=t(e.__tsParticlesInternals.updaters),e.__tsParticlesInternals.utils=t(e.__tsParticlesInternals.utils),e.__tsParticlesInternals.canvas=t(e.__tsParticlesInternals.canvas),e.__tsParticlesInternals.path=t(e.__tsParticlesInternals.path),e.tsparticlesInternalExports=e.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@tsparticles/engine")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/engine"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).__tsParticlesInternals=e.__tsParticlesInternals||{},e.__tsParticlesInternals.updaters=e.__tsParticlesInternals.updaters||{},e.__tsParticlesInternals.updaters.roll=e.__tsParticlesInternals.updaters.roll||{}),e.__tsParticlesInternals.engine)}(this,function(e,t){"use strict";var s;!function(e){e.both="both",e.horizontal="horizontal",e.vertical="vertical"}(s||(s={}));class l{enable;value;constructor(){this.enable=!1,this.value=0}load(e){t.isNull(e)||(void 0!==e.enable&&(this.enable=e.enable),void 0!==e.value&&(this.value=t.setRangeValue(e.value)))}}class a{backColor;darken;enable;enlighten;mode;speed;constructor(){this.darken=new l,this.enable=!1,this.enlighten=new l,this.mode=s.vertical,this.speed=25}load(e){t.isNull(e)||(void 0!==e.backColor&&(this.backColor=t.OptionsColor.create(this.backColor,e.backColor)),this.darken.load(e.darken),void 0!==e.enable&&(this.enable=e.enable),this.enlighten.load(e.enlighten),void 0!==e.mode&&(this.mode=e.mode),void 0!==e.speed&&(this.speed=t.setRangeValue(e.speed)))}}class n{#e;constructor(e){this.#e=e}getTransformValues(e){const t=e.roll?.enable&&e.roll,s=t&&t.horizontal,l=t&&t.vertical;return{a:s?Math.cos(t.angle):void 0,d:l?Math.sin(t.angle):void 0}}init(e){!function(e,l){const a=l.options.roll;if(a?.enable)if(l.roll={enable:a.enable,horizontal:a.mode===s.horizontal||a.mode===s.both,vertical:a.mode===s.vertical||a.mode===s.both,angle:t.getRandom()*t.doublePI,speed:t.getRangeValue(a.speed)/360},a.backColor)l.backColor=t.rangeColorToHsl(e,a.backColor);else if(a.darken.enable&&a.enlighten.enable){const e=t.getRandom()>=t.half?t.AlterType.darken:t.AlterType.enlighten;l.roll.alter={type:e,value:t.getRangeValue(e===t.AlterType.darken?a.darken.value:a.enlighten.value)}}else a.darken.enable?l.roll.alter={type:t.AlterType.darken,value:t.getRangeValue(a.darken.value)}:a.enlighten.enable&&(l.roll.alter={type:t.AlterType.enlighten,value:t.getRangeValue(a.enlighten.value)});else l.roll={enable:!1,horizontal:!1,vertical:!1,angle:0,speed:0}}(this.#e,e)}isEnabled(e){const t=e.options.roll;return!e.destroyed&&!e.spawning&&!!t?.enable}loadOptions(e,...t){e.roll??=new a;for(const s of t)e.roll.load(s?.roll)}update(e,s){this.isEnabled(e)&&function(e,s){const l=e.options.roll,a=e.roll;if(!a||!l?.enable)return;const n=a.speed*s.factor,r=t.doublePI;a.angle+=n,a.angle>r&&(a.angle-=r)}(e,s)}}async function r(e){e.checkVersion("4.1.3"),await e.pluginManager.register(e=>{e.pluginManager.addParticleUpdater("roll",()=>Promise.resolve(new n(e.pluginManager)))})}const i=globalThis;i.__tsParticlesInternals=i.__tsParticlesInternals??{},i.loadRollUpdater=r,e.loadRollUpdater=r}),Object.assign(globalThis.window||globalThis,{loadRollUpdater:(globalThis.__tsParticlesInternals.updaters.roll||{}).loadRollUpdater}),delete(globalThis.window||globalThis).tsparticlesInternalExports;
1
+ !function(e){e.__tsParticlesInternals=e.__tsParticlesInternals||{},e.__tsParticlesInternals.bundles=e.__tsParticlesInternals.bundles||{},e.__tsParticlesInternals.effects=e.__tsParticlesInternals.effects||{},e.__tsParticlesInternals.engine=e.__tsParticlesInternals.engine||{},e.__tsParticlesInternals.interactions=e.__tsParticlesInternals.interactions||{},e.__tsParticlesInternals.palettes=e.__tsParticlesInternals.palettes||{},e.__tsParticlesInternals.paths=e.__tsParticlesInternals.paths||{},e.__tsParticlesInternals.plugins=e.__tsParticlesInternals.plugins||{},e.__tsParticlesInternals.plugins=e.__tsParticlesInternals.plugins||{},e.__tsParticlesInternals.plugins.emittersShapes=e.__tsParticlesInternals.plugins.emittersShapes||{},e.__tsParticlesInternals.presets=e.__tsParticlesInternals.presets||{},e.__tsParticlesInternals.shapes=e.__tsParticlesInternals.shapes||{},e.__tsParticlesInternals.updaters=e.__tsParticlesInternals.updaters||{},e.__tsParticlesInternals.utils=e.__tsParticlesInternals.utils||{},e.__tsParticlesInternals.canvas=e.__tsParticlesInternals.canvas||{},e.__tsParticlesInternals.canvas=e.__tsParticlesInternals.canvas||{},e.__tsParticlesInternals.canvas.utils=e.__tsParticlesInternals.canvas.utils||{},e.__tsParticlesInternals.path=e.__tsParticlesInternals.path||{},e.__tsParticlesInternals.path=e.__tsParticlesInternals.path||{},e.__tsParticlesInternals.path.utils=e.__tsParticlesInternals.path.utils||{};var t="undefined"!=typeof Proxy?function(e){return new Proxy(e,{get:function(e,t){return t in e||(e[t]={}),e[t]}})}:function(e){return e};e.__tsParticlesInternals.bundles=t(e.__tsParticlesInternals.bundles),e.__tsParticlesInternals.effects=t(e.__tsParticlesInternals.effects),e.__tsParticlesInternals.interactions=t(e.__tsParticlesInternals.interactions),e.__tsParticlesInternals.palettes=t(e.__tsParticlesInternals.palettes),e.__tsParticlesInternals.paths=t(e.__tsParticlesInternals.paths),e.__tsParticlesInternals.plugins=t(e.__tsParticlesInternals.plugins),e.__tsParticlesInternals.plugins.emittersShapes=t(e.__tsParticlesInternals.plugins.emittersShapes),e.__tsParticlesInternals.presets=t(e.__tsParticlesInternals.presets),e.__tsParticlesInternals.shapes=t(e.__tsParticlesInternals.shapes),e.__tsParticlesInternals.updaters=t(e.__tsParticlesInternals.updaters),e.__tsParticlesInternals.utils=t(e.__tsParticlesInternals.utils),e.__tsParticlesInternals.canvas=t(e.__tsParticlesInternals.canvas),e.__tsParticlesInternals.path=t(e.__tsParticlesInternals.path),e.tsparticlesInternalExports=e.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@tsparticles/engine")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/engine"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).__tsParticlesInternals=e.__tsParticlesInternals||{},e.__tsParticlesInternals.updaters=e.__tsParticlesInternals.updaters||{},e.__tsParticlesInternals.updaters.roll=e.__tsParticlesInternals.updaters.roll||{}),e.__tsParticlesInternals.engine)}(this,function(e,t){"use strict";var s;!function(e){e.both="both",e.horizontal="horizontal",e.vertical="vertical"}(s||(s={}));class l{enable=!1;value=0;load(e){t.isNull(e)||(t.loadProperty(this,"enable",e.enable),t.loadRangeProperty(this,"value",e.value))}}class a{backColor;darken=new l;enable=!1;enlighten=new l;mode=s.vertical;speed=25;load(e){t.isNull(e)||(void 0!==e.backColor&&(this.backColor=t.OptionsColor.create(this.backColor,e.backColor)),this.darken.load(e.darken),t.loadProperty(this,"enable",e.enable),this.enlighten.load(e.enlighten),t.loadProperty(this,"mode",e.mode),t.loadRangeProperty(this,"speed",e.speed))}}class n{#e;constructor(e){this.#e=e}getTransformValues(e){const t=e.roll?.enable&&e.roll,s=t&&t.horizontal,l=t&&t.vertical;return{a:s?Math.cos(t.angle):void 0,d:l?Math.sin(t.angle):void 0}}init(e){!function(e,l){const a=l.options.roll;if(a?.enable)if(l.roll={enable:a.enable,horizontal:a.mode===s.horizontal||a.mode===s.both,vertical:a.mode===s.vertical||a.mode===s.both,angle:t.getRandom()*t.doublePI,speed:t.getRangeValue(a.speed)/360},a.backColor)l.backColor=t.rangeColorToHsl(e,a.backColor);else if(a.darken.enable&&a.enlighten.enable){const e=t.getRandom()>=t.half?t.AlterType.darken:t.AlterType.enlighten;l.roll.alter={type:e,value:t.getRangeValue(e===t.AlterType.darken?a.darken.value:a.enlighten.value)}}else a.darken.enable?l.roll.alter={type:t.AlterType.darken,value:t.getRangeValue(a.darken.value)}:a.enlighten.enable&&(l.roll.alter={type:t.AlterType.enlighten,value:t.getRangeValue(a.enlighten.value)});else l.roll={enable:!1,horizontal:!1,vertical:!1,angle:0,speed:0}}(this.#e,e)}isEnabled(e){const t=e.options.roll;return!e.destroyed&&!e.spawning&&!!t?.enable}loadOptions(e,...s){t.loadOptionProperty(e,"roll",a,...s)}update(e,s){this.isEnabled(e)&&function(e,s){const l=e.options.roll,a=e.roll;if(!a||!l?.enable)return;const n=a.speed*s.factor,r=t.doublePI;a.angle+=n,a.angle>r&&(a.angle-=r)}(e,s)}}async function r(e){e.checkVersion("4.2.1"),await e.pluginManager.register(e=>{e.pluginManager.addParticleUpdater("roll",()=>Promise.resolve(new n(e.pluginManager)))})}const i=globalThis;i.__tsParticlesInternals=i.__tsParticlesInternals??{},i.loadRollUpdater=r,e.loadRollUpdater=r}),Object.assign(globalThis.window||globalThis,{loadRollUpdater:(globalThis.__tsParticlesInternals.updaters.roll||{}).loadRollUpdater}),delete(globalThis.window||globalThis).tsparticlesInternalExports;
@@ -4,11 +4,10 @@ import { RollLight } from "./RollLight.js";
4
4
  import { RollMode } from "../../RollMode.js";
5
5
  export declare class Roll implements IRoll, IOptionLoader<IRoll> {
6
6
  backColor?: OptionsColor;
7
- darken: RollLight;
7
+ readonly darken: RollLight;
8
8
  enable: boolean;
9
- enlighten: RollLight;
9
+ readonly enlighten: RollLight;
10
10
  mode: RollMode | keyof typeof RollMode;
11
11
  speed: RangeValue;
12
- constructor();
13
12
  load(data?: RecursivePartial<IRoll>): void;
14
13
  }
@@ -3,6 +3,5 @@ import type { IRollLight } from "../Interfaces/IRollLight.js";
3
3
  export declare class RollLight implements IRollLight, IOptionLoader<IRollLight> {
4
4
  enable: boolean;
5
5
  value: RangeValue;
6
- constructor();
7
6
  load(data?: RecursivePartial<IRollLight>): void;
8
7
  }