@tsparticles/preset-fountain 4.0.2 → 4.0.3
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
(function(g){g.__tsParticlesInternals=g.__tsParticlesInternals||{};g.__tsParticlesInternals.bundles=g.__tsParticlesInternals.bundles||{};g.__tsParticlesInternals.effects=g.__tsParticlesInternals.effects||{};g.__tsParticlesInternals.engine=g.__tsParticlesInternals.engine||{};g.__tsParticlesInternals.interactions=g.__tsParticlesInternals.interactions||{};g.__tsParticlesInternals.palettes=g.__tsParticlesInternals.palettes||{};g.__tsParticlesInternals.paths=g.__tsParticlesInternals.paths||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins.emittersShapes=g.__tsParticlesInternals.plugins.emittersShapes||{};g.__tsParticlesInternals.presets=g.__tsParticlesInternals.presets||{};g.__tsParticlesInternals.shapes=g.__tsParticlesInternals.shapes||{};g.__tsParticlesInternals.updaters=g.__tsParticlesInternals.updaters||{};g.__tsParticlesInternals.utils=g.__tsParticlesInternals.utils||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas.utils=g.__tsParticlesInternals.canvas.utils||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path.utils=g.__tsParticlesInternals.path.utils||{};var __tsProxyFactory=typeof Proxy!=="undefined"?function(obj){return new Proxy(obj,{get:function(target,key){if(!(key in target)){target[key]={};}return target[key];}});}:function(obj){return obj;};g.__tsParticlesInternals.bundles=__tsProxyFactory(g.__tsParticlesInternals.bundles);g.__tsParticlesInternals.effects=__tsProxyFactory(g.__tsParticlesInternals.effects);g.__tsParticlesInternals.interactions=__tsProxyFactory(g.__tsParticlesInternals.interactions);g.__tsParticlesInternals.palettes=__tsProxyFactory(g.__tsParticlesInternals.palettes);g.__tsParticlesInternals.paths=__tsProxyFactory(g.__tsParticlesInternals.paths);g.__tsParticlesInternals.plugins=__tsProxyFactory(g.__tsParticlesInternals.plugins);g.__tsParticlesInternals.plugins.emittersShapes=__tsProxyFactory(g.__tsParticlesInternals.plugins.emittersShapes);g.__tsParticlesInternals.presets=__tsProxyFactory(g.__tsParticlesInternals.presets);g.__tsParticlesInternals.shapes=__tsProxyFactory(g.__tsParticlesInternals.shapes);g.__tsParticlesInternals.updaters=__tsProxyFactory(g.__tsParticlesInternals.updaters);g.__tsParticlesInternals.utils=__tsProxyFactory(g.__tsParticlesInternals.utils);g.__tsParticlesInternals.canvas=__tsProxyFactory(g.__tsParticlesInternals.canvas);g.__tsParticlesInternals.path=__tsProxyFactory(g.__tsParticlesInternals.path);g.tsparticlesInternalExports=g.tsparticlesInternalExports||{};})(typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:this);
|
|
2
|
-
/* Preset v4.0.
|
|
2
|
+
/* Preset v4.0.3 */
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
5
5
|
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
|
@@ -1012,7 +1012,7 @@
|
|
|
1012
1012
|
return this._domArray;
|
|
1013
1013
|
}
|
|
1014
1014
|
get version() {
|
|
1015
|
-
return "4.0.
|
|
1015
|
+
return "4.0.3";
|
|
1016
1016
|
}
|
|
1017
1017
|
addEventListener(type, listener) {
|
|
1018
1018
|
this._eventDispatcher.addEventListener(type, listener);
|
|
@@ -2839,6 +2839,58 @@
|
|
|
2839
2839
|
|
|
2840
2840
|
const tsParticles = initEngine();
|
|
2841
2841
|
|
|
2842
|
+
class Blend {
|
|
2843
|
+
enable;
|
|
2844
|
+
mode;
|
|
2845
|
+
constructor() {
|
|
2846
|
+
this.mode = "destination-out";
|
|
2847
|
+
this.enable = false;
|
|
2848
|
+
}
|
|
2849
|
+
load(data) {
|
|
2850
|
+
if (isNull(data)) {
|
|
2851
|
+
return;
|
|
2852
|
+
}
|
|
2853
|
+
if (data.mode !== undefined) {
|
|
2854
|
+
this.mode = data.mode;
|
|
2855
|
+
}
|
|
2856
|
+
if (data.enable !== undefined) {
|
|
2857
|
+
this.enable = data.enable;
|
|
2858
|
+
}
|
|
2859
|
+
}
|
|
2860
|
+
}
|
|
2861
|
+
|
|
2862
|
+
class BlendPlugin {
|
|
2863
|
+
id = "blend";
|
|
2864
|
+
async getPlugin(container) {
|
|
2865
|
+
const { BlendPluginInstance } = await Promise.resolve().then(function () { return BlendPluginInstance$1; });
|
|
2866
|
+
return new BlendPluginInstance(container);
|
|
2867
|
+
}
|
|
2868
|
+
loadOptions(_container, options, source) {
|
|
2869
|
+
if (!this.needsPlugin(options) && !this.needsPlugin(source)) {
|
|
2870
|
+
return;
|
|
2871
|
+
}
|
|
2872
|
+
let blendOptions = options.blend;
|
|
2873
|
+
if (!blendOptions?.load) {
|
|
2874
|
+
options.blend = blendOptions = new Blend();
|
|
2875
|
+
}
|
|
2876
|
+
blendOptions.load(source?.blend);
|
|
2877
|
+
}
|
|
2878
|
+
loadParticlesOptions(_container, options, source) {
|
|
2879
|
+
options.blend ??= new Blend();
|
|
2880
|
+
options.blend.load(source?.blend);
|
|
2881
|
+
}
|
|
2882
|
+
needsPlugin(options) {
|
|
2883
|
+
return !!options?.blend?.enable || !!options?.particles?.blend?.enable;
|
|
2884
|
+
}
|
|
2885
|
+
}
|
|
2886
|
+
|
|
2887
|
+
async function loadBlendPlugin(engine) {
|
|
2888
|
+
engine.checkVersion("4.0.3");
|
|
2889
|
+
await engine.pluginManager.register(e => {
|
|
2890
|
+
e.pluginManager.addPlugin(new BlendPlugin());
|
|
2891
|
+
});
|
|
2892
|
+
}
|
|
2893
|
+
|
|
2842
2894
|
const minAngle$1 = 0;
|
|
2843
2895
|
function drawCircle(data) {
|
|
2844
2896
|
const { context, particle, radius } = data;
|
|
@@ -2870,7 +2922,7 @@
|
|
|
2870
2922
|
}
|
|
2871
2923
|
|
|
2872
2924
|
async function loadCircleShape(engine) {
|
|
2873
|
-
engine.checkVersion("4.0.
|
|
2925
|
+
engine.checkVersion("4.0.3");
|
|
2874
2926
|
await engine.pluginManager.register(e => {
|
|
2875
2927
|
e.pluginManager.addShape(["circle"], () => {
|
|
2876
2928
|
return Promise.resolve(new CircleDrawer());
|
|
@@ -2918,7 +2970,7 @@
|
|
|
2918
2970
|
}
|
|
2919
2971
|
|
|
2920
2972
|
async function loadHexColorPlugin(engine) {
|
|
2921
|
-
engine.checkVersion("4.0.
|
|
2973
|
+
engine.checkVersion("4.0.3");
|
|
2922
2974
|
await engine.pluginManager.register(e => {
|
|
2923
2975
|
e.pluginManager.addColorManager("hex", new HexColorManager());
|
|
2924
2976
|
});
|
|
@@ -2971,7 +3023,7 @@
|
|
|
2971
3023
|
}
|
|
2972
3024
|
|
|
2973
3025
|
async function loadHslColorPlugin(engine) {
|
|
2974
|
-
engine.checkVersion("4.0.
|
|
3026
|
+
engine.checkVersion("4.0.3");
|
|
2975
3027
|
await engine.pluginManager.register(e => {
|
|
2976
3028
|
e.pluginManager.addColorManager("hsl", new HslColorManager());
|
|
2977
3029
|
});
|
|
@@ -2995,7 +3047,7 @@
|
|
|
2995
3047
|
}
|
|
2996
3048
|
|
|
2997
3049
|
async function loadMovePlugin(engine) {
|
|
2998
|
-
engine.checkVersion("4.0.
|
|
3050
|
+
engine.checkVersion("4.0.3");
|
|
2999
3051
|
await engine.pluginManager.register(e => {
|
|
3000
3052
|
const moveEngine = e, movePluginManager = moveEngine.pluginManager;
|
|
3001
3053
|
movePluginManager.initializers.pathGenerators ??= new Map();
|
|
@@ -3056,7 +3108,7 @@
|
|
|
3056
3108
|
}
|
|
3057
3109
|
|
|
3058
3110
|
async function loadOpacityUpdater(engine) {
|
|
3059
|
-
engine.checkVersion("4.0.
|
|
3111
|
+
engine.checkVersion("4.0.3");
|
|
3060
3112
|
await engine.pluginManager.register(e => {
|
|
3061
3113
|
e.pluginManager.addParticleUpdater("opacity", container => {
|
|
3062
3114
|
return Promise.resolve(new OpacityUpdater(container));
|
|
@@ -3408,7 +3460,7 @@
|
|
|
3408
3460
|
}
|
|
3409
3461
|
|
|
3410
3462
|
async function loadOutModesUpdater(engine) {
|
|
3411
|
-
engine.checkVersion("4.0.
|
|
3463
|
+
engine.checkVersion("4.0.3");
|
|
3412
3464
|
await engine.pluginManager.register(e => {
|
|
3413
3465
|
e.pluginManager.addParticleUpdater("outModes", container => {
|
|
3414
3466
|
return Promise.resolve(new OutOfCanvasUpdater(container));
|
|
@@ -3479,7 +3531,7 @@
|
|
|
3479
3531
|
}
|
|
3480
3532
|
|
|
3481
3533
|
async function loadPaintUpdater(engine) {
|
|
3482
|
-
engine.checkVersion("4.0.
|
|
3534
|
+
engine.checkVersion("4.0.3");
|
|
3483
3535
|
await engine.pluginManager.register(e => {
|
|
3484
3536
|
e.pluginManager.addParticleUpdater("paint", container => {
|
|
3485
3537
|
return Promise.resolve(new PaintUpdater(e.pluginManager, container));
|
|
@@ -3534,7 +3586,7 @@
|
|
|
3534
3586
|
}
|
|
3535
3587
|
|
|
3536
3588
|
async function loadRgbColorPlugin(engine) {
|
|
3537
|
-
engine.checkVersion("4.0.
|
|
3589
|
+
engine.checkVersion("4.0.3");
|
|
3538
3590
|
await engine.pluginManager.register(e => {
|
|
3539
3591
|
e.pluginManager.addColorManager("rgb", new RgbColorManager());
|
|
3540
3592
|
});
|
|
@@ -3577,7 +3629,7 @@
|
|
|
3577
3629
|
}
|
|
3578
3630
|
|
|
3579
3631
|
async function loadSizeUpdater(engine) {
|
|
3580
|
-
engine.checkVersion("4.0.
|
|
3632
|
+
engine.checkVersion("4.0.3");
|
|
3581
3633
|
await engine.pluginManager.register(e => {
|
|
3582
3634
|
e.pluginManager.addParticleUpdater("size", container => {
|
|
3583
3635
|
return Promise.resolve(new SizeUpdater(container));
|
|
@@ -3586,9 +3638,10 @@
|
|
|
3586
3638
|
}
|
|
3587
3639
|
|
|
3588
3640
|
async function loadBasic(engine) {
|
|
3589
|
-
engine.checkVersion("4.0.
|
|
3641
|
+
engine.checkVersion("4.0.3");
|
|
3590
3642
|
await engine.pluginManager.register(async (e) => {
|
|
3591
3643
|
await Promise.all([
|
|
3644
|
+
loadBlendPlugin(e),
|
|
3592
3645
|
loadHexColorPlugin(e),
|
|
3593
3646
|
loadHslColorPlugin(e),
|
|
3594
3647
|
loadRgbColorPlugin(e),
|
|
@@ -3955,7 +4008,7 @@
|
|
|
3955
4008
|
}
|
|
3956
4009
|
|
|
3957
4010
|
async function loadDestroyUpdater(engine) {
|
|
3958
|
-
engine.checkVersion("4.0.
|
|
4011
|
+
engine.checkVersion("4.0.3");
|
|
3959
4012
|
await engine.pluginManager.register(e => {
|
|
3960
4013
|
e.pluginManager.addParticleUpdater("destroy", container => {
|
|
3961
4014
|
return Promise.resolve(new DestroyUpdater(e.pluginManager, container));
|
|
@@ -4231,7 +4284,7 @@
|
|
|
4231
4284
|
})(EmitterClickMode || (EmitterClickMode = {}));
|
|
4232
4285
|
|
|
4233
4286
|
async function loadEmittersPluginSimple(engine) {
|
|
4234
|
-
engine.checkVersion("4.0.
|
|
4287
|
+
engine.checkVersion("4.0.3");
|
|
4235
4288
|
await engine.pluginManager.register(async (e) => {
|
|
4236
4289
|
const instancesManager = await getEmittersInstancesManager(e);
|
|
4237
4290
|
await addEmittersShapesManager(e);
|
|
@@ -4306,7 +4359,7 @@
|
|
|
4306
4359
|
}
|
|
4307
4360
|
|
|
4308
4361
|
async function loadTrailPlugin(engine) {
|
|
4309
|
-
engine.checkVersion("4.0.
|
|
4362
|
+
engine.checkVersion("4.0.3");
|
|
4310
4363
|
await engine.pluginManager.register(e => {
|
|
4311
4364
|
e.pluginManager.addPlugin(new TrailPlugin(e.pluginManager));
|
|
4312
4365
|
});
|
|
@@ -6492,6 +6545,44 @@
|
|
|
6492
6545
|
Container: Container
|
|
6493
6546
|
});
|
|
6494
6547
|
|
|
6548
|
+
class BlendPluginInstance {
|
|
6549
|
+
_container;
|
|
6550
|
+
_defaultCompositeValue;
|
|
6551
|
+
constructor(container) {
|
|
6552
|
+
this._container = container;
|
|
6553
|
+
}
|
|
6554
|
+
drawParticleCleanup(context, particle) {
|
|
6555
|
+
if (!particle.options.blend?.enable) {
|
|
6556
|
+
return;
|
|
6557
|
+
}
|
|
6558
|
+
context.globalCompositeOperation = particle.originalBlendMode ?? defaultCompositeValue;
|
|
6559
|
+
particle.originalBlendMode = undefined;
|
|
6560
|
+
}
|
|
6561
|
+
drawParticleSetup(context, particle) {
|
|
6562
|
+
if (!particle.options.blend?.enable) {
|
|
6563
|
+
return;
|
|
6564
|
+
}
|
|
6565
|
+
particle.originalBlendMode = context.globalCompositeOperation;
|
|
6566
|
+
context.globalCompositeOperation = particle.options.blend.mode;
|
|
6567
|
+
}
|
|
6568
|
+
drawSettingsCleanup(context) {
|
|
6569
|
+
if (!this._defaultCompositeValue) {
|
|
6570
|
+
return;
|
|
6571
|
+
}
|
|
6572
|
+
context.globalCompositeOperation = this._defaultCompositeValue;
|
|
6573
|
+
}
|
|
6574
|
+
drawSettingsSetup(context) {
|
|
6575
|
+
const previousComposite = context.globalCompositeOperation, blend = this._container.actualOptions.blend;
|
|
6576
|
+
this._defaultCompositeValue = previousComposite;
|
|
6577
|
+
context.globalCompositeOperation = blend?.enable ? blend.mode : previousComposite;
|
|
6578
|
+
}
|
|
6579
|
+
}
|
|
6580
|
+
|
|
6581
|
+
var BlendPluginInstance$1 = /*#__PURE__*/Object.freeze({
|
|
6582
|
+
__proto__: null,
|
|
6583
|
+
BlendPluginInstance: BlendPluginInstance
|
|
6584
|
+
});
|
|
6585
|
+
|
|
6495
6586
|
const minVelocity = 0, identity = 1, moveSpeedFactor = 60, minSpinRadius = 0, spinFactor = 0.01, defaultPathDelay = 0, noDecay = 1;
|
|
6496
6587
|
function applyDistance(particle) {
|
|
6497
6588
|
const initialPosition = particle.initialPosition, { dx, dy } = getDistances(initialPosition, particle.position), dxFixed = Math.abs(dx), dyFixed = Math.abs(dy), { maxDistance } = particle.retina, hDistance = maxDistance.horizontal, vDistance = maxDistance.vertical;
|