tsparticles 1.39.2 → 1.40.2
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 +1 -1
- 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 -6
- 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
|
@@ -1567,15 +1567,32 @@
|
|
|
1567
1567
|
this.type = 0;
|
|
1568
1568
|
}
|
|
1569
1569
|
}
|
|
1570
|
+
var __classPrivateFieldSet = undefined && undefined.__classPrivateFieldSet || function(receiver, state, value, kind, f) {
|
|
1571
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
1572
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
1573
|
+
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");
|
|
1574
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value),
|
|
1575
|
+
value;
|
|
1576
|
+
};
|
|
1577
|
+
var __classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function(receiver, state, kind, f) {
|
|
1578
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
1579
|
+
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");
|
|
1580
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
1581
|
+
};
|
|
1582
|
+
var _InteractionManager_engine;
|
|
1570
1583
|
class InteractionManager_InteractionManager {
|
|
1571
|
-
constructor(container) {
|
|
1584
|
+
constructor(engine, container) {
|
|
1572
1585
|
this.container = container;
|
|
1586
|
+
_InteractionManager_engine.set(this, void 0);
|
|
1587
|
+
__classPrivateFieldSet(this, _InteractionManager_engine, engine, "f");
|
|
1573
1588
|
this.externalInteractors = [];
|
|
1574
1589
|
this.particleInteractors = [];
|
|
1575
1590
|
this.init();
|
|
1576
1591
|
}
|
|
1577
1592
|
init() {
|
|
1578
|
-
const interactors =
|
|
1593
|
+
const interactors = __classPrivateFieldGet(this, _InteractionManager_engine, "f").plugins.getInteractors(this.container, true);
|
|
1594
|
+
this.externalInteractors = [];
|
|
1595
|
+
this.particleInteractors = [];
|
|
1579
1596
|
for (const interactor of interactors) {
|
|
1580
1597
|
switch (interactor.type) {
|
|
1581
1598
|
case 0:
|
|
@@ -1606,6 +1623,7 @@
|
|
|
1606
1623
|
}
|
|
1607
1624
|
}
|
|
1608
1625
|
}
|
|
1626
|
+
_InteractionManager_engine = new WeakMap;
|
|
1609
1627
|
function applyDistance(particle) {
|
|
1610
1628
|
const initialPosition = particle.initialPosition;
|
|
1611
1629
|
const {dx: dx, dy: dy} = getDistances(initialPosition, particle.position);
|
|
@@ -1779,26 +1797,38 @@
|
|
|
1779
1797
|
return proximityFactor / slowFactor;
|
|
1780
1798
|
}
|
|
1781
1799
|
}
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
class
|
|
1791
|
-
|
|
1792
|
-
|
|
1800
|
+
var Plugins_classPrivateFieldSet = undefined && undefined.__classPrivateFieldSet || function(receiver, state, value, kind, f) {
|
|
1801
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
1802
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
1803
|
+
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");
|
|
1804
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value),
|
|
1805
|
+
value;
|
|
1806
|
+
};
|
|
1807
|
+
var _Plugins_engine;
|
|
1808
|
+
class Plugins {
|
|
1809
|
+
constructor(engine) {
|
|
1810
|
+
_Plugins_engine.set(this, void 0);
|
|
1811
|
+
Plugins_classPrivateFieldSet(this, _Plugins_engine, engine, "f");
|
|
1812
|
+
this.plugins = [];
|
|
1813
|
+
this.interactorsInitializers = new Map;
|
|
1814
|
+
this.updatersInitializers = new Map;
|
|
1815
|
+
this.interactors = new Map;
|
|
1816
|
+
this.updaters = new Map;
|
|
1817
|
+
this.presets = new Map;
|
|
1818
|
+
this.drawers = new Map;
|
|
1819
|
+
this.pathGenerators = new Map;
|
|
1820
|
+
}
|
|
1821
|
+
getPlugin(plugin) {
|
|
1822
|
+
return this.plugins.find((t => t.id === plugin));
|
|
1793
1823
|
}
|
|
1794
|
-
|
|
1795
|
-
if (!
|
|
1796
|
-
plugins.push(plugin);
|
|
1824
|
+
addPlugin(plugin) {
|
|
1825
|
+
if (!this.getPlugin(plugin.id)) {
|
|
1826
|
+
this.plugins.push(plugin);
|
|
1797
1827
|
}
|
|
1798
1828
|
}
|
|
1799
|
-
|
|
1829
|
+
getAvailablePlugins(container) {
|
|
1800
1830
|
const res = new Map;
|
|
1801
|
-
for (const plugin of plugins) {
|
|
1831
|
+
for (const plugin of this.plugins) {
|
|
1802
1832
|
if (!plugin.needsPlugin(container.actualOptions)) {
|
|
1803
1833
|
continue;
|
|
1804
1834
|
}
|
|
@@ -1806,61 +1836,62 @@
|
|
|
1806
1836
|
}
|
|
1807
1837
|
return res;
|
|
1808
1838
|
}
|
|
1809
|
-
|
|
1810
|
-
for (const plugin of plugins) {
|
|
1839
|
+
loadOptions(options, sourceOptions) {
|
|
1840
|
+
for (const plugin of this.plugins) {
|
|
1811
1841
|
plugin.loadOptions(options, sourceOptions);
|
|
1812
1842
|
}
|
|
1813
1843
|
}
|
|
1814
|
-
|
|
1815
|
-
return presets.get(preset);
|
|
1844
|
+
getPreset(preset) {
|
|
1845
|
+
return this.presets.get(preset);
|
|
1816
1846
|
}
|
|
1817
|
-
|
|
1818
|
-
if (override || !
|
|
1819
|
-
presets.set(presetKey, options);
|
|
1847
|
+
addPreset(presetKey, options, override = false) {
|
|
1848
|
+
if (override || !this.getPreset(presetKey)) {
|
|
1849
|
+
this.presets.set(presetKey, options);
|
|
1820
1850
|
}
|
|
1821
1851
|
}
|
|
1822
|
-
|
|
1823
|
-
if (!
|
|
1824
|
-
drawers.set(type, drawer);
|
|
1852
|
+
addShapeDrawer(type, drawer) {
|
|
1853
|
+
if (!this.getShapeDrawer(type)) {
|
|
1854
|
+
this.drawers.set(type, drawer);
|
|
1825
1855
|
}
|
|
1826
1856
|
}
|
|
1827
|
-
|
|
1828
|
-
return drawers.get(type);
|
|
1857
|
+
getShapeDrawer(type) {
|
|
1858
|
+
return this.drawers.get(type);
|
|
1829
1859
|
}
|
|
1830
|
-
|
|
1831
|
-
return drawers.keys();
|
|
1860
|
+
getSupportedShapes() {
|
|
1861
|
+
return this.drawers.keys();
|
|
1832
1862
|
}
|
|
1833
|
-
|
|
1834
|
-
return pathGenerators.get(type);
|
|
1863
|
+
getPathGenerator(type) {
|
|
1864
|
+
return this.pathGenerators.get(type);
|
|
1835
1865
|
}
|
|
1836
|
-
|
|
1837
|
-
if (!
|
|
1838
|
-
pathGenerators.set(type, pathGenerator);
|
|
1866
|
+
addPathGenerator(type, pathGenerator) {
|
|
1867
|
+
if (!this.getPathGenerator(type)) {
|
|
1868
|
+
this.pathGenerators.set(type, pathGenerator);
|
|
1839
1869
|
}
|
|
1840
1870
|
}
|
|
1841
|
-
|
|
1842
|
-
let res = interactors.get(container);
|
|
1871
|
+
getInteractors(container, force = false) {
|
|
1872
|
+
let res = this.interactors.get(container);
|
|
1843
1873
|
if (!res || force) {
|
|
1844
|
-
res = [ ...interactorsInitializers.values() ].map((t => t(container)));
|
|
1845
|
-
interactors.set(container, res);
|
|
1874
|
+
res = [ ...this.interactorsInitializers.values() ].map((t => t(container)));
|
|
1875
|
+
this.interactors.set(container, res);
|
|
1846
1876
|
}
|
|
1847
1877
|
return res;
|
|
1848
1878
|
}
|
|
1849
|
-
|
|
1850
|
-
interactorsInitializers.set(name, initInteractor);
|
|
1879
|
+
addInteractor(name, initInteractor) {
|
|
1880
|
+
this.interactorsInitializers.set(name, initInteractor);
|
|
1851
1881
|
}
|
|
1852
|
-
|
|
1853
|
-
let res = updaters.get(container);
|
|
1882
|
+
getUpdaters(container, force = false) {
|
|
1883
|
+
let res = this.updaters.get(container);
|
|
1854
1884
|
if (!res || force) {
|
|
1855
|
-
res = [ ...updatersInitializers.values() ].map((t => t(container)));
|
|
1856
|
-
updaters.set(container, res);
|
|
1885
|
+
res = [ ...this.updatersInitializers.values() ].map((t => t(container)));
|
|
1886
|
+
this.updaters.set(container, res);
|
|
1857
1887
|
}
|
|
1858
1888
|
return res;
|
|
1859
1889
|
}
|
|
1860
|
-
|
|
1861
|
-
updatersInitializers.set(name, initUpdater);
|
|
1890
|
+
addParticleUpdater(name, initUpdater) {
|
|
1891
|
+
this.updatersInitializers.set(name, initUpdater);
|
|
1862
1892
|
}
|
|
1863
1893
|
}
|
|
1894
|
+
_Plugins_engine = new WeakMap;
|
|
1864
1895
|
class QuadTree_QuadTree {
|
|
1865
1896
|
constructor(rectangle, capacity) {
|
|
1866
1897
|
this.rectangle = rectangle;
|
|
@@ -3478,22 +3509,31 @@
|
|
|
3478
3509
|
}
|
|
3479
3510
|
}
|
|
3480
3511
|
}
|
|
3481
|
-
var
|
|
3512
|
+
var Options_classPrivateFieldSet = undefined && undefined.__classPrivateFieldSet || function(receiver, state, value, kind, f) {
|
|
3513
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3514
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
3515
|
+
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");
|
|
3516
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value),
|
|
3517
|
+
value;
|
|
3518
|
+
};
|
|
3519
|
+
var Options_classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function(receiver, state, kind, f) {
|
|
3482
3520
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3483
3521
|
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");
|
|
3484
3522
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
3485
3523
|
};
|
|
3486
|
-
var _Options_instances, _Options_findDefaultTheme;
|
|
3524
|
+
var _Options_instances, _Options_engine, _Options_findDefaultTheme;
|
|
3487
3525
|
class Options_Options {
|
|
3488
|
-
constructor() {
|
|
3526
|
+
constructor(engine) {
|
|
3489
3527
|
_Options_instances.add(this);
|
|
3528
|
+
_Options_engine.set(this, void 0);
|
|
3529
|
+
Options_classPrivateFieldSet(this, _Options_engine, engine, "f");
|
|
3490
3530
|
this.autoPlay = true;
|
|
3491
3531
|
this.background = new Background;
|
|
3492
3532
|
this.backgroundMask = new BackgroundMask;
|
|
3493
3533
|
this.fullScreen = new FullScreen;
|
|
3494
3534
|
this.detectRetina = true;
|
|
3495
3535
|
this.duration = 0;
|
|
3496
|
-
this.fpsLimit =
|
|
3536
|
+
this.fpsLimit = 120;
|
|
3497
3537
|
this.interactivity = new Interactivity;
|
|
3498
3538
|
this.manualParticles = [];
|
|
3499
3539
|
this.motion = new Motion;
|
|
@@ -3579,7 +3619,7 @@
|
|
|
3579
3619
|
this.motion.load(data.motion);
|
|
3580
3620
|
this.particles.load(data.particles);
|
|
3581
3621
|
this.style = deepExtend(this.style, data.style);
|
|
3582
|
-
|
|
3622
|
+
Options_classPrivateFieldGet(this, _Options_engine, "f").plugins.loadOptions(this, data);
|
|
3583
3623
|
if (data.responsive !== undefined) {
|
|
3584
3624
|
for (const responsive of data.responsive) {
|
|
3585
3625
|
const optResponsive = new Responsive;
|
|
@@ -3595,8 +3635,8 @@
|
|
|
3595
3635
|
this.themes.push(optTheme);
|
|
3596
3636
|
}
|
|
3597
3637
|
}
|
|
3598
|
-
this.defaultDarkTheme = (_d =
|
|
3599
|
-
this.defaultLightTheme = (_e =
|
|
3638
|
+
this.defaultDarkTheme = (_d = Options_classPrivateFieldGet(this, _Options_instances, "m", _Options_findDefaultTheme).call(this, "dark")) === null || _d === void 0 ? void 0 : _d.name;
|
|
3639
|
+
this.defaultLightTheme = (_e = Options_classPrivateFieldGet(this, _Options_instances, "m", _Options_findDefaultTheme).call(this, "light")) === null || _e === void 0 ? void 0 : _e.name;
|
|
3600
3640
|
}
|
|
3601
3641
|
setTheme(name) {
|
|
3602
3642
|
if (name) {
|
|
@@ -3605,7 +3645,7 @@
|
|
|
3605
3645
|
this.load(chosenTheme.options);
|
|
3606
3646
|
}
|
|
3607
3647
|
} else {
|
|
3608
|
-
const mediaMatch = typeof matchMedia !== "undefined" && matchMedia("(prefers-color-scheme: dark)"), clientDarkMode = mediaMatch && mediaMatch.matches, defaultTheme =
|
|
3648
|
+
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");
|
|
3609
3649
|
if (defaultTheme) {
|
|
3610
3650
|
this.load(defaultTheme.options);
|
|
3611
3651
|
}
|
|
@@ -3618,13 +3658,26 @@
|
|
|
3618
3658
|
return responsiveOptions === null || responsiveOptions === void 0 ? void 0 : responsiveOptions.maxWidth;
|
|
3619
3659
|
}
|
|
3620
3660
|
importPreset(preset) {
|
|
3621
|
-
this.load(
|
|
3661
|
+
this.load(Options_classPrivateFieldGet(this, _Options_engine, "f").plugins.getPreset(preset));
|
|
3622
3662
|
}
|
|
3623
3663
|
}
|
|
3624
|
-
_Options_instances = new WeakSet, _Options_findDefaultTheme = function _Options_findDefaultTheme(mode) {
|
|
3664
|
+
_Options_engine = new WeakMap, _Options_instances = new WeakSet, _Options_findDefaultTheme = function _Options_findDefaultTheme(mode) {
|
|
3625
3665
|
var _a;
|
|
3626
3666
|
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"));
|
|
3627
3667
|
};
|
|
3668
|
+
var Particle_classPrivateFieldSet = undefined && undefined.__classPrivateFieldSet || function(receiver, state, value, kind, f) {
|
|
3669
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3670
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
3671
|
+
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");
|
|
3672
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value),
|
|
3673
|
+
value;
|
|
3674
|
+
};
|
|
3675
|
+
var Particle_classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function(receiver, state, kind, f) {
|
|
3676
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3677
|
+
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");
|
|
3678
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
3679
|
+
};
|
|
3680
|
+
var _Particle_engine;
|
|
3628
3681
|
const fixOutMode = data => {
|
|
3629
3682
|
if (isInArray(data.outMode, data.checkModes) || isInArray(data.outMode, data.checkModes)) {
|
|
3630
3683
|
if (data.coord > data.maxCoord - data.radius * 2) {
|
|
@@ -3635,11 +3688,13 @@
|
|
|
3635
3688
|
}
|
|
3636
3689
|
};
|
|
3637
3690
|
class Particle_Particle {
|
|
3638
|
-
constructor(id, container, position, overrideOptions, group) {
|
|
3691
|
+
constructor(engine, id, container, position, overrideOptions, group) {
|
|
3639
3692
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
3640
3693
|
this.id = id;
|
|
3641
3694
|
this.container = container;
|
|
3642
3695
|
this.group = group;
|
|
3696
|
+
_Particle_engine.set(this, void 0);
|
|
3697
|
+
Particle_classPrivateFieldSet(this, _Particle_engine, engine, "f");
|
|
3643
3698
|
this.fill = true;
|
|
3644
3699
|
this.close = true;
|
|
3645
3700
|
this.lastPathTime = 0;
|
|
@@ -3733,7 +3788,7 @@
|
|
|
3733
3788
|
this.sides = 24;
|
|
3734
3789
|
let drawer = container.drawers.get(this.shape);
|
|
3735
3790
|
if (!drawer) {
|
|
3736
|
-
drawer =
|
|
3791
|
+
drawer = Particle_classPrivateFieldGet(this, _Particle_engine, "f").plugins.getShapeDrawer(this.shape);
|
|
3737
3792
|
if (drawer) {
|
|
3738
3793
|
container.drawers.set(this.shape, drawer);
|
|
3739
3794
|
}
|
|
@@ -3973,9 +4028,25 @@
|
|
|
3973
4028
|
return life;
|
|
3974
4029
|
}
|
|
3975
4030
|
}
|
|
4031
|
+
_Particle_engine = new WeakMap;
|
|
4032
|
+
var Particles_classPrivateFieldSet = undefined && undefined.__classPrivateFieldSet || function(receiver, state, value, kind, f) {
|
|
4033
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
4034
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4035
|
+
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");
|
|
4036
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value),
|
|
4037
|
+
value;
|
|
4038
|
+
};
|
|
4039
|
+
var Particles_classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function(receiver, state, kind, f) {
|
|
4040
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4041
|
+
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");
|
|
4042
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
4043
|
+
};
|
|
4044
|
+
var _Particles_engine;
|
|
3976
4045
|
class Particles_Particles {
|
|
3977
|
-
constructor(container) {
|
|
4046
|
+
constructor(engine, container) {
|
|
3978
4047
|
this.container = container;
|
|
4048
|
+
_Particles_engine.set(this, void 0);
|
|
4049
|
+
Particles_classPrivateFieldSet(this, _Particles_engine, engine, "f");
|
|
3979
4050
|
this.nextId = 0;
|
|
3980
4051
|
this.array = [];
|
|
3981
4052
|
this.zArray = [];
|
|
@@ -3987,11 +4058,11 @@
|
|
|
3987
4058
|
links: new Map,
|
|
3988
4059
|
triangles: new Map
|
|
3989
4060
|
};
|
|
3990
|
-
this.interactionManager = new InteractionManager(container);
|
|
4061
|
+
this.interactionManager = new InteractionManager(Particles_classPrivateFieldGet(this, _Particles_engine, "f"), container);
|
|
3991
4062
|
const canvasSize = this.container.canvas.size;
|
|
3992
4063
|
this.linksColors = new Map;
|
|
3993
4064
|
this.quadTree = new QuadTree(new Rectangle(-canvasSize.width / 4, -canvasSize.height / 4, canvasSize.width * 3 / 2, canvasSize.height * 3 / 2), 4);
|
|
3994
|
-
this.updaters =
|
|
4065
|
+
this.updaters = Particles_classPrivateFieldGet(this, _Particles_engine, "f").plugins.getUpdaters(container, true);
|
|
3995
4066
|
}
|
|
3996
4067
|
get count() {
|
|
3997
4068
|
return this.array.length;
|
|
@@ -4005,7 +4076,7 @@
|
|
|
4005
4076
|
this.freqs.links = new Map;
|
|
4006
4077
|
this.freqs.triangles = new Map;
|
|
4007
4078
|
let handled = false;
|
|
4008
|
-
this.updaters =
|
|
4079
|
+
this.updaters = Particles_classPrivateFieldGet(this, _Particles_engine, "f").plugins.getUpdaters(container, true);
|
|
4009
4080
|
this.interactionManager.init();
|
|
4010
4081
|
for (const [, plugin] of container.plugins) {
|
|
4011
4082
|
if (plugin.particlesInitialization !== undefined) {
|
|
@@ -4252,7 +4323,7 @@
|
|
|
4252
4323
|
}
|
|
4253
4324
|
pushParticle(position, overrideOptions, group, initializer) {
|
|
4254
4325
|
try {
|
|
4255
|
-
const particle = new Particle(this.nextId, this.container, position, overrideOptions, group);
|
|
4326
|
+
const particle = new Particle(Particles_classPrivateFieldGet(this, _Particles_engine, "f"), this.nextId, this.container, position, overrideOptions, group);
|
|
4256
4327
|
let canAdd = true;
|
|
4257
4328
|
if (initializer) {
|
|
4258
4329
|
canAdd = initializer(particle);
|
|
@@ -4270,6 +4341,7 @@
|
|
|
4270
4341
|
}
|
|
4271
4342
|
}
|
|
4272
4343
|
}
|
|
4344
|
+
_Particles_engine = new WeakMap;
|
|
4273
4345
|
class Retina_Retina {
|
|
4274
4346
|
constructor(container) {
|
|
4275
4347
|
this.container = container;
|
|
@@ -4357,10 +4429,25 @@
|
|
|
4357
4429
|
}
|
|
4358
4430
|
}
|
|
4359
4431
|
}
|
|
4432
|
+
var Container_classPrivateFieldSet = undefined && undefined.__classPrivateFieldSet || function(receiver, state, value, kind, f) {
|
|
4433
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
4434
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4435
|
+
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");
|
|
4436
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value),
|
|
4437
|
+
value;
|
|
4438
|
+
};
|
|
4439
|
+
var Container_classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function(receiver, state, kind, f) {
|
|
4440
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4441
|
+
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");
|
|
4442
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
4443
|
+
};
|
|
4444
|
+
var _Container_engine;
|
|
4360
4445
|
class Container_Container {
|
|
4361
|
-
constructor(id, sourceOptions, ...presets) {
|
|
4446
|
+
constructor(engine, id, sourceOptions, ...presets) {
|
|
4362
4447
|
this.id = id;
|
|
4363
|
-
this
|
|
4448
|
+
_Container_engine.set(this, void 0);
|
|
4449
|
+
Container_classPrivateFieldSet(this, _Container_engine, engine, "f");
|
|
4450
|
+
this.fpsLimit = 120;
|
|
4364
4451
|
this.duration = 0;
|
|
4365
4452
|
this.lifeTime = 0;
|
|
4366
4453
|
this.firstStart = true;
|
|
@@ -4374,7 +4461,7 @@
|
|
|
4374
4461
|
this._initialSourceOptions = sourceOptions;
|
|
4375
4462
|
this.retina = new Retina(this);
|
|
4376
4463
|
this.canvas = new Canvas(this);
|
|
4377
|
-
this.particles = new Particles(this);
|
|
4464
|
+
this.particles = new Particles(Container_classPrivateFieldGet(this, _Container_engine, "f"), this);
|
|
4378
4465
|
this.drawer = new FrameManager(this);
|
|
4379
4466
|
this.presets = presets;
|
|
4380
4467
|
this.pathGenerator = {
|
|
@@ -4403,8 +4490,8 @@
|
|
|
4403
4490
|
this.plugins = new Map;
|
|
4404
4491
|
this.drawers = new Map;
|
|
4405
4492
|
this.density = 1;
|
|
4406
|
-
this._options = new Options;
|
|
4407
|
-
this.actualOptions = new Options;
|
|
4493
|
+
this._options = new Options(Container_classPrivateFieldGet(this, _Container_engine, "f"));
|
|
4494
|
+
this.actualOptions = new Options(Container_classPrivateFieldGet(this, _Container_engine, "f"));
|
|
4408
4495
|
this.eventListeners = new EventListeners(this);
|
|
4409
4496
|
if (typeof IntersectionObserver !== "undefined" && IntersectionObserver) {
|
|
4410
4497
|
this.intersectionObserver = new IntersectionObserver((entries => this.intersectionManager(entries)));
|
|
@@ -4519,7 +4606,7 @@
|
|
|
4519
4606
|
return this.start();
|
|
4520
4607
|
}
|
|
4521
4608
|
reset() {
|
|
4522
|
-
this._options = new Options;
|
|
4609
|
+
this._options = new Options(Container_classPrivateFieldGet(this, _Container_engine, "f"));
|
|
4523
4610
|
return this.refresh();
|
|
4524
4611
|
}
|
|
4525
4612
|
stop() {
|
|
@@ -4533,7 +4620,7 @@
|
|
|
4533
4620
|
this.particles.clear();
|
|
4534
4621
|
this.canvas.clear();
|
|
4535
4622
|
if (this.interactivity.element instanceof HTMLElement && this.intersectionObserver) {
|
|
4536
|
-
this.intersectionObserver.
|
|
4623
|
+
this.intersectionObserver.unobserve(this.interactivity.element);
|
|
4537
4624
|
}
|
|
4538
4625
|
for (const [, plugin] of this.plugins) {
|
|
4539
4626
|
if (plugin.stop) {
|
|
@@ -4660,20 +4747,20 @@
|
|
|
4660
4747
|
return false;
|
|
4661
4748
|
}
|
|
4662
4749
|
async init() {
|
|
4663
|
-
this._options = new Options;
|
|
4750
|
+
this._options = new Options(Container_classPrivateFieldGet(this, _Container_engine, "f"));
|
|
4664
4751
|
for (const preset of this.presets) {
|
|
4665
|
-
this._options.load(
|
|
4752
|
+
this._options.load(Container_classPrivateFieldGet(this, _Container_engine, "f").plugins.getPreset(preset));
|
|
4666
4753
|
}
|
|
4667
|
-
const shapes =
|
|
4754
|
+
const shapes = Container_classPrivateFieldGet(this, _Container_engine, "f").plugins.getSupportedShapes();
|
|
4668
4755
|
for (const type of shapes) {
|
|
4669
|
-
const drawer =
|
|
4756
|
+
const drawer = Container_classPrivateFieldGet(this, _Container_engine, "f").plugins.getShapeDrawer(type);
|
|
4670
4757
|
if (drawer) {
|
|
4671
4758
|
this.drawers.set(type, drawer);
|
|
4672
4759
|
}
|
|
4673
4760
|
}
|
|
4674
4761
|
this._options.load(this._initialSourceOptions);
|
|
4675
4762
|
this._options.load(this._sourceOptions);
|
|
4676
|
-
this.actualOptions = new Options;
|
|
4763
|
+
this.actualOptions = new Options(Container_classPrivateFieldGet(this, _Container_engine, "f"));
|
|
4677
4764
|
this.actualOptions.load(this._options);
|
|
4678
4765
|
this.retina.init();
|
|
4679
4766
|
this.canvas.init();
|
|
@@ -4683,8 +4770,8 @@
|
|
|
4683
4770
|
this.zLayers = this.actualOptions.zLayers;
|
|
4684
4771
|
this.duration = getRangeValue(this.actualOptions.duration);
|
|
4685
4772
|
this.lifeTime = 0;
|
|
4686
|
-
this.fpsLimit = this.actualOptions.fpsLimit > 0 ? this.actualOptions.fpsLimit :
|
|
4687
|
-
const availablePlugins =
|
|
4773
|
+
this.fpsLimit = this.actualOptions.fpsLimit > 0 ? this.actualOptions.fpsLimit : 120;
|
|
4774
|
+
const availablePlugins = Container_classPrivateFieldGet(this, _Container_engine, "f").plugins.getAvailablePlugins(this);
|
|
4688
4775
|
for (const [id, plugin] of availablePlugins) {
|
|
4689
4776
|
this.plugins.set(id, plugin);
|
|
4690
4777
|
}
|
|
@@ -4702,7 +4789,7 @@
|
|
|
4702
4789
|
}
|
|
4703
4790
|
const pathOptions = this.actualOptions.particles.move.path;
|
|
4704
4791
|
if (pathOptions.generator) {
|
|
4705
|
-
const customGenerator =
|
|
4792
|
+
const customGenerator = Container_classPrivateFieldGet(this, _Container_engine, "f").plugins.getPathGenerator(pathOptions.generator);
|
|
4706
4793
|
if (customGenerator) {
|
|
4707
4794
|
if (customGenerator.init) {
|
|
4708
4795
|
this.pathGenerator.init = customGenerator.init;
|
|
@@ -4739,24 +4826,41 @@
|
|
|
4739
4826
|
}
|
|
4740
4827
|
}
|
|
4741
4828
|
}
|
|
4742
|
-
|
|
4829
|
+
_Container_engine = new WeakMap;
|
|
4830
|
+
var Loader_classPrivateFieldSet = undefined && undefined.__classPrivateFieldSet || function(receiver, state, value, kind, f) {
|
|
4831
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
4832
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4833
|
+
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");
|
|
4834
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value),
|
|
4835
|
+
value;
|
|
4836
|
+
};
|
|
4837
|
+
var Loader_classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function(receiver, state, kind, f) {
|
|
4838
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4839
|
+
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");
|
|
4840
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
4841
|
+
};
|
|
4842
|
+
var _Loader_engine;
|
|
4743
4843
|
function fetchError(statusCode) {
|
|
4744
4844
|
console.error(`Error tsParticles - fetch status: ${statusCode}`);
|
|
4745
4845
|
console.error("Error tsParticles - File config not found");
|
|
4746
4846
|
}
|
|
4747
4847
|
class Loader {
|
|
4748
|
-
|
|
4749
|
-
|
|
4848
|
+
constructor(engine) {
|
|
4849
|
+
_Loader_engine.set(this, void 0);
|
|
4850
|
+
Loader_classPrivateFieldSet(this, _Loader_engine, engine, "f");
|
|
4851
|
+
}
|
|
4852
|
+
dom() {
|
|
4853
|
+
return Loader_classPrivateFieldGet(this, _Loader_engine, "f").domArray;
|
|
4750
4854
|
}
|
|
4751
|
-
|
|
4752
|
-
const dom =
|
|
4855
|
+
domItem(index) {
|
|
4856
|
+
const dom = this.dom();
|
|
4753
4857
|
const item = dom[index];
|
|
4754
4858
|
if (item && !item.destroyed) {
|
|
4755
4859
|
return item;
|
|
4756
4860
|
}
|
|
4757
4861
|
dom.splice(index, 1);
|
|
4758
4862
|
}
|
|
4759
|
-
|
|
4863
|
+
async loadOptions(params) {
|
|
4760
4864
|
var _a, _b, _c;
|
|
4761
4865
|
const tagId = (_a = params.tagId) !== null && _a !== void 0 ? _a : `tsparticles${Math.floor(Math.random() * 1e4)}`;
|
|
4762
4866
|
const {options: options, index: index} = params;
|
|
@@ -4767,10 +4871,10 @@
|
|
|
4767
4871
|
(_c = document.querySelector("body")) === null || _c === void 0 ? void 0 : _c.append(domContainer);
|
|
4768
4872
|
}
|
|
4769
4873
|
const currentOptions = options instanceof Array ? itemFromArray(options, index) : options;
|
|
4770
|
-
const dom =
|
|
4874
|
+
const dom = this.dom();
|
|
4771
4875
|
const oldIndex = dom.findIndex((v => v.id === tagId));
|
|
4772
4876
|
if (oldIndex >= 0) {
|
|
4773
|
-
const old =
|
|
4877
|
+
const old = this.domItem(oldIndex);
|
|
4774
4878
|
if (old && !old.destroyed) {
|
|
4775
4879
|
old.destroy();
|
|
4776
4880
|
dom.splice(oldIndex, 1);
|
|
@@ -4793,7 +4897,7 @@
|
|
|
4793
4897
|
domContainer.appendChild(canvasEl);
|
|
4794
4898
|
}
|
|
4795
4899
|
}
|
|
4796
|
-
const newItem = new Container(tagId, currentOptions);
|
|
4900
|
+
const newItem = new Container(Loader_classPrivateFieldGet(this, _Loader_engine, "f"), tagId, currentOptions);
|
|
4797
4901
|
if (oldIndex >= 0) {
|
|
4798
4902
|
dom.splice(oldIndex, 0, newItem);
|
|
4799
4903
|
} else {
|
|
@@ -4803,7 +4907,7 @@
|
|
|
4803
4907
|
await newItem.start();
|
|
4804
4908
|
return newItem;
|
|
4805
4909
|
}
|
|
4806
|
-
|
|
4910
|
+
async loadRemoteOptions(params) {
|
|
4807
4911
|
const {url: jsonUrl, index: index} = params;
|
|
4808
4912
|
const url = jsonUrl instanceof Array ? itemFromArray(jsonUrl, index) : jsonUrl;
|
|
4809
4913
|
if (!url) {
|
|
@@ -4815,14 +4919,14 @@
|
|
|
4815
4919
|
return;
|
|
4816
4920
|
}
|
|
4817
4921
|
const data = await response.json();
|
|
4818
|
-
return
|
|
4922
|
+
return this.loadOptions({
|
|
4819
4923
|
tagId: params.tagId,
|
|
4820
4924
|
element: params.element,
|
|
4821
4925
|
index: index,
|
|
4822
4926
|
options: data
|
|
4823
4927
|
});
|
|
4824
4928
|
}
|
|
4825
|
-
|
|
4929
|
+
load(tagId, options, index) {
|
|
4826
4930
|
const params = {
|
|
4827
4931
|
index: index
|
|
4828
4932
|
};
|
|
@@ -4838,7 +4942,7 @@
|
|
|
4838
4942
|
}
|
|
4839
4943
|
return this.loadOptions(params);
|
|
4840
4944
|
}
|
|
4841
|
-
|
|
4945
|
+
async set(id, domContainer, options, index) {
|
|
4842
4946
|
const params = {
|
|
4843
4947
|
index: index
|
|
4844
4948
|
};
|
|
@@ -4859,7 +4963,7 @@
|
|
|
4859
4963
|
}
|
|
4860
4964
|
return this.loadOptions(params);
|
|
4861
4965
|
}
|
|
4862
|
-
|
|
4966
|
+
async loadJSON(tagId, jsonUrl, index) {
|
|
4863
4967
|
let url, id;
|
|
4864
4968
|
if (typeof jsonUrl === "number" || jsonUrl === undefined) {
|
|
4865
4969
|
url = tagId;
|
|
@@ -4867,13 +4971,13 @@
|
|
|
4867
4971
|
id = tagId;
|
|
4868
4972
|
url = jsonUrl;
|
|
4869
4973
|
}
|
|
4870
|
-
return
|
|
4974
|
+
return this.loadRemoteOptions({
|
|
4871
4975
|
tagId: id,
|
|
4872
4976
|
url: url,
|
|
4873
4977
|
index: index
|
|
4874
4978
|
});
|
|
4875
4979
|
}
|
|
4876
|
-
|
|
4980
|
+
async setJSON(id, domContainer, jsonUrl, index) {
|
|
4877
4981
|
let url, newId, newIndex, element;
|
|
4878
4982
|
if (id instanceof HTMLElement) {
|
|
4879
4983
|
element = id;
|
|
@@ -4885,15 +4989,15 @@
|
|
|
4885
4989
|
url = jsonUrl;
|
|
4886
4990
|
newIndex = index;
|
|
4887
4991
|
}
|
|
4888
|
-
return
|
|
4992
|
+
return this.loadRemoteOptions({
|
|
4889
4993
|
tagId: newId,
|
|
4890
4994
|
url: url,
|
|
4891
4995
|
index: newIndex,
|
|
4892
4996
|
element: element
|
|
4893
4997
|
});
|
|
4894
4998
|
}
|
|
4895
|
-
|
|
4896
|
-
const dom =
|
|
4999
|
+
setOnClickHandler(callback) {
|
|
5000
|
+
const dom = this.dom();
|
|
4897
5001
|
if (dom.length === 0) {
|
|
4898
5002
|
throw new Error("Can only set click handlers after calling tsParticles.load() or tsParticles.loadJSON()");
|
|
4899
5003
|
}
|
|
@@ -4902,6 +5006,7 @@
|
|
|
4902
5006
|
}
|
|
4903
5007
|
}
|
|
4904
5008
|
}
|
|
5009
|
+
_Loader_engine = new WeakMap;
|
|
4905
5010
|
class Attractor extends ExternalInteractorBase {
|
|
4906
5011
|
constructor(container) {
|
|
4907
5012
|
super(container);
|