tsparticles 1.37.1 → 1.37.5
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/Container.d.ts +1 -0
- package/Core/Container.js +2 -0
- package/Plugins/Absorbers/AbsorberInstance.d.ts +2 -1
- package/Plugins/Absorbers/AbsorberInstance.js +21 -9
- package/Plugins/Absorbers/Options/Classes/AbsorberSize.d.ts +2 -1
- package/Plugins/Absorbers/Options/Classes/AbsorberSize.js +6 -4
- package/Plugins/Absorbers/Options/Classes/AbsorberSizeLimit.d.ts +9 -0
- package/Plugins/Absorbers/Options/Classes/AbsorberSizeLimit.js +21 -0
- package/Plugins/Absorbers/Options/Interfaces/IAbsorberSize.d.ts +3 -2
- package/Plugins/Absorbers/Options/Interfaces/IAbsorberSizeLimit.d.ts +4 -0
- package/Plugins/Absorbers/Options/Interfaces/IAbsorberSizeLimit.js +2 -0
- package/Utils/EventListeners.d.ts +1 -0
- package/Utils/EventListeners.js +13 -2
- package/Utils/Utils.js +4 -7
- package/browser/Core/Container.d.ts +1 -0
- package/browser/Core/Container.js +2 -0
- package/browser/Plugins/Absorbers/AbsorberInstance.d.ts +2 -1
- package/browser/Plugins/Absorbers/AbsorberInstance.js +21 -9
- package/browser/Plugins/Absorbers/Options/Classes/AbsorberSize.d.ts +2 -1
- package/browser/Plugins/Absorbers/Options/Classes/AbsorberSize.js +6 -4
- package/browser/Plugins/Absorbers/Options/Classes/AbsorberSizeLimit.d.ts +9 -0
- package/browser/Plugins/Absorbers/Options/Classes/AbsorberSizeLimit.js +17 -0
- package/browser/Plugins/Absorbers/Options/Interfaces/IAbsorberSize.d.ts +3 -2
- package/browser/Plugins/Absorbers/Options/Interfaces/IAbsorberSizeLimit.d.ts +4 -0
- package/browser/Plugins/Absorbers/Options/Interfaces/IAbsorberSizeLimit.js +1 -0
- package/browser/Plugins/PolygonMask/plugin.js +3 -1
- package/browser/Utils/EventListeners.d.ts +1 -0
- package/browser/Utils/EventListeners.js +14 -3
- package/browser/Utils/Utils.js +5 -8
- package/esm/Core/Container.d.ts +1 -0
- package/esm/Core/Container.js +2 -0
- package/esm/Plugins/Absorbers/AbsorberInstance.d.ts +2 -1
- package/esm/Plugins/Absorbers/AbsorberInstance.js +21 -9
- package/esm/Plugins/Absorbers/Options/Classes/AbsorberSize.d.ts +2 -1
- package/esm/Plugins/Absorbers/Options/Classes/AbsorberSize.js +6 -4
- package/esm/Plugins/Absorbers/Options/Classes/AbsorberSizeLimit.d.ts +9 -0
- package/esm/Plugins/Absorbers/Options/Classes/AbsorberSizeLimit.js +17 -0
- package/esm/Plugins/Absorbers/Options/Interfaces/IAbsorberSize.d.ts +3 -2
- package/esm/Plugins/Absorbers/Options/Interfaces/IAbsorberSizeLimit.d.ts +4 -0
- package/esm/Plugins/Absorbers/Options/Interfaces/IAbsorberSizeLimit.js +1 -0
- package/esm/Utils/EventListeners.d.ts +1 -0
- package/esm/Utils/EventListeners.js +14 -3
- package/esm/Utils/Utils.js +5 -8
- package/package.json +1 -1
- package/report.html +2 -2
- package/report.slim.html +2 -2
- package/tsparticles.js +326 -30
- package/tsparticles.min.js +2 -2
- package/tsparticles.pathseg.js +1472 -0
- package/tsparticles.slim.js +18 -10
- package/tsparticles.slim.min.js +2 -2
package/tsparticles.slim.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var a = factory();
|
|
4
4
|
for (var i in a) (typeof exports === "object" ? exports : root)[i] = a[i];
|
|
5
5
|
}
|
|
6
|
-
})(
|
|
6
|
+
})(window, (function() {
|
|
7
7
|
return function() {
|
|
8
8
|
"use strict";
|
|
9
9
|
var __webpack_require__ = {};
|
|
@@ -939,14 +939,11 @@
|
|
|
939
939
|
};
|
|
940
940
|
}
|
|
941
941
|
function circleBounce(p1, p2) {
|
|
942
|
-
const xVelocityDiff = p1.velocity.
|
|
943
|
-
const
|
|
944
|
-
const
|
|
945
|
-
const pos2 = p2.position;
|
|
946
|
-
const xDist = pos2.x - pos1.x;
|
|
947
|
-
const yDist = pos2.y - pos1.y;
|
|
942
|
+
const {x: xVelocityDiff, y: yVelocityDiff} = p1.velocity.sub(p2.velocity);
|
|
943
|
+
const [pos1, pos2] = [ p1.position, p2.position ];
|
|
944
|
+
const {dx: xDist, dy: yDist} = getDistances(pos2, pos1);
|
|
948
945
|
if (xVelocityDiff * xDist + yVelocityDiff * yDist >= 0) {
|
|
949
|
-
const angle = -Math.atan2(
|
|
946
|
+
const angle = -Math.atan2(yDist, xDist);
|
|
950
947
|
const m1 = p1.mass;
|
|
951
948
|
const m2 = p2.mass;
|
|
952
949
|
const u1 = p1.velocity.rotate(angle);
|
|
@@ -1880,6 +1877,7 @@
|
|
|
1880
1877
|
this.mouseDownHandler = () => this.mouseDown();
|
|
1881
1878
|
this.visibilityChangeHandler = () => this.handleVisibilityChange();
|
|
1882
1879
|
this.themeChangeHandler = e => this.handleThemeChange(e);
|
|
1880
|
+
this.oldThemeChangeHandler = e => this.handleThemeChange(e);
|
|
1883
1881
|
this.resizeHandler = () => this.handleWindowResize();
|
|
1884
1882
|
}
|
|
1885
1883
|
addListeners() {
|
|
@@ -1903,9 +1901,17 @@
|
|
|
1903
1901
|
} else {
|
|
1904
1902
|
container.interactivity.element = container.canvas.element;
|
|
1905
1903
|
}
|
|
1906
|
-
const mediaMatch = typeof matchMedia !== "undefined" && matchMedia("(prefers-color-scheme: dark)");
|
|
1904
|
+
const mediaMatch = !isSsr() && typeof matchMedia !== "undefined" && matchMedia("(prefers-color-scheme: dark)");
|
|
1907
1905
|
if (mediaMatch) {
|
|
1908
|
-
|
|
1906
|
+
if (mediaMatch.addEventListener !== undefined) {
|
|
1907
|
+
manageListener(mediaMatch, "change", this.themeChangeHandler, add);
|
|
1908
|
+
} else if (mediaMatch.addListener !== undefined) {
|
|
1909
|
+
if (add) {
|
|
1910
|
+
mediaMatch.addListener(this.oldThemeChangeHandler);
|
|
1911
|
+
} else {
|
|
1912
|
+
mediaMatch.removeListener(this.oldThemeChangeHandler);
|
|
1913
|
+
}
|
|
1914
|
+
}
|
|
1909
1915
|
}
|
|
1910
1916
|
const interactivityEl = container.interactivity.element;
|
|
1911
1917
|
if (!interactivityEl) {
|
|
@@ -6308,6 +6314,7 @@
|
|
|
6308
6314
|
this.zLayers = 100;
|
|
6309
6315
|
this.pageHidden = false;
|
|
6310
6316
|
this._sourceOptions = sourceOptions;
|
|
6317
|
+
this._initialSourceOptions = sourceOptions;
|
|
6311
6318
|
this.retina = new Retina(this);
|
|
6312
6319
|
this.canvas = new Canvas(this);
|
|
6313
6320
|
this.particles = new Particles(this);
|
|
@@ -6607,6 +6614,7 @@
|
|
|
6607
6614
|
this.drawers.set(type, drawer);
|
|
6608
6615
|
}
|
|
6609
6616
|
}
|
|
6617
|
+
this._options.load(this._initialSourceOptions);
|
|
6610
6618
|
this._options.load(this._sourceOptions);
|
|
6611
6619
|
this.actualOptions = new Options;
|
|
6612
6620
|
this.actualOptions.load(this._options);
|