@tsparticles/updater-gradient 3.6.0-beta.1 → 3.7.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.
Files changed (39) hide show
  1. package/browser/GradientUpdater.js +4 -1
  2. package/browser/Options/Classes/AnimatableGradient.js +2 -2
  3. package/browser/Options/Classes/AnimatableGradientColor.js +2 -2
  4. package/browser/Options/Classes/GradientAngle.js +2 -2
  5. package/browser/Options/Classes/GradientAngleAnimation.js +2 -2
  6. package/browser/Options/Classes/GradientColorOpacity.js +2 -2
  7. package/browser/Options/Classes/GradientColorOpacityAnimation.js +2 -2
  8. package/browser/index.js +3 -1
  9. package/cjs/GradientUpdater.js +4 -1
  10. package/cjs/Options/Classes/AnimatableGradient.js +1 -1
  11. package/cjs/Options/Classes/AnimatableGradientColor.js +1 -1
  12. package/cjs/Options/Classes/GradientAngle.js +1 -1
  13. package/cjs/Options/Classes/GradientAngleAnimation.js +1 -1
  14. package/cjs/Options/Classes/GradientColorOpacity.js +1 -1
  15. package/cjs/Options/Classes/GradientColorOpacityAnimation.js +1 -1
  16. package/cjs/index.js +3 -1
  17. package/esm/GradientUpdater.js +4 -1
  18. package/esm/Options/Classes/AnimatableGradient.js +2 -2
  19. package/esm/Options/Classes/AnimatableGradientColor.js +2 -2
  20. package/esm/Options/Classes/GradientAngle.js +2 -2
  21. package/esm/Options/Classes/GradientAngleAnimation.js +2 -2
  22. package/esm/Options/Classes/GradientColorOpacity.js +2 -2
  23. package/esm/Options/Classes/GradientColorOpacityAnimation.js +2 -2
  24. package/esm/index.js +3 -1
  25. package/package.json +2 -2
  26. package/report.html +1 -1
  27. package/tsparticles.updater.gradient.js +9 -9
  28. package/tsparticles.updater.gradient.min.js +1 -1
  29. package/tsparticles.updater.gradient.min.js.LICENSE.txt +1 -1
  30. package/types/GradientUpdater.d.ts +3 -1
  31. package/types/index.d.ts +1 -1
  32. package/umd/GradientUpdater.js +4 -1
  33. package/umd/Options/Classes/AnimatableGradient.js +1 -1
  34. package/umd/Options/Classes/AnimatableGradientColor.js +1 -1
  35. package/umd/Options/Classes/GradientAngle.js +1 -1
  36. package/umd/Options/Classes/GradientAngleAnimation.js +1 -1
  37. package/umd/Options/Classes/GradientColorOpacity.js +1 -1
  38. package/umd/Options/Classes/GradientColorOpacityAnimation.js +1 -1
  39. package/umd/index.js +4 -2
@@ -3,6 +3,9 @@ import { AnimatableGradient } from "./Options/Classes/AnimatableGradient.js";
3
3
  import { updateGradient } from "./Utils.js";
4
4
  const double = 2, doublePI = Math.PI * double;
5
5
  export class GradientUpdater {
6
+ constructor(engine) {
7
+ this._engine = engine;
8
+ }
6
9
  getColorStyles(particle, context, radius, opacity) {
7
10
  const gradient = particle.gradient;
8
11
  if (!gradient) {
@@ -55,7 +58,7 @@ export class GradientUpdater {
55
58
  }
56
59
  const reduceDuplicates = particle.options.reduceDuplicates;
57
60
  for (const grColor of gradient.colors) {
58
- const grHslColor = rangeColorToHsl(grColor.value, particle.id, reduceDuplicates);
61
+ const grHslColor = rangeColorToHsl(this._engine, grColor.value, particle.id, reduceDuplicates);
59
62
  if (!grHslColor) {
60
63
  continue;
61
64
  }
@@ -1,4 +1,4 @@
1
- import { GradientType } from "@tsparticles/engine";
1
+ import { GradientType, isNull } from "@tsparticles/engine";
2
2
  import { AnimatableGradientColor } from "./AnimatableGradientColor.js";
3
3
  import { GradientAngle } from "./GradientAngle.js";
4
4
  export class AnimatableGradient {
@@ -8,7 +8,7 @@ export class AnimatableGradient {
8
8
  this.type = GradientType.random;
9
9
  }
10
10
  load(data) {
11
- if (!data) {
11
+ if (isNull(data)) {
12
12
  return;
13
13
  }
14
14
  this.angle.load(data.angle);
@@ -1,4 +1,4 @@
1
- import { AnimatableColor, isNumber } from "@tsparticles/engine";
1
+ import { AnimatableColor, isNull, isNumber } from "@tsparticles/engine";
2
2
  import { GradientColorOpacity } from "./GradientColorOpacity.js";
3
3
  export class AnimatableGradientColor {
4
4
  constructor() {
@@ -6,7 +6,7 @@ export class AnimatableGradientColor {
6
6
  this.value = new AnimatableColor();
7
7
  }
8
8
  load(data) {
9
- if (!data) {
9
+ if (isNull(data)) {
10
10
  return;
11
11
  }
12
12
  if (data.stop !== undefined) {
@@ -1,4 +1,4 @@
1
- import { RotateDirection, setRangeValue, } from "@tsparticles/engine";
1
+ import { RotateDirection, isNull, setRangeValue, } from "@tsparticles/engine";
2
2
  import { GradientAngleAnimation } from "./GradientAngleAnimation.js";
3
3
  export class GradientAngle {
4
4
  constructor() {
@@ -7,7 +7,7 @@ export class GradientAngle {
7
7
  this.direction = RotateDirection.clockwise;
8
8
  }
9
9
  load(data) {
10
- if (!data) {
10
+ if (isNull(data)) {
11
11
  return;
12
12
  }
13
13
  this.animation.load(data.animation);
@@ -1,4 +1,4 @@
1
- import { setRangeValue, } from "@tsparticles/engine";
1
+ import { isNull, setRangeValue, } from "@tsparticles/engine";
2
2
  export class GradientAngleAnimation {
3
3
  constructor() {
4
4
  this.count = 0;
@@ -9,7 +9,7 @@ export class GradientAngleAnimation {
9
9
  this.sync = false;
10
10
  }
11
11
  load(data) {
12
- if (!data) {
12
+ if (isNull(data)) {
13
13
  return;
14
14
  }
15
15
  if (data.count !== undefined) {
@@ -1,4 +1,4 @@
1
- import { setRangeValue, } from "@tsparticles/engine";
1
+ import { isNull, setRangeValue, } from "@tsparticles/engine";
2
2
  import { GradientColorOpacityAnimation } from "./GradientColorOpacityAnimation.js";
3
3
  export class GradientColorOpacity {
4
4
  constructor() {
@@ -6,7 +6,7 @@ export class GradientColorOpacity {
6
6
  this.animation = new GradientColorOpacityAnimation();
7
7
  }
8
8
  load(data) {
9
- if (!data) {
9
+ if (isNull(data)) {
10
10
  return;
11
11
  }
12
12
  this.animation.load(data.animation);
@@ -1,4 +1,4 @@
1
- import { StartValueType, setRangeValue, } from "@tsparticles/engine";
1
+ import { StartValueType, isNull, setRangeValue, } from "@tsparticles/engine";
2
2
  export class GradientColorOpacityAnimation {
3
3
  constructor() {
4
4
  this.count = 0;
@@ -10,7 +10,7 @@ export class GradientColorOpacityAnimation {
10
10
  this.startValue = StartValueType.random;
11
11
  }
12
12
  load(data) {
13
- if (!data) {
13
+ if (isNull(data)) {
14
14
  return;
15
15
  }
16
16
  if (data.count !== undefined) {
package/browser/index.js CHANGED
@@ -1,6 +1,8 @@
1
+ import { assertValidVersion } from "@tsparticles/engine";
1
2
  import { GradientUpdater } from "./GradientUpdater.js";
2
3
  export async function loadGradientUpdater(engine, refresh = true) {
4
+ assertValidVersion(engine, "3.7.0");
3
5
  await engine.addParticleUpdater("gradient", () => {
4
- return Promise.resolve(new GradientUpdater());
6
+ return Promise.resolve(new GradientUpdater(engine));
5
7
  }, refresh);
6
8
  }
@@ -6,6 +6,9 @@ const AnimatableGradient_js_1 = require("./Options/Classes/AnimatableGradient.js
6
6
  const Utils_js_1 = require("./Utils.js");
7
7
  const double = 2, doublePI = Math.PI * double;
8
8
  class GradientUpdater {
9
+ constructor(engine) {
10
+ this._engine = engine;
11
+ }
9
12
  getColorStyles(particle, context, radius, opacity) {
10
13
  const gradient = particle.gradient;
11
14
  if (!gradient) {
@@ -58,7 +61,7 @@ class GradientUpdater {
58
61
  }
59
62
  const reduceDuplicates = particle.options.reduceDuplicates;
60
63
  for (const grColor of gradient.colors) {
61
- const grHslColor = (0, engine_1.rangeColorToHsl)(grColor.value, particle.id, reduceDuplicates);
64
+ const grHslColor = (0, engine_1.rangeColorToHsl)(this._engine, grColor.value, particle.id, reduceDuplicates);
62
65
  if (!grHslColor) {
63
66
  continue;
64
67
  }
@@ -11,7 +11,7 @@ class AnimatableGradient {
11
11
  this.type = engine_1.GradientType.random;
12
12
  }
13
13
  load(data) {
14
- if (!data) {
14
+ if ((0, engine_1.isNull)(data)) {
15
15
  return;
16
16
  }
17
17
  this.angle.load(data.angle);
@@ -9,7 +9,7 @@ class AnimatableGradientColor {
9
9
  this.value = new engine_1.AnimatableColor();
10
10
  }
11
11
  load(data) {
12
- if (!data) {
12
+ if ((0, engine_1.isNull)(data)) {
13
13
  return;
14
14
  }
15
15
  if (data.stop !== undefined) {
@@ -10,7 +10,7 @@ class GradientAngle {
10
10
  this.direction = engine_1.RotateDirection.clockwise;
11
11
  }
12
12
  load(data) {
13
- if (!data) {
13
+ if ((0, engine_1.isNull)(data)) {
14
14
  return;
15
15
  }
16
16
  this.animation.load(data.animation);
@@ -12,7 +12,7 @@ class GradientAngleAnimation {
12
12
  this.sync = false;
13
13
  }
14
14
  load(data) {
15
- if (!data) {
15
+ if ((0, engine_1.isNull)(data)) {
16
16
  return;
17
17
  }
18
18
  if (data.count !== undefined) {
@@ -9,7 +9,7 @@ class GradientColorOpacity {
9
9
  this.animation = new GradientColorOpacityAnimation_js_1.GradientColorOpacityAnimation();
10
10
  }
11
11
  load(data) {
12
- if (!data) {
12
+ if ((0, engine_1.isNull)(data)) {
13
13
  return;
14
14
  }
15
15
  this.animation.load(data.animation);
@@ -13,7 +13,7 @@ class GradientColorOpacityAnimation {
13
13
  this.startValue = engine_1.StartValueType.random;
14
14
  }
15
15
  load(data) {
16
- if (!data) {
16
+ if ((0, engine_1.isNull)(data)) {
17
17
  return;
18
18
  }
19
19
  if (data.count !== undefined) {
package/cjs/index.js CHANGED
@@ -1,9 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.loadGradientUpdater = loadGradientUpdater;
4
+ const engine_1 = require("@tsparticles/engine");
4
5
  const GradientUpdater_js_1 = require("./GradientUpdater.js");
5
6
  async function loadGradientUpdater(engine, refresh = true) {
7
+ (0, engine_1.assertValidVersion)(engine, "3.7.0");
6
8
  await engine.addParticleUpdater("gradient", () => {
7
- return Promise.resolve(new GradientUpdater_js_1.GradientUpdater());
9
+ return Promise.resolve(new GradientUpdater_js_1.GradientUpdater(engine));
8
10
  }, refresh);
9
11
  }
@@ -3,6 +3,9 @@ import { AnimatableGradient } from "./Options/Classes/AnimatableGradient.js";
3
3
  import { updateGradient } from "./Utils.js";
4
4
  const double = 2, doublePI = Math.PI * double;
5
5
  export class GradientUpdater {
6
+ constructor(engine) {
7
+ this._engine = engine;
8
+ }
6
9
  getColorStyles(particle, context, radius, opacity) {
7
10
  const gradient = particle.gradient;
8
11
  if (!gradient) {
@@ -55,7 +58,7 @@ export class GradientUpdater {
55
58
  }
56
59
  const reduceDuplicates = particle.options.reduceDuplicates;
57
60
  for (const grColor of gradient.colors) {
58
- const grHslColor = rangeColorToHsl(grColor.value, particle.id, reduceDuplicates);
61
+ const grHslColor = rangeColorToHsl(this._engine, grColor.value, particle.id, reduceDuplicates);
59
62
  if (!grHslColor) {
60
63
  continue;
61
64
  }
@@ -1,4 +1,4 @@
1
- import { GradientType } from "@tsparticles/engine";
1
+ import { GradientType, isNull } from "@tsparticles/engine";
2
2
  import { AnimatableGradientColor } from "./AnimatableGradientColor.js";
3
3
  import { GradientAngle } from "./GradientAngle.js";
4
4
  export class AnimatableGradient {
@@ -8,7 +8,7 @@ export class AnimatableGradient {
8
8
  this.type = GradientType.random;
9
9
  }
10
10
  load(data) {
11
- if (!data) {
11
+ if (isNull(data)) {
12
12
  return;
13
13
  }
14
14
  this.angle.load(data.angle);
@@ -1,4 +1,4 @@
1
- import { AnimatableColor, isNumber } from "@tsparticles/engine";
1
+ import { AnimatableColor, isNull, isNumber } from "@tsparticles/engine";
2
2
  import { GradientColorOpacity } from "./GradientColorOpacity.js";
3
3
  export class AnimatableGradientColor {
4
4
  constructor() {
@@ -6,7 +6,7 @@ export class AnimatableGradientColor {
6
6
  this.value = new AnimatableColor();
7
7
  }
8
8
  load(data) {
9
- if (!data) {
9
+ if (isNull(data)) {
10
10
  return;
11
11
  }
12
12
  if (data.stop !== undefined) {
@@ -1,4 +1,4 @@
1
- import { RotateDirection, setRangeValue, } from "@tsparticles/engine";
1
+ import { RotateDirection, isNull, setRangeValue, } from "@tsparticles/engine";
2
2
  import { GradientAngleAnimation } from "./GradientAngleAnimation.js";
3
3
  export class GradientAngle {
4
4
  constructor() {
@@ -7,7 +7,7 @@ export class GradientAngle {
7
7
  this.direction = RotateDirection.clockwise;
8
8
  }
9
9
  load(data) {
10
- if (!data) {
10
+ if (isNull(data)) {
11
11
  return;
12
12
  }
13
13
  this.animation.load(data.animation);
@@ -1,4 +1,4 @@
1
- import { setRangeValue, } from "@tsparticles/engine";
1
+ import { isNull, setRangeValue, } from "@tsparticles/engine";
2
2
  export class GradientAngleAnimation {
3
3
  constructor() {
4
4
  this.count = 0;
@@ -9,7 +9,7 @@ export class GradientAngleAnimation {
9
9
  this.sync = false;
10
10
  }
11
11
  load(data) {
12
- if (!data) {
12
+ if (isNull(data)) {
13
13
  return;
14
14
  }
15
15
  if (data.count !== undefined) {
@@ -1,4 +1,4 @@
1
- import { setRangeValue, } from "@tsparticles/engine";
1
+ import { isNull, setRangeValue, } from "@tsparticles/engine";
2
2
  import { GradientColorOpacityAnimation } from "./GradientColorOpacityAnimation.js";
3
3
  export class GradientColorOpacity {
4
4
  constructor() {
@@ -6,7 +6,7 @@ export class GradientColorOpacity {
6
6
  this.animation = new GradientColorOpacityAnimation();
7
7
  }
8
8
  load(data) {
9
- if (!data) {
9
+ if (isNull(data)) {
10
10
  return;
11
11
  }
12
12
  this.animation.load(data.animation);
@@ -1,4 +1,4 @@
1
- import { StartValueType, setRangeValue, } from "@tsparticles/engine";
1
+ import { StartValueType, isNull, setRangeValue, } from "@tsparticles/engine";
2
2
  export class GradientColorOpacityAnimation {
3
3
  constructor() {
4
4
  this.count = 0;
@@ -10,7 +10,7 @@ export class GradientColorOpacityAnimation {
10
10
  this.startValue = StartValueType.random;
11
11
  }
12
12
  load(data) {
13
- if (!data) {
13
+ if (isNull(data)) {
14
14
  return;
15
15
  }
16
16
  if (data.count !== undefined) {
package/esm/index.js CHANGED
@@ -1,6 +1,8 @@
1
+ import { assertValidVersion } from "@tsparticles/engine";
1
2
  import { GradientUpdater } from "./GradientUpdater.js";
2
3
  export async function loadGradientUpdater(engine, refresh = true) {
4
+ assertValidVersion(engine, "3.7.0");
3
5
  await engine.addParticleUpdater("gradient", () => {
4
- return Promise.resolve(new GradientUpdater());
6
+ return Promise.resolve(new GradientUpdater(engine));
5
7
  }, refresh);
6
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsparticles/updater-gradient",
3
- "version": "3.6.0-beta.1",
3
+ "version": "3.7.0",
4
4
  "description": "tsParticles particles gradient updater",
5
5
  "homepage": "https://particles.js.org",
6
6
  "repository": {
@@ -101,7 +101,7 @@
101
101
  "./package.json": "./package.json"
102
102
  },
103
103
  "dependencies": {
104
- "@tsparticles/engine": "^3.6.0-beta.1"
104
+ "@tsparticles/engine": "3.7.0"
105
105
  },
106
106
  "publishConfig": {
107
107
  "access": "public"
package/report.html CHANGED
@@ -3,7 +3,7 @@
3
3
  <head>
4
4
  <meta charset="UTF-8"/>
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1"/>
6
- <title>@tsparticles/updater-gradient [13 Oct 2024 at 17:31]</title>
6
+ <title>@tsparticles/updater-gradient [24 Nov 2024 at 19:27]</title>
7
7
  <link rel="shortcut icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAABrVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+O1foceMD///+J0/qK1Pr7/v8Xdr/9///W8P4UdL7L7P0Scr2r4Pyj3vwad8D5/f/2/f+55f3E6f34+/2H0/ojfMKpzOd0rNgQcb3F3O/j9f7c8v6g3Pz0/P/w+v/q+P7n9v6T1/uQ1vuE0vqLut/y+v+Z2fvt+f+15Pzv9fuc2/vR7v2V2Pvd6/bg9P7I6/285/2y4/yp3/zp8vk8i8kqgMT7/P31+fyv4vxGkcz6/P6/6P3j7vfS5PNnpNUxhcbO7f7F6v3O4vHK3/DA2u631Ouy0eqXweKJud5wqthfoNMMbLvY8f73+v2dxeR8sNtTmdDx9/zX6PSjyeaCtd1YnNGX2PuQveCGt95Nls42h8dLlM3F4vBtAAAAM3RSTlMAAyOx0/sKBvik8opWGBMOAe3l1snDm2E9LSb06eHcu5JpHbarfHZCN9CBb08zzkdNS0kYaptYAAAFV0lEQVRYw92X51/aYBDHHS2O2qqttVbrqNq9m+TJIAYIShBkWwqIiCgoWvfeq7Z2/s29hyQNyUcR7LveGwVyXy6XH8/9rqxglLfUPLxVduUor3h0rfp2TYvpivk37929TkG037hffoX0+peVtZQc1589rigVUdXS/ABSAyEmGIO/1XfvldSK8vs3OqB6u3m0nxmIrvgB0dj7rr7Y9IbuF68hnfFaiHA/sxqm0wciIG43P60qKv9WXWc1RXGh/mFESFABTSBi0sNAKzqet17eCtOb3kZIDwxEEU0oAIJGYxNBDhBND29e0rtXXbcpuPmED9IhEAAQ/AXEaF8EPmnrrKsv0LvWR3fg5sWDNAFZOgAgaKvZDogHNU9MFwnnYROkc56RD5CjAbQX9Ow4g7upCsvYu55aSI/Nj0H1akgKQEUM94dwK65hYRmFU9MIcH/fqJYOZYcnuJSU/waKDgTOEVaVKhwrTRP5XzgSpAITYzom7UvkhFX5VutmxeNnWDjjswTKTyfgluNDGbUpWissXhF3s7mlSml+czWkg3D0l1nNjGNjz3myOQOa1KM/jOS6ebdbAVTCi4gljHSFrviza7tOgRWcS0MOUX9zdNgag5w7rRqA44Lzw0hr1WqES36dFliSJFlh2rXIae3FFcDDgKdxrUIDePr8jGcSClV1u7A9xeN0ModY/pHMxmR1EzRh8TJiwqsHmKW0l4FCEZI+jHio+JdPPE9qwQtTRxku2D8sIeRL2LnxWSllANCQGOIiqVHAz2ye2JR0DcH+HoxDkaADLjgxjKQ+AwCX/g0+DNgdG0ukYCONAe+dbc2IAc6fwt1ARoDSezNHxV2Cmzwv3O6lDMV55edBGwGK9n1+x2F8EDfAGCxug8MhpsMEcTEAWf3rx2vZhe/LAmtIn/6apE6PN0ULKgywD9mmdxbmFl3OvD5AS5fW5zLbv/YHmcsBTjf/afDz3MaZTVCfAP9z6/Bw6ycv8EUBWJIn9zYcoAWWlW9+OzO3vkTy8H+RANLmdrpOuYWdZYEXpo+TlCJrW5EARb7fF+bWdqf3hhyZI1nWJQHgznErZhbjoEsWqi8dQNoE294aldzFurwSABL2XXMf9+H1VQGke9exw5P/AnA5Pv5ngMul7LOvO922iwACu8WkCwLCafvM4CeWPxfA8lNHcWZSoi8EwMAIciKX2Z4SWCMAa3snCZ/G4EA8D6CMLNFsGQhkkz/gQNEBbPCbWsxGUpYVu3z8IyNAknwJkfPMEhLyrdi5RTyUVACkw4GSFRNWJNEW+fgPGwHD8/JxnRuLabN4CGNRkAE23na2+VmEAUmrYymSGjMAYqH84YUIyzgzs3XC7gNgH36Vcc4zKY9o9fgPBXUAiHHwVboBHGLiX6Zcjp1f2wu4tvzZKo0ecPnDtQYDQvJXaBeNzce45Fp28ZQLrEZVuFqgBwOalArKXnW1UzlnSusQKJqKYNuz4tOnI6sZG4zanpemv+7ySU2jbA9h6uhcgpfy6G2PahirDZ6zvq6zDduMVFTKvzw8wgyEdelwY9in3XkEPs3osJuwRQ4qTkfzifndg9Gfc4pdsu82+tTnHZTBa2EAMrqr2t43pguc8tNm7JQVQ2S0ukj2d22dhXYP0/veWtwKrCkNoNimAN5+Xr/oLrxswKbVJjteWrX7eR63o4j9q0GxnaBdWgGA5VStpanIjQmEhV0/nVt5VOFUvix6awJhPcAaTEShgrG+iGyvb5a0Ndb1YGHFPEwoqAinoaykaID1o1pdPNu7XsnCKQ3R+hwWIIhGvORcJUBYXe3Xa3vq/mF/N9V13ugufMkfXn+KHsRD0B8AAAAASUVORK5CYII=" type="image/x-icon" />
8
8
 
9
9
  <script>
@@ -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.6.0-beta.1
7
+ * v3.7.0
8
8
  */
9
9
  /*
10
10
  * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
@@ -34,7 +34,7 @@ return /******/ (() => { // webpackBootstrap
34
34
  \*****************************************/
35
35
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
36
36
 
37
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ GradientUpdater: () => (/* binding */ GradientUpdater)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Options_Classes_AnimatableGradient_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Options/Classes/AnimatableGradient.js */ \"./dist/browser/Options/Classes/AnimatableGradient.js\");\n/* harmony import */ var _Utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Utils.js */ \"./dist/browser/Utils.js\");\n\n\n\nconst double = 2,\n doublePI = Math.PI * double;\nclass GradientUpdater {\n getColorStyles(particle, context, radius, opacity) {\n const gradient = particle.gradient;\n if (!gradient) {\n return {};\n }\n const gradientAngle = gradient.angle.value,\n origin = {\n x: 0,\n y: 0\n },\n minRadius = 0,\n fillGradient = gradient.type === _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.GradientType.radial ? context.createRadialGradient(origin.x, origin.y, minRadius, origin.x, origin.y, radius) : context.createLinearGradient(Math.cos(gradientAngle) * -radius, Math.sin(gradientAngle) * -radius, Math.cos(gradientAngle) * radius, Math.sin(gradientAngle) * radius);\n for (const {\n stop,\n value,\n opacity: cOpacity\n } of gradient.colors) {\n fillGradient.addColorStop(stop, (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getStyleFromHsl)({\n h: value.h.value,\n s: value.s.value,\n l: value.l.value\n }, cOpacity?.value ?? opacity));\n }\n return {\n fill: fillGradient\n };\n }\n init(particle) {\n const gradient = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.itemFromSingleOrMultiple)(particle.options.gradient);\n if (!gradient) {\n return;\n }\n const {\n angle\n } = gradient,\n speedFactor = 360,\n delayOffset = 1;\n particle.gradient = {\n angle: {\n value: (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(angle.value),\n enable: angle.animation.enable,\n velocity: (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(angle.animation.speed) / speedFactor * particle.container.retina.reduceFactor,\n decay: delayOffset - (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(angle.animation.decay),\n delayTime: (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(angle.animation.delay) * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.millisecondsToSeconds,\n max: doublePI,\n min: 0,\n time: 0\n },\n type: gradient.type,\n colors: []\n };\n let rotateDirection = gradient.angle.direction;\n if (rotateDirection === _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.RotateDirection.random) {\n rotateDirection = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRandom)() > _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.halfRandom ? _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.RotateDirection.counterClockwise : _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.RotateDirection.clockwise;\n }\n switch (rotateDirection) {\n case _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.RotateDirection.counterClockwise:\n case \"counterClockwise\":\n particle.gradient.angle.status = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.AnimationStatus.decreasing;\n break;\n case _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.RotateDirection.clockwise:\n particle.gradient.angle.status = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.AnimationStatus.increasing;\n break;\n }\n const reduceDuplicates = particle.options.reduceDuplicates;\n for (const grColor of gradient.colors) {\n const grHslColor = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.rangeColorToHsl)(grColor.value, particle.id, reduceDuplicates);\n if (!grHslColor) {\n continue;\n }\n const grHslAnimation = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getHslAnimationFromHsl)(grHslColor, grColor.value.animation, particle.container.retina.reduceFactor),\n addColor = {\n stop: grColor.stop,\n value: grHslAnimation,\n opacity: grColor.opacity ? {\n enable: grColor.opacity.animation.enable,\n max: (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeMax)(grColor.opacity.value),\n min: (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeMin)(grColor.opacity.value),\n status: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.AnimationStatus.increasing,\n value: (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(grColor.opacity.value),\n velocity: (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(grColor.opacity.animation.speed) / _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.percentDenominator * particle.container.retina.reduceFactor,\n decay: delayOffset - (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(grColor.opacity.animation.decay),\n delayTime: (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(grColor.opacity.animation.delay) * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.millisecondsToSeconds,\n time: 0\n } : undefined\n };\n const {\n opacity: addOpacity\n } = addColor;\n if (grColor.opacity && addOpacity) {\n const opacityRange = grColor.opacity.value;\n addOpacity.min = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeMin)(opacityRange);\n addOpacity.max = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeMax)(opacityRange);\n const opacityAnimation = grColor.opacity.animation;\n switch (opacityAnimation.startValue) {\n case _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.StartValueType.min:\n addOpacity.value = addOpacity.min;\n addOpacity.status = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.AnimationStatus.increasing;\n break;\n case _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.StartValueType.max:\n addOpacity.value = addOpacity.max;\n addOpacity.status = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.AnimationStatus.decreasing;\n break;\n case _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.StartValueType.random:\n default:\n addOpacity.value = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.randomInRange)(addOpacity);\n addOpacity.status = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRandom)() >= _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.halfRandom ? _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.AnimationStatus.increasing : _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.AnimationStatus.decreasing;\n break;\n }\n }\n particle.gradient.colors.push(addColor);\n }\n }\n isEnabled(particle) {\n return !particle.destroyed && !particle.spawning && (!!particle.gradient?.angle.enable || (particle.gradient?.colors.some(c => c.value.h.enable || c.value.s.enable || c.value.l.enable) ?? false));\n }\n loadOptions(options, ...sources) {\n for (const source of sources) {\n if (!source?.gradient) {\n continue;\n }\n const gradientToLoad = source.gradient;\n if (!gradientToLoad) {\n continue;\n }\n options.gradient = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.executeOnSingleOrMultiple)(gradientToLoad, gradient => {\n const tmp = new _Options_Classes_AnimatableGradient_js__WEBPACK_IMPORTED_MODULE_1__.AnimatableGradient();\n tmp.load(gradient);\n return tmp;\n });\n }\n }\n update(particle, delta) {\n (0,_Utils_js__WEBPACK_IMPORTED_MODULE_2__.updateGradient)(particle, delta);\n }\n}\n\n//# sourceURL=webpack://@tsparticles/updater-gradient/./dist/browser/GradientUpdater.js?");
37
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ GradientUpdater: () => (/* binding */ GradientUpdater)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Options_Classes_AnimatableGradient_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Options/Classes/AnimatableGradient.js */ \"./dist/browser/Options/Classes/AnimatableGradient.js\");\n/* harmony import */ var _Utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Utils.js */ \"./dist/browser/Utils.js\");\n\n\n\nconst double = 2,\n doublePI = Math.PI * double;\nclass GradientUpdater {\n constructor(engine) {\n this._engine = engine;\n }\n getColorStyles(particle, context, radius, opacity) {\n const gradient = particle.gradient;\n if (!gradient) {\n return {};\n }\n const gradientAngle = gradient.angle.value,\n origin = {\n x: 0,\n y: 0\n },\n minRadius = 0,\n fillGradient = gradient.type === _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.GradientType.radial ? context.createRadialGradient(origin.x, origin.y, minRadius, origin.x, origin.y, radius) : context.createLinearGradient(Math.cos(gradientAngle) * -radius, Math.sin(gradientAngle) * -radius, Math.cos(gradientAngle) * radius, Math.sin(gradientAngle) * radius);\n for (const {\n stop,\n value,\n opacity: cOpacity\n } of gradient.colors) {\n fillGradient.addColorStop(stop, (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getStyleFromHsl)({\n h: value.h.value,\n s: value.s.value,\n l: value.l.value\n }, cOpacity?.value ?? opacity));\n }\n return {\n fill: fillGradient\n };\n }\n init(particle) {\n const gradient = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.itemFromSingleOrMultiple)(particle.options.gradient);\n if (!gradient) {\n return;\n }\n const {\n angle\n } = gradient,\n speedFactor = 360,\n delayOffset = 1;\n particle.gradient = {\n angle: {\n value: (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(angle.value),\n enable: angle.animation.enable,\n velocity: (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(angle.animation.speed) / speedFactor * particle.container.retina.reduceFactor,\n decay: delayOffset - (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(angle.animation.decay),\n delayTime: (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(angle.animation.delay) * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.millisecondsToSeconds,\n max: doublePI,\n min: 0,\n time: 0\n },\n type: gradient.type,\n colors: []\n };\n let rotateDirection = gradient.angle.direction;\n if (rotateDirection === _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.RotateDirection.random) {\n rotateDirection = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRandom)() > _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.halfRandom ? _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.RotateDirection.counterClockwise : _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.RotateDirection.clockwise;\n }\n switch (rotateDirection) {\n case _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.RotateDirection.counterClockwise:\n case \"counterClockwise\":\n particle.gradient.angle.status = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.AnimationStatus.decreasing;\n break;\n case _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.RotateDirection.clockwise:\n particle.gradient.angle.status = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.AnimationStatus.increasing;\n break;\n }\n const reduceDuplicates = particle.options.reduceDuplicates;\n for (const grColor of gradient.colors) {\n const grHslColor = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.rangeColorToHsl)(this._engine, grColor.value, particle.id, reduceDuplicates);\n if (!grHslColor) {\n continue;\n }\n const grHslAnimation = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getHslAnimationFromHsl)(grHslColor, grColor.value.animation, particle.container.retina.reduceFactor),\n addColor = {\n stop: grColor.stop,\n value: grHslAnimation,\n opacity: grColor.opacity ? {\n enable: grColor.opacity.animation.enable,\n max: (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeMax)(grColor.opacity.value),\n min: (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeMin)(grColor.opacity.value),\n status: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.AnimationStatus.increasing,\n value: (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(grColor.opacity.value),\n velocity: (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(grColor.opacity.animation.speed) / _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.percentDenominator * particle.container.retina.reduceFactor,\n decay: delayOffset - (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(grColor.opacity.animation.decay),\n delayTime: (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(grColor.opacity.animation.delay) * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.millisecondsToSeconds,\n time: 0\n } : undefined\n };\n const {\n opacity: addOpacity\n } = addColor;\n if (grColor.opacity && addOpacity) {\n const opacityRange = grColor.opacity.value;\n addOpacity.min = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeMin)(opacityRange);\n addOpacity.max = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeMax)(opacityRange);\n const opacityAnimation = grColor.opacity.animation;\n switch (opacityAnimation.startValue) {\n case _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.StartValueType.min:\n addOpacity.value = addOpacity.min;\n addOpacity.status = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.AnimationStatus.increasing;\n break;\n case _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.StartValueType.max:\n addOpacity.value = addOpacity.max;\n addOpacity.status = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.AnimationStatus.decreasing;\n break;\n case _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.StartValueType.random:\n default:\n addOpacity.value = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.randomInRange)(addOpacity);\n addOpacity.status = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRandom)() >= _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.halfRandom ? _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.AnimationStatus.increasing : _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.AnimationStatus.decreasing;\n break;\n }\n }\n particle.gradient.colors.push(addColor);\n }\n }\n isEnabled(particle) {\n return !particle.destroyed && !particle.spawning && (!!particle.gradient?.angle.enable || (particle.gradient?.colors.some(c => c.value.h.enable || c.value.s.enable || c.value.l.enable) ?? false));\n }\n loadOptions(options, ...sources) {\n for (const source of sources) {\n if (!source?.gradient) {\n continue;\n }\n const gradientToLoad = source.gradient;\n if (!gradientToLoad) {\n continue;\n }\n options.gradient = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.executeOnSingleOrMultiple)(gradientToLoad, gradient => {\n const tmp = new _Options_Classes_AnimatableGradient_js__WEBPACK_IMPORTED_MODULE_1__.AnimatableGradient();\n tmp.load(gradient);\n return tmp;\n });\n }\n }\n update(particle, delta) {\n (0,_Utils_js__WEBPACK_IMPORTED_MODULE_2__.updateGradient)(particle, delta);\n }\n}\n\n//# sourceURL=webpack://@tsparticles/updater-gradient/./dist/browser/GradientUpdater.js?");
38
38
 
39
39
  /***/ }),
40
40
 
@@ -44,7 +44,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
44
44
  \************************************************************/
45
45
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
46
46
 
47
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AnimatableGradient: () => (/* binding */ AnimatableGradient)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _AnimatableGradientColor_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AnimatableGradientColor.js */ \"./dist/browser/Options/Classes/AnimatableGradientColor.js\");\n/* harmony import */ var _GradientAngle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./GradientAngle.js */ \"./dist/browser/Options/Classes/GradientAngle.js\");\n\n\n\nclass AnimatableGradient {\n constructor() {\n this.angle = new _GradientAngle_js__WEBPACK_IMPORTED_MODULE_1__.GradientAngle();\n this.colors = [];\n this.type = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.GradientType.random;\n }\n load(data) {\n if (!data) {\n return;\n }\n this.angle.load(data.angle);\n if (data.colors !== undefined) {\n this.colors = data.colors.map(s => {\n const tmp = new _AnimatableGradientColor_js__WEBPACK_IMPORTED_MODULE_2__.AnimatableGradientColor();\n tmp.load(s);\n return tmp;\n });\n }\n if (data.type !== undefined) {\n this.type = data.type;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/updater-gradient/./dist/browser/Options/Classes/AnimatableGradient.js?");
47
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AnimatableGradient: () => (/* binding */ AnimatableGradient)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _AnimatableGradientColor_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AnimatableGradientColor.js */ \"./dist/browser/Options/Classes/AnimatableGradientColor.js\");\n/* harmony import */ var _GradientAngle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./GradientAngle.js */ \"./dist/browser/Options/Classes/GradientAngle.js\");\n\n\n\nclass AnimatableGradient {\n constructor() {\n this.angle = new _GradientAngle_js__WEBPACK_IMPORTED_MODULE_1__.GradientAngle();\n this.colors = [];\n this.type = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.GradientType.random;\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n this.angle.load(data.angle);\n if (data.colors !== undefined) {\n this.colors = data.colors.map(s => {\n const tmp = new _AnimatableGradientColor_js__WEBPACK_IMPORTED_MODULE_2__.AnimatableGradientColor();\n tmp.load(s);\n return tmp;\n });\n }\n if (data.type !== undefined) {\n this.type = data.type;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/updater-gradient/./dist/browser/Options/Classes/AnimatableGradient.js?");
48
48
 
49
49
  /***/ }),
50
50
 
@@ -54,7 +54,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
54
54
  \*****************************************************************/
55
55
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
56
56
 
57
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AnimatableGradientColor: () => (/* binding */ AnimatableGradientColor)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _GradientColorOpacity_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./GradientColorOpacity.js */ \"./dist/browser/Options/Classes/GradientColorOpacity.js\");\n\n\nclass AnimatableGradientColor {\n constructor() {\n this.stop = 0;\n this.value = new _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.AnimatableColor();\n }\n load(data) {\n if (!data) {\n return;\n }\n if (data.stop !== undefined) {\n this.stop = data.stop;\n }\n this.value = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.AnimatableColor.create(this.value, data.value);\n if (data.opacity !== undefined) {\n this.opacity = new _GradientColorOpacity_js__WEBPACK_IMPORTED_MODULE_1__.GradientColorOpacity();\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNumber)(data.opacity)) {\n this.opacity.value = data.opacity;\n } else {\n this.opacity.load(data.opacity);\n }\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/updater-gradient/./dist/browser/Options/Classes/AnimatableGradientColor.js?");
57
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AnimatableGradientColor: () => (/* binding */ AnimatableGradientColor)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _GradientColorOpacity_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./GradientColorOpacity.js */ \"./dist/browser/Options/Classes/GradientColorOpacity.js\");\n\n\nclass AnimatableGradientColor {\n constructor() {\n this.stop = 0;\n this.value = new _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.AnimatableColor();\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n if (data.stop !== undefined) {\n this.stop = data.stop;\n }\n this.value = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.AnimatableColor.create(this.value, data.value);\n if (data.opacity !== undefined) {\n this.opacity = new _GradientColorOpacity_js__WEBPACK_IMPORTED_MODULE_1__.GradientColorOpacity();\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNumber)(data.opacity)) {\n this.opacity.value = data.opacity;\n } else {\n this.opacity.load(data.opacity);\n }\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/updater-gradient/./dist/browser/Options/Classes/AnimatableGradientColor.js?");
58
58
 
59
59
  /***/ }),
60
60
 
@@ -64,7 +64,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
64
64
  \*******************************************************/
65
65
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
66
66
 
67
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ GradientAngle: () => (/* binding */ GradientAngle)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _GradientAngleAnimation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./GradientAngleAnimation.js */ \"./dist/browser/Options/Classes/GradientAngleAnimation.js\");\n\n\nclass GradientAngle {\n constructor() {\n this.value = 0;\n this.animation = new _GradientAngleAnimation_js__WEBPACK_IMPORTED_MODULE_1__.GradientAngleAnimation();\n this.direction = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.RotateDirection.clockwise;\n }\n load(data) {\n if (!data) {\n return;\n }\n this.animation.load(data.animation);\n if (data.value !== undefined) {\n this.value = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.value);\n }\n if (data.direction !== undefined) {\n this.direction = data.direction;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/updater-gradient/./dist/browser/Options/Classes/GradientAngle.js?");
67
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ GradientAngle: () => (/* binding */ GradientAngle)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _GradientAngleAnimation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./GradientAngleAnimation.js */ \"./dist/browser/Options/Classes/GradientAngleAnimation.js\");\n\n\nclass GradientAngle {\n constructor() {\n this.value = 0;\n this.animation = new _GradientAngleAnimation_js__WEBPACK_IMPORTED_MODULE_1__.GradientAngleAnimation();\n this.direction = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.RotateDirection.clockwise;\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n this.animation.load(data.animation);\n if (data.value !== undefined) {\n this.value = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.value);\n }\n if (data.direction !== undefined) {\n this.direction = data.direction;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/updater-gradient/./dist/browser/Options/Classes/GradientAngle.js?");
68
68
 
69
69
  /***/ }),
70
70
 
@@ -74,7 +74,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
74
74
  \****************************************************************/
75
75
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
76
76
 
77
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ GradientAngleAnimation: () => (/* binding */ GradientAngleAnimation)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n\nclass GradientAngleAnimation {\n constructor() {\n this.count = 0;\n this.enable = false;\n this.speed = 0;\n this.decay = 0;\n this.delay = 0;\n this.sync = false;\n }\n load(data) {\n if (!data) {\n return;\n }\n if (data.count !== undefined) {\n this.count = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.count);\n }\n if (data.enable !== undefined) {\n this.enable = data.enable;\n }\n if (data.speed !== undefined) {\n this.speed = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.speed);\n }\n if (data.decay !== undefined) {\n this.decay = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.decay);\n }\n if (data.delay !== undefined) {\n this.delay = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.delay);\n }\n if (data.sync !== undefined) {\n this.sync = data.sync;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/updater-gradient/./dist/browser/Options/Classes/GradientAngleAnimation.js?");
77
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ GradientAngleAnimation: () => (/* binding */ GradientAngleAnimation)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n\nclass GradientAngleAnimation {\n constructor() {\n this.count = 0;\n this.enable = false;\n this.speed = 0;\n this.decay = 0;\n this.delay = 0;\n this.sync = false;\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n if (data.count !== undefined) {\n this.count = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.count);\n }\n if (data.enable !== undefined) {\n this.enable = data.enable;\n }\n if (data.speed !== undefined) {\n this.speed = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.speed);\n }\n if (data.decay !== undefined) {\n this.decay = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.decay);\n }\n if (data.delay !== undefined) {\n this.delay = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.delay);\n }\n if (data.sync !== undefined) {\n this.sync = data.sync;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/updater-gradient/./dist/browser/Options/Classes/GradientAngleAnimation.js?");
78
78
 
79
79
  /***/ }),
80
80
 
@@ -84,7 +84,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
84
84
  \**************************************************************/
85
85
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
86
86
 
87
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ GradientColorOpacity: () => (/* binding */ GradientColorOpacity)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _GradientColorOpacityAnimation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./GradientColorOpacityAnimation.js */ \"./dist/browser/Options/Classes/GradientColorOpacityAnimation.js\");\n\n\nclass GradientColorOpacity {\n constructor() {\n this.value = 0;\n this.animation = new _GradientColorOpacityAnimation_js__WEBPACK_IMPORTED_MODULE_1__.GradientColorOpacityAnimation();\n }\n load(data) {\n if (!data) {\n return;\n }\n this.animation.load(data.animation);\n if (data.value !== undefined) {\n this.value = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.value);\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/updater-gradient/./dist/browser/Options/Classes/GradientColorOpacity.js?");
87
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ GradientColorOpacity: () => (/* binding */ GradientColorOpacity)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _GradientColorOpacityAnimation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./GradientColorOpacityAnimation.js */ \"./dist/browser/Options/Classes/GradientColorOpacityAnimation.js\");\n\n\nclass GradientColorOpacity {\n constructor() {\n this.value = 0;\n this.animation = new _GradientColorOpacityAnimation_js__WEBPACK_IMPORTED_MODULE_1__.GradientColorOpacityAnimation();\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n this.animation.load(data.animation);\n if (data.value !== undefined) {\n this.value = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.value);\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/updater-gradient/./dist/browser/Options/Classes/GradientColorOpacity.js?");
88
88
 
89
89
  /***/ }),
90
90
 
@@ -94,7 +94,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
94
94
  \***********************************************************************/
95
95
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
96
96
 
97
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ GradientColorOpacityAnimation: () => (/* binding */ GradientColorOpacityAnimation)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n\nclass GradientColorOpacityAnimation {\n constructor() {\n this.count = 0;\n this.enable = false;\n this.speed = 0;\n this.decay = 0;\n this.delay = 0;\n this.sync = false;\n this.startValue = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.StartValueType.random;\n }\n load(data) {\n if (!data) {\n return;\n }\n if (data.count !== undefined) {\n this.count = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.count);\n }\n if (data.enable !== undefined) {\n this.enable = data.enable;\n }\n if (data.speed !== undefined) {\n this.speed = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.speed);\n }\n if (data.sync !== undefined) {\n this.sync = data.sync;\n }\n if (data.startValue !== undefined) {\n this.startValue = data.startValue;\n }\n if (data.decay !== undefined) {\n this.decay = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.decay);\n }\n if (data.delay !== undefined) {\n this.delay = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.delay);\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/updater-gradient/./dist/browser/Options/Classes/GradientColorOpacityAnimation.js?");
97
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ GradientColorOpacityAnimation: () => (/* binding */ GradientColorOpacityAnimation)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n\nclass GradientColorOpacityAnimation {\n constructor() {\n this.count = 0;\n this.enable = false;\n this.speed = 0;\n this.decay = 0;\n this.delay = 0;\n this.sync = false;\n this.startValue = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.StartValueType.random;\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n if (data.count !== undefined) {\n this.count = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.count);\n }\n if (data.enable !== undefined) {\n this.enable = data.enable;\n }\n if (data.speed !== undefined) {\n this.speed = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.speed);\n }\n if (data.sync !== undefined) {\n this.sync = data.sync;\n }\n if (data.startValue !== undefined) {\n this.startValue = data.startValue;\n }\n if (data.decay !== undefined) {\n this.decay = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.decay);\n }\n if (data.delay !== undefined) {\n this.delay = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.delay);\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/updater-gradient/./dist/browser/Options/Classes/GradientColorOpacityAnimation.js?");
98
98
 
99
99
  /***/ }),
100
100
 
@@ -114,7 +114,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
114
114
  \*******************************/
115
115
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
116
116
 
117
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadGradientUpdater: () => (/* binding */ loadGradientUpdater)\n/* harmony export */ });\n/* harmony import */ var _GradientUpdater_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./GradientUpdater.js */ \"./dist/browser/GradientUpdater.js\");\n\nasync function loadGradientUpdater(engine, refresh = true) {\n await engine.addParticleUpdater(\"gradient\", () => {\n return Promise.resolve(new _GradientUpdater_js__WEBPACK_IMPORTED_MODULE_0__.GradientUpdater());\n }, refresh);\n}\n\n//# sourceURL=webpack://@tsparticles/updater-gradient/./dist/browser/index.js?");
117
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadGradientUpdater: () => (/* binding */ loadGradientUpdater)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _GradientUpdater_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./GradientUpdater.js */ \"./dist/browser/GradientUpdater.js\");\n\n\nasync function loadGradientUpdater(engine, refresh = true) {\n (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.assertValidVersion)(engine, \"3.7.0\");\n await engine.addParticleUpdater(\"gradient\", () => {\n return Promise.resolve(new _GradientUpdater_js__WEBPACK_IMPORTED_MODULE_1__.GradientUpdater(engine));\n }, refresh);\n}\n\n//# sourceURL=webpack://@tsparticles/updater-gradient/./dist/browser/index.js?");
118
118
 
119
119
  /***/ }),
120
120
 
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see tsparticles.updater.gradient.min.js.LICENSE.txt */
2
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine"],t);else{var a="object"==typeof exports?t(require("@tsparticles/engine")):t(e.window);for(var i in a)("object"==typeof exports?exports:e)[i]=a[i]}}(this,(e=>(()=>{var t={303:t=>{t.exports=e}},a={};function i(e){var n=a[e];if(void 0!==n)return n.exports;var o=a[e]={exports:{}};return t[e](o,o.exports,i),o.exports}i.d=(e,t)=>{for(var a in t)i.o(t,a)&&!i.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};i.r(n),i.d(n,{loadGradientUpdater:()=>g});var o=i(303);class s{constructor(){this.count=0,this.enable=!1,this.speed=0,this.decay=0,this.delay=0,this.sync=!1,this.startValue=o.StartValueType.random}load(e){e&&(void 0!==e.count&&(this.count=(0,o.setRangeValue)(e.count)),void 0!==e.enable&&(this.enable=e.enable),void 0!==e.speed&&(this.speed=(0,o.setRangeValue)(e.speed)),void 0!==e.sync&&(this.sync=e.sync),void 0!==e.startValue&&(this.startValue=e.startValue),void 0!==e.decay&&(this.decay=(0,o.setRangeValue)(e.decay)),void 0!==e.delay&&(this.delay=(0,o.setRangeValue)(e.delay)))}}class l{constructor(){this.value=0,this.animation=new s}load(e){e&&(this.animation.load(e.animation),void 0!==e.value&&(this.value=(0,o.setRangeValue)(e.value)))}}class r{constructor(){this.stop=0,this.value=new o.AnimatableColor}load(e){e&&(void 0!==e.stop&&(this.stop=e.stop),this.value=o.AnimatableColor.create(this.value,e.value),void 0!==e.opacity&&(this.opacity=new l,(0,o.isNumber)(e.opacity)?this.opacity.value=e.opacity:this.opacity.load(e.opacity)))}}class c{constructor(){this.count=0,this.enable=!1,this.speed=0,this.decay=0,this.delay=0,this.sync=!1}load(e){e&&(void 0!==e.count&&(this.count=(0,o.setRangeValue)(e.count)),void 0!==e.enable&&(this.enable=e.enable),void 0!==e.speed&&(this.speed=(0,o.setRangeValue)(e.speed)),void 0!==e.decay&&(this.decay=(0,o.setRangeValue)(e.decay)),void 0!==e.delay&&(this.delay=(0,o.setRangeValue)(e.delay)),void 0!==e.sync&&(this.sync=e.sync))}}class d{constructor(){this.value=0,this.animation=new c,this.direction=o.RotateDirection.clockwise}load(e){e&&(this.animation.load(e.animation),void 0!==e.value&&(this.value=(0,o.setRangeValue)(e.value)),void 0!==e.direction&&(this.direction=e.direction))}}class u{constructor(){this.angle=new d,this.colors=[],this.type=o.GradientType.random}load(e){e&&(this.angle.load(e.angle),void 0!==e.colors&&(this.colors=e.colors.map((e=>{const t=new r;return t.load(e),t}))),void 0!==e.type&&(this.type=e.type))}}const p=2*Math.PI;class y{getColorStyles(e,t,a,i){const n=e.gradient;if(!n)return{};const s=n.angle.value,l=0,r=0,c=n.type===o.GradientType.radial?t.createRadialGradient(l,r,0,l,r,a):t.createLinearGradient(Math.cos(s)*-a,Math.sin(s)*-a,Math.cos(s)*a,Math.sin(s)*a);for(const{stop:e,value:t,opacity:a}of n.colors)c.addColorStop(e,(0,o.getStyleFromHsl)({h:t.h.value,s:t.s.value,l:t.l.value},a?.value??i));return{fill:c}}init(e){const t=(0,o.itemFromSingleOrMultiple)(e.options.gradient);if(!t)return;const{angle:a}=t;e.gradient={angle:{value:(0,o.getRangeValue)(a.value),enable:a.animation.enable,velocity:(0,o.getRangeValue)(a.animation.speed)/360*e.container.retina.reduceFactor,decay:1-(0,o.getRangeValue)(a.animation.decay),delayTime:(0,o.getRangeValue)(a.animation.delay)*o.millisecondsToSeconds,max:p,min:0,time:0},type:t.type,colors:[]};let i=t.angle.direction;switch(i===o.RotateDirection.random&&(i=(0,o.getRandom)()>o.halfRandom?o.RotateDirection.counterClockwise:o.RotateDirection.clockwise),i){case o.RotateDirection.counterClockwise:case"counterClockwise":e.gradient.angle.status=o.AnimationStatus.decreasing;break;case o.RotateDirection.clockwise:e.gradient.angle.status=o.AnimationStatus.increasing}const n=e.options.reduceDuplicates;for(const a of t.colors){const t=(0,o.rangeColorToHsl)(a.value,e.id,n);if(!t)continue;const i=(0,o.getHslAnimationFromHsl)(t,a.value.animation,e.container.retina.reduceFactor),s={stop:a.stop,value:i,opacity:a.opacity?{enable:a.opacity.animation.enable,max:(0,o.getRangeMax)(a.opacity.value),min:(0,o.getRangeMin)(a.opacity.value),status:o.AnimationStatus.increasing,value:(0,o.getRangeValue)(a.opacity.value),velocity:(0,o.getRangeValue)(a.opacity.animation.speed)/o.percentDenominator*e.container.retina.reduceFactor,decay:1-(0,o.getRangeValue)(a.opacity.animation.decay),delayTime:(0,o.getRangeValue)(a.opacity.animation.delay)*o.millisecondsToSeconds,time:0}:void 0},{opacity:l}=s;if(a.opacity&&l){const e=a.opacity.value;l.min=(0,o.getRangeMin)(e),l.max=(0,o.getRangeMax)(e);switch(a.opacity.animation.startValue){case o.StartValueType.min:l.value=l.min,l.status=o.AnimationStatus.increasing;break;case o.StartValueType.max:l.value=l.max,l.status=o.AnimationStatus.decreasing;break;case o.StartValueType.random:default:l.value=(0,o.randomInRange)(l),l.status=(0,o.getRandom)()>=o.halfRandom?o.AnimationStatus.increasing:o.AnimationStatus.decreasing}}e.gradient.colors.push(s)}}isEnabled(e){return!e.destroyed&&!e.spawning&&(!!e.gradient?.angle.enable||(e.gradient?.colors.some((e=>e.value.h.enable||e.value.s.enable||e.value.l.enable))??!1))}loadOptions(e,...t){for(const a of t){if(!a?.gradient)continue;const t=a.gradient;t&&(e.gradient=(0,o.executeOnSingleOrMultiple)(t,(e=>{const t=new u;return t.load(e),t})))}}update(e,t){!function(e,t){const{gradient:a}=e;if(a){(0,o.updateAnimation)(e,a.angle,!1,o.DestroyType.none,t);for(const i of a.colors)(0,o.updateColor)(i.value,t),i.opacity&&(0,o.updateAnimation)(e,i.opacity,!0,o.DestroyType.none,t)}}(e,t)}}async function g(e,t=!0){await e.addParticleUpdater("gradient",(()=>Promise.resolve(new y)),t)}return n})()));
2
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine"],t);else{var a="object"==typeof exports?t(require("@tsparticles/engine")):t(e.window);for(var i in a)("object"==typeof exports?exports:e)[i]=a[i]}}(this,(e=>(()=>{var t={303:t=>{t.exports=e}},a={};function i(e){var n=a[e];if(void 0!==n)return n.exports;var o=a[e]={exports:{}};return t[e](o,o.exports,i),o.exports}i.d=(e,t)=>{for(var a in t)i.o(t,a)&&!i.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};i.r(n),i.d(n,{loadGradientUpdater:()=>g});var o=i(303);class s{constructor(){this.count=0,this.enable=!1,this.speed=0,this.decay=0,this.delay=0,this.sync=!1,this.startValue=o.StartValueType.random}load(e){(0,o.isNull)(e)||(void 0!==e.count&&(this.count=(0,o.setRangeValue)(e.count)),void 0!==e.enable&&(this.enable=e.enable),void 0!==e.speed&&(this.speed=(0,o.setRangeValue)(e.speed)),void 0!==e.sync&&(this.sync=e.sync),void 0!==e.startValue&&(this.startValue=e.startValue),void 0!==e.decay&&(this.decay=(0,o.setRangeValue)(e.decay)),void 0!==e.delay&&(this.delay=(0,o.setRangeValue)(e.delay)))}}class l{constructor(){this.value=0,this.animation=new s}load(e){(0,o.isNull)(e)||(this.animation.load(e.animation),void 0!==e.value&&(this.value=(0,o.setRangeValue)(e.value)))}}class r{constructor(){this.stop=0,this.value=new o.AnimatableColor}load(e){(0,o.isNull)(e)||(void 0!==e.stop&&(this.stop=e.stop),this.value=o.AnimatableColor.create(this.value,e.value),void 0!==e.opacity&&(this.opacity=new l,(0,o.isNumber)(e.opacity)?this.opacity.value=e.opacity:this.opacity.load(e.opacity)))}}class c{constructor(){this.count=0,this.enable=!1,this.speed=0,this.decay=0,this.delay=0,this.sync=!1}load(e){(0,o.isNull)(e)||(void 0!==e.count&&(this.count=(0,o.setRangeValue)(e.count)),void 0!==e.enable&&(this.enable=e.enable),void 0!==e.speed&&(this.speed=(0,o.setRangeValue)(e.speed)),void 0!==e.decay&&(this.decay=(0,o.setRangeValue)(e.decay)),void 0!==e.delay&&(this.delay=(0,o.setRangeValue)(e.delay)),void 0!==e.sync&&(this.sync=e.sync))}}class d{constructor(){this.value=0,this.animation=new c,this.direction=o.RotateDirection.clockwise}load(e){(0,o.isNull)(e)||(this.animation.load(e.animation),void 0!==e.value&&(this.value=(0,o.setRangeValue)(e.value)),void 0!==e.direction&&(this.direction=e.direction))}}class u{constructor(){this.angle=new d,this.colors=[],this.type=o.GradientType.random}load(e){(0,o.isNull)(e)||(this.angle.load(e.angle),void 0!==e.colors&&(this.colors=e.colors.map((e=>{const t=new r;return t.load(e),t}))),void 0!==e.type&&(this.type=e.type))}}const p=2*Math.PI;class y{constructor(e){this._engine=e}getColorStyles(e,t,a,i){const n=e.gradient;if(!n)return{};const s=n.angle.value,l=0,r=0,c=n.type===o.GradientType.radial?t.createRadialGradient(l,r,0,l,r,a):t.createLinearGradient(Math.cos(s)*-a,Math.sin(s)*-a,Math.cos(s)*a,Math.sin(s)*a);for(const{stop:e,value:t,opacity:a}of n.colors)c.addColorStop(e,(0,o.getStyleFromHsl)({h:t.h.value,s:t.s.value,l:t.l.value},a?.value??i));return{fill:c}}init(e){const t=(0,o.itemFromSingleOrMultiple)(e.options.gradient);if(!t)return;const{angle:a}=t;e.gradient={angle:{value:(0,o.getRangeValue)(a.value),enable:a.animation.enable,velocity:(0,o.getRangeValue)(a.animation.speed)/360*e.container.retina.reduceFactor,decay:1-(0,o.getRangeValue)(a.animation.decay),delayTime:(0,o.getRangeValue)(a.animation.delay)*o.millisecondsToSeconds,max:p,min:0,time:0},type:t.type,colors:[]};let i=t.angle.direction;switch(i===o.RotateDirection.random&&(i=(0,o.getRandom)()>o.halfRandom?o.RotateDirection.counterClockwise:o.RotateDirection.clockwise),i){case o.RotateDirection.counterClockwise:case"counterClockwise":e.gradient.angle.status=o.AnimationStatus.decreasing;break;case o.RotateDirection.clockwise:e.gradient.angle.status=o.AnimationStatus.increasing}const n=e.options.reduceDuplicates;for(const a of t.colors){const t=(0,o.rangeColorToHsl)(this._engine,a.value,e.id,n);if(!t)continue;const i=(0,o.getHslAnimationFromHsl)(t,a.value.animation,e.container.retina.reduceFactor),s={stop:a.stop,value:i,opacity:a.opacity?{enable:a.opacity.animation.enable,max:(0,o.getRangeMax)(a.opacity.value),min:(0,o.getRangeMin)(a.opacity.value),status:o.AnimationStatus.increasing,value:(0,o.getRangeValue)(a.opacity.value),velocity:(0,o.getRangeValue)(a.opacity.animation.speed)/o.percentDenominator*e.container.retina.reduceFactor,decay:1-(0,o.getRangeValue)(a.opacity.animation.decay),delayTime:(0,o.getRangeValue)(a.opacity.animation.delay)*o.millisecondsToSeconds,time:0}:void 0},{opacity:l}=s;if(a.opacity&&l){const e=a.opacity.value;l.min=(0,o.getRangeMin)(e),l.max=(0,o.getRangeMax)(e);switch(a.opacity.animation.startValue){case o.StartValueType.min:l.value=l.min,l.status=o.AnimationStatus.increasing;break;case o.StartValueType.max:l.value=l.max,l.status=o.AnimationStatus.decreasing;break;case o.StartValueType.random:default:l.value=(0,o.randomInRange)(l),l.status=(0,o.getRandom)()>=o.halfRandom?o.AnimationStatus.increasing:o.AnimationStatus.decreasing}}e.gradient.colors.push(s)}}isEnabled(e){return!e.destroyed&&!e.spawning&&(!!e.gradient?.angle.enable||(e.gradient?.colors.some((e=>e.value.h.enable||e.value.s.enable||e.value.l.enable))??!1))}loadOptions(e,...t){for(const a of t){if(!a?.gradient)continue;const t=a.gradient;t&&(e.gradient=(0,o.executeOnSingleOrMultiple)(t,(e=>{const t=new u;return t.load(e),t})))}}update(e,t){!function(e,t){const{gradient:a}=e;if(a){(0,o.updateAnimation)(e,a.angle,!1,o.DestroyType.none,t);for(const i of a.colors)(0,o.updateColor)(i.value,t),i.opacity&&(0,o.updateAnimation)(e,i.opacity,!0,o.DestroyType.none,t)}}(e,t)}}async function g(e,t=!0){(0,o.assertValidVersion)(e,"3.7.0"),await e.addParticleUpdater("gradient",(()=>Promise.resolve(new y(e))),t)}return n})()));
@@ -1 +1 @@
1
- /*! tsParticles Gradient Updater v3.6.0-beta.1 by Matteo Bruni */
1
+ /*! tsParticles Gradient Updater v3.7.0 by Matteo Bruni */
@@ -1,6 +1,8 @@
1
- import { type IDelta, type IParticleColorStyle, type IParticleUpdater, type RecursivePartial } from "@tsparticles/engine";
1
+ import { type Engine, type IDelta, type IParticleColorStyle, type IParticleUpdater, type RecursivePartial } from "@tsparticles/engine";
2
2
  import type { GradientParticle, GradientParticlesOptions, IGradientParticlesOptions } from "./Types.js";
3
3
  export declare class GradientUpdater implements IParticleUpdater {
4
+ private readonly _engine;
5
+ constructor(engine: Engine);
4
6
  getColorStyles(particle: GradientParticle, context: CanvasRenderingContext2D, radius: number, opacity: number): IParticleColorStyle;
5
7
  init(particle: GradientParticle): void;
6
8
  isEnabled(particle: GradientParticle): boolean;
package/types/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import type { Engine } from "@tsparticles/engine";
1
+ import { type Engine } from "@tsparticles/engine";
2
2
  export declare function loadGradientUpdater(engine: Engine, refresh?: boolean): Promise<void>;
@@ -15,6 +15,9 @@
15
15
  const Utils_js_1 = require("./Utils.js");
16
16
  const double = 2, doublePI = Math.PI * double;
17
17
  class GradientUpdater {
18
+ constructor(engine) {
19
+ this._engine = engine;
20
+ }
18
21
  getColorStyles(particle, context, radius, opacity) {
19
22
  const gradient = particle.gradient;
20
23
  if (!gradient) {
@@ -67,7 +70,7 @@
67
70
  }
68
71
  const reduceDuplicates = particle.options.reduceDuplicates;
69
72
  for (const grColor of gradient.colors) {
70
- const grHslColor = (0, engine_1.rangeColorToHsl)(grColor.value, particle.id, reduceDuplicates);
73
+ const grHslColor = (0, engine_1.rangeColorToHsl)(this._engine, grColor.value, particle.id, reduceDuplicates);
71
74
  if (!grHslColor) {
72
75
  continue;
73
76
  }
@@ -20,7 +20,7 @@
20
20
  this.type = engine_1.GradientType.random;
21
21
  }
22
22
  load(data) {
23
- if (!data) {
23
+ if ((0, engine_1.isNull)(data)) {
24
24
  return;
25
25
  }
26
26
  this.angle.load(data.angle);
@@ -18,7 +18,7 @@
18
18
  this.value = new engine_1.AnimatableColor();
19
19
  }
20
20
  load(data) {
21
- if (!data) {
21
+ if ((0, engine_1.isNull)(data)) {
22
22
  return;
23
23
  }
24
24
  if (data.stop !== undefined) {
@@ -19,7 +19,7 @@
19
19
  this.direction = engine_1.RotateDirection.clockwise;
20
20
  }
21
21
  load(data) {
22
- if (!data) {
22
+ if ((0, engine_1.isNull)(data)) {
23
23
  return;
24
24
  }
25
25
  this.animation.load(data.animation);
@@ -21,7 +21,7 @@
21
21
  this.sync = false;
22
22
  }
23
23
  load(data) {
24
- if (!data) {
24
+ if ((0, engine_1.isNull)(data)) {
25
25
  return;
26
26
  }
27
27
  if (data.count !== undefined) {
@@ -18,7 +18,7 @@
18
18
  this.animation = new GradientColorOpacityAnimation_js_1.GradientColorOpacityAnimation();
19
19
  }
20
20
  load(data) {
21
- if (!data) {
21
+ if ((0, engine_1.isNull)(data)) {
22
22
  return;
23
23
  }
24
24
  this.animation.load(data.animation);
@@ -22,7 +22,7 @@
22
22
  this.startValue = engine_1.StartValueType.random;
23
23
  }
24
24
  load(data) {
25
- if (!data) {
25
+ if ((0, engine_1.isNull)(data)) {
26
26
  return;
27
27
  }
28
28
  if (data.count !== undefined) {
package/umd/index.js CHANGED
@@ -4,16 +4,18 @@
4
4
  if (v !== undefined) module.exports = v;
5
5
  }
6
6
  else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "./GradientUpdater.js"], factory);
7
+ define(["require", "exports", "@tsparticles/engine", "./GradientUpdater.js"], factory);
8
8
  }
9
9
  })(function (require, exports) {
10
10
  "use strict";
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.loadGradientUpdater = loadGradientUpdater;
13
+ const engine_1 = require("@tsparticles/engine");
13
14
  const GradientUpdater_js_1 = require("./GradientUpdater.js");
14
15
  async function loadGradientUpdater(engine, refresh = true) {
16
+ (0, engine_1.assertValidVersion)(engine, "3.7.0");
15
17
  await engine.addParticleUpdater("gradient", () => {
16
- return Promise.resolve(new GradientUpdater_js_1.GradientUpdater());
18
+ return Promise.resolve(new GradientUpdater_js_1.GradientUpdater(engine));
17
19
  }, refresh);
18
20
  }
19
21
  });