New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@tsparticles/updater-gradient

Package Overview
Dependencies
Maintainers
0
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tsparticles/updater-gradient - npm Package Compare versions

Comparing version 3.4.0 to 3.5.0

3

cjs/index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.loadGradientUpdater = void 0;
exports.loadGradientUpdater = loadGradientUpdater;
const GradientUpdater_js_1 = require("./GradientUpdater.js");

@@ -10,2 +10,1 @@ async function loadGradientUpdater(engine, refresh = true) {

}
exports.loadGradientUpdater = loadGradientUpdater;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.updateGradient = void 0;
exports.updateGradient = updateGradient;
const engine_1 = require("@tsparticles/engine");

@@ -18,2 +18,1 @@ function updateGradient(particle, delta) {

}
exports.updateGradient = updateGradient;
{
"name": "@tsparticles/updater-gradient",
"version": "3.4.0",
"version": "3.5.0",
"description": "tsParticles particles gradient updater",

@@ -104,3 +104,3 @@ "homepage": "https://particles.js.org",

"dependencies": {
"@tsparticles/engine": "^3.4.0"
"@tsparticles/engine": "^3.5.0"
},

@@ -107,0 +107,0 @@ "publishConfig": {

@@ -7,3 +7,3 @@ /*!

* How to use? : Check the GitHub README
* v3.4.0
* v3.5.0
*/

@@ -10,0 +10,0 @@ /*

/*! For license information please see tsparticles.updater.gradient.min.js.LICENSE.txt */
!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={};return(()=>{i.r(n),i.d(n,{loadGradientUpdater:()=>u});var e=i(303);class t{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){t&&(void 0!==t.count&&(this.count=(0,e.setRangeValue)(t.count)),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.speed&&(this.speed=(0,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=(0,e.setRangeValue)(t.decay)),void 0!==t.delay&&(this.delay=(0,e.setRangeValue)(t.delay)))}}class a{constructor(){this.value=0,this.animation=new t}load(t){t&&(this.animation.load(t.animation),void 0!==t.value&&(this.value=(0,e.setRangeValue)(t.value)))}}class o{constructor(){this.stop=0,this.value=new e.AnimatableColor}load(t){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 a,(0,e.isNumber)(t.opacity)?this.opacity.value=t.opacity:this.opacity.load(t.opacity)))}}class s{constructor(){this.count=0,this.enable=!1,this.speed=0,this.decay=0,this.delay=0,this.sync=!1}load(t){t&&(void 0!==t.count&&(this.count=(0,e.setRangeValue)(t.count)),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.speed&&(this.speed=(0,e.setRangeValue)(t.speed)),void 0!==t.decay&&(this.decay=(0,e.setRangeValue)(t.decay)),void 0!==t.delay&&(this.delay=(0,e.setRangeValue)(t.delay)),void 0!==t.sync&&(this.sync=t.sync))}}class l{constructor(){this.value=0,this.animation=new s,this.direction=e.RotateDirection.clockwise}load(t){t&&(this.animation.load(t.animation),void 0!==t.value&&(this.value=(0,e.setRangeValue)(t.value)),void 0!==t.direction&&(this.direction=t.direction))}}class r{constructor(){this.angle=new l,this.colors=[],this.type=e.GradientType.random}load(e){e&&(this.angle.load(e.angle),void 0!==e.colors&&(this.colors=e.colors.map((e=>{const t=new o;return t.load(e),t}))),void 0!==e.type&&(this.type=e.type))}}const c=2*Math.PI;class d{getColorStyles(t,a,i,n){const o=t.gradient;if(!o)return{};const s=o.angle.value,l=0,r=0,c=o.type===e.GradientType.radial?a.createRadialGradient(l,r,0,l,r,i):a.createLinearGradient(Math.cos(s)*-i,Math.sin(s)*-i,Math.cos(s)*i,Math.sin(s)*i);for(const{stop:t,value:a,opacity:i}of o.colors)c.addColorStop(t,(0,e.getStyleFromHsl)({h:a.h.value,s:a.s.value,l:a.l.value},i?.value??n));return{fill:c}}init(t){const a=(0,e.itemFromSingleOrMultiple)(t.options.gradient);if(!a)return;const{angle:i}=a;t.gradient={angle:{value:(0,e.getRangeValue)(i.value),enable:i.animation.enable,velocity:(0,e.getRangeValue)(i.animation.speed)/360*t.container.retina.reduceFactor,decay:1-(0,e.getRangeValue)(i.animation.decay),delayTime:(0,e.getRangeValue)(i.animation.delay)*e.millisecondsToSeconds,max:c,min:0,time:0},type:a.type,colors:[]};let n=a.angle.direction;switch(n===e.RotateDirection.random&&(n=(0,e.getRandom)()>e.halfRandom?e.RotateDirection.counterClockwise:e.RotateDirection.clockwise),n){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 o=t.options.reduceDuplicates;for(const i of a.colors){const a=(0,e.rangeColorToHsl)(i.value,t.id,o);if(!a)continue;const n=(0,e.getHslAnimationFromHsl)(a,i.value.animation,t.container.retina.reduceFactor),s={stop:i.stop,value:n,opacity:i.opacity?{enable:i.opacity.animation.enable,max:(0,e.getRangeMax)(i.opacity.value),min:(0,e.getRangeMin)(i.opacity.value),status:e.AnimationStatus.increasing,value:(0,e.getRangeValue)(i.opacity.value),velocity:(0,e.getRangeValue)(i.opacity.animation.speed)/e.percentDenominator*t.container.retina.reduceFactor,decay:1-(0,e.getRangeValue)(i.opacity.animation.decay),delayTime:(0,e.getRangeValue)(i.opacity.animation.delay)*e.millisecondsToSeconds,time:0}:void 0},{opacity:l}=s;if(i.opacity&&l){const t=i.opacity.value;l.min=(0,e.getRangeMin)(t),l.max=(0,e.getRangeMax)(t);switch(i.opacity.animation.startValue){case e.StartValueType.min:l.value=l.min,l.status=e.AnimationStatus.increasing;break;case e.StartValueType.max:l.value=l.max,l.status=e.AnimationStatus.decreasing;break;case e.StartValueType.random:default:l.value=(0,e.randomInRange)(l),l.status=(0,e.getRandom)()>=e.halfRandom?e.AnimationStatus.increasing:e.AnimationStatus.decreasing}}t.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(t,...a){for(const i of a){if(!i?.gradient)continue;const a=i.gradient;a&&(t.gradient=(0,e.executeOnSingleOrMultiple)(a,(e=>{const t=new r;return t.load(e),t})))}}update(t,a){!function(t,a){const{gradient:i}=t;if(i){(0,e.updateAnimation)(t,i.angle,!1,e.DestroyType.none,a);for(const n of i.colors)(0,e.updateColor)(n.value,a),n.opacity&&(0,e.updateAnimation)(t,n.opacity,!0,e.DestroyType.none,a)}}(t,a)}}async function u(e,t=!0){await e.addParticleUpdater("gradient",(()=>Promise.resolve(new d)),t)}})(),n})()));
!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){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){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){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){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){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){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{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.halfRandom?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)(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.halfRandom?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){await e.addParticleUpdater("gradient",(()=>Promise.resolve(new y)),t)}return n})()));

@@ -1,1 +0,1 @@

/*! tsParticles Gradient Updater v3.4.0 by Matteo Bruni */
/*! tsParticles Gradient Updater v3.5.0 by Matteo Bruni */

@@ -12,3 +12,3 @@ (function (factory) {

Object.defineProperty(exports, "__esModule", { value: true });
exports.loadGradientUpdater = void 0;
exports.loadGradientUpdater = loadGradientUpdater;
const GradientUpdater_js_1 = require("./GradientUpdater.js");

@@ -20,3 +20,2 @@ async function loadGradientUpdater(engine, refresh = true) {

}
exports.loadGradientUpdater = loadGradientUpdater;
});

@@ -12,3 +12,3 @@ (function (factory) {

Object.defineProperty(exports, "__esModule", { value: true });
exports.updateGradient = void 0;
exports.updateGradient = updateGradient;
const engine_1 = require("@tsparticles/engine");

@@ -28,3 +28,2 @@ function updateGradient(particle, delta) {

}
exports.updateGradient = updateGradient;
});

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc