tsparticles 1.42.0 → 1.42.3
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.d.ts +1 -1
- package/Core/Canvas.js +16 -7
- package/Core/Particles.js +2 -3
- package/Plugins/Emitters/Options/Classes/Emitter.js +2 -2
- package/browser/Core/Canvas.d.ts +1 -1
- package/browser/Core/Canvas.js +16 -7
- package/browser/Core/Particles.js +3 -4
- package/browser/Plugins/Emitters/Options/Classes/Emitter.js +2 -2
- package/esm/Core/Canvas.d.ts +1 -1
- package/esm/Core/Canvas.js +16 -7
- package/esm/Core/Particles.js +2 -3
- package/esm/Plugins/Emitters/Options/Classes/Emitter.js +2 -2
- package/package.json +15 -3
- package/report.html +2 -2
- package/report.slim.html +2 -2
- package/tsparticles.engine.js +15 -10
- package/tsparticles.engine.min.js +2 -2
- package/tsparticles.interaction.external.attract.js +15 -10
- package/tsparticles.interaction.external.attract.min.js +1 -1
- package/tsparticles.interaction.external.bounce.js +15 -10
- package/tsparticles.interaction.external.bounce.min.js +1 -1
- package/tsparticles.interaction.external.bubble.js +15 -10
- package/tsparticles.interaction.external.bubble.min.js +1 -1
- package/tsparticles.interaction.external.connect.js +15 -10
- package/tsparticles.interaction.external.connect.min.js +1 -1
- package/tsparticles.interaction.external.grab.js +15 -10
- package/tsparticles.interaction.external.grab.min.js +1 -1
- package/tsparticles.interaction.external.repulse.js +15 -10
- package/tsparticles.interaction.external.repulse.min.js +1 -1
- package/tsparticles.interaction.external.trail.js +15 -10
- package/tsparticles.interaction.external.trail.min.js +1 -1
- package/tsparticles.interaction.particles.attract.js +15 -10
- package/tsparticles.interaction.particles.attract.min.js +1 -1
- package/tsparticles.interaction.particles.collisions.js +15 -10
- package/tsparticles.interaction.particles.collisions.min.js +1 -1
- package/tsparticles.interaction.particles.links.js +15 -10
- package/tsparticles.interaction.particles.links.min.js +1 -1
- package/tsparticles.js +17 -12
- package/tsparticles.min.js +2 -2
- package/tsparticles.pathseg.min.js +1 -1
- package/tsparticles.plugins.absorbers.js +15 -10
- package/tsparticles.plugins.absorbers.min.js +1 -1
- package/tsparticles.plugins.emitters.js +17 -12
- package/tsparticles.plugins.emitters.min.js +2 -2
- package/tsparticles.plugins.polygonMask.js +15 -10
- package/tsparticles.plugins.polygonMask.min.js +1 -1
- package/tsparticles.shape.circle.min.js +1 -1
- package/tsparticles.shape.image.js +15 -10
- 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 +15 -10
- package/tsparticles.shape.text.min.js +1 -1
- package/tsparticles.slim.js +15 -10
- package/tsparticles.slim.min.js +2 -2
- package/tsparticles.updater.angle.js +15 -10
- package/tsparticles.updater.angle.min.js +1 -1
- package/tsparticles.updater.color.js +15 -10
- package/tsparticles.updater.color.min.js +1 -1
- package/tsparticles.updater.life.js +15 -10
- package/tsparticles.updater.life.min.js +1 -1
- package/tsparticles.updater.opacity.js +15 -10
- package/tsparticles.updater.opacity.min.js +1 -1
- package/tsparticles.updater.outModes.js +15 -10
- package/tsparticles.updater.outModes.min.js +1 -1
- package/tsparticles.updater.roll.js +15 -10
- package/tsparticles.updater.roll.min.js +1 -1
- package/tsparticles.updater.size.js +15 -10
- package/tsparticles.updater.size.min.js +1 -1
- package/tsparticles.updater.strokeColor.js +15 -10
- package/tsparticles.updater.strokeColor.min.js +1 -1
- package/tsparticles.updater.tilt.js +15 -10
- package/tsparticles.updater.tilt.min.js +1 -1
- package/tsparticles.updater.wobble.js +15 -10
- package/tsparticles.updater.wobble.min.js +1 -1
- package/umd/Core/Canvas.d.ts +1 -1
- package/umd/Core/Canvas.js +16 -7
- package/umd/Core/Particles.js +2 -3
- package/umd/Plugins/Emitters/Options/Classes/Emitter.js +2 -2
package/Core/Canvas.d.ts
CHANGED
package/Core/Canvas.js
CHANGED
|
@@ -50,9 +50,9 @@ class Canvas {
|
|
|
50
50
|
paint() {
|
|
51
51
|
const options = this.container.actualOptions;
|
|
52
52
|
this.draw((ctx) => {
|
|
53
|
-
if (options.backgroundMask.enable && options.backgroundMask.cover
|
|
53
|
+
if (options.backgroundMask.enable && options.backgroundMask.cover) {
|
|
54
54
|
(0, Utils_1.clear)(ctx, this.size);
|
|
55
|
-
this.paintBase(
|
|
55
|
+
this.paintBase(this.coverColorStyle);
|
|
56
56
|
}
|
|
57
57
|
else {
|
|
58
58
|
this.paintBase();
|
|
@@ -98,11 +98,19 @@ class Canvas {
|
|
|
98
98
|
const container = this.container;
|
|
99
99
|
const pxRatio = container.retina.pixelRatio;
|
|
100
100
|
const size = container.canvas.size;
|
|
101
|
+
const newSize = {
|
|
102
|
+
width: this.element.offsetWidth * pxRatio,
|
|
103
|
+
height: this.element.offsetHeight * pxRatio,
|
|
104
|
+
};
|
|
105
|
+
if (newSize.height === size.height &&
|
|
106
|
+
newSize.width === size.width &&
|
|
107
|
+
newSize.height === this.element.height &&
|
|
108
|
+
newSize.width === this.element.width) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
101
111
|
const oldSize = Object.assign({}, size);
|
|
102
|
-
size.width = this.element.offsetWidth * pxRatio;
|
|
103
|
-
size.height = this.element.offsetHeight * pxRatio;
|
|
104
|
-
this.element.width = size.width;
|
|
105
|
-
this.element.height = size.height;
|
|
112
|
+
this.element.width = size.width = this.element.offsetWidth * pxRatio;
|
|
113
|
+
this.element.height = size.height = this.element.offsetHeight * pxRatio;
|
|
106
114
|
if (this.container.started) {
|
|
107
115
|
this.resizeFactor = {
|
|
108
116
|
width: size.width / oldSize.width,
|
|
@@ -229,12 +237,13 @@ class Canvas {
|
|
|
229
237
|
const color = cover.color;
|
|
230
238
|
const coverRgb = (0, Utils_1.colorToRgb)(color);
|
|
231
239
|
if (coverRgb) {
|
|
232
|
-
|
|
240
|
+
const coverColor = {
|
|
233
241
|
r: coverRgb.r,
|
|
234
242
|
g: coverRgb.g,
|
|
235
243
|
b: coverRgb.b,
|
|
236
244
|
a: cover.opacity,
|
|
237
245
|
};
|
|
246
|
+
this.coverColorStyle = (0, Utils_1.getStyleFromRgb)(coverColor, coverColor.a);
|
|
238
247
|
}
|
|
239
248
|
}
|
|
240
249
|
initTrail() {
|
package/Core/Particles.js
CHANGED
|
@@ -147,9 +147,7 @@ class Particles {
|
|
|
147
147
|
delete container.canvas.resizeFactor;
|
|
148
148
|
}
|
|
149
149
|
async draw(delta) {
|
|
150
|
-
const container = this.container;
|
|
151
|
-
container.canvas.clear();
|
|
152
|
-
const canvasSize = this.container.canvas.size;
|
|
150
|
+
const container = this.container, canvasSize = this.container.canvas.size;
|
|
153
151
|
this.quadTree = new Utils_1.QuadTree(new Utils_1.Rectangle(-canvasSize.width / 4, -canvasSize.height / 4, (canvasSize.width * 3) / 2, (canvasSize.height * 3) / 2), 4);
|
|
154
152
|
await this.update(delta);
|
|
155
153
|
if (this.needsSort) {
|
|
@@ -157,6 +155,7 @@ class Particles {
|
|
|
157
155
|
this.lastZIndex = this.zArray[this.zArray.length - 1].position.z;
|
|
158
156
|
this.needsSort = false;
|
|
159
157
|
}
|
|
158
|
+
container.canvas.clear();
|
|
160
159
|
for (const [, plugin] of container.plugins) {
|
|
161
160
|
container.canvas.drawPlugin(plugin, delta);
|
|
162
161
|
}
|
|
@@ -46,10 +46,10 @@ class Emitter {
|
|
|
46
46
|
}
|
|
47
47
|
if (data.position !== undefined) {
|
|
48
48
|
this.position = {};
|
|
49
|
-
if (data.position.x) {
|
|
49
|
+
if (data.position.x !== undefined) {
|
|
50
50
|
this.position.x = (0, Utils_1.setRangeValue)(data.position.x);
|
|
51
51
|
}
|
|
52
|
-
if (data.position.y) {
|
|
52
|
+
if (data.position.y !== undefined) {
|
|
53
53
|
this.position.y = (0, Utils_1.setRangeValue)(data.position.y);
|
|
54
54
|
}
|
|
55
55
|
}
|
package/browser/Core/Canvas.d.ts
CHANGED
package/browser/Core/Canvas.js
CHANGED
|
@@ -62,9 +62,9 @@ export class Canvas {
|
|
|
62
62
|
paint() {
|
|
63
63
|
const options = this.container.actualOptions;
|
|
64
64
|
this.draw((ctx) => {
|
|
65
|
-
if (options.backgroundMask.enable && options.backgroundMask.cover
|
|
65
|
+
if (options.backgroundMask.enable && options.backgroundMask.cover) {
|
|
66
66
|
clear(ctx, this.size);
|
|
67
|
-
this.paintBase(
|
|
67
|
+
this.paintBase(this.coverColorStyle);
|
|
68
68
|
}
|
|
69
69
|
else {
|
|
70
70
|
this.paintBase();
|
|
@@ -117,11 +117,19 @@ 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 newSize = {
|
|
121
|
+
width: this.element.offsetWidth * pxRatio,
|
|
122
|
+
height: this.element.offsetHeight * pxRatio,
|
|
123
|
+
};
|
|
124
|
+
if (newSize.height === size.height &&
|
|
125
|
+
newSize.width === size.width &&
|
|
126
|
+
newSize.height === this.element.height &&
|
|
127
|
+
newSize.width === this.element.width) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
120
130
|
const oldSize = Object.assign({}, size);
|
|
121
|
-
size.width = this.element.offsetWidth * pxRatio;
|
|
122
|
-
size.height = this.element.offsetHeight * pxRatio;
|
|
123
|
-
this.element.width = size.width;
|
|
124
|
-
this.element.height = size.height;
|
|
131
|
+
this.element.width = size.width = this.element.offsetWidth * pxRatio;
|
|
132
|
+
this.element.height = size.height = this.element.offsetHeight * pxRatio;
|
|
125
133
|
if (this.container.started) {
|
|
126
134
|
this.resizeFactor = {
|
|
127
135
|
width: size.width / oldSize.width,
|
|
@@ -248,12 +256,13 @@ export class Canvas {
|
|
|
248
256
|
const color = cover.color;
|
|
249
257
|
const coverRgb = colorToRgb(color);
|
|
250
258
|
if (coverRgb) {
|
|
251
|
-
|
|
259
|
+
const coverColor = {
|
|
252
260
|
r: coverRgb.r,
|
|
253
261
|
g: coverRgb.g,
|
|
254
262
|
b: coverRgb.b,
|
|
255
263
|
a: cover.opacity,
|
|
256
264
|
};
|
|
265
|
+
this.coverColorStyle = getStyleFromRgb(coverColor, coverColor.a);
|
|
257
266
|
}
|
|
258
267
|
}
|
|
259
268
|
initTrail() {
|
|
@@ -158,10 +158,7 @@ export class Particles {
|
|
|
158
158
|
delete container.canvas.resizeFactor;
|
|
159
159
|
}
|
|
160
160
|
async draw(delta) {
|
|
161
|
-
const container = this.container;
|
|
162
|
-
/* clear canvas */
|
|
163
|
-
container.canvas.clear();
|
|
164
|
-
const canvasSize = this.container.canvas.size;
|
|
161
|
+
const container = this.container, canvasSize = this.container.canvas.size;
|
|
165
162
|
this.quadTree = new QuadTree(new Rectangle(-canvasSize.width / 4, -canvasSize.height / 4, (canvasSize.width * 3) / 2, (canvasSize.height * 3) / 2), 4);
|
|
166
163
|
/* update each particles param */
|
|
167
164
|
await this.update(delta);
|
|
@@ -170,6 +167,8 @@ export class Particles {
|
|
|
170
167
|
this.lastZIndex = this.zArray[this.zArray.length - 1].position.z;
|
|
171
168
|
this.needsSort = false;
|
|
172
169
|
}
|
|
170
|
+
/* clear canvas */
|
|
171
|
+
container.canvas.clear();
|
|
173
172
|
/* draw polygon shape in debug mode */
|
|
174
173
|
for (const [, plugin] of container.plugins) {
|
|
175
174
|
container.canvas.drawPlugin(plugin, delta);
|
|
@@ -47,10 +47,10 @@ export class Emitter {
|
|
|
47
47
|
}
|
|
48
48
|
if (data.position !== undefined) {
|
|
49
49
|
this.position = {};
|
|
50
|
-
if (data.position.x) {
|
|
50
|
+
if (data.position.x !== undefined) {
|
|
51
51
|
this.position.x = setRangeValue(data.position.x);
|
|
52
52
|
}
|
|
53
|
-
if (data.position.y) {
|
|
53
|
+
if (data.position.y !== undefined) {
|
|
54
54
|
this.position.y = setRangeValue(data.position.y);
|
|
55
55
|
}
|
|
56
56
|
}
|
package/esm/Core/Canvas.d.ts
CHANGED
package/esm/Core/Canvas.js
CHANGED
|
@@ -47,9 +47,9 @@ export class Canvas {
|
|
|
47
47
|
paint() {
|
|
48
48
|
const options = this.container.actualOptions;
|
|
49
49
|
this.draw((ctx) => {
|
|
50
|
-
if (options.backgroundMask.enable && options.backgroundMask.cover
|
|
50
|
+
if (options.backgroundMask.enable && options.backgroundMask.cover) {
|
|
51
51
|
clear(ctx, this.size);
|
|
52
|
-
this.paintBase(
|
|
52
|
+
this.paintBase(this.coverColorStyle);
|
|
53
53
|
}
|
|
54
54
|
else {
|
|
55
55
|
this.paintBase();
|
|
@@ -95,11 +95,19 @@ 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 newSize = {
|
|
99
|
+
width: this.element.offsetWidth * pxRatio,
|
|
100
|
+
height: this.element.offsetHeight * pxRatio,
|
|
101
|
+
};
|
|
102
|
+
if (newSize.height === size.height &&
|
|
103
|
+
newSize.width === size.width &&
|
|
104
|
+
newSize.height === this.element.height &&
|
|
105
|
+
newSize.width === this.element.width) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
98
108
|
const oldSize = Object.assign({}, size);
|
|
99
|
-
size.width = this.element.offsetWidth * pxRatio;
|
|
100
|
-
size.height = this.element.offsetHeight * pxRatio;
|
|
101
|
-
this.element.width = size.width;
|
|
102
|
-
this.element.height = size.height;
|
|
109
|
+
this.element.width = size.width = this.element.offsetWidth * pxRatio;
|
|
110
|
+
this.element.height = size.height = this.element.offsetHeight * pxRatio;
|
|
103
111
|
if (this.container.started) {
|
|
104
112
|
this.resizeFactor = {
|
|
105
113
|
width: size.width / oldSize.width,
|
|
@@ -226,12 +234,13 @@ export class Canvas {
|
|
|
226
234
|
const color = cover.color;
|
|
227
235
|
const coverRgb = colorToRgb(color);
|
|
228
236
|
if (coverRgb) {
|
|
229
|
-
|
|
237
|
+
const coverColor = {
|
|
230
238
|
r: coverRgb.r,
|
|
231
239
|
g: coverRgb.g,
|
|
232
240
|
b: coverRgb.b,
|
|
233
241
|
a: cover.opacity,
|
|
234
242
|
};
|
|
243
|
+
this.coverColorStyle = getStyleFromRgb(coverColor, coverColor.a);
|
|
235
244
|
}
|
|
236
245
|
}
|
|
237
246
|
initTrail() {
|
package/esm/Core/Particles.js
CHANGED
|
@@ -144,9 +144,7 @@ export class Particles {
|
|
|
144
144
|
delete container.canvas.resizeFactor;
|
|
145
145
|
}
|
|
146
146
|
async draw(delta) {
|
|
147
|
-
const container = this.container;
|
|
148
|
-
container.canvas.clear();
|
|
149
|
-
const canvasSize = this.container.canvas.size;
|
|
147
|
+
const container = this.container, canvasSize = this.container.canvas.size;
|
|
150
148
|
this.quadTree = new QuadTree(new Rectangle(-canvasSize.width / 4, -canvasSize.height / 4, (canvasSize.width * 3) / 2, (canvasSize.height * 3) / 2), 4);
|
|
151
149
|
await this.update(delta);
|
|
152
150
|
if (this.needsSort) {
|
|
@@ -154,6 +152,7 @@ export class Particles {
|
|
|
154
152
|
this.lastZIndex = this.zArray[this.zArray.length - 1].position.z;
|
|
155
153
|
this.needsSort = false;
|
|
156
154
|
}
|
|
155
|
+
container.canvas.clear();
|
|
157
156
|
for (const [, plugin] of container.plugins) {
|
|
158
157
|
container.canvas.drawPlugin(plugin, delta);
|
|
159
158
|
}
|
|
@@ -43,10 +43,10 @@ export class Emitter {
|
|
|
43
43
|
}
|
|
44
44
|
if (data.position !== undefined) {
|
|
45
45
|
this.position = {};
|
|
46
|
-
if (data.position.x) {
|
|
46
|
+
if (data.position.x !== undefined) {
|
|
47
47
|
this.position.x = setRangeValue(data.position.x);
|
|
48
48
|
}
|
|
49
|
-
if (data.position.y) {
|
|
49
|
+
if (data.position.y !== undefined) {
|
|
50
50
|
this.position.y = setRangeValue(data.position.y);
|
|
51
51
|
}
|
|
52
52
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tsparticles",
|
|
3
|
-
"version": "1.42.
|
|
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.",
|
|
3
|
+
"version": "1.42.3",
|
|
4
|
+
"description": "Easily create highly customizable particle, confetti and fireworks 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": {
|
|
7
7
|
"install": "node ./scripts/install.js"
|
|
@@ -30,6 +30,10 @@
|
|
|
30
30
|
"react-particles",
|
|
31
31
|
"react",
|
|
32
32
|
"reactjs",
|
|
33
|
+
"vue-particles",
|
|
34
|
+
"ngx-particles",
|
|
35
|
+
"angular-particles",
|
|
36
|
+
"particleground",
|
|
33
37
|
"vue",
|
|
34
38
|
"vuejs",
|
|
35
39
|
"preact",
|
|
@@ -48,7 +52,15 @@
|
|
|
48
52
|
"html",
|
|
49
53
|
"css3",
|
|
50
54
|
"animated",
|
|
51
|
-
"background"
|
|
55
|
+
"background",
|
|
56
|
+
"confetti",
|
|
57
|
+
"canvas",
|
|
58
|
+
"fireworks",
|
|
59
|
+
"fireworks-js",
|
|
60
|
+
"confetti-js",
|
|
61
|
+
"confettijs",
|
|
62
|
+
"fireworksjs",
|
|
63
|
+
"canvas-confetti"
|
|
52
64
|
],
|
|
53
65
|
"author": "Matteo Bruni <matteo.bruni@me.com>",
|
|
54
66
|
"contributors": [
|