@tsparticles/updater-gradient 3.0.0-alpha.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/LICENSE +21 -0
- package/README.md +70 -0
- package/browser/GradientUpdater.js +227 -0
- package/browser/Options/Classes/AnimatableGradient.js +25 -0
- package/browser/Options/Classes/AnimatableGradientColor.js +26 -0
- package/browser/Options/Classes/GradientAngle.js +20 -0
- package/browser/Options/Classes/GradientAngleAnimation.js +30 -0
- package/browser/Options/Classes/GradientColorOpacity.js +17 -0
- package/browser/Options/Classes/GradientColorOpacityAnimation.js +31 -0
- package/browser/Options/Interfaces/Gradients.js +1 -0
- package/browser/Options/Interfaces/IAnimatableGradient.js +1 -0
- package/browser/Options/Interfaces/IOptionsGradient.js +1 -0
- package/browser/index.js +4 -0
- package/cjs/GradientUpdater.js +231 -0
- package/cjs/Options/Classes/AnimatableGradient.js +29 -0
- package/cjs/Options/Classes/AnimatableGradientColor.js +30 -0
- package/cjs/Options/Classes/GradientAngle.js +24 -0
- package/cjs/Options/Classes/GradientAngleAnimation.js +34 -0
- package/cjs/Options/Classes/GradientColorOpacity.js +21 -0
- package/cjs/Options/Classes/GradientColorOpacityAnimation.js +35 -0
- package/cjs/Options/Interfaces/Gradients.js +2 -0
- package/cjs/Options/Interfaces/IAnimatableGradient.js +2 -0
- package/cjs/Options/Interfaces/IOptionsGradient.js +2 -0
- package/cjs/index.js +8 -0
- package/esm/GradientUpdater.js +227 -0
- package/esm/Options/Classes/AnimatableGradient.js +25 -0
- package/esm/Options/Classes/AnimatableGradientColor.js +26 -0
- package/esm/Options/Classes/GradientAngle.js +20 -0
- package/esm/Options/Classes/GradientAngleAnimation.js +30 -0
- package/esm/Options/Classes/GradientColorOpacity.js +17 -0
- package/esm/Options/Classes/GradientColorOpacityAnimation.js +31 -0
- package/esm/Options/Interfaces/Gradients.js +1 -0
- package/esm/Options/Interfaces/IAnimatableGradient.js +1 -0
- package/esm/Options/Interfaces/IOptionsGradient.js +1 -0
- package/esm/index.js +4 -0
- package/package.json +92 -0
- package/report.html +39 -0
- package/tsparticles.updater.gradient.js +486 -0
- package/tsparticles.updater.gradient.min.js +2 -0
- package/tsparticles.updater.gradient.min.js.LICENSE.txt +8 -0
- package/types/GradientUpdater.d.ts +32 -0
- package/types/Options/Classes/AnimatableGradient.d.ts +12 -0
- package/types/Options/Classes/AnimatableGradientColor.d.ts +11 -0
- package/types/Options/Classes/GradientAngle.d.ts +11 -0
- package/types/Options/Classes/GradientAngleAnimation.d.ts +10 -0
- package/types/Options/Classes/GradientColorOpacity.d.ts +10 -0
- package/types/Options/Classes/GradientColorOpacityAnimation.d.ts +13 -0
- package/types/Options/Interfaces/Gradients.d.ts +18 -0
- package/types/Options/Interfaces/IAnimatableGradient.d.ts +7 -0
- package/types/Options/Interfaces/IOptionsGradient.d.ts +10 -0
- package/types/index.d.ts +2 -0
- package/umd/GradientUpdater.js +241 -0
- package/umd/Options/Classes/AnimatableGradient.js +39 -0
- package/umd/Options/Classes/AnimatableGradientColor.js +40 -0
- package/umd/Options/Classes/GradientAngle.js +34 -0
- package/umd/Options/Classes/GradientAngleAnimation.js +44 -0
- package/umd/Options/Classes/GradientColorOpacity.js +31 -0
- package/umd/Options/Classes/GradientColorOpacityAnimation.js +45 -0
- package/umd/Options/Interfaces/Gradients.js +12 -0
- package/umd/Options/Interfaces/IAnimatableGradient.js +12 -0
- package/umd/Options/Interfaces/IOptionsGradient.js +12 -0
- package/umd/index.js +18 -0
|
@@ -0,0 +1,486 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Author : Matteo Bruni
|
|
3
|
+
* MIT license: https://opensource.org/licenses/MIT
|
|
4
|
+
* Demo / Generator : https://particles.js.org/
|
|
5
|
+
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
|
+
* How to use? : Check the GitHub README
|
|
7
|
+
* v3.0.0-alpha.0
|
|
8
|
+
*/
|
|
9
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
|
10
|
+
if(typeof exports === 'object' && typeof module === 'object')
|
|
11
|
+
module.exports = factory(require("@tsparticles/engine"));
|
|
12
|
+
else if(typeof define === 'function' && define.amd)
|
|
13
|
+
define(["@tsparticles/engine"], factory);
|
|
14
|
+
else {
|
|
15
|
+
var a = typeof exports === 'object' ? factory(require("@tsparticles/engine")) : factory(root["window"]);
|
|
16
|
+
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
|
|
17
|
+
}
|
|
18
|
+
})(this, (__WEBPACK_EXTERNAL_MODULE__533__) => {
|
|
19
|
+
return /******/ (() => { // webpackBootstrap
|
|
20
|
+
/******/ "use strict";
|
|
21
|
+
/******/ var __webpack_modules__ = ({
|
|
22
|
+
|
|
23
|
+
/***/ 533:
|
|
24
|
+
/***/ ((module) => {
|
|
25
|
+
|
|
26
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__533__;
|
|
27
|
+
|
|
28
|
+
/***/ })
|
|
29
|
+
|
|
30
|
+
/******/ });
|
|
31
|
+
/************************************************************************/
|
|
32
|
+
/******/ // The module cache
|
|
33
|
+
/******/ var __webpack_module_cache__ = {};
|
|
34
|
+
/******/
|
|
35
|
+
/******/ // The require function
|
|
36
|
+
/******/ function __webpack_require__(moduleId) {
|
|
37
|
+
/******/ // Check if module is in cache
|
|
38
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
39
|
+
/******/ if (cachedModule !== undefined) {
|
|
40
|
+
/******/ return cachedModule.exports;
|
|
41
|
+
/******/ }
|
|
42
|
+
/******/ // Create a new module (and put it into the cache)
|
|
43
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
44
|
+
/******/ // no module.id needed
|
|
45
|
+
/******/ // no module.loaded needed
|
|
46
|
+
/******/ exports: {}
|
|
47
|
+
/******/ };
|
|
48
|
+
/******/
|
|
49
|
+
/******/ // Execute the module function
|
|
50
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
51
|
+
/******/
|
|
52
|
+
/******/ // Return the exports of the module
|
|
53
|
+
/******/ return module.exports;
|
|
54
|
+
/******/ }
|
|
55
|
+
/******/
|
|
56
|
+
/************************************************************************/
|
|
57
|
+
/******/ /* webpack/runtime/define property getters */
|
|
58
|
+
/******/ (() => {
|
|
59
|
+
/******/ // define getter functions for harmony exports
|
|
60
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
|
61
|
+
/******/ for(var key in definition) {
|
|
62
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
63
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
64
|
+
/******/ }
|
|
65
|
+
/******/ }
|
|
66
|
+
/******/ };
|
|
67
|
+
/******/ })();
|
|
68
|
+
/******/
|
|
69
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
70
|
+
/******/ (() => {
|
|
71
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
72
|
+
/******/ })();
|
|
73
|
+
/******/
|
|
74
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
75
|
+
/******/ (() => {
|
|
76
|
+
/******/ // define __esModule on exports
|
|
77
|
+
/******/ __webpack_require__.r = (exports) => {
|
|
78
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
79
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
80
|
+
/******/ }
|
|
81
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
82
|
+
/******/ };
|
|
83
|
+
/******/ })();
|
|
84
|
+
/******/
|
|
85
|
+
/************************************************************************/
|
|
86
|
+
var __webpack_exports__ = {};
|
|
87
|
+
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
|
88
|
+
(() => {
|
|
89
|
+
// ESM COMPAT FLAG
|
|
90
|
+
__webpack_require__.r(__webpack_exports__);
|
|
91
|
+
|
|
92
|
+
// EXPORTS
|
|
93
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
94
|
+
"loadGradientUpdater": () => (/* binding */ loadGradientUpdater)
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
// EXTERNAL MODULE: external {"commonjs":"@tsparticles/engine","commonjs2":"@tsparticles/engine","amd":"@tsparticles/engine","root":"window"}
|
|
98
|
+
var engine_root_window_ = __webpack_require__(533);
|
|
99
|
+
;// CONCATENATED MODULE: ./dist/browser/Options/Classes/GradientColorOpacityAnimation.js
|
|
100
|
+
|
|
101
|
+
class GradientColorOpacityAnimation {
|
|
102
|
+
constructor() {
|
|
103
|
+
this.count = 0;
|
|
104
|
+
this.enable = false;
|
|
105
|
+
this.speed = 0;
|
|
106
|
+
this.decay = 0;
|
|
107
|
+
this.sync = false;
|
|
108
|
+
this.startValue = "random";
|
|
109
|
+
}
|
|
110
|
+
load(data) {
|
|
111
|
+
if (!data) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
if (data.count !== undefined) {
|
|
115
|
+
this.count = (0,engine_root_window_.setRangeValue)(data.count);
|
|
116
|
+
}
|
|
117
|
+
if (data.enable !== undefined) {
|
|
118
|
+
this.enable = data.enable;
|
|
119
|
+
}
|
|
120
|
+
if (data.speed !== undefined) {
|
|
121
|
+
this.speed = (0,engine_root_window_.setRangeValue)(data.speed);
|
|
122
|
+
}
|
|
123
|
+
if (data.sync !== undefined) {
|
|
124
|
+
this.sync = data.sync;
|
|
125
|
+
}
|
|
126
|
+
if (data.startValue !== undefined) {
|
|
127
|
+
this.startValue = data.startValue;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
;// CONCATENATED MODULE: ./dist/browser/Options/Classes/GradientColorOpacity.js
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
class GradientColorOpacity {
|
|
135
|
+
constructor() {
|
|
136
|
+
this.value = 0;
|
|
137
|
+
this.animation = new GradientColorOpacityAnimation();
|
|
138
|
+
}
|
|
139
|
+
load(data) {
|
|
140
|
+
if (!data) {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
this.animation.load(data.animation);
|
|
144
|
+
if (data.value !== undefined) {
|
|
145
|
+
this.value = (0,engine_root_window_.setRangeValue)(data.value);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
;// CONCATENATED MODULE: ./dist/browser/Options/Classes/AnimatableGradientColor.js
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
class AnimatableGradientColor {
|
|
153
|
+
constructor() {
|
|
154
|
+
this.stop = 0;
|
|
155
|
+
this.value = new engine_root_window_.AnimatableColor();
|
|
156
|
+
}
|
|
157
|
+
load(data) {
|
|
158
|
+
if (!data) {
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
if (data.stop !== undefined) {
|
|
162
|
+
this.stop = data.stop;
|
|
163
|
+
}
|
|
164
|
+
this.value = engine_root_window_.AnimatableColor.create(this.value, data.value);
|
|
165
|
+
if (data.opacity !== undefined) {
|
|
166
|
+
this.opacity = new GradientColorOpacity();
|
|
167
|
+
if (typeof data.opacity === "number") {
|
|
168
|
+
this.opacity.value = data.opacity;
|
|
169
|
+
} else {
|
|
170
|
+
this.opacity.load(data.opacity);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
;// CONCATENATED MODULE: ./dist/browser/Options/Classes/GradientAngleAnimation.js
|
|
176
|
+
|
|
177
|
+
class GradientAngleAnimation {
|
|
178
|
+
constructor() {
|
|
179
|
+
this.count = 0;
|
|
180
|
+
this.enable = false;
|
|
181
|
+
this.speed = 0;
|
|
182
|
+
this.decay = 0;
|
|
183
|
+
this.sync = false;
|
|
184
|
+
}
|
|
185
|
+
load(data) {
|
|
186
|
+
if (!data) {
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
if (data.count !== undefined) {
|
|
190
|
+
this.count = (0,engine_root_window_.setRangeValue)(data.count);
|
|
191
|
+
}
|
|
192
|
+
if (data.enable !== undefined) {
|
|
193
|
+
this.enable = data.enable;
|
|
194
|
+
}
|
|
195
|
+
if (data.speed !== undefined) {
|
|
196
|
+
this.speed = (0,engine_root_window_.setRangeValue)(data.speed);
|
|
197
|
+
}
|
|
198
|
+
if (data.decay !== undefined) {
|
|
199
|
+
this.decay = (0,engine_root_window_.setRangeValue)(data.decay);
|
|
200
|
+
}
|
|
201
|
+
if (data.sync !== undefined) {
|
|
202
|
+
this.sync = data.sync;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
;// CONCATENATED MODULE: ./dist/browser/Options/Classes/GradientAngle.js
|
|
207
|
+
|
|
208
|
+
class GradientAngle {
|
|
209
|
+
constructor() {
|
|
210
|
+
this.value = 0;
|
|
211
|
+
this.animation = new GradientAngleAnimation();
|
|
212
|
+
this.direction = "clockwise";
|
|
213
|
+
}
|
|
214
|
+
load(data) {
|
|
215
|
+
if (!data) {
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
this.animation.load(data.animation);
|
|
219
|
+
if (data.value !== undefined) {
|
|
220
|
+
this.value = data.value;
|
|
221
|
+
}
|
|
222
|
+
if (data.direction !== undefined) {
|
|
223
|
+
this.direction = data.direction;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
;// CONCATENATED MODULE: ./dist/browser/Options/Classes/AnimatableGradient.js
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
class AnimatableGradient {
|
|
231
|
+
constructor() {
|
|
232
|
+
this.angle = new GradientAngle();
|
|
233
|
+
this.colors = [];
|
|
234
|
+
this.type = "random";
|
|
235
|
+
}
|
|
236
|
+
load(data) {
|
|
237
|
+
if (!data) {
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
this.angle.load(data.angle);
|
|
241
|
+
if (data.colors !== undefined) {
|
|
242
|
+
this.colors = data.colors.map(s => {
|
|
243
|
+
const tmp = new AnimatableGradientColor();
|
|
244
|
+
tmp.load(s);
|
|
245
|
+
return tmp;
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
if (data.type !== undefined) {
|
|
249
|
+
this.type = data.type;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
;// CONCATENATED MODULE: ./dist/browser/GradientUpdater.js
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
function updateColorOpacity(delta, value) {
|
|
257
|
+
var _a, _b, _c;
|
|
258
|
+
if (!value.enable) {
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
const decay = (_a = value.decay) !== null && _a !== void 0 ? _a : 1;
|
|
262
|
+
switch (value.status) {
|
|
263
|
+
case "increasing":
|
|
264
|
+
if (value.value >= value.max) {
|
|
265
|
+
value.status = "decreasing";
|
|
266
|
+
} else {
|
|
267
|
+
value.value += ((_b = value.velocity) !== null && _b !== void 0 ? _b : 0) * delta.factor;
|
|
268
|
+
}
|
|
269
|
+
break;
|
|
270
|
+
case "decreasing":
|
|
271
|
+
if (value.value <= value.min) {
|
|
272
|
+
value.status = "increasing";
|
|
273
|
+
} else {
|
|
274
|
+
value.value -= ((_c = value.velocity) !== null && _c !== void 0 ? _c : 0) * delta.factor;
|
|
275
|
+
}
|
|
276
|
+
break;
|
|
277
|
+
}
|
|
278
|
+
if (value.velocity && decay !== 1) {
|
|
279
|
+
value.velocity *= decay;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
function updateColorValue(delta, value, max, decrease) {
|
|
283
|
+
var _a, _b;
|
|
284
|
+
const colorValue = value;
|
|
285
|
+
if (!colorValue || !colorValue.enable) {
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
const velocity = ((_a = value.velocity) !== null && _a !== void 0 ? _a : 0) * delta.factor,
|
|
289
|
+
decay = (_b = value.decay) !== null && _b !== void 0 ? _b : 1;
|
|
290
|
+
if (!decrease || colorValue.status === "increasing") {
|
|
291
|
+
colorValue.value += velocity;
|
|
292
|
+
if (decrease && colorValue.value > max) {
|
|
293
|
+
colorValue.status = "decreasing";
|
|
294
|
+
colorValue.value -= colorValue.value % max;
|
|
295
|
+
}
|
|
296
|
+
} else {
|
|
297
|
+
colorValue.value -= velocity;
|
|
298
|
+
if (colorValue.value < 0) {
|
|
299
|
+
colorValue.status = "increasing";
|
|
300
|
+
colorValue.value += colorValue.value;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
if (colorValue.value > max) {
|
|
304
|
+
colorValue.value %= max;
|
|
305
|
+
}
|
|
306
|
+
if (value.velocity && decay !== 1) {
|
|
307
|
+
value.velocity *= decay;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
function updateAngle(delta, angle) {
|
|
311
|
+
var _a, _b;
|
|
312
|
+
const speed = ((_a = angle.velocity) !== null && _a !== void 0 ? _a : 0) * delta.factor,
|
|
313
|
+
max = 2 * Math.PI,
|
|
314
|
+
decay = (_b = angle.decay) !== null && _b !== void 0 ? _b : 1;
|
|
315
|
+
if (!angle.enable) {
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
switch (angle.status) {
|
|
319
|
+
case "increasing":
|
|
320
|
+
angle.value += speed;
|
|
321
|
+
if (angle.value > max) {
|
|
322
|
+
angle.value -= max;
|
|
323
|
+
}
|
|
324
|
+
break;
|
|
325
|
+
case "decreasing":
|
|
326
|
+
default:
|
|
327
|
+
angle.value -= speed;
|
|
328
|
+
if (angle.value < 0) {
|
|
329
|
+
angle.value += max;
|
|
330
|
+
}
|
|
331
|
+
break;
|
|
332
|
+
}
|
|
333
|
+
if (angle.velocity && decay !== 1) {
|
|
334
|
+
angle.velocity *= decay;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
function updateGradient(particle, delta) {
|
|
338
|
+
var _a, _b, _c;
|
|
339
|
+
const gradient = particle.gradient;
|
|
340
|
+
if (!gradient) {
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
updateAngle(delta, gradient.angle);
|
|
344
|
+
for (const color of gradient.colors) {
|
|
345
|
+
if (((_a = particle.color) === null || _a === void 0 ? void 0 : _a.h) !== undefined) {
|
|
346
|
+
updateColorValue(delta, color.value.h, 360, false);
|
|
347
|
+
}
|
|
348
|
+
if (((_b = particle.color) === null || _b === void 0 ? void 0 : _b.s) !== undefined) {
|
|
349
|
+
updateColorValue(delta, color.value.s, 100, true);
|
|
350
|
+
}
|
|
351
|
+
if (((_c = particle.color) === null || _c === void 0 ? void 0 : _c.l) !== undefined) {
|
|
352
|
+
updateColorValue(delta, color.value.l, 100, true);
|
|
353
|
+
}
|
|
354
|
+
if (color.opacity) {
|
|
355
|
+
updateColorOpacity(delta, color.opacity);
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
class GradientUpdater {
|
|
360
|
+
getColorStyles(particle, context, radius, opacity) {
|
|
361
|
+
var _a, _b;
|
|
362
|
+
const gradient = particle.gradient;
|
|
363
|
+
if (!gradient) {
|
|
364
|
+
return {};
|
|
365
|
+
}
|
|
366
|
+
const gradientAngle = gradient.angle.value,
|
|
367
|
+
fillGradient = gradient.type === "radial" ? context.createRadialGradient(0, 0, 0, 0, 0, radius) : context.createLinearGradient(Math.cos(gradientAngle) * -radius, Math.sin(gradientAngle) * -radius, Math.cos(gradientAngle) * radius, Math.sin(gradientAngle) * radius);
|
|
368
|
+
for (const color of gradient.colors) {
|
|
369
|
+
fillGradient.addColorStop(color.stop, (0,engine_root_window_.getStyleFromHsl)({
|
|
370
|
+
h: color.value.h.value,
|
|
371
|
+
s: color.value.s.value,
|
|
372
|
+
l: color.value.l.value
|
|
373
|
+
}, (_b = (_a = color.opacity) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : opacity));
|
|
374
|
+
}
|
|
375
|
+
return {
|
|
376
|
+
fill: fillGradient
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
init(particle) {
|
|
380
|
+
const gradient = (0,engine_root_window_.itemFromSingleOrMultiple)(particle.options.gradient);
|
|
381
|
+
if (!gradient) {
|
|
382
|
+
return;
|
|
383
|
+
}
|
|
384
|
+
particle.gradient = {
|
|
385
|
+
angle: {
|
|
386
|
+
value: gradient.angle.value,
|
|
387
|
+
enable: gradient.angle.animation.enable,
|
|
388
|
+
velocity: (0,engine_root_window_.getRangeValue)(gradient.angle.animation.speed) / 360 * particle.container.retina.reduceFactor,
|
|
389
|
+
decay: 1 - (0,engine_root_window_.getRangeValue)(gradient.angle.animation.decay)
|
|
390
|
+
},
|
|
391
|
+
type: gradient.type,
|
|
392
|
+
colors: []
|
|
393
|
+
};
|
|
394
|
+
let rotateDirection = gradient.angle.direction;
|
|
395
|
+
if (rotateDirection === "random") {
|
|
396
|
+
const index = Math.floor((0,engine_root_window_.getRandom)() * 2);
|
|
397
|
+
rotateDirection = index > 0 ? "counter-clockwise" : "clockwise";
|
|
398
|
+
}
|
|
399
|
+
switch (rotateDirection) {
|
|
400
|
+
case "counter-clockwise":
|
|
401
|
+
case "counterClockwise":
|
|
402
|
+
particle.gradient.angle.status = "decreasing";
|
|
403
|
+
break;
|
|
404
|
+
case "clockwise":
|
|
405
|
+
particle.gradient.angle.status = "increasing";
|
|
406
|
+
break;
|
|
407
|
+
}
|
|
408
|
+
const reduceDuplicates = particle.options.reduceDuplicates;
|
|
409
|
+
for (const grColor of gradient.colors) {
|
|
410
|
+
const grHslColor = (0,engine_root_window_.rangeColorToHsl)(grColor.value, particle.id, reduceDuplicates);
|
|
411
|
+
if (!grHslColor) {
|
|
412
|
+
continue;
|
|
413
|
+
}
|
|
414
|
+
const grHslAnimation = (0,engine_root_window_.getHslAnimationFromHsl)(grHslColor, grColor.value.animation, particle.container.retina.reduceFactor),
|
|
415
|
+
addColor = {
|
|
416
|
+
stop: grColor.stop,
|
|
417
|
+
value: grHslAnimation,
|
|
418
|
+
opacity: grColor.opacity ? {
|
|
419
|
+
enable: grColor.opacity.animation.enable,
|
|
420
|
+
max: (0,engine_root_window_.getRangeMax)(grColor.opacity.value),
|
|
421
|
+
min: (0,engine_root_window_.getRangeMin)(grColor.opacity.value),
|
|
422
|
+
status: "increasing",
|
|
423
|
+
value: (0,engine_root_window_.getRangeValue)(grColor.opacity.value),
|
|
424
|
+
velocity: (0,engine_root_window_.getRangeValue)(grColor.opacity.animation.speed) / 100 * particle.container.retina.reduceFactor,
|
|
425
|
+
decay: 1 - (0,engine_root_window_.getRangeValue)(grColor.opacity.animation.decay)
|
|
426
|
+
} : undefined
|
|
427
|
+
};
|
|
428
|
+
if (grColor.opacity && addColor.opacity) {
|
|
429
|
+
const opacityRange = grColor.opacity.value;
|
|
430
|
+
addColor.opacity.min = (0,engine_root_window_.getRangeMin)(opacityRange);
|
|
431
|
+
addColor.opacity.max = (0,engine_root_window_.getRangeMax)(opacityRange);
|
|
432
|
+
const opacityAnimation = grColor.opacity.animation;
|
|
433
|
+
switch (opacityAnimation.startValue) {
|
|
434
|
+
case "min":
|
|
435
|
+
addColor.opacity.value = addColor.opacity.min;
|
|
436
|
+
addColor.opacity.status = "increasing";
|
|
437
|
+
break;
|
|
438
|
+
case "random":
|
|
439
|
+
addColor.opacity.value = (0,engine_root_window_.randomInRange)(addColor.opacity);
|
|
440
|
+
addColor.opacity.status = (0,engine_root_window_.getRandom)() >= 0.5 ? "increasing" : "decreasing";
|
|
441
|
+
break;
|
|
442
|
+
case "max":
|
|
443
|
+
default:
|
|
444
|
+
addColor.opacity.value = addColor.opacity.max;
|
|
445
|
+
addColor.opacity.status = "decreasing";
|
|
446
|
+
break;
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
particle.gradient.colors.push(addColor);
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
isEnabled(particle) {
|
|
453
|
+
var _a, _b, _c;
|
|
454
|
+
return !particle.destroyed && !particle.spawning && (((_a = particle.gradient) === null || _a === void 0 ? void 0 : _a.angle.enable) || ((_c = (_b = particle.gradient) === null || _b === void 0 ? void 0 : _b.colors.some(c => c.value.h.enable || c.value.s.enable || c.value.l.enable)) !== null && _c !== void 0 ? _c : false));
|
|
455
|
+
}
|
|
456
|
+
loadOptions(options, ...sources) {
|
|
457
|
+
for (const source of sources) {
|
|
458
|
+
if (!(source === null || source === void 0 ? void 0 : source.gradient)) {
|
|
459
|
+
continue;
|
|
460
|
+
}
|
|
461
|
+
const gradientToLoad = source.gradient;
|
|
462
|
+
if (!gradientToLoad) {
|
|
463
|
+
continue;
|
|
464
|
+
}
|
|
465
|
+
options.gradient = (0,engine_root_window_.executeOnSingleOrMultiple)(gradientToLoad, gradient => {
|
|
466
|
+
const tmp = new AnimatableGradient();
|
|
467
|
+
tmp.load(gradient);
|
|
468
|
+
return tmp;
|
|
469
|
+
});
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
update(particle, delta) {
|
|
473
|
+
updateGradient(particle, delta);
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
;// CONCATENATED MODULE: ./dist/browser/index.js
|
|
477
|
+
|
|
478
|
+
function loadGradientUpdater(engine) {
|
|
479
|
+
engine.addParticleUpdater("gradient", () => new GradientUpdater());
|
|
480
|
+
}
|
|
481
|
+
})();
|
|
482
|
+
|
|
483
|
+
/******/ return __webpack_exports__;
|
|
484
|
+
/******/ })()
|
|
485
|
+
;
|
|
486
|
+
});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see tsparticles.updater.gradient.min.js.LICENSE.txt */
|
|
2
|
+
!function(e,a){if("object"==typeof exports&&"object"==typeof module)module.exports=a(require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine"],a);else{var t="object"==typeof exports?a(require("@tsparticles/engine")):a(e.window);for(var o in t)("object"==typeof exports?exports:e)[o]=t[o]}}(this,(e=>(()=>{"use strict";var a={533:a=>{a.exports=e}},t={};function o(e){var i=t[e];if(void 0!==i)return i.exports;var n=t[e]={exports:{}};return a[e](n,n.exports,o),n.exports}o.d=(e,a)=>{for(var t in a)o.o(a,t)&&!o.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:a[t]})},o.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{o.r(i),o.d(i,{loadGradientUpdater:()=>p});var e=o(533);class a{constructor(){this.count=0,this.enable=!1,this.speed=0,this.decay=0,this.sync=!1,this.startValue="random"}load(a){a&&(void 0!==a.count&&(this.count=(0,e.setRangeValue)(a.count)),void 0!==a.enable&&(this.enable=a.enable),void 0!==a.speed&&(this.speed=(0,e.setRangeValue)(a.speed)),void 0!==a.sync&&(this.sync=a.sync),void 0!==a.startValue&&(this.startValue=a.startValue))}}class t{constructor(){this.value=0,this.animation=new a}load(a){a&&(this.animation.load(a.animation),void 0!==a.value&&(this.value=(0,e.setRangeValue)(a.value)))}}class n{constructor(){this.stop=0,this.value=new e.AnimatableColor}load(a){a&&(void 0!==a.stop&&(this.stop=a.stop),this.value=e.AnimatableColor.create(this.value,a.value),void 0!==a.opacity&&(this.opacity=new t,"number"==typeof a.opacity?this.opacity.value=a.opacity:this.opacity.load(a.opacity)))}}class l{constructor(){this.count=0,this.enable=!1,this.speed=0,this.decay=0,this.sync=!1}load(a){a&&(void 0!==a.count&&(this.count=(0,e.setRangeValue)(a.count)),void 0!==a.enable&&(this.enable=a.enable),void 0!==a.speed&&(this.speed=(0,e.setRangeValue)(a.speed)),void 0!==a.decay&&(this.decay=(0,e.setRangeValue)(a.decay)),void 0!==a.sync&&(this.sync=a.sync))}}class s{constructor(){this.value=0,this.animation=new l,this.direction="clockwise"}load(e){e&&(this.animation.load(e.animation),void 0!==e.value&&(this.value=e.value),void 0!==e.direction&&(this.direction=e.direction))}}class c{constructor(){this.angle=new s,this.colors=[],this.type="random"}load(e){e&&(this.angle.load(e.angle),void 0!==e.colors&&(this.colors=e.colors.map((e=>{const a=new n;return a.load(e),a}))),void 0!==e.type&&(this.type=e.type))}}function r(e,a){var t,o,i;if(!a.enable)return;const n=null!==(t=a.decay)&&void 0!==t?t:1;switch(a.status){case"increasing":a.value>=a.max?a.status="decreasing":a.value+=(null!==(o=a.velocity)&&void 0!==o?o:0)*e.factor;break;case"decreasing":a.value<=a.min?a.status="increasing":a.value-=(null!==(i=a.velocity)&&void 0!==i?i:0)*e.factor}a.velocity&&1!==n&&(a.velocity*=n)}function u(e,a,t,o){var i,n;const l=a;if(!l||!l.enable)return;const s=(null!==(i=a.velocity)&&void 0!==i?i:0)*e.factor,c=null!==(n=a.decay)&&void 0!==n?n:1;o&&"increasing"!==l.status?(l.value-=s,l.value<0&&(l.status="increasing",l.value+=l.value)):(l.value+=s,o&&l.value>t&&(l.status="decreasing",l.value-=l.value%t)),l.value>t&&(l.value%=t),a.velocity&&1!==c&&(a.velocity*=c)}function d(e,a){var t,o,i;const n=e.gradient;if(n){!function(e,a){var t,o;const i=(null!==(t=a.velocity)&&void 0!==t?t:0)*e.factor,n=2*Math.PI,l=null!==(o=a.decay)&&void 0!==o?o:1;a.enable&&("increasing"===a.status?(a.value+=i,a.value>n&&(a.value-=n)):(a.value-=i,a.value<0&&(a.value+=n)),a.velocity&&1!==l&&(a.velocity*=l))}(a,n.angle);for(const l of n.colors)void 0!==(null===(t=e.color)||void 0===t?void 0:t.h)&&u(a,l.value.h,360,!1),void 0!==(null===(o=e.color)||void 0===o?void 0:o.s)&&u(a,l.value.s,100,!0),void 0!==(null===(i=e.color)||void 0===i?void 0:i.l)&&u(a,l.value.l,100,!0),l.opacity&&r(a,l.opacity)}}class v{getColorStyles(a,t,o,i){var n,l;const s=a.gradient;if(!s)return{};const c=s.angle.value,r="radial"===s.type?t.createRadialGradient(0,0,0,0,0,o):t.createLinearGradient(Math.cos(c)*-o,Math.sin(c)*-o,Math.cos(c)*o,Math.sin(c)*o);for(const a of s.colors)r.addColorStop(a.stop,(0,e.getStyleFromHsl)({h:a.value.h.value,s:a.value.s.value,l:a.value.l.value},null!==(l=null===(n=a.opacity)||void 0===n?void 0:n.value)&&void 0!==l?l:i));return{fill:r}}init(a){const t=(0,e.itemFromSingleOrMultiple)(a.options.gradient);if(!t)return;a.gradient={angle:{value:t.angle.value,enable:t.angle.animation.enable,velocity:(0,e.getRangeValue)(t.angle.animation.speed)/360*a.container.retina.reduceFactor,decay:1-(0,e.getRangeValue)(t.angle.animation.decay)},type:t.type,colors:[]};let o=t.angle.direction;if("random"===o){o=Math.floor(2*(0,e.getRandom)())>0?"counter-clockwise":"clockwise"}switch(o){case"counter-clockwise":case"counterClockwise":a.gradient.angle.status="decreasing";break;case"clockwise":a.gradient.angle.status="increasing"}const i=a.options.reduceDuplicates;for(const o of t.colors){const t=(0,e.rangeColorToHsl)(o.value,a.id,i);if(!t)continue;const n=(0,e.getHslAnimationFromHsl)(t,o.value.animation,a.container.retina.reduceFactor),l={stop:o.stop,value:n,opacity:o.opacity?{enable:o.opacity.animation.enable,max:(0,e.getRangeMax)(o.opacity.value),min:(0,e.getRangeMin)(o.opacity.value),status:"increasing",value:(0,e.getRangeValue)(o.opacity.value),velocity:(0,e.getRangeValue)(o.opacity.animation.speed)/100*a.container.retina.reduceFactor,decay:1-(0,e.getRangeValue)(o.opacity.animation.decay)}:void 0};if(o.opacity&&l.opacity){const a=o.opacity.value;l.opacity.min=(0,e.getRangeMin)(a),l.opacity.max=(0,e.getRangeMax)(a);switch(o.opacity.animation.startValue){case"min":l.opacity.value=l.opacity.min,l.opacity.status="increasing";break;case"random":l.opacity.value=(0,e.randomInRange)(l.opacity),l.opacity.status=(0,e.getRandom)()>=.5?"increasing":"decreasing";break;default:l.opacity.value=l.opacity.max,l.opacity.status="decreasing"}}a.gradient.colors.push(l)}}isEnabled(e){var a,t,o;return!e.destroyed&&!e.spawning&&((null===(a=e.gradient)||void 0===a?void 0:a.angle.enable)||null!==(o=null===(t=e.gradient)||void 0===t?void 0:t.colors.some((e=>e.value.h.enable||e.value.s.enable||e.value.l.enable)))&&void 0!==o&&o)}loadOptions(a,...t){for(const o of t){if(!(null==o?void 0:o.gradient))continue;const t=o.gradient;t&&(a.gradient=(0,e.executeOnSingleOrMultiple)(t,(e=>{const a=new c;return a.load(e),a})))}}update(e,a){d(e,a)}}function p(e){e.addParticleUpdater("gradient",(()=>new v))}})(),i})()));
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { GradientType } from "@tsparticles/engine";
|
|
2
|
+
import type { IDelta, IParticleColorStyle, IParticleHslAnimation, IParticleNumericValueAnimation, IParticleUpdater, IParticleValueAnimation, IParticlesOptions, Particle, ParticlesOptions, RecursivePartial, SingleOrMultiple } from "@tsparticles/engine";
|
|
3
|
+
import { AnimatableGradient } from "./Options/Classes/AnimatableGradient";
|
|
4
|
+
import type { IAnimatableGradient } from "./Options/Interfaces/IAnimatableGradient";
|
|
5
|
+
interface IParticleGradientColorAnimation {
|
|
6
|
+
opacity?: IParticleNumericValueAnimation;
|
|
7
|
+
stop: number;
|
|
8
|
+
value: IParticleHslAnimation;
|
|
9
|
+
}
|
|
10
|
+
interface IParticleGradientAnimation {
|
|
11
|
+
angle: IParticleValueAnimation<number>;
|
|
12
|
+
colors: IParticleGradientColorAnimation[];
|
|
13
|
+
type: GradientType;
|
|
14
|
+
}
|
|
15
|
+
type GradientParticle = Particle & {
|
|
16
|
+
gradient?: IParticleGradientAnimation;
|
|
17
|
+
options: GradientParticlesOptions;
|
|
18
|
+
};
|
|
19
|
+
type IGradientParticlesOptions = IParticlesOptions & {
|
|
20
|
+
gradient?: SingleOrMultiple<IAnimatableGradient>;
|
|
21
|
+
};
|
|
22
|
+
type GradientParticlesOptions = ParticlesOptions & {
|
|
23
|
+
gradient?: SingleOrMultiple<AnimatableGradient>;
|
|
24
|
+
};
|
|
25
|
+
export declare class GradientUpdater implements IParticleUpdater {
|
|
26
|
+
getColorStyles(particle: GradientParticle, context: CanvasRenderingContext2D, radius: number, opacity: number): IParticleColorStyle;
|
|
27
|
+
init(particle: GradientParticle): void;
|
|
28
|
+
isEnabled(particle: GradientParticle): boolean;
|
|
29
|
+
loadOptions(options: GradientParticlesOptions, ...sources: (RecursivePartial<IGradientParticlesOptions> | undefined)[]): void;
|
|
30
|
+
update(particle: GradientParticle, delta: IDelta): void;
|
|
31
|
+
}
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IOptionLoader, RecursivePartial } from "@tsparticles/engine";
|
|
2
|
+
import { AnimatableGradientColor } from "./AnimatableGradientColor";
|
|
3
|
+
import { GradientAngle } from "./GradientAngle";
|
|
4
|
+
import { GradientType } from "@tsparticles/engine";
|
|
5
|
+
import type { IAnimatableGradient } from "../Interfaces/IAnimatableGradient";
|
|
6
|
+
export declare class AnimatableGradient implements IAnimatableGradient, IOptionLoader<IAnimatableGradient> {
|
|
7
|
+
angle: GradientAngle;
|
|
8
|
+
colors: AnimatableGradientColor[];
|
|
9
|
+
type: GradientType;
|
|
10
|
+
constructor();
|
|
11
|
+
load(data?: RecursivePartial<IAnimatableGradient>): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IOptionLoader, RecursivePartial } from "@tsparticles/engine";
|
|
2
|
+
import { AnimatableColor } from "@tsparticles/engine";
|
|
3
|
+
import { GradientColorOpacity } from "./GradientColorOpacity";
|
|
4
|
+
import type { IAnimatableGradientColor } from "../Interfaces/IOptionsGradient";
|
|
5
|
+
export declare class AnimatableGradientColor implements IAnimatableGradientColor, IOptionLoader<IAnimatableGradientColor> {
|
|
6
|
+
opacity?: GradientColorOpacity;
|
|
7
|
+
stop: number;
|
|
8
|
+
value: AnimatableColor;
|
|
9
|
+
constructor();
|
|
10
|
+
load(data?: RecursivePartial<IAnimatableGradientColor>): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IAnimatable, IAnimation, IOptionLoader, RecursivePartial, RotateDirectionAlt } from "@tsparticles/engine";
|
|
2
|
+
import { GradientAngleAnimation } from "./GradientAngleAnimation";
|
|
3
|
+
import type { IGradientAngle } from "../Interfaces/Gradients";
|
|
4
|
+
import { RotateDirection } from "@tsparticles/engine";
|
|
5
|
+
export declare class GradientAngle implements IGradientAngle, IAnimatable<IAnimation>, IOptionLoader<IGradientAngle & IAnimatable<IAnimation>> {
|
|
6
|
+
animation: GradientAngleAnimation;
|
|
7
|
+
direction: RotateDirection | keyof typeof RotateDirection | RotateDirectionAlt;
|
|
8
|
+
value: number;
|
|
9
|
+
constructor();
|
|
10
|
+
load(data?: RecursivePartial<IGradientAngle & IAnimatable<IAnimation>>): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IAnimation, IOptionLoader, RangeValue, RecursivePartial } from "@tsparticles/engine";
|
|
2
|
+
export declare class GradientAngleAnimation implements IAnimation, IOptionLoader<IAnimation> {
|
|
3
|
+
count: RangeValue;
|
|
4
|
+
decay: RangeValue;
|
|
5
|
+
enable: boolean;
|
|
6
|
+
speed: RangeValue;
|
|
7
|
+
sync: boolean;
|
|
8
|
+
constructor();
|
|
9
|
+
load(data?: RecursivePartial<IAnimation>): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IAnimatable, IAnimation, IOptionLoader, RangeValue, RecursivePartial } from "@tsparticles/engine";
|
|
2
|
+
import { GradientColorOpacityAnimation } from "./GradientColorOpacityAnimation";
|
|
3
|
+
import type { IGradientColorOpacity } from "../Interfaces/Gradients";
|
|
4
|
+
import type { IGradientColorOpacityAnimation } from "../Interfaces/IOptionsGradient";
|
|
5
|
+
export declare class GradientColorOpacity implements IGradientColorOpacity, IAnimatable<GradientColorOpacityAnimation>, IOptionLoader<IGradientColorOpacity & IAnimatable<IGradientColorOpacityAnimation>> {
|
|
6
|
+
animation: GradientColorOpacityAnimation;
|
|
7
|
+
value: RangeValue;
|
|
8
|
+
constructor();
|
|
9
|
+
load(data?: RecursivePartial<IGradientColorOpacity & IAnimatable<IAnimation>>): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { IOptionLoader, RangeValue, RecursivePartial } from "@tsparticles/engine";
|
|
2
|
+
import { StartValueType } from "@tsparticles/engine";
|
|
3
|
+
import type { IGradientColorOpacityAnimation } from "../Interfaces/IOptionsGradient";
|
|
4
|
+
export declare class GradientColorOpacityAnimation implements IGradientColorOpacityAnimation, IOptionLoader<IGradientColorOpacityAnimation> {
|
|
5
|
+
count: RangeValue;
|
|
6
|
+
decay: RangeValue;
|
|
7
|
+
enable: boolean;
|
|
8
|
+
speed: RangeValue;
|
|
9
|
+
startValue: StartValueType | keyof typeof StartValueType;
|
|
10
|
+
sync: boolean;
|
|
11
|
+
constructor();
|
|
12
|
+
load(data?: RecursivePartial<IGradientColorOpacityAnimation>): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { GradientType, IOptionsColor, RangeValue, RotateDirection, RotateDirectionAlt } from "@tsparticles/engine";
|
|
2
|
+
export interface IGradientColorOpacity {
|
|
3
|
+
value: RangeValue;
|
|
4
|
+
}
|
|
5
|
+
export interface IGradientColor {
|
|
6
|
+
opacity?: IGradientColorOpacity | number;
|
|
7
|
+
stop: number;
|
|
8
|
+
value: IOptionsColor;
|
|
9
|
+
}
|
|
10
|
+
export interface IGradientAngle {
|
|
11
|
+
direction: RotateDirection | keyof typeof RotateDirection | RotateDirectionAlt;
|
|
12
|
+
value: number;
|
|
13
|
+
}
|
|
14
|
+
export interface IGradient {
|
|
15
|
+
angle?: IGradientAngle;
|
|
16
|
+
colors: IGradientColor[];
|
|
17
|
+
type: GradientType;
|
|
18
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { IAnimatable, IAnimation } from "@tsparticles/engine";
|
|
2
|
+
import type { IAnimatableGradientColor, IOptionsGradient } from "./IOptionsGradient";
|
|
3
|
+
import type { IGradientAngle } from "./Gradients";
|
|
4
|
+
export type IAnimatableGradient = IOptionsGradient & {
|
|
5
|
+
angle: IGradientAngle & IAnimatable<IAnimation>;
|
|
6
|
+
colors: IAnimatableGradientColor[];
|
|
7
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IAnimatable, IAnimatableColor, IAnimation, StartValueType } from "@tsparticles/engine";
|
|
2
|
+
import type { IGradient, IGradientColor, IGradientColorOpacity } from "./Gradients";
|
|
3
|
+
export interface IGradientColorOpacityAnimation extends IAnimation {
|
|
4
|
+
startValue: StartValueType | keyof typeof StartValueType;
|
|
5
|
+
}
|
|
6
|
+
export interface IAnimatableGradientColor extends IGradientColor {
|
|
7
|
+
opacity?: (IGradientColorOpacity & IAnimatable<IGradientColorOpacityAnimation>) | number;
|
|
8
|
+
value: IAnimatableColor;
|
|
9
|
+
}
|
|
10
|
+
export type IOptionsGradient = IGradient;
|
package/types/index.d.ts
ADDED