@tsparticles/updater-gradient 3.2.2 → 3.4.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/browser/GradientUpdater.js +20 -21
- package/browser/Options/Classes/AnimatableGradient.js +3 -2
- package/browser/Options/Classes/GradientAngle.js +2 -2
- package/browser/Options/Classes/GradientColorOpacityAnimation.js +2 -2
- package/browser/Utils.js +3 -3
- package/browser/index.js +3 -3
- package/cjs/GradientUpdater.js +20 -44
- package/cjs/Options/Classes/AnimatableGradient.js +3 -2
- package/cjs/Options/Classes/GradientAngle.js +1 -1
- package/cjs/Options/Classes/GradientColorOpacityAnimation.js +1 -1
- package/cjs/Utils.js +2 -2
- package/cjs/index.js +3 -26
- package/esm/GradientUpdater.js +20 -21
- package/esm/Options/Classes/AnimatableGradient.js +3 -2
- package/esm/Options/Classes/GradientAngle.js +2 -2
- package/esm/Options/Classes/GradientColorOpacityAnimation.js +2 -2
- package/esm/Utils.js +3 -3
- package/esm/index.js +3 -3
- package/package.json +2 -2
- package/report.html +1 -1
- package/tsparticles.updater.gradient.js +82 -200
- 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/umd/GradientUpdater.js +21 -46
- package/umd/Options/Classes/AnimatableGradient.js +4 -3
- package/umd/Options/Classes/GradientAngle.js +1 -1
- package/umd/Options/Classes/GradientColorOpacityAnimation.js +1 -1
- package/umd/Utils.js +2 -2
- package/umd/index.js +4 -28
- package/103.min.js +0 -2
- package/103.min.js.LICENSE.txt +0 -1
- package/914.min.js +0 -2
- package/914.min.js.LICENSE.txt +0 -1
- package/dist_browser_GradientUpdater_js.js +0 -90
- package/dist_browser_Utils_js.js +0 -30
package/umd/Utils.js
CHANGED
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
if (!gradient) {
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
|
-
(0, engine_1.updateAnimation)(particle, gradient.angle, false,
|
|
19
|
+
(0, engine_1.updateAnimation)(particle, gradient.angle, false, engine_1.DestroyType.none, delta);
|
|
20
20
|
for (const color of gradient.colors) {
|
|
21
21
|
(0, engine_1.updateColor)(color.value, delta);
|
|
22
22
|
if (color.opacity) {
|
|
23
|
-
(0, engine_1.updateAnimation)(particle, color.opacity, true,
|
|
23
|
+
(0, engine_1.updateAnimation)(particle, color.opacity, true, engine_1.DestroyType.none, delta);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
}
|
package/umd/index.js
CHANGED
|
@@ -1,43 +1,19 @@
|
|
|
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
|
-
};
|
|
24
1
|
(function (factory) {
|
|
25
2
|
if (typeof module === "object" && typeof module.exports === "object") {
|
|
26
3
|
var v = factory(require, exports);
|
|
27
4
|
if (v !== undefined) module.exports = v;
|
|
28
5
|
}
|
|
29
6
|
else if (typeof define === "function" && define.amd) {
|
|
30
|
-
define(["require", "exports"], factory);
|
|
7
|
+
define(["require", "exports", "./GradientUpdater.js"], factory);
|
|
31
8
|
}
|
|
32
9
|
})(function (require, exports) {
|
|
33
10
|
"use strict";
|
|
34
|
-
var __syncRequire = typeof module === "object" && typeof module.exports === "object";
|
|
35
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
12
|
exports.loadGradientUpdater = void 0;
|
|
13
|
+
const GradientUpdater_js_1 = require("./GradientUpdater.js");
|
|
37
14
|
async function loadGradientUpdater(engine, refresh = true) {
|
|
38
|
-
await engine.addParticleUpdater("gradient",
|
|
39
|
-
|
|
40
|
-
return new GradientUpdater();
|
|
15
|
+
await engine.addParticleUpdater("gradient", () => {
|
|
16
|
+
return Promise.resolve(new GradientUpdater_js_1.GradientUpdater());
|
|
41
17
|
}, refresh);
|
|
42
18
|
}
|
|
43
19
|
exports.loadGradientUpdater = loadGradientUpdater;
|
package/103.min.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 103.min.js.LICENSE.txt */
|
|
2
|
-
(this.webpackChunk_tsparticles_updater_gradient=this.webpackChunk_tsparticles_updater_gradient||[]).push([[103],{103:(t,a,n)=>{n.d(a,{updateGradient:()=>i});var e=n(533);function i(t,a){const{gradient:n}=t;if(n){(0,e.updateAnimation)(t,n.angle,!1,"none",a);for(const i of n.colors)(0,e.updateColor)(i.value,a),i.opacity&&(0,e.updateAnimation)(t,i.opacity,!0,"none",a)}}}}]);
|
package/103.min.js.LICENSE.txt
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! tsParticles Gradient Updater v3.2.2 by Matteo Bruni */
|
package/914.min.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 914.min.js.LICENSE.txt */
|
|
2
|
-
(this.webpackChunk_tsparticles_updater_gradient=this.webpackChunk_tsparticles_updater_gradient||[]).push([[914],{914:(e,a,t)=>{t.d(a,{GradientUpdater:()=>u});var i=t(533);class n{constructor(){this.count=0,this.enable=!1,this.speed=0,this.decay=0,this.delay=0,this.sync=!1,this.startValue="random"}load(e){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 s{constructor(){this.value=0,this.animation=new n}load(e){e&&(this.animation.load(e.animation),void 0!==e.value&&(this.value=(0,i.setRangeValue)(e.value)))}}class o{constructor(){this.stop=0,this.value=new i.AnimatableColor}load(e){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 s,(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){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="clockwise"}load(e){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 d{constructor(){this.angle=new c,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 o;return a.load(e),a}))),void 0!==e.type&&(this.type=e.type))}}const r=2*Math.PI;class u{getColorStyles(e,a,t,n){const s=e.gradient;if(!s)return{};const o=s.angle.value,l=0,c=0,d="radial"===s.type?a.createRadialGradient(l,c,0,l,c,t):a.createLinearGradient(Math.cos(o)*-t,Math.sin(o)*-t,Math.cos(o)*t,Math.sin(o)*t);for(const{stop:e,value:a,opacity:t}of s.colors)d.addColorStop(e,(0,i.getStyleFromHsl)({h:a.h.value,s:a.s.value,l:a.l.value},t?.value??n));return{fill:d}}async 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:r,min:0,time:0},type:a.type,colors:[]};let n=a.angle.direction;switch("random"===n&&(n=(0,i.getRandom)()>i.halfRandom?"counter-clockwise":"clockwise"),n){case"counter-clockwise":case"counterClockwise":e.gradient.angle.status="decreasing";break;case"clockwise":e.gradient.angle.status="increasing"}const s=e.options.reduceDuplicates;for(const t of a.colors){const a=(0,i.rangeColorToHsl)(t.value,e.id,s);if(!a)continue;const n=(0,i.getHslAnimationFromHsl)(a,t.value.animation,e.container.retina.reduceFactor),o={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:"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}=o;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"min":l.value=l.min,l.status="increasing";break;case"max":l.value=l.max,l.status="decreasing";break;default:l.value=(0,i.randomInRange)(l),l.status=(0,i.getRandom)()>=i.halfRandom?"increasing":"decreasing"}}e.gradient.colors.push(o)}await Promise.resolve()}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;a&&(e.gradient=(0,i.executeOnSingleOrMultiple)(a,(e=>{const a=new d;return a.load(e),a})))}}async update(e,a){const{updateGradient:i}=await t.e(103).then(t.bind(t,103));i(e,a)}}}}]);
|
package/914.min.js.LICENSE.txt
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! tsParticles Gradient Updater v3.2.2 by Matteo Bruni */
|
|
@@ -1,90 +0,0 @@
|
|
|
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.2.2
|
|
8
|
-
*/
|
|
9
|
-
"use strict";
|
|
10
|
-
/*
|
|
11
|
-
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
12
|
-
* This devtool is neither made for production nor for readable output files.
|
|
13
|
-
* It uses "eval()" calls to create a separate source file in the browser devtools.
|
|
14
|
-
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
|
|
15
|
-
* or disable the default devtool with "devtool: false".
|
|
16
|
-
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
|
|
17
|
-
*/
|
|
18
|
-
(this["webpackChunk_tsparticles_updater_gradient"] = this["webpackChunk_tsparticles_updater_gradient"] || []).push([["dist_browser_GradientUpdater_js"],{
|
|
19
|
-
|
|
20
|
-
/***/ "./dist/browser/GradientUpdater.js":
|
|
21
|
-
/*!*****************************************!*\
|
|
22
|
-
!*** ./dist/browser/GradientUpdater.js ***!
|
|
23
|
-
\*****************************************/
|
|
24
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
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 _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\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\n\nconst double = 2,\n doublePI = Math.PI * double;\nclass GradientUpdater {\n getColorStyles(particle, context, radius, opacity) {\n const gradient = particle.gradient;\n if (!gradient) {\n return {};\n }\n const gradientAngle = gradient.angle.value,\n origin = {\n x: 0,\n y: 0\n },\n minRadius = 0,\n fillGradient = gradient.type === \"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 {\n stop,\n value,\n opacity: cOpacity\n } of gradient.colors) {\n fillGradient.addColorStop(stop, (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getStyleFromHsl)({\n h: value.h.value,\n s: value.s.value,\n l: value.l.value\n }, cOpacity?.value ?? opacity));\n }\n return {\n fill: fillGradient\n };\n }\n async init(particle) {\n const gradient = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.itemFromSingleOrMultiple)(particle.options.gradient);\n if (!gradient) {\n return;\n }\n const {\n angle\n } = gradient,\n speedFactor = 360,\n 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: doublePI,\n min: 0,\n time: 0\n },\n type: gradient.type,\n colors: []\n };\n let rotateDirection = gradient.angle.direction;\n if (rotateDirection === \"random\") {\n rotateDirection = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRandom)() > _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.halfRandom ? \"counter-clockwise\" : \"clockwise\";\n }\n switch (rotateDirection) {\n case \"counter-clockwise\":\n case \"counterClockwise\":\n particle.gradient.angle.status = \"decreasing\";\n break;\n case \"clockwise\":\n particle.gradient.angle.status = \"increasing\";\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)(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),\n 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: \"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 };\n const {\n opacity: addOpacity\n } = 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 \"min\":\n addOpacity.value = addOpacity.min;\n addOpacity.status = \"increasing\";\n break;\n case \"max\":\n addOpacity.value = addOpacity.max;\n addOpacity.status = \"decreasing\";\n break;\n case \"random\":\n default:\n addOpacity.value = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.randomInRange)(addOpacity);\n addOpacity.status = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRandom)() >= _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.halfRandom ? \"increasing\" : \"decreasing\";\n break;\n }\n }\n particle.gradient.colors.push(addColor);\n }\n await Promise.resolve();\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 if (!gradientToLoad) {\n continue;\n }\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 async update(particle, delta) {\n const {\n updateGradient\n } = await __webpack_require__.e(/*! import() */ \"dist_browser_Utils_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./Utils.js */ \"./dist/browser/Utils.js\"));\n updateGradient(particle, delta);\n }\n}\n\n//# sourceURL=webpack://@tsparticles/updater-gradient/./dist/browser/GradientUpdater.js?");
|
|
27
|
-
|
|
28
|
-
/***/ }),
|
|
29
|
-
|
|
30
|
-
/***/ "./dist/browser/Options/Classes/AnimatableGradient.js":
|
|
31
|
-
/*!************************************************************!*\
|
|
32
|
-
!*** ./dist/browser/Options/Classes/AnimatableGradient.js ***!
|
|
33
|
-
\************************************************************/
|
|
34
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
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 _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_0__ = __webpack_require__(/*! ./GradientAngle.js */ \"./dist/browser/Options/Classes/GradientAngle.js\");\n\n\nclass AnimatableGradient {\n constructor() {\n this.angle = new _GradientAngle_js__WEBPACK_IMPORTED_MODULE_0__.GradientAngle();\n this.colors = [];\n this.type = \"random\";\n }\n load(data) {\n if (!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//# sourceURL=webpack://@tsparticles/updater-gradient/./dist/browser/Options/Classes/AnimatableGradient.js?");
|
|
37
|
-
|
|
38
|
-
/***/ }),
|
|
39
|
-
|
|
40
|
-
/***/ "./dist/browser/Options/Classes/AnimatableGradientColor.js":
|
|
41
|
-
/*!*****************************************************************!*\
|
|
42
|
-
!*** ./dist/browser/Options/Classes/AnimatableGradientColor.js ***!
|
|
43
|
-
\*****************************************************************/
|
|
44
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
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 _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\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 constructor() {\n this.stop = 0;\n this.value = new _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.AnimatableColor();\n }\n load(data) {\n if (!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//# sourceURL=webpack://@tsparticles/updater-gradient/./dist/browser/Options/Classes/AnimatableGradientColor.js?");
|
|
47
|
-
|
|
48
|
-
/***/ }),
|
|
49
|
-
|
|
50
|
-
/***/ "./dist/browser/Options/Classes/GradientAngle.js":
|
|
51
|
-
/*!*******************************************************!*\
|
|
52
|
-
!*** ./dist/browser/Options/Classes/GradientAngle.js ***!
|
|
53
|
-
\*******************************************************/
|
|
54
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
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 _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\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 constructor() {\n this.value = 0;\n this.animation = new _GradientAngleAnimation_js__WEBPACK_IMPORTED_MODULE_1__.GradientAngleAnimation();\n this.direction = \"clockwise\";\n }\n load(data) {\n if (!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//# sourceURL=webpack://@tsparticles/updater-gradient/./dist/browser/Options/Classes/GradientAngle.js?");
|
|
57
|
-
|
|
58
|
-
/***/ }),
|
|
59
|
-
|
|
60
|
-
/***/ "./dist/browser/Options/Classes/GradientAngleAnimation.js":
|
|
61
|
-
/*!****************************************************************!*\
|
|
62
|
-
!*** ./dist/browser/Options/Classes/GradientAngleAnimation.js ***!
|
|
63
|
-
\****************************************************************/
|
|
64
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
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/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n\nclass GradientAngleAnimation {\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 (!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//# sourceURL=webpack://@tsparticles/updater-gradient/./dist/browser/Options/Classes/GradientAngleAnimation.js?");
|
|
67
|
-
|
|
68
|
-
/***/ }),
|
|
69
|
-
|
|
70
|
-
/***/ "./dist/browser/Options/Classes/GradientColorOpacity.js":
|
|
71
|
-
/*!**************************************************************!*\
|
|
72
|
-
!*** ./dist/browser/Options/Classes/GradientColorOpacity.js ***!
|
|
73
|
-
\**************************************************************/
|
|
74
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
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 _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\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 constructor() {\n this.value = 0;\n this.animation = new _GradientColorOpacityAnimation_js__WEBPACK_IMPORTED_MODULE_1__.GradientColorOpacityAnimation();\n }\n load(data) {\n if (!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//# sourceURL=webpack://@tsparticles/updater-gradient/./dist/browser/Options/Classes/GradientColorOpacity.js?");
|
|
77
|
-
|
|
78
|
-
/***/ }),
|
|
79
|
-
|
|
80
|
-
/***/ "./dist/browser/Options/Classes/GradientColorOpacityAnimation.js":
|
|
81
|
-
/*!***********************************************************************!*\
|
|
82
|
-
!*** ./dist/browser/Options/Classes/GradientColorOpacityAnimation.js ***!
|
|
83
|
-
\***********************************************************************/
|
|
84
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
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/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n\nclass GradientColorOpacityAnimation {\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 = \"random\";\n }\n load(data) {\n if (!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//# sourceURL=webpack://@tsparticles/updater-gradient/./dist/browser/Options/Classes/GradientColorOpacityAnimation.js?");
|
|
87
|
-
|
|
88
|
-
/***/ })
|
|
89
|
-
|
|
90
|
-
}]);
|
package/dist_browser_Utils_js.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
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.2.2
|
|
8
|
-
*/
|
|
9
|
-
"use strict";
|
|
10
|
-
/*
|
|
11
|
-
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
12
|
-
* This devtool is neither made for production nor for readable output files.
|
|
13
|
-
* It uses "eval()" calls to create a separate source file in the browser devtools.
|
|
14
|
-
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
|
|
15
|
-
* or disable the default devtool with "devtool: false".
|
|
16
|
-
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
|
|
17
|
-
*/
|
|
18
|
-
(this["webpackChunk_tsparticles_updater_gradient"] = this["webpackChunk_tsparticles_updater_gradient"] || []).push([["dist_browser_Utils_js"],{
|
|
19
|
-
|
|
20
|
-
/***/ "./dist/browser/Utils.js":
|
|
21
|
-
/*!*******************************!*\
|
|
22
|
-
!*** ./dist/browser/Utils.js ***!
|
|
23
|
-
\*******************************/
|
|
24
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
25
|
-
|
|
26
|
-
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/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n\nfunction updateGradient(particle, delta) {\n const {\n gradient\n } = particle;\n if (!gradient) {\n return;\n }\n (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.updateAnimation)(particle, gradient.angle, false, \"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, \"none\", delta);\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/updater-gradient/./dist/browser/Utils.js?");
|
|
27
|
-
|
|
28
|
-
/***/ })
|
|
29
|
-
|
|
30
|
-
}]);
|