tsparticles 1.39.1 → 1.40.1
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 +3 -1
- package/Core/Container.js +30 -15
- package/Core/Loader.d.ts +12 -9
- package/Core/Loader.js +35 -19
- package/Core/Particle.d.ts +3 -1
- package/Core/Particle.js +17 -2
- package/Core/Particles.d.ts +3 -1
- package/Core/Particles.js +20 -5
- package/Core/Utils/InteractionManager.d.ts +5 -3
- package/Core/Utils/InteractionManager.js +19 -3
- package/Core/Utils/Plugins.d.ts +29 -15
- package/Core/Utils/Plugins.js +58 -46
- package/Options/Classes/Options.d.ts +2 -1
- package/Options/Classes/Options.js +14 -7
- package/Plugins/Emitters/EmitterInstance.d.ts +6 -3
- package/Plugins/Emitters/EmitterInstance.js +46 -16
- package/Plugins/Emitters/Emitters.d.ts +3 -1
- package/Plugins/Emitters/Emitters.js +17 -2
- package/Plugins/Emitters/{EmittersMain.d.ts → EmittersEngine.d.ts} +3 -1
- package/Plugins/Emitters/{EmittersMain.js → EmittersEngine.js} +0 -0
- package/Plugins/Emitters/IEmitterShape.d.ts +2 -2
- package/Plugins/Emitters/Options/Classes/Emitter.d.ts +1 -0
- package/Plugins/Emitters/Options/Classes/Emitter.js +1 -0
- package/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +1 -0
- package/Plugins/Emitters/ShapeManager.d.ts +6 -3
- package/Plugins/Emitters/ShapeManager.js +16 -4
- package/Plugins/Emitters/Shapes/Circle/CircleShape.d.ts +2 -2
- package/Plugins/Emitters/Shapes/Circle/CircleShape.js +2 -2
- package/Plugins/Emitters/Shapes/Square/SquareShape.d.ts +2 -2
- package/Plugins/Emitters/Shapes/Square/SquareShape.js +4 -4
- package/Plugins/Emitters/index.d.ts +3 -3
- package/Plugins/Emitters/index.js +25 -6
- package/README.md +3 -3
- package/browser/Core/Container.d.ts +4 -1
- package/browser/Core/Container.js +32 -16
- package/browser/Core/Loader.d.ts +12 -9
- package/browser/Core/Loader.js +35 -19
- package/browser/Core/Particle.d.ts +3 -1
- package/browser/Core/Particle.js +18 -3
- package/browser/Core/Particles.d.ts +3 -1
- package/browser/Core/Particles.js +21 -6
- package/browser/Core/Utils/InteractionManager.d.ts +5 -3
- package/browser/Core/Utils/InteractionManager.js +19 -3
- package/browser/Core/Utils/Plugins.d.ts +29 -15
- package/browser/Core/Utils/Plugins.js +58 -46
- package/browser/Options/Classes/Options.d.ts +2 -1
- package/browser/Options/Classes/Options.js +14 -7
- package/browser/Plugins/Emitters/EmitterInstance.d.ts +6 -3
- package/browser/Plugins/Emitters/EmitterInstance.js +46 -16
- package/browser/Plugins/Emitters/Emitters.d.ts +3 -1
- package/browser/Plugins/Emitters/Emitters.js +17 -2
- package/{esm/Plugins/Emitters/EmittersMain.d.ts → browser/Plugins/Emitters/EmittersEngine.d.ts} +3 -1
- package/browser/Plugins/Emitters/{EmittersMain.js → EmittersEngine.js} +0 -0
- package/browser/Plugins/Emitters/IEmitterShape.d.ts +2 -2
- package/browser/Plugins/Emitters/Options/Classes/Emitter.d.ts +1 -0
- package/browser/Plugins/Emitters/Options/Classes/Emitter.js +1 -0
- package/browser/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +4 -0
- package/browser/Plugins/Emitters/ShapeManager.d.ts +6 -3
- package/browser/Plugins/Emitters/ShapeManager.js +16 -4
- package/browser/Plugins/Emitters/Shapes/Circle/CircleShape.d.ts +2 -2
- package/browser/Plugins/Emitters/Shapes/Circle/CircleShape.js +2 -2
- package/browser/Plugins/Emitters/Shapes/Square/SquareShape.d.ts +2 -2
- package/browser/Plugins/Emitters/Shapes/Square/SquareShape.js +4 -4
- package/browser/Plugins/Emitters/index.d.ts +3 -3
- package/browser/Plugins/Emitters/index.js +25 -6
- package/browser/engine.d.ts +5 -1
- package/browser/engine.js +22 -17
- package/engine.d.ts +3 -0
- package/engine.js +20 -16
- package/esm/Core/Container.d.ts +3 -1
- package/esm/Core/Container.js +31 -16
- package/esm/Core/Loader.d.ts +12 -9
- package/esm/Core/Loader.js +35 -19
- package/esm/Core/Particle.d.ts +3 -1
- package/esm/Core/Particle.js +18 -3
- package/esm/Core/Particles.d.ts +3 -1
- package/esm/Core/Particles.js +21 -6
- package/esm/Core/Utils/InteractionManager.d.ts +5 -3
- package/esm/Core/Utils/InteractionManager.js +19 -3
- package/esm/Core/Utils/Plugins.d.ts +29 -15
- package/esm/Core/Utils/Plugins.js +58 -46
- package/esm/Options/Classes/Options.d.ts +2 -1
- package/esm/Options/Classes/Options.js +14 -7
- package/esm/Plugins/Emitters/EmitterInstance.d.ts +6 -3
- package/esm/Plugins/Emitters/EmitterInstance.js +46 -16
- package/esm/Plugins/Emitters/Emitters.d.ts +3 -1
- package/esm/Plugins/Emitters/Emitters.js +17 -2
- package/{browser/Plugins/Emitters/EmittersMain.d.ts → esm/Plugins/Emitters/EmittersEngine.d.ts} +3 -1
- package/esm/Plugins/Emitters/{EmittersMain.js → EmittersEngine.js} +0 -0
- package/esm/Plugins/Emitters/IEmitterShape.d.ts +2 -2
- package/esm/Plugins/Emitters/Options/Classes/Emitter.d.ts +1 -0
- package/esm/Plugins/Emitters/Options/Classes/Emitter.js +1 -0
- package/esm/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +1 -0
- package/esm/Plugins/Emitters/ShapeManager.d.ts +6 -3
- package/esm/Plugins/Emitters/ShapeManager.js +16 -4
- package/esm/Plugins/Emitters/Shapes/Circle/CircleShape.d.ts +2 -2
- package/esm/Plugins/Emitters/Shapes/Circle/CircleShape.js +2 -2
- package/esm/Plugins/Emitters/Shapes/Square/SquareShape.d.ts +2 -2
- package/esm/Plugins/Emitters/Shapes/Square/SquareShape.js +4 -4
- package/esm/Plugins/Emitters/index.d.ts +3 -3
- package/esm/Plugins/Emitters/index.js +25 -6
- package/esm/engine.d.ts +3 -0
- package/esm/engine.js +20 -16
- package/package.json +11 -5
- package/report.html +2 -2
- package/report.slim.html +2 -2
- package/tsparticles.engine.js +227 -118
- package/tsparticles.engine.min.js +2 -2
- package/tsparticles.interaction.external.attract.js +205 -100
- package/tsparticles.interaction.external.attract.min.js +2 -2
- package/tsparticles.interaction.external.bounce.js +205 -100
- package/tsparticles.interaction.external.bounce.min.js +2 -2
- package/tsparticles.interaction.external.bubble.js +205 -100
- package/tsparticles.interaction.external.bubble.min.js +2 -2
- package/tsparticles.interaction.external.connect.js +205 -100
- package/tsparticles.interaction.external.connect.min.js +2 -2
- package/tsparticles.interaction.external.grab.js +205 -100
- package/tsparticles.interaction.external.grab.min.js +2 -2
- package/tsparticles.interaction.external.repulse.js +205 -100
- package/tsparticles.interaction.external.repulse.min.js +2 -2
- package/tsparticles.interaction.external.trail.js +205 -100
- package/tsparticles.interaction.external.trail.min.js +2 -2
- package/tsparticles.interaction.particles.attract.js +205 -100
- package/tsparticles.interaction.particles.attract.min.js +2 -2
- package/tsparticles.interaction.particles.collisions.js +205 -100
- package/tsparticles.interaction.particles.collisions.min.js +2 -2
- package/tsparticles.interaction.particles.links.js +205 -100
- package/tsparticles.interaction.particles.links.min.js +2 -2
- package/tsparticles.js +347 -156
- package/tsparticles.min.js +2 -2
- package/tsparticles.pathseg.min.js +1 -1
- package/tsparticles.plugins.absorbers.js +205 -100
- package/tsparticles.plugins.absorbers.min.js +2 -2
- package/tsparticles.plugins.emitters.js +330 -143
- package/tsparticles.plugins.emitters.min.js +2 -2
- package/tsparticles.plugins.polygonMask.js +205 -100
- package/tsparticles.plugins.polygonMask.min.js +2 -2
- package/tsparticles.shape.circle.min.js +1 -1
- package/tsparticles.shape.image.js +208 -103
- package/tsparticles.shape.image.min.js +2 -2
- 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 +205 -100
- package/tsparticles.shape.text.min.js +2 -2
- package/tsparticles.slim.js +227 -118
- package/tsparticles.slim.min.js +2 -2
- package/tsparticles.updater.angle.js +205 -100
- package/tsparticles.updater.angle.min.js +2 -2
- package/tsparticles.updater.color.js +205 -100
- package/tsparticles.updater.color.min.js +2 -2
- package/tsparticles.updater.life.js +205 -100
- package/tsparticles.updater.life.min.js +2 -2
- package/tsparticles.updater.opacity.js +205 -100
- package/tsparticles.updater.opacity.min.js +2 -2
- package/tsparticles.updater.outModes.js +205 -100
- package/tsparticles.updater.outModes.min.js +2 -2
- package/tsparticles.updater.roll.js +205 -100
- package/tsparticles.updater.roll.min.js +2 -2
- package/tsparticles.updater.size.js +205 -100
- package/tsparticles.updater.size.min.js +2 -2
- package/tsparticles.updater.strokeColor.js +205 -100
- package/tsparticles.updater.strokeColor.min.js +2 -2
- package/tsparticles.updater.tilt.js +205 -100
- package/tsparticles.updater.tilt.min.js +2 -2
- package/tsparticles.updater.wobble.js +205 -100
- package/tsparticles.updater.wobble.min.js +2 -2
|
@@ -1553,15 +1553,32 @@
|
|
|
1553
1553
|
}
|
|
1554
1554
|
}
|
|
1555
1555
|
}
|
|
1556
|
+
var __classPrivateFieldSet = undefined && undefined.__classPrivateFieldSet || function(receiver, state, value, kind, f) {
|
|
1557
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
1558
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
1559
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
1560
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value),
|
|
1561
|
+
value;
|
|
1562
|
+
};
|
|
1563
|
+
var __classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function(receiver, state, kind, f) {
|
|
1564
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
1565
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
1566
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
1567
|
+
};
|
|
1568
|
+
var _InteractionManager_engine;
|
|
1556
1569
|
class InteractionManager_InteractionManager {
|
|
1557
|
-
constructor(container) {
|
|
1570
|
+
constructor(engine, container) {
|
|
1558
1571
|
this.container = container;
|
|
1572
|
+
_InteractionManager_engine.set(this, void 0);
|
|
1573
|
+
__classPrivateFieldSet(this, _InteractionManager_engine, engine, "f");
|
|
1559
1574
|
this.externalInteractors = [];
|
|
1560
1575
|
this.particleInteractors = [];
|
|
1561
1576
|
this.init();
|
|
1562
1577
|
}
|
|
1563
1578
|
init() {
|
|
1564
|
-
const interactors =
|
|
1579
|
+
const interactors = __classPrivateFieldGet(this, _InteractionManager_engine, "f").plugins.getInteractors(this.container, true);
|
|
1580
|
+
this.externalInteractors = [];
|
|
1581
|
+
this.particleInteractors = [];
|
|
1565
1582
|
for (const interactor of interactors) {
|
|
1566
1583
|
switch (interactor.type) {
|
|
1567
1584
|
case 0:
|
|
@@ -1592,6 +1609,7 @@
|
|
|
1592
1609
|
}
|
|
1593
1610
|
}
|
|
1594
1611
|
}
|
|
1612
|
+
_InteractionManager_engine = new WeakMap;
|
|
1595
1613
|
class ParticlesInteractorBase {
|
|
1596
1614
|
constructor(container) {
|
|
1597
1615
|
this.container = container;
|
|
@@ -1771,26 +1789,38 @@
|
|
|
1771
1789
|
return proximityFactor / slowFactor;
|
|
1772
1790
|
}
|
|
1773
1791
|
}
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
class
|
|
1783
|
-
|
|
1784
|
-
|
|
1792
|
+
var Plugins_classPrivateFieldSet = undefined && undefined.__classPrivateFieldSet || function(receiver, state, value, kind, f) {
|
|
1793
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
1794
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
1795
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
1796
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value),
|
|
1797
|
+
value;
|
|
1798
|
+
};
|
|
1799
|
+
var _Plugins_engine;
|
|
1800
|
+
class Plugins {
|
|
1801
|
+
constructor(engine) {
|
|
1802
|
+
_Plugins_engine.set(this, void 0);
|
|
1803
|
+
Plugins_classPrivateFieldSet(this, _Plugins_engine, engine, "f");
|
|
1804
|
+
this.plugins = [];
|
|
1805
|
+
this.interactorsInitializers = new Map;
|
|
1806
|
+
this.updatersInitializers = new Map;
|
|
1807
|
+
this.interactors = new Map;
|
|
1808
|
+
this.updaters = new Map;
|
|
1809
|
+
this.presets = new Map;
|
|
1810
|
+
this.drawers = new Map;
|
|
1811
|
+
this.pathGenerators = new Map;
|
|
1812
|
+
}
|
|
1813
|
+
getPlugin(plugin) {
|
|
1814
|
+
return this.plugins.find((t => t.id === plugin));
|
|
1785
1815
|
}
|
|
1786
|
-
|
|
1787
|
-
if (!
|
|
1788
|
-
plugins.push(plugin);
|
|
1816
|
+
addPlugin(plugin) {
|
|
1817
|
+
if (!this.getPlugin(plugin.id)) {
|
|
1818
|
+
this.plugins.push(plugin);
|
|
1789
1819
|
}
|
|
1790
1820
|
}
|
|
1791
|
-
|
|
1821
|
+
getAvailablePlugins(container) {
|
|
1792
1822
|
const res = new Map;
|
|
1793
|
-
for (const plugin of plugins) {
|
|
1823
|
+
for (const plugin of this.plugins) {
|
|
1794
1824
|
if (!plugin.needsPlugin(container.actualOptions)) {
|
|
1795
1825
|
continue;
|
|
1796
1826
|
}
|
|
@@ -1798,61 +1828,62 @@
|
|
|
1798
1828
|
}
|
|
1799
1829
|
return res;
|
|
1800
1830
|
}
|
|
1801
|
-
|
|
1802
|
-
for (const plugin of plugins) {
|
|
1831
|
+
loadOptions(options, sourceOptions) {
|
|
1832
|
+
for (const plugin of this.plugins) {
|
|
1803
1833
|
plugin.loadOptions(options, sourceOptions);
|
|
1804
1834
|
}
|
|
1805
1835
|
}
|
|
1806
|
-
|
|
1807
|
-
return presets.get(preset);
|
|
1836
|
+
getPreset(preset) {
|
|
1837
|
+
return this.presets.get(preset);
|
|
1808
1838
|
}
|
|
1809
|
-
|
|
1810
|
-
if (override || !
|
|
1811
|
-
presets.set(presetKey, options);
|
|
1839
|
+
addPreset(presetKey, options, override = false) {
|
|
1840
|
+
if (override || !this.getPreset(presetKey)) {
|
|
1841
|
+
this.presets.set(presetKey, options);
|
|
1812
1842
|
}
|
|
1813
1843
|
}
|
|
1814
|
-
|
|
1815
|
-
if (!
|
|
1816
|
-
drawers.set(type, drawer);
|
|
1844
|
+
addShapeDrawer(type, drawer) {
|
|
1845
|
+
if (!this.getShapeDrawer(type)) {
|
|
1846
|
+
this.drawers.set(type, drawer);
|
|
1817
1847
|
}
|
|
1818
1848
|
}
|
|
1819
|
-
|
|
1820
|
-
return drawers.get(type);
|
|
1849
|
+
getShapeDrawer(type) {
|
|
1850
|
+
return this.drawers.get(type);
|
|
1821
1851
|
}
|
|
1822
|
-
|
|
1823
|
-
return drawers.keys();
|
|
1852
|
+
getSupportedShapes() {
|
|
1853
|
+
return this.drawers.keys();
|
|
1824
1854
|
}
|
|
1825
|
-
|
|
1826
|
-
return pathGenerators.get(type);
|
|
1855
|
+
getPathGenerator(type) {
|
|
1856
|
+
return this.pathGenerators.get(type);
|
|
1827
1857
|
}
|
|
1828
|
-
|
|
1829
|
-
if (!
|
|
1830
|
-
pathGenerators.set(type, pathGenerator);
|
|
1858
|
+
addPathGenerator(type, pathGenerator) {
|
|
1859
|
+
if (!this.getPathGenerator(type)) {
|
|
1860
|
+
this.pathGenerators.set(type, pathGenerator);
|
|
1831
1861
|
}
|
|
1832
1862
|
}
|
|
1833
|
-
|
|
1834
|
-
let res = interactors.get(container);
|
|
1863
|
+
getInteractors(container, force = false) {
|
|
1864
|
+
let res = this.interactors.get(container);
|
|
1835
1865
|
if (!res || force) {
|
|
1836
|
-
res = [ ...interactorsInitializers.values() ].map((t => t(container)));
|
|
1837
|
-
interactors.set(container, res);
|
|
1866
|
+
res = [ ...this.interactorsInitializers.values() ].map((t => t(container)));
|
|
1867
|
+
this.interactors.set(container, res);
|
|
1838
1868
|
}
|
|
1839
1869
|
return res;
|
|
1840
1870
|
}
|
|
1841
|
-
|
|
1842
|
-
interactorsInitializers.set(name, initInteractor);
|
|
1871
|
+
addInteractor(name, initInteractor) {
|
|
1872
|
+
this.interactorsInitializers.set(name, initInteractor);
|
|
1843
1873
|
}
|
|
1844
|
-
|
|
1845
|
-
let res = updaters.get(container);
|
|
1874
|
+
getUpdaters(container, force = false) {
|
|
1875
|
+
let res = this.updaters.get(container);
|
|
1846
1876
|
if (!res || force) {
|
|
1847
|
-
res = [ ...updatersInitializers.values() ].map((t => t(container)));
|
|
1848
|
-
updaters.set(container, res);
|
|
1877
|
+
res = [ ...this.updatersInitializers.values() ].map((t => t(container)));
|
|
1878
|
+
this.updaters.set(container, res);
|
|
1849
1879
|
}
|
|
1850
1880
|
return res;
|
|
1851
1881
|
}
|
|
1852
|
-
|
|
1853
|
-
updatersInitializers.set(name, initUpdater);
|
|
1882
|
+
addParticleUpdater(name, initUpdater) {
|
|
1883
|
+
this.updatersInitializers.set(name, initUpdater);
|
|
1854
1884
|
}
|
|
1855
1885
|
}
|
|
1886
|
+
_Plugins_engine = new WeakMap;
|
|
1856
1887
|
class QuadTree_QuadTree {
|
|
1857
1888
|
constructor(rectangle, capacity) {
|
|
1858
1889
|
this.rectangle = rectangle;
|
|
@@ -3379,22 +3410,31 @@
|
|
|
3379
3410
|
}
|
|
3380
3411
|
}
|
|
3381
3412
|
}
|
|
3382
|
-
var
|
|
3413
|
+
var Options_classPrivateFieldSet = undefined && undefined.__classPrivateFieldSet || function(receiver, state, value, kind, f) {
|
|
3414
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3415
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
3416
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
3417
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value),
|
|
3418
|
+
value;
|
|
3419
|
+
};
|
|
3420
|
+
var Options_classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function(receiver, state, kind, f) {
|
|
3383
3421
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3384
3422
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
3385
3423
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
3386
3424
|
};
|
|
3387
|
-
var _Options_instances, _Options_findDefaultTheme;
|
|
3425
|
+
var _Options_instances, _Options_engine, _Options_findDefaultTheme;
|
|
3388
3426
|
class Options_Options {
|
|
3389
|
-
constructor() {
|
|
3427
|
+
constructor(engine) {
|
|
3390
3428
|
_Options_instances.add(this);
|
|
3429
|
+
_Options_engine.set(this, void 0);
|
|
3430
|
+
Options_classPrivateFieldSet(this, _Options_engine, engine, "f");
|
|
3391
3431
|
this.autoPlay = true;
|
|
3392
3432
|
this.background = new Background;
|
|
3393
3433
|
this.backgroundMask = new BackgroundMask;
|
|
3394
3434
|
this.fullScreen = new FullScreen;
|
|
3395
3435
|
this.detectRetina = true;
|
|
3396
3436
|
this.duration = 0;
|
|
3397
|
-
this.fpsLimit =
|
|
3437
|
+
this.fpsLimit = 120;
|
|
3398
3438
|
this.interactivity = new Interactivity;
|
|
3399
3439
|
this.manualParticles = [];
|
|
3400
3440
|
this.motion = new Motion;
|
|
@@ -3480,7 +3520,7 @@
|
|
|
3480
3520
|
this.motion.load(data.motion);
|
|
3481
3521
|
this.particles.load(data.particles);
|
|
3482
3522
|
this.style = deepExtend(this.style, data.style);
|
|
3483
|
-
|
|
3523
|
+
Options_classPrivateFieldGet(this, _Options_engine, "f").plugins.loadOptions(this, data);
|
|
3484
3524
|
if (data.responsive !== undefined) {
|
|
3485
3525
|
for (const responsive of data.responsive) {
|
|
3486
3526
|
const optResponsive = new Responsive;
|
|
@@ -3496,8 +3536,8 @@
|
|
|
3496
3536
|
this.themes.push(optTheme);
|
|
3497
3537
|
}
|
|
3498
3538
|
}
|
|
3499
|
-
this.defaultDarkTheme = (_d =
|
|
3500
|
-
this.defaultLightTheme = (_e =
|
|
3539
|
+
this.defaultDarkTheme = (_d = Options_classPrivateFieldGet(this, _Options_instances, "m", _Options_findDefaultTheme).call(this, "dark")) === null || _d === void 0 ? void 0 : _d.name;
|
|
3540
|
+
this.defaultLightTheme = (_e = Options_classPrivateFieldGet(this, _Options_instances, "m", _Options_findDefaultTheme).call(this, "light")) === null || _e === void 0 ? void 0 : _e.name;
|
|
3501
3541
|
}
|
|
3502
3542
|
setTheme(name) {
|
|
3503
3543
|
if (name) {
|
|
@@ -3506,7 +3546,7 @@
|
|
|
3506
3546
|
this.load(chosenTheme.options);
|
|
3507
3547
|
}
|
|
3508
3548
|
} else {
|
|
3509
|
-
const mediaMatch = typeof matchMedia !== "undefined" && matchMedia("(prefers-color-scheme: dark)"), clientDarkMode = mediaMatch && mediaMatch.matches, defaultTheme =
|
|
3549
|
+
const mediaMatch = typeof matchMedia !== "undefined" && matchMedia("(prefers-color-scheme: dark)"), clientDarkMode = mediaMatch && mediaMatch.matches, defaultTheme = Options_classPrivateFieldGet(this, _Options_instances, "m", _Options_findDefaultTheme).call(this, clientDarkMode ? "dark" : "light");
|
|
3510
3550
|
if (defaultTheme) {
|
|
3511
3551
|
this.load(defaultTheme.options);
|
|
3512
3552
|
}
|
|
@@ -3519,13 +3559,26 @@
|
|
|
3519
3559
|
return responsiveOptions === null || responsiveOptions === void 0 ? void 0 : responsiveOptions.maxWidth;
|
|
3520
3560
|
}
|
|
3521
3561
|
importPreset(preset) {
|
|
3522
|
-
this.load(
|
|
3562
|
+
this.load(Options_classPrivateFieldGet(this, _Options_engine, "f").plugins.getPreset(preset));
|
|
3523
3563
|
}
|
|
3524
3564
|
}
|
|
3525
|
-
_Options_instances = new WeakSet, _Options_findDefaultTheme = function _Options_findDefaultTheme(mode) {
|
|
3565
|
+
_Options_engine = new WeakMap, _Options_instances = new WeakSet, _Options_findDefaultTheme = function _Options_findDefaultTheme(mode) {
|
|
3526
3566
|
var _a;
|
|
3527
3567
|
return (_a = this.themes.find((theme => theme.default.value && theme.default.mode === mode))) !== null && _a !== void 0 ? _a : this.themes.find((theme => theme.default.value && theme.default.mode === "any"));
|
|
3528
3568
|
};
|
|
3569
|
+
var Particle_classPrivateFieldSet = undefined && undefined.__classPrivateFieldSet || function(receiver, state, value, kind, f) {
|
|
3570
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3571
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
3572
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
3573
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value),
|
|
3574
|
+
value;
|
|
3575
|
+
};
|
|
3576
|
+
var Particle_classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function(receiver, state, kind, f) {
|
|
3577
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3578
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
3579
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
3580
|
+
};
|
|
3581
|
+
var _Particle_engine;
|
|
3529
3582
|
const fixOutMode = data => {
|
|
3530
3583
|
if (isInArray(data.outMode, data.checkModes) || isInArray(data.outMode, data.checkModes)) {
|
|
3531
3584
|
if (data.coord > data.maxCoord - data.radius * 2) {
|
|
@@ -3536,11 +3589,13 @@
|
|
|
3536
3589
|
}
|
|
3537
3590
|
};
|
|
3538
3591
|
class Particle_Particle {
|
|
3539
|
-
constructor(id, container, position, overrideOptions, group) {
|
|
3592
|
+
constructor(engine, id, container, position, overrideOptions, group) {
|
|
3540
3593
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
3541
3594
|
this.id = id;
|
|
3542
3595
|
this.container = container;
|
|
3543
3596
|
this.group = group;
|
|
3597
|
+
_Particle_engine.set(this, void 0);
|
|
3598
|
+
Particle_classPrivateFieldSet(this, _Particle_engine, engine, "f");
|
|
3544
3599
|
this.fill = true;
|
|
3545
3600
|
this.close = true;
|
|
3546
3601
|
this.lastPathTime = 0;
|
|
@@ -3634,7 +3689,7 @@
|
|
|
3634
3689
|
this.sides = 24;
|
|
3635
3690
|
let drawer = container.drawers.get(this.shape);
|
|
3636
3691
|
if (!drawer) {
|
|
3637
|
-
drawer =
|
|
3692
|
+
drawer = Particle_classPrivateFieldGet(this, _Particle_engine, "f").plugins.getShapeDrawer(this.shape);
|
|
3638
3693
|
if (drawer) {
|
|
3639
3694
|
container.drawers.set(this.shape, drawer);
|
|
3640
3695
|
}
|
|
@@ -3874,9 +3929,25 @@
|
|
|
3874
3929
|
return life;
|
|
3875
3930
|
}
|
|
3876
3931
|
}
|
|
3932
|
+
_Particle_engine = new WeakMap;
|
|
3933
|
+
var Particles_classPrivateFieldSet = undefined && undefined.__classPrivateFieldSet || function(receiver, state, value, kind, f) {
|
|
3934
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3935
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
3936
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
3937
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value),
|
|
3938
|
+
value;
|
|
3939
|
+
};
|
|
3940
|
+
var Particles_classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function(receiver, state, kind, f) {
|
|
3941
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3942
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
3943
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
3944
|
+
};
|
|
3945
|
+
var _Particles_engine;
|
|
3877
3946
|
class Particles_Particles {
|
|
3878
|
-
constructor(container) {
|
|
3947
|
+
constructor(engine, container) {
|
|
3879
3948
|
this.container = container;
|
|
3949
|
+
_Particles_engine.set(this, void 0);
|
|
3950
|
+
Particles_classPrivateFieldSet(this, _Particles_engine, engine, "f");
|
|
3880
3951
|
this.nextId = 0;
|
|
3881
3952
|
this.array = [];
|
|
3882
3953
|
this.zArray = [];
|
|
@@ -3888,11 +3959,11 @@
|
|
|
3888
3959
|
links: new Map,
|
|
3889
3960
|
triangles: new Map
|
|
3890
3961
|
};
|
|
3891
|
-
this.interactionManager = new InteractionManager(container);
|
|
3962
|
+
this.interactionManager = new InteractionManager(Particles_classPrivateFieldGet(this, _Particles_engine, "f"), container);
|
|
3892
3963
|
const canvasSize = this.container.canvas.size;
|
|
3893
3964
|
this.linksColors = new Map;
|
|
3894
3965
|
this.quadTree = new QuadTree(new Rectangle(-canvasSize.width / 4, -canvasSize.height / 4, canvasSize.width * 3 / 2, canvasSize.height * 3 / 2), 4);
|
|
3895
|
-
this.updaters =
|
|
3966
|
+
this.updaters = Particles_classPrivateFieldGet(this, _Particles_engine, "f").plugins.getUpdaters(container, true);
|
|
3896
3967
|
}
|
|
3897
3968
|
get count() {
|
|
3898
3969
|
return this.array.length;
|
|
@@ -3906,7 +3977,7 @@
|
|
|
3906
3977
|
this.freqs.links = new Map;
|
|
3907
3978
|
this.freqs.triangles = new Map;
|
|
3908
3979
|
let handled = false;
|
|
3909
|
-
this.updaters =
|
|
3980
|
+
this.updaters = Particles_classPrivateFieldGet(this, _Particles_engine, "f").plugins.getUpdaters(container, true);
|
|
3910
3981
|
this.interactionManager.init();
|
|
3911
3982
|
for (const [, plugin] of container.plugins) {
|
|
3912
3983
|
if (plugin.particlesInitialization !== undefined) {
|
|
@@ -4153,7 +4224,7 @@
|
|
|
4153
4224
|
}
|
|
4154
4225
|
pushParticle(position, overrideOptions, group, initializer) {
|
|
4155
4226
|
try {
|
|
4156
|
-
const particle = new Particle(this.nextId, this.container, position, overrideOptions, group);
|
|
4227
|
+
const particle = new Particle(Particles_classPrivateFieldGet(this, _Particles_engine, "f"), this.nextId, this.container, position, overrideOptions, group);
|
|
4157
4228
|
let canAdd = true;
|
|
4158
4229
|
if (initializer) {
|
|
4159
4230
|
canAdd = initializer(particle);
|
|
@@ -4171,6 +4242,7 @@
|
|
|
4171
4242
|
}
|
|
4172
4243
|
}
|
|
4173
4244
|
}
|
|
4245
|
+
_Particles_engine = new WeakMap;
|
|
4174
4246
|
class Retina_Retina {
|
|
4175
4247
|
constructor(container) {
|
|
4176
4248
|
this.container = container;
|
|
@@ -4258,10 +4330,25 @@
|
|
|
4258
4330
|
}
|
|
4259
4331
|
}
|
|
4260
4332
|
}
|
|
4333
|
+
var Container_classPrivateFieldSet = undefined && undefined.__classPrivateFieldSet || function(receiver, state, value, kind, f) {
|
|
4334
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
4335
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4336
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
4337
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value),
|
|
4338
|
+
value;
|
|
4339
|
+
};
|
|
4340
|
+
var Container_classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function(receiver, state, kind, f) {
|
|
4341
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4342
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4343
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
4344
|
+
};
|
|
4345
|
+
var _Container_engine;
|
|
4261
4346
|
class Container_Container {
|
|
4262
|
-
constructor(id, sourceOptions, ...presets) {
|
|
4347
|
+
constructor(engine, id, sourceOptions, ...presets) {
|
|
4263
4348
|
this.id = id;
|
|
4264
|
-
this
|
|
4349
|
+
_Container_engine.set(this, void 0);
|
|
4350
|
+
Container_classPrivateFieldSet(this, _Container_engine, engine, "f");
|
|
4351
|
+
this.fpsLimit = 120;
|
|
4265
4352
|
this.duration = 0;
|
|
4266
4353
|
this.lifeTime = 0;
|
|
4267
4354
|
this.firstStart = true;
|
|
@@ -4275,7 +4362,7 @@
|
|
|
4275
4362
|
this._initialSourceOptions = sourceOptions;
|
|
4276
4363
|
this.retina = new Retina(this);
|
|
4277
4364
|
this.canvas = new Canvas(this);
|
|
4278
|
-
this.particles = new Particles(this);
|
|
4365
|
+
this.particles = new Particles(Container_classPrivateFieldGet(this, _Container_engine, "f"), this);
|
|
4279
4366
|
this.drawer = new FrameManager(this);
|
|
4280
4367
|
this.presets = presets;
|
|
4281
4368
|
this.pathGenerator = {
|
|
@@ -4304,8 +4391,8 @@
|
|
|
4304
4391
|
this.plugins = new Map;
|
|
4305
4392
|
this.drawers = new Map;
|
|
4306
4393
|
this.density = 1;
|
|
4307
|
-
this._options = new Options;
|
|
4308
|
-
this.actualOptions = new Options;
|
|
4394
|
+
this._options = new Options(Container_classPrivateFieldGet(this, _Container_engine, "f"));
|
|
4395
|
+
this.actualOptions = new Options(Container_classPrivateFieldGet(this, _Container_engine, "f"));
|
|
4309
4396
|
this.eventListeners = new EventListeners(this);
|
|
4310
4397
|
if (typeof IntersectionObserver !== "undefined" && IntersectionObserver) {
|
|
4311
4398
|
this.intersectionObserver = new IntersectionObserver((entries => this.intersectionManager(entries)));
|
|
@@ -4420,7 +4507,7 @@
|
|
|
4420
4507
|
return this.start();
|
|
4421
4508
|
}
|
|
4422
4509
|
reset() {
|
|
4423
|
-
this._options = new Options;
|
|
4510
|
+
this._options = new Options(Container_classPrivateFieldGet(this, _Container_engine, "f"));
|
|
4424
4511
|
return this.refresh();
|
|
4425
4512
|
}
|
|
4426
4513
|
stop() {
|
|
@@ -4434,7 +4521,7 @@
|
|
|
4434
4521
|
this.particles.clear();
|
|
4435
4522
|
this.canvas.clear();
|
|
4436
4523
|
if (this.interactivity.element instanceof HTMLElement && this.intersectionObserver) {
|
|
4437
|
-
this.intersectionObserver.
|
|
4524
|
+
this.intersectionObserver.unobserve(this.interactivity.element);
|
|
4438
4525
|
}
|
|
4439
4526
|
for (const [, plugin] of this.plugins) {
|
|
4440
4527
|
if (plugin.stop) {
|
|
@@ -4561,20 +4648,20 @@
|
|
|
4561
4648
|
return false;
|
|
4562
4649
|
}
|
|
4563
4650
|
async init() {
|
|
4564
|
-
this._options = new Options;
|
|
4651
|
+
this._options = new Options(Container_classPrivateFieldGet(this, _Container_engine, "f"));
|
|
4565
4652
|
for (const preset of this.presets) {
|
|
4566
|
-
this._options.load(
|
|
4653
|
+
this._options.load(Container_classPrivateFieldGet(this, _Container_engine, "f").plugins.getPreset(preset));
|
|
4567
4654
|
}
|
|
4568
|
-
const shapes =
|
|
4655
|
+
const shapes = Container_classPrivateFieldGet(this, _Container_engine, "f").plugins.getSupportedShapes();
|
|
4569
4656
|
for (const type of shapes) {
|
|
4570
|
-
const drawer =
|
|
4657
|
+
const drawer = Container_classPrivateFieldGet(this, _Container_engine, "f").plugins.getShapeDrawer(type);
|
|
4571
4658
|
if (drawer) {
|
|
4572
4659
|
this.drawers.set(type, drawer);
|
|
4573
4660
|
}
|
|
4574
4661
|
}
|
|
4575
4662
|
this._options.load(this._initialSourceOptions);
|
|
4576
4663
|
this._options.load(this._sourceOptions);
|
|
4577
|
-
this.actualOptions = new Options;
|
|
4664
|
+
this.actualOptions = new Options(Container_classPrivateFieldGet(this, _Container_engine, "f"));
|
|
4578
4665
|
this.actualOptions.load(this._options);
|
|
4579
4666
|
this.retina.init();
|
|
4580
4667
|
this.canvas.init();
|
|
@@ -4584,8 +4671,8 @@
|
|
|
4584
4671
|
this.zLayers = this.actualOptions.zLayers;
|
|
4585
4672
|
this.duration = getRangeValue(this.actualOptions.duration);
|
|
4586
4673
|
this.lifeTime = 0;
|
|
4587
|
-
this.fpsLimit = this.actualOptions.fpsLimit > 0 ? this.actualOptions.fpsLimit :
|
|
4588
|
-
const availablePlugins =
|
|
4674
|
+
this.fpsLimit = this.actualOptions.fpsLimit > 0 ? this.actualOptions.fpsLimit : 120;
|
|
4675
|
+
const availablePlugins = Container_classPrivateFieldGet(this, _Container_engine, "f").plugins.getAvailablePlugins(this);
|
|
4589
4676
|
for (const [id, plugin] of availablePlugins) {
|
|
4590
4677
|
this.plugins.set(id, plugin);
|
|
4591
4678
|
}
|
|
@@ -4603,7 +4690,7 @@
|
|
|
4603
4690
|
}
|
|
4604
4691
|
const pathOptions = this.actualOptions.particles.move.path;
|
|
4605
4692
|
if (pathOptions.generator) {
|
|
4606
|
-
const customGenerator =
|
|
4693
|
+
const customGenerator = Container_classPrivateFieldGet(this, _Container_engine, "f").plugins.getPathGenerator(pathOptions.generator);
|
|
4607
4694
|
if (customGenerator) {
|
|
4608
4695
|
if (customGenerator.init) {
|
|
4609
4696
|
this.pathGenerator.init = customGenerator.init;
|
|
@@ -4640,24 +4727,41 @@
|
|
|
4640
4727
|
}
|
|
4641
4728
|
}
|
|
4642
4729
|
}
|
|
4643
|
-
|
|
4730
|
+
_Container_engine = new WeakMap;
|
|
4731
|
+
var Loader_classPrivateFieldSet = undefined && undefined.__classPrivateFieldSet || function(receiver, state, value, kind, f) {
|
|
4732
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
4733
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4734
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
4735
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value),
|
|
4736
|
+
value;
|
|
4737
|
+
};
|
|
4738
|
+
var Loader_classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function(receiver, state, kind, f) {
|
|
4739
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4740
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4741
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
4742
|
+
};
|
|
4743
|
+
var _Loader_engine;
|
|
4644
4744
|
function fetchError(statusCode) {
|
|
4645
4745
|
console.error(`Error tsParticles - fetch status: ${statusCode}`);
|
|
4646
4746
|
console.error("Error tsParticles - File config not found");
|
|
4647
4747
|
}
|
|
4648
4748
|
class Loader {
|
|
4649
|
-
|
|
4650
|
-
|
|
4749
|
+
constructor(engine) {
|
|
4750
|
+
_Loader_engine.set(this, void 0);
|
|
4751
|
+
Loader_classPrivateFieldSet(this, _Loader_engine, engine, "f");
|
|
4752
|
+
}
|
|
4753
|
+
dom() {
|
|
4754
|
+
return Loader_classPrivateFieldGet(this, _Loader_engine, "f").domArray;
|
|
4651
4755
|
}
|
|
4652
|
-
|
|
4653
|
-
const dom =
|
|
4756
|
+
domItem(index) {
|
|
4757
|
+
const dom = this.dom();
|
|
4654
4758
|
const item = dom[index];
|
|
4655
4759
|
if (item && !item.destroyed) {
|
|
4656
4760
|
return item;
|
|
4657
4761
|
}
|
|
4658
4762
|
dom.splice(index, 1);
|
|
4659
4763
|
}
|
|
4660
|
-
|
|
4764
|
+
async loadOptions(params) {
|
|
4661
4765
|
var _a, _b, _c;
|
|
4662
4766
|
const tagId = (_a = params.tagId) !== null && _a !== void 0 ? _a : `tsparticles${Math.floor(Math.random() * 1e4)}`;
|
|
4663
4767
|
const {options: options, index: index} = params;
|
|
@@ -4668,10 +4772,10 @@
|
|
|
4668
4772
|
(_c = document.querySelector("body")) === null || _c === void 0 ? void 0 : _c.append(domContainer);
|
|
4669
4773
|
}
|
|
4670
4774
|
const currentOptions = options instanceof Array ? itemFromArray(options, index) : options;
|
|
4671
|
-
const dom =
|
|
4775
|
+
const dom = this.dom();
|
|
4672
4776
|
const oldIndex = dom.findIndex((v => v.id === tagId));
|
|
4673
4777
|
if (oldIndex >= 0) {
|
|
4674
|
-
const old =
|
|
4778
|
+
const old = this.domItem(oldIndex);
|
|
4675
4779
|
if (old && !old.destroyed) {
|
|
4676
4780
|
old.destroy();
|
|
4677
4781
|
dom.splice(oldIndex, 1);
|
|
@@ -4694,7 +4798,7 @@
|
|
|
4694
4798
|
domContainer.appendChild(canvasEl);
|
|
4695
4799
|
}
|
|
4696
4800
|
}
|
|
4697
|
-
const newItem = new Container(tagId, currentOptions);
|
|
4801
|
+
const newItem = new Container(Loader_classPrivateFieldGet(this, _Loader_engine, "f"), tagId, currentOptions);
|
|
4698
4802
|
if (oldIndex >= 0) {
|
|
4699
4803
|
dom.splice(oldIndex, 0, newItem);
|
|
4700
4804
|
} else {
|
|
@@ -4704,7 +4808,7 @@
|
|
|
4704
4808
|
await newItem.start();
|
|
4705
4809
|
return newItem;
|
|
4706
4810
|
}
|
|
4707
|
-
|
|
4811
|
+
async loadRemoteOptions(params) {
|
|
4708
4812
|
const {url: jsonUrl, index: index} = params;
|
|
4709
4813
|
const url = jsonUrl instanceof Array ? itemFromArray(jsonUrl, index) : jsonUrl;
|
|
4710
4814
|
if (!url) {
|
|
@@ -4716,14 +4820,14 @@
|
|
|
4716
4820
|
return;
|
|
4717
4821
|
}
|
|
4718
4822
|
const data = await response.json();
|
|
4719
|
-
return
|
|
4823
|
+
return this.loadOptions({
|
|
4720
4824
|
tagId: params.tagId,
|
|
4721
4825
|
element: params.element,
|
|
4722
4826
|
index: index,
|
|
4723
4827
|
options: data
|
|
4724
4828
|
});
|
|
4725
4829
|
}
|
|
4726
|
-
|
|
4830
|
+
load(tagId, options, index) {
|
|
4727
4831
|
const params = {
|
|
4728
4832
|
index: index
|
|
4729
4833
|
};
|
|
@@ -4739,7 +4843,7 @@
|
|
|
4739
4843
|
}
|
|
4740
4844
|
return this.loadOptions(params);
|
|
4741
4845
|
}
|
|
4742
|
-
|
|
4846
|
+
async set(id, domContainer, options, index) {
|
|
4743
4847
|
const params = {
|
|
4744
4848
|
index: index
|
|
4745
4849
|
};
|
|
@@ -4760,7 +4864,7 @@
|
|
|
4760
4864
|
}
|
|
4761
4865
|
return this.loadOptions(params);
|
|
4762
4866
|
}
|
|
4763
|
-
|
|
4867
|
+
async loadJSON(tagId, jsonUrl, index) {
|
|
4764
4868
|
let url, id;
|
|
4765
4869
|
if (typeof jsonUrl === "number" || jsonUrl === undefined) {
|
|
4766
4870
|
url = tagId;
|
|
@@ -4768,13 +4872,13 @@
|
|
|
4768
4872
|
id = tagId;
|
|
4769
4873
|
url = jsonUrl;
|
|
4770
4874
|
}
|
|
4771
|
-
return
|
|
4875
|
+
return this.loadRemoteOptions({
|
|
4772
4876
|
tagId: id,
|
|
4773
4877
|
url: url,
|
|
4774
4878
|
index: index
|
|
4775
4879
|
});
|
|
4776
4880
|
}
|
|
4777
|
-
|
|
4881
|
+
async setJSON(id, domContainer, jsonUrl, index) {
|
|
4778
4882
|
let url, newId, newIndex, element;
|
|
4779
4883
|
if (id instanceof HTMLElement) {
|
|
4780
4884
|
element = id;
|
|
@@ -4786,15 +4890,15 @@
|
|
|
4786
4890
|
url = jsonUrl;
|
|
4787
4891
|
newIndex = index;
|
|
4788
4892
|
}
|
|
4789
|
-
return
|
|
4893
|
+
return this.loadRemoteOptions({
|
|
4790
4894
|
tagId: newId,
|
|
4791
4895
|
url: url,
|
|
4792
4896
|
index: newIndex,
|
|
4793
4897
|
element: element
|
|
4794
4898
|
});
|
|
4795
4899
|
}
|
|
4796
|
-
|
|
4797
|
-
const dom =
|
|
4900
|
+
setOnClickHandler(callback) {
|
|
4901
|
+
const dom = this.dom();
|
|
4798
4902
|
if (dom.length === 0) {
|
|
4799
4903
|
throw new Error("Can only set click handlers after calling tsParticles.load() or tsParticles.loadJSON()");
|
|
4800
4904
|
}
|
|
@@ -4803,6 +4907,7 @@
|
|
|
4803
4907
|
}
|
|
4804
4908
|
}
|
|
4805
4909
|
}
|
|
4910
|
+
_Loader_engine = new WeakMap;
|
|
4806
4911
|
class Attractor extends ParticlesInteractorBase {
|
|
4807
4912
|
constructor(container) {
|
|
4808
4913
|
super(container);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! tsParticles v1.
|
|
2
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var o=t();for(var n in o)("object"==typeof exports?exports:e)[n]=o[n]}}(window,(function(){return function(){"use strict";var e={d:function(t,o){for(var n in o)e.o(o,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:o[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function o(e,t){const o=e.x-t.x,n=e.y-t.y;return{dx:o,dy:n,distance:Math.sqrt(o*o+n*n)}}e.r(t),e.d(t,{loadParticlesAttractInteraction:function(){return r}});class n{}n.generatedAttribute="generated",n.randomColorValue="random",n.midColorValue="mid",n.touchEndEvent="touchend",n.mouseDownEvent="mousedown",n.mouseUpEvent="mouseup",n.mouseMoveEvent="mousemove",n.touchStartEvent="touchstart",n.touchMoveEvent="touchmove",n.mouseLeaveEvent="mouseleave",n.mouseOutEvent="mouseout",n.touchCancelEvent="touchcancel",n.resizeEvent="resize",n.visibilityChangeEvent="visibilitychange",n.noPolygonDataLoaded="No polygon data loaded.",n.noPolygonFound="No polygon found, you need to specify SVG url in config.";new
|
|
1
|
+
/*! tsParticles v1.40.1 by Matteo Bruni */
|
|
2
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var o=t();for(var n in o)("object"==typeof exports?exports:e)[n]=o[n]}}(window,(function(){return function(){"use strict";var e={d:function(t,o){for(var n in o)e.o(o,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:o[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function o(e,t){const o=e.x-t.x,n=e.y-t.y;return{dx:o,dy:n,distance:Math.sqrt(o*o+n*n)}}e.r(t),e.d(t,{loadParticlesAttractInteraction:function(){return r}});class n{}n.generatedAttribute="generated",n.randomColorValue="random",n.midColorValue="mid",n.touchEndEvent="touchend",n.mouseDownEvent="mousedown",n.mouseUpEvent="mouseup",n.mouseMoveEvent="mousemove",n.touchStartEvent="touchstart",n.touchMoveEvent="touchmove",n.mouseLeaveEvent="mouseleave",n.mouseOutEvent="mouseout",n.touchCancelEvent="touchcancel",n.resizeEvent="resize",n.visibilityChangeEvent="visibilitychange",n.noPolygonDataLoaded="No polygon data loaded.",n.noPolygonFound="No polygon found, you need to specify SVG url in config.";new WeakMap;new WeakMap;new WeakMap,new WeakSet;new WeakMap;new WeakMap;new WeakMap;new WeakMap;class a extends class{constructor(e){this.container=e,this.type=1}}{constructor(e){super(e)}interact(e){var t;const n=this.container,a=null!==(t=e.retina.attractDistance)&&void 0!==t?t:n.retina.attractDistance,r=e.getPosition(),i=n.particles.quadTree.queryCircle(r,a);for(const t of i){if(e===t||!t.options.move.attract.enable||t.destroyed||t.spawning)continue;const n=t.getPosition(),{dx:a,dy:i}=o(r,n),c=e.options.move.attract.rotate,s=a/(1e3*c.x),u=i/(1e3*c.y),l=t.size.value/e.size.value,d=1/l;e.velocity.x-=s*l,e.velocity.y-=u*l,t.velocity.x+=s*d,t.velocity.y+=u*d}}isEnabled(e){return e.options.move.attract.enable}reset(){}}async function r(e){await e.addInteractor("particlesAttract",(e=>new a(e)))}return t}()}));
|