@tsparticles/updater-gradient 4.0.0-beta.12 → 4.0.0-beta.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/browser.js +5 -0
- package/browser/index.js +4 -4
- package/browser/index.lazy.js +9 -0
- package/cjs/browser.js +5 -0
- package/cjs/index.js +4 -4
- package/cjs/index.lazy.js +9 -0
- package/esm/browser.js +5 -0
- package/esm/index.js +4 -4
- package/esm/index.lazy.js +9 -0
- package/package.json +9 -2
- package/report.html +4949 -94
- package/tsparticles.updater.gradient.js +343 -310
- package/tsparticles.updater.gradient.min.js +1 -2
- package/types/browser.d.ts +1 -0
- package/types/index.lazy.d.ts +2 -0
- package/558.min.js +0 -1
- package/dist_browser_GradientUpdater_js.js +0 -100
|
@@ -1,2 +1 @@
|
|
|
1
|
-
!function(e,t){
|
|
2
|
-
(`+n+": "+i+")",s.name="ChunkLoadError",s.type=n,s.request=i,o[1](s)}},"chunk-"+e,e)}},r=(e,r)=>{var o,n,[i,s,p]=r,c=0;if(i.some(e=>0!==t[e])){for(o in s)a.o(s,o)&&(a.m[o]=s[o]);p&&p(a)}for(e&&e(r);c<i.length;c++)n=i[c],a.o(t,n)&&t[n]&&t[n][0](),t[n]=0},(o=this.webpackChunk_tsparticles_updater_gradient=this.webpackChunk_tsparticles_updater_gradient||[]).forEach(r.bind(null,0)),o.push=r.bind(null,o.push.bind(o));var d={};async function f(e){e.checkVersion("4.0.0-beta.12"),await e.pluginManager.register(e=>{e.pluginManager.addParticleUpdater("gradient",async t=>{let{GradientUpdater:r}=await a.e(558).then(a.bind(a,558));return new r(e.pluginManager,t)})})}return a.r(d),a.d(d,{loadGradientUpdater:()=>f}),d})());
|
|
1
|
+
!function(t){t.__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.bundles=t.__tsParticlesInternals.bundles||{},t.__tsParticlesInternals.effects=t.__tsParticlesInternals.effects||{},t.__tsParticlesInternals.engine=t.__tsParticlesInternals.engine||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.palettes=t.__tsParticlesInternals.palettes||{},t.__tsParticlesInternals.paths=t.__tsParticlesInternals.paths||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins.emittersShapes=t.__tsParticlesInternals.plugins.emittersShapes||{},t.__tsParticlesInternals.presets=t.__tsParticlesInternals.presets||{},t.__tsParticlesInternals.shapes=t.__tsParticlesInternals.shapes||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.utils=t.__tsParticlesInternals.utils||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas.utils=t.__tsParticlesInternals.canvas.utils||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path.utils=t.__tsParticlesInternals.path.utils||{};var e="undefined"!=typeof Proxy?function(t){return new Proxy(t,{get:function(t,e){return e in t||(t[e]={}),t[e]}})}:function(t){return t};t.__tsParticlesInternals.bundles=e(t.__tsParticlesInternals.bundles),t.__tsParticlesInternals.effects=e(t.__tsParticlesInternals.effects),t.__tsParticlesInternals.interactions=e(t.__tsParticlesInternals.interactions),t.__tsParticlesInternals.palettes=e(t.__tsParticlesInternals.palettes),t.__tsParticlesInternals.paths=e(t.__tsParticlesInternals.paths),t.__tsParticlesInternals.plugins=e(t.__tsParticlesInternals.plugins),t.__tsParticlesInternals.plugins.emittersShapes=e(t.__tsParticlesInternals.plugins.emittersShapes),t.__tsParticlesInternals.presets=e(t.__tsParticlesInternals.presets),t.__tsParticlesInternals.shapes=e(t.__tsParticlesInternals.shapes),t.__tsParticlesInternals.updaters=e(t.__tsParticlesInternals.updaters),t.__tsParticlesInternals.utils=e(t.__tsParticlesInternals.utils),t.__tsParticlesInternals.canvas=e(t.__tsParticlesInternals.canvas),t.__tsParticlesInternals.path=e(t.__tsParticlesInternals.path),t.tsparticlesInternalExports=t.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@tsparticles/engine")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/engine"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.updaters.gradient=t.__tsParticlesInternals.updaters.gradient||{}),t.__tsParticlesInternals.engine)}(this,function(t,e){"use strict";class a{count;decay;delay;enable;speed;startValue;sync;constructor(){this.count=0,this.enable=!1,this.speed=0,this.decay=0,this.delay=0,this.sync=!1,this.startValue=e.StartValueType.random}load(t){e.isNull(t)||(void 0!==t.count&&(this.count=e.setRangeValue(t.count)),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.speed&&(this.speed=e.setRangeValue(t.speed)),void 0!==t.sync&&(this.sync=t.sync),void 0!==t.startValue&&(this.startValue=t.startValue),void 0!==t.decay&&(this.decay=e.setRangeValue(t.decay)),void 0!==t.delay&&(this.delay=e.setRangeValue(t.delay)))}}class s{animation;value;constructor(){this.value=0,this.animation=new a}load(t){e.isNull(t)||(this.animation.load(t.animation),void 0!==t.value&&(this.value=e.setRangeValue(t.value)))}}class n{opacity;stop;value;constructor(){this.stop=0,this.value=new e.AnimatableColor}load(t){e.isNull(t)||(void 0!==t.stop&&(this.stop=t.stop),this.value=e.AnimatableColor.create(this.value,t.value),void 0!==t.opacity&&(this.opacity=new s,e.isNumber(t.opacity)?this.opacity.value=t.opacity:this.opacity.load(t.opacity)))}}class i{count;decay;delay;enable;speed;sync;constructor(){this.count=0,this.enable=!1,this.speed=0,this.decay=0,this.delay=0,this.sync=!1}load(t){e.isNull(t)||(void 0!==t.count&&(this.count=e.setRangeValue(t.count)),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.speed&&(this.speed=e.setRangeValue(t.speed)),void 0!==t.decay&&(this.decay=e.setRangeValue(t.decay)),void 0!==t.delay&&(this.delay=e.setRangeValue(t.delay)),void 0!==t.sync&&(this.sync=t.sync))}}class l{animation;direction;value;constructor(){this.value=0,this.animation=new i,this.direction=e.RotateDirection.clockwise}load(t){e.isNull(t)||(this.animation.load(t.animation),void 0!==t.value&&(this.value=e.setRangeValue(t.value)),void 0!==t.direction&&(this.direction=t.direction))}}class r{angle;colors;type;constructor(){this.angle=new l,this.colors=[],this.type=e.GradientType.random}load(t){e.isNull(t)||(this.angle.load(t.angle),void 0!==t.colors&&(this.colors=t.colors.map(t=>{const e=new n;return e.load(t),e})),void 0!==t.type&&(this.type=t.type))}}class o{_container;_pluginManager;constructor(t,e){this._pluginManager=t,this._container=e}getColorStyles(t,a,s,n){const i=t.gradient;if(!i)return{};const{_container:l}=this,r=i.angle.value,o=0,c=0,u=i.type===e.GradientType.radial?a.createRadialGradient(o,c,0,o,c,s):a.createLinearGradient(Math.cos(r)*-s,Math.sin(r)*-s,Math.cos(r)*s,Math.sin(r)*s);for(const{stop:t,value:a,opacity:s}of i.colors){const i={h:a.h.value,s:a.s.value,l:a.l.value};u.addColorStop(t,e.getStyleFromHsl(i,l.hdr,s?.value??n))}return{fill:u}}init(t){const a=e.itemFromSingleOrMultiple(t.options.gradient);if(!a)return;const s=this._container,{angle:n}=a;t.gradient={angle:{value:e.getRangeValue(n.value),enable:n.animation.enable,velocity:e.getRangeValue(n.animation.speed)/360*s.retina.reduceFactor,decay:1-e.getRangeValue(n.animation.decay),delayTime:e.getRangeValue(n.animation.delay)*e.millisecondsToSeconds,max:e.doublePI,min:0,time:0},type:a.type,colors:[]};let i=a.angle.direction;switch(i===e.RotateDirection.random&&(i=e.getRandom()>e.half?e.RotateDirection.counterClockwise:e.RotateDirection.clockwise),i){case e.RotateDirection.counterClockwise:case"counterClockwise":t.gradient.angle.status=e.AnimationStatus.decreasing;break;case e.RotateDirection.clockwise:t.gradient.angle.status=e.AnimationStatus.increasing}const l=t.options.reduceDuplicates;for(const n of a.colors){const a=e.rangeColorToHsl(this._pluginManager,n.value,t.id,l);if(!a)continue;const i=e.getHslAnimationFromHsl(a,n.value.animation,s.retina.reduceFactor),r={stop:n.stop,value:i,opacity:n.opacity?{enable:n.opacity.animation.enable,max:e.getRangeMax(n.opacity.value),min:e.getRangeMin(n.opacity.value),status:e.AnimationStatus.increasing,value:e.getRangeValue(n.opacity.value),velocity:e.getRangeValue(n.opacity.animation.speed)/e.percentDenominator*s.retina.reduceFactor,decay:1-e.getRangeValue(n.opacity.animation.decay),delayTime:e.getRangeValue(n.opacity.animation.delay)*e.millisecondsToSeconds,time:0}:void 0},{opacity:o}=r;if(n.opacity&&o){const t=n.opacity.value;o.min=e.getRangeMin(t),o.max=e.getRangeMax(t);switch(n.opacity.animation.startValue){case e.StartValueType.min:o.value=o.min,o.status=e.AnimationStatus.increasing;break;case e.StartValueType.max:o.value=o.max,o.status=e.AnimationStatus.decreasing;break;case e.StartValueType.random:default:o.value=e.randomInRangeValue(o),o.status=e.getRandom()>=e.half?e.AnimationStatus.increasing:e.AnimationStatus.decreasing}}t.gradient.colors.push(r)}}isEnabled(t){return!t.destroyed&&!t.spawning&&(!!t.gradient?.angle.enable||(t.gradient?.colors.some(t=>t.value.h.enable||t.value.s.enable||t.value.l.enable)??!1))}loadOptions(t,...a){for(const s of a){if(!s?.gradient)continue;const a=s.gradient;t.gradient=e.executeOnSingleOrMultiple(a,t=>{const e=new r;return e.load(t),e})}}update(t,a){!function(t,a){const{gradient:s}=t;if(s){e.updateAnimation(t,s.angle,!1,e.DestroyType.none,a);for(const n of s.colors)e.updateColor(n.value,a),n.opacity&&e.updateAnimation(t,n.opacity,!0,e.DestroyType.none,a)}}(t,a)}}async function c(t){t.checkVersion("4.0.0-beta.15"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("gradient",e=>Promise.resolve(new o(t.pluginManager,e)))})}const u=globalThis;u.__tsParticlesInternals=u.__tsParticlesInternals??{},u.loadGradientUpdater=c,t.loadGradientUpdater=c}),Object.assign(globalThis.window||globalThis,{loadGradientUpdater:(globalThis.__tsParticlesInternals.updaters.gradient||{}).loadGradientUpdater}),delete(globalThis.window||globalThis).tsparticlesInternalExports;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./index.js";
|
package/558.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(this.webpackChunk_tsparticles_updater_gradient=this.webpackChunk_tsparticles_updater_gradient||[]).push([[558],{558(e,a,t){t.d(a,{GradientUpdater:()=>u});var i=t(303);class n{count;decay;delay;enable;speed;startValue;sync;constructor(){this.count=0,this.enable=!1,this.speed=0,this.decay=0,this.delay=0,this.sync=!1,this.startValue=i.StartValueType.random}load(e){(0,i.isNull)(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 o{animation;value;constructor(){this.value=0,this.animation=new n}load(e){(0,i.isNull)(e)||(this.animation.load(e.animation),void 0!==e.value&&(this.value=(0,i.setRangeValue)(e.value)))}}class l{opacity;stop;value;constructor(){this.stop=0,this.value=new i.AnimatableColor}load(e){(0,i.isNull)(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 o,(0,i.isNumber)(e.opacity)?this.opacity.value=e.opacity:this.opacity.load(e.opacity)))}}class s{count;decay;delay;enable;speed;sync;constructor(){this.count=0,this.enable=!1,this.speed=0,this.decay=0,this.delay=0,this.sync=!1}load(e){(0,i.isNull)(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{animation;direction;value;constructor(){this.value=0,this.animation=new s,this.direction=i.RotateDirection.clockwise}load(e){(0,i.isNull)(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 r{angle;colors;type;constructor(){this.angle=new c,this.colors=[],this.type=i.GradientType.random}load(e){(0,i.isNull)(e)||(this.angle.load(e.angle),void 0!==e.colors&&(this.colors=e.colors.map(e=>{let a=new l;return a.load(e),a})),void 0!==e.type&&(this.type=e.type))}}class u{_container;_pluginManager;constructor(e,a){this._pluginManager=e,this._container=a}getColorStyles(e,a,t,n){let o=e.gradient;if(!o)return{};let{_container:l}=this,s=o.angle.value,c=o.type===i.GradientType.radial?a.createRadialGradient(0,0,0,0,0,t):a.createLinearGradient(-(Math.cos(s)*t),-(Math.sin(s)*t),Math.cos(s)*t,Math.sin(s)*t);for(let{stop:e,value:a,opacity:t}of o.colors){let o={h:a.h.value,s:a.s.value,l:a.l.value};c.addColorStop(e,(0,i.getStyleFromHsl)(o,l.hdr,t?.value??n))}return{fill:c}}init(e){let a=(0,i.itemFromSingleOrMultiple)(e.options.gradient);if(!a)return;let t=this._container,{angle:n}=a;e.gradient={angle:{value:(0,i.getRangeValue)(n.value),enable:n.animation.enable,velocity:(0,i.getRangeValue)(n.animation.speed)/360*t.retina.reduceFactor,decay:1-(0,i.getRangeValue)(n.animation.decay),delayTime:(0,i.getRangeValue)(n.animation.delay)*i.millisecondsToSeconds,max:i.doublePI,min:0,time:0},type:a.type,colors:[]};let o=a.angle.direction;switch(o===i.RotateDirection.random&&(o=(0,i.getRandom)()>i.half?i.RotateDirection.counterClockwise:i.RotateDirection.clockwise),o){case i.RotateDirection.counterClockwise:case"counterClockwise":e.gradient.angle.status=i.AnimationStatus.decreasing;break;case i.RotateDirection.clockwise:e.gradient.angle.status=i.AnimationStatus.increasing}let l=e.options.reduceDuplicates;for(let n of a.colors){let a=(0,i.rangeColorToHsl)(this._pluginManager,n.value,e.id,l);if(!a)continue;let o=(0,i.getHslAnimationFromHsl)(a,n.value.animation,t.retina.reduceFactor),s={stop:n.stop,value:o,opacity:n.opacity?{enable:n.opacity.animation.enable,max:(0,i.getRangeMax)(n.opacity.value),min:(0,i.getRangeMin)(n.opacity.value),status:i.AnimationStatus.increasing,value:(0,i.getRangeValue)(n.opacity.value),velocity:(0,i.getRangeValue)(n.opacity.animation.speed)/i.percentDenominator*t.retina.reduceFactor,decay:1-(0,i.getRangeValue)(n.opacity.animation.decay),delayTime:(0,i.getRangeValue)(n.opacity.animation.delay)*i.millisecondsToSeconds,time:0}:void 0},{opacity:c}=s;if(n.opacity&&c){let e=n.opacity.value;switch(c.min=(0,i.getRangeMin)(e),c.max=(0,i.getRangeMax)(e),n.opacity.animation.startValue){case i.StartValueType.min:c.value=c.min,c.status=i.AnimationStatus.increasing;break;case i.StartValueType.max:c.value=c.max,c.status=i.AnimationStatus.decreasing;break;case i.StartValueType.random:default:c.value=(0,i.randomInRangeValue)(c),c.status=(0,i.getRandom)()>=i.half?i.AnimationStatus.increasing:i.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,...a){for(let t of a){if(!t?.gradient)continue;let a=t.gradient;e.gradient=(0,i.executeOnSingleOrMultiple)(a,e=>{let a=new r;return a.load(e),a})}}update(e,a){!function(e,a){let{gradient:t}=e;if(t)for(let n of((0,i.updateAnimation)(e,t.angle,!1,i.DestroyType.none,a),t.colors))(0,i.updateColor)(n.value,a),n.opacity&&(0,i.updateAnimation)(e,n.opacity,!0,i.DestroyType.none,a)}(e,a)}}}}]);
|
|
@@ -1,100 +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
|
-
* v4.0.0-beta.12
|
|
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___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 _Options_Classes_AnimatableGradient_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Options/Classes/AnimatableGradient.js */ \"./dist/browser/Options/Classes/AnimatableGradient.js\");\n/* harmony import */ var _Utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Utils.js */ \"./dist/browser/Utils.js\");\n\n\n\nclass GradientUpdater {\n _container;\n _pluginManager;\n constructor(pluginManager, container){\n this._pluginManager = pluginManager;\n this._container = container;\n }\n getColorStyles(particle, context, radius, opacity) {\n const gradient = particle.gradient;\n if (!gradient) {\n return {};\n }\n const { _container: container } = this, gradientAngle = gradient.angle.value, origin = {\n x: 0,\n y: 0\n }, minRadius = 0, fillGradient = gradient.type === _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.GradientType.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 { stop, value, opacity: cOpacity } of gradient.colors){\n const hsl = {\n h: value.h.value,\n s: value.s.value,\n l: value.l.value\n };\n fillGradient.addColorStop(stop, (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getStyleFromHsl)(hsl, container.hdr, cOpacity?.value ?? opacity));\n }\n return {\n fill: fillGradient\n };\n }\n init(particle) {\n const gradient = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.itemFromSingleOrMultiple)(particle.options.gradient);\n if (!gradient) {\n return;\n }\n const container = this._container, { angle } = gradient, speedFactor = 360, 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 * 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: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.doublePI,\n min: 0,\n time: 0\n },\n type: gradient.type,\n colors: []\n };\n let rotateDirection = gradient.angle.direction;\n if (rotateDirection === _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.RotateDirection.random) {\n rotateDirection = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRandom)() > _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.half ? _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.RotateDirection.counterClockwise : _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.RotateDirection.clockwise;\n }\n switch(rotateDirection){\n case _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.RotateDirection.counterClockwise:\n case \"counterClockwise\":\n particle.gradient.angle.status = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.AnimationStatus.decreasing;\n break;\n case _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.RotateDirection.clockwise:\n particle.gradient.angle.status = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.AnimationStatus.increasing;\n break;\n default:\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)(this._pluginManager, 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, container.retina.reduceFactor), 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: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.AnimationStatus.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 * 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 }, { opacity: addOpacity } = 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 _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.StartValueType.min:\n addOpacity.value = addOpacity.min;\n addOpacity.status = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.AnimationStatus.increasing;\n break;\n case _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.StartValueType.max:\n addOpacity.value = addOpacity.max;\n addOpacity.status = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.AnimationStatus.decreasing;\n break;\n case _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.StartValueType.random:\n default:\n addOpacity.value = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.randomInRangeValue)(addOpacity);\n addOpacity.status = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRandom)() >= _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.half ? _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.AnimationStatus.increasing : _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.AnimationStatus.decreasing;\n break;\n }\n }\n particle.gradient.colors.push(addColor);\n }\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 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 update(particle, delta) {\n (0,_Utils_js__WEBPACK_IMPORTED_MODULE_2__.updateGradient)(particle, delta);\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/updater-gradient/./dist/browser/GradientUpdater.js?\n}");
|
|
27
|
-
|
|
28
|
-
/***/ },
|
|
29
|
-
|
|
30
|
-
/***/ "./dist/browser/Options/Classes/AnimatableGradient.js"
|
|
31
|
-
/*!************************************************************!*\
|
|
32
|
-
!*** ./dist/browser/Options/Classes/AnimatableGradient.js ***!
|
|
33
|
-
\************************************************************/
|
|
34
|
-
(__unused_webpack___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 _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\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_2__ = __webpack_require__(/*! ./GradientAngle.js */ \"./dist/browser/Options/Classes/GradientAngle.js\");\n\n\n\nclass AnimatableGradient {\n angle;\n colors;\n type;\n constructor(){\n this.angle = new _GradientAngle_js__WEBPACK_IMPORTED_MODULE_2__.GradientAngle();\n this.colors = [];\n this.type = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.GradientType.random;\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(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\n//# sourceURL=webpack://@tsparticles/updater-gradient/./dist/browser/Options/Classes/AnimatableGradient.js?\n}");
|
|
37
|
-
|
|
38
|
-
/***/ },
|
|
39
|
-
|
|
40
|
-
/***/ "./dist/browser/Options/Classes/AnimatableGradientColor.js"
|
|
41
|
-
/*!*****************************************************************!*\
|
|
42
|
-
!*** ./dist/browser/Options/Classes/AnimatableGradientColor.js ***!
|
|
43
|
-
\*****************************************************************/
|
|
44
|
-
(__unused_webpack___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 _GradientColorOpacity_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./GradientColorOpacity.js */ \"./dist/browser/Options/Classes/GradientColorOpacity.js\");\n\n\nclass AnimatableGradientColor {\n opacity;\n stop;\n value;\n constructor(){\n this.stop = 0;\n this.value = new _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.AnimatableColor();\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(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\n//# sourceURL=webpack://@tsparticles/updater-gradient/./dist/browser/Options/Classes/AnimatableGradientColor.js?\n}");
|
|
47
|
-
|
|
48
|
-
/***/ },
|
|
49
|
-
|
|
50
|
-
/***/ "./dist/browser/Options/Classes/GradientAngle.js"
|
|
51
|
-
/*!*******************************************************!*\
|
|
52
|
-
!*** ./dist/browser/Options/Classes/GradientAngle.js ***!
|
|
53
|
-
\*******************************************************/
|
|
54
|
-
(__unused_webpack___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 _GradientAngleAnimation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./GradientAngleAnimation.js */ \"./dist/browser/Options/Classes/GradientAngleAnimation.js\");\n\n\nclass GradientAngle {\n animation;\n direction;\n value;\n constructor(){\n this.value = 0;\n this.animation = new _GradientAngleAnimation_js__WEBPACK_IMPORTED_MODULE_1__.GradientAngleAnimation();\n this.direction = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.RotateDirection.clockwise;\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(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\n//# sourceURL=webpack://@tsparticles/updater-gradient/./dist/browser/Options/Classes/GradientAngle.js?\n}");
|
|
57
|
-
|
|
58
|
-
/***/ },
|
|
59
|
-
|
|
60
|
-
/***/ "./dist/browser/Options/Classes/GradientAngleAnimation.js"
|
|
61
|
-
/*!****************************************************************!*\
|
|
62
|
-
!*** ./dist/browser/Options/Classes/GradientAngleAnimation.js ***!
|
|
63
|
-
\****************************************************************/
|
|
64
|
-
(__unused_webpack___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\nclass GradientAngleAnimation {\n count;\n decay;\n delay;\n enable;\n speed;\n sync;\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 ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(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\n//# sourceURL=webpack://@tsparticles/updater-gradient/./dist/browser/Options/Classes/GradientAngleAnimation.js?\n}");
|
|
67
|
-
|
|
68
|
-
/***/ },
|
|
69
|
-
|
|
70
|
-
/***/ "./dist/browser/Options/Classes/GradientColorOpacity.js"
|
|
71
|
-
/*!**************************************************************!*\
|
|
72
|
-
!*** ./dist/browser/Options/Classes/GradientColorOpacity.js ***!
|
|
73
|
-
\**************************************************************/
|
|
74
|
-
(__unused_webpack___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 _GradientColorOpacityAnimation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./GradientColorOpacityAnimation.js */ \"./dist/browser/Options/Classes/GradientColorOpacityAnimation.js\");\n\n\nclass GradientColorOpacity {\n animation;\n value;\n constructor(){\n this.value = 0;\n this.animation = new _GradientColorOpacityAnimation_js__WEBPACK_IMPORTED_MODULE_1__.GradientColorOpacityAnimation();\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(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\n//# sourceURL=webpack://@tsparticles/updater-gradient/./dist/browser/Options/Classes/GradientColorOpacity.js?\n}");
|
|
77
|
-
|
|
78
|
-
/***/ },
|
|
79
|
-
|
|
80
|
-
/***/ "./dist/browser/Options/Classes/GradientColorOpacityAnimation.js"
|
|
81
|
-
/*!***********************************************************************!*\
|
|
82
|
-
!*** ./dist/browser/Options/Classes/GradientColorOpacityAnimation.js ***!
|
|
83
|
-
\***********************************************************************/
|
|
84
|
-
(__unused_webpack___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\nclass GradientColorOpacityAnimation {\n count;\n decay;\n delay;\n enable;\n speed;\n startValue;\n sync;\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 = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.StartValueType.random;\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(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\n//# sourceURL=webpack://@tsparticles/updater-gradient/./dist/browser/Options/Classes/GradientColorOpacityAnimation.js?\n}");
|
|
87
|
-
|
|
88
|
-
/***/ },
|
|
89
|
-
|
|
90
|
-
/***/ "./dist/browser/Utils.js"
|
|
91
|
-
/*!*******************************!*\
|
|
92
|
-
!*** ./dist/browser/Utils.js ***!
|
|
93
|
-
\*******************************/
|
|
94
|
-
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
95
|
-
|
|
96
|
-
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\nfunction updateGradient(particle, delta) {\n const { gradient } = particle;\n if (!gradient) {\n return;\n }\n (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.updateAnimation)(particle, gradient.angle, false, _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.DestroyType.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, _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.DestroyType.none, delta);\n }\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/updater-gradient/./dist/browser/Utils.js?\n}");
|
|
97
|
-
|
|
98
|
-
/***/ }
|
|
99
|
-
|
|
100
|
-
}]);
|