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
|
@@ -506,15 +506,30 @@
|
|
|
506
506
|
}
|
|
507
507
|
}
|
|
508
508
|
}
|
|
509
|
+
var __classPrivateFieldSet = undefined && undefined.__classPrivateFieldSet || function(receiver, state, value, kind, f) {
|
|
510
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
511
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
512
|
+
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");
|
|
513
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value),
|
|
514
|
+
value;
|
|
515
|
+
};
|
|
516
|
+
var __classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function(receiver, state, kind, f) {
|
|
517
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
518
|
+
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");
|
|
519
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
520
|
+
};
|
|
521
|
+
var _InteractionManager_engine;
|
|
509
522
|
class InteractionManager_InteractionManager {
|
|
510
|
-
constructor(container) {
|
|
523
|
+
constructor(engine, container) {
|
|
511
524
|
this.container = container;
|
|
525
|
+
_InteractionManager_engine.set(this, void 0);
|
|
526
|
+
__classPrivateFieldSet(this, _InteractionManager_engine, engine, "f");
|
|
512
527
|
this.externalInteractors = [];
|
|
513
528
|
this.particleInteractors = [];
|
|
514
529
|
this.init();
|
|
515
530
|
}
|
|
516
531
|
init() {
|
|
517
|
-
const interactors =
|
|
532
|
+
const interactors = __classPrivateFieldGet(this, _InteractionManager_engine, "f").plugins.getInteractors(this.container, true);
|
|
518
533
|
this.externalInteractors = [];
|
|
519
534
|
this.particleInteractors = [];
|
|
520
535
|
for (const interactor of interactors) {
|
|
@@ -547,6 +562,7 @@
|
|
|
547
562
|
}
|
|
548
563
|
}
|
|
549
564
|
}
|
|
565
|
+
_InteractionManager_engine = new WeakMap;
|
|
550
566
|
function applyDistance(particle) {
|
|
551
567
|
const initialPosition = particle.initialPosition;
|
|
552
568
|
const {dx: dx, dy: dy} = getDistances(initialPosition, particle.position);
|
|
@@ -720,26 +736,38 @@
|
|
|
720
736
|
return proximityFactor / slowFactor;
|
|
721
737
|
}
|
|
722
738
|
}
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
class
|
|
732
|
-
|
|
733
|
-
|
|
739
|
+
var Plugins_classPrivateFieldSet = undefined && undefined.__classPrivateFieldSet || function(receiver, state, value, kind, f) {
|
|
740
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
741
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
742
|
+
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");
|
|
743
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value),
|
|
744
|
+
value;
|
|
745
|
+
};
|
|
746
|
+
var _Plugins_engine;
|
|
747
|
+
class Plugins {
|
|
748
|
+
constructor(engine) {
|
|
749
|
+
_Plugins_engine.set(this, void 0);
|
|
750
|
+
Plugins_classPrivateFieldSet(this, _Plugins_engine, engine, "f");
|
|
751
|
+
this.plugins = [];
|
|
752
|
+
this.interactorsInitializers = new Map;
|
|
753
|
+
this.updatersInitializers = new Map;
|
|
754
|
+
this.interactors = new Map;
|
|
755
|
+
this.updaters = new Map;
|
|
756
|
+
this.presets = new Map;
|
|
757
|
+
this.drawers = new Map;
|
|
758
|
+
this.pathGenerators = new Map;
|
|
734
759
|
}
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
760
|
+
getPlugin(plugin) {
|
|
761
|
+
return this.plugins.find((t => t.id === plugin));
|
|
762
|
+
}
|
|
763
|
+
addPlugin(plugin) {
|
|
764
|
+
if (!this.getPlugin(plugin.id)) {
|
|
765
|
+
this.plugins.push(plugin);
|
|
738
766
|
}
|
|
739
767
|
}
|
|
740
|
-
|
|
768
|
+
getAvailablePlugins(container) {
|
|
741
769
|
const res = new Map;
|
|
742
|
-
for (const plugin of plugins) {
|
|
770
|
+
for (const plugin of this.plugins) {
|
|
743
771
|
if (!plugin.needsPlugin(container.actualOptions)) {
|
|
744
772
|
continue;
|
|
745
773
|
}
|
|
@@ -747,61 +775,62 @@
|
|
|
747
775
|
}
|
|
748
776
|
return res;
|
|
749
777
|
}
|
|
750
|
-
|
|
751
|
-
for (const plugin of plugins) {
|
|
778
|
+
loadOptions(options, sourceOptions) {
|
|
779
|
+
for (const plugin of this.plugins) {
|
|
752
780
|
plugin.loadOptions(options, sourceOptions);
|
|
753
781
|
}
|
|
754
782
|
}
|
|
755
|
-
|
|
756
|
-
return presets.get(preset);
|
|
783
|
+
getPreset(preset) {
|
|
784
|
+
return this.presets.get(preset);
|
|
757
785
|
}
|
|
758
|
-
|
|
759
|
-
if (override || !
|
|
760
|
-
presets.set(presetKey, options);
|
|
786
|
+
addPreset(presetKey, options, override = false) {
|
|
787
|
+
if (override || !this.getPreset(presetKey)) {
|
|
788
|
+
this.presets.set(presetKey, options);
|
|
761
789
|
}
|
|
762
790
|
}
|
|
763
|
-
|
|
764
|
-
if (!
|
|
765
|
-
drawers.set(type, drawer);
|
|
791
|
+
addShapeDrawer(type, drawer) {
|
|
792
|
+
if (!this.getShapeDrawer(type)) {
|
|
793
|
+
this.drawers.set(type, drawer);
|
|
766
794
|
}
|
|
767
795
|
}
|
|
768
|
-
|
|
769
|
-
return drawers.get(type);
|
|
796
|
+
getShapeDrawer(type) {
|
|
797
|
+
return this.drawers.get(type);
|
|
770
798
|
}
|
|
771
|
-
|
|
772
|
-
return drawers.keys();
|
|
799
|
+
getSupportedShapes() {
|
|
800
|
+
return this.drawers.keys();
|
|
773
801
|
}
|
|
774
|
-
|
|
775
|
-
return pathGenerators.get(type);
|
|
802
|
+
getPathGenerator(type) {
|
|
803
|
+
return this.pathGenerators.get(type);
|
|
776
804
|
}
|
|
777
|
-
|
|
778
|
-
if (!
|
|
779
|
-
pathGenerators.set(type, pathGenerator);
|
|
805
|
+
addPathGenerator(type, pathGenerator) {
|
|
806
|
+
if (!this.getPathGenerator(type)) {
|
|
807
|
+
this.pathGenerators.set(type, pathGenerator);
|
|
780
808
|
}
|
|
781
809
|
}
|
|
782
|
-
|
|
783
|
-
let res = interactors.get(container);
|
|
810
|
+
getInteractors(container, force = false) {
|
|
811
|
+
let res = this.interactors.get(container);
|
|
784
812
|
if (!res || force) {
|
|
785
|
-
res = [ ...interactorsInitializers.values() ].map((t => t(container)));
|
|
786
|
-
interactors.set(container, res);
|
|
813
|
+
res = [ ...this.interactorsInitializers.values() ].map((t => t(container)));
|
|
814
|
+
this.interactors.set(container, res);
|
|
787
815
|
}
|
|
788
816
|
return res;
|
|
789
817
|
}
|
|
790
|
-
|
|
791
|
-
interactorsInitializers.set(name, initInteractor);
|
|
818
|
+
addInteractor(name, initInteractor) {
|
|
819
|
+
this.interactorsInitializers.set(name, initInteractor);
|
|
792
820
|
}
|
|
793
|
-
|
|
794
|
-
let res = updaters.get(container);
|
|
821
|
+
getUpdaters(container, force = false) {
|
|
822
|
+
let res = this.updaters.get(container);
|
|
795
823
|
if (!res || force) {
|
|
796
|
-
res = [ ...updatersInitializers.values() ].map((t => t(container)));
|
|
797
|
-
updaters.set(container, res);
|
|
824
|
+
res = [ ...this.updatersInitializers.values() ].map((t => t(container)));
|
|
825
|
+
this.updaters.set(container, res);
|
|
798
826
|
}
|
|
799
827
|
return res;
|
|
800
828
|
}
|
|
801
|
-
|
|
802
|
-
updatersInitializers.set(name, initUpdater);
|
|
829
|
+
addParticleUpdater(name, initUpdater) {
|
|
830
|
+
this.updatersInitializers.set(name, initUpdater);
|
|
803
831
|
}
|
|
804
832
|
}
|
|
833
|
+
_Plugins_engine = new WeakMap;
|
|
805
834
|
class QuadTree_QuadTree {
|
|
806
835
|
constructor(rectangle, capacity) {
|
|
807
836
|
this.rectangle = rectangle;
|
|
@@ -2328,15 +2357,24 @@
|
|
|
2328
2357
|
}
|
|
2329
2358
|
}
|
|
2330
2359
|
}
|
|
2331
|
-
var
|
|
2360
|
+
var Options_classPrivateFieldSet = undefined && undefined.__classPrivateFieldSet || function(receiver, state, value, kind, f) {
|
|
2361
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
2362
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
2363
|
+
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");
|
|
2364
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value),
|
|
2365
|
+
value;
|
|
2366
|
+
};
|
|
2367
|
+
var Options_classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function(receiver, state, kind, f) {
|
|
2332
2368
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
2333
2369
|
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");
|
|
2334
2370
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
2335
2371
|
};
|
|
2336
|
-
var _Options_instances, _Options_findDefaultTheme;
|
|
2372
|
+
var _Options_instances, _Options_engine, _Options_findDefaultTheme;
|
|
2337
2373
|
class Options_Options {
|
|
2338
|
-
constructor() {
|
|
2374
|
+
constructor(engine) {
|
|
2339
2375
|
_Options_instances.add(this);
|
|
2376
|
+
_Options_engine.set(this, void 0);
|
|
2377
|
+
Options_classPrivateFieldSet(this, _Options_engine, engine, "f");
|
|
2340
2378
|
this.autoPlay = true;
|
|
2341
2379
|
this.background = new Background;
|
|
2342
2380
|
this.backgroundMask = new BackgroundMask;
|
|
@@ -2429,7 +2467,7 @@
|
|
|
2429
2467
|
this.motion.load(data.motion);
|
|
2430
2468
|
this.particles.load(data.particles);
|
|
2431
2469
|
this.style = deepExtend(this.style, data.style);
|
|
2432
|
-
|
|
2470
|
+
Options_classPrivateFieldGet(this, _Options_engine, "f").plugins.loadOptions(this, data);
|
|
2433
2471
|
if (data.responsive !== undefined) {
|
|
2434
2472
|
for (const responsive of data.responsive) {
|
|
2435
2473
|
const optResponsive = new Responsive;
|
|
@@ -2445,8 +2483,8 @@
|
|
|
2445
2483
|
this.themes.push(optTheme);
|
|
2446
2484
|
}
|
|
2447
2485
|
}
|
|
2448
|
-
this.defaultDarkTheme = (_d =
|
|
2449
|
-
this.defaultLightTheme = (_e =
|
|
2486
|
+
this.defaultDarkTheme = (_d = Options_classPrivateFieldGet(this, _Options_instances, "m", _Options_findDefaultTheme).call(this, "dark")) === null || _d === void 0 ? void 0 : _d.name;
|
|
2487
|
+
this.defaultLightTheme = (_e = Options_classPrivateFieldGet(this, _Options_instances, "m", _Options_findDefaultTheme).call(this, "light")) === null || _e === void 0 ? void 0 : _e.name;
|
|
2450
2488
|
}
|
|
2451
2489
|
setTheme(name) {
|
|
2452
2490
|
if (name) {
|
|
@@ -2455,7 +2493,7 @@
|
|
|
2455
2493
|
this.load(chosenTheme.options);
|
|
2456
2494
|
}
|
|
2457
2495
|
} else {
|
|
2458
|
-
const mediaMatch = typeof matchMedia !== "undefined" && matchMedia("(prefers-color-scheme: dark)"), clientDarkMode = mediaMatch && mediaMatch.matches, defaultTheme =
|
|
2496
|
+
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");
|
|
2459
2497
|
if (defaultTheme) {
|
|
2460
2498
|
this.load(defaultTheme.options);
|
|
2461
2499
|
}
|
|
@@ -2468,13 +2506,26 @@
|
|
|
2468
2506
|
return responsiveOptions === null || responsiveOptions === void 0 ? void 0 : responsiveOptions.maxWidth;
|
|
2469
2507
|
}
|
|
2470
2508
|
importPreset(preset) {
|
|
2471
|
-
this.load(
|
|
2509
|
+
this.load(Options_classPrivateFieldGet(this, _Options_engine, "f").plugins.getPreset(preset));
|
|
2472
2510
|
}
|
|
2473
2511
|
}
|
|
2474
|
-
_Options_instances = new WeakSet, _Options_findDefaultTheme = function _Options_findDefaultTheme(mode) {
|
|
2512
|
+
_Options_engine = new WeakMap, _Options_instances = new WeakSet, _Options_findDefaultTheme = function _Options_findDefaultTheme(mode) {
|
|
2475
2513
|
var _a;
|
|
2476
2514
|
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"));
|
|
2477
2515
|
};
|
|
2516
|
+
var Particle_classPrivateFieldSet = undefined && undefined.__classPrivateFieldSet || function(receiver, state, value, kind, f) {
|
|
2517
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
2518
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
2519
|
+
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");
|
|
2520
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value),
|
|
2521
|
+
value;
|
|
2522
|
+
};
|
|
2523
|
+
var Particle_classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function(receiver, state, kind, f) {
|
|
2524
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
2525
|
+
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");
|
|
2526
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
2527
|
+
};
|
|
2528
|
+
var _Particle_engine;
|
|
2478
2529
|
const fixOutMode = data => {
|
|
2479
2530
|
if (isInArray(data.outMode, data.checkModes) || isInArray(data.outMode, data.checkModes)) {
|
|
2480
2531
|
if (data.coord > data.maxCoord - data.radius * 2) {
|
|
@@ -2485,11 +2536,13 @@
|
|
|
2485
2536
|
}
|
|
2486
2537
|
};
|
|
2487
2538
|
class Particle_Particle {
|
|
2488
|
-
constructor(id, container, position, overrideOptions, group) {
|
|
2539
|
+
constructor(engine, id, container, position, overrideOptions, group) {
|
|
2489
2540
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
2490
2541
|
this.id = id;
|
|
2491
2542
|
this.container = container;
|
|
2492
2543
|
this.group = group;
|
|
2544
|
+
_Particle_engine.set(this, void 0);
|
|
2545
|
+
Particle_classPrivateFieldSet(this, _Particle_engine, engine, "f");
|
|
2493
2546
|
this.fill = true;
|
|
2494
2547
|
this.close = true;
|
|
2495
2548
|
this.lastPathTime = 0;
|
|
@@ -2583,7 +2636,7 @@
|
|
|
2583
2636
|
this.sides = 24;
|
|
2584
2637
|
let drawer = container.drawers.get(this.shape);
|
|
2585
2638
|
if (!drawer) {
|
|
2586
|
-
drawer =
|
|
2639
|
+
drawer = Particle_classPrivateFieldGet(this, _Particle_engine, "f").plugins.getShapeDrawer(this.shape);
|
|
2587
2640
|
if (drawer) {
|
|
2588
2641
|
container.drawers.set(this.shape, drawer);
|
|
2589
2642
|
}
|
|
@@ -2823,9 +2876,25 @@
|
|
|
2823
2876
|
return life;
|
|
2824
2877
|
}
|
|
2825
2878
|
}
|
|
2879
|
+
_Particle_engine = new WeakMap;
|
|
2880
|
+
var Particles_classPrivateFieldSet = undefined && undefined.__classPrivateFieldSet || function(receiver, state, value, kind, f) {
|
|
2881
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
2882
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
2883
|
+
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");
|
|
2884
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value),
|
|
2885
|
+
value;
|
|
2886
|
+
};
|
|
2887
|
+
var Particles_classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function(receiver, state, kind, f) {
|
|
2888
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
2889
|
+
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");
|
|
2890
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
2891
|
+
};
|
|
2892
|
+
var _Particles_engine;
|
|
2826
2893
|
class Particles_Particles {
|
|
2827
|
-
constructor(container) {
|
|
2894
|
+
constructor(engine, container) {
|
|
2828
2895
|
this.container = container;
|
|
2896
|
+
_Particles_engine.set(this, void 0);
|
|
2897
|
+
Particles_classPrivateFieldSet(this, _Particles_engine, engine, "f");
|
|
2829
2898
|
this.nextId = 0;
|
|
2830
2899
|
this.array = [];
|
|
2831
2900
|
this.zArray = [];
|
|
@@ -2837,11 +2906,11 @@
|
|
|
2837
2906
|
links: new Map,
|
|
2838
2907
|
triangles: new Map
|
|
2839
2908
|
};
|
|
2840
|
-
this.interactionManager = new InteractionManager(container);
|
|
2909
|
+
this.interactionManager = new InteractionManager(Particles_classPrivateFieldGet(this, _Particles_engine, "f"), container);
|
|
2841
2910
|
const canvasSize = this.container.canvas.size;
|
|
2842
2911
|
this.linksColors = new Map;
|
|
2843
2912
|
this.quadTree = new QuadTree(new Rectangle(-canvasSize.width / 4, -canvasSize.height / 4, canvasSize.width * 3 / 2, canvasSize.height * 3 / 2), 4);
|
|
2844
|
-
this.updaters =
|
|
2913
|
+
this.updaters = Particles_classPrivateFieldGet(this, _Particles_engine, "f").plugins.getUpdaters(container, true);
|
|
2845
2914
|
}
|
|
2846
2915
|
get count() {
|
|
2847
2916
|
return this.array.length;
|
|
@@ -2855,7 +2924,7 @@
|
|
|
2855
2924
|
this.freqs.links = new Map;
|
|
2856
2925
|
this.freqs.triangles = new Map;
|
|
2857
2926
|
let handled = false;
|
|
2858
|
-
this.updaters =
|
|
2927
|
+
this.updaters = Particles_classPrivateFieldGet(this, _Particles_engine, "f").plugins.getUpdaters(container, true);
|
|
2859
2928
|
this.interactionManager.init();
|
|
2860
2929
|
for (const [, plugin] of container.plugins) {
|
|
2861
2930
|
if (plugin.particlesInitialization !== undefined) {
|
|
@@ -3102,7 +3171,7 @@
|
|
|
3102
3171
|
}
|
|
3103
3172
|
pushParticle(position, overrideOptions, group, initializer) {
|
|
3104
3173
|
try {
|
|
3105
|
-
const particle = new Particle(this.nextId, this.container, position, overrideOptions, group);
|
|
3174
|
+
const particle = new Particle(Particles_classPrivateFieldGet(this, _Particles_engine, "f"), this.nextId, this.container, position, overrideOptions, group);
|
|
3106
3175
|
let canAdd = true;
|
|
3107
3176
|
if (initializer) {
|
|
3108
3177
|
canAdd = initializer(particle);
|
|
@@ -3120,6 +3189,7 @@
|
|
|
3120
3189
|
}
|
|
3121
3190
|
}
|
|
3122
3191
|
}
|
|
3192
|
+
_Particles_engine = new WeakMap;
|
|
3123
3193
|
class Retina_Retina {
|
|
3124
3194
|
constructor(container) {
|
|
3125
3195
|
this.container = container;
|
|
@@ -3207,9 +3277,24 @@
|
|
|
3207
3277
|
}
|
|
3208
3278
|
}
|
|
3209
3279
|
}
|
|
3280
|
+
var Container_classPrivateFieldSet = undefined && undefined.__classPrivateFieldSet || function(receiver, state, value, kind, f) {
|
|
3281
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3282
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
3283
|
+
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");
|
|
3284
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value),
|
|
3285
|
+
value;
|
|
3286
|
+
};
|
|
3287
|
+
var Container_classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function(receiver, state, kind, f) {
|
|
3288
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3289
|
+
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");
|
|
3290
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
3291
|
+
};
|
|
3292
|
+
var _Container_engine;
|
|
3210
3293
|
class Container_Container {
|
|
3211
|
-
constructor(id, sourceOptions, ...presets) {
|
|
3294
|
+
constructor(engine, id, sourceOptions, ...presets) {
|
|
3212
3295
|
this.id = id;
|
|
3296
|
+
_Container_engine.set(this, void 0);
|
|
3297
|
+
Container_classPrivateFieldSet(this, _Container_engine, engine, "f");
|
|
3213
3298
|
this.fpsLimit = 120;
|
|
3214
3299
|
this.duration = 0;
|
|
3215
3300
|
this.lifeTime = 0;
|
|
@@ -3224,7 +3309,7 @@
|
|
|
3224
3309
|
this._initialSourceOptions = sourceOptions;
|
|
3225
3310
|
this.retina = new Retina(this);
|
|
3226
3311
|
this.canvas = new Canvas(this);
|
|
3227
|
-
this.particles = new Particles(this);
|
|
3312
|
+
this.particles = new Particles(Container_classPrivateFieldGet(this, _Container_engine, "f"), this);
|
|
3228
3313
|
this.drawer = new FrameManager(this);
|
|
3229
3314
|
this.presets = presets;
|
|
3230
3315
|
this.pathGenerator = {
|
|
@@ -3253,8 +3338,8 @@
|
|
|
3253
3338
|
this.plugins = new Map;
|
|
3254
3339
|
this.drawers = new Map;
|
|
3255
3340
|
this.density = 1;
|
|
3256
|
-
this._options = new Options;
|
|
3257
|
-
this.actualOptions = new Options;
|
|
3341
|
+
this._options = new Options(Container_classPrivateFieldGet(this, _Container_engine, "f"));
|
|
3342
|
+
this.actualOptions = new Options(Container_classPrivateFieldGet(this, _Container_engine, "f"));
|
|
3258
3343
|
this.eventListeners = new EventListeners(this);
|
|
3259
3344
|
if (typeof IntersectionObserver !== "undefined" && IntersectionObserver) {
|
|
3260
3345
|
this.intersectionObserver = new IntersectionObserver((entries => this.intersectionManager(entries)));
|
|
@@ -3369,7 +3454,7 @@
|
|
|
3369
3454
|
return this.start();
|
|
3370
3455
|
}
|
|
3371
3456
|
reset() {
|
|
3372
|
-
this._options = new Options;
|
|
3457
|
+
this._options = new Options(Container_classPrivateFieldGet(this, _Container_engine, "f"));
|
|
3373
3458
|
return this.refresh();
|
|
3374
3459
|
}
|
|
3375
3460
|
stop() {
|
|
@@ -3510,20 +3595,20 @@
|
|
|
3510
3595
|
return false;
|
|
3511
3596
|
}
|
|
3512
3597
|
async init() {
|
|
3513
|
-
this._options = new Options;
|
|
3598
|
+
this._options = new Options(Container_classPrivateFieldGet(this, _Container_engine, "f"));
|
|
3514
3599
|
for (const preset of this.presets) {
|
|
3515
|
-
this._options.load(
|
|
3600
|
+
this._options.load(Container_classPrivateFieldGet(this, _Container_engine, "f").plugins.getPreset(preset));
|
|
3516
3601
|
}
|
|
3517
|
-
const shapes =
|
|
3602
|
+
const shapes = Container_classPrivateFieldGet(this, _Container_engine, "f").plugins.getSupportedShapes();
|
|
3518
3603
|
for (const type of shapes) {
|
|
3519
|
-
const drawer =
|
|
3604
|
+
const drawer = Container_classPrivateFieldGet(this, _Container_engine, "f").plugins.getShapeDrawer(type);
|
|
3520
3605
|
if (drawer) {
|
|
3521
3606
|
this.drawers.set(type, drawer);
|
|
3522
3607
|
}
|
|
3523
3608
|
}
|
|
3524
3609
|
this._options.load(this._initialSourceOptions);
|
|
3525
3610
|
this._options.load(this._sourceOptions);
|
|
3526
|
-
this.actualOptions = new Options;
|
|
3611
|
+
this.actualOptions = new Options(Container_classPrivateFieldGet(this, _Container_engine, "f"));
|
|
3527
3612
|
this.actualOptions.load(this._options);
|
|
3528
3613
|
this.retina.init();
|
|
3529
3614
|
this.canvas.init();
|
|
@@ -3534,7 +3619,7 @@
|
|
|
3534
3619
|
this.duration = getRangeValue(this.actualOptions.duration);
|
|
3535
3620
|
this.lifeTime = 0;
|
|
3536
3621
|
this.fpsLimit = this.actualOptions.fpsLimit > 0 ? this.actualOptions.fpsLimit : 120;
|
|
3537
|
-
const availablePlugins =
|
|
3622
|
+
const availablePlugins = Container_classPrivateFieldGet(this, _Container_engine, "f").plugins.getAvailablePlugins(this);
|
|
3538
3623
|
for (const [id, plugin] of availablePlugins) {
|
|
3539
3624
|
this.plugins.set(id, plugin);
|
|
3540
3625
|
}
|
|
@@ -3552,7 +3637,7 @@
|
|
|
3552
3637
|
}
|
|
3553
3638
|
const pathOptions = this.actualOptions.particles.move.path;
|
|
3554
3639
|
if (pathOptions.generator) {
|
|
3555
|
-
const customGenerator =
|
|
3640
|
+
const customGenerator = Container_classPrivateFieldGet(this, _Container_engine, "f").plugins.getPathGenerator(pathOptions.generator);
|
|
3556
3641
|
if (customGenerator) {
|
|
3557
3642
|
if (customGenerator.init) {
|
|
3558
3643
|
this.pathGenerator.init = customGenerator.init;
|
|
@@ -3589,24 +3674,41 @@
|
|
|
3589
3674
|
}
|
|
3590
3675
|
}
|
|
3591
3676
|
}
|
|
3592
|
-
|
|
3677
|
+
_Container_engine = new WeakMap;
|
|
3678
|
+
var Loader_classPrivateFieldSet = undefined && undefined.__classPrivateFieldSet || function(receiver, state, value, kind, f) {
|
|
3679
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3680
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
3681
|
+
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");
|
|
3682
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value),
|
|
3683
|
+
value;
|
|
3684
|
+
};
|
|
3685
|
+
var Loader_classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function(receiver, state, kind, f) {
|
|
3686
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3687
|
+
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");
|
|
3688
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
3689
|
+
};
|
|
3690
|
+
var _Loader_engine;
|
|
3593
3691
|
function fetchError(statusCode) {
|
|
3594
3692
|
console.error(`Error tsParticles - fetch status: ${statusCode}`);
|
|
3595
3693
|
console.error("Error tsParticles - File config not found");
|
|
3596
3694
|
}
|
|
3597
3695
|
class Loader {
|
|
3598
|
-
|
|
3599
|
-
|
|
3696
|
+
constructor(engine) {
|
|
3697
|
+
_Loader_engine.set(this, void 0);
|
|
3698
|
+
Loader_classPrivateFieldSet(this, _Loader_engine, engine, "f");
|
|
3699
|
+
}
|
|
3700
|
+
dom() {
|
|
3701
|
+
return Loader_classPrivateFieldGet(this, _Loader_engine, "f").domArray;
|
|
3600
3702
|
}
|
|
3601
|
-
|
|
3602
|
-
const dom =
|
|
3703
|
+
domItem(index) {
|
|
3704
|
+
const dom = this.dom();
|
|
3603
3705
|
const item = dom[index];
|
|
3604
3706
|
if (item && !item.destroyed) {
|
|
3605
3707
|
return item;
|
|
3606
3708
|
}
|
|
3607
3709
|
dom.splice(index, 1);
|
|
3608
3710
|
}
|
|
3609
|
-
|
|
3711
|
+
async loadOptions(params) {
|
|
3610
3712
|
var _a, _b, _c;
|
|
3611
3713
|
const tagId = (_a = params.tagId) !== null && _a !== void 0 ? _a : `tsparticles${Math.floor(Math.random() * 1e4)}`;
|
|
3612
3714
|
const {options: options, index: index} = params;
|
|
@@ -3617,10 +3719,10 @@
|
|
|
3617
3719
|
(_c = document.querySelector("body")) === null || _c === void 0 ? void 0 : _c.append(domContainer);
|
|
3618
3720
|
}
|
|
3619
3721
|
const currentOptions = options instanceof Array ? itemFromArray(options, index) : options;
|
|
3620
|
-
const dom =
|
|
3722
|
+
const dom = this.dom();
|
|
3621
3723
|
const oldIndex = dom.findIndex((v => v.id === tagId));
|
|
3622
3724
|
if (oldIndex >= 0) {
|
|
3623
|
-
const old =
|
|
3725
|
+
const old = this.domItem(oldIndex);
|
|
3624
3726
|
if (old && !old.destroyed) {
|
|
3625
3727
|
old.destroy();
|
|
3626
3728
|
dom.splice(oldIndex, 1);
|
|
@@ -3643,7 +3745,7 @@
|
|
|
3643
3745
|
domContainer.appendChild(canvasEl);
|
|
3644
3746
|
}
|
|
3645
3747
|
}
|
|
3646
|
-
const newItem = new Container(tagId, currentOptions);
|
|
3748
|
+
const newItem = new Container(Loader_classPrivateFieldGet(this, _Loader_engine, "f"), tagId, currentOptions);
|
|
3647
3749
|
if (oldIndex >= 0) {
|
|
3648
3750
|
dom.splice(oldIndex, 0, newItem);
|
|
3649
3751
|
} else {
|
|
@@ -3653,7 +3755,7 @@
|
|
|
3653
3755
|
await newItem.start();
|
|
3654
3756
|
return newItem;
|
|
3655
3757
|
}
|
|
3656
|
-
|
|
3758
|
+
async loadRemoteOptions(params) {
|
|
3657
3759
|
const {url: jsonUrl, index: index} = params;
|
|
3658
3760
|
const url = jsonUrl instanceof Array ? itemFromArray(jsonUrl, index) : jsonUrl;
|
|
3659
3761
|
if (!url) {
|
|
@@ -3665,14 +3767,14 @@
|
|
|
3665
3767
|
return;
|
|
3666
3768
|
}
|
|
3667
3769
|
const data = await response.json();
|
|
3668
|
-
return
|
|
3770
|
+
return this.loadOptions({
|
|
3669
3771
|
tagId: params.tagId,
|
|
3670
3772
|
element: params.element,
|
|
3671
3773
|
index: index,
|
|
3672
3774
|
options: data
|
|
3673
3775
|
});
|
|
3674
3776
|
}
|
|
3675
|
-
|
|
3777
|
+
load(tagId, options, index) {
|
|
3676
3778
|
const params = {
|
|
3677
3779
|
index: index
|
|
3678
3780
|
};
|
|
@@ -3688,7 +3790,7 @@
|
|
|
3688
3790
|
}
|
|
3689
3791
|
return this.loadOptions(params);
|
|
3690
3792
|
}
|
|
3691
|
-
|
|
3793
|
+
async set(id, domContainer, options, index) {
|
|
3692
3794
|
const params = {
|
|
3693
3795
|
index: index
|
|
3694
3796
|
};
|
|
@@ -3709,7 +3811,7 @@
|
|
|
3709
3811
|
}
|
|
3710
3812
|
return this.loadOptions(params);
|
|
3711
3813
|
}
|
|
3712
|
-
|
|
3814
|
+
async loadJSON(tagId, jsonUrl, index) {
|
|
3713
3815
|
let url, id;
|
|
3714
3816
|
if (typeof jsonUrl === "number" || jsonUrl === undefined) {
|
|
3715
3817
|
url = tagId;
|
|
@@ -3717,13 +3819,13 @@
|
|
|
3717
3819
|
id = tagId;
|
|
3718
3820
|
url = jsonUrl;
|
|
3719
3821
|
}
|
|
3720
|
-
return
|
|
3822
|
+
return this.loadRemoteOptions({
|
|
3721
3823
|
tagId: id,
|
|
3722
3824
|
url: url,
|
|
3723
3825
|
index: index
|
|
3724
3826
|
});
|
|
3725
3827
|
}
|
|
3726
|
-
|
|
3828
|
+
async setJSON(id, domContainer, jsonUrl, index) {
|
|
3727
3829
|
let url, newId, newIndex, element;
|
|
3728
3830
|
if (id instanceof HTMLElement) {
|
|
3729
3831
|
element = id;
|
|
@@ -3735,15 +3837,15 @@
|
|
|
3735
3837
|
url = jsonUrl;
|
|
3736
3838
|
newIndex = index;
|
|
3737
3839
|
}
|
|
3738
|
-
return
|
|
3840
|
+
return this.loadRemoteOptions({
|
|
3739
3841
|
tagId: newId,
|
|
3740
3842
|
url: url,
|
|
3741
3843
|
index: newIndex,
|
|
3742
3844
|
element: element
|
|
3743
3845
|
});
|
|
3744
3846
|
}
|
|
3745
|
-
|
|
3746
|
-
const dom =
|
|
3847
|
+
setOnClickHandler(callback) {
|
|
3848
|
+
const dom = this.dom();
|
|
3747
3849
|
if (dom.length === 0) {
|
|
3748
3850
|
throw new Error("Can only set click handlers after calling tsParticles.load() or tsParticles.loadJSON()");
|
|
3749
3851
|
}
|
|
@@ -3752,6 +3854,7 @@
|
|
|
3752
3854
|
}
|
|
3753
3855
|
}
|
|
3754
3856
|
}
|
|
3857
|
+
_Loader_engine = new WeakMap;
|
|
3755
3858
|
function NumberUtils_clamp(num, min, max) {
|
|
3756
3859
|
return Math.min(Math.max(num, min), max);
|
|
3757
3860
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! tsParticles v1.
|
|
2
|
-
!function(e,o){if("object"==typeof exports&&"object"==typeof module)module.exports=o();else if("function"==typeof define&&define.amd)define([],o);else{var t=o();for(var n in t)("object"==typeof exports?exports:e)[n]=t[n]}}(window,(function(){return function(){"use strict";var e={d:function(o,t){for(var n in t)e.o(t,n)&&!e.o(o,n)&&Object.defineProperty(o,n,{enumerable:!0,get:t[n]})},o:function(e,o){return Object.prototype.hasOwnProperty.call(e,o)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},o={};e.r(o),e.d(o,{loadSizeUpdater:function(){return s}});class t{}t.generatedAttribute="generated",t.randomColorValue="random",t.midColorValue="mid",t.touchEndEvent="touchend",t.mouseDownEvent="mousedown",t.mouseUpEvent="mouseup",t.mouseMoveEvent="mousemove",t.touchStartEvent="touchstart",t.touchMoveEvent="touchmove",t.mouseLeaveEvent="mouseleave",t.mouseOutEvent="mouseout",t.touchCancelEvent="touchcancel",t.resizeEvent="resize",t.visibilityChangeEvent="visibilitychange",t.noPolygonDataLoaded="No polygon data loaded.",t.noPolygonFound="No polygon found, you need to specify SVG url in config.";new
|
|
1
|
+
/*! tsParticles v1.40.0 by Matteo Bruni */
|
|
2
|
+
!function(e,o){if("object"==typeof exports&&"object"==typeof module)module.exports=o();else if("function"==typeof define&&define.amd)define([],o);else{var t=o();for(var n in t)("object"==typeof exports?exports:e)[n]=t[n]}}(window,(function(){return function(){"use strict";var e={d:function(o,t){for(var n in t)e.o(t,n)&&!e.o(o,n)&&Object.defineProperty(o,n,{enumerable:!0,get:t[n]})},o:function(e,o){return Object.prototype.hasOwnProperty.call(e,o)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},o={};e.r(o),e.d(o,{loadSizeUpdater:function(){return s}});class t{}t.generatedAttribute="generated",t.randomColorValue="random",t.midColorValue="mid",t.touchEndEvent="touchend",t.mouseDownEvent="mousedown",t.mouseUpEvent="mouseup",t.mouseMoveEvent="mousemove",t.touchStartEvent="touchstart",t.touchMoveEvent="touchmove",t.mouseLeaveEvent="mouseleave",t.mouseOutEvent="mouseout",t.touchCancelEvent="touchcancel",t.resizeEvent="resize",t.visibilityChangeEvent="visibilitychange",t.noPolygonDataLoaded="No polygon data loaded.",t.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;function n(e,o){var t,n,i,s;const a=(null!==(t=e.size.velocity)&&void 0!==t?t:0)*o.factor,u=e.size.min,l=e.size.max;if(!e.destroyed&&e.size.enable&&((null!==(n=e.size.loops)&&void 0!==n?n:0)<=0||(null!==(i=e.size.loops)&&void 0!==i?i:0)<(null!==(s=e.size.maxLoops)&&void 0!==s?s:0))){switch(e.size.status){case 0:e.size.value>=l?(e.size.status=1,e.size.loops||(e.size.loops=0),e.size.loops++):e.size.value+=a;break;case 1:e.size.value<=u?(e.size.status=0,e.size.loops||(e.size.loops=0),e.size.loops++):e.size.value-=a}var r,d,c;!function(e,o,t,n){switch(e.options.size.animation.destroy){case"max":o>=n&&e.destroy();break;case"min":o<=t&&e.destroy()}}(e,e.size.value,u,l),e.destroyed||(e.size.value=(r=e.size.value,d=u,c=l,Math.min(Math.max(r,d),c)))}}new WeakMap;class i{init(){}isEnabled(e){var o,t,n;return!e.destroyed&&!e.spawning&&e.size.enable&&((null!==(o=e.size.loops)&&void 0!==o?o:0)<=0||(null!==(t=e.size.loops)&&void 0!==t?t:0)<(null!==(n=e.size.maxLoops)&&void 0!==n?n:0))}update(e,o){this.isEnabled(e)&&n(e,o)}}async function s(e){await e.addParticleUpdater("size",(()=>new i))}return o}()}));
|