@tsparticles/preset-bubbles 4.0.1 → 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),
|
|
@@ -3870,7 +3923,7 @@
|
|
|
3870
3923
|
})(EmitterClickMode || (EmitterClickMode = {}));
|
|
3871
3924
|
|
|
3872
3925
|
async function loadEmittersPluginSimple(engine) {
|
|
3873
|
-
engine.checkVersion("4.0.
|
|
3926
|
+
engine.checkVersion("4.0.3");
|
|
3874
3927
|
await engine.pluginManager.register(async (e) => {
|
|
3875
3928
|
const instancesManager = await getEmittersInstancesManager(e);
|
|
3876
3929
|
await addEmittersShapesManager(e);
|
|
@@ -6012,6 +6065,44 @@
|
|
|
6012
6065
|
Container: Container
|
|
6013
6066
|
});
|
|
6014
6067
|
|
|
6068
|
+
class BlendPluginInstance {
|
|
6069
|
+
_container;
|
|
6070
|
+
_defaultCompositeValue;
|
|
6071
|
+
constructor(container) {
|
|
6072
|
+
this._container = container;
|
|
6073
|
+
}
|
|
6074
|
+
drawParticleCleanup(context, particle) {
|
|
6075
|
+
if (!particle.options.blend?.enable) {
|
|
6076
|
+
return;
|
|
6077
|
+
}
|
|
6078
|
+
context.globalCompositeOperation = particle.originalBlendMode ?? defaultCompositeValue;
|
|
6079
|
+
particle.originalBlendMode = undefined;
|
|
6080
|
+
}
|
|
6081
|
+
drawParticleSetup(context, particle) {
|
|
6082
|
+
if (!particle.options.blend?.enable) {
|
|
6083
|
+
return;
|
|
6084
|
+
}
|
|
6085
|
+
particle.originalBlendMode = context.globalCompositeOperation;
|
|
6086
|
+
context.globalCompositeOperation = particle.options.blend.mode;
|
|
6087
|
+
}
|
|
6088
|
+
drawSettingsCleanup(context) {
|
|
6089
|
+
if (!this._defaultCompositeValue) {
|
|
6090
|
+
return;
|
|
6091
|
+
}
|
|
6092
|
+
context.globalCompositeOperation = this._defaultCompositeValue;
|
|
6093
|
+
}
|
|
6094
|
+
drawSettingsSetup(context) {
|
|
6095
|
+
const previousComposite = context.globalCompositeOperation, blend = this._container.actualOptions.blend;
|
|
6096
|
+
this._defaultCompositeValue = previousComposite;
|
|
6097
|
+
context.globalCompositeOperation = blend?.enable ? blend.mode : previousComposite;
|
|
6098
|
+
}
|
|
6099
|
+
}
|
|
6100
|
+
|
|
6101
|
+
var BlendPluginInstance$1 = /*#__PURE__*/Object.freeze({
|
|
6102
|
+
__proto__: null,
|
|
6103
|
+
BlendPluginInstance: BlendPluginInstance
|
|
6104
|
+
});
|
|
6105
|
+
|
|
6015
6106
|
const minVelocity = 0, identity = 1, moveSpeedFactor = 60, minSpinRadius = 0, spinFactor = 0.01, defaultPathDelay = 0, noDecay = 1;
|
|
6016
6107
|
function applyDistance(particle) {
|
|
6017
6108
|
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;
|