@tsparticles/updater-life
Advanced tools
Comparing version 3.4.0 to 3.5.0
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.loadLifeUpdater = void 0; | ||
exports.loadLifeUpdater = loadLifeUpdater; | ||
const LifeUpdater_js_1 = require("./LifeUpdater.js"); | ||
@@ -10,2 +10,1 @@ async function loadLifeUpdater(engine, refresh = true) { | ||
} | ||
exports.loadLifeUpdater = loadLifeUpdater; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.updateLife = void 0; | ||
exports.updateLife = updateLife; | ||
const engine_1 = require("@tsparticles/engine"); | ||
@@ -60,2 +60,1 @@ const noTime = 0, infiniteValue = -1, noLife = 0, minCanvasSize = 0; | ||
} | ||
exports.updateLife = updateLife; |
{ | ||
"name": "@tsparticles/updater-life", | ||
"version": "3.4.0", | ||
"version": "3.5.0", | ||
"description": "tsParticles particles life updater", | ||
@@ -90,3 +90,3 @@ "homepage": "https://particles.js.org", | ||
"dependencies": { | ||
"@tsparticles/engine": "^3.4.0" | ||
"@tsparticles/engine": "^3.5.0" | ||
}, | ||
@@ -93,0 +93,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.life.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 n="object"==typeof exports?t(require("@tsparticles/engine")):t(e.window);for(var i in n)("object"==typeof exports?exports:e)[i]=n[i]}}(this,(e=>(()=>{var t={303:t=>{t.exports=e}},n={};function i(e){var o=n[e];if(void 0!==o)return o.exports;var a=n[e]={exports:{}};return t[e](a,a.exports,i),a.exports}i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},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 o={};return(()=>{i.r(o),i.d(o,{loadLifeUpdater:()=>s});var e=i(303);class t extends e.ValueWithRandom{constructor(){super(),this.sync=!1}load(e){e&&(super.load(e),void 0!==e.sync&&(this.sync=e.sync))}}class n extends e.ValueWithRandom{constructor(){super(),this.sync=!1}load(e){e&&(super.load(e),void 0!==e.sync&&(this.sync=e.sync))}}class a{constructor(){this.count=0,this.delay=new t,this.duration=new n}load(e){e&&(void 0!==e.count&&(this.count=e.count),this.delay.load(e.delay),this.duration.load(e.duration))}}class r{constructor(e){this.container=e}init(t){const n=this.container,i=t.options.life;i&&(t.life={delay:n.retina.reduceFactor?(0,e.getRangeValue)(i.delay.value)*(i.delay.sync?1:(0,e.getRandom)())/n.retina.reduceFactor*e.millisecondsToSeconds:0,delayTime:0,duration:n.retina.reduceFactor?(0,e.getRangeValue)(i.duration.value)*(i.duration.sync?1:(0,e.getRandom)())/n.retina.reduceFactor*e.millisecondsToSeconds:0,time:0,count:i.count},t.life.duration<=0&&(t.life.duration=-1),t.life.count<=0&&(t.life.count=-1),t.life&&(t.spawning=t.life.delay>0))}isEnabled(e){return!e.destroyed}loadOptions(e,...t){e.life||(e.life=new a);for(const n of t)e.life.load(n?.life)}update(t,n){this.isEnabled(t)&&t.life&&function(t,n,i){if(!t.life)return;const o=t.life;let a=!1;if(t.spawning){if(o.delayTime+=n.value,!(o.delayTime>=t.life.delay))return;a=!0,t.spawning=!1,o.delayTime=0,o.time=0}if(-1===o.duration)return;if(t.spawning)return;if(a?o.time=0:o.time+=n.value,o.time<o.duration)return;if(o.time=0,t.life.count>0&&t.life.count--,0===t.life.count)return void t.destroy();const r=(0,e.setRangeValue)(0,i.width),s=(0,e.setRangeValue)(0,i.width);t.position.x=(0,e.randomInRange)(r),t.position.y=(0,e.randomInRange)(s),t.spawning=!0,o.delayTime=0,o.time=0,t.reset();const l=t.options.life;l&&(o.delay=(0,e.getRangeValue)(l.delay.value)*e.millisecondsToSeconds,o.duration=(0,e.getRangeValue)(l.duration.value)*e.millisecondsToSeconds)}(t,n,this.container.canvas.size)}}async function s(e,t=!0){await e.addParticleUpdater("life",(async e=>Promise.resolve(new r(e))),t)}})(),o})())); | ||
!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 n="object"==typeof exports?t(require("@tsparticles/engine")):t(e.window);for(var i in n)("object"==typeof exports?exports:e)[i]=n[i]}}(this,(e=>(()=>{var t={303:t=>{t.exports=e}},n={};function i(e){var o=n[e];if(void 0!==o)return o.exports;var a=n[e]={exports:{}};return t[e](a,a.exports,i),a.exports}i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},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 o={};i.r(o),i.d(o,{loadLifeUpdater:()=>c});var a=i(303);class r extends a.ValueWithRandom{constructor(){super(),this.sync=!1}load(e){e&&(super.load(e),void 0!==e.sync&&(this.sync=e.sync))}}class s extends a.ValueWithRandom{constructor(){super(),this.sync=!1}load(e){e&&(super.load(e),void 0!==e.sync&&(this.sync=e.sync))}}class l{constructor(){this.count=0,this.delay=new r,this.duration=new s}load(e){e&&(void 0!==e.count&&(this.count=e.count),this.delay.load(e.delay),this.duration.load(e.duration))}}class d{constructor(e){this.container=e}init(e){const t=this.container,n=e.options.life;n&&(e.life={delay:t.retina.reduceFactor?(0,a.getRangeValue)(n.delay.value)*(n.delay.sync?1:(0,a.getRandom)())/t.retina.reduceFactor*a.millisecondsToSeconds:0,delayTime:0,duration:t.retina.reduceFactor?(0,a.getRangeValue)(n.duration.value)*(n.duration.sync?1:(0,a.getRandom)())/t.retina.reduceFactor*a.millisecondsToSeconds:0,time:0,count:n.count},e.life.duration<=0&&(e.life.duration=-1),e.life.count<=0&&(e.life.count=-1),e.life&&(e.spawning=e.life.delay>0))}isEnabled(e){return!e.destroyed}loadOptions(e,...t){e.life||(e.life=new l);for(const n of t)e.life.load(n?.life)}update(e,t){this.isEnabled(e)&&e.life&&function(e,t,n){if(!e.life)return;const i=e.life;let o=!1;if(e.spawning){if(i.delayTime+=t.value,!(i.delayTime>=e.life.delay))return;o=!0,e.spawning=!1,i.delayTime=0,i.time=0}if(-1===i.duration)return;if(e.spawning)return;if(o?i.time=0:i.time+=t.value,i.time<i.duration)return;if(i.time=0,e.life.count>0&&e.life.count--,0===e.life.count)return void e.destroy();const r=(0,a.setRangeValue)(0,n.width),s=(0,a.setRangeValue)(0,n.width);e.position.x=(0,a.randomInRange)(r),e.position.y=(0,a.randomInRange)(s),e.spawning=!0,i.delayTime=0,i.time=0,e.reset();const l=e.options.life;l&&(i.delay=(0,a.getRangeValue)(l.delay.value)*a.millisecondsToSeconds,i.duration=(0,a.getRangeValue)(l.duration.value)*a.millisecondsToSeconds)}(e,t,this.container.canvas.size)}}async function c(e,t=!0){await e.addParticleUpdater("life",(async e=>Promise.resolve(new d(e))),t)}return o})())); |
@@ -1,1 +0,1 @@ | ||
/*! tsParticles Life Updater v3.4.0 by Matteo Bruni */ | ||
/*! tsParticles Life Updater v3.5.0 by Matteo Bruni */ |
@@ -12,3 +12,3 @@ (function (factory) { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.loadLifeUpdater = void 0; | ||
exports.loadLifeUpdater = loadLifeUpdater; | ||
const LifeUpdater_js_1 = require("./LifeUpdater.js"); | ||
@@ -20,3 +20,2 @@ async function loadLifeUpdater(engine, refresh = true) { | ||
} | ||
exports.loadLifeUpdater = loadLifeUpdater; | ||
}); |
@@ -12,3 +12,3 @@ (function (factory) { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.updateLife = void 0; | ||
exports.updateLife = updateLife; | ||
const engine_1 = require("@tsparticles/engine"); | ||
@@ -70,3 +70,2 @@ const noTime = 0, infiniteValue = -1, noLife = 0, minCanvasSize = 0; | ||
} | ||
exports.updateLife = updateLife; | ||
}); |
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
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
330109
1104
Updated@tsparticles/engine@^3.5.0