@tsparticles/updater-gradient 3.0.3 → 3.2.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/103.min.js +2 -0
- package/103.min.js.LICENSE.txt +1 -0
- package/914.min.js +2 -0
- package/914.min.js.LICENSE.txt +1 -0
- package/browser/GradientUpdater.js +20 -16
- package/browser/Utils.js +4 -97
- package/browser/index.js +4 -2
- package/cjs/GradientUpdater.js +43 -16
- package/cjs/Utils.js +4 -97
- package/cjs/index.js +27 -2
- package/dist_browser_GradientUpdater_js.js +90 -0
- package/dist_browser_Utils_js.js +30 -0
- package/esm/GradientUpdater.js +20 -16
- package/esm/Utils.js +4 -97
- package/esm/index.js +4 -2
- package/package.json +2 -2
- package/report.html +3 -3
- package/tsparticles.updater.gradient.js +241 -432
- package/tsparticles.updater.gradient.min.js +1 -1
- package/tsparticles.updater.gradient.min.js.LICENSE.txt +1 -1
- package/types/GradientUpdater.d.ts +2 -2
- package/types/Types.d.ts +2 -2
- package/umd/GradientUpdater.js +45 -17
- package/umd/Utils.js +5 -98
- package/umd/index.js +29 -3
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see tsparticles.updater.gradient.min.js.LICENSE.txt */
|
|
2
|
-
!function(e,
|
|
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 r="object"==typeof exports?t(require("@tsparticles/engine")):t(e.window);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(this,(e=>(()=>{var t,r,n={533:t=>{t.exports=e}},o={};function i(e){var t=o[e];if(void 0!==t)return t.exports;var r=o[e]={exports:{}};return n[e](r,r.exports,i),r.exports}i.m=n,i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce(((t,r)=>(i.f[r](e,t),t)),[])),i.u=e=>e+".min.js",i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),t={},r="@tsparticles/updater-gradient:",i.l=(e,n,o,a)=>{if(t[e])t[e].push(n);else{var s,d;if(void 0!==o)for(var u=document.getElementsByTagName("script"),c=0;c<u.length;c++){var p=u[c];if(p.getAttribute("src")==e||p.getAttribute("data-webpack")==r+o){s=p;break}}s||(d=!0,(s=document.createElement("script")).charset="utf-8",s.timeout=120,i.nc&&s.setAttribute("nonce",i.nc),s.setAttribute("data-webpack",r+o),s.src=e),t[e]=[n];var l=(r,n)=>{s.onerror=s.onload=null,clearTimeout(f);var o=t[e];if(delete t[e],s.parentNode&&s.parentNode.removeChild(s),o&&o.forEach((e=>e(n))),r)return r(n)},f=setTimeout(l.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=l.bind(null,s.onerror),s.onload=l.bind(null,s.onload),d&&document.head.appendChild(s)}},i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;i.g.importScripts&&(e=i.g.location+"");var t=i.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&!e;)e=r[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=e})(),(()=>{var e={127:0};i.f.j=(t,r)=>{var n=i.o(e,t)?e[t]:void 0;if(0!==n)if(n)r.push(n[2]);else{var o=new Promise(((r,o)=>n=e[t]=[r,o]));r.push(n[2]=o);var a=i.p+i.u(t),s=new Error;i.l(a,(r=>{if(i.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var o=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;s.message="Loading chunk "+t+" failed.\n("+o+": "+a+")",s.name="ChunkLoadError",s.type=o,s.request=a,n[1](s)}}),"chunk-"+t,t)}};var t=(t,r)=>{var n,o,a=r[0],s=r[1],d=r[2],u=0;if(a.some((t=>0!==e[t]))){for(n in s)i.o(s,n)&&(i.m[n]=s[n]);if(d)d(i)}for(t&&t(r);u<a.length;u++)o=a[u],i.o(e,o)&&e[o]&&e[o][0](),e[o]=0},r=this.webpackChunk_tsparticles_updater_gradient=this.webpackChunk_tsparticles_updater_gradient||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var a={};return(()=>{async function e(e,t=!0){await e.addParticleUpdater("gradient",(async()=>{const{GradientUpdater:e}=await i.e(914).then(i.bind(i,914));return new e}),t)}i.r(a),i.d(a,{loadGradientUpdater:()=>e})})(),a})()));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! tsParticles Gradient Updater v3.0
|
|
1
|
+
/*! tsParticles Gradient Updater v3.2.0 by Matteo Bruni */
|
|
@@ -2,8 +2,8 @@ import { type IDelta, type IParticleColorStyle, type IParticleUpdater, type Recu
|
|
|
2
2
|
import type { GradientParticle, GradientParticlesOptions, IGradientParticlesOptions } from "./Types.js";
|
|
3
3
|
export declare class GradientUpdater implements IParticleUpdater {
|
|
4
4
|
getColorStyles(particle: GradientParticle, context: CanvasRenderingContext2D, radius: number, opacity: number): IParticleColorStyle;
|
|
5
|
-
init(particle: GradientParticle): void
|
|
5
|
+
init(particle: GradientParticle): Promise<void>;
|
|
6
6
|
isEnabled(particle: GradientParticle): boolean;
|
|
7
7
|
loadOptions(options: GradientParticlesOptions, ...sources: (RecursivePartial<IGradientParticlesOptions> | undefined)[]): void;
|
|
8
|
-
update(particle: GradientParticle, delta: IDelta): void
|
|
8
|
+
update(particle: GradientParticle, delta: IDelta): Promise<void>;
|
|
9
9
|
}
|
package/types/Types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GradientType, IParticleHslAnimation, IParticleNumericValueAnimation,
|
|
1
|
+
import type { GradientType, IParticleHslAnimation, IParticleNumericValueAnimation, IParticlesOptions, Particle, ParticlesOptions, SingleOrMultiple } from "@tsparticles/engine";
|
|
2
2
|
import type { AnimatableGradient } from "./Options/Classes/AnimatableGradient.js";
|
|
3
3
|
import type { IAnimatableGradient } from "./Options/Interfaces/IAnimatableGradient.js";
|
|
4
4
|
export interface IParticleGradientColorAnimation {
|
|
@@ -7,7 +7,7 @@ export interface IParticleGradientColorAnimation {
|
|
|
7
7
|
value: IParticleHslAnimation;
|
|
8
8
|
}
|
|
9
9
|
export interface IParticleGradientAnimation {
|
|
10
|
-
angle:
|
|
10
|
+
angle: IParticleNumericValueAnimation;
|
|
11
11
|
colors: IParticleGradientColorAnimation[];
|
|
12
12
|
type: GradientType;
|
|
13
13
|
}
|
package/umd/GradientUpdater.js
CHANGED
|
@@ -1,26 +1,50 @@
|
|
|
1
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
2
|
+
if (k2 === undefined) k2 = k;
|
|
3
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
4
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
5
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
6
|
+
}
|
|
7
|
+
Object.defineProperty(o, k2, desc);
|
|
8
|
+
}) : (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
o[k2] = m[k];
|
|
11
|
+
}));
|
|
12
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
13
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
14
|
+
}) : function(o, v) {
|
|
15
|
+
o["default"] = v;
|
|
16
|
+
});
|
|
17
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
18
|
+
if (mod && mod.__esModule) return mod;
|
|
19
|
+
var result = {};
|
|
20
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
21
|
+
__setModuleDefault(result, mod);
|
|
22
|
+
return result;
|
|
23
|
+
};
|
|
1
24
|
(function (factory) {
|
|
2
25
|
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
26
|
var v = factory(require, exports);
|
|
4
27
|
if (v !== undefined) module.exports = v;
|
|
5
28
|
}
|
|
6
29
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "@tsparticles/engine", "./Options/Classes/AnimatableGradient.js"
|
|
30
|
+
define(["require", "exports", "@tsparticles/engine", "./Options/Classes/AnimatableGradient.js"], factory);
|
|
8
31
|
}
|
|
9
32
|
})(function (require, exports) {
|
|
10
33
|
"use strict";
|
|
34
|
+
var __syncRequire = typeof module === "object" && typeof module.exports === "object";
|
|
11
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
36
|
exports.GradientUpdater = void 0;
|
|
13
37
|
const engine_1 = require("@tsparticles/engine");
|
|
14
38
|
const AnimatableGradient_js_1 = require("./Options/Classes/AnimatableGradient.js");
|
|
15
|
-
const
|
|
39
|
+
const double = 2, doublePI = Math.PI * double;
|
|
16
40
|
class GradientUpdater {
|
|
17
41
|
getColorStyles(particle, context, radius, opacity) {
|
|
18
42
|
const gradient = particle.gradient;
|
|
19
43
|
if (!gradient) {
|
|
20
44
|
return {};
|
|
21
45
|
}
|
|
22
|
-
const gradientAngle = gradient.angle.value, fillGradient = gradient.type === "radial"
|
|
23
|
-
? context.createRadialGradient(
|
|
46
|
+
const gradientAngle = gradient.angle.value, origin = { x: 0, y: 0 }, minRadius = 0, fillGradient = gradient.type === "radial"
|
|
47
|
+
? context.createRadialGradient(origin.x, origin.y, minRadius, origin.x, origin.y, radius)
|
|
24
48
|
: context.createLinearGradient(Math.cos(gradientAngle) * -radius, Math.sin(gradientAngle) * -radius, Math.cos(gradientAngle) * radius, Math.sin(gradientAngle) * radius);
|
|
25
49
|
for (const { stop, value, opacity: cOpacity } of gradient.colors) {
|
|
26
50
|
fillGradient.addColorStop(stop, (0, engine_1.getStyleFromHsl)({
|
|
@@ -31,19 +55,21 @@
|
|
|
31
55
|
}
|
|
32
56
|
return { fill: fillGradient };
|
|
33
57
|
}
|
|
34
|
-
init(particle) {
|
|
58
|
+
async init(particle) {
|
|
35
59
|
const gradient = (0, engine_1.itemFromSingleOrMultiple)(particle.options.gradient);
|
|
36
60
|
if (!gradient) {
|
|
37
61
|
return;
|
|
38
62
|
}
|
|
39
|
-
const { angle } = gradient;
|
|
63
|
+
const { angle } = gradient, speedFactor = 360, delayOffset = 1;
|
|
40
64
|
particle.gradient = {
|
|
41
65
|
angle: {
|
|
42
66
|
value: (0, engine_1.getRangeValue)(angle.value),
|
|
43
67
|
enable: angle.animation.enable,
|
|
44
|
-
velocity: ((0, engine_1.getRangeValue)(angle.animation.speed) /
|
|
45
|
-
decay:
|
|
46
|
-
delayTime: (0, engine_1.getRangeValue)(angle.animation.delay) *
|
|
68
|
+
velocity: ((0, engine_1.getRangeValue)(angle.animation.speed) / speedFactor) * particle.container.retina.reduceFactor,
|
|
69
|
+
decay: delayOffset - (0, engine_1.getRangeValue)(angle.animation.decay),
|
|
70
|
+
delayTime: (0, engine_1.getRangeValue)(angle.animation.delay) * engine_1.millisecondsToSeconds,
|
|
71
|
+
max: doublePI,
|
|
72
|
+
min: 0,
|
|
47
73
|
time: 0,
|
|
48
74
|
},
|
|
49
75
|
type: gradient.type,
|
|
@@ -51,7 +77,7 @@
|
|
|
51
77
|
};
|
|
52
78
|
let rotateDirection = gradient.angle.direction;
|
|
53
79
|
if (rotateDirection === "random") {
|
|
54
|
-
rotateDirection = (0, engine_1.getRandom)() >
|
|
80
|
+
rotateDirection = (0, engine_1.getRandom)() > engine_1.halfRandom ? "counter-clockwise" : "clockwise";
|
|
55
81
|
}
|
|
56
82
|
switch (rotateDirection) {
|
|
57
83
|
case "counter-clockwise":
|
|
@@ -78,10 +104,10 @@
|
|
|
78
104
|
min: (0, engine_1.getRangeMin)(grColor.opacity.value),
|
|
79
105
|
status: "increasing",
|
|
80
106
|
value: (0, engine_1.getRangeValue)(grColor.opacity.value),
|
|
81
|
-
velocity: ((0, engine_1.getRangeValue)(grColor.opacity.animation.speed) /
|
|
107
|
+
velocity: ((0, engine_1.getRangeValue)(grColor.opacity.animation.speed) / engine_1.percentDenominator) *
|
|
82
108
|
particle.container.retina.reduceFactor,
|
|
83
|
-
decay:
|
|
84
|
-
delayTime: (0, engine_1.getRangeValue)(grColor.opacity.animation.delay) *
|
|
109
|
+
decay: delayOffset - (0, engine_1.getRangeValue)(grColor.opacity.animation.decay),
|
|
110
|
+
delayTime: (0, engine_1.getRangeValue)(grColor.opacity.animation.delay) * engine_1.millisecondsToSeconds,
|
|
85
111
|
time: 0,
|
|
86
112
|
}
|
|
87
113
|
: undefined,
|
|
@@ -105,17 +131,18 @@
|
|
|
105
131
|
default:
|
|
106
132
|
addOpacity.value = (0, engine_1.randomInRange)(addOpacity);
|
|
107
133
|
addOpacity.status =
|
|
108
|
-
(0, engine_1.getRandom)() >=
|
|
134
|
+
(0, engine_1.getRandom)() >= engine_1.halfRandom ? "increasing" : "decreasing";
|
|
109
135
|
break;
|
|
110
136
|
}
|
|
111
137
|
}
|
|
112
138
|
particle.gradient.colors.push(addColor);
|
|
113
139
|
}
|
|
140
|
+
await Promise.resolve();
|
|
114
141
|
}
|
|
115
142
|
isEnabled(particle) {
|
|
116
143
|
return (!particle.destroyed &&
|
|
117
144
|
!particle.spawning &&
|
|
118
|
-
(particle.gradient?.angle.enable ||
|
|
145
|
+
(!!particle.gradient?.angle.enable ||
|
|
119
146
|
(particle.gradient?.colors.some((c) => c.value.h.enable || c.value.s.enable || c.value.l.enable) ??
|
|
120
147
|
false)));
|
|
121
148
|
}
|
|
@@ -135,8 +162,9 @@
|
|
|
135
162
|
});
|
|
136
163
|
}
|
|
137
164
|
}
|
|
138
|
-
update(particle, delta) {
|
|
139
|
-
(
|
|
165
|
+
async update(particle, delta) {
|
|
166
|
+
const { updateGradient } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./Utils.js"))) : new Promise((resolve_1, reject_1) => { require(["./Utils.js"], resolve_1, reject_1); }).then(__importStar));
|
|
167
|
+
updateGradient(particle, delta);
|
|
140
168
|
}
|
|
141
169
|
}
|
|
142
170
|
exports.GradientUpdater = GradientUpdater;
|
package/umd/Utils.js
CHANGED
|
@@ -4,116 +4,23 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports"], factory);
|
|
7
|
+
define(["require", "exports", "@tsparticles/engine"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.updateGradient = void 0;
|
|
13
|
-
|
|
14
|
-
if (!value.enable) {
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
const decay = value.decay ?? 1;
|
|
18
|
-
switch (value.status) {
|
|
19
|
-
case "increasing":
|
|
20
|
-
if (value.value >= value.max) {
|
|
21
|
-
value.status = "decreasing";
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
value.value += (value.velocity ?? 0) * delta.factor;
|
|
25
|
-
}
|
|
26
|
-
break;
|
|
27
|
-
case "decreasing":
|
|
28
|
-
if (value.value <= value.min) {
|
|
29
|
-
value.status = "increasing";
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
value.value -= (value.velocity ?? 0) * delta.factor;
|
|
33
|
-
}
|
|
34
|
-
break;
|
|
35
|
-
}
|
|
36
|
-
if (value.velocity && decay !== 1) {
|
|
37
|
-
value.velocity *= decay;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
function updateColorValue(delta, colorValue, max, decrease) {
|
|
41
|
-
if (!colorValue || !colorValue.enable) {
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
if (!colorValue.time) {
|
|
45
|
-
colorValue.time = 0;
|
|
46
|
-
}
|
|
47
|
-
if ((colorValue.delayTime ?? 0) > 0 && colorValue.time < (colorValue.delayTime ?? 0)) {
|
|
48
|
-
colorValue.time += delta.value;
|
|
49
|
-
}
|
|
50
|
-
if ((colorValue.delayTime ?? 0) > 0 && colorValue.time < (colorValue.delayTime ?? 0)) {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
const velocity = (colorValue.velocity ?? 0) * delta.factor, decay = colorValue.decay ?? 1;
|
|
54
|
-
if (!decrease || colorValue.status === "increasing") {
|
|
55
|
-
colorValue.value += velocity;
|
|
56
|
-
if (decrease && colorValue.value > max) {
|
|
57
|
-
colorValue.status = "decreasing";
|
|
58
|
-
colorValue.value -= colorValue.value % max;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
colorValue.value -= velocity;
|
|
63
|
-
if (colorValue.value < 0) {
|
|
64
|
-
colorValue.status = "increasing";
|
|
65
|
-
colorValue.value += colorValue.value;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
if (colorValue.value > max) {
|
|
69
|
-
colorValue.value %= max;
|
|
70
|
-
}
|
|
71
|
-
if (colorValue.velocity && decay !== 1) {
|
|
72
|
-
colorValue.velocity *= decay;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
function updateAngle(delta, angle) {
|
|
76
|
-
const speed = (angle.velocity ?? 0) * delta.factor, max = 2 * Math.PI, decay = angle.decay ?? 1;
|
|
77
|
-
if (!angle.enable) {
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
switch (angle.status) {
|
|
81
|
-
case "increasing":
|
|
82
|
-
angle.value += speed;
|
|
83
|
-
if (angle.value > max) {
|
|
84
|
-
angle.value -= max;
|
|
85
|
-
}
|
|
86
|
-
break;
|
|
87
|
-
case "decreasing":
|
|
88
|
-
default:
|
|
89
|
-
angle.value -= speed;
|
|
90
|
-
if (angle.value < 0) {
|
|
91
|
-
angle.value += max;
|
|
92
|
-
}
|
|
93
|
-
break;
|
|
94
|
-
}
|
|
95
|
-
if (angle.velocity && decay !== 1) {
|
|
96
|
-
angle.velocity *= decay;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
13
|
+
const engine_1 = require("@tsparticles/engine");
|
|
99
14
|
function updateGradient(particle, delta) {
|
|
100
15
|
const { gradient } = particle;
|
|
101
16
|
if (!gradient) {
|
|
102
17
|
return;
|
|
103
18
|
}
|
|
104
|
-
|
|
19
|
+
(0, engine_1.updateAnimation)(particle, gradient.angle, false, "none", delta);
|
|
105
20
|
for (const color of gradient.colors) {
|
|
106
|
-
|
|
107
|
-
updateColorValue(delta, color.value.h, 360, false);
|
|
108
|
-
}
|
|
109
|
-
if (particle.color?.s !== undefined) {
|
|
110
|
-
updateColorValue(delta, color.value.s, 100, true);
|
|
111
|
-
}
|
|
112
|
-
if (particle.color?.l !== undefined) {
|
|
113
|
-
updateColorValue(delta, color.value.l, 100, true);
|
|
114
|
-
}
|
|
21
|
+
(0, engine_1.updateColor)(color.value, delta);
|
|
115
22
|
if (color.opacity) {
|
|
116
|
-
|
|
23
|
+
(0, engine_1.updateAnimation)(particle, color.opacity, true, "none", delta);
|
|
117
24
|
}
|
|
118
25
|
}
|
|
119
26
|
}
|
package/umd/index.js
CHANGED
|
@@ -1,18 +1,44 @@
|
|
|
1
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
2
|
+
if (k2 === undefined) k2 = k;
|
|
3
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
4
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
5
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
6
|
+
}
|
|
7
|
+
Object.defineProperty(o, k2, desc);
|
|
8
|
+
}) : (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
o[k2] = m[k];
|
|
11
|
+
}));
|
|
12
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
13
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
14
|
+
}) : function(o, v) {
|
|
15
|
+
o["default"] = v;
|
|
16
|
+
});
|
|
17
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
18
|
+
if (mod && mod.__esModule) return mod;
|
|
19
|
+
var result = {};
|
|
20
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
21
|
+
__setModuleDefault(result, mod);
|
|
22
|
+
return result;
|
|
23
|
+
};
|
|
1
24
|
(function (factory) {
|
|
2
25
|
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
26
|
var v = factory(require, exports);
|
|
4
27
|
if (v !== undefined) module.exports = v;
|
|
5
28
|
}
|
|
6
29
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports"
|
|
30
|
+
define(["require", "exports"], factory);
|
|
8
31
|
}
|
|
9
32
|
})(function (require, exports) {
|
|
10
33
|
"use strict";
|
|
34
|
+
var __syncRequire = typeof module === "object" && typeof module.exports === "object";
|
|
11
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
36
|
exports.loadGradientUpdater = void 0;
|
|
13
|
-
const GradientUpdater_js_1 = require("./GradientUpdater.js");
|
|
14
37
|
async function loadGradientUpdater(engine, refresh = true) {
|
|
15
|
-
await engine.addParticleUpdater("gradient", () =>
|
|
38
|
+
await engine.addParticleUpdater("gradient", async () => {
|
|
39
|
+
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));
|
|
40
|
+
return new GradientUpdater();
|
|
41
|
+
}, refresh);
|
|
16
42
|
}
|
|
17
43
|
exports.loadGradientUpdater = loadGradientUpdater;
|
|
18
44
|
});
|