@tsparticles/updater-size 4.1.3 → 4.2.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/browser/Options/Classes/Size.js +2 -6
- package/browser/Options/Classes/SizeAnimation.js +3 -10
- package/browser/SizeUpdater.js +3 -5
- package/browser/index.js +1 -1
- package/browser/index.lazy.js +1 -1
- package/cjs/Options/Classes/Size.js +2 -6
- package/cjs/Options/Classes/SizeAnimation.js +3 -10
- package/cjs/SizeUpdater.js +3 -5
- package/cjs/index.js +1 -1
- package/cjs/index.lazy.js +1 -1
- package/esm/Options/Classes/Size.js +2 -6
- package/esm/Options/Classes/SizeAnimation.js +3 -10
- package/esm/SizeUpdater.js +3 -5
- package/esm/index.js +1 -1
- package/esm/index.lazy.js +1 -1
- package/package.json +5 -2
- package/report.html +1 -1
- package/tsparticles.updater.size.js +13 -27
- package/tsparticles.updater.size.min.js +1 -1
- package/types/Options/Classes/Size.d.ts +1 -1
- package/types/Options/Classes/SizeAnimation.d.ts +0 -1
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import { RangedAnimationValueWithRandom, isNull } from "@tsparticles/engine";
|
|
2
2
|
import { SizeAnimation } from "./SizeAnimation.js";
|
|
3
3
|
export class Size extends RangedAnimationValueWithRandom {
|
|
4
|
-
animation;
|
|
5
|
-
|
|
6
|
-
super();
|
|
7
|
-
this.animation = new SizeAnimation();
|
|
8
|
-
this.value = 3;
|
|
9
|
-
}
|
|
4
|
+
animation = new SizeAnimation();
|
|
5
|
+
value = 3;
|
|
10
6
|
load(data) {
|
|
11
7
|
super.load(data);
|
|
12
8
|
if (isNull(data)) {
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
import { DestroyType, RangedAnimationOptions, isNull, } from "@tsparticles/engine";
|
|
1
|
+
import { DestroyType, RangedAnimationOptions, isNull, loadProperty, } from "@tsparticles/engine";
|
|
2
2
|
export class SizeAnimation extends RangedAnimationOptions {
|
|
3
|
-
destroy;
|
|
4
|
-
constructor() {
|
|
5
|
-
super();
|
|
6
|
-
this.destroy = DestroyType.none;
|
|
7
|
-
this.speed = 5;
|
|
8
|
-
}
|
|
3
|
+
destroy = DestroyType.none;
|
|
9
4
|
load(data) {
|
|
10
5
|
super.load(data);
|
|
11
6
|
if (isNull(data)) {
|
|
12
7
|
return;
|
|
13
8
|
}
|
|
14
|
-
|
|
15
|
-
this.destroy = data.destroy;
|
|
16
|
-
}
|
|
9
|
+
loadProperty(this, "destroy", data.destroy);
|
|
17
10
|
}
|
|
18
11
|
}
|
package/browser/SizeUpdater.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { getRandom, getRangeValue,
|
|
1
|
+
import { getRandom, getRangeValue, loadOptionProperty, percentDenominator, } from "@tsparticles/engine";
|
|
2
|
+
import { initParticleNumericAnimationValue, updateAnimation } from "@tsparticles/animation-utils";
|
|
2
3
|
import { Size } from "./Options/Classes/Size.js";
|
|
3
4
|
const minLoops = 0;
|
|
4
5
|
export class SizeUpdater {
|
|
@@ -30,10 +31,7 @@ export class SizeUpdater {
|
|
|
30
31
|
(particle.size.loops ?? minLoops) < (particle.size.maxLoops ?? minLoops))));
|
|
31
32
|
}
|
|
32
33
|
loadOptions(options, ...sources) {
|
|
33
|
-
options
|
|
34
|
-
for (const source of sources) {
|
|
35
|
-
options.size.load(source?.size);
|
|
36
|
-
}
|
|
34
|
+
loadOptionProperty(options, "size", Size, ...sources);
|
|
37
35
|
}
|
|
38
36
|
preInit(particle) {
|
|
39
37
|
const pxRatio = this.#container.retina.pixelRatio, options = particle.options, sizeOptions = options.size;
|
package/browser/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SizeUpdater } from "./SizeUpdater.js";
|
|
2
2
|
export async function loadSizeUpdater(engine) {
|
|
3
|
-
engine.checkVersion("4.
|
|
3
|
+
engine.checkVersion("4.2.0");
|
|
4
4
|
await engine.pluginManager.register(e => {
|
|
5
5
|
e.pluginManager.addParticleUpdater("size", container => {
|
|
6
6
|
return Promise.resolve(new SizeUpdater(container));
|
package/browser/index.lazy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadSizeUpdater(engine) {
|
|
2
|
-
engine.checkVersion("4.
|
|
2
|
+
engine.checkVersion("4.2.0");
|
|
3
3
|
await engine.pluginManager.register(e => {
|
|
4
4
|
e.pluginManager.addParticleUpdater("size", async (container) => {
|
|
5
5
|
const { SizeUpdater } = await import("./SizeUpdater.js");
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import { RangedAnimationValueWithRandom, isNull } from "@tsparticles/engine";
|
|
2
2
|
import { SizeAnimation } from "./SizeAnimation.js";
|
|
3
3
|
export class Size extends RangedAnimationValueWithRandom {
|
|
4
|
-
animation;
|
|
5
|
-
|
|
6
|
-
super();
|
|
7
|
-
this.animation = new SizeAnimation();
|
|
8
|
-
this.value = 3;
|
|
9
|
-
}
|
|
4
|
+
animation = new SizeAnimation();
|
|
5
|
+
value = 3;
|
|
10
6
|
load(data) {
|
|
11
7
|
super.load(data);
|
|
12
8
|
if (isNull(data)) {
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
import { DestroyType, RangedAnimationOptions, isNull, } from "@tsparticles/engine";
|
|
1
|
+
import { DestroyType, RangedAnimationOptions, isNull, loadProperty, } from "@tsparticles/engine";
|
|
2
2
|
export class SizeAnimation extends RangedAnimationOptions {
|
|
3
|
-
destroy;
|
|
4
|
-
constructor() {
|
|
5
|
-
super();
|
|
6
|
-
this.destroy = DestroyType.none;
|
|
7
|
-
this.speed = 5;
|
|
8
|
-
}
|
|
3
|
+
destroy = DestroyType.none;
|
|
9
4
|
load(data) {
|
|
10
5
|
super.load(data);
|
|
11
6
|
if (isNull(data)) {
|
|
12
7
|
return;
|
|
13
8
|
}
|
|
14
|
-
|
|
15
|
-
this.destroy = data.destroy;
|
|
16
|
-
}
|
|
9
|
+
loadProperty(this, "destroy", data.destroy);
|
|
17
10
|
}
|
|
18
11
|
}
|
package/cjs/SizeUpdater.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { getRandom, getRangeValue,
|
|
1
|
+
import { getRandom, getRangeValue, loadOptionProperty, percentDenominator, } from "@tsparticles/engine";
|
|
2
|
+
import { initParticleNumericAnimationValue, updateAnimation } from "@tsparticles/animation-utils";
|
|
2
3
|
import { Size } from "./Options/Classes/Size.js";
|
|
3
4
|
const minLoops = 0;
|
|
4
5
|
export class SizeUpdater {
|
|
@@ -30,10 +31,7 @@ export class SizeUpdater {
|
|
|
30
31
|
(particle.size.loops ?? minLoops) < (particle.size.maxLoops ?? minLoops))));
|
|
31
32
|
}
|
|
32
33
|
loadOptions(options, ...sources) {
|
|
33
|
-
options
|
|
34
|
-
for (const source of sources) {
|
|
35
|
-
options.size.load(source?.size);
|
|
36
|
-
}
|
|
34
|
+
loadOptionProperty(options, "size", Size, ...sources);
|
|
37
35
|
}
|
|
38
36
|
preInit(particle) {
|
|
39
37
|
const pxRatio = this.#container.retina.pixelRatio, options = particle.options, sizeOptions = options.size;
|
package/cjs/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SizeUpdater } from "./SizeUpdater.js";
|
|
2
2
|
export async function loadSizeUpdater(engine) {
|
|
3
|
-
engine.checkVersion("4.
|
|
3
|
+
engine.checkVersion("4.2.0");
|
|
4
4
|
await engine.pluginManager.register(e => {
|
|
5
5
|
e.pluginManager.addParticleUpdater("size", container => {
|
|
6
6
|
return Promise.resolve(new SizeUpdater(container));
|
package/cjs/index.lazy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadSizeUpdater(engine) {
|
|
2
|
-
engine.checkVersion("4.
|
|
2
|
+
engine.checkVersion("4.2.0");
|
|
3
3
|
await engine.pluginManager.register(e => {
|
|
4
4
|
e.pluginManager.addParticleUpdater("size", async (container) => {
|
|
5
5
|
const { SizeUpdater } = await import("./SizeUpdater.js");
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import { RangedAnimationValueWithRandom, isNull } from "@tsparticles/engine";
|
|
2
2
|
import { SizeAnimation } from "./SizeAnimation.js";
|
|
3
3
|
export class Size extends RangedAnimationValueWithRandom {
|
|
4
|
-
animation;
|
|
5
|
-
|
|
6
|
-
super();
|
|
7
|
-
this.animation = new SizeAnimation();
|
|
8
|
-
this.value = 3;
|
|
9
|
-
}
|
|
4
|
+
animation = new SizeAnimation();
|
|
5
|
+
value = 3;
|
|
10
6
|
load(data) {
|
|
11
7
|
super.load(data);
|
|
12
8
|
if (isNull(data)) {
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
import { DestroyType, RangedAnimationOptions, isNull, } from "@tsparticles/engine";
|
|
1
|
+
import { DestroyType, RangedAnimationOptions, isNull, loadProperty, } from "@tsparticles/engine";
|
|
2
2
|
export class SizeAnimation extends RangedAnimationOptions {
|
|
3
|
-
destroy;
|
|
4
|
-
constructor() {
|
|
5
|
-
super();
|
|
6
|
-
this.destroy = DestroyType.none;
|
|
7
|
-
this.speed = 5;
|
|
8
|
-
}
|
|
3
|
+
destroy = DestroyType.none;
|
|
9
4
|
load(data) {
|
|
10
5
|
super.load(data);
|
|
11
6
|
if (isNull(data)) {
|
|
12
7
|
return;
|
|
13
8
|
}
|
|
14
|
-
|
|
15
|
-
this.destroy = data.destroy;
|
|
16
|
-
}
|
|
9
|
+
loadProperty(this, "destroy", data.destroy);
|
|
17
10
|
}
|
|
18
11
|
}
|
package/esm/SizeUpdater.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { getRandom, getRangeValue,
|
|
1
|
+
import { getRandom, getRangeValue, loadOptionProperty, percentDenominator, } from "@tsparticles/engine";
|
|
2
|
+
import { initParticleNumericAnimationValue, updateAnimation } from "@tsparticles/animation-utils";
|
|
2
3
|
import { Size } from "./Options/Classes/Size.js";
|
|
3
4
|
const minLoops = 0;
|
|
4
5
|
export class SizeUpdater {
|
|
@@ -30,10 +31,7 @@ export class SizeUpdater {
|
|
|
30
31
|
(particle.size.loops ?? minLoops) < (particle.size.maxLoops ?? minLoops))));
|
|
31
32
|
}
|
|
32
33
|
loadOptions(options, ...sources) {
|
|
33
|
-
options
|
|
34
|
-
for (const source of sources) {
|
|
35
|
-
options.size.load(source?.size);
|
|
36
|
-
}
|
|
34
|
+
loadOptionProperty(options, "size", Size, ...sources);
|
|
37
35
|
}
|
|
38
36
|
preInit(particle) {
|
|
39
37
|
const pxRatio = this.#container.retina.pixelRatio, options = particle.options, sizeOptions = options.size;
|
package/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SizeUpdater } from "./SizeUpdater.js";
|
|
2
2
|
export async function loadSizeUpdater(engine) {
|
|
3
|
-
engine.checkVersion("4.
|
|
3
|
+
engine.checkVersion("4.2.0");
|
|
4
4
|
await engine.pluginManager.register(e => {
|
|
5
5
|
e.pluginManager.addParticleUpdater("size", container => {
|
|
6
6
|
return Promise.resolve(new SizeUpdater(container));
|
package/esm/index.lazy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadSizeUpdater(engine) {
|
|
2
|
-
engine.checkVersion("4.
|
|
2
|
+
engine.checkVersion("4.2.0");
|
|
3
3
|
await engine.pluginManager.register(e => {
|
|
4
4
|
e.pluginManager.addParticleUpdater("size", async (container) => {
|
|
5
5
|
const { SizeUpdater } = await import("./SizeUpdater.js");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/updater-size",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "tsParticles particles size updater",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -92,8 +92,11 @@
|
|
|
92
92
|
},
|
|
93
93
|
"./package.json": "./package.json"
|
|
94
94
|
},
|
|
95
|
+
"dependencies": {
|
|
96
|
+
"@tsparticles/animation-utils": "4.2.0"
|
|
97
|
+
},
|
|
95
98
|
"peerDependencies": {
|
|
96
|
-
"@tsparticles/engine": "4.
|
|
99
|
+
"@tsparticles/engine": "4.2.0"
|
|
97
100
|
},
|
|
98
101
|
"publishConfig": {
|
|
99
102
|
"access": "public"
|
package/report.html
CHANGED
|
@@ -4930,7 +4930,7 @@ var drawChart = (function (exports) {
|
|
|
4930
4930
|
</script>
|
|
4931
4931
|
<script>
|
|
4932
4932
|
/*<!--*/
|
|
4933
|
-
const data = {"version":2,"tree":{"name":"root","children":[{"name":"tsparticles.updater.size.js","children":[{"name":"dist/browser","children":[{"name":"Options/Classes","children":[{"uid":"
|
|
4933
|
+
const data = {"version":2,"tree":{"name":"root","children":[{"name":"tsparticles.updater.size.js","children":[{"name":"dist/browser","children":[{"name":"Options/Classes","children":[{"uid":"83ed8b8c-1","name":"SizeAnimation.js"},{"uid":"83ed8b8c-3","name":"Size.js"}]},{"uid":"83ed8b8c-5","name":"SizeUpdater.js"},{"uid":"83ed8b8c-7","name":"index.js"},{"uid":"83ed8b8c-9","name":"browser.js"}]}]}],"isRoot":true},"nodeParts":{"83ed8b8c-1":{"renderedLength":314,"gzipLength":0,"brotliLength":0,"metaUid":"83ed8b8c-0"},"83ed8b8c-3":{"renderedLength":417,"gzipLength":0,"brotliLength":0,"metaUid":"83ed8b8c-2"},"83ed8b8c-5":{"renderedLength":2103,"gzipLength":0,"brotliLength":0,"metaUid":"83ed8b8c-4"},"83ed8b8c-7":{"renderedLength":305,"gzipLength":0,"brotliLength":0,"metaUid":"83ed8b8c-6"},"83ed8b8c-9":{"renderedLength":173,"gzipLength":0,"brotliLength":0,"metaUid":"83ed8b8c-8"}},"nodeMetas":{"83ed8b8c-0":{"id":"/dist/browser/Options/Classes/SizeAnimation.js","moduleParts":{"tsparticles.updater.size.js":"83ed8b8c-1"},"imported":[{"uid":"83ed8b8c-10"}],"importedBy":[{"uid":"83ed8b8c-2"}]},"83ed8b8c-2":{"id":"/dist/browser/Options/Classes/Size.js","moduleParts":{"tsparticles.updater.size.js":"83ed8b8c-3"},"imported":[{"uid":"83ed8b8c-10"},{"uid":"83ed8b8c-0"}],"importedBy":[{"uid":"83ed8b8c-4"}]},"83ed8b8c-4":{"id":"/dist/browser/SizeUpdater.js","moduleParts":{"tsparticles.updater.size.js":"83ed8b8c-5"},"imported":[{"uid":"83ed8b8c-10"},{"uid":"83ed8b8c-11"},{"uid":"83ed8b8c-2"}],"importedBy":[{"uid":"83ed8b8c-6"}]},"83ed8b8c-6":{"id":"/dist/browser/index.js","moduleParts":{"tsparticles.updater.size.js":"83ed8b8c-7"},"imported":[{"uid":"83ed8b8c-4"}],"importedBy":[{"uid":"83ed8b8c-8"}]},"83ed8b8c-8":{"id":"/dist/browser/browser.js","moduleParts":{"tsparticles.updater.size.js":"83ed8b8c-9"},"imported":[{"uid":"83ed8b8c-6"}],"importedBy":[],"isEntry":true},"83ed8b8c-10":{"id":"@tsparticles/engine","moduleParts":{},"imported":[],"importedBy":[{"uid":"83ed8b8c-4"},{"uid":"83ed8b8c-2"},{"uid":"83ed8b8c-0"}],"isExternal":true},"83ed8b8c-11":{"id":"@tsparticles/animation-utils","moduleParts":{},"imported":[],"importedBy":[{"uid":"83ed8b8c-4"}],"isExternal":true}},"env":{"rollup":"4.62.0"},"options":{"gzip":false,"brotli":false,"sourcemap":false}};
|
|
4934
4934
|
|
|
4935
4935
|
const run = () => {
|
|
4936
4936
|
const width = window.innerWidth;
|
|
@@ -1,36 +1,25 @@
|
|
|
1
1
|
(function(g){g.__tsParticlesInternals=g.__tsParticlesInternals||{};g.__tsParticlesInternals.bundles=g.__tsParticlesInternals.bundles||{};g.__tsParticlesInternals.effects=g.__tsParticlesInternals.effects||{};g.__tsParticlesInternals.engine=g.__tsParticlesInternals.engine||{};g.__tsParticlesInternals.interactions=g.__tsParticlesInternals.interactions||{};g.__tsParticlesInternals.palettes=g.__tsParticlesInternals.palettes||{};g.__tsParticlesInternals.paths=g.__tsParticlesInternals.paths||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins.emittersShapes=g.__tsParticlesInternals.plugins.emittersShapes||{};g.__tsParticlesInternals.presets=g.__tsParticlesInternals.presets||{};g.__tsParticlesInternals.shapes=g.__tsParticlesInternals.shapes||{};g.__tsParticlesInternals.updaters=g.__tsParticlesInternals.updaters||{};g.__tsParticlesInternals.utils=g.__tsParticlesInternals.utils||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas.utils=g.__tsParticlesInternals.canvas.utils||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path.utils=g.__tsParticlesInternals.path.utils||{};var __tsProxyFactory=typeof Proxy!=="undefined"?function(obj){return new Proxy(obj,{get:function(target,key){if(!(key in target)){target[key]={};}return target[key];}});}:function(obj){return obj;};g.__tsParticlesInternals.bundles=__tsProxyFactory(g.__tsParticlesInternals.bundles);g.__tsParticlesInternals.effects=__tsProxyFactory(g.__tsParticlesInternals.effects);g.__tsParticlesInternals.interactions=__tsProxyFactory(g.__tsParticlesInternals.interactions);g.__tsParticlesInternals.palettes=__tsProxyFactory(g.__tsParticlesInternals.palettes);g.__tsParticlesInternals.paths=__tsProxyFactory(g.__tsParticlesInternals.paths);g.__tsParticlesInternals.plugins=__tsProxyFactory(g.__tsParticlesInternals.plugins);g.__tsParticlesInternals.plugins.emittersShapes=__tsProxyFactory(g.__tsParticlesInternals.plugins.emittersShapes);g.__tsParticlesInternals.presets=__tsProxyFactory(g.__tsParticlesInternals.presets);g.__tsParticlesInternals.shapes=__tsProxyFactory(g.__tsParticlesInternals.shapes);g.__tsParticlesInternals.updaters=__tsProxyFactory(g.__tsParticlesInternals.updaters);g.__tsParticlesInternals.utils=__tsProxyFactory(g.__tsParticlesInternals.utils);g.__tsParticlesInternals.canvas=__tsProxyFactory(g.__tsParticlesInternals.canvas);g.__tsParticlesInternals.path=__tsProxyFactory(g.__tsParticlesInternals.path);g.tsparticlesInternalExports=g.tsparticlesInternalExports||{};})(typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:this);
|
|
2
|
-
/* Updater v4.
|
|
2
|
+
/* Updater v4.2.0 */
|
|
3
3
|
(function (global, factory) {
|
|
4
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tsparticles/engine')) :
|
|
5
|
-
typeof define === 'function' && define.amd ? define(['exports', '@tsparticles/engine'], factory) :
|
|
6
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.__tsParticlesInternals = global.__tsParticlesInternals || {}, global.__tsParticlesInternals.updaters = global.__tsParticlesInternals.updaters || {}, global.__tsParticlesInternals.updaters.size = global.__tsParticlesInternals.updaters.size || {}), global.__tsParticlesInternals.engine));
|
|
7
|
-
})(this, (function (exports, engine) { 'use strict';
|
|
4
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tsparticles/engine'), require('@tsparticles/animation-utils')) :
|
|
5
|
+
typeof define === 'function' && define.amd ? define(['exports', '@tsparticles/engine', '@tsparticles/animation-utils'], factory) :
|
|
6
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.__tsParticlesInternals = global.__tsParticlesInternals || {}, global.__tsParticlesInternals.updaters = global.__tsParticlesInternals.updaters || {}, global.__tsParticlesInternals.updaters.size = global.__tsParticlesInternals.updaters.size || {}), global.__tsParticlesInternals.engine, global.__tsParticlesInternals.animation.utils));
|
|
7
|
+
})(this, (function (exports, engine, animationUtils) { 'use strict';
|
|
8
8
|
|
|
9
9
|
class SizeAnimation extends engine.RangedAnimationOptions {
|
|
10
|
-
destroy;
|
|
11
|
-
constructor() {
|
|
12
|
-
super();
|
|
13
|
-
this.destroy = engine.DestroyType.none;
|
|
14
|
-
this.speed = 5;
|
|
15
|
-
}
|
|
10
|
+
destroy = engine.DestroyType.none;
|
|
16
11
|
load(data) {
|
|
17
12
|
super.load(data);
|
|
18
13
|
if (engine.isNull(data)) {
|
|
19
14
|
return;
|
|
20
15
|
}
|
|
21
|
-
|
|
22
|
-
this.destroy = data.destroy;
|
|
23
|
-
}
|
|
16
|
+
engine.loadProperty(this, "destroy", data.destroy);
|
|
24
17
|
}
|
|
25
18
|
}
|
|
26
19
|
|
|
27
20
|
class Size extends engine.RangedAnimationValueWithRandom {
|
|
28
|
-
animation;
|
|
29
|
-
|
|
30
|
-
super();
|
|
31
|
-
this.animation = new SizeAnimation();
|
|
32
|
-
this.value = 3;
|
|
33
|
-
}
|
|
21
|
+
animation = new SizeAnimation();
|
|
22
|
+
value = 3;
|
|
34
23
|
load(data) {
|
|
35
24
|
super.load(data);
|
|
36
25
|
if (engine.isNull(data)) {
|
|
@@ -73,17 +62,14 @@
|
|
|
73
62
|
(particle.size.loops ?? minLoops) < (particle.size.maxLoops ?? minLoops))));
|
|
74
63
|
}
|
|
75
64
|
loadOptions(options, ...sources) {
|
|
76
|
-
options
|
|
77
|
-
for (const source of sources) {
|
|
78
|
-
options.size.load(source?.size);
|
|
79
|
-
}
|
|
65
|
+
engine.loadOptionProperty(options, "size", Size, ...sources);
|
|
80
66
|
}
|
|
81
67
|
preInit(particle) {
|
|
82
68
|
const pxRatio = this.#container.retina.pixelRatio, options = particle.options, sizeOptions = options.size;
|
|
83
69
|
if (!sizeOptions) {
|
|
84
70
|
return;
|
|
85
71
|
}
|
|
86
|
-
particle.size =
|
|
72
|
+
particle.size = animationUtils.initParticleNumericAnimationValue(sizeOptions, pxRatio);
|
|
87
73
|
particle.retina.sizeAnimationSpeed = engine.getRangeValue(sizeOptions.animation.speed) * pxRatio;
|
|
88
74
|
}
|
|
89
75
|
reset(particle) {
|
|
@@ -94,12 +80,12 @@
|
|
|
94
80
|
if (!this.isEnabled(particle) || !particle.options.size) {
|
|
95
81
|
return;
|
|
96
82
|
}
|
|
97
|
-
|
|
83
|
+
animationUtils.updateAnimation(particle, particle.size, true, particle.options.size.animation.destroy, delta);
|
|
98
84
|
}
|
|
99
85
|
}
|
|
100
86
|
|
|
101
87
|
async function loadSizeUpdater(engine) {
|
|
102
|
-
engine.checkVersion("4.
|
|
88
|
+
engine.checkVersion("4.2.0");
|
|
103
89
|
await engine.pluginManager.register(e => {
|
|
104
90
|
e.pluginManager.addParticleUpdater("size", container => {
|
|
105
91
|
return Promise.resolve(new SizeUpdater(container));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(
|
|
1
|
+
!function(t){t.__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.bundles=t.__tsParticlesInternals.bundles||{},t.__tsParticlesInternals.effects=t.__tsParticlesInternals.effects||{},t.__tsParticlesInternals.engine=t.__tsParticlesInternals.engine||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.palettes=t.__tsParticlesInternals.palettes||{},t.__tsParticlesInternals.paths=t.__tsParticlesInternals.paths||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins.emittersShapes=t.__tsParticlesInternals.plugins.emittersShapes||{},t.__tsParticlesInternals.presets=t.__tsParticlesInternals.presets||{},t.__tsParticlesInternals.shapes=t.__tsParticlesInternals.shapes||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.utils=t.__tsParticlesInternals.utils||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas.utils=t.__tsParticlesInternals.canvas.utils||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path.utils=t.__tsParticlesInternals.path.utils||{};var s="undefined"!=typeof Proxy?function(t){return new Proxy(t,{get:function(t,s){return s in t||(t[s]={}),t[s]}})}:function(t){return t};t.__tsParticlesInternals.bundles=s(t.__tsParticlesInternals.bundles),t.__tsParticlesInternals.effects=s(t.__tsParticlesInternals.effects),t.__tsParticlesInternals.interactions=s(t.__tsParticlesInternals.interactions),t.__tsParticlesInternals.palettes=s(t.__tsParticlesInternals.palettes),t.__tsParticlesInternals.paths=s(t.__tsParticlesInternals.paths),t.__tsParticlesInternals.plugins=s(t.__tsParticlesInternals.plugins),t.__tsParticlesInternals.plugins.emittersShapes=s(t.__tsParticlesInternals.plugins.emittersShapes),t.__tsParticlesInternals.presets=s(t.__tsParticlesInternals.presets),t.__tsParticlesInternals.shapes=s(t.__tsParticlesInternals.shapes),t.__tsParticlesInternals.updaters=s(t.__tsParticlesInternals.updaters),t.__tsParticlesInternals.utils=s(t.__tsParticlesInternals.utils),t.__tsParticlesInternals.canvas=s(t.__tsParticlesInternals.canvas),t.__tsParticlesInternals.path=s(t.__tsParticlesInternals.path),t.tsparticlesInternalExports=t.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t,s){"object"==typeof exports&&"undefined"!=typeof module?s(exports,require("@tsparticles/engine"),require("@tsparticles/animation-utils")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/engine","@tsparticles/animation-utils"],s):s(((t="undefined"!=typeof globalThis?globalThis:t||self).__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.updaters.size=t.__tsParticlesInternals.updaters.size||{}),t.__tsParticlesInternals.engine,t.__tsParticlesInternals.animation.utils)}(this,function(t,s,e){"use strict";class n extends s.RangedAnimationOptions{destroy=s.DestroyType.none;load(t){super.load(t),s.isNull(t)||s.loadProperty(this,"destroy",t.destroy)}}class a extends s.RangedAnimationValueWithRandom{animation=new n;value=3;load(t){if(super.load(t),s.isNull(t))return;const e=t.animation;void 0!==e&&this.animation.load(e)}}class i{#t;constructor(t){this.#t=t}init(t){const e=this.#t,n=t.options.size;if(!n)return;const a=n.animation;a.enable&&(t.size.velocity=t.retina.sizeAnimationSpeed/s.percentDenominator*e.retina.reduceFactor,a.sync||(t.size.velocity*=s.getRandom()))}isEnabled(t){return!t.destroyed&&!t.spawning&&t.size.enable&&((t.size.maxLoops??0)<=0||(t.size.maxLoops??0)>0&&(t.size.loops??0)<(t.size.maxLoops??0))}loadOptions(t,...e){s.loadOptionProperty(t,"size",a,...e)}preInit(t){const n=this.#t.retina.pixelRatio,a=t.options.size;a&&(t.size=e.initParticleNumericAnimationValue(a,n),t.retina.sizeAnimationSpeed=s.getRangeValue(a.animation.speed)*n)}reset(t){t.size.time=0,t.size.loops=0}update(t,s){this.isEnabled(t)&&t.options.size&&e.updateAnimation(t,t.size,!0,t.options.size.animation.destroy,s)}}async function r(t){t.checkVersion("4.2.0"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("size",t=>Promise.resolve(new i(t)))})}const l=globalThis;l.__tsParticlesInternals=l.__tsParticlesInternals??{},l.loadSizeUpdater=r,t.loadSizeUpdater=r}),Object.assign(globalThis.window||globalThis,{loadSizeUpdater:(globalThis.__tsParticlesInternals.updaters.size||{}).loadSizeUpdater}),delete(globalThis.window||globalThis).tsparticlesInternalExports;
|
|
@@ -3,6 +3,6 @@ import type { ISize } from "../Interfaces/ISize.js";
|
|
|
3
3
|
import { SizeAnimation } from "./SizeAnimation.js";
|
|
4
4
|
export declare class Size extends RangedAnimationValueWithRandom implements ISize, IOptionLoader<ISize> {
|
|
5
5
|
readonly animation: SizeAnimation;
|
|
6
|
-
|
|
6
|
+
value: number;
|
|
7
7
|
load(data?: RecursivePartial<ISize>): void;
|
|
8
8
|
}
|
|
@@ -2,6 +2,5 @@ import { DestroyType, type IOptionLoader, RangedAnimationOptions, type Recursive
|
|
|
2
2
|
import type { ISizeAnimation } from "../Interfaces/ISizeAnimation.js";
|
|
3
3
|
export declare class SizeAnimation extends RangedAnimationOptions implements ISizeAnimation, IOptionLoader<ISizeAnimation> {
|
|
4
4
|
destroy: DestroyType | keyof typeof DestroyType;
|
|
5
|
-
constructor();
|
|
6
5
|
load(data?: RecursivePartial<ISizeAnimation>): void;
|
|
7
6
|
}
|