tsparticles-updater-stroke-color
Advanced tools
Comparing version 2.0.5 to 2.0.6
{ | ||
"name": "tsparticles-updater-stroke-color", | ||
"version": "2.0.5", | ||
"version": "2.0.6", | ||
"description": "tsParticles particles stroke color updater", | ||
@@ -13,2 +13,4 @@ "homepage": "https://particles.js.org/", | ||
"tsparticles", | ||
"particles.js", | ||
"particlesjs", | ||
"particles", | ||
@@ -20,5 +22,22 @@ "particle", | ||
"particles-js", | ||
"particles.js", | ||
"particles-bg", | ||
"particles-bg-vue", | ||
"particles-ts", | ||
"particles.ts", | ||
"react-particles-js", | ||
"react-particles.js", | ||
"react-particles", | ||
"react", | ||
"reactjs", | ||
"vue-particles", | ||
"ngx-particles", | ||
"angular-particles", | ||
"particleground", | ||
"vue", | ||
"vuejs", | ||
"preact", | ||
"preactjs", | ||
"jquery", | ||
"angularjs", | ||
"angular", | ||
"typescript", | ||
@@ -36,3 +55,12 @@ "javascript", | ||
"background", | ||
"tsparticles-shape" | ||
"confetti", | ||
"canvas", | ||
"fireworks", | ||
"fireworks-js", | ||
"confetti-js", | ||
"confettijs", | ||
"fireworksjs", | ||
"canvas-confetti", | ||
"tsparticles-plugin", | ||
"tsparticles-updater" | ||
], | ||
@@ -44,11 +72,10 @@ "author": "Matteo Bruni", | ||
}, | ||
"main": "index.js", | ||
"main": "cjs/index.js", | ||
"jsdelivr": "tsparticles.updater.stroke-color.min.js", | ||
"unpkg": "tsparticles.updater.stroke-color.min.js", | ||
"browser": "index.js", | ||
"module": "index.js", | ||
"types": "index.d.ts", | ||
"module": "esm/index.js", | ||
"types": "types/index.d.ts", | ||
"dependencies": { | ||
"tsparticles-engine": "^2.0.5" | ||
"tsparticles-engine": "^2.0.6" | ||
} | ||
} |
@@ -7,3 +7,3 @@ /*! | ||
* How to use? : Check the GitHub README | ||
* v2.0.5 | ||
* v2.0.6 | ||
*/ | ||
@@ -19,3 +19,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
} | ||
})(this, function(__WEBPACK_EXTERNAL_MODULE__818__) { | ||
})(this, (__WEBPACK_EXTERNAL_MODULE__818__) => { | ||
return /******/ (() => { // webpackBootstrap | ||
@@ -101,3 +101,3 @@ /******/ "use strict"; | ||
var external_commonjs_tsparticles_engine_commonjs2_tsparticles_engine_amd_tsparticles_engine_root_window_ = __webpack_require__(818); | ||
;// CONCATENATED MODULE: ./dist/StrokeColorUpdater.js | ||
;// CONCATENATED MODULE: ./dist/browser/StrokeColorUpdater.js | ||
@@ -117,7 +117,11 @@ | ||
if (!decrease || colorValue.status === 0) { | ||
if (!decrease || colorValue.status === 0 | ||
/* increasing */ | ||
) { | ||
colorValue.value += velocity; | ||
if (decrease && colorValue.value > max) { | ||
colorValue.status = 1; | ||
colorValue.status = 1 | ||
/* decreasing */ | ||
; | ||
colorValue.value -= colorValue.value % max; | ||
@@ -129,3 +133,5 @@ } | ||
if (colorValue.value < 0) { | ||
colorValue.status = 0; | ||
colorValue.status = 0 | ||
/* increasing */ | ||
; | ||
colorValue.value += colorValue.value; | ||
@@ -176,2 +182,4 @@ } | ||
const container = this.container; | ||
/* strokeColor */ | ||
particle.stroke = particle.options.stroke instanceof Array ? (0,external_commonjs_tsparticles_engine_commonjs2_tsparticles_engine_amd_tsparticles_engine_root_window_.itemFromArray)(particle.options.stroke, particle.id, particle.options.reduceDuplicates) : particle.options.stroke; | ||
@@ -202,40 +210,6 @@ particle.strokeWidth = particle.stroke.width * container.retina.pixelRatio; | ||
} | ||
;// CONCATENATED MODULE: ./dist/index.js | ||
var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { | ||
return value instanceof P ? value : new P(function (resolve) { | ||
resolve(value); | ||
}); | ||
} | ||
;// CONCATENATED MODULE: ./dist/browser/index.js | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { | ||
try { | ||
step(generator.next(value)); | ||
} catch (e) { | ||
reject(e); | ||
} | ||
} | ||
function rejected(value) { | ||
try { | ||
step(generator["throw"](value)); | ||
} catch (e) { | ||
reject(e); | ||
} | ||
} | ||
function step(result) { | ||
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); | ||
} | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
function loadStrokeColorUpdater(engine) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
yield engine.addParticleUpdater("strokeColor", container => new StrokeColorUpdater(container)); | ||
}); | ||
async function loadStrokeColorUpdater(engine) { | ||
await engine.addParticleUpdater("strokeColor", container => new StrokeColorUpdater(container)); | ||
} | ||
@@ -242,0 +216,0 @@ })(); |
@@ -1,2 +0,2 @@ | ||
/*! tsParticles Stroke Color Updater v2.0.5 by Matteo Bruni */ | ||
!function(o,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("tsparticles-engine"));else if("function"==typeof define&&define.amd)define(["tsparticles-engine"],e);else{var t="object"==typeof exports?e(require("tsparticles-engine")):e(o.window);for(var r in t)("object"==typeof exports?exports:o)[r]=t[r]}}(this,(function(o){return(()=>{"use strict";var e={818:e=>{e.exports=o}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var i=t[o]={exports:{}};return e[o](i,i.exports,r),i.exports}r.d=(o,e)=>{for(var t in e)r.o(e,t)&&!r.o(o,t)&&Object.defineProperty(o,t,{enumerable:!0,get:e[t]})},r.o=(o,e)=>Object.prototype.hasOwnProperty.call(o,e),r.r=o=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})};var n={};return(()=>{r.r(n),r.d(n,{loadStrokeColorUpdater:()=>l});var o=r(818);function e(e,t,r,n,i){var l;const a=t;if(!a||!a.enable)return;const s=(0,o.randomInRange)(r.offset),u=(null!==(l=t.velocity)&&void 0!==l?l:0)*e.factor+3.6*s;i&&0!==a.status?(a.value-=u,a.value<0&&(a.status=0,a.value+=a.value)):(a.value+=u,i&&a.value>n&&(a.status=1,a.value-=a.value%n)),a.value>n&&(a.value%=n)}class t{constructor(o){this.container=o}init(e){var t,r;const n=this.container;e.stroke=e.options.stroke instanceof Array?(0,o.itemFromArray)(e.options.stroke,e.id,e.options.reduceDuplicates):e.options.stroke,e.strokeWidth=e.stroke.width*n.retina.pixelRatio;const i=null!==(t=(0,o.colorToHsl)(e.stroke.color))&&void 0!==t?t:e.getFillColor();i&&(e.strokeColor=(0,o.getHslAnimationFromHsl)(i,null===(r=e.stroke.color)||void 0===r?void 0:r.animation,n.retina.reduceFactor))}isEnabled(o){var e,t,r,n;const i=null===(e=o.stroke)||void 0===e?void 0:e.color;return!o.destroyed&&!o.spawning&&!!i&&(void 0!==(null===(t=o.strokeColor)||void 0===t?void 0:t.h.value)&&i.animation.h.enable||void 0!==(null===(r=o.strokeColor)||void 0===r?void 0:r.s.value)&&i.animation.s.enable||void 0!==(null===(n=o.strokeColor)||void 0===n?void 0:n.l.value)&&i.animation.l.enable)}update(o,t){this.isEnabled(o)&&function(o,t){var r,n,i,l,a,s,u,d,v,c;if(!(null===(r=o.stroke)||void 0===r?void 0:r.color))return;const f=o.stroke.color.animation,p=null!==(i=null===(n=o.strokeColor)||void 0===n?void 0:n.h)&&void 0!==i?i:null===(l=o.color)||void 0===l?void 0:l.h;p&&e(t,p,f.h,360,!1);const y=null!==(s=null===(a=o.strokeColor)||void 0===a?void 0:a.s)&&void 0!==s?s:null===(u=o.color)||void 0===u?void 0:u.s;y&&e(t,y,f.s,100,!0);const k=null!==(v=null===(d=o.strokeColor)||void 0===d?void 0:d.l)&&void 0!==v?v:null===(c=o.color)||void 0===c?void 0:c.l;k&&e(t,k,f.l,100,!0)}(o,t)}}var i=function(o,e,t,r){return new(t||(t=Promise))((function(n,i){function l(o){try{s(r.next(o))}catch(o){i(o)}}function a(o){try{s(r.throw(o))}catch(o){i(o)}}function s(o){var e;o.done?n(o.value):(e=o.value,e instanceof t?e:new t((function(o){o(e)}))).then(l,a)}s((r=r.apply(o,e||[])).next())}))};function l(o){return i(this,void 0,void 0,(function*(){yield o.addParticleUpdater("strokeColor",(o=>new t(o)))}))}})(),n})()})); | ||
/*! tsParticles Stroke Color Updater v2.0.6 by Matteo Bruni */ | ||
!function(o,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("tsparticles-engine"));else if("function"==typeof define&&define.amd)define(["tsparticles-engine"],e);else{var t="object"==typeof exports?e(require("tsparticles-engine")):e(o.window);for(var r in t)("object"==typeof exports?exports:o)[r]=t[r]}}(this,(o=>(()=>{"use strict";var e={818:e=>{e.exports=o}},t={};function r(o){var i=t[o];if(void 0!==i)return i.exports;var l=t[o]={exports:{}};return e[o](l,l.exports,r),l.exports}r.d=(o,e)=>{for(var t in e)r.o(e,t)&&!r.o(o,t)&&Object.defineProperty(o,t,{enumerable:!0,get:e[t]})},r.o=(o,e)=>Object.prototype.hasOwnProperty.call(o,e),r.r=o=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})};var i={};return(()=>{r.r(i),r.d(i,{loadStrokeColorUpdater:()=>l});var o=r(818);function e(e,t,r,i,l){var n;const s=t;if(!s||!s.enable)return;const a=(0,o.randomInRange)(r.offset),d=(null!==(n=t.velocity)&&void 0!==n?n:0)*e.factor+3.6*a;l&&0!==s.status?(s.value-=d,s.value<0&&(s.status=0,s.value+=s.value)):(s.value+=d,l&&s.value>i&&(s.status=1,s.value-=s.value%i)),s.value>i&&(s.value%=i)}class t{constructor(o){this.container=o}init(e){var t,r;const i=this.container;e.stroke=e.options.stroke instanceof Array?(0,o.itemFromArray)(e.options.stroke,e.id,e.options.reduceDuplicates):e.options.stroke,e.strokeWidth=e.stroke.width*i.retina.pixelRatio;const l=null!==(t=(0,o.colorToHsl)(e.stroke.color))&&void 0!==t?t:e.getFillColor();l&&(e.strokeColor=(0,o.getHslAnimationFromHsl)(l,null===(r=e.stroke.color)||void 0===r?void 0:r.animation,i.retina.reduceFactor))}isEnabled(o){var e,t,r,i;const l=null===(e=o.stroke)||void 0===e?void 0:e.color;return!o.destroyed&&!o.spawning&&!!l&&(void 0!==(null===(t=o.strokeColor)||void 0===t?void 0:t.h.value)&&l.animation.h.enable||void 0!==(null===(r=o.strokeColor)||void 0===r?void 0:r.s.value)&&l.animation.s.enable||void 0!==(null===(i=o.strokeColor)||void 0===i?void 0:i.l.value)&&l.animation.l.enable)}update(o,t){this.isEnabled(o)&&function(o,t){var r,i,l,n,s,a,d,u,v,c;if(!(null===(r=o.stroke)||void 0===r?void 0:r.color))return;const p=o.stroke.color.animation,f=null!==(l=null===(i=o.strokeColor)||void 0===i?void 0:i.h)&&void 0!==l?l:null===(n=o.color)||void 0===n?void 0:n.h;f&&e(t,f,p.h,360,!1);const k=null!==(a=null===(s=o.strokeColor)||void 0===s?void 0:s.s)&&void 0!==a?a:null===(d=o.color)||void 0===d?void 0:d.s;k&&e(t,k,p.s,100,!0);const y=null!==(v=null===(u=o.strokeColor)||void 0===u?void 0:u.l)&&void 0!==v?v:null===(c=o.color)||void 0===c?void 0:c.l;y&&e(t,y,p.l,100,!0)}(o,t)}}async function l(o){await o.addParticleUpdater("strokeColor",(o=>new t(o)))}})(),i})())); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
309671
565
1
Updatedtsparticles-engine@^2.0.6