@tsparticles/updater-gradient 3.8.0 → 3.8.1
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/index.js +1 -1
- package/cjs/index.js +1 -1
- package/esm/index.js +1 -1
- package/package.json +2 -2
- package/report.html +1 -1
- package/tsparticles.updater.gradient.js +2 -2
- package/tsparticles.updater.gradient.min.js +1 -1
- package/tsparticles.updater.gradient.min.js.LICENSE.txt +1 -1
- package/umd/index.js +1 -1
package/browser/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GradientUpdater } from "./GradientUpdater.js";
|
|
2
2
|
export async function loadGradientUpdater(engine, refresh = true) {
|
|
3
|
-
engine.checkVersion("3.8.
|
|
3
|
+
engine.checkVersion("3.8.1");
|
|
4
4
|
await engine.addParticleUpdater("gradient", () => {
|
|
5
5
|
return Promise.resolve(new GradientUpdater(engine));
|
|
6
6
|
}, refresh);
|
package/cjs/index.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.loadGradientUpdater = loadGradientUpdater;
|
|
4
4
|
const GradientUpdater_js_1 = require("./GradientUpdater.js");
|
|
5
5
|
async function loadGradientUpdater(engine, refresh = true) {
|
|
6
|
-
engine.checkVersion("3.8.
|
|
6
|
+
engine.checkVersion("3.8.1");
|
|
7
7
|
await engine.addParticleUpdater("gradient", () => {
|
|
8
8
|
return Promise.resolve(new GradientUpdater_js_1.GradientUpdater(engine));
|
|
9
9
|
}, refresh);
|
package/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GradientUpdater } from "./GradientUpdater.js";
|
|
2
2
|
export async function loadGradientUpdater(engine, refresh = true) {
|
|
3
|
-
engine.checkVersion("3.8.
|
|
3
|
+
engine.checkVersion("3.8.1");
|
|
4
4
|
await engine.addParticleUpdater("gradient", () => {
|
|
5
5
|
return Promise.resolve(new GradientUpdater(engine));
|
|
6
6
|
}, refresh);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/updater-gradient",
|
|
3
|
-
"version": "3.8.
|
|
3
|
+
"version": "3.8.1",
|
|
4
4
|
"description": "tsParticles particles gradient updater",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
"./package.json": "./package.json"
|
|
102
102
|
},
|
|
103
103
|
"dependencies": {
|
|
104
|
-
"@tsparticles/engine": "3.8.
|
|
104
|
+
"@tsparticles/engine": "3.8.1"
|
|
105
105
|
},
|
|
106
106
|
"publishConfig": {
|
|
107
107
|
"access": "public"
|
package/report.html
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8"/>
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
6
|
-
<title>@tsparticles/updater-gradient [
|
|
6
|
+
<title>@tsparticles/updater-gradient [31 Jan 2025 at 09:16]</title>
|
|
7
7
|
<link rel="shortcut icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAABrVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+O1foceMD///+J0/qK1Pr7/v8Xdr/9///W8P4UdL7L7P0Scr2r4Pyj3vwad8D5/f/2/f+55f3E6f34+/2H0/ojfMKpzOd0rNgQcb3F3O/j9f7c8v6g3Pz0/P/w+v/q+P7n9v6T1/uQ1vuE0vqLut/y+v+Z2fvt+f+15Pzv9fuc2/vR7v2V2Pvd6/bg9P7I6/285/2y4/yp3/zp8vk8i8kqgMT7/P31+fyv4vxGkcz6/P6/6P3j7vfS5PNnpNUxhcbO7f7F6v3O4vHK3/DA2u631Ouy0eqXweKJud5wqthfoNMMbLvY8f73+v2dxeR8sNtTmdDx9/zX6PSjyeaCtd1YnNGX2PuQveCGt95Nls42h8dLlM3F4vBtAAAAM3RSTlMAAyOx0/sKBvik8opWGBMOAe3l1snDm2E9LSb06eHcu5JpHbarfHZCN9CBb08zzkdNS0kYaptYAAAFV0lEQVRYw92X51/aYBDHHS2O2qqttVbrqNq9m+TJIAYIShBkWwqIiCgoWvfeq7Z2/s29hyQNyUcR7LveGwVyXy6XH8/9rqxglLfUPLxVduUor3h0rfp2TYvpivk37929TkG037hffoX0+peVtZQc1589rigVUdXS/ABSAyEmGIO/1XfvldSK8vs3OqB6u3m0nxmIrvgB0dj7rr7Y9IbuF68hnfFaiHA/sxqm0wciIG43P60qKv9WXWc1RXGh/mFESFABTSBi0sNAKzqet17eCtOb3kZIDwxEEU0oAIJGYxNBDhBND29e0rtXXbcpuPmED9IhEAAQ/AXEaF8EPmnrrKsv0LvWR3fg5sWDNAFZOgAgaKvZDogHNU9MFwnnYROkc56RD5CjAbQX9Ow4g7upCsvYu55aSI/Nj0H1akgKQEUM94dwK65hYRmFU9MIcH/fqJYOZYcnuJSU/waKDgTOEVaVKhwrTRP5XzgSpAITYzom7UvkhFX5VutmxeNnWDjjswTKTyfgluNDGbUpWissXhF3s7mlSml+czWkg3D0l1nNjGNjz3myOQOa1KM/jOS6ebdbAVTCi4gljHSFrviza7tOgRWcS0MOUX9zdNgag5w7rRqA44Lzw0hr1WqES36dFliSJFlh2rXIae3FFcDDgKdxrUIDePr8jGcSClV1u7A9xeN0ModY/pHMxmR1EzRh8TJiwqsHmKW0l4FCEZI+jHio+JdPPE9qwQtTRxku2D8sIeRL2LnxWSllANCQGOIiqVHAz2ye2JR0DcH+HoxDkaADLjgxjKQ+AwCX/g0+DNgdG0ukYCONAe+dbc2IAc6fwt1ARoDSezNHxV2Cmzwv3O6lDMV55edBGwGK9n1+x2F8EDfAGCxug8MhpsMEcTEAWf3rx2vZhe/LAmtIn/6apE6PN0ULKgywD9mmdxbmFl3OvD5AS5fW5zLbv/YHmcsBTjf/afDz3MaZTVCfAP9z6/Bw6ycv8EUBWJIn9zYcoAWWlW9+OzO3vkTy8H+RANLmdrpOuYWdZYEXpo+TlCJrW5EARb7fF+bWdqf3hhyZI1nWJQHgznErZhbjoEsWqi8dQNoE294aldzFurwSABL2XXMf9+H1VQGke9exw5P/AnA5Pv5ngMul7LOvO922iwACu8WkCwLCafvM4CeWPxfA8lNHcWZSoi8EwMAIciKX2Z4SWCMAa3snCZ/G4EA8D6CMLNFsGQhkkz/gQNEBbPCbWsxGUpYVu3z8IyNAknwJkfPMEhLyrdi5RTyUVACkw4GSFRNWJNEW+fgPGwHD8/JxnRuLabN4CGNRkAE23na2+VmEAUmrYymSGjMAYqH84YUIyzgzs3XC7gNgH36Vcc4zKY9o9fgPBXUAiHHwVboBHGLiX6Zcjp1f2wu4tvzZKo0ecPnDtQYDQvJXaBeNzce45Fp28ZQLrEZVuFqgBwOalArKXnW1UzlnSusQKJqKYNuz4tOnI6sZG4zanpemv+7ySU2jbA9h6uhcgpfy6G2PahirDZ6zvq6zDduMVFTKvzw8wgyEdelwY9in3XkEPs3osJuwRQ4qTkfzifndg9Gfc4pdsu82+tTnHZTBa2EAMrqr2t43pguc8tNm7JQVQ2S0ukj2d22dhXYP0/veWtwKrCkNoNimAN5+Xr/oLrxswKbVJjteWrX7eR63o4j9q0GxnaBdWgGA5VStpanIjQmEhV0/nVt5VOFUvix6awJhPcAaTEShgrG+iGyvb5a0Ndb1YGHFPEwoqAinoaykaID1o1pdPNu7XsnCKQ3R+hwWIIhGvORcJUBYXe3Xa3vq/mF/N9V13ugufMkfXn+KHsRD0B8AAAAASUVORK5CYII=" type="image/x-icon" />
|
|
8
8
|
|
|
9
9
|
<script>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Demo / Generator : https://particles.js.org/
|
|
5
5
|
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
6
|
* How to use? : Check the GitHub README
|
|
7
|
-
* v3.8.
|
|
7
|
+
* v3.8.1
|
|
8
8
|
*/
|
|
9
9
|
/*
|
|
10
10
|
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
@@ -114,7 +114,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
114
114
|
\*******************************/
|
|
115
115
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
116
116
|
|
|
117
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadGradientUpdater: () => (/* binding */ loadGradientUpdater)\n/* harmony export */ });\n/* harmony import */ var _GradientUpdater_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./GradientUpdater.js */ \"./dist/browser/GradientUpdater.js\");\n\nasync function loadGradientUpdater(engine, refresh = true) {\n engine.checkVersion(\"3.8.
|
|
117
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadGradientUpdater: () => (/* binding */ loadGradientUpdater)\n/* harmony export */ });\n/* harmony import */ var _GradientUpdater_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./GradientUpdater.js */ \"./dist/browser/GradientUpdater.js\");\n\nasync function loadGradientUpdater(engine, refresh = true) {\n engine.checkVersion(\"3.8.1\");\n await engine.addParticleUpdater(\"gradient\", () => {\n return Promise.resolve(new _GradientUpdater_js__WEBPACK_IMPORTED_MODULE_0__.GradientUpdater(engine));\n }, refresh);\n}\n\n//# sourceURL=webpack://@tsparticles/updater-gradient/./dist/browser/index.js?");
|
|
118
118
|
|
|
119
119
|
/***/ }),
|
|
120
120
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see tsparticles.updater.gradient.min.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine"],t);else{var a="object"==typeof exports?t(require("@tsparticles/engine")):t(e.window);for(var i in a)("object"==typeof exports?exports:e)[i]=a[i]}}(this,(e=>(()=>{var t={303:t=>{t.exports=e}},a={};function i(e){var n=a[e];if(void 0!==n)return n.exports;var o=a[e]={exports:{}};return t[e](o,o.exports,i),o.exports}i.d=(e,t)=>{for(var a in t)i.o(t,a)&&!i.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};i.r(n),i.d(n,{loadGradientUpdater:()=>g});var o=i(303);class s{constructor(){this.count=0,this.enable=!1,this.speed=0,this.decay=0,this.delay=0,this.sync=!1,this.startValue=o.StartValueType.random}load(e){(0,o.isNull)(e)||(void 0!==e.count&&(this.count=(0,o.setRangeValue)(e.count)),void 0!==e.enable&&(this.enable=e.enable),void 0!==e.speed&&(this.speed=(0,o.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,o.setRangeValue)(e.decay)),void 0!==e.delay&&(this.delay=(0,o.setRangeValue)(e.delay)))}}class l{constructor(){this.value=0,this.animation=new s}load(e){(0,o.isNull)(e)||(this.animation.load(e.animation),void 0!==e.value&&(this.value=(0,o.setRangeValue)(e.value)))}}class r{constructor(){this.stop=0,this.value=new o.AnimatableColor}load(e){(0,o.isNull)(e)||(void 0!==e.stop&&(this.stop=e.stop),this.value=o.AnimatableColor.create(this.value,e.value),void 0!==e.opacity&&(this.opacity=new l,(0,o.isNumber)(e.opacity)?this.opacity.value=e.opacity:this.opacity.load(e.opacity)))}}class c{constructor(){this.count=0,this.enable=!1,this.speed=0,this.decay=0,this.delay=0,this.sync=!1}load(e){(0,o.isNull)(e)||(void 0!==e.count&&(this.count=(0,o.setRangeValue)(e.count)),void 0!==e.enable&&(this.enable=e.enable),void 0!==e.speed&&(this.speed=(0,o.setRangeValue)(e.speed)),void 0!==e.decay&&(this.decay=(0,o.setRangeValue)(e.decay)),void 0!==e.delay&&(this.delay=(0,o.setRangeValue)(e.delay)),void 0!==e.sync&&(this.sync=e.sync))}}class d{constructor(){this.value=0,this.animation=new c,this.direction=o.RotateDirection.clockwise}load(e){(0,o.isNull)(e)||(this.animation.load(e.animation),void 0!==e.value&&(this.value=(0,o.setRangeValue)(e.value)),void 0!==e.direction&&(this.direction=e.direction))}}class u{constructor(){this.angle=new d,this.colors=[],this.type=o.GradientType.random}load(e){(0,o.isNull)(e)||(this.angle.load(e.angle),void 0!==e.colors&&(this.colors=e.colors.map((e=>{const t=new r;return t.load(e),t}))),void 0!==e.type&&(this.type=e.type))}}const p=2*Math.PI;class y{constructor(e){this._engine=e}getColorStyles(e,t,a,i){const n=e.gradient;if(!n)return{};const s=n.angle.value,l=0,r=0,c=n.type===o.GradientType.radial?t.createRadialGradient(l,r,0,l,r,a):t.createLinearGradient(Math.cos(s)*-a,Math.sin(s)*-a,Math.cos(s)*a,Math.sin(s)*a);for(const{stop:e,value:t,opacity:a}of n.colors)c.addColorStop(e,(0,o.getStyleFromHsl)({h:t.h.value,s:t.s.value,l:t.l.value},a?.value??i));return{fill:c}}init(e){const t=(0,o.itemFromSingleOrMultiple)(e.options.gradient);if(!t)return;const{angle:a}=t;e.gradient={angle:{value:(0,o.getRangeValue)(a.value),enable:a.animation.enable,velocity:(0,o.getRangeValue)(a.animation.speed)/360*e.container.retina.reduceFactor,decay:1-(0,o.getRangeValue)(a.animation.decay),delayTime:(0,o.getRangeValue)(a.animation.delay)*o.millisecondsToSeconds,max:p,min:0,time:0},type:t.type,colors:[]};let i=t.angle.direction;switch(i===o.RotateDirection.random&&(i=(0,o.getRandom)()>o.half?o.RotateDirection.counterClockwise:o.RotateDirection.clockwise),i){case o.RotateDirection.counterClockwise:case"counterClockwise":e.gradient.angle.status=o.AnimationStatus.decreasing;break;case o.RotateDirection.clockwise:e.gradient.angle.status=o.AnimationStatus.increasing}const n=e.options.reduceDuplicates;for(const a of t.colors){const t=(0,o.rangeColorToHsl)(this._engine,a.value,e.id,n);if(!t)continue;const i=(0,o.getHslAnimationFromHsl)(t,a.value.animation,e.container.retina.reduceFactor),s={stop:a.stop,value:i,opacity:a.opacity?{enable:a.opacity.animation.enable,max:(0,o.getRangeMax)(a.opacity.value),min:(0,o.getRangeMin)(a.opacity.value),status:o.AnimationStatus.increasing,value:(0,o.getRangeValue)(a.opacity.value),velocity:(0,o.getRangeValue)(a.opacity.animation.speed)/o.percentDenominator*e.container.retina.reduceFactor,decay:1-(0,o.getRangeValue)(a.opacity.animation.decay),delayTime:(0,o.getRangeValue)(a.opacity.animation.delay)*o.millisecondsToSeconds,time:0}:void 0},{opacity:l}=s;if(a.opacity&&l){const e=a.opacity.value;l.min=(0,o.getRangeMin)(e),l.max=(0,o.getRangeMax)(e);switch(a.opacity.animation.startValue){case o.StartValueType.min:l.value=l.min,l.status=o.AnimationStatus.increasing;break;case o.StartValueType.max:l.value=l.max,l.status=o.AnimationStatus.decreasing;break;case o.StartValueType.random:default:l.value=(0,o.randomInRange)(l),l.status=(0,o.getRandom)()>=o.half?o.AnimationStatus.increasing:o.AnimationStatus.decreasing}}e.gradient.colors.push(s)}}isEnabled(e){return!e.destroyed&&!e.spawning&&(!!e.gradient?.angle.enable||(e.gradient?.colors.some((e=>e.value.h.enable||e.value.s.enable||e.value.l.enable))??!1))}loadOptions(e,...t){for(const a of t){if(!a?.gradient)continue;const t=a.gradient;t&&(e.gradient=(0,o.executeOnSingleOrMultiple)(t,(e=>{const t=new u;return t.load(e),t})))}}update(e,t){!function(e,t){const{gradient:a}=e;if(a){(0,o.updateAnimation)(e,a.angle,!1,o.DestroyType.none,t);for(const i of a.colors)(0,o.updateColor)(i.value,t),i.opacity&&(0,o.updateAnimation)(e,i.opacity,!0,o.DestroyType.none,t)}}(e,t)}}async function g(e,t=!0){e.checkVersion("3.8.
|
|
2
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine"],t);else{var a="object"==typeof exports?t(require("@tsparticles/engine")):t(e.window);for(var i in a)("object"==typeof exports?exports:e)[i]=a[i]}}(this,(e=>(()=>{var t={303:t=>{t.exports=e}},a={};function i(e){var n=a[e];if(void 0!==n)return n.exports;var o=a[e]={exports:{}};return t[e](o,o.exports,i),o.exports}i.d=(e,t)=>{for(var a in t)i.o(t,a)&&!i.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};i.r(n),i.d(n,{loadGradientUpdater:()=>g});var o=i(303);class s{constructor(){this.count=0,this.enable=!1,this.speed=0,this.decay=0,this.delay=0,this.sync=!1,this.startValue=o.StartValueType.random}load(e){(0,o.isNull)(e)||(void 0!==e.count&&(this.count=(0,o.setRangeValue)(e.count)),void 0!==e.enable&&(this.enable=e.enable),void 0!==e.speed&&(this.speed=(0,o.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,o.setRangeValue)(e.decay)),void 0!==e.delay&&(this.delay=(0,o.setRangeValue)(e.delay)))}}class l{constructor(){this.value=0,this.animation=new s}load(e){(0,o.isNull)(e)||(this.animation.load(e.animation),void 0!==e.value&&(this.value=(0,o.setRangeValue)(e.value)))}}class r{constructor(){this.stop=0,this.value=new o.AnimatableColor}load(e){(0,o.isNull)(e)||(void 0!==e.stop&&(this.stop=e.stop),this.value=o.AnimatableColor.create(this.value,e.value),void 0!==e.opacity&&(this.opacity=new l,(0,o.isNumber)(e.opacity)?this.opacity.value=e.opacity:this.opacity.load(e.opacity)))}}class c{constructor(){this.count=0,this.enable=!1,this.speed=0,this.decay=0,this.delay=0,this.sync=!1}load(e){(0,o.isNull)(e)||(void 0!==e.count&&(this.count=(0,o.setRangeValue)(e.count)),void 0!==e.enable&&(this.enable=e.enable),void 0!==e.speed&&(this.speed=(0,o.setRangeValue)(e.speed)),void 0!==e.decay&&(this.decay=(0,o.setRangeValue)(e.decay)),void 0!==e.delay&&(this.delay=(0,o.setRangeValue)(e.delay)),void 0!==e.sync&&(this.sync=e.sync))}}class d{constructor(){this.value=0,this.animation=new c,this.direction=o.RotateDirection.clockwise}load(e){(0,o.isNull)(e)||(this.animation.load(e.animation),void 0!==e.value&&(this.value=(0,o.setRangeValue)(e.value)),void 0!==e.direction&&(this.direction=e.direction))}}class u{constructor(){this.angle=new d,this.colors=[],this.type=o.GradientType.random}load(e){(0,o.isNull)(e)||(this.angle.load(e.angle),void 0!==e.colors&&(this.colors=e.colors.map((e=>{const t=new r;return t.load(e),t}))),void 0!==e.type&&(this.type=e.type))}}const p=2*Math.PI;class y{constructor(e){this._engine=e}getColorStyles(e,t,a,i){const n=e.gradient;if(!n)return{};const s=n.angle.value,l=0,r=0,c=n.type===o.GradientType.radial?t.createRadialGradient(l,r,0,l,r,a):t.createLinearGradient(Math.cos(s)*-a,Math.sin(s)*-a,Math.cos(s)*a,Math.sin(s)*a);for(const{stop:e,value:t,opacity:a}of n.colors)c.addColorStop(e,(0,o.getStyleFromHsl)({h:t.h.value,s:t.s.value,l:t.l.value},a?.value??i));return{fill:c}}init(e){const t=(0,o.itemFromSingleOrMultiple)(e.options.gradient);if(!t)return;const{angle:a}=t;e.gradient={angle:{value:(0,o.getRangeValue)(a.value),enable:a.animation.enable,velocity:(0,o.getRangeValue)(a.animation.speed)/360*e.container.retina.reduceFactor,decay:1-(0,o.getRangeValue)(a.animation.decay),delayTime:(0,o.getRangeValue)(a.animation.delay)*o.millisecondsToSeconds,max:p,min:0,time:0},type:t.type,colors:[]};let i=t.angle.direction;switch(i===o.RotateDirection.random&&(i=(0,o.getRandom)()>o.half?o.RotateDirection.counterClockwise:o.RotateDirection.clockwise),i){case o.RotateDirection.counterClockwise:case"counterClockwise":e.gradient.angle.status=o.AnimationStatus.decreasing;break;case o.RotateDirection.clockwise:e.gradient.angle.status=o.AnimationStatus.increasing}const n=e.options.reduceDuplicates;for(const a of t.colors){const t=(0,o.rangeColorToHsl)(this._engine,a.value,e.id,n);if(!t)continue;const i=(0,o.getHslAnimationFromHsl)(t,a.value.animation,e.container.retina.reduceFactor),s={stop:a.stop,value:i,opacity:a.opacity?{enable:a.opacity.animation.enable,max:(0,o.getRangeMax)(a.opacity.value),min:(0,o.getRangeMin)(a.opacity.value),status:o.AnimationStatus.increasing,value:(0,o.getRangeValue)(a.opacity.value),velocity:(0,o.getRangeValue)(a.opacity.animation.speed)/o.percentDenominator*e.container.retina.reduceFactor,decay:1-(0,o.getRangeValue)(a.opacity.animation.decay),delayTime:(0,o.getRangeValue)(a.opacity.animation.delay)*o.millisecondsToSeconds,time:0}:void 0},{opacity:l}=s;if(a.opacity&&l){const e=a.opacity.value;l.min=(0,o.getRangeMin)(e),l.max=(0,o.getRangeMax)(e);switch(a.opacity.animation.startValue){case o.StartValueType.min:l.value=l.min,l.status=o.AnimationStatus.increasing;break;case o.StartValueType.max:l.value=l.max,l.status=o.AnimationStatus.decreasing;break;case o.StartValueType.random:default:l.value=(0,o.randomInRange)(l),l.status=(0,o.getRandom)()>=o.half?o.AnimationStatus.increasing:o.AnimationStatus.decreasing}}e.gradient.colors.push(s)}}isEnabled(e){return!e.destroyed&&!e.spawning&&(!!e.gradient?.angle.enable||(e.gradient?.colors.some((e=>e.value.h.enable||e.value.s.enable||e.value.l.enable))??!1))}loadOptions(e,...t){for(const a of t){if(!a?.gradient)continue;const t=a.gradient;t&&(e.gradient=(0,o.executeOnSingleOrMultiple)(t,(e=>{const t=new u;return t.load(e),t})))}}update(e,t){!function(e,t){const{gradient:a}=e;if(a){(0,o.updateAnimation)(e,a.angle,!1,o.DestroyType.none,t);for(const i of a.colors)(0,o.updateColor)(i.value,t),i.opacity&&(0,o.updateAnimation)(e,i.opacity,!0,o.DestroyType.none,t)}}(e,t)}}async function g(e,t=!0){e.checkVersion("3.8.1"),await e.addParticleUpdater("gradient",(()=>Promise.resolve(new y(e))),t)}return n})()));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! tsParticles Gradient Updater v3.8.
|
|
1
|
+
/*! tsParticles Gradient Updater v3.8.1 by Matteo Bruni */
|
package/umd/index.js
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
exports.loadGradientUpdater = loadGradientUpdater;
|
|
13
13
|
const GradientUpdater_js_1 = require("./GradientUpdater.js");
|
|
14
14
|
async function loadGradientUpdater(engine, refresh = true) {
|
|
15
|
-
engine.checkVersion("3.8.
|
|
15
|
+
engine.checkVersion("3.8.1");
|
|
16
16
|
await engine.addParticleUpdater("gradient", () => {
|
|
17
17
|
return Promise.resolve(new GradientUpdater_js_1.GradientUpdater(engine));
|
|
18
18
|
}, refresh);
|