@tsparticles/updater-gradient 4.2.0 → 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.
- package/browser/index.js +1 -1
- package/browser/index.lazy.js +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.lazy.js +1 -1
- package/esm/index.js +1 -1
- package/esm/index.lazy.js +1 -1
- package/package.json +3 -3
- package/tsparticles.updater.gradient.js +2 -2
- package/tsparticles.updater.gradient.min.js +1 -1
package/browser/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GradientUpdater } from "./GradientUpdater.js";
|
|
2
2
|
export async function loadGradientUpdater(engine) {
|
|
3
|
-
engine.checkVersion("4.2.
|
|
3
|
+
engine.checkVersion("4.2.1");
|
|
4
4
|
await engine.pluginManager.register(e => {
|
|
5
5
|
e.pluginManager.addParticleUpdater("gradient", container => {
|
|
6
6
|
return Promise.resolve(new GradientUpdater(e.pluginManager, container));
|
package/browser/index.lazy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadGradientUpdater(engine) {
|
|
2
|
-
engine.checkVersion("4.2.
|
|
2
|
+
engine.checkVersion("4.2.1");
|
|
3
3
|
await engine.pluginManager.register(e => {
|
|
4
4
|
e.pluginManager.addParticleUpdater("gradient", async (container) => {
|
|
5
5
|
const { GradientUpdater } = await import("./GradientUpdater.js");
|
package/cjs/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GradientUpdater } from "./GradientUpdater.js";
|
|
2
2
|
export async function loadGradientUpdater(engine) {
|
|
3
|
-
engine.checkVersion("4.2.
|
|
3
|
+
engine.checkVersion("4.2.1");
|
|
4
4
|
await engine.pluginManager.register(e => {
|
|
5
5
|
e.pluginManager.addParticleUpdater("gradient", container => {
|
|
6
6
|
return Promise.resolve(new GradientUpdater(e.pluginManager, container));
|
package/cjs/index.lazy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadGradientUpdater(engine) {
|
|
2
|
-
engine.checkVersion("4.2.
|
|
2
|
+
engine.checkVersion("4.2.1");
|
|
3
3
|
await engine.pluginManager.register(e => {
|
|
4
4
|
e.pluginManager.addParticleUpdater("gradient", async (container) => {
|
|
5
5
|
const { GradientUpdater } = await import("./GradientUpdater.js");
|
package/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GradientUpdater } from "./GradientUpdater.js";
|
|
2
2
|
export async function loadGradientUpdater(engine) {
|
|
3
|
-
engine.checkVersion("4.2.
|
|
3
|
+
engine.checkVersion("4.2.1");
|
|
4
4
|
await engine.pluginManager.register(e => {
|
|
5
5
|
e.pluginManager.addParticleUpdater("gradient", container => {
|
|
6
6
|
return Promise.resolve(new GradientUpdater(e.pluginManager, container));
|
package/esm/index.lazy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadGradientUpdater(engine) {
|
|
2
|
-
engine.checkVersion("4.2.
|
|
2
|
+
engine.checkVersion("4.2.1");
|
|
3
3
|
await engine.pluginManager.register(e => {
|
|
4
4
|
e.pluginManager.addParticleUpdater("gradient", async (container) => {
|
|
5
5
|
const { GradientUpdater } = await import("./GradientUpdater.js");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/updater-gradient",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.1",
|
|
4
4
|
"description": "tsParticles particles gradient updater",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -107,10 +107,10 @@
|
|
|
107
107
|
"./package.json": "./package.json"
|
|
108
108
|
},
|
|
109
109
|
"dependencies": {
|
|
110
|
-
"@tsparticles/animation-utils": "4.2.
|
|
110
|
+
"@tsparticles/animation-utils": "4.2.1"
|
|
111
111
|
},
|
|
112
112
|
"peerDependencies": {
|
|
113
|
-
"@tsparticles/engine": "4.2.
|
|
113
|
+
"@tsparticles/engine": "4.2.1"
|
|
114
114
|
},
|
|
115
115
|
"publishConfig": {
|
|
116
116
|
"access": "public"
|
|
@@ -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.2.
|
|
2
|
+
/* Updater v4.2.1 */
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tsparticles/engine'), require('@tsparticles/animation-utils')) :
|
|
5
5
|
typeof define === 'function' && define.amd ? define(['exports', '@tsparticles/engine', '@tsparticles/animation-utils'], factory) :
|
|
@@ -260,7 +260,7 @@
|
|
|
260
260
|
}
|
|
261
261
|
|
|
262
262
|
async function loadGradientUpdater(engine) {
|
|
263
|
-
engine.checkVersion("4.2.
|
|
263
|
+
engine.checkVersion("4.2.1");
|
|
264
264
|
await engine.pluginManager.register(e => {
|
|
265
265
|
e.pluginManager.addParticleUpdater("gradient", container => {
|
|
266
266
|
return Promise.resolve(new GradientUpdater(e.pluginManager, container));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t){t.__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.bundles=t.__tsParticlesInternals.bundles||{},t.__tsParticlesInternals.effects=t.__tsParticlesInternals.effects||{},t.__tsParticlesInternals.engine=t.__tsParticlesInternals.engine||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.palettes=t.__tsParticlesInternals.palettes||{},t.__tsParticlesInternals.paths=t.__tsParticlesInternals.paths||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins.emittersShapes=t.__tsParticlesInternals.plugins.emittersShapes||{},t.__tsParticlesInternals.presets=t.__tsParticlesInternals.presets||{},t.__tsParticlesInternals.shapes=t.__tsParticlesInternals.shapes||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.utils=t.__tsParticlesInternals.utils||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas.utils=t.__tsParticlesInternals.canvas.utils||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path.utils=t.__tsParticlesInternals.path.utils||{};var e="undefined"!=typeof Proxy?function(t){return new Proxy(t,{get:function(t,e){return e in t||(t[e]={}),t[e]}})}:function(t){return t};t.__tsParticlesInternals.bundles=e(t.__tsParticlesInternals.bundles),t.__tsParticlesInternals.effects=e(t.__tsParticlesInternals.effects),t.__tsParticlesInternals.interactions=e(t.__tsParticlesInternals.interactions),t.__tsParticlesInternals.palettes=e(t.__tsParticlesInternals.palettes),t.__tsParticlesInternals.paths=e(t.__tsParticlesInternals.paths),t.__tsParticlesInternals.plugins=e(t.__tsParticlesInternals.plugins),t.__tsParticlesInternals.plugins.emittersShapes=e(t.__tsParticlesInternals.plugins.emittersShapes),t.__tsParticlesInternals.presets=e(t.__tsParticlesInternals.presets),t.__tsParticlesInternals.shapes=e(t.__tsParticlesInternals.shapes),t.__tsParticlesInternals.updaters=e(t.__tsParticlesInternals.updaters),t.__tsParticlesInternals.utils=e(t.__tsParticlesInternals.utils),t.__tsParticlesInternals.canvas=e(t.__tsParticlesInternals.canvas),t.__tsParticlesInternals.path=e(t.__tsParticlesInternals.path),t.tsparticlesInternalExports=t.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@tsparticles/engine"),require("@tsparticles/animation-utils")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/engine","@tsparticles/animation-utils"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.updaters.gradient=t.__tsParticlesInternals.updaters.gradient||{}),t.__tsParticlesInternals.engine,t.__tsParticlesInternals.animation.utils)}(this,function(t,e,a){"use strict";class s{count=0;decay=0;delay=0;enable=!1;speed=0;startValue=e.StartValueType.random;sync=!1;load(t){e.isNull(t)||(e.loadRangeProperty(this,"count",t.count),e.loadProperty(this,"enable",t.enable),e.loadRangeProperty(this,"speed",t.speed),e.loadProperty(this,"sync",t.sync),e.loadProperty(this,"startValue",t.startValue),e.loadRangeProperty(this,"decay",t.decay),e.loadRangeProperty(this,"delay",t.delay))}}class n{animation=new s;value=0;load(t){e.isNull(t)||(this.animation.load(t.animation),e.loadRangeProperty(this,"value",t.value))}}class l{opacity;stop=0;value=new e.AnimatableColor;load(t){e.isNull(t)||(e.loadProperty(this,"stop",t.stop),this.value=e.AnimatableColor.create(this.value,t.value),void 0!==t.opacity&&(this.opacity=new n,e.isNumber(t.opacity)?this.opacity.value=t.opacity:this.opacity.load(t.opacity)))}}class i{count=0;decay=0;delay=0;enable=!1;speed=0;sync=!1;load(t){e.isNull(t)||(e.loadRangeProperty(this,"count",t.count),e.loadProperty(this,"enable",t.enable),e.loadRangeProperty(this,"speed",t.speed),e.loadRangeProperty(this,"decay",t.decay),e.loadRangeProperty(this,"delay",t.delay),e.loadProperty(this,"sync",t.sync))}}class r{animation=new i;direction=e.RotateDirection.clockwise;value=0;load(t){e.isNull(t)||(this.animation.load(t.animation),e.loadRangeProperty(this,"value",t.value),e.loadProperty(this,"direction",t.direction))}}class o{angle=new r;colors=[];type=e.GradientType.random;load(t){e.isNull(t)||(this.angle.load(t.angle),void 0!==t.colors&&(this.colors=t.colors.map(t=>{const e=new l;return e.load(t),e})),e.loadProperty(this,"type",t.type))}}class c{#t;#e;constructor(t,e){this.#e=t,this.#t=e}getColorStyles(t,a,s,n){const l=t.gradient;if(!l)return{};const i=this.#t,r=l.angle.value,o=0,c=0,d=l.type===e.GradientType.radial?a.createRadialGradient(o,c,0,o,c,s):a.createLinearGradient(Math.cos(r)*-s,Math.sin(r)*-s,Math.cos(r)*s,Math.sin(r)*s);for(const{stop:t,value:a,opacity:s}of l.colors){const l={h:a.h.value,s:a.s.value,l:a.l.value};d.addColorStop(t,e.getStyleFromHsl(l,i.hdr,s?.value??n))}return{fill:d}}init(t){const a=e.itemFromSingleOrMultiple(t.options.gradient);if(!a)return;const s=this.#t,{angle:n}=a;t.gradient={angle:{value:e.getRangeValue(n.value),enable:n.animation.enable,velocity:e.getRangeValue(n.animation.speed)/360*s.retina.reduceFactor,decay:1-e.getRangeValue(n.animation.decay),delayTime:e.getRangeValue(n.animation.delay)*e.millisecondsToSeconds,max:e.doublePI,min:0,time:0},type:a.type,colors:[]};let l=a.angle.direction;switch(l===e.RotateDirection.random&&(l=e.getRandom()>e.half?e.RotateDirection.counterClockwise:e.RotateDirection.clockwise),l){case e.RotateDirection.counterClockwise:case"counterClockwise":t.gradient.angle.status=e.AnimationStatus.decreasing;break;case e.RotateDirection.clockwise:t.gradient.angle.status=e.AnimationStatus.increasing}const i=t.options.reduceDuplicates;for(const n of a.colors){const a=e.rangeColorToHsl(this.#e,n.value,t.id,i);if(!a)continue;const l=e.getHslAnimationFromHsl(a,n.value.animation,s.retina.reduceFactor),r={stop:n.stop,value:l,opacity:n.opacity?{enable:n.opacity.animation.enable,max:e.getRangeMax(n.opacity.value),min:e.getRangeMin(n.opacity.value),status:e.AnimationStatus.increasing,value:e.getRangeValue(n.opacity.value),velocity:e.getRangeValue(n.opacity.animation.speed)/e.percentDenominator*s.retina.reduceFactor,decay:1-e.getRangeValue(n.opacity.animation.decay),delayTime:e.getRangeValue(n.opacity.animation.delay)*e.millisecondsToSeconds,time:0}:void 0},{opacity:o}=r;if(n.opacity&&o){const t=n.opacity.value;o.min=e.getRangeMin(t),o.max=e.getRangeMax(t);switch(n.opacity.animation.startValue){case e.StartValueType.min:o.value=o.min,o.status=e.AnimationStatus.increasing;break;case e.StartValueType.max:o.value=o.max,o.status=e.AnimationStatus.decreasing;break;case e.StartValueType.random:default:o.value=e.randomInRangeValue(o),o.status=e.getRandom()>=e.half?e.AnimationStatus.increasing:e.AnimationStatus.decreasing}}t.gradient.colors.push(r)}}isEnabled(t){return!t.destroyed&&!t.spawning&&(!!t.gradient?.angle.enable||(t.gradient?.colors.some(t=>t.value.h.enable||t.value.s.enable||t.value.l.enable)??!1))}loadOptions(t,...a){for(const s of a){if(!s?.gradient)continue;const a=s.gradient;t.gradient=e.executeOnSingleOrMultiple(a,t=>{const e=new o;return e.load(t),e})}}update(t,s){!function(t,s){const{gradient:n}=t;if(n){a.updateAnimation(t,n.angle,!1,e.DestroyType.none,s);for(const l of n.colors)e.updateColor(l.value,s),l.opacity&&a.updateAnimation(t,l.opacity,!0,e.DestroyType.none,s)}}(t,s)}}async function d(t){t.checkVersion("4.2.
|
|
1
|
+
!function(t){t.__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.bundles=t.__tsParticlesInternals.bundles||{},t.__tsParticlesInternals.effects=t.__tsParticlesInternals.effects||{},t.__tsParticlesInternals.engine=t.__tsParticlesInternals.engine||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.palettes=t.__tsParticlesInternals.palettes||{},t.__tsParticlesInternals.paths=t.__tsParticlesInternals.paths||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins.emittersShapes=t.__tsParticlesInternals.plugins.emittersShapes||{},t.__tsParticlesInternals.presets=t.__tsParticlesInternals.presets||{},t.__tsParticlesInternals.shapes=t.__tsParticlesInternals.shapes||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.utils=t.__tsParticlesInternals.utils||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas.utils=t.__tsParticlesInternals.canvas.utils||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path.utils=t.__tsParticlesInternals.path.utils||{};var e="undefined"!=typeof Proxy?function(t){return new Proxy(t,{get:function(t,e){return e in t||(t[e]={}),t[e]}})}:function(t){return t};t.__tsParticlesInternals.bundles=e(t.__tsParticlesInternals.bundles),t.__tsParticlesInternals.effects=e(t.__tsParticlesInternals.effects),t.__tsParticlesInternals.interactions=e(t.__tsParticlesInternals.interactions),t.__tsParticlesInternals.palettes=e(t.__tsParticlesInternals.palettes),t.__tsParticlesInternals.paths=e(t.__tsParticlesInternals.paths),t.__tsParticlesInternals.plugins=e(t.__tsParticlesInternals.plugins),t.__tsParticlesInternals.plugins.emittersShapes=e(t.__tsParticlesInternals.plugins.emittersShapes),t.__tsParticlesInternals.presets=e(t.__tsParticlesInternals.presets),t.__tsParticlesInternals.shapes=e(t.__tsParticlesInternals.shapes),t.__tsParticlesInternals.updaters=e(t.__tsParticlesInternals.updaters),t.__tsParticlesInternals.utils=e(t.__tsParticlesInternals.utils),t.__tsParticlesInternals.canvas=e(t.__tsParticlesInternals.canvas),t.__tsParticlesInternals.path=e(t.__tsParticlesInternals.path),t.tsparticlesInternalExports=t.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@tsparticles/engine"),require("@tsparticles/animation-utils")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/engine","@tsparticles/animation-utils"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.updaters.gradient=t.__tsParticlesInternals.updaters.gradient||{}),t.__tsParticlesInternals.engine,t.__tsParticlesInternals.animation.utils)}(this,function(t,e,a){"use strict";class s{count=0;decay=0;delay=0;enable=!1;speed=0;startValue=e.StartValueType.random;sync=!1;load(t){e.isNull(t)||(e.loadRangeProperty(this,"count",t.count),e.loadProperty(this,"enable",t.enable),e.loadRangeProperty(this,"speed",t.speed),e.loadProperty(this,"sync",t.sync),e.loadProperty(this,"startValue",t.startValue),e.loadRangeProperty(this,"decay",t.decay),e.loadRangeProperty(this,"delay",t.delay))}}class n{animation=new s;value=0;load(t){e.isNull(t)||(this.animation.load(t.animation),e.loadRangeProperty(this,"value",t.value))}}class l{opacity;stop=0;value=new e.AnimatableColor;load(t){e.isNull(t)||(e.loadProperty(this,"stop",t.stop),this.value=e.AnimatableColor.create(this.value,t.value),void 0!==t.opacity&&(this.opacity=new n,e.isNumber(t.opacity)?this.opacity.value=t.opacity:this.opacity.load(t.opacity)))}}class i{count=0;decay=0;delay=0;enable=!1;speed=0;sync=!1;load(t){e.isNull(t)||(e.loadRangeProperty(this,"count",t.count),e.loadProperty(this,"enable",t.enable),e.loadRangeProperty(this,"speed",t.speed),e.loadRangeProperty(this,"decay",t.decay),e.loadRangeProperty(this,"delay",t.delay),e.loadProperty(this,"sync",t.sync))}}class r{animation=new i;direction=e.RotateDirection.clockwise;value=0;load(t){e.isNull(t)||(this.animation.load(t.animation),e.loadRangeProperty(this,"value",t.value),e.loadProperty(this,"direction",t.direction))}}class o{angle=new r;colors=[];type=e.GradientType.random;load(t){e.isNull(t)||(this.angle.load(t.angle),void 0!==t.colors&&(this.colors=t.colors.map(t=>{const e=new l;return e.load(t),e})),e.loadProperty(this,"type",t.type))}}class c{#t;#e;constructor(t,e){this.#e=t,this.#t=e}getColorStyles(t,a,s,n){const l=t.gradient;if(!l)return{};const i=this.#t,r=l.angle.value,o=0,c=0,d=l.type===e.GradientType.radial?a.createRadialGradient(o,c,0,o,c,s):a.createLinearGradient(Math.cos(r)*-s,Math.sin(r)*-s,Math.cos(r)*s,Math.sin(r)*s);for(const{stop:t,value:a,opacity:s}of l.colors){const l={h:a.h.value,s:a.s.value,l:a.l.value};d.addColorStop(t,e.getStyleFromHsl(l,i.hdr,s?.value??n))}return{fill:d}}init(t){const a=e.itemFromSingleOrMultiple(t.options.gradient);if(!a)return;const s=this.#t,{angle:n}=a;t.gradient={angle:{value:e.getRangeValue(n.value),enable:n.animation.enable,velocity:e.getRangeValue(n.animation.speed)/360*s.retina.reduceFactor,decay:1-e.getRangeValue(n.animation.decay),delayTime:e.getRangeValue(n.animation.delay)*e.millisecondsToSeconds,max:e.doublePI,min:0,time:0},type:a.type,colors:[]};let l=a.angle.direction;switch(l===e.RotateDirection.random&&(l=e.getRandom()>e.half?e.RotateDirection.counterClockwise:e.RotateDirection.clockwise),l){case e.RotateDirection.counterClockwise:case"counterClockwise":t.gradient.angle.status=e.AnimationStatus.decreasing;break;case e.RotateDirection.clockwise:t.gradient.angle.status=e.AnimationStatus.increasing}const i=t.options.reduceDuplicates;for(const n of a.colors){const a=e.rangeColorToHsl(this.#e,n.value,t.id,i);if(!a)continue;const l=e.getHslAnimationFromHsl(a,n.value.animation,s.retina.reduceFactor),r={stop:n.stop,value:l,opacity:n.opacity?{enable:n.opacity.animation.enable,max:e.getRangeMax(n.opacity.value),min:e.getRangeMin(n.opacity.value),status:e.AnimationStatus.increasing,value:e.getRangeValue(n.opacity.value),velocity:e.getRangeValue(n.opacity.animation.speed)/e.percentDenominator*s.retina.reduceFactor,decay:1-e.getRangeValue(n.opacity.animation.decay),delayTime:e.getRangeValue(n.opacity.animation.delay)*e.millisecondsToSeconds,time:0}:void 0},{opacity:o}=r;if(n.opacity&&o){const t=n.opacity.value;o.min=e.getRangeMin(t),o.max=e.getRangeMax(t);switch(n.opacity.animation.startValue){case e.StartValueType.min:o.value=o.min,o.status=e.AnimationStatus.increasing;break;case e.StartValueType.max:o.value=o.max,o.status=e.AnimationStatus.decreasing;break;case e.StartValueType.random:default:o.value=e.randomInRangeValue(o),o.status=e.getRandom()>=e.half?e.AnimationStatus.increasing:e.AnimationStatus.decreasing}}t.gradient.colors.push(r)}}isEnabled(t){return!t.destroyed&&!t.spawning&&(!!t.gradient?.angle.enable||(t.gradient?.colors.some(t=>t.value.h.enable||t.value.s.enable||t.value.l.enable)??!1))}loadOptions(t,...a){for(const s of a){if(!s?.gradient)continue;const a=s.gradient;t.gradient=e.executeOnSingleOrMultiple(a,t=>{const e=new o;return e.load(t),e})}}update(t,s){!function(t,s){const{gradient:n}=t;if(n){a.updateAnimation(t,n.angle,!1,e.DestroyType.none,s);for(const l of n.colors)e.updateColor(l.value,s),l.opacity&&a.updateAnimation(t,l.opacity,!0,e.DestroyType.none,s)}}(t,s)}}async function d(t){t.checkVersion("4.2.1"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("gradient",e=>Promise.resolve(new c(t.pluginManager,e)))})}const u=globalThis;u.__tsParticlesInternals=u.__tsParticlesInternals??{},u.loadGradientUpdater=d,t.loadGradientUpdater=d}),Object.assign(globalThis.window||globalThis,{loadGradientUpdater:(globalThis.__tsParticlesInternals.updaters.gradient||{}).loadGradientUpdater}),delete(globalThis.window||globalThis).tsparticlesInternalExports;
|