@tsparticles/updater-gradient 4.0.0-beta.12 → 4.0.0-beta.15
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/browser.js +5 -0
- package/browser/index.js +4 -4
- package/browser/index.lazy.js +9 -0
- package/cjs/browser.js +5 -0
- package/cjs/index.js +4 -4
- package/cjs/index.lazy.js +9 -0
- package/esm/browser.js +5 -0
- package/esm/index.js +4 -4
- package/esm/index.lazy.js +9 -0
- package/package.json +9 -2
- package/report.html +4949 -94
- package/tsparticles.updater.gradient.js +343 -310
- package/tsparticles.updater.gradient.min.js +1 -2
- package/types/browser.d.ts +1 -0
- package/types/index.lazy.d.ts +2 -0
- package/558.min.js +0 -1
- package/dist_browser_GradientUpdater_js.js +0 -100
|
@@ -1,317 +1,350 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*/
|
|
9
|
-
/*
|
|
10
|
-
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
11
|
-
* This devtool is neither made for production nor for readable output files.
|
|
12
|
-
* It uses "eval()" calls to create a separate source file in the browser devtools.
|
|
13
|
-
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
|
|
14
|
-
* or disable the default devtool with "devtool: false".
|
|
15
|
-
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
|
|
16
|
-
*/
|
|
17
|
-
(function webpackUniversalModuleDefinition(root, factory) {
|
|
18
|
-
if(typeof exports === 'object' && typeof module === 'object')
|
|
19
|
-
module.exports = factory(require("@tsparticles/engine"));
|
|
20
|
-
else if(typeof define === 'function' && define.amd)
|
|
21
|
-
define(["@tsparticles/engine"], factory);
|
|
22
|
-
else {
|
|
23
|
-
var a = typeof exports === 'object' ? factory(require("@tsparticles/engine")) : factory(root["window"]);
|
|
24
|
-
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
|
|
25
|
-
}
|
|
26
|
-
})(this, (__WEBPACK_EXTERNAL_MODULE__tsparticles_engine__) => {
|
|
27
|
-
return /******/ (() => { // webpackBootstrap
|
|
28
|
-
/******/ "use strict";
|
|
29
|
-
/******/ var __webpack_modules__ = ({
|
|
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.0.0-beta.15 */
|
|
3
|
+
(function (global, factory) {
|
|
4
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tsparticles/engine')) :
|
|
5
|
+
typeof define === 'function' && define.amd ? define(['exports', '@tsparticles/engine'], factory) :
|
|
6
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.__tsParticlesInternals = global.__tsParticlesInternals || {}, global.__tsParticlesInternals.updaters = global.__tsParticlesInternals.updaters || {}, global.__tsParticlesInternals.updaters.gradient = global.__tsParticlesInternals.updaters.gradient || {}), global.__tsParticlesInternals.engine));
|
|
7
|
+
})(this, (function (exports, engine) { 'use strict';
|
|
30
8
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
9
|
+
class GradientColorOpacityAnimation {
|
|
10
|
+
count;
|
|
11
|
+
decay;
|
|
12
|
+
delay;
|
|
13
|
+
enable;
|
|
14
|
+
speed;
|
|
15
|
+
startValue;
|
|
16
|
+
sync;
|
|
17
|
+
constructor() {
|
|
18
|
+
this.count = 0;
|
|
19
|
+
this.enable = false;
|
|
20
|
+
this.speed = 0;
|
|
21
|
+
this.decay = 0;
|
|
22
|
+
this.delay = 0;
|
|
23
|
+
this.sync = false;
|
|
24
|
+
this.startValue = engine.StartValueType.random;
|
|
25
|
+
}
|
|
26
|
+
load(data) {
|
|
27
|
+
if (engine.isNull(data)) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (data.count !== undefined) {
|
|
31
|
+
this.count = engine.setRangeValue(data.count);
|
|
32
|
+
}
|
|
33
|
+
if (data.enable !== undefined) {
|
|
34
|
+
this.enable = data.enable;
|
|
35
|
+
}
|
|
36
|
+
if (data.speed !== undefined) {
|
|
37
|
+
this.speed = engine.setRangeValue(data.speed);
|
|
38
|
+
}
|
|
39
|
+
if (data.sync !== undefined) {
|
|
40
|
+
this.sync = data.sync;
|
|
41
|
+
}
|
|
42
|
+
if (data.startValue !== undefined) {
|
|
43
|
+
this.startValue = data.startValue;
|
|
44
|
+
}
|
|
45
|
+
if (data.decay !== undefined) {
|
|
46
|
+
this.decay = engine.setRangeValue(data.decay);
|
|
47
|
+
}
|
|
48
|
+
if (data.delay !== undefined) {
|
|
49
|
+
this.delay = engine.setRangeValue(data.delay);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
36
53
|
|
|
37
|
-
|
|
54
|
+
class GradientColorOpacity {
|
|
55
|
+
animation;
|
|
56
|
+
value;
|
|
57
|
+
constructor() {
|
|
58
|
+
this.value = 0;
|
|
59
|
+
this.animation = new GradientColorOpacityAnimation();
|
|
60
|
+
}
|
|
61
|
+
load(data) {
|
|
62
|
+
if (engine.isNull(data)) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
this.animation.load(data.animation);
|
|
66
|
+
if (data.value !== undefined) {
|
|
67
|
+
this.value = engine.setRangeValue(data.value);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
38
71
|
|
|
39
|
-
|
|
72
|
+
class AnimatableGradientColor {
|
|
73
|
+
opacity;
|
|
74
|
+
stop;
|
|
75
|
+
value;
|
|
76
|
+
constructor() {
|
|
77
|
+
this.stop = 0;
|
|
78
|
+
this.value = new engine.AnimatableColor();
|
|
79
|
+
}
|
|
80
|
+
load(data) {
|
|
81
|
+
if (engine.isNull(data)) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
if (data.stop !== undefined) {
|
|
85
|
+
this.stop = data.stop;
|
|
86
|
+
}
|
|
87
|
+
this.value = engine.AnimatableColor.create(this.value, data.value);
|
|
88
|
+
if (data.opacity !== undefined) {
|
|
89
|
+
this.opacity = new GradientColorOpacity();
|
|
90
|
+
if (engine.isNumber(data.opacity)) {
|
|
91
|
+
this.opacity.value = data.opacity;
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
this.opacity.load(data.opacity);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
40
99
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
100
|
+
class GradientAngleAnimation {
|
|
101
|
+
count;
|
|
102
|
+
decay;
|
|
103
|
+
delay;
|
|
104
|
+
enable;
|
|
105
|
+
speed;
|
|
106
|
+
sync;
|
|
107
|
+
constructor() {
|
|
108
|
+
this.count = 0;
|
|
109
|
+
this.enable = false;
|
|
110
|
+
this.speed = 0;
|
|
111
|
+
this.decay = 0;
|
|
112
|
+
this.delay = 0;
|
|
113
|
+
this.sync = false;
|
|
114
|
+
}
|
|
115
|
+
load(data) {
|
|
116
|
+
if (engine.isNull(data)) {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
if (data.count !== undefined) {
|
|
120
|
+
this.count = engine.setRangeValue(data.count);
|
|
121
|
+
}
|
|
122
|
+
if (data.enable !== undefined) {
|
|
123
|
+
this.enable = data.enable;
|
|
124
|
+
}
|
|
125
|
+
if (data.speed !== undefined) {
|
|
126
|
+
this.speed = engine.setRangeValue(data.speed);
|
|
127
|
+
}
|
|
128
|
+
if (data.decay !== undefined) {
|
|
129
|
+
this.decay = engine.setRangeValue(data.decay);
|
|
130
|
+
}
|
|
131
|
+
if (data.delay !== undefined) {
|
|
132
|
+
this.delay = engine.setRangeValue(data.delay);
|
|
133
|
+
}
|
|
134
|
+
if (data.sync !== undefined) {
|
|
135
|
+
this.sync = data.sync;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
46
139
|
|
|
47
|
-
|
|
140
|
+
class GradientAngle {
|
|
141
|
+
animation;
|
|
142
|
+
direction;
|
|
143
|
+
value;
|
|
144
|
+
constructor() {
|
|
145
|
+
this.value = 0;
|
|
146
|
+
this.animation = new GradientAngleAnimation();
|
|
147
|
+
this.direction = engine.RotateDirection.clockwise;
|
|
148
|
+
}
|
|
149
|
+
load(data) {
|
|
150
|
+
if (engine.isNull(data)) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
this.animation.load(data.animation);
|
|
154
|
+
if (data.value !== undefined) {
|
|
155
|
+
this.value = engine.setRangeValue(data.value);
|
|
156
|
+
}
|
|
157
|
+
if (data.direction !== undefined) {
|
|
158
|
+
this.direction = data.direction;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
48
162
|
|
|
49
|
-
|
|
163
|
+
class AnimatableGradient {
|
|
164
|
+
angle;
|
|
165
|
+
colors;
|
|
166
|
+
type;
|
|
167
|
+
constructor() {
|
|
168
|
+
this.angle = new GradientAngle();
|
|
169
|
+
this.colors = [];
|
|
170
|
+
this.type = engine.GradientType.random;
|
|
171
|
+
}
|
|
172
|
+
load(data) {
|
|
173
|
+
if (engine.isNull(data)) {
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
this.angle.load(data.angle);
|
|
177
|
+
if (data.colors !== undefined) {
|
|
178
|
+
this.colors = data.colors.map(s => {
|
|
179
|
+
const tmp = new AnimatableGradientColor();
|
|
180
|
+
tmp.load(s);
|
|
181
|
+
return tmp;
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
if (data.type !== undefined) {
|
|
185
|
+
this.type = data.type;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
50
189
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
/******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
|
|
213
|
-
/******/ scriptUrl = scriptUrl.replace(/^blob:/, "").replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
|
|
214
|
-
/******/ __webpack_require__.p = scriptUrl;
|
|
215
|
-
/******/ })();
|
|
216
|
-
/******/
|
|
217
|
-
/******/ /* webpack/runtime/jsonp chunk loading */
|
|
218
|
-
/******/ (() => {
|
|
219
|
-
/******/ // no baseURI
|
|
220
|
-
/******/
|
|
221
|
-
/******/ // object to store loaded and loading chunks
|
|
222
|
-
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
|
|
223
|
-
/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
|
|
224
|
-
/******/ var installedChunks = {
|
|
225
|
-
/******/ "tsparticles.updater.gradient": 0
|
|
226
|
-
/******/ };
|
|
227
|
-
/******/
|
|
228
|
-
/******/ __webpack_require__.f.j = (chunkId, promises) => {
|
|
229
|
-
/******/ // JSONP chunk loading for javascript
|
|
230
|
-
/******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;
|
|
231
|
-
/******/ if(installedChunkData !== 0) { // 0 means "already installed".
|
|
232
|
-
/******/
|
|
233
|
-
/******/ // a Promise means "currently loading".
|
|
234
|
-
/******/ if(installedChunkData) {
|
|
235
|
-
/******/ promises.push(installedChunkData[2]);
|
|
236
|
-
/******/ } else {
|
|
237
|
-
/******/ if(true) { // all chunks have JS
|
|
238
|
-
/******/ // setup Promise in chunk cache
|
|
239
|
-
/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));
|
|
240
|
-
/******/ promises.push(installedChunkData[2] = promise);
|
|
241
|
-
/******/
|
|
242
|
-
/******/ // start chunk loading
|
|
243
|
-
/******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId);
|
|
244
|
-
/******/ // create error before stack unwound to get useful stacktrace later
|
|
245
|
-
/******/ var error = new Error();
|
|
246
|
-
/******/ var loadingEnded = (event) => {
|
|
247
|
-
/******/ if(__webpack_require__.o(installedChunks, chunkId)) {
|
|
248
|
-
/******/ installedChunkData = installedChunks[chunkId];
|
|
249
|
-
/******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined;
|
|
250
|
-
/******/ if(installedChunkData) {
|
|
251
|
-
/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
|
|
252
|
-
/******/ var realSrc = event && event.target && event.target.src;
|
|
253
|
-
/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
|
|
254
|
-
/******/ error.name = 'ChunkLoadError';
|
|
255
|
-
/******/ error.type = errorType;
|
|
256
|
-
/******/ error.request = realSrc;
|
|
257
|
-
/******/ installedChunkData[1](error);
|
|
258
|
-
/******/ }
|
|
259
|
-
/******/ }
|
|
260
|
-
/******/ };
|
|
261
|
-
/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId);
|
|
262
|
-
/******/ }
|
|
263
|
-
/******/ }
|
|
264
|
-
/******/ }
|
|
265
|
-
/******/ };
|
|
266
|
-
/******/
|
|
267
|
-
/******/ // no prefetching
|
|
268
|
-
/******/
|
|
269
|
-
/******/ // no preloaded
|
|
270
|
-
/******/
|
|
271
|
-
/******/ // no HMR
|
|
272
|
-
/******/
|
|
273
|
-
/******/ // no HMR manifest
|
|
274
|
-
/******/
|
|
275
|
-
/******/ // no on chunks loaded
|
|
276
|
-
/******/
|
|
277
|
-
/******/ // install a JSONP callback for chunk loading
|
|
278
|
-
/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
|
|
279
|
-
/******/ var [chunkIds, moreModules, runtime] = data;
|
|
280
|
-
/******/ // add "moreModules" to the modules object,
|
|
281
|
-
/******/ // then flag all "chunkIds" as loaded and fire callback
|
|
282
|
-
/******/ var moduleId, chunkId, i = 0;
|
|
283
|
-
/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
|
|
284
|
-
/******/ for(moduleId in moreModules) {
|
|
285
|
-
/******/ if(__webpack_require__.o(moreModules, moduleId)) {
|
|
286
|
-
/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
|
|
287
|
-
/******/ }
|
|
288
|
-
/******/ }
|
|
289
|
-
/******/ if(runtime) var result = runtime(__webpack_require__);
|
|
290
|
-
/******/ }
|
|
291
|
-
/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
|
|
292
|
-
/******/ for(;i < chunkIds.length; i++) {
|
|
293
|
-
/******/ chunkId = chunkIds[i];
|
|
294
|
-
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
|
|
295
|
-
/******/ installedChunks[chunkId][0]();
|
|
296
|
-
/******/ }
|
|
297
|
-
/******/ installedChunks[chunkId] = 0;
|
|
298
|
-
/******/ }
|
|
299
|
-
/******/
|
|
300
|
-
/******/ }
|
|
301
|
-
/******/
|
|
302
|
-
/******/ var chunkLoadingGlobal = this["webpackChunk_tsparticles_updater_gradient"] = this["webpackChunk_tsparticles_updater_gradient"] || [];
|
|
303
|
-
/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
|
|
304
|
-
/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
|
|
305
|
-
/******/ })();
|
|
306
|
-
/******/
|
|
307
|
-
/************************************************************************/
|
|
308
|
-
/******/
|
|
309
|
-
/******/ // startup
|
|
310
|
-
/******/ // Load entry module and return exports
|
|
311
|
-
/******/ // This entry module can't be inlined because the eval devtool is used.
|
|
312
|
-
/******/ var __webpack_exports__ = __webpack_require__("./dist/browser/index.js");
|
|
313
|
-
/******/
|
|
314
|
-
/******/ return __webpack_exports__;
|
|
315
|
-
/******/ })()
|
|
316
|
-
;
|
|
317
|
-
});
|
|
190
|
+
function updateGradient(particle, delta) {
|
|
191
|
+
const { gradient } = particle;
|
|
192
|
+
if (!gradient) {
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
engine.updateAnimation(particle, gradient.angle, false, engine.DestroyType.none, delta);
|
|
196
|
+
for (const color of gradient.colors) {
|
|
197
|
+
engine.updateColor(color.value, delta);
|
|
198
|
+
if (color.opacity) {
|
|
199
|
+
engine.updateAnimation(particle, color.opacity, true, engine.DestroyType.none, delta);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
class GradientUpdater {
|
|
205
|
+
_container;
|
|
206
|
+
_pluginManager;
|
|
207
|
+
constructor(pluginManager, container) {
|
|
208
|
+
this._pluginManager = pluginManager;
|
|
209
|
+
this._container = container;
|
|
210
|
+
}
|
|
211
|
+
getColorStyles(particle, context, radius, opacity) {
|
|
212
|
+
const gradient = particle.gradient;
|
|
213
|
+
if (!gradient) {
|
|
214
|
+
return {};
|
|
215
|
+
}
|
|
216
|
+
const { _container: container } = this, gradientAngle = gradient.angle.value, origin = { x: 0, y: 0 }, minRadius = 0, fillGradient = gradient.type === engine.GradientType.radial
|
|
217
|
+
? context.createRadialGradient(origin.x, origin.y, minRadius, origin.x, origin.y, radius)
|
|
218
|
+
: context.createLinearGradient(Math.cos(gradientAngle) * -radius, Math.sin(gradientAngle) * -radius, Math.cos(gradientAngle) * radius, Math.sin(gradientAngle) * radius);
|
|
219
|
+
for (const { stop, value, opacity: cOpacity } of gradient.colors) {
|
|
220
|
+
const hsl = {
|
|
221
|
+
h: value.h.value,
|
|
222
|
+
s: value.s.value,
|
|
223
|
+
l: value.l.value,
|
|
224
|
+
};
|
|
225
|
+
fillGradient.addColorStop(stop, engine.getStyleFromHsl(hsl, container.hdr, cOpacity?.value ?? opacity));
|
|
226
|
+
}
|
|
227
|
+
return { fill: fillGradient };
|
|
228
|
+
}
|
|
229
|
+
init(particle) {
|
|
230
|
+
const gradient = engine.itemFromSingleOrMultiple(particle.options.gradient);
|
|
231
|
+
if (!gradient) {
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
const container = this._container, { angle } = gradient, speedFactor = 360, delayOffset = 1;
|
|
235
|
+
particle.gradient = {
|
|
236
|
+
angle: {
|
|
237
|
+
value: engine.getRangeValue(angle.value),
|
|
238
|
+
enable: angle.animation.enable,
|
|
239
|
+
velocity: (engine.getRangeValue(angle.animation.speed) / speedFactor) * container.retina.reduceFactor,
|
|
240
|
+
decay: delayOffset - engine.getRangeValue(angle.animation.decay),
|
|
241
|
+
delayTime: engine.getRangeValue(angle.animation.delay) * engine.millisecondsToSeconds,
|
|
242
|
+
max: engine.doublePI,
|
|
243
|
+
min: 0,
|
|
244
|
+
time: 0,
|
|
245
|
+
},
|
|
246
|
+
type: gradient.type,
|
|
247
|
+
colors: [],
|
|
248
|
+
};
|
|
249
|
+
let rotateDirection = gradient.angle.direction;
|
|
250
|
+
if (rotateDirection === engine.RotateDirection.random) {
|
|
251
|
+
rotateDirection = engine.getRandom() > engine.half ? engine.RotateDirection.counterClockwise : engine.RotateDirection.clockwise;
|
|
252
|
+
}
|
|
253
|
+
switch (rotateDirection) {
|
|
254
|
+
case engine.RotateDirection.counterClockwise:
|
|
255
|
+
case "counterClockwise":
|
|
256
|
+
particle.gradient.angle.status = engine.AnimationStatus.decreasing;
|
|
257
|
+
break;
|
|
258
|
+
case engine.RotateDirection.clockwise:
|
|
259
|
+
particle.gradient.angle.status = engine.AnimationStatus.increasing;
|
|
260
|
+
break;
|
|
261
|
+
}
|
|
262
|
+
const reduceDuplicates = particle.options.reduceDuplicates;
|
|
263
|
+
for (const grColor of gradient.colors) {
|
|
264
|
+
const grHslColor = engine.rangeColorToHsl(this._pluginManager, grColor.value, particle.id, reduceDuplicates);
|
|
265
|
+
if (!grHslColor) {
|
|
266
|
+
continue;
|
|
267
|
+
}
|
|
268
|
+
const grHslAnimation = engine.getHslAnimationFromHsl(grHslColor, grColor.value.animation, container.retina.reduceFactor), addColor = {
|
|
269
|
+
stop: grColor.stop,
|
|
270
|
+
value: grHslAnimation,
|
|
271
|
+
opacity: grColor.opacity
|
|
272
|
+
? {
|
|
273
|
+
enable: grColor.opacity.animation.enable,
|
|
274
|
+
max: engine.getRangeMax(grColor.opacity.value),
|
|
275
|
+
min: engine.getRangeMin(grColor.opacity.value),
|
|
276
|
+
status: engine.AnimationStatus.increasing,
|
|
277
|
+
value: engine.getRangeValue(grColor.opacity.value),
|
|
278
|
+
velocity: (engine.getRangeValue(grColor.opacity.animation.speed) / engine.percentDenominator) * container.retina.reduceFactor,
|
|
279
|
+
decay: delayOffset - engine.getRangeValue(grColor.opacity.animation.decay),
|
|
280
|
+
delayTime: engine.getRangeValue(grColor.opacity.animation.delay) * engine.millisecondsToSeconds,
|
|
281
|
+
time: 0,
|
|
282
|
+
}
|
|
283
|
+
: undefined,
|
|
284
|
+
}, { opacity: addOpacity } = addColor;
|
|
285
|
+
if (grColor.opacity && addOpacity) {
|
|
286
|
+
const opacityRange = grColor.opacity.value;
|
|
287
|
+
addOpacity.min = engine.getRangeMin(opacityRange);
|
|
288
|
+
addOpacity.max = engine.getRangeMax(opacityRange);
|
|
289
|
+
const opacityAnimation = grColor.opacity.animation;
|
|
290
|
+
switch (opacityAnimation.startValue) {
|
|
291
|
+
case engine.StartValueType.min:
|
|
292
|
+
addOpacity.value = addOpacity.min;
|
|
293
|
+
addOpacity.status = engine.AnimationStatus.increasing;
|
|
294
|
+
break;
|
|
295
|
+
case engine.StartValueType.max:
|
|
296
|
+
addOpacity.value = addOpacity.max;
|
|
297
|
+
addOpacity.status = engine.AnimationStatus.decreasing;
|
|
298
|
+
break;
|
|
299
|
+
case engine.StartValueType.random:
|
|
300
|
+
default:
|
|
301
|
+
addOpacity.value = engine.randomInRangeValue(addOpacity);
|
|
302
|
+
addOpacity.status = engine.getRandom() >= engine.half ? engine.AnimationStatus.increasing : engine.AnimationStatus.decreasing;
|
|
303
|
+
break;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
particle.gradient.colors.push(addColor);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
isEnabled(particle) {
|
|
310
|
+
return (!particle.destroyed &&
|
|
311
|
+
!particle.spawning &&
|
|
312
|
+
(!!particle.gradient?.angle.enable ||
|
|
313
|
+
(particle.gradient?.colors.some(c => c.value.h.enable || c.value.s.enable || c.value.l.enable) ?? false)));
|
|
314
|
+
}
|
|
315
|
+
loadOptions(options, ...sources) {
|
|
316
|
+
for (const source of sources) {
|
|
317
|
+
if (!source?.gradient) {
|
|
318
|
+
continue;
|
|
319
|
+
}
|
|
320
|
+
const gradientToLoad = source.gradient;
|
|
321
|
+
options.gradient = engine.executeOnSingleOrMultiple(gradientToLoad, gradient => {
|
|
322
|
+
const tmp = new AnimatableGradient();
|
|
323
|
+
tmp.load(gradient);
|
|
324
|
+
return tmp;
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
update(particle, delta) {
|
|
329
|
+
updateGradient(particle, delta);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
async function loadGradientUpdater(engine) {
|
|
334
|
+
engine.checkVersion("4.0.0-beta.15");
|
|
335
|
+
await engine.pluginManager.register(e => {
|
|
336
|
+
e.pluginManager.addParticleUpdater("gradient", container => {
|
|
337
|
+
return Promise.resolve(new GradientUpdater(e.pluginManager, container));
|
|
338
|
+
});
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
const globalObject = globalThis;
|
|
343
|
+
globalObject.__tsParticlesInternals = globalObject.__tsParticlesInternals ?? {};
|
|
344
|
+
globalObject.loadGradientUpdater = loadGradientUpdater;
|
|
345
|
+
|
|
346
|
+
exports.loadGradientUpdater = loadGradientUpdater;
|
|
347
|
+
|
|
348
|
+
}));
|
|
349
|
+
Object.assign(globalThis.window || globalThis, { loadGradientUpdater: (globalThis.__tsParticlesInternals.updaters.gradient || {}).loadGradientUpdater });
|
|
350
|
+
delete (globalThis.window || globalThis).tsparticlesInternalExports;
|