@tsparticles/updater-gradient 4.0.0-alpha.8 → 4.0.0-beta.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.
- package/711.min.js +1 -0
- package/browser/GradientUpdater.js +4 -2
- package/browser/Options/Classes/AnimatableGradient.js +3 -0
- package/browser/Options/Classes/AnimatableGradientColor.js +3 -0
- package/browser/Options/Classes/GradientAngle.js +3 -0
- package/browser/Options/Classes/GradientAngleAnimation.js +6 -0
- package/browser/Options/Classes/GradientColorOpacity.js +2 -0
- package/browser/Options/Classes/GradientColorOpacityAnimation.js +7 -0
- package/browser/index.js +1 -1
- package/cjs/GradientUpdater.js +4 -2
- package/cjs/Options/Classes/AnimatableGradient.js +3 -0
- package/cjs/Options/Classes/AnimatableGradientColor.js +3 -0
- package/cjs/Options/Classes/GradientAngle.js +3 -0
- package/cjs/Options/Classes/GradientAngleAnimation.js +6 -0
- package/cjs/Options/Classes/GradientColorOpacity.js +2 -0
- package/cjs/Options/Classes/GradientColorOpacityAnimation.js +7 -0
- package/cjs/index.js +1 -1
- package/dist_browser_GradientUpdater_js.js +9 -9
- package/esm/GradientUpdater.js +4 -2
- package/esm/Options/Classes/AnimatableGradient.js +3 -0
- package/esm/Options/Classes/AnimatableGradientColor.js +3 -0
- package/esm/Options/Classes/GradientAngle.js +3 -0
- package/esm/Options/Classes/GradientAngleAnimation.js +6 -0
- package/esm/Options/Classes/GradientColorOpacity.js +2 -0
- package/esm/Options/Classes/GradientColorOpacityAnimation.js +7 -0
- package/esm/index.js +1 -1
- package/package.json +2 -2
- package/report.html +1 -1
- package/tsparticles.updater.gradient.js +31 -19
- package/tsparticles.updater.gradient.min.js +2 -2
- package/umd/GradientUpdater.js +4 -2
- package/umd/Options/Classes/AnimatableGradient.js +3 -0
- package/umd/Options/Classes/AnimatableGradientColor.js +3 -0
- package/umd/Options/Classes/GradientAngle.js +3 -0
- package/umd/Options/Classes/GradientAngleAnimation.js +6 -0
- package/umd/Options/Classes/GradientColorOpacity.js +2 -0
- package/umd/Options/Classes/GradientColorOpacityAnimation.js +7 -0
- package/umd/index.js +1 -1
- package/652.min.js +0 -2
- package/652.min.js.LICENSE.txt +0 -1
- package/tsparticles.updater.gradient.min.js.LICENSE.txt +0 -1
package/711.min.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(this.webpackChunk_tsparticles_updater_gradient=this.webpackChunk_tsparticles_updater_gradient||[]).push([[711],{711(e,a,t){t.d(a,{GradientUpdater:()=>u});var i=t(303);class n{count;decay;delay;enable;speed;startValue;sync;constructor(){this.count=0,this.enable=!1,this.speed=0,this.decay=0,this.delay=0,this.sync=!1,this.startValue=i.StartValueType.random}load(e){(0,i.isNull)(e)||(void 0!==e.count&&(this.count=(0,i.setRangeValue)(e.count)),void 0!==e.enable&&(this.enable=e.enable),void 0!==e.speed&&(this.speed=(0,i.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,i.setRangeValue)(e.decay)),void 0!==e.delay&&(this.delay=(0,i.setRangeValue)(e.delay)))}}class o{animation;value;constructor(){this.value=0,this.animation=new n}load(e){(0,i.isNull)(e)||(this.animation.load(e.animation),void 0!==e.value&&(this.value=(0,i.setRangeValue)(e.value)))}}class l{opacity;stop;value;constructor(){this.stop=0,this.value=new i.AnimatableColor}load(e){(0,i.isNull)(e)||(void 0!==e.stop&&(this.stop=e.stop),this.value=i.AnimatableColor.create(this.value,e.value),void 0!==e.opacity&&(this.opacity=new o,(0,i.isNumber)(e.opacity)?this.opacity.value=e.opacity:this.opacity.load(e.opacity)))}}class s{count;decay;delay;enable;speed;sync;constructor(){this.count=0,this.enable=!1,this.speed=0,this.decay=0,this.delay=0,this.sync=!1}load(e){(0,i.isNull)(e)||(void 0!==e.count&&(this.count=(0,i.setRangeValue)(e.count)),void 0!==e.enable&&(this.enable=e.enable),void 0!==e.speed&&(this.speed=(0,i.setRangeValue)(e.speed)),void 0!==e.decay&&(this.decay=(0,i.setRangeValue)(e.decay)),void 0!==e.delay&&(this.delay=(0,i.setRangeValue)(e.delay)),void 0!==e.sync&&(this.sync=e.sync))}}class c{animation;direction;value;constructor(){this.value=0,this.animation=new s,this.direction=i.RotateDirection.clockwise}load(e){(0,i.isNull)(e)||(this.animation.load(e.animation),void 0!==e.value&&(this.value=(0,i.setRangeValue)(e.value)),void 0!==e.direction&&(this.direction=e.direction))}}class r{angle;colors;type;constructor(){this.angle=new c,this.colors=[],this.type=i.GradientType.random}load(e){(0,i.isNull)(e)||(this.angle.load(e.angle),void 0!==e.colors&&(this.colors=e.colors.map(e=>{let a=new l;return a.load(e),a})),void 0!==e.type&&(this.type=e.type))}}class u{_engine;constructor(e){this._engine=e}getColorStyles(e,a,t,n){let o=e.gradient;if(!o)return{};let{container:l}=e,s=o.angle.value,c=o.type===i.GradientType.radial?a.createRadialGradient(0,0,0,0,0,t):a.createLinearGradient(-(Math.cos(s)*t),-(Math.sin(s)*t),Math.cos(s)*t,Math.sin(s)*t);for(let{stop:e,value:a,opacity:t}of o.colors){let o={h:a.h.value,s:a.s.value,l:a.l.value};c.addColorStop(e,(0,i.getStyleFromHsl)(o,l.hdr,t?.value??n))}return{fill:c}}init(e){let a=(0,i.itemFromSingleOrMultiple)(e.options.gradient);if(!a)return;let{angle:t}=a;e.gradient={angle:{value:(0,i.getRangeValue)(t.value),enable:t.animation.enable,velocity:(0,i.getRangeValue)(t.animation.speed)/360*e.container.retina.reduceFactor,decay:1-(0,i.getRangeValue)(t.animation.decay),delayTime:(0,i.getRangeValue)(t.animation.delay)*i.millisecondsToSeconds,max:i.doublePI,min:0,time:0},type:a.type,colors:[]};let n=a.angle.direction;switch(n===i.RotateDirection.random&&(n=(0,i.getRandom)()>i.half?i.RotateDirection.counterClockwise:i.RotateDirection.clockwise),n){case i.RotateDirection.counterClockwise:case"counterClockwise":e.gradient.angle.status=i.AnimationStatus.decreasing;break;case i.RotateDirection.clockwise:e.gradient.angle.status=i.AnimationStatus.increasing}let o=e.options.reduceDuplicates;for(let t of a.colors){let a=(0,i.rangeColorToHsl)(this._engine,t.value,e.id,o);if(!a)continue;let n=(0,i.getHslAnimationFromHsl)(a,t.value.animation,e.container.retina.reduceFactor),l={stop:t.stop,value:n,opacity:t.opacity?{enable:t.opacity.animation.enable,max:(0,i.getRangeMax)(t.opacity.value),min:(0,i.getRangeMin)(t.opacity.value),status:i.AnimationStatus.increasing,value:(0,i.getRangeValue)(t.opacity.value),velocity:(0,i.getRangeValue)(t.opacity.animation.speed)/i.percentDenominator*e.container.retina.reduceFactor,decay:1-(0,i.getRangeValue)(t.opacity.animation.decay),delayTime:(0,i.getRangeValue)(t.opacity.animation.delay)*i.millisecondsToSeconds,time:0}:void 0},{opacity:s}=l;if(t.opacity&&s){let e=t.opacity.value;switch(s.min=(0,i.getRangeMin)(e),s.max=(0,i.getRangeMax)(e),t.opacity.animation.startValue){case i.StartValueType.min:s.value=s.min,s.status=i.AnimationStatus.increasing;break;case i.StartValueType.max:s.value=s.max,s.status=i.AnimationStatus.decreasing;break;case i.StartValueType.random:default:s.value=(0,i.randomInRangeValue)(s),s.status=(0,i.getRandom)()>=i.half?i.AnimationStatus.increasing:i.AnimationStatus.decreasing}}e.gradient.colors.push(l)}}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,...a){for(let t of a){if(!t?.gradient)continue;let a=t.gradient;e.gradient=(0,i.executeOnSingleOrMultiple)(a,e=>{let a=new r;return a.load(e),a})}}update(e,a){!function(e,a){let{gradient:t}=e;if(t)for(let n of((0,i.updateAnimation)(e,t.angle,!1,i.DestroyType.none,a),t.colors))(0,i.updateColor)(n.value,a),n.opacity&&(0,i.updateAnimation)(e,n.opacity,!0,i.DestroyType.none,a)}(e,a)}}}}]);
|
|
@@ -2,6 +2,7 @@ import { AnimationStatus, GradientType, RotateDirection, StartValueType, doubleP
|
|
|
2
2
|
import { AnimatableGradient } from "./Options/Classes/AnimatableGradient.js";
|
|
3
3
|
import { updateGradient } from "./Utils.js";
|
|
4
4
|
export class GradientUpdater {
|
|
5
|
+
_engine;
|
|
5
6
|
constructor(engine) {
|
|
6
7
|
this._engine = engine;
|
|
7
8
|
}
|
|
@@ -55,6 +56,8 @@ export class GradientUpdater {
|
|
|
55
56
|
case RotateDirection.clockwise:
|
|
56
57
|
particle.gradient.angle.status = AnimationStatus.increasing;
|
|
57
58
|
break;
|
|
59
|
+
default:
|
|
60
|
+
break;
|
|
58
61
|
}
|
|
59
62
|
const reduceDuplicates = particle.options.reduceDuplicates;
|
|
60
63
|
for (const grColor of gradient.colors) {
|
|
@@ -79,8 +82,7 @@ export class GradientUpdater {
|
|
|
79
82
|
time: 0,
|
|
80
83
|
}
|
|
81
84
|
: undefined,
|
|
82
|
-
};
|
|
83
|
-
const { opacity: addOpacity } = addColor;
|
|
85
|
+
}, { opacity: addOpacity } = addColor;
|
|
84
86
|
if (grColor.opacity && addOpacity) {
|
|
85
87
|
const opacityRange = grColor.opacity.value;
|
|
86
88
|
addOpacity.min = getRangeMin(opacityRange);
|
|
@@ -2,6 +2,9 @@ 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 {
|
|
5
|
+
angle;
|
|
6
|
+
colors;
|
|
7
|
+
type;
|
|
5
8
|
constructor() {
|
|
6
9
|
this.angle = new GradientAngle();
|
|
7
10
|
this.colors = [];
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { AnimatableColor, isNull, isNumber } from "@tsparticles/engine";
|
|
2
2
|
import { GradientColorOpacity } from "./GradientColorOpacity.js";
|
|
3
3
|
export class AnimatableGradientColor {
|
|
4
|
+
opacity;
|
|
5
|
+
stop;
|
|
6
|
+
value;
|
|
4
7
|
constructor() {
|
|
5
8
|
this.stop = 0;
|
|
6
9
|
this.value = new AnimatableColor();
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { RotateDirection, isNull, setRangeValue, } from "@tsparticles/engine";
|
|
2
2
|
import { GradientAngleAnimation } from "./GradientAngleAnimation.js";
|
|
3
3
|
export class GradientAngle {
|
|
4
|
+
animation;
|
|
5
|
+
direction;
|
|
6
|
+
value;
|
|
4
7
|
constructor() {
|
|
5
8
|
this.value = 0;
|
|
6
9
|
this.animation = new GradientAngleAnimation();
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { isNull, setRangeValue, } from "@tsparticles/engine";
|
|
2
2
|
import { GradientColorOpacityAnimation } from "./GradientColorOpacityAnimation.js";
|
|
3
3
|
export class GradientColorOpacity {
|
|
4
|
+
animation;
|
|
5
|
+
value;
|
|
4
6
|
constructor() {
|
|
5
7
|
this.value = 0;
|
|
6
8
|
this.animation = new GradientColorOpacityAnimation();
|
package/browser/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadGradientUpdater(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-
|
|
2
|
+
engine.checkVersion("4.0.0-beta.0");
|
|
3
3
|
await engine.register(e => {
|
|
4
4
|
e.addParticleUpdater("gradient", async () => {
|
|
5
5
|
const { GradientUpdater } = await import("./GradientUpdater.js");
|
package/cjs/GradientUpdater.js
CHANGED
|
@@ -2,6 +2,7 @@ import { AnimationStatus, GradientType, RotateDirection, StartValueType, doubleP
|
|
|
2
2
|
import { AnimatableGradient } from "./Options/Classes/AnimatableGradient.js";
|
|
3
3
|
import { updateGradient } from "./Utils.js";
|
|
4
4
|
export class GradientUpdater {
|
|
5
|
+
_engine;
|
|
5
6
|
constructor(engine) {
|
|
6
7
|
this._engine = engine;
|
|
7
8
|
}
|
|
@@ -55,6 +56,8 @@ export class GradientUpdater {
|
|
|
55
56
|
case RotateDirection.clockwise:
|
|
56
57
|
particle.gradient.angle.status = AnimationStatus.increasing;
|
|
57
58
|
break;
|
|
59
|
+
default:
|
|
60
|
+
break;
|
|
58
61
|
}
|
|
59
62
|
const reduceDuplicates = particle.options.reduceDuplicates;
|
|
60
63
|
for (const grColor of gradient.colors) {
|
|
@@ -79,8 +82,7 @@ export class GradientUpdater {
|
|
|
79
82
|
time: 0,
|
|
80
83
|
}
|
|
81
84
|
: undefined,
|
|
82
|
-
};
|
|
83
|
-
const { opacity: addOpacity } = addColor;
|
|
85
|
+
}, { opacity: addOpacity } = addColor;
|
|
84
86
|
if (grColor.opacity && addOpacity) {
|
|
85
87
|
const opacityRange = grColor.opacity.value;
|
|
86
88
|
addOpacity.min = getRangeMin(opacityRange);
|
|
@@ -2,6 +2,9 @@ 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 {
|
|
5
|
+
angle;
|
|
6
|
+
colors;
|
|
7
|
+
type;
|
|
5
8
|
constructor() {
|
|
6
9
|
this.angle = new GradientAngle();
|
|
7
10
|
this.colors = [];
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { AnimatableColor, isNull, isNumber } from "@tsparticles/engine";
|
|
2
2
|
import { GradientColorOpacity } from "./GradientColorOpacity.js";
|
|
3
3
|
export class AnimatableGradientColor {
|
|
4
|
+
opacity;
|
|
5
|
+
stop;
|
|
6
|
+
value;
|
|
4
7
|
constructor() {
|
|
5
8
|
this.stop = 0;
|
|
6
9
|
this.value = new AnimatableColor();
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { RotateDirection, isNull, setRangeValue, } from "@tsparticles/engine";
|
|
2
2
|
import { GradientAngleAnimation } from "./GradientAngleAnimation.js";
|
|
3
3
|
export class GradientAngle {
|
|
4
|
+
animation;
|
|
5
|
+
direction;
|
|
6
|
+
value;
|
|
4
7
|
constructor() {
|
|
5
8
|
this.value = 0;
|
|
6
9
|
this.animation = new GradientAngleAnimation();
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { isNull, setRangeValue, } from "@tsparticles/engine";
|
|
2
2
|
import { GradientColorOpacityAnimation } from "./GradientColorOpacityAnimation.js";
|
|
3
3
|
export class GradientColorOpacity {
|
|
4
|
+
animation;
|
|
5
|
+
value;
|
|
4
6
|
constructor() {
|
|
5
7
|
this.value = 0;
|
|
6
8
|
this.animation = new GradientColorOpacityAnimation();
|
package/cjs/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadGradientUpdater(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-
|
|
2
|
+
engine.checkVersion("4.0.0-beta.0");
|
|
3
3
|
await engine.register(e => {
|
|
4
4
|
e.addParticleUpdater("gradient", async () => {
|
|
5
5
|
const { GradientUpdater } = await import("./GradientUpdater.js");
|
|
@@ -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
|
-
* v4.0.0-
|
|
7
|
+
* v4.0.0-beta.0
|
|
8
8
|
*/
|
|
9
9
|
"use strict";
|
|
10
10
|
/*
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
\*****************************************/
|
|
24
24
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
25
25
|
|
|
26
|
-
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 _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\nclass GradientUpdater {\n
|
|
26
|
+
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 _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\nclass GradientUpdater {\n _engine;\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 { container } = particle, gradientAngle = gradient.angle.value, origin = {\n x: 0,\n y: 0\n }, minRadius = 0, 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 { stop, value, opacity: cOpacity } of gradient.colors){\n const hsl = {\n h: value.h.value,\n s: value.s.value,\n l: value.l.value\n };\n fillGradient.addColorStop(stop, (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getStyleFromHsl)(hsl, container.hdr, 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 { angle } = gradient, speedFactor = 360, 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: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.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__.half ? _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 default:\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), 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 }, { opacity: addOpacity } = 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__.randomInRangeValue)(addOpacity);\n addOpacity.status = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRandom)() >= _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.half ? _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 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\n//# sourceURL=webpack://@tsparticles/updater-gradient/./dist/browser/GradientUpdater.js?\n}");
|
|
27
27
|
|
|
28
28
|
/***/ },
|
|
29
29
|
|
|
@@ -33,7 +33,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
33
33
|
\************************************************************/
|
|
34
34
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
35
35
|
|
|
36
|
-
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 _AnimatableGradientColor_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AnimatableGradientColor.js */ \"./dist/browser/Options/Classes/AnimatableGradientColor.js\");\n/* harmony import */ var _GradientAngle_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./GradientAngle.js */ \"./dist/browser/Options/Classes/GradientAngle.js\");\n\n\n\nclass AnimatableGradient {\n
|
|
36
|
+
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 _AnimatableGradientColor_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AnimatableGradientColor.js */ \"./dist/browser/Options/Classes/AnimatableGradientColor.js\");\n/* harmony import */ var _GradientAngle_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./GradientAngle.js */ \"./dist/browser/Options/Classes/GradientAngle.js\");\n\n\n\nclass AnimatableGradient {\n angle;\n colors;\n type;\n constructor(){\n this.angle = new _GradientAngle_js__WEBPACK_IMPORTED_MODULE_2__.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_1__.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\n//# sourceURL=webpack://@tsparticles/updater-gradient/./dist/browser/Options/Classes/AnimatableGradient.js?\n}");
|
|
37
37
|
|
|
38
38
|
/***/ },
|
|
39
39
|
|
|
@@ -43,7 +43,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
43
43
|
\*****************************************************************/
|
|
44
44
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
45
45
|
|
|
46
|
-
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 _GradientColorOpacity_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./GradientColorOpacity.js */ \"./dist/browser/Options/Classes/GradientColorOpacity.js\");\n\n\nclass AnimatableGradientColor {\n
|
|
46
|
+
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 _GradientColorOpacity_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./GradientColorOpacity.js */ \"./dist/browser/Options/Classes/GradientColorOpacity.js\");\n\n\nclass AnimatableGradientColor {\n opacity;\n stop;\n value;\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\n//# sourceURL=webpack://@tsparticles/updater-gradient/./dist/browser/Options/Classes/AnimatableGradientColor.js?\n}");
|
|
47
47
|
|
|
48
48
|
/***/ },
|
|
49
49
|
|
|
@@ -53,7 +53,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
53
53
|
\*******************************************************/
|
|
54
54
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
55
55
|
|
|
56
|
-
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 _GradientAngleAnimation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./GradientAngleAnimation.js */ \"./dist/browser/Options/Classes/GradientAngleAnimation.js\");\n\n\nclass GradientAngle {\n
|
|
56
|
+
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 _GradientAngleAnimation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./GradientAngleAnimation.js */ \"./dist/browser/Options/Classes/GradientAngleAnimation.js\");\n\n\nclass GradientAngle {\n animation;\n direction;\n value;\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\n//# sourceURL=webpack://@tsparticles/updater-gradient/./dist/browser/Options/Classes/GradientAngle.js?\n}");
|
|
57
57
|
|
|
58
58
|
/***/ },
|
|
59
59
|
|
|
@@ -63,7 +63,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
63
63
|
\****************************************************************/
|
|
64
64
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
65
65
|
|
|
66
|
-
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\nclass GradientAngleAnimation {\n
|
|
66
|
+
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\nclass GradientAngleAnimation {\n count;\n decay;\n delay;\n enable;\n speed;\n sync;\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\n//# sourceURL=webpack://@tsparticles/updater-gradient/./dist/browser/Options/Classes/GradientAngleAnimation.js?\n}");
|
|
67
67
|
|
|
68
68
|
/***/ },
|
|
69
69
|
|
|
@@ -73,7 +73,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
73
73
|
\**************************************************************/
|
|
74
74
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
75
75
|
|
|
76
|
-
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 _GradientColorOpacityAnimation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./GradientColorOpacityAnimation.js */ \"./dist/browser/Options/Classes/GradientColorOpacityAnimation.js\");\n\n\nclass GradientColorOpacity {\n
|
|
76
|
+
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 _GradientColorOpacityAnimation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./GradientColorOpacityAnimation.js */ \"./dist/browser/Options/Classes/GradientColorOpacityAnimation.js\");\n\n\nclass GradientColorOpacity {\n animation;\n value;\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\n//# sourceURL=webpack://@tsparticles/updater-gradient/./dist/browser/Options/Classes/GradientColorOpacity.js?\n}");
|
|
77
77
|
|
|
78
78
|
/***/ },
|
|
79
79
|
|
|
@@ -83,7 +83,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
83
83
|
\***********************************************************************/
|
|
84
84
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
85
85
|
|
|
86
|
-
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\nclass GradientColorOpacityAnimation {\n
|
|
86
|
+
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\nclass GradientColorOpacityAnimation {\n count;\n decay;\n delay;\n enable;\n speed;\n startValue;\n sync;\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\n//# sourceURL=webpack://@tsparticles/updater-gradient/./dist/browser/Options/Classes/GradientColorOpacityAnimation.js?\n}");
|
|
87
87
|
|
|
88
88
|
/***/ },
|
|
89
89
|
|
|
@@ -93,7 +93,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
93
93
|
\*******************************/
|
|
94
94
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
95
95
|
|
|
96
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ updateGradient: () => (/* binding */ updateGradient)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nfunction updateGradient(particle, delta) {\n
|
|
96
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ updateGradient: () => (/* binding */ updateGradient)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nfunction updateGradient(particle, delta) {\n const { gradient } = particle;\n if (!gradient) {\n return;\n }\n (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.updateAnimation)(particle, gradient.angle, false, _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.DestroyType.none, delta);\n for (const color of gradient.colors){\n (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.updateColor)(color.value, delta);\n if (color.opacity) {\n (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.updateAnimation)(particle, color.opacity, true, _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.DestroyType.none, delta);\n }\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/updater-gradient/./dist/browser/Utils.js?\n}");
|
|
97
97
|
|
|
98
98
|
/***/ }
|
|
99
99
|
|
package/esm/GradientUpdater.js
CHANGED
|
@@ -2,6 +2,7 @@ import { AnimationStatus, GradientType, RotateDirection, StartValueType, doubleP
|
|
|
2
2
|
import { AnimatableGradient } from "./Options/Classes/AnimatableGradient.js";
|
|
3
3
|
import { updateGradient } from "./Utils.js";
|
|
4
4
|
export class GradientUpdater {
|
|
5
|
+
_engine;
|
|
5
6
|
constructor(engine) {
|
|
6
7
|
this._engine = engine;
|
|
7
8
|
}
|
|
@@ -55,6 +56,8 @@ export class GradientUpdater {
|
|
|
55
56
|
case RotateDirection.clockwise:
|
|
56
57
|
particle.gradient.angle.status = AnimationStatus.increasing;
|
|
57
58
|
break;
|
|
59
|
+
default:
|
|
60
|
+
break;
|
|
58
61
|
}
|
|
59
62
|
const reduceDuplicates = particle.options.reduceDuplicates;
|
|
60
63
|
for (const grColor of gradient.colors) {
|
|
@@ -79,8 +82,7 @@ export class GradientUpdater {
|
|
|
79
82
|
time: 0,
|
|
80
83
|
}
|
|
81
84
|
: undefined,
|
|
82
|
-
};
|
|
83
|
-
const { opacity: addOpacity } = addColor;
|
|
85
|
+
}, { opacity: addOpacity } = addColor;
|
|
84
86
|
if (grColor.opacity && addOpacity) {
|
|
85
87
|
const opacityRange = grColor.opacity.value;
|
|
86
88
|
addOpacity.min = getRangeMin(opacityRange);
|
|
@@ -2,6 +2,9 @@ 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 {
|
|
5
|
+
angle;
|
|
6
|
+
colors;
|
|
7
|
+
type;
|
|
5
8
|
constructor() {
|
|
6
9
|
this.angle = new GradientAngle();
|
|
7
10
|
this.colors = [];
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { AnimatableColor, isNull, isNumber } from "@tsparticles/engine";
|
|
2
2
|
import { GradientColorOpacity } from "./GradientColorOpacity.js";
|
|
3
3
|
export class AnimatableGradientColor {
|
|
4
|
+
opacity;
|
|
5
|
+
stop;
|
|
6
|
+
value;
|
|
4
7
|
constructor() {
|
|
5
8
|
this.stop = 0;
|
|
6
9
|
this.value = new AnimatableColor();
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { RotateDirection, isNull, setRangeValue, } from "@tsparticles/engine";
|
|
2
2
|
import { GradientAngleAnimation } from "./GradientAngleAnimation.js";
|
|
3
3
|
export class GradientAngle {
|
|
4
|
+
animation;
|
|
5
|
+
direction;
|
|
6
|
+
value;
|
|
4
7
|
constructor() {
|
|
5
8
|
this.value = 0;
|
|
6
9
|
this.animation = new GradientAngleAnimation();
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { isNull, setRangeValue, } from "@tsparticles/engine";
|
|
2
2
|
import { GradientColorOpacityAnimation } from "./GradientColorOpacityAnimation.js";
|
|
3
3
|
export class GradientColorOpacity {
|
|
4
|
+
animation;
|
|
5
|
+
value;
|
|
4
6
|
constructor() {
|
|
5
7
|
this.value = 0;
|
|
6
8
|
this.animation = new GradientColorOpacityAnimation();
|
package/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadGradientUpdater(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-
|
|
2
|
+
engine.checkVersion("4.0.0-beta.0");
|
|
3
3
|
await engine.register(e => {
|
|
4
4
|
e.addParticleUpdater("gradient", async () => {
|
|
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.0.0-
|
|
3
|
+
"version": "4.0.0-beta.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": "4.0.0-
|
|
104
|
+
"@tsparticles/engine": "4.0.0-beta.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 [
|
|
6
|
+
<title>@tsparticles/updater-gradient [19 Mar 2026 at 14:00]</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
|
-
* v4.0.0-
|
|
7
|
+
* v4.0.0-beta.0
|
|
8
8
|
*/
|
|
9
9
|
/*
|
|
10
10
|
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
@@ -28,16 +28,6 @@ return /******/ (() => { // webpackBootstrap
|
|
|
28
28
|
/******/ "use strict";
|
|
29
29
|
/******/ var __webpack_modules__ = ({
|
|
30
30
|
|
|
31
|
-
/***/ "./dist/browser/index.js"
|
|
32
|
-
/*!*******************************!*\
|
|
33
|
-
!*** ./dist/browser/index.js ***!
|
|
34
|
-
\*******************************/
|
|
35
|
-
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
36
|
-
|
|
37
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadGradientUpdater: () => (/* binding */ loadGradientUpdater)\n/* harmony export */ });\nasync function loadGradientUpdater(engine) {\n engine.checkVersion(\"4.0.0-alpha.8\");\n await engine.register(e => {\n e.addParticleUpdater(\"gradient\", async () => {\n const {\n GradientUpdater\n } = await __webpack_require__.e(/*! import() */ \"dist_browser_GradientUpdater_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./GradientUpdater.js */ \"./dist/browser/GradientUpdater.js\"));\n return new GradientUpdater(e);\n });\n });\n}\n\n//# sourceURL=webpack://@tsparticles/updater-gradient/./dist/browser/index.js?\n}");
|
|
38
|
-
|
|
39
|
-
/***/ },
|
|
40
|
-
|
|
41
31
|
/***/ "@tsparticles/engine"
|
|
42
32
|
/*!*********************************************************************************************************************************!*\
|
|
43
33
|
!*** external {"commonjs":"@tsparticles/engine","commonjs2":"@tsparticles/engine","amd":"@tsparticles/engine","root":"window"} ***!
|
|
@@ -46,6 +36,16 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
46
36
|
|
|
47
37
|
module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
|
|
48
38
|
|
|
39
|
+
/***/ },
|
|
40
|
+
|
|
41
|
+
/***/ "./dist/browser/index.js"
|
|
42
|
+
/*!*******************************!*\
|
|
43
|
+
!*** ./dist/browser/index.js ***!
|
|
44
|
+
\*******************************/
|
|
45
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
46
|
+
|
|
47
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadGradientUpdater: () => (/* binding */ loadGradientUpdater)\n/* harmony export */ });\nasync function loadGradientUpdater(engine) {\n engine.checkVersion(\"4.0.0-beta.0\");\n await engine.register((e)=>{\n e.addParticleUpdater(\"gradient\", async ()=>{\n const { GradientUpdater } = await __webpack_require__.e(/*! import() */ \"dist_browser_GradientUpdater_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./GradientUpdater.js */ \"./dist/browser/GradientUpdater.js\"));\n return new GradientUpdater(e);\n });\n });\n}\n\n\n//# sourceURL=webpack://@tsparticles/updater-gradient/./dist/browser/index.js?\n}");
|
|
48
|
+
|
|
49
49
|
/***/ }
|
|
50
50
|
|
|
51
51
|
/******/ });
|
|
@@ -60,12 +60,6 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
|
|
|
60
60
|
/******/ if (cachedModule !== undefined) {
|
|
61
61
|
/******/ return cachedModule.exports;
|
|
62
62
|
/******/ }
|
|
63
|
-
/******/ // Check if module exists (development only)
|
|
64
|
-
/******/ if (__webpack_modules__[moduleId] === undefined) {
|
|
65
|
-
/******/ var e = new Error("Cannot find module '" + moduleId + "'");
|
|
66
|
-
/******/ e.code = 'MODULE_NOT_FOUND';
|
|
67
|
-
/******/ throw e;
|
|
68
|
-
/******/ }
|
|
69
63
|
/******/ // Create a new module (and put it into the cache)
|
|
70
64
|
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
71
65
|
/******/ // no module.id needed
|
|
@@ -74,6 +68,12 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
|
|
|
74
68
|
/******/ };
|
|
75
69
|
/******/
|
|
76
70
|
/******/ // Execute the module function
|
|
71
|
+
/******/ if (!(moduleId in __webpack_modules__)) {
|
|
72
|
+
/******/ delete __webpack_module_cache__[moduleId];
|
|
73
|
+
/******/ var e = new Error("Cannot find module '" + moduleId + "'");
|
|
74
|
+
/******/ e.code = 'MODULE_NOT_FOUND';
|
|
75
|
+
/******/ throw e;
|
|
76
|
+
/******/ }
|
|
77
77
|
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
78
78
|
/******/
|
|
79
79
|
/******/ // Return the exports of the module
|
|
@@ -118,6 +118,18 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
|
|
|
118
118
|
/******/ };
|
|
119
119
|
/******/ })();
|
|
120
120
|
/******/
|
|
121
|
+
/******/ /* webpack/runtime/global */
|
|
122
|
+
/******/ (() => {
|
|
123
|
+
/******/ __webpack_require__.g = (function() {
|
|
124
|
+
/******/ if (typeof globalThis === 'object') return globalThis;
|
|
125
|
+
/******/ try {
|
|
126
|
+
/******/ return this || new Function('return this')();
|
|
127
|
+
/******/ } catch (e) {
|
|
128
|
+
/******/ if (typeof window === 'object') return window;
|
|
129
|
+
/******/ }
|
|
130
|
+
/******/ })();
|
|
131
|
+
/******/ })();
|
|
132
|
+
/******/
|
|
121
133
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
122
134
|
/******/ (() => {
|
|
123
135
|
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
@@ -182,8 +194,8 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
|
|
|
182
194
|
/******/ /* webpack/runtime/publicPath */
|
|
183
195
|
/******/ (() => {
|
|
184
196
|
/******/ var scriptUrl;
|
|
185
|
-
/******/ if (
|
|
186
|
-
/******/ var document =
|
|
197
|
+
/******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
|
|
198
|
+
/******/ var document = __webpack_require__.g.document;
|
|
187
199
|
/******/ if (!scriptUrl && document) {
|
|
188
200
|
/******/ if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')
|
|
189
201
|
/******/ scriptUrl = document.currentScript.src;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
!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 r="object"==typeof exports?t(require("@tsparticles/engine")):t(e.window);for(var o in r)("object"==typeof exports?exports:e)[o]=r[o]}}(this,e=>(()=>{"use strict";var t,r,o,i={303(t){t.exports=e}},n={};function a(e){var t=n[e];if(void 0!==t)return t.exports;var r=n[e]={exports:{}};return i[e](r,r.exports,a),r.exports}a.m=i,a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce((t,r)=>(a.f[r](e,t),t),[])),a.u=e=>""+e+".min.js",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s={},a.l=(e,t,r,o)=>{if(s[e])return void s[e].push(t);if(void 0!==r)for(var i,n,c=document.getElementsByTagName("script"),p=0;p<c.length;p++){var u=c[p];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")=="@tsparticles/updater-gradient:"+r){i=u;break}}i||(n=!0,(i=document.createElement("script")).charset="utf-8",a.nc&&i.setAttribute("nonce",a.nc),i.setAttribute("data-webpack","@tsparticles/updater-gradient:"+r),i.src=e),s[e]=[t];var l=(t,r)=>{i.onerror=i.onload=null,clearTimeout(d);var o=s[e];if(delete s[e],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach(e=>e(r)),t)return t(r)},d=setTimeout(l.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=l.bind(null,i.onerror),i.onload=l.bind(null,i.onload),n&&document.head.appendChild(i)},a.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.g.importScripts&&(c=a.g.location+"");var s,c,p=a.g.document;if(!c&&p&&(p.currentScript&&"SCRIPT"===p.currentScript.tagName.toUpperCase()&&(c=p.currentScript.src),!c)){var u=p.getElementsByTagName("script");if(u.length)for(var l=u.length-1;l>-1&&(!c||!/^http(s?):/.test(c));)c=u[l--].src}if(!c)throw Error("Automatic publicPath is not supported in this browser");a.p=c=c.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),t={408:0},a.f.j=(e,r)=>{var o=a.o(t,e)?t[e]:void 0;if(0!==o)if(o)r.push(o[2]);else{var i=new Promise((r,i)=>o=t[e]=[r,i]);r.push(o[2]=i);var n=a.p+a.u(e),s=Error();a.l(n,r=>{if(a.o(t,e)&&(0!==(o=t[e])&&(t[e]=void 0),o)){var i=r&&("load"===r.type?"missing":r.type),n=r&&r.target&&r.target.src;s.message="Loading chunk "+e+` failed.
|
|
2
|
+
(`+i+": "+n+")",s.name="ChunkLoadError",s.type=i,s.request=n,o[1](s)}},"chunk-"+e,e)}},r=(e,r)=>{var o,i,[n,s,c]=r,p=0;if(n.some(e=>0!==t[e])){for(o in s)a.o(s,o)&&(a.m[o]=s[o]);c&&c(a)}for(e&&e(r);p<n.length;p++)i=n[p],a.o(t,i)&&t[i]&&t[i][0](),t[i]=0},(o=this.webpackChunk_tsparticles_updater_gradient=this.webpackChunk_tsparticles_updater_gradient||[]).forEach(r.bind(null,0)),o.push=r.bind(null,o.push.bind(o));var d={};async function f(e){e.checkVersion("4.0.0-beta.0"),await e.register(e=>{e.addParticleUpdater("gradient",async()=>{let{GradientUpdater:t}=await a.e(711).then(a.bind(a,711));return new t(e)})})}return a.r(d),a.d(d,{loadGradientUpdater:()=>f}),d})());
|
package/umd/GradientUpdater.js
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
const AnimatableGradient_js_1 = require("./Options/Classes/AnimatableGradient.js");
|
|
15
15
|
const Utils_js_1 = require("./Utils.js");
|
|
16
16
|
class GradientUpdater {
|
|
17
|
+
_engine;
|
|
17
18
|
constructor(engine) {
|
|
18
19
|
this._engine = engine;
|
|
19
20
|
}
|
|
@@ -67,6 +68,8 @@
|
|
|
67
68
|
case engine_1.RotateDirection.clockwise:
|
|
68
69
|
particle.gradient.angle.status = engine_1.AnimationStatus.increasing;
|
|
69
70
|
break;
|
|
71
|
+
default:
|
|
72
|
+
break;
|
|
70
73
|
}
|
|
71
74
|
const reduceDuplicates = particle.options.reduceDuplicates;
|
|
72
75
|
for (const grColor of gradient.colors) {
|
|
@@ -91,8 +94,7 @@
|
|
|
91
94
|
time: 0,
|
|
92
95
|
}
|
|
93
96
|
: undefined,
|
|
94
|
-
};
|
|
95
|
-
const { opacity: addOpacity } = addColor;
|
|
97
|
+
}, { opacity: addOpacity } = addColor;
|
|
96
98
|
if (grColor.opacity && addOpacity) {
|
|
97
99
|
const opacityRange = grColor.opacity.value;
|
|
98
100
|
addOpacity.min = (0, engine_1.getRangeMin)(opacityRange);
|
|
@@ -14,6 +14,9 @@
|
|
|
14
14
|
const AnimatableGradientColor_js_1 = require("./AnimatableGradientColor.js");
|
|
15
15
|
const GradientAngle_js_1 = require("./GradientAngle.js");
|
|
16
16
|
class AnimatableGradient {
|
|
17
|
+
angle;
|
|
18
|
+
colors;
|
|
19
|
+
type;
|
|
17
20
|
constructor() {
|
|
18
21
|
this.angle = new GradientAngle_js_1.GradientAngle();
|
|
19
22
|
this.colors = [];
|
|
@@ -13,6 +13,9 @@
|
|
|
13
13
|
const engine_1 = require("@tsparticles/engine");
|
|
14
14
|
const GradientColorOpacity_js_1 = require("./GradientColorOpacity.js");
|
|
15
15
|
class AnimatableGradientColor {
|
|
16
|
+
opacity;
|
|
17
|
+
stop;
|
|
18
|
+
value;
|
|
16
19
|
constructor() {
|
|
17
20
|
this.stop = 0;
|
|
18
21
|
this.value = new engine_1.AnimatableColor();
|
|
@@ -13,6 +13,9 @@
|
|
|
13
13
|
const engine_1 = require("@tsparticles/engine");
|
|
14
14
|
const GradientAngleAnimation_js_1 = require("./GradientAngleAnimation.js");
|
|
15
15
|
class GradientAngle {
|
|
16
|
+
animation;
|
|
17
|
+
direction;
|
|
18
|
+
value;
|
|
16
19
|
constructor() {
|
|
17
20
|
this.value = 0;
|
|
18
21
|
this.animation = new GradientAngleAnimation_js_1.GradientAngleAnimation();
|
|
@@ -12,6 +12,12 @@
|
|
|
12
12
|
exports.GradientAngleAnimation = void 0;
|
|
13
13
|
const engine_1 = require("@tsparticles/engine");
|
|
14
14
|
class GradientAngleAnimation {
|
|
15
|
+
count;
|
|
16
|
+
decay;
|
|
17
|
+
delay;
|
|
18
|
+
enable;
|
|
19
|
+
speed;
|
|
20
|
+
sync;
|
|
15
21
|
constructor() {
|
|
16
22
|
this.count = 0;
|
|
17
23
|
this.enable = false;
|
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
const engine_1 = require("@tsparticles/engine");
|
|
14
14
|
const GradientColorOpacityAnimation_js_1 = require("./GradientColorOpacityAnimation.js");
|
|
15
15
|
class GradientColorOpacity {
|
|
16
|
+
animation;
|
|
17
|
+
value;
|
|
16
18
|
constructor() {
|
|
17
19
|
this.value = 0;
|
|
18
20
|
this.animation = new GradientColorOpacityAnimation_js_1.GradientColorOpacityAnimation();
|
|
@@ -12,6 +12,13 @@
|
|
|
12
12
|
exports.GradientColorOpacityAnimation = void 0;
|
|
13
13
|
const engine_1 = require("@tsparticles/engine");
|
|
14
14
|
class GradientColorOpacityAnimation {
|
|
15
|
+
count;
|
|
16
|
+
decay;
|
|
17
|
+
delay;
|
|
18
|
+
enable;
|
|
19
|
+
speed;
|
|
20
|
+
startValue;
|
|
21
|
+
sync;
|
|
15
22
|
constructor() {
|
|
16
23
|
this.count = 0;
|
|
17
24
|
this.enable = false;
|
package/umd/index.js
CHANGED
|
@@ -45,7 +45,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
45
45
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
46
|
exports.loadGradientUpdater = loadGradientUpdater;
|
|
47
47
|
async function loadGradientUpdater(engine) {
|
|
48
|
-
engine.checkVersion("4.0.0-
|
|
48
|
+
engine.checkVersion("4.0.0-beta.0");
|
|
49
49
|
await engine.register(e => {
|
|
50
50
|
e.addParticleUpdater("gradient", async () => {
|
|
51
51
|
const { GradientUpdater } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./GradientUpdater.js"))) : new Promise((resolve_1, reject_1) => { require(["./GradientUpdater.js"], resolve_1, reject_1); }).then(__importStar));
|
package/652.min.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 652.min.js.LICENSE.txt */
|
|
2
|
-
(this.webpackChunk_tsparticles_updater_gradient=this.webpackChunk_tsparticles_updater_gradient||[]).push([[652],{652(e,a,t){t.d(a,{GradientUpdater:()=>u});var i=t(303);class n{constructor(){this.count=0,this.enable=!1,this.speed=0,this.decay=0,this.delay=0,this.sync=!1,this.startValue=i.StartValueType.random}load(e){(0,i.isNull)(e)||(void 0!==e.count&&(this.count=(0,i.setRangeValue)(e.count)),void 0!==e.enable&&(this.enable=e.enable),void 0!==e.speed&&(this.speed=(0,i.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,i.setRangeValue)(e.decay)),void 0!==e.delay&&(this.delay=(0,i.setRangeValue)(e.delay)))}}class o{constructor(){this.value=0,this.animation=new n}load(e){(0,i.isNull)(e)||(this.animation.load(e.animation),void 0!==e.value&&(this.value=(0,i.setRangeValue)(e.value)))}}class s{constructor(){this.stop=0,this.value=new i.AnimatableColor}load(e){(0,i.isNull)(e)||(void 0!==e.stop&&(this.stop=e.stop),this.value=i.AnimatableColor.create(this.value,e.value),void 0!==e.opacity&&(this.opacity=new o,(0,i.isNumber)(e.opacity)?this.opacity.value=e.opacity:this.opacity.load(e.opacity)))}}class l{constructor(){this.count=0,this.enable=!1,this.speed=0,this.decay=0,this.delay=0,this.sync=!1}load(e){(0,i.isNull)(e)||(void 0!==e.count&&(this.count=(0,i.setRangeValue)(e.count)),void 0!==e.enable&&(this.enable=e.enable),void 0!==e.speed&&(this.speed=(0,i.setRangeValue)(e.speed)),void 0!==e.decay&&(this.decay=(0,i.setRangeValue)(e.decay)),void 0!==e.delay&&(this.delay=(0,i.setRangeValue)(e.delay)),void 0!==e.sync&&(this.sync=e.sync))}}class c{constructor(){this.value=0,this.animation=new l,this.direction=i.RotateDirection.clockwise}load(e){(0,i.isNull)(e)||(this.animation.load(e.animation),void 0!==e.value&&(this.value=(0,i.setRangeValue)(e.value)),void 0!==e.direction&&(this.direction=e.direction))}}class r{constructor(){this.angle=new c,this.colors=[],this.type=i.GradientType.random}load(e){(0,i.isNull)(e)||(this.angle.load(e.angle),void 0!==e.colors&&(this.colors=e.colors.map((e=>{const a=new s;return a.load(e),a}))),void 0!==e.type&&(this.type=e.type))}}class u{constructor(e){this._engine=e}getColorStyles(e,a,t,n){const o=e.gradient;if(!o)return{};const{container:s}=e,l=o.angle.value,c=0,r=0,u=o.type===i.GradientType.radial?a.createRadialGradient(c,r,0,c,r,t):a.createLinearGradient(Math.cos(l)*-t,Math.sin(l)*-t,Math.cos(l)*t,Math.sin(l)*t);for(const{stop:e,value:a,opacity:t}of o.colors){const o={h:a.h.value,s:a.s.value,l:a.l.value};u.addColorStop(e,(0,i.getStyleFromHsl)(o,s.hdr,t?.value??n))}return{fill:u}}init(e){const a=(0,i.itemFromSingleOrMultiple)(e.options.gradient);if(!a)return;const{angle:t}=a;e.gradient={angle:{value:(0,i.getRangeValue)(t.value),enable:t.animation.enable,velocity:(0,i.getRangeValue)(t.animation.speed)/360*e.container.retina.reduceFactor,decay:1-(0,i.getRangeValue)(t.animation.decay),delayTime:(0,i.getRangeValue)(t.animation.delay)*i.millisecondsToSeconds,max:i.doublePI,min:0,time:0},type:a.type,colors:[]};let n=a.angle.direction;switch(n===i.RotateDirection.random&&(n=(0,i.getRandom)()>i.half?i.RotateDirection.counterClockwise:i.RotateDirection.clockwise),n){case i.RotateDirection.counterClockwise:case"counterClockwise":e.gradient.angle.status=i.AnimationStatus.decreasing;break;case i.RotateDirection.clockwise:e.gradient.angle.status=i.AnimationStatus.increasing}const o=e.options.reduceDuplicates;for(const t of a.colors){const a=(0,i.rangeColorToHsl)(this._engine,t.value,e.id,o);if(!a)continue;const n=(0,i.getHslAnimationFromHsl)(a,t.value.animation,e.container.retina.reduceFactor),s={stop:t.stop,value:n,opacity:t.opacity?{enable:t.opacity.animation.enable,max:(0,i.getRangeMax)(t.opacity.value),min:(0,i.getRangeMin)(t.opacity.value),status:i.AnimationStatus.increasing,value:(0,i.getRangeValue)(t.opacity.value),velocity:(0,i.getRangeValue)(t.opacity.animation.speed)/i.percentDenominator*e.container.retina.reduceFactor,decay:1-(0,i.getRangeValue)(t.opacity.animation.decay),delayTime:(0,i.getRangeValue)(t.opacity.animation.delay)*i.millisecondsToSeconds,time:0}:void 0},{opacity:l}=s;if(t.opacity&&l){const e=t.opacity.value;l.min=(0,i.getRangeMin)(e),l.max=(0,i.getRangeMax)(e);switch(t.opacity.animation.startValue){case i.StartValueType.min:l.value=l.min,l.status=i.AnimationStatus.increasing;break;case i.StartValueType.max:l.value=l.max,l.status=i.AnimationStatus.decreasing;break;case i.StartValueType.random:default:l.value=(0,i.randomInRangeValue)(l),l.status=(0,i.getRandom)()>=i.half?i.AnimationStatus.increasing:i.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,...a){for(const t of a){if(!t?.gradient)continue;const a=t.gradient;e.gradient=(0,i.executeOnSingleOrMultiple)(a,(e=>{const a=new r;return a.load(e),a}))}}update(e,a){!function(e,a){const{gradient:t}=e;if(t){(0,i.updateAnimation)(e,t.angle,!1,i.DestroyType.none,a);for(const n of t.colors)(0,i.updateColor)(n.value,a),n.opacity&&(0,i.updateAnimation)(e,n.opacity,!0,i.DestroyType.none,a)}}(e,a)}}}}]);
|
package/652.min.js.LICENSE.txt
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! tsParticles Gradient Updater v4.0.0-alpha.8 by Matteo Bruni */
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! tsParticles Gradient Updater v4.0.0-alpha.8 by Matteo Bruni */
|