tsparticles 1.41.3 → 1.41.6
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/Core/Canvas.js +1 -4
- package/Core/Particle.d.ts +1 -0
- package/Core/Particle.js +1 -0
- package/Core/Particles.js +2 -1
- package/Plugins/Emitters/EmitterInstance.js +8 -7
- package/Updaters/Size/SizeUpdater.js +0 -1
- package/browser/Core/Canvas.js +1 -4
- package/browser/Core/Particle.d.ts +1 -0
- package/browser/Core/Particle.js +1 -0
- package/browser/Core/Particles.js +2 -1
- package/browser/Plugins/Emitters/EmitterInstance.js +8 -7
- package/browser/Updaters/Size/SizeUpdater.js +0 -1
- package/esm/Core/Canvas.js +1 -4
- package/esm/Core/Particle.d.ts +1 -0
- package/esm/Core/Particle.js +1 -0
- package/esm/Core/Particles.js +2 -1
- package/esm/Plugins/Emitters/EmitterInstance.js +8 -7
- package/esm/Updaters/Size/SizeUpdater.js +0 -1
- package/package.json +1 -1
- package/report.html +2 -2
- package/report.slim.html +2 -2
- package/tsparticles.engine.js +4 -5
- package/tsparticles.engine.min.js +2 -2
- package/tsparticles.interaction.external.attract.js +4 -5
- package/tsparticles.interaction.external.attract.min.js +1 -1
- package/tsparticles.interaction.external.bounce.js +4 -5
- package/tsparticles.interaction.external.bounce.min.js +1 -1
- package/tsparticles.interaction.external.bubble.js +4 -5
- package/tsparticles.interaction.external.bubble.min.js +1 -1
- package/tsparticles.interaction.external.connect.js +4 -5
- package/tsparticles.interaction.external.connect.min.js +1 -1
- package/tsparticles.interaction.external.grab.js +4 -5
- package/tsparticles.interaction.external.grab.min.js +1 -1
- package/tsparticles.interaction.external.repulse.js +4 -5
- package/tsparticles.interaction.external.repulse.min.js +1 -1
- package/tsparticles.interaction.external.trail.js +4 -5
- package/tsparticles.interaction.external.trail.min.js +1 -1
- package/tsparticles.interaction.particles.attract.js +4 -5
- package/tsparticles.interaction.particles.attract.min.js +1 -1
- package/tsparticles.interaction.particles.collisions.js +4 -5
- package/tsparticles.interaction.particles.collisions.min.js +1 -1
- package/tsparticles.interaction.particles.links.js +4 -5
- package/tsparticles.interaction.particles.links.min.js +1 -1
- package/tsparticles.js +12 -13
- package/tsparticles.min.js +2 -2
- package/tsparticles.pathseg.min.js +1 -1
- package/tsparticles.plugins.absorbers.js +4 -5
- package/tsparticles.plugins.absorbers.min.js +1 -1
- package/tsparticles.plugins.emitters.js +12 -12
- package/tsparticles.plugins.emitters.min.js +2 -2
- package/tsparticles.plugins.polygonMask.js +4 -5
- package/tsparticles.plugins.polygonMask.min.js +1 -1
- package/tsparticles.shape.circle.min.js +1 -1
- package/tsparticles.shape.image.js +4 -5
- package/tsparticles.shape.image.min.js +1 -1
- package/tsparticles.shape.line.min.js +1 -1
- package/tsparticles.shape.polygon.min.js +1 -1
- package/tsparticles.shape.square.min.js +1 -1
- package/tsparticles.shape.star.min.js +1 -1
- package/tsparticles.shape.text.js +4 -5
- package/tsparticles.shape.text.min.js +1 -1
- package/tsparticles.slim.js +4 -6
- package/tsparticles.slim.min.js +2 -2
- package/tsparticles.updater.angle.js +4 -5
- package/tsparticles.updater.angle.min.js +1 -1
- package/tsparticles.updater.color.js +4 -5
- package/tsparticles.updater.color.min.js +1 -1
- package/tsparticles.updater.life.js +4 -5
- package/tsparticles.updater.life.min.js +1 -1
- package/tsparticles.updater.opacity.js +4 -5
- package/tsparticles.updater.opacity.min.js +1 -1
- package/tsparticles.updater.outModes.js +4 -5
- package/tsparticles.updater.outModes.min.js +1 -1
- package/tsparticles.updater.roll.js +4 -5
- package/tsparticles.updater.roll.min.js +1 -1
- package/tsparticles.updater.size.js +4 -6
- package/tsparticles.updater.size.min.js +2 -2
- package/tsparticles.updater.strokeColor.js +4 -5
- package/tsparticles.updater.strokeColor.min.js +1 -1
- package/tsparticles.updater.tilt.js +4 -5
- package/tsparticles.updater.tilt.min.js +1 -1
- package/tsparticles.updater.wobble.js +4 -5
- package/tsparticles.updater.wobble.min.js +1 -1
- package/umd/Core/Canvas.js +1 -4
- package/umd/Core/Particle.d.ts +1 -0
- package/umd/Core/Particle.js +1 -0
- package/umd/Core/Particles.js +2 -1
- package/umd/Plugins/Emitters/EmitterInstance.js +8 -7
- package/umd/Updaters/Size/SizeUpdater.js +0 -1
package/Core/Canvas.js
CHANGED
|
@@ -98,10 +98,7 @@ class Canvas {
|
|
|
98
98
|
const container = this.container;
|
|
99
99
|
const pxRatio = container.retina.pixelRatio;
|
|
100
100
|
const size = container.canvas.size;
|
|
101
|
-
const oldSize = {
|
|
102
|
-
width: size.width,
|
|
103
|
-
height: size.height,
|
|
104
|
-
};
|
|
101
|
+
const oldSize = Object.assign({}, size);
|
|
105
102
|
size.width = this.element.offsetWidth * pxRatio;
|
|
106
103
|
size.height = this.element.offsetHeight * pxRatio;
|
|
107
104
|
this.element.width = size.width;
|
package/Core/Particle.d.ts
CHANGED
package/Core/Particle.js
CHANGED
|
@@ -45,6 +45,7 @@ class Particle {
|
|
|
45
45
|
this.retina = {
|
|
46
46
|
maxDistance: {},
|
|
47
47
|
};
|
|
48
|
+
this.ignoresResizeRatio = true;
|
|
48
49
|
const pxRatio = container.retina.pixelRatio;
|
|
49
50
|
const mainOptions = container.actualOptions;
|
|
50
51
|
const particlesOptions = new ParticlesOptions_1.ParticlesOptions();
|
package/Core/Particles.js
CHANGED
|
@@ -111,10 +111,11 @@ class Particles {
|
|
|
111
111
|
}
|
|
112
112
|
for (const particle of this.array) {
|
|
113
113
|
const resizeFactor = container.canvas.resizeFactor;
|
|
114
|
-
if (resizeFactor) {
|
|
114
|
+
if (resizeFactor && !particle.ignoresResizeRatio) {
|
|
115
115
|
particle.position.x *= resizeFactor.width;
|
|
116
116
|
particle.position.y *= resizeFactor.height;
|
|
117
117
|
}
|
|
118
|
+
particle.ignoresResizeRatio = false;
|
|
118
119
|
particle.bubble.inRange = false;
|
|
119
120
|
for (const [, plugin] of this.container.plugins) {
|
|
120
121
|
if (particle.destroyed) {
|
|
@@ -18,8 +18,8 @@ const Emitter_1 = require("./Options/Classes/Emitter");
|
|
|
18
18
|
const EmitterSize_1 = require("./Options/Classes/EmitterSize");
|
|
19
19
|
class EmitterInstance {
|
|
20
20
|
constructor(engine, emitters, container, options, position) {
|
|
21
|
-
var _a, _b, _c, _d, _e, _f;
|
|
22
|
-
var
|
|
21
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
22
|
+
var _h;
|
|
23
23
|
this.emitters = emitters;
|
|
24
24
|
this.container = container;
|
|
25
25
|
_EmitterInstance_firstSpawn.set(this, void 0);
|
|
@@ -38,22 +38,23 @@ class EmitterInstance {
|
|
|
38
38
|
this.options.load(options);
|
|
39
39
|
}
|
|
40
40
|
this.spawnDelay = (((_a = this.options.life.delay) !== null && _a !== void 0 ? _a : 0) * 1000) / this.container.retina.reduceFactor;
|
|
41
|
+
this.position = (_b = this.initialPosition) !== null && _b !== void 0 ? _b : this.calcPosition();
|
|
41
42
|
this.name = this.options.name;
|
|
42
|
-
this.shape = (
|
|
43
|
+
this.shape = (_c = __classPrivateFieldGet(this, _EmitterInstance_engine, "f").emitterShapeManager) === null || _c === void 0 ? void 0 : _c.getShape(this.options.shape);
|
|
43
44
|
this.fill = this.options.fill;
|
|
44
45
|
__classPrivateFieldSet(this, _EmitterInstance_firstSpawn, !this.options.life.wait, "f");
|
|
45
46
|
__classPrivateFieldSet(this, _EmitterInstance_startParticlesAdded, false, "f");
|
|
46
47
|
let particlesOptions = (0, Utils_1.deepExtend)({}, this.options.particles);
|
|
47
48
|
particlesOptions !== null && particlesOptions !== void 0 ? particlesOptions : (particlesOptions = {});
|
|
48
|
-
(
|
|
49
|
-
(
|
|
49
|
+
(_d = particlesOptions.move) !== null && _d !== void 0 ? _d : (particlesOptions.move = {});
|
|
50
|
+
(_e = (_h = particlesOptions.move).direction) !== null && _e !== void 0 ? _e : (_h.direction = this.options.direction);
|
|
50
51
|
if (this.options.spawnColor) {
|
|
51
52
|
this.spawnColor = (0, Utils_1.colorToHsl)(this.options.spawnColor);
|
|
52
53
|
}
|
|
53
54
|
this.paused = !this.options.autoPlay;
|
|
54
55
|
this.particlesOptions = particlesOptions;
|
|
55
56
|
this.size =
|
|
56
|
-
(
|
|
57
|
+
(_f = this.options.size) !== null && _f !== void 0 ? _f : (() => {
|
|
57
58
|
const size = new EmitterSize_1.EmitterSize();
|
|
58
59
|
size.load({
|
|
59
60
|
height: 0,
|
|
@@ -62,7 +63,7 @@ class EmitterInstance {
|
|
|
62
63
|
});
|
|
63
64
|
return size;
|
|
64
65
|
})();
|
|
65
|
-
this.lifeCount = (
|
|
66
|
+
this.lifeCount = (_g = this.options.life.count) !== null && _g !== void 0 ? _g : -1;
|
|
66
67
|
this.immortal = this.lifeCount <= 0;
|
|
67
68
|
this.play();
|
|
68
69
|
}
|
package/browser/Core/Canvas.js
CHANGED
|
@@ -117,10 +117,7 @@ export class Canvas {
|
|
|
117
117
|
const container = this.container;
|
|
118
118
|
const pxRatio = container.retina.pixelRatio;
|
|
119
119
|
const size = container.canvas.size;
|
|
120
|
-
const oldSize = {
|
|
121
|
-
width: size.width,
|
|
122
|
-
height: size.height,
|
|
123
|
-
};
|
|
120
|
+
const oldSize = Object.assign({}, size);
|
|
124
121
|
size.width = this.element.offsetWidth * pxRatio;
|
|
125
122
|
size.height = this.element.offsetHeight * pxRatio;
|
|
126
123
|
this.element.width = size.width;
|
package/browser/Core/Particle.js
CHANGED
|
@@ -121,10 +121,11 @@ export class Particles {
|
|
|
121
121
|
// p.vy = f * Math.sin(t);
|
|
122
122
|
// }
|
|
123
123
|
const resizeFactor = container.canvas.resizeFactor;
|
|
124
|
-
if (resizeFactor) {
|
|
124
|
+
if (resizeFactor && !particle.ignoresResizeRatio) {
|
|
125
125
|
particle.position.x *= resizeFactor.width;
|
|
126
126
|
particle.position.y *= resizeFactor.height;
|
|
127
127
|
}
|
|
128
|
+
particle.ignoresResizeRatio = false;
|
|
128
129
|
particle.bubble.inRange = false;
|
|
129
130
|
for (const [, plugin] of this.container.plugins) {
|
|
130
131
|
if (particle.destroyed) {
|
|
@@ -18,8 +18,8 @@ import { EmitterSize } from "./Options/Classes/EmitterSize";
|
|
|
18
18
|
*/
|
|
19
19
|
export class EmitterInstance {
|
|
20
20
|
constructor(engine, emitters, container, options, position) {
|
|
21
|
-
var _a, _b, _c, _d, _e, _f;
|
|
22
|
-
var
|
|
21
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
22
|
+
var _h;
|
|
23
23
|
this.emitters = emitters;
|
|
24
24
|
this.container = container;
|
|
25
25
|
_EmitterInstance_firstSpawn.set(this, void 0);
|
|
@@ -38,22 +38,23 @@ export class EmitterInstance {
|
|
|
38
38
|
this.options.load(options);
|
|
39
39
|
}
|
|
40
40
|
this.spawnDelay = (((_a = this.options.life.delay) !== null && _a !== void 0 ? _a : 0) * 1000) / this.container.retina.reduceFactor;
|
|
41
|
+
this.position = (_b = this.initialPosition) !== null && _b !== void 0 ? _b : this.calcPosition();
|
|
41
42
|
this.name = this.options.name;
|
|
42
|
-
this.shape = (
|
|
43
|
+
this.shape = (_c = __classPrivateFieldGet(this, _EmitterInstance_engine, "f").emitterShapeManager) === null || _c === void 0 ? void 0 : _c.getShape(this.options.shape);
|
|
43
44
|
this.fill = this.options.fill;
|
|
44
45
|
__classPrivateFieldSet(this, _EmitterInstance_firstSpawn, !this.options.life.wait, "f");
|
|
45
46
|
__classPrivateFieldSet(this, _EmitterInstance_startParticlesAdded, false, "f");
|
|
46
47
|
let particlesOptions = deepExtend({}, this.options.particles);
|
|
47
48
|
particlesOptions !== null && particlesOptions !== void 0 ? particlesOptions : (particlesOptions = {});
|
|
48
|
-
(
|
|
49
|
-
(
|
|
49
|
+
(_d = particlesOptions.move) !== null && _d !== void 0 ? _d : (particlesOptions.move = {});
|
|
50
|
+
(_e = (_h = particlesOptions.move).direction) !== null && _e !== void 0 ? _e : (_h.direction = this.options.direction);
|
|
50
51
|
if (this.options.spawnColor) {
|
|
51
52
|
this.spawnColor = colorToHsl(this.options.spawnColor);
|
|
52
53
|
}
|
|
53
54
|
this.paused = !this.options.autoPlay;
|
|
54
55
|
this.particlesOptions = particlesOptions;
|
|
55
56
|
this.size =
|
|
56
|
-
(
|
|
57
|
+
(_f = this.options.size) !== null && _f !== void 0 ? _f : (() => {
|
|
57
58
|
const size = new EmitterSize();
|
|
58
59
|
size.load({
|
|
59
60
|
height: 0,
|
|
@@ -62,7 +63,7 @@ export class EmitterInstance {
|
|
|
62
63
|
});
|
|
63
64
|
return size;
|
|
64
65
|
})();
|
|
65
|
-
this.lifeCount = (
|
|
66
|
+
this.lifeCount = (_g = this.options.life.count) !== null && _g !== void 0 ? _g : -1;
|
|
66
67
|
this.immortal = this.lifeCount <= 0;
|
|
67
68
|
this.play();
|
|
68
69
|
}
|
package/esm/Core/Canvas.js
CHANGED
|
@@ -95,10 +95,7 @@ export class Canvas {
|
|
|
95
95
|
const container = this.container;
|
|
96
96
|
const pxRatio = container.retina.pixelRatio;
|
|
97
97
|
const size = container.canvas.size;
|
|
98
|
-
const oldSize = {
|
|
99
|
-
width: size.width,
|
|
100
|
-
height: size.height,
|
|
101
|
-
};
|
|
98
|
+
const oldSize = Object.assign({}, size);
|
|
102
99
|
size.width = this.element.offsetWidth * pxRatio;
|
|
103
100
|
size.height = this.element.offsetHeight * pxRatio;
|
|
104
101
|
this.element.width = size.width;
|
package/esm/Core/Particle.d.ts
CHANGED
package/esm/Core/Particle.js
CHANGED
package/esm/Core/Particles.js
CHANGED
|
@@ -108,10 +108,11 @@ export class Particles {
|
|
|
108
108
|
}
|
|
109
109
|
for (const particle of this.array) {
|
|
110
110
|
const resizeFactor = container.canvas.resizeFactor;
|
|
111
|
-
if (resizeFactor) {
|
|
111
|
+
if (resizeFactor && !particle.ignoresResizeRatio) {
|
|
112
112
|
particle.position.x *= resizeFactor.width;
|
|
113
113
|
particle.position.y *= resizeFactor.height;
|
|
114
114
|
}
|
|
115
|
+
particle.ignoresResizeRatio = false;
|
|
115
116
|
particle.bubble.inRange = false;
|
|
116
117
|
for (const [, plugin] of this.container.plugins) {
|
|
117
118
|
if (particle.destroyed) {
|
|
@@ -15,8 +15,8 @@ import { Emitter } from "./Options/Classes/Emitter";
|
|
|
15
15
|
import { EmitterSize } from "./Options/Classes/EmitterSize";
|
|
16
16
|
export class EmitterInstance {
|
|
17
17
|
constructor(engine, emitters, container, options, position) {
|
|
18
|
-
var _a, _b, _c, _d, _e, _f;
|
|
19
|
-
var
|
|
18
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
19
|
+
var _h;
|
|
20
20
|
this.emitters = emitters;
|
|
21
21
|
this.container = container;
|
|
22
22
|
_EmitterInstance_firstSpawn.set(this, void 0);
|
|
@@ -35,22 +35,23 @@ export class EmitterInstance {
|
|
|
35
35
|
this.options.load(options);
|
|
36
36
|
}
|
|
37
37
|
this.spawnDelay = (((_a = this.options.life.delay) !== null && _a !== void 0 ? _a : 0) * 1000) / this.container.retina.reduceFactor;
|
|
38
|
+
this.position = (_b = this.initialPosition) !== null && _b !== void 0 ? _b : this.calcPosition();
|
|
38
39
|
this.name = this.options.name;
|
|
39
|
-
this.shape = (
|
|
40
|
+
this.shape = (_c = __classPrivateFieldGet(this, _EmitterInstance_engine, "f").emitterShapeManager) === null || _c === void 0 ? void 0 : _c.getShape(this.options.shape);
|
|
40
41
|
this.fill = this.options.fill;
|
|
41
42
|
__classPrivateFieldSet(this, _EmitterInstance_firstSpawn, !this.options.life.wait, "f");
|
|
42
43
|
__classPrivateFieldSet(this, _EmitterInstance_startParticlesAdded, false, "f");
|
|
43
44
|
let particlesOptions = deepExtend({}, this.options.particles);
|
|
44
45
|
particlesOptions !== null && particlesOptions !== void 0 ? particlesOptions : (particlesOptions = {});
|
|
45
|
-
(
|
|
46
|
-
(
|
|
46
|
+
(_d = particlesOptions.move) !== null && _d !== void 0 ? _d : (particlesOptions.move = {});
|
|
47
|
+
(_e = (_h = particlesOptions.move).direction) !== null && _e !== void 0 ? _e : (_h.direction = this.options.direction);
|
|
47
48
|
if (this.options.spawnColor) {
|
|
48
49
|
this.spawnColor = colorToHsl(this.options.spawnColor);
|
|
49
50
|
}
|
|
50
51
|
this.paused = !this.options.autoPlay;
|
|
51
52
|
this.particlesOptions = particlesOptions;
|
|
52
53
|
this.size =
|
|
53
|
-
(
|
|
54
|
+
(_f = this.options.size) !== null && _f !== void 0 ? _f : (() => {
|
|
54
55
|
const size = new EmitterSize();
|
|
55
56
|
size.load({
|
|
56
57
|
height: 0,
|
|
@@ -59,7 +60,7 @@ export class EmitterInstance {
|
|
|
59
60
|
});
|
|
60
61
|
return size;
|
|
61
62
|
})();
|
|
62
|
-
this.lifeCount = (
|
|
63
|
+
this.lifeCount = (_g = this.options.life.count) !== null && _g !== void 0 ? _g : -1;
|
|
63
64
|
this.immortal = this.lifeCount <= 0;
|
|
64
65
|
this.play();
|
|
65
66
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tsparticles",
|
|
3
|
-
"version": "1.41.
|
|
3
|
+
"version": "1.41.6",
|
|
4
4
|
"description": "Easily create highly customizable particle animations and use them as animated backgrounds for your website. Ready to use components available also for React, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Riot.js, Inferno.",
|
|
5
5
|
"homepage": "https://particles.js.org/",
|
|
6
6
|
"scripts": {
|