@tsparticles/updater-size 3.9.0 → 4.0.0-alpha.0
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/879.min.js +2 -0
- package/879.min.js.LICENSE.txt +1 -0
- package/browser/index.js +8 -6
- package/cjs/SizeUpdater.js +5 -9
- package/cjs/index.js +8 -9
- package/dist_browser_SizeUpdater_js.js +30 -0
- package/esm/index.js +8 -6
- package/package.json +4 -3
- package/report.html +5 -4
- package/tsparticles.updater.size.js +209 -30
- package/tsparticles.updater.size.min.js +1 -1
- package/tsparticles.updater.size.min.js.LICENSE.txt +1 -1
- package/types/index.d.ts +1 -1
- package/umd/index.js +43 -7
package/879.min.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see 879.min.js.LICENSE.txt */
|
|
2
|
+
(this.webpackChunk_tsparticles_updater_size=this.webpackChunk_tsparticles_updater_size||[]).push([[879],{879(e,i,s){s.d(i,{SizeUpdater:()=>a});var t=s(303);class a{init(e){const i=e.container,s=e.options.size.animation;s.enable&&(e.size.velocity=(e.retina.sizeAnimationSpeed??i.retina.sizeAnimationSpeed)/t.percentDenominator*i.retina.reduceFactor,s.sync||(e.size.velocity*=(0,t.getRandom)()))}isEnabled(e){return!e.destroyed&&!e.spawning&&e.size.enable&&((e.size.maxLoops??0)<=0||(e.size.maxLoops??0)>0&&(e.size.loops??0)<(e.size.maxLoops??0))}reset(e){e.size.loops=0}update(e,i){this.isEnabled(e)&&(0,t.updateAnimation)(e,e.size,!0,e.options.size.animation.destroy,i)}}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! tsParticles Size Updater v4.0.0-alpha.0 by Matteo Bruni */
|
package/browser/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
engine.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
export function loadSizeUpdater(engine) {
|
|
2
|
+
engine.checkVersion("4.0.0-alpha.0");
|
|
3
|
+
engine.register(e => {
|
|
4
|
+
e.addParticleUpdater("size", async () => {
|
|
5
|
+
const { SizeUpdater } = await import("./SizeUpdater.js");
|
|
6
|
+
return new SizeUpdater();
|
|
7
|
+
});
|
|
8
|
+
});
|
|
7
9
|
}
|
package/cjs/SizeUpdater.js
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SizeUpdater = void 0;
|
|
4
|
-
const engine_1 = require("@tsparticles/engine");
|
|
1
|
+
import { getRandom, percentDenominator, updateAnimation, } from "@tsparticles/engine";
|
|
5
2
|
const minLoops = 0;
|
|
6
|
-
class SizeUpdater {
|
|
3
|
+
export class SizeUpdater {
|
|
7
4
|
init(particle) {
|
|
8
5
|
const container = particle.container, sizeOptions = particle.options.size, sizeAnimation = sizeOptions.animation;
|
|
9
6
|
if (sizeAnimation.enable) {
|
|
10
7
|
particle.size.velocity =
|
|
11
|
-
((particle.retina.sizeAnimationSpeed ?? container.retina.sizeAnimationSpeed) /
|
|
8
|
+
((particle.retina.sizeAnimationSpeed ?? container.retina.sizeAnimationSpeed) / percentDenominator) *
|
|
12
9
|
container.retina.reduceFactor;
|
|
13
10
|
if (!sizeAnimation.sync) {
|
|
14
|
-
particle.size.velocity *=
|
|
11
|
+
particle.size.velocity *= getRandom();
|
|
15
12
|
}
|
|
16
13
|
}
|
|
17
14
|
}
|
|
@@ -30,7 +27,6 @@ class SizeUpdater {
|
|
|
30
27
|
if (!this.isEnabled(particle)) {
|
|
31
28
|
return;
|
|
32
29
|
}
|
|
33
|
-
|
|
30
|
+
updateAnimation(particle, particle.size, true, particle.options.size.animation.destroy, delta);
|
|
34
31
|
}
|
|
35
32
|
}
|
|
36
|
-
exports.SizeUpdater = SizeUpdater;
|
package/cjs/index.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}, refresh);
|
|
1
|
+
export function loadSizeUpdater(engine) {
|
|
2
|
+
engine.checkVersion("4.0.0-alpha.0");
|
|
3
|
+
engine.register(e => {
|
|
4
|
+
e.addParticleUpdater("size", async () => {
|
|
5
|
+
const { SizeUpdater } = await import("./SizeUpdater.js");
|
|
6
|
+
return new SizeUpdater();
|
|
7
|
+
});
|
|
8
|
+
});
|
|
10
9
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
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-alpha.0
|
|
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_size"] = this["webpackChunk_tsparticles_updater_size"] || []).push([["dist_browser_SizeUpdater_js"],{
|
|
19
|
+
|
|
20
|
+
/***/ "./dist/browser/SizeUpdater.js"
|
|
21
|
+
/*!*************************************!*\
|
|
22
|
+
!*** ./dist/browser/SizeUpdater.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 */ SizeUpdater: () => (/* binding */ SizeUpdater)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nconst minLoops = 0;\nclass SizeUpdater {\n init(particle) {\n const container = particle.container,\n sizeOptions = particle.options.size,\n sizeAnimation = sizeOptions.animation;\n if (sizeAnimation.enable) {\n particle.size.velocity = (particle.retina.sizeAnimationSpeed ?? container.retina.sizeAnimationSpeed) / _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.percentDenominator * container.retina.reduceFactor;\n if (!sizeAnimation.sync) {\n particle.size.velocity *= (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRandom)();\n }\n }\n }\n isEnabled(particle) {\n return !particle.destroyed && !particle.spawning && particle.size.enable && ((particle.size.maxLoops ?? minLoops) <= minLoops || (particle.size.maxLoops ?? minLoops) > minLoops && (particle.size.loops ?? minLoops) < (particle.size.maxLoops ?? minLoops));\n }\n reset(particle) {\n particle.size.loops = minLoops;\n }\n update(particle, delta) {\n if (!this.isEnabled(particle)) {\n return;\n }\n (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.updateAnimation)(particle, particle.size, true, particle.options.size.animation.destroy, delta);\n }\n}\n\n//# sourceURL=webpack://@tsparticles/updater-size/./dist/browser/SizeUpdater.js?\n}");
|
|
27
|
+
|
|
28
|
+
/***/ }
|
|
29
|
+
|
|
30
|
+
}]);
|
package/esm/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
engine.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
export function loadSizeUpdater(engine) {
|
|
2
|
+
engine.checkVersion("4.0.0-alpha.0");
|
|
3
|
+
engine.register(e => {
|
|
4
|
+
e.addParticleUpdater("size", async () => {
|
|
5
|
+
const { SizeUpdater } = await import("./SizeUpdater.js");
|
|
6
|
+
return new SizeUpdater();
|
|
7
|
+
});
|
|
8
|
+
});
|
|
7
9
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/updater-size",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-alpha.0",
|
|
4
4
|
"description": "tsParticles particles size updater",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -87,9 +87,10 @@
|
|
|
87
87
|
"./package.json": "./package.json"
|
|
88
88
|
},
|
|
89
89
|
"dependencies": {
|
|
90
|
-
"@tsparticles/engine": "
|
|
90
|
+
"@tsparticles/engine": "4.0.0-alpha.0"
|
|
91
91
|
},
|
|
92
92
|
"publishConfig": {
|
|
93
93
|
"access": "public"
|
|
94
|
-
}
|
|
94
|
+
},
|
|
95
|
+
"type": "module"
|
|
95
96
|
}
|