Socket
Socket
Sign inDemoInstall

@tsparticles/updater-life

Package Overview
Dependencies
Maintainers
2
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tsparticles/updater-life - npm Package Compare versions

Comparing version 3.3.0 to 3.4.0

4

browser/index.js

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

import { LifeUpdater } from "./LifeUpdater.js";
export async function loadLifeUpdater(engine, refresh = true) {
await engine.addParticleUpdater("life", async (container) => {
const { LifeUpdater } = await import("./LifeUpdater.js");
return new LifeUpdater(container);
return Promise.resolve(new LifeUpdater(container));
}, refresh);
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.loadLifeUpdater = void 0;
const LifeUpdater_js_1 = require("./LifeUpdater.js");
async function loadLifeUpdater(engine, refresh = true) {
await engine.addParticleUpdater("life", async (container) => {
const { LifeUpdater } = await import("./LifeUpdater.js");
return new LifeUpdater(container);
return Promise.resolve(new LifeUpdater_js_1.LifeUpdater(container));
}, refresh);
}
exports.loadLifeUpdater = loadLifeUpdater;

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

import { LifeUpdater } from "./LifeUpdater.js";
export async function loadLifeUpdater(engine, refresh = true) {
await engine.addParticleUpdater("life", async (container) => {
const { LifeUpdater } = await import("./LifeUpdater.js");
return new LifeUpdater(container);
return Promise.resolve(new LifeUpdater(container));
}, refresh);
}
{
"name": "@tsparticles/updater-life",
"version": "3.3.0",
"version": "3.4.0",
"description": "tsParticles particles life updater",

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

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

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

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

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

@@ -32,2 +32,52 @@ /*

/***/ "./dist/browser/LifeUpdater.js":
/*!*************************************!*\
!*** ./dist/browser/LifeUpdater.js ***!
\*************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ LifeUpdater: () => (/* binding */ LifeUpdater)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Options_Classes_Life_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Options/Classes/Life.js */ \"./dist/browser/Options/Classes/Life.js\");\n/* harmony import */ var _Utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Utils.js */ \"./dist/browser/Utils.js\");\n\n\n\nconst noTime = 0,\n identity = 1,\n infiniteValue = -1;\nclass LifeUpdater {\n constructor(container) {\n this.container = container;\n }\n init(particle) {\n const container = this.container,\n particlesOptions = particle.options,\n lifeOptions = particlesOptions.life;\n if (!lifeOptions) {\n return;\n }\n particle.life = {\n delay: container.retina.reduceFactor ? (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(lifeOptions.delay.value) * (lifeOptions.delay.sync ? identity : (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRandom)()) / container.retina.reduceFactor * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.millisecondsToSeconds : noTime,\n delayTime: noTime,\n duration: container.retina.reduceFactor ? (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(lifeOptions.duration.value) * (lifeOptions.duration.sync ? identity : (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRandom)()) / container.retina.reduceFactor * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.millisecondsToSeconds : noTime,\n time: noTime,\n count: lifeOptions.count\n };\n if (particle.life.duration <= noTime) {\n particle.life.duration = infiniteValue;\n }\n if (particle.life.count <= noTime) {\n particle.life.count = infiniteValue;\n }\n if (particle.life) {\n particle.spawning = particle.life.delay > noTime;\n }\n }\n isEnabled(particle) {\n return !particle.destroyed;\n }\n loadOptions(options, ...sources) {\n if (!options.life) {\n options.life = new _Options_Classes_Life_js__WEBPACK_IMPORTED_MODULE_1__.Life();\n }\n for (const source of sources) {\n options.life.load(source?.life);\n }\n }\n update(particle, delta) {\n if (!this.isEnabled(particle) || !particle.life) {\n return;\n }\n (0,_Utils_js__WEBPACK_IMPORTED_MODULE_2__.updateLife)(particle, delta, this.container.canvas.size);\n }\n}\n\n//# sourceURL=webpack://@tsparticles/updater-life/./dist/browser/LifeUpdater.js?");
/***/ }),
/***/ "./dist/browser/Options/Classes/Life.js":
/*!**********************************************!*\
!*** ./dist/browser/Options/Classes/Life.js ***!
\**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Life: () => (/* binding */ Life)\n/* harmony export */ });\n/* harmony import */ var _LifeDelay_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./LifeDelay.js */ \"./dist/browser/Options/Classes/LifeDelay.js\");\n/* harmony import */ var _LifeDuration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./LifeDuration.js */ \"./dist/browser/Options/Classes/LifeDuration.js\");\n\n\nclass Life {\n constructor() {\n this.count = 0;\n this.delay = new _LifeDelay_js__WEBPACK_IMPORTED_MODULE_0__.LifeDelay();\n this.duration = new _LifeDuration_js__WEBPACK_IMPORTED_MODULE_1__.LifeDuration();\n }\n load(data) {\n if (!data) {\n return;\n }\n if (data.count !== undefined) {\n this.count = data.count;\n }\n this.delay.load(data.delay);\n this.duration.load(data.duration);\n }\n}\n\n//# sourceURL=webpack://@tsparticles/updater-life/./dist/browser/Options/Classes/Life.js?");
/***/ }),
/***/ "./dist/browser/Options/Classes/LifeDelay.js":
/*!***************************************************!*\
!*** ./dist/browser/Options/Classes/LifeDelay.js ***!
\***************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ LifeDelay: () => (/* binding */ LifeDelay)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n\nclass LifeDelay extends _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.ValueWithRandom {\n constructor() {\n super();\n this.sync = false;\n }\n load(data) {\n if (!data) {\n return;\n }\n super.load(data);\n if (data.sync !== undefined) {\n this.sync = data.sync;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/updater-life/./dist/browser/Options/Classes/LifeDelay.js?");
/***/ }),
/***/ "./dist/browser/Options/Classes/LifeDuration.js":
/*!******************************************************!*\
!*** ./dist/browser/Options/Classes/LifeDuration.js ***!
\******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ LifeDuration: () => (/* binding */ LifeDuration)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n\nclass LifeDuration extends _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.ValueWithRandom {\n constructor() {\n super();\n this.sync = false;\n }\n load(data) {\n if (!data) {\n return;\n }\n super.load(data);\n if (data.sync !== undefined) {\n this.sync = data.sync;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/updater-life/./dist/browser/Options/Classes/LifeDuration.js?");
/***/ }),
/***/ "./dist/browser/Utils.js":
/*!*******************************!*\
!*** ./dist/browser/Utils.js ***!
\*******************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ updateLife: () => (/* binding */ updateLife)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n\nconst noTime = 0,\n infiniteValue = -1,\n noLife = 0,\n minCanvasSize = 0;\nfunction updateLife(particle, delta, canvasSize) {\n if (!particle.life) {\n return;\n }\n const life = particle.life;\n let justSpawned = false;\n if (particle.spawning) {\n life.delayTime += delta.value;\n if (life.delayTime >= particle.life.delay) {\n justSpawned = true;\n particle.spawning = false;\n life.delayTime = noTime;\n life.time = noTime;\n } else {\n return;\n }\n }\n if (life.duration === infiniteValue) {\n return;\n }\n if (particle.spawning) {\n return;\n }\n if (justSpawned) {\n life.time = noTime;\n } else {\n life.time += delta.value;\n }\n if (life.time < life.duration) {\n return;\n }\n life.time = noTime;\n if (particle.life.count > noLife) {\n particle.life.count--;\n }\n if (particle.life.count === noLife) {\n particle.destroy();\n return;\n }\n const widthRange = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(minCanvasSize, canvasSize.width),\n heightRange = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(minCanvasSize, canvasSize.width);\n particle.position.x = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.randomInRange)(widthRange);\n particle.position.y = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.randomInRange)(heightRange);\n particle.spawning = true;\n life.delayTime = noTime;\n life.time = noTime;\n particle.reset();\n const lifeOptions = particle.options.life;\n if (lifeOptions) {\n life.delay = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(lifeOptions.delay.value) * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.millisecondsToSeconds;\n life.duration = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(lifeOptions.duration.value) * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.millisecondsToSeconds;\n }\n}\n\n//# sourceURL=webpack://@tsparticles/updater-life/./dist/browser/Utils.js?");
/***/ }),
/***/ "./dist/browser/index.js":

@@ -39,3 +89,3 @@ /*!*******************************!*\

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadLifeUpdater: () => (/* binding */ loadLifeUpdater)\n/* harmony export */ });\nasync function loadLifeUpdater(engine, refresh = true) {\n await engine.addParticleUpdater(\"life\", async container => {\n const {\n LifeUpdater\n } = await __webpack_require__.e(/*! import() */ \"dist_browser_LifeUpdater_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./LifeUpdater.js */ \"./dist/browser/LifeUpdater.js\"));\n return new LifeUpdater(container);\n }, refresh);\n}\n\n//# sourceURL=webpack://@tsparticles/updater-life/./dist/browser/index.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadLifeUpdater: () => (/* binding */ loadLifeUpdater)\n/* harmony export */ });\n/* harmony import */ var _LifeUpdater_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./LifeUpdater.js */ \"./dist/browser/LifeUpdater.js\");\n\nasync function loadLifeUpdater(engine, refresh = true) {\n await engine.addParticleUpdater(\"life\", async container => {\n return Promise.resolve(new _LifeUpdater_js__WEBPACK_IMPORTED_MODULE_0__.LifeUpdater(container));\n }, refresh);\n}\n\n//# sourceURL=webpack://@tsparticles/updater-life/./dist/browser/index.js?");

@@ -80,5 +130,2 @@ /***/ }),

/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = __webpack_modules__;
/******/
/************************************************************************/

@@ -109,36 +156,2 @@ /******/ /* webpack/runtime/compat get default export */

/******/
/******/ /* webpack/runtime/ensure chunk */
/******/ (() => {
/******/ __webpack_require__.f = {};
/******/ // This file contains only the entry chunk.
/******/ // The chunk loading function for additional chunks
/******/ __webpack_require__.e = (chunkId) => {
/******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
/******/ __webpack_require__.f[key](chunkId, promises);
/******/ return promises;
/******/ }, []));
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/get javascript chunk filename */
/******/ (() => {
/******/ // This function allow to reference async chunks
/******/ __webpack_require__.u = (chunkId) => {
/******/ // return url for filenames based on template
/******/ return "" + chunkId + ".js";
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/global */
/******/ (() => {
/******/ __webpack_require__.g = (function() {
/******/ if (typeof globalThis === 'object') return globalThis;
/******/ try {
/******/ return this || new Function('return this')();
/******/ } catch (e) {
/******/ if (typeof window === 'object') return window;
/******/ }
/******/ })();
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */

@@ -149,48 +162,2 @@ /******/ (() => {

/******/
/******/ /* webpack/runtime/load script */
/******/ (() => {
/******/ var inProgress = {};
/******/ var dataWebpackPrefix = "@tsparticles/updater-life:";
/******/ // loadScript function to load a script via script tag
/******/ __webpack_require__.l = (url, done, key, chunkId) => {
/******/ if(inProgress[url]) { inProgress[url].push(done); return; }
/******/ var script, needAttach;
/******/ if(key !== undefined) {
/******/ var scripts = document.getElementsByTagName("script");
/******/ for(var i = 0; i < scripts.length; i++) {
/******/ var s = scripts[i];
/******/ if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; }
/******/ }
/******/ }
/******/ if(!script) {
/******/ needAttach = true;
/******/ script = document.createElement('script');
/******/
/******/ script.charset = 'utf-8';
/******/ script.timeout = 120;
/******/ if (__webpack_require__.nc) {
/******/ script.setAttribute("nonce", __webpack_require__.nc);
/******/ }
/******/ script.setAttribute("data-webpack", dataWebpackPrefix + key);
/******/
/******/ script.src = url;
/******/ }
/******/ inProgress[url] = [done];
/******/ var onScriptComplete = (prev, event) => {
/******/ // avoid mem leaks in IE.
/******/ script.onerror = script.onload = null;
/******/ clearTimeout(timeout);
/******/ var doneFns = inProgress[url];
/******/ delete inProgress[url];
/******/ script.parentNode && script.parentNode.removeChild(script);
/******/ doneFns && doneFns.forEach((fn) => (fn(event)));
/******/ if(prev) return prev(event);
/******/ }
/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
/******/ script.onerror = onScriptComplete.bind(null, script.onerror);
/******/ script.onload = onScriptComplete.bind(null, script.onload);
/******/ needAttach && document.head.appendChild(script);
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */

@@ -207,117 +174,2 @@ /******/ (() => {

/******/
/******/ /* webpack/runtime/publicPath */
/******/ (() => {
/******/ var scriptUrl;
/******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
/******/ var document = __webpack_require__.g.document;
/******/ if (!scriptUrl && document) {
/******/ if (document.currentScript)
/******/ scriptUrl = document.currentScript.src;
/******/ if (!scriptUrl) {
/******/ var scripts = document.getElementsByTagName("script");
/******/ if(scripts.length) {
/******/ var i = scripts.length - 1;
/******/ while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;
/******/ }
/******/ }
/******/ }
/******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
/******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
/******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
/******/ scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
/******/ __webpack_require__.p = scriptUrl;
/******/ })();
/******/
/******/ /* webpack/runtime/jsonp chunk loading */
/******/ (() => {
/******/ // no baseURI
/******/
/******/ // object to store loaded and loading chunks
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
/******/ var installedChunks = {
/******/ "tsparticles.updater.life": 0
/******/ };
/******/
/******/ __webpack_require__.f.j = (chunkId, promises) => {
/******/ // JSONP chunk loading for javascript
/******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;
/******/ if(installedChunkData !== 0) { // 0 means "already installed".
/******/
/******/ // a Promise means "currently loading".
/******/ if(installedChunkData) {
/******/ promises.push(installedChunkData[2]);
/******/ } else {
/******/ if(true) { // all chunks have JS
/******/ // setup Promise in chunk cache
/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));
/******/ promises.push(installedChunkData[2] = promise);
/******/
/******/ // start chunk loading
/******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId);
/******/ // create error before stack unwound to get useful stacktrace later
/******/ var error = new Error();
/******/ var loadingEnded = (event) => {
/******/ if(__webpack_require__.o(installedChunks, chunkId)) {
/******/ installedChunkData = installedChunks[chunkId];
/******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined;
/******/ if(installedChunkData) {
/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
/******/ var realSrc = event && event.target && event.target.src;
/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
/******/ error.name = 'ChunkLoadError';
/******/ error.type = errorType;
/******/ error.request = realSrc;
/******/ installedChunkData[1](error);
/******/ }
/******/ }
/******/ };
/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId);
/******/ }
/******/ }
/******/ }
/******/ };
/******/
/******/ // no prefetching
/******/
/******/ // no preloaded
/******/
/******/ // no HMR
/******/
/******/ // no HMR manifest
/******/
/******/ // no on chunks loaded
/******/
/******/ // install a JSONP callback for chunk loading
/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
/******/ var chunkIds = data[0];
/******/ var moreModules = data[1];
/******/ var runtime = data[2];
/******/ // add "moreModules" to the modules object,
/******/ // then flag all "chunkIds" as loaded and fire callback
/******/ var moduleId, chunkId, i = 0;
/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
/******/ for(moduleId in moreModules) {
/******/ if(__webpack_require__.o(moreModules, moduleId)) {
/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
/******/ }
/******/ }
/******/ if(runtime) var result = runtime(__webpack_require__);
/******/ }
/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
/******/ for(;i < chunkIds.length; i++) {
/******/ chunkId = chunkIds[i];
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
/******/ installedChunks[chunkId][0]();
/******/ }
/******/ installedChunks[chunkId] = 0;
/******/ }
/******/
/******/ }
/******/
/******/ var chunkLoadingGlobal = this["webpackChunk_tsparticles_updater_life"] = this["webpackChunk_tsparticles_updater_life"] || [];
/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
/******/ })();
/******/
/************************************************************************/

@@ -324,0 +176,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 r="object"==typeof exports?t(require("@tsparticles/engine")):t(e.window);for(var o in r)("object"==typeof exports?exports:e)[o]=r[o]}}(this,(e=>(()=>{var t,r,o={303:t=>{t.exports=e}},i={};function n(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={exports:{}};return o[e](r,r.exports,n),r.exports}n.m=o,n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((t,r)=>(n.f[r](e,t),t)),[])),n.u=e=>e+".min.js",n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),t={},r="@tsparticles/updater-life:",n.l=(e,o,i,a)=>{if(t[e])t[e].push(o);else{var s,l;if(void 0!==i)for(var p=document.getElementsByTagName("script"),c=0;c<p.length;c++){var u=p[c];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")==r+i){s=u;break}}s||(l=!0,(s=document.createElement("script")).charset="utf-8",s.timeout=120,n.nc&&s.setAttribute("nonce",n.nc),s.setAttribute("data-webpack",r+i),s.src=e),t[e]=[o];var d=(r,o)=>{s.onerror=s.onload=null,clearTimeout(f);var i=t[e];if(delete t[e],s.parentNode&&s.parentNode.removeChild(s),i&&i.forEach((e=>e(o))),r)return r(o)},f=setTimeout(d.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=d.bind(null,s.onerror),s.onload=d.bind(null,s.onload),l&&document.head.appendChild(s)}},n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var o=r.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=r[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{var e={654:0};n.f.j=(t,r)=>{var o=n.o(e,t)?e[t]:void 0;if(0!==o)if(o)r.push(o[2]);else{var i=new Promise(((r,i)=>o=e[t]=[r,i]));r.push(o[2]=i);var a=n.p+n.u(t),s=new Error;n.l(a,(r=>{if(n.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var i=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;s.message="Loading chunk "+t+" failed.\n("+i+": "+a+")",s.name="ChunkLoadError",s.type=i,s.request=a,o[1](s)}}),"chunk-"+t,t)}};var t=(t,r)=>{var o,i,a=r[0],s=r[1],l=r[2],p=0;if(a.some((t=>0!==e[t]))){for(o in s)n.o(s,o)&&(n.m[o]=s[o]);if(l)l(n)}for(t&&t(r);p<a.length;p++)i=a[p],n.o(e,i)&&e[i]&&e[i][0](),e[i]=0},r=this.webpackChunk_tsparticles_updater_life=this.webpackChunk_tsparticles_updater_life||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var a={};return(()=>{async function e(e,t=!0){await e.addParticleUpdater("life",(async e=>{const{LifeUpdater:t}=await n.e(266).then(n.bind(n,266));return new t(e)}),t)}n.r(a),n.d(a,{loadLifeUpdater:()=>e})})(),a})()));
!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})()));

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

/*! tsParticles Life Updater v3.3.0 by Matteo Bruni */
/*! tsParticles Life Updater v3.4.0 by Matteo Bruni */

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

var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
(function (factory) {

@@ -30,13 +7,12 @@ if (typeof module === "object" && typeof module.exports === "object") {

else if (typeof define === "function" && define.amd) {
define(["require", "exports"], factory);
define(["require", "exports", "./LifeUpdater.js"], factory);
}
})(function (require, exports) {
"use strict";
var __syncRequire = typeof module === "object" && typeof module.exports === "object";
Object.defineProperty(exports, "__esModule", { value: true });
exports.loadLifeUpdater = void 0;
const LifeUpdater_js_1 = require("./LifeUpdater.js");
async function loadLifeUpdater(engine, refresh = true) {
await engine.addParticleUpdater("life", async (container) => {
const { LifeUpdater } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./LifeUpdater.js"))) : new Promise((resolve_1, reject_1) => { require(["./LifeUpdater.js"], resolve_1, reject_1); }).then(__importStar));
return new LifeUpdater(container);
return Promise.resolve(new LifeUpdater_js_1.LifeUpdater(container));
}, refresh);

@@ -43,0 +19,0 @@ }

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