tsparticles 1.39.3 → 1.40.0
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 +27 -12
- 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 +3 -1
- package/Core/Utils/InteractionManager.js +17 -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 +13 -6
- 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 +29 -13
- 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 +3 -1
- package/browser/Core/Utils/InteractionManager.js +17 -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 +13 -6
- 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 +28 -13
- 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 +3 -1
- package/esm/Core/Utils/InteractionManager.js +17 -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 +13 -6
- 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 +1 -1
- package/report.html +2 -2
- package/report.slim.html +2 -2
- package/tsparticles.engine.js +221 -114
- package/tsparticles.engine.min.js +2 -2
- package/tsparticles.interaction.external.attract.js +199 -96
- package/tsparticles.interaction.external.attract.min.js +2 -2
- package/tsparticles.interaction.external.bounce.js +199 -96
- package/tsparticles.interaction.external.bounce.min.js +2 -2
- package/tsparticles.interaction.external.bubble.js +199 -96
- package/tsparticles.interaction.external.bubble.min.js +2 -2
- package/tsparticles.interaction.external.connect.js +199 -96
- package/tsparticles.interaction.external.connect.min.js +2 -2
- package/tsparticles.interaction.external.grab.js +199 -96
- package/tsparticles.interaction.external.grab.min.js +2 -2
- package/tsparticles.interaction.external.repulse.js +199 -96
- package/tsparticles.interaction.external.repulse.min.js +2 -2
- package/tsparticles.interaction.external.trail.js +199 -96
- package/tsparticles.interaction.external.trail.min.js +2 -2
- package/tsparticles.interaction.particles.attract.js +199 -96
- package/tsparticles.interaction.particles.attract.min.js +2 -2
- package/tsparticles.interaction.particles.collisions.js +199 -96
- package/tsparticles.interaction.particles.collisions.min.js +2 -2
- package/tsparticles.interaction.particles.links.js +199 -96
- package/tsparticles.interaction.particles.links.min.js +2 -2
- package/tsparticles.js +341 -152
- package/tsparticles.min.js +2 -2
- package/tsparticles.pathseg.min.js +1 -1
- package/tsparticles.plugins.absorbers.js +199 -96
- package/tsparticles.plugins.absorbers.min.js +2 -2
- package/tsparticles.plugins.emitters.js +324 -139
- package/tsparticles.plugins.emitters.min.js +2 -2
- package/tsparticles.plugins.polygonMask.js +199 -96
- package/tsparticles.plugins.polygonMask.min.js +2 -2
- package/tsparticles.shape.circle.min.js +1 -1
- package/tsparticles.shape.image.js +202 -99
- 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 +199 -96
- package/tsparticles.shape.text.min.js +2 -2
- package/tsparticles.slim.js +221 -114
- package/tsparticles.slim.min.js +2 -2
- package/tsparticles.updater.angle.js +199 -96
- package/tsparticles.updater.angle.min.js +2 -2
- package/tsparticles.updater.color.js +199 -96
- package/tsparticles.updater.color.min.js +2 -2
- package/tsparticles.updater.life.js +199 -96
- package/tsparticles.updater.life.min.js +2 -2
- package/tsparticles.updater.opacity.js +199 -96
- package/tsparticles.updater.opacity.min.js +2 -2
- package/tsparticles.updater.outModes.js +199 -96
- package/tsparticles.updater.outModes.min.js +2 -2
- package/tsparticles.updater.roll.js +199 -96
- package/tsparticles.updater.roll.min.js +2 -2
- package/tsparticles.updater.size.js +199 -96
- package/tsparticles.updater.size.min.js +2 -2
- package/tsparticles.updater.strokeColor.js +199 -96
- package/tsparticles.updater.strokeColor.min.js +2 -2
- package/tsparticles.updater.tilt.js +199 -96
- package/tsparticles.updater.tilt.min.js +2 -2
- package/tsparticles.updater.wobble.js +199 -96
- package/tsparticles.updater.wobble.min.js +2 -2
|
@@ -1567,15 +1567,30 @@
|
|
|
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);
|
|
1579
1594
|
this.externalInteractors = [];
|
|
1580
1595
|
this.particleInteractors = [];
|
|
1581
1596
|
for (const interactor of interactors) {
|
|
@@ -1608,6 +1623,7 @@
|
|
|
1608
1623
|
}
|
|
1609
1624
|
}
|
|
1610
1625
|
}
|
|
1626
|
+
_InteractionManager_engine = new WeakMap;
|
|
1611
1627
|
function applyDistance(particle) {
|
|
1612
1628
|
const initialPosition = particle.initialPosition;
|
|
1613
1629
|
const {dx: dx, dy: dy} = getDistances(initialPosition, particle.position);
|
|
@@ -1781,26 +1797,38 @@
|
|
|
1781
1797
|
return proximityFactor / slowFactor;
|
|
1782
1798
|
}
|
|
1783
1799
|
}
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
class
|
|
1793
|
-
|
|
1794
|
-
|
|
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;
|
|
1795
1820
|
}
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1821
|
+
getPlugin(plugin) {
|
|
1822
|
+
return this.plugins.find((t => t.id === plugin));
|
|
1823
|
+
}
|
|
1824
|
+
addPlugin(plugin) {
|
|
1825
|
+
if (!this.getPlugin(plugin.id)) {
|
|
1826
|
+
this.plugins.push(plugin);
|
|
1799
1827
|
}
|
|
1800
1828
|
}
|
|
1801
|
-
|
|
1829
|
+
getAvailablePlugins(container) {
|
|
1802
1830
|
const res = new Map;
|
|
1803
|
-
for (const plugin of plugins) {
|
|
1831
|
+
for (const plugin of this.plugins) {
|
|
1804
1832
|
if (!plugin.needsPlugin(container.actualOptions)) {
|
|
1805
1833
|
continue;
|
|
1806
1834
|
}
|
|
@@ -1808,61 +1836,62 @@
|
|
|
1808
1836
|
}
|
|
1809
1837
|
return res;
|
|
1810
1838
|
}
|
|
1811
|
-
|
|
1812
|
-
for (const plugin of plugins) {
|
|
1839
|
+
loadOptions(options, sourceOptions) {
|
|
1840
|
+
for (const plugin of this.plugins) {
|
|
1813
1841
|
plugin.loadOptions(options, sourceOptions);
|
|
1814
1842
|
}
|
|
1815
1843
|
}
|
|
1816
|
-
|
|
1817
|
-
return presets.get(preset);
|
|
1844
|
+
getPreset(preset) {
|
|
1845
|
+
return this.presets.get(preset);
|
|
1818
1846
|
}
|
|
1819
|
-
|
|
1820
|
-
if (override || !
|
|
1821
|
-
presets.set(presetKey, options);
|
|
1847
|
+
addPreset(presetKey, options, override = false) {
|
|
1848
|
+
if (override || !this.getPreset(presetKey)) {
|
|
1849
|
+
this.presets.set(presetKey, options);
|
|
1822
1850
|
}
|
|
1823
1851
|
}
|
|
1824
|
-
|
|
1825
|
-
if (!
|
|
1826
|
-
drawers.set(type, drawer);
|
|
1852
|
+
addShapeDrawer(type, drawer) {
|
|
1853
|
+
if (!this.getShapeDrawer(type)) {
|
|
1854
|
+
this.drawers.set(type, drawer);
|
|
1827
1855
|
}
|
|
1828
1856
|
}
|
|
1829
|
-
|
|
1830
|
-
return drawers.get(type);
|
|
1857
|
+
getShapeDrawer(type) {
|
|
1858
|
+
return this.drawers.get(type);
|
|
1831
1859
|
}
|
|
1832
|
-
|
|
1833
|
-
return drawers.keys();
|
|
1860
|
+
getSupportedShapes() {
|
|
1861
|
+
return this.drawers.keys();
|
|
1834
1862
|
}
|
|
1835
|
-
|
|
1836
|
-
return pathGenerators.get(type);
|
|
1863
|
+
getPathGenerator(type) {
|
|
1864
|
+
return this.pathGenerators.get(type);
|
|
1837
1865
|
}
|
|
1838
|
-
|
|
1839
|
-
if (!
|
|
1840
|
-
pathGenerators.set(type, pathGenerator);
|
|
1866
|
+
addPathGenerator(type, pathGenerator) {
|
|
1867
|
+
if (!this.getPathGenerator(type)) {
|
|
1868
|
+
this.pathGenerators.set(type, pathGenerator);
|
|
1841
1869
|
}
|
|
1842
1870
|
}
|
|
1843
|
-
|
|
1844
|
-
let res = interactors.get(container);
|
|
1871
|
+
getInteractors(container, force = false) {
|
|
1872
|
+
let res = this.interactors.get(container);
|
|
1845
1873
|
if (!res || force) {
|
|
1846
|
-
res = [ ...interactorsInitializers.values() ].map((t => t(container)));
|
|
1847
|
-
interactors.set(container, res);
|
|
1874
|
+
res = [ ...this.interactorsInitializers.values() ].map((t => t(container)));
|
|
1875
|
+
this.interactors.set(container, res);
|
|
1848
1876
|
}
|
|
1849
1877
|
return res;
|
|
1850
1878
|
}
|
|
1851
|
-
|
|
1852
|
-
interactorsInitializers.set(name, initInteractor);
|
|
1879
|
+
addInteractor(name, initInteractor) {
|
|
1880
|
+
this.interactorsInitializers.set(name, initInteractor);
|
|
1853
1881
|
}
|
|
1854
|
-
|
|
1855
|
-
let res = updaters.get(container);
|
|
1882
|
+
getUpdaters(container, force = false) {
|
|
1883
|
+
let res = this.updaters.get(container);
|
|
1856
1884
|
if (!res || force) {
|
|
1857
|
-
res = [ ...updatersInitializers.values() ].map((t => t(container)));
|
|
1858
|
-
updaters.set(container, res);
|
|
1885
|
+
res = [ ...this.updatersInitializers.values() ].map((t => t(container)));
|
|
1886
|
+
this.updaters.set(container, res);
|
|
1859
1887
|
}
|
|
1860
1888
|
return res;
|
|
1861
1889
|
}
|
|
1862
|
-
|
|
1863
|
-
updatersInitializers.set(name, initUpdater);
|
|
1890
|
+
addParticleUpdater(name, initUpdater) {
|
|
1891
|
+
this.updatersInitializers.set(name, initUpdater);
|
|
1864
1892
|
}
|
|
1865
1893
|
}
|
|
1894
|
+
_Plugins_engine = new WeakMap;
|
|
1866
1895
|
class QuadTree_QuadTree {
|
|
1867
1896
|
constructor(rectangle, capacity) {
|
|
1868
1897
|
this.rectangle = rectangle;
|
|
@@ -3480,15 +3509,24 @@
|
|
|
3480
3509
|
}
|
|
3481
3510
|
}
|
|
3482
3511
|
}
|
|
3483
|
-
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) {
|
|
3484
3520
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3485
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");
|
|
3486
3522
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
3487
3523
|
};
|
|
3488
|
-
var _Options_instances, _Options_findDefaultTheme;
|
|
3524
|
+
var _Options_instances, _Options_engine, _Options_findDefaultTheme;
|
|
3489
3525
|
class Options_Options {
|
|
3490
|
-
constructor() {
|
|
3526
|
+
constructor(engine) {
|
|
3491
3527
|
_Options_instances.add(this);
|
|
3528
|
+
_Options_engine.set(this, void 0);
|
|
3529
|
+
Options_classPrivateFieldSet(this, _Options_engine, engine, "f");
|
|
3492
3530
|
this.autoPlay = true;
|
|
3493
3531
|
this.background = new Background;
|
|
3494
3532
|
this.backgroundMask = new BackgroundMask;
|
|
@@ -3581,7 +3619,7 @@
|
|
|
3581
3619
|
this.motion.load(data.motion);
|
|
3582
3620
|
this.particles.load(data.particles);
|
|
3583
3621
|
this.style = deepExtend(this.style, data.style);
|
|
3584
|
-
|
|
3622
|
+
Options_classPrivateFieldGet(this, _Options_engine, "f").plugins.loadOptions(this, data);
|
|
3585
3623
|
if (data.responsive !== undefined) {
|
|
3586
3624
|
for (const responsive of data.responsive) {
|
|
3587
3625
|
const optResponsive = new Responsive;
|
|
@@ -3597,8 +3635,8 @@
|
|
|
3597
3635
|
this.themes.push(optTheme);
|
|
3598
3636
|
}
|
|
3599
3637
|
}
|
|
3600
|
-
this.defaultDarkTheme = (_d =
|
|
3601
|
-
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;
|
|
3602
3640
|
}
|
|
3603
3641
|
setTheme(name) {
|
|
3604
3642
|
if (name) {
|
|
@@ -3607,7 +3645,7 @@
|
|
|
3607
3645
|
this.load(chosenTheme.options);
|
|
3608
3646
|
}
|
|
3609
3647
|
} else {
|
|
3610
|
-
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");
|
|
3611
3649
|
if (defaultTheme) {
|
|
3612
3650
|
this.load(defaultTheme.options);
|
|
3613
3651
|
}
|
|
@@ -3620,13 +3658,26 @@
|
|
|
3620
3658
|
return responsiveOptions === null || responsiveOptions === void 0 ? void 0 : responsiveOptions.maxWidth;
|
|
3621
3659
|
}
|
|
3622
3660
|
importPreset(preset) {
|
|
3623
|
-
this.load(
|
|
3661
|
+
this.load(Options_classPrivateFieldGet(this, _Options_engine, "f").plugins.getPreset(preset));
|
|
3624
3662
|
}
|
|
3625
3663
|
}
|
|
3626
|
-
_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) {
|
|
3627
3665
|
var _a;
|
|
3628
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"));
|
|
3629
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;
|
|
3630
3681
|
const fixOutMode = data => {
|
|
3631
3682
|
if (isInArray(data.outMode, data.checkModes) || isInArray(data.outMode, data.checkModes)) {
|
|
3632
3683
|
if (data.coord > data.maxCoord - data.radius * 2) {
|
|
@@ -3637,11 +3688,13 @@
|
|
|
3637
3688
|
}
|
|
3638
3689
|
};
|
|
3639
3690
|
class Particle_Particle {
|
|
3640
|
-
constructor(id, container, position, overrideOptions, group) {
|
|
3691
|
+
constructor(engine, id, container, position, overrideOptions, group) {
|
|
3641
3692
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
3642
3693
|
this.id = id;
|
|
3643
3694
|
this.container = container;
|
|
3644
3695
|
this.group = group;
|
|
3696
|
+
_Particle_engine.set(this, void 0);
|
|
3697
|
+
Particle_classPrivateFieldSet(this, _Particle_engine, engine, "f");
|
|
3645
3698
|
this.fill = true;
|
|
3646
3699
|
this.close = true;
|
|
3647
3700
|
this.lastPathTime = 0;
|
|
@@ -3735,7 +3788,7 @@
|
|
|
3735
3788
|
this.sides = 24;
|
|
3736
3789
|
let drawer = container.drawers.get(this.shape);
|
|
3737
3790
|
if (!drawer) {
|
|
3738
|
-
drawer =
|
|
3791
|
+
drawer = Particle_classPrivateFieldGet(this, _Particle_engine, "f").plugins.getShapeDrawer(this.shape);
|
|
3739
3792
|
if (drawer) {
|
|
3740
3793
|
container.drawers.set(this.shape, drawer);
|
|
3741
3794
|
}
|
|
@@ -3975,9 +4028,25 @@
|
|
|
3975
4028
|
return life;
|
|
3976
4029
|
}
|
|
3977
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;
|
|
3978
4045
|
class Particles_Particles {
|
|
3979
|
-
constructor(container) {
|
|
4046
|
+
constructor(engine, container) {
|
|
3980
4047
|
this.container = container;
|
|
4048
|
+
_Particles_engine.set(this, void 0);
|
|
4049
|
+
Particles_classPrivateFieldSet(this, _Particles_engine, engine, "f");
|
|
3981
4050
|
this.nextId = 0;
|
|
3982
4051
|
this.array = [];
|
|
3983
4052
|
this.zArray = [];
|
|
@@ -3989,11 +4058,11 @@
|
|
|
3989
4058
|
links: new Map,
|
|
3990
4059
|
triangles: new Map
|
|
3991
4060
|
};
|
|
3992
|
-
this.interactionManager = new InteractionManager(container);
|
|
4061
|
+
this.interactionManager = new InteractionManager(Particles_classPrivateFieldGet(this, _Particles_engine, "f"), container);
|
|
3993
4062
|
const canvasSize = this.container.canvas.size;
|
|
3994
4063
|
this.linksColors = new Map;
|
|
3995
4064
|
this.quadTree = new QuadTree(new Rectangle(-canvasSize.width / 4, -canvasSize.height / 4, canvasSize.width * 3 / 2, canvasSize.height * 3 / 2), 4);
|
|
3996
|
-
this.updaters =
|
|
4065
|
+
this.updaters = Particles_classPrivateFieldGet(this, _Particles_engine, "f").plugins.getUpdaters(container, true);
|
|
3997
4066
|
}
|
|
3998
4067
|
get count() {
|
|
3999
4068
|
return this.array.length;
|
|
@@ -4007,7 +4076,7 @@
|
|
|
4007
4076
|
this.freqs.links = new Map;
|
|
4008
4077
|
this.freqs.triangles = new Map;
|
|
4009
4078
|
let handled = false;
|
|
4010
|
-
this.updaters =
|
|
4079
|
+
this.updaters = Particles_classPrivateFieldGet(this, _Particles_engine, "f").plugins.getUpdaters(container, true);
|
|
4011
4080
|
this.interactionManager.init();
|
|
4012
4081
|
for (const [, plugin] of container.plugins) {
|
|
4013
4082
|
if (plugin.particlesInitialization !== undefined) {
|
|
@@ -4254,7 +4323,7 @@
|
|
|
4254
4323
|
}
|
|
4255
4324
|
pushParticle(position, overrideOptions, group, initializer) {
|
|
4256
4325
|
try {
|
|
4257
|
-
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);
|
|
4258
4327
|
let canAdd = true;
|
|
4259
4328
|
if (initializer) {
|
|
4260
4329
|
canAdd = initializer(particle);
|
|
@@ -4272,6 +4341,7 @@
|
|
|
4272
4341
|
}
|
|
4273
4342
|
}
|
|
4274
4343
|
}
|
|
4344
|
+
_Particles_engine = new WeakMap;
|
|
4275
4345
|
class Retina_Retina {
|
|
4276
4346
|
constructor(container) {
|
|
4277
4347
|
this.container = container;
|
|
@@ -4359,9 +4429,24 @@
|
|
|
4359
4429
|
}
|
|
4360
4430
|
}
|
|
4361
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;
|
|
4362
4445
|
class Container_Container {
|
|
4363
|
-
constructor(id, sourceOptions, ...presets) {
|
|
4446
|
+
constructor(engine, id, sourceOptions, ...presets) {
|
|
4364
4447
|
this.id = id;
|
|
4448
|
+
_Container_engine.set(this, void 0);
|
|
4449
|
+
Container_classPrivateFieldSet(this, _Container_engine, engine, "f");
|
|
4365
4450
|
this.fpsLimit = 120;
|
|
4366
4451
|
this.duration = 0;
|
|
4367
4452
|
this.lifeTime = 0;
|
|
@@ -4376,7 +4461,7 @@
|
|
|
4376
4461
|
this._initialSourceOptions = sourceOptions;
|
|
4377
4462
|
this.retina = new Retina(this);
|
|
4378
4463
|
this.canvas = new Canvas(this);
|
|
4379
|
-
this.particles = new Particles(this);
|
|
4464
|
+
this.particles = new Particles(Container_classPrivateFieldGet(this, _Container_engine, "f"), this);
|
|
4380
4465
|
this.drawer = new FrameManager(this);
|
|
4381
4466
|
this.presets = presets;
|
|
4382
4467
|
this.pathGenerator = {
|
|
@@ -4405,8 +4490,8 @@
|
|
|
4405
4490
|
this.plugins = new Map;
|
|
4406
4491
|
this.drawers = new Map;
|
|
4407
4492
|
this.density = 1;
|
|
4408
|
-
this._options = new Options;
|
|
4409
|
-
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"));
|
|
4410
4495
|
this.eventListeners = new EventListeners(this);
|
|
4411
4496
|
if (typeof IntersectionObserver !== "undefined" && IntersectionObserver) {
|
|
4412
4497
|
this.intersectionObserver = new IntersectionObserver((entries => this.intersectionManager(entries)));
|
|
@@ -4521,7 +4606,7 @@
|
|
|
4521
4606
|
return this.start();
|
|
4522
4607
|
}
|
|
4523
4608
|
reset() {
|
|
4524
|
-
this._options = new Options;
|
|
4609
|
+
this._options = new Options(Container_classPrivateFieldGet(this, _Container_engine, "f"));
|
|
4525
4610
|
return this.refresh();
|
|
4526
4611
|
}
|
|
4527
4612
|
stop() {
|
|
@@ -4662,20 +4747,20 @@
|
|
|
4662
4747
|
return false;
|
|
4663
4748
|
}
|
|
4664
4749
|
async init() {
|
|
4665
|
-
this._options = new Options;
|
|
4750
|
+
this._options = new Options(Container_classPrivateFieldGet(this, _Container_engine, "f"));
|
|
4666
4751
|
for (const preset of this.presets) {
|
|
4667
|
-
this._options.load(
|
|
4752
|
+
this._options.load(Container_classPrivateFieldGet(this, _Container_engine, "f").plugins.getPreset(preset));
|
|
4668
4753
|
}
|
|
4669
|
-
const shapes =
|
|
4754
|
+
const shapes = Container_classPrivateFieldGet(this, _Container_engine, "f").plugins.getSupportedShapes();
|
|
4670
4755
|
for (const type of shapes) {
|
|
4671
|
-
const drawer =
|
|
4756
|
+
const drawer = Container_classPrivateFieldGet(this, _Container_engine, "f").plugins.getShapeDrawer(type);
|
|
4672
4757
|
if (drawer) {
|
|
4673
4758
|
this.drawers.set(type, drawer);
|
|
4674
4759
|
}
|
|
4675
4760
|
}
|
|
4676
4761
|
this._options.load(this._initialSourceOptions);
|
|
4677
4762
|
this._options.load(this._sourceOptions);
|
|
4678
|
-
this.actualOptions = new Options;
|
|
4763
|
+
this.actualOptions = new Options(Container_classPrivateFieldGet(this, _Container_engine, "f"));
|
|
4679
4764
|
this.actualOptions.load(this._options);
|
|
4680
4765
|
this.retina.init();
|
|
4681
4766
|
this.canvas.init();
|
|
@@ -4686,7 +4771,7 @@
|
|
|
4686
4771
|
this.duration = getRangeValue(this.actualOptions.duration);
|
|
4687
4772
|
this.lifeTime = 0;
|
|
4688
4773
|
this.fpsLimit = this.actualOptions.fpsLimit > 0 ? this.actualOptions.fpsLimit : 120;
|
|
4689
|
-
const availablePlugins =
|
|
4774
|
+
const availablePlugins = Container_classPrivateFieldGet(this, _Container_engine, "f").plugins.getAvailablePlugins(this);
|
|
4690
4775
|
for (const [id, plugin] of availablePlugins) {
|
|
4691
4776
|
this.plugins.set(id, plugin);
|
|
4692
4777
|
}
|
|
@@ -4704,7 +4789,7 @@
|
|
|
4704
4789
|
}
|
|
4705
4790
|
const pathOptions = this.actualOptions.particles.move.path;
|
|
4706
4791
|
if (pathOptions.generator) {
|
|
4707
|
-
const customGenerator =
|
|
4792
|
+
const customGenerator = Container_classPrivateFieldGet(this, _Container_engine, "f").plugins.getPathGenerator(pathOptions.generator);
|
|
4708
4793
|
if (customGenerator) {
|
|
4709
4794
|
if (customGenerator.init) {
|
|
4710
4795
|
this.pathGenerator.init = customGenerator.init;
|
|
@@ -4741,24 +4826,41 @@
|
|
|
4741
4826
|
}
|
|
4742
4827
|
}
|
|
4743
4828
|
}
|
|
4744
|
-
|
|
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;
|
|
4745
4843
|
function fetchError(statusCode) {
|
|
4746
4844
|
console.error(`Error tsParticles - fetch status: ${statusCode}`);
|
|
4747
4845
|
console.error("Error tsParticles - File config not found");
|
|
4748
4846
|
}
|
|
4749
4847
|
class Loader {
|
|
4750
|
-
|
|
4751
|
-
|
|
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;
|
|
4752
4854
|
}
|
|
4753
|
-
|
|
4754
|
-
const dom =
|
|
4855
|
+
domItem(index) {
|
|
4856
|
+
const dom = this.dom();
|
|
4755
4857
|
const item = dom[index];
|
|
4756
4858
|
if (item && !item.destroyed) {
|
|
4757
4859
|
return item;
|
|
4758
4860
|
}
|
|
4759
4861
|
dom.splice(index, 1);
|
|
4760
4862
|
}
|
|
4761
|
-
|
|
4863
|
+
async loadOptions(params) {
|
|
4762
4864
|
var _a, _b, _c;
|
|
4763
4865
|
const tagId = (_a = params.tagId) !== null && _a !== void 0 ? _a : `tsparticles${Math.floor(Math.random() * 1e4)}`;
|
|
4764
4866
|
const {options: options, index: index} = params;
|
|
@@ -4769,10 +4871,10 @@
|
|
|
4769
4871
|
(_c = document.querySelector("body")) === null || _c === void 0 ? void 0 : _c.append(domContainer);
|
|
4770
4872
|
}
|
|
4771
4873
|
const currentOptions = options instanceof Array ? itemFromArray(options, index) : options;
|
|
4772
|
-
const dom =
|
|
4874
|
+
const dom = this.dom();
|
|
4773
4875
|
const oldIndex = dom.findIndex((v => v.id === tagId));
|
|
4774
4876
|
if (oldIndex >= 0) {
|
|
4775
|
-
const old =
|
|
4877
|
+
const old = this.domItem(oldIndex);
|
|
4776
4878
|
if (old && !old.destroyed) {
|
|
4777
4879
|
old.destroy();
|
|
4778
4880
|
dom.splice(oldIndex, 1);
|
|
@@ -4795,7 +4897,7 @@
|
|
|
4795
4897
|
domContainer.appendChild(canvasEl);
|
|
4796
4898
|
}
|
|
4797
4899
|
}
|
|
4798
|
-
const newItem = new Container(tagId, currentOptions);
|
|
4900
|
+
const newItem = new Container(Loader_classPrivateFieldGet(this, _Loader_engine, "f"), tagId, currentOptions);
|
|
4799
4901
|
if (oldIndex >= 0) {
|
|
4800
4902
|
dom.splice(oldIndex, 0, newItem);
|
|
4801
4903
|
} else {
|
|
@@ -4805,7 +4907,7 @@
|
|
|
4805
4907
|
await newItem.start();
|
|
4806
4908
|
return newItem;
|
|
4807
4909
|
}
|
|
4808
|
-
|
|
4910
|
+
async loadRemoteOptions(params) {
|
|
4809
4911
|
const {url: jsonUrl, index: index} = params;
|
|
4810
4912
|
const url = jsonUrl instanceof Array ? itemFromArray(jsonUrl, index) : jsonUrl;
|
|
4811
4913
|
if (!url) {
|
|
@@ -4817,14 +4919,14 @@
|
|
|
4817
4919
|
return;
|
|
4818
4920
|
}
|
|
4819
4921
|
const data = await response.json();
|
|
4820
|
-
return
|
|
4922
|
+
return this.loadOptions({
|
|
4821
4923
|
tagId: params.tagId,
|
|
4822
4924
|
element: params.element,
|
|
4823
4925
|
index: index,
|
|
4824
4926
|
options: data
|
|
4825
4927
|
});
|
|
4826
4928
|
}
|
|
4827
|
-
|
|
4929
|
+
load(tagId, options, index) {
|
|
4828
4930
|
const params = {
|
|
4829
4931
|
index: index
|
|
4830
4932
|
};
|
|
@@ -4840,7 +4942,7 @@
|
|
|
4840
4942
|
}
|
|
4841
4943
|
return this.loadOptions(params);
|
|
4842
4944
|
}
|
|
4843
|
-
|
|
4945
|
+
async set(id, domContainer, options, index) {
|
|
4844
4946
|
const params = {
|
|
4845
4947
|
index: index
|
|
4846
4948
|
};
|
|
@@ -4861,7 +4963,7 @@
|
|
|
4861
4963
|
}
|
|
4862
4964
|
return this.loadOptions(params);
|
|
4863
4965
|
}
|
|
4864
|
-
|
|
4966
|
+
async loadJSON(tagId, jsonUrl, index) {
|
|
4865
4967
|
let url, id;
|
|
4866
4968
|
if (typeof jsonUrl === "number" || jsonUrl === undefined) {
|
|
4867
4969
|
url = tagId;
|
|
@@ -4869,13 +4971,13 @@
|
|
|
4869
4971
|
id = tagId;
|
|
4870
4972
|
url = jsonUrl;
|
|
4871
4973
|
}
|
|
4872
|
-
return
|
|
4974
|
+
return this.loadRemoteOptions({
|
|
4873
4975
|
tagId: id,
|
|
4874
4976
|
url: url,
|
|
4875
4977
|
index: index
|
|
4876
4978
|
});
|
|
4877
4979
|
}
|
|
4878
|
-
|
|
4980
|
+
async setJSON(id, domContainer, jsonUrl, index) {
|
|
4879
4981
|
let url, newId, newIndex, element;
|
|
4880
4982
|
if (id instanceof HTMLElement) {
|
|
4881
4983
|
element = id;
|
|
@@ -4887,15 +4989,15 @@
|
|
|
4887
4989
|
url = jsonUrl;
|
|
4888
4990
|
newIndex = index;
|
|
4889
4991
|
}
|
|
4890
|
-
return
|
|
4992
|
+
return this.loadRemoteOptions({
|
|
4891
4993
|
tagId: newId,
|
|
4892
4994
|
url: url,
|
|
4893
4995
|
index: newIndex,
|
|
4894
4996
|
element: element
|
|
4895
4997
|
});
|
|
4896
4998
|
}
|
|
4897
|
-
|
|
4898
|
-
const dom =
|
|
4999
|
+
setOnClickHandler(callback) {
|
|
5000
|
+
const dom = this.dom();
|
|
4899
5001
|
if (dom.length === 0) {
|
|
4900
5002
|
throw new Error("Can only set click handlers after calling tsParticles.load() or tsParticles.loadJSON()");
|
|
4901
5003
|
}
|
|
@@ -4904,6 +5006,7 @@
|
|
|
4904
5006
|
}
|
|
4905
5007
|
}
|
|
4906
5008
|
}
|
|
5009
|
+
_Loader_engine = new WeakMap;
|
|
4907
5010
|
class Attractor extends ExternalInteractorBase {
|
|
4908
5011
|
constructor(container) {
|
|
4909
5012
|
super(container);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! tsParticles v1.
|
|
2
|
-
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}(window,(function(){return function(){"use strict";var t={d:function(e,n){for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t,e){const n=t.x-e.x,o=t.y-e.y;return{dx:n,dy:o,distance:Math.sqrt(n*n+o*o)}}function o(t,e){switch(e){case"ease-out-quad":return 1-(1-t)**2;case"ease-out-cubic":return 1-(1-t)**3;case"ease-out-quart":return 1-(1-t)**4;case"ease-out-quint":return 1-(1-t)**5;case"ease-out-expo":return 1===t?1:1-Math.pow(2,-10*t);case"ease-out-sine":return Math.sin(t*Math.PI/2);case"ease-out-back":{const e=1.70158;return 1+(e+1)*Math.pow(t-1,3)+e*Math.pow(t-1,2)}case"ease-out-circ":return Math.sqrt(1-Math.pow(t-1,2));default:return t}}function
|
|
1
|
+
/*! tsParticles v1.40.0 by Matteo Bruni */
|
|
2
|
+
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}(window,(function(){return function(){"use strict";var t={d:function(e,n){for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t,e){const n=t.x-e.x,o=t.y-e.y;return{dx:n,dy:o,distance:Math.sqrt(n*n+o*o)}}function o(t,e){switch(e){case"ease-out-quad":return 1-(1-t)**2;case"ease-out-cubic":return 1-(1-t)**3;case"ease-out-quart":return 1-(1-t)**4;case"ease-out-quint":return 1-(1-t)**5;case"ease-out-expo":return 1===t?1:1-Math.pow(2,-10*t);case"ease-out-sine":return Math.sin(t*Math.PI/2);case"ease-out-back":{const e=1.70158;return 1+(e+1)*Math.pow(t-1,3)+e*Math.pow(t-1,2)}case"ease-out-circ":return Math.sqrt(1-Math.pow(t-1,2));default:return t}}function a(t,e){return t===e||e instanceof Array&&e.indexOf(t)>-1}t.r(e),t.d(e,{loadExternalAttractInteraction:function(){return u}});class i extends class{constructor(t,e){this.position={x:t,y:e}}}{constructor(t,e,n){super(t,e),this.radius=n}contains(t){return e=t,o=this.position,n(e,o).distance<=this.radius;var e,o}intersects(t){const e=t,n=t,o=this.position,a=t.position,i=Math.abs(a.x-o.x),r=Math.abs(a.y-o.y),s=this.radius;if(void 0!==n.radius){return s+n.radius>Math.sqrt(i*i+r+r)}if(void 0!==e.size){const t=e.size.width,n=e.size.height,o=Math.pow(i-t,2)+Math.pow(r-n,2);return!(i>s+t||r>s+n)&&(i<=t||r<=n||o<=s*s)}return!1}}class r{}r.generatedAttribute="generated",r.randomColorValue="random",r.midColorValue="mid",r.touchEndEvent="touchend",r.mouseDownEvent="mousedown",r.mouseUpEvent="mouseup",r.mouseMoveEvent="mousemove",r.touchStartEvent="touchstart",r.touchMoveEvent="touchmove",r.mouseLeaveEvent="mouseleave",r.mouseOutEvent="mouseout",r.touchCancelEvent="touchcancel",r.resizeEvent="resize",r.visibilityChangeEvent="visibilitychange",r.noPolygonDataLoaded="No polygon data loaded.",r.noPolygonFound="No polygon found, you need to specify SVG url in config.";new WeakMap;new WeakMap;class s{constructor(t,e){let n,o;if(void 0===e){if("number"==typeof t)throw new Error("tsParticles - Vector not initialized correctly");const e=t;[n,o]=[e.x,e.y]}else[n,o]=[t,e];this.x=n,this.y=o}static clone(t){return s.create(t.x,t.y)}static create(t,e){return new s(t,e)}static get origin(){return s.create(0,0)}get angle(){return Math.atan2(this.y,this.x)}set angle(t){this.updateFromAngle(t,this.length)}get length(){return Math.sqrt(this.x**2+this.y**2)}set length(t){this.updateFromAngle(this.angle,t)}add(t){return s.create(this.x+t.x,this.y+t.y)}addTo(t){this.x+=t.x,this.y+=t.y}sub(t){return s.create(this.x-t.x,this.y-t.y)}subFrom(t){this.x-=t.x,this.y-=t.y}mult(t){return s.create(this.x*t,this.y*t)}multTo(t){this.x*=t,this.y*=t}div(t){return s.create(this.x/t,this.y/t)}divTo(t){this.x/=t,this.y/=t}distanceTo(t){return this.sub(t).length}getLengthSq(){return this.x**2+this.y**2}distanceToSq(t){return this.sub(t).getLengthSq()}manhattanDistanceTo(t){return Math.abs(t.x-this.x)+Math.abs(t.y-this.y)}copy(){return s.clone(this)}setTo(t){this.x=t.x,this.y=t.y}rotate(t){return s.create(this.x*Math.cos(t)-this.y*Math.sin(t),this.x*Math.sin(t)+this.y*Math.cos(t))}updateFromAngle(t,e){this.x=Math.cos(t)*e,this.y=Math.sin(t)*e}}new WeakMap,new WeakSet;new WeakMap;new WeakMap;new WeakMap;new WeakMap;class c extends class{constructor(t){this.container=t,this.type=0}}{constructor(t){super(t)}isEnabled(){const t=this.container,e=t.actualOptions,n=t.interactivity.mouse,o=e.interactivity.events;if(!(n.position&&o.onHover.enable||n.clickPosition&&o.onClick.enable))return!1;const i=o.onHover.mode,r=o.onClick.mode;return a("attract",i)||a("attract",r)}reset(){}interact(){const t=this.container,e=t.actualOptions,n=t.interactivity.status===r.mouseMoveEvent,o=e.interactivity.events,i=o.onHover.enable,s=o.onHover.mode,c=o.onClick.enable,u=o.onClick.mode;n&&i&&a("attract",s)?this.hoverAttract():c&&a("attract",u)&&this.clickAttract()}hoverAttract(){const t=this.container,e=t.interactivity.mouse.position;if(!e)return;const n=t.retina.attractModeDistance;this.processAttract(e,n,new i(e.x,e.y,n))}processAttract(t,e,a){const i=this.container,r=i.actualOptions.interactivity.modes.attract,c=i.particles.quadTree.query(a);for(const a of c){const{dx:i,dy:c,distance:l}=n(a.position,t),y=r.speed*r.factor,p=(u=o(1-l/e,r.easing)*y,h=0,d=r.maxSpeed,Math.min(Math.max(u,h),d)),v=s.create(0===l?y:i/l*p,0===l?y:c/l*p);a.position.subFrom(v)}var u,h,d}clickAttract(){const t=this.container;if(t.attract.finish||(t.attract.count||(t.attract.count=0),t.attract.count++,t.attract.count===t.particles.count&&(t.attract.finish=!0)),t.attract.clicking){const e=t.interactivity.mouse.clickPosition;if(!e)return;const n=t.retina.attractModeDistance;this.processAttract(e,n,new i(e.x,e.y,n))}else!1===t.attract.clicking&&(t.attract.particles=[])}}async function u(t){await t.addInteractor("externalAttract",(t=>new c(t)))}return e}()}));
|