@tsparticles/preset-hyperspace 4.5.1 → 4.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,6 +1,6 @@
|
|
|
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);})(typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:this);
|
|
2
2
|
(function (g) {
|
|
3
|
-
/* Preset v4.5.
|
|
3
|
+
/* Preset v4.5.2 */
|
|
4
4
|
g.__tsParticlesInternals = g.__tsParticlesInternals || {};
|
|
5
5
|
g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
|
|
6
6
|
(function (exports) {
|
|
@@ -120,7 +120,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
|
|
|
120
120
|
}
|
|
121
121
|
normalize() {
|
|
122
122
|
const length = this.length;
|
|
123
|
-
if (length
|
|
123
|
+
if (length !== none) {
|
|
124
124
|
this.multTo(inverseFactorNumerator / length);
|
|
125
125
|
}
|
|
126
126
|
}
|
|
@@ -877,11 +877,13 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
|
|
|
877
877
|
#domArray = [];
|
|
878
878
|
#eventDispatcher = new EventDispatcher();
|
|
879
879
|
#initialized = false;
|
|
880
|
+
#loadSequence = 0;
|
|
881
|
+
#loadSequences = new Map();
|
|
880
882
|
get items() {
|
|
881
883
|
return this.#domArray;
|
|
882
884
|
}
|
|
883
885
|
get version() {
|
|
884
|
-
return "4.5.
|
|
886
|
+
return "4.5.2";
|
|
885
887
|
}
|
|
886
888
|
addEventListener(type, listener) {
|
|
887
889
|
this.#eventDispatcher.addEventListener(type, listener);
|
|
@@ -911,44 +913,60 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
|
|
|
911
913
|
return item;
|
|
912
914
|
}
|
|
913
915
|
async load(params) {
|
|
914
|
-
await this.init();
|
|
915
916
|
let domSourceElement;
|
|
916
917
|
if (typeof HTMLElement !== "undefined" && params.element instanceof HTMLElement) {
|
|
917
918
|
domSourceElement = params.element;
|
|
918
919
|
}
|
|
919
|
-
const
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
920
|
+
const id = params.id ?? domSourceElement?.id ?? `tsparticles${Math.floor(getRandom() * loadRandomFactor).toString()}`, loadSequence = ++this.#loadSequence;
|
|
921
|
+
this.#loadSequences.set(id, loadSequence);
|
|
922
|
+
try {
|
|
923
|
+
await this.init();
|
|
924
|
+
const { Container } = await Promise.resolve().then(function () { return Container$1; }), { index, url } = params, options = url ? await getDataFromUrl({ fallback: params.options, url, index }) : params.options;
|
|
925
|
+
if (this.#loadSequences.get(id) !== loadSequence) {
|
|
926
|
+
return undefined;
|
|
927
|
+
}
|
|
928
|
+
const currentOptions = itemFromSingleOrMultiple(options, index), { items } = this, oldIndex = items.findIndex(v => v.id.description === id), newItem = new Container({
|
|
929
|
+
dispatchCallback: (eventType, args) => {
|
|
930
|
+
this.dispatchEvent(eventType, args);
|
|
931
|
+
},
|
|
932
|
+
id,
|
|
933
|
+
onDestroy: (remove) => {
|
|
934
|
+
if (!remove) {
|
|
935
|
+
return;
|
|
936
|
+
}
|
|
937
|
+
const mainArr = this.items, idx = mainArr.indexOf(newItem);
|
|
938
|
+
if (idx >= removeMinIndex) {
|
|
939
|
+
mainArr.splice(idx, removeDeleteCount);
|
|
940
|
+
}
|
|
941
|
+
},
|
|
942
|
+
pluginManager: this.pluginManager,
|
|
943
|
+
sourceOptions: currentOptions,
|
|
944
|
+
});
|
|
945
|
+
if (oldIndex >= loadMinIndex) {
|
|
946
|
+
const old = this.item(oldIndex), deleteCount = old ? one : none;
|
|
947
|
+
if (old && !old.destroyed) {
|
|
948
|
+
old.destroy(false);
|
|
931
949
|
}
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
if (oldIndex >= loadMinIndex) {
|
|
937
|
-
const old = this.item(oldIndex), deleteCount = old ? one : none;
|
|
938
|
-
if (old && !old.destroyed) {
|
|
939
|
-
old.destroy(false);
|
|
950
|
+
items.splice(oldIndex, deleteCount, newItem);
|
|
951
|
+
}
|
|
952
|
+
else {
|
|
953
|
+
items.push(newItem);
|
|
940
954
|
}
|
|
941
|
-
|
|
955
|
+
const sourceCanvas = typeof OffscreenCanvas !== "undefined" && params.element instanceof OffscreenCanvas
|
|
956
|
+
? params.element
|
|
957
|
+
: getCanvasFromContainer(getDomContainer(id, domSourceElement));
|
|
958
|
+
newItem.canvas.loadCanvas(sourceCanvas);
|
|
959
|
+
await newItem.start();
|
|
960
|
+
if (newItem.destroyed) {
|
|
961
|
+
return undefined;
|
|
962
|
+
}
|
|
963
|
+
return newItem;
|
|
942
964
|
}
|
|
943
|
-
|
|
944
|
-
|
|
965
|
+
finally {
|
|
966
|
+
if (this.#loadSequences.get(id) === loadSequence) {
|
|
967
|
+
this.#loadSequences.delete(id);
|
|
968
|
+
}
|
|
945
969
|
}
|
|
946
|
-
const sourceCanvas = typeof OffscreenCanvas !== "undefined" && params.element instanceof OffscreenCanvas
|
|
947
|
-
? params.element
|
|
948
|
-
: getCanvasFromContainer(getDomContainer(id, domSourceElement));
|
|
949
|
-
newItem.canvas.loadCanvas(sourceCanvas);
|
|
950
|
-
await newItem.start();
|
|
951
|
-
return newItem;
|
|
952
970
|
}
|
|
953
971
|
async refresh(refresh = true) {
|
|
954
972
|
if (!refresh) {
|
|
@@ -2256,6 +2274,13 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
|
|
|
2256
2274
|
}
|
|
2257
2275
|
}
|
|
2258
2276
|
|
|
2277
|
+
function hasEnabledBlend(particleOptions) {
|
|
2278
|
+
if (!particleOptions || typeof particleOptions !== "object" || !("blend" in particleOptions)) {
|
|
2279
|
+
return false;
|
|
2280
|
+
}
|
|
2281
|
+
const blend = particleOptions.blend;
|
|
2282
|
+
return !!blend && typeof blend === "object" && "enable" in blend && !!blend.enable;
|
|
2283
|
+
}
|
|
2259
2284
|
class BlendPlugin {
|
|
2260
2285
|
id = "blend";
|
|
2261
2286
|
async getPlugin(container) {
|
|
@@ -2277,12 +2302,31 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
|
|
|
2277
2302
|
options.blend.load(source?.blend);
|
|
2278
2303
|
}
|
|
2279
2304
|
needsPlugin(options) {
|
|
2280
|
-
|
|
2305
|
+
if (options?.blend?.enable ||
|
|
2306
|
+
options?.particles?.blend?.enable ||
|
|
2307
|
+
Object.values(options?.particles?.groups ?? {}).some(hasEnabledBlend)) {
|
|
2308
|
+
return true;
|
|
2309
|
+
}
|
|
2310
|
+
const emitters = options?.["emitters"];
|
|
2311
|
+
let emitterList = [];
|
|
2312
|
+
if (Array.isArray(emitters)) {
|
|
2313
|
+
emitterList = emitters;
|
|
2314
|
+
}
|
|
2315
|
+
else if (emitters) {
|
|
2316
|
+
emitterList = [emitters];
|
|
2317
|
+
}
|
|
2318
|
+
return emitterList.some(emitter => {
|
|
2319
|
+
if (!emitter || typeof emitter !== "object" || !("particles" in emitter)) {
|
|
2320
|
+
return false;
|
|
2321
|
+
}
|
|
2322
|
+
const particles = emitter.particles;
|
|
2323
|
+
return Array.isArray(particles) ? particles.some(hasEnabledBlend) : hasEnabledBlend(particles);
|
|
2324
|
+
});
|
|
2281
2325
|
}
|
|
2282
2326
|
}
|
|
2283
2327
|
|
|
2284
2328
|
async function loadBlendPlugin(engine) {
|
|
2285
|
-
engine.checkVersion("4.5.
|
|
2329
|
+
engine.checkVersion("4.5.2");
|
|
2286
2330
|
await engine.pluginManager.register(e => {
|
|
2287
2331
|
e.pluginManager.addPlugin(new BlendPlugin());
|
|
2288
2332
|
});
|
|
@@ -2319,7 +2363,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
|
|
|
2319
2363
|
}
|
|
2320
2364
|
|
|
2321
2365
|
async function loadCircleShape(engine) {
|
|
2322
|
-
engine.checkVersion("4.5.
|
|
2366
|
+
engine.checkVersion("4.5.2");
|
|
2323
2367
|
await engine.pluginManager.register(e => {
|
|
2324
2368
|
e.pluginManager.addShape(["circle"], () => {
|
|
2325
2369
|
return Promise.resolve(new CircleDrawer());
|
|
@@ -2367,7 +2411,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
|
|
|
2367
2411
|
}
|
|
2368
2412
|
|
|
2369
2413
|
async function loadHexColorPlugin(engine) {
|
|
2370
|
-
engine.checkVersion("4.5.
|
|
2414
|
+
engine.checkVersion("4.5.2");
|
|
2371
2415
|
await engine.pluginManager.register(e => {
|
|
2372
2416
|
e.pluginManager.addColorManager("hex", new HexColorManager());
|
|
2373
2417
|
});
|
|
@@ -2420,7 +2464,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
|
|
|
2420
2464
|
}
|
|
2421
2465
|
|
|
2422
2466
|
async function loadHslColorPlugin(engine) {
|
|
2423
|
-
engine.checkVersion("4.5.
|
|
2467
|
+
engine.checkVersion("4.5.2");
|
|
2424
2468
|
await engine.pluginManager.register(e => {
|
|
2425
2469
|
e.pluginManager.addColorManager("hsl", new HslColorManager());
|
|
2426
2470
|
});
|
|
@@ -2452,7 +2496,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
|
|
|
2452
2496
|
}
|
|
2453
2497
|
|
|
2454
2498
|
async function loadMovePlugin(engine) {
|
|
2455
|
-
engine.checkVersion("4.5.
|
|
2499
|
+
engine.checkVersion("4.5.2");
|
|
2456
2500
|
if (typeof process !== "undefined" && process.env.NODE_ENV !== "production") {
|
|
2457
2501
|
addErrorMessages(ErrorMessages$1);
|
|
2458
2502
|
}
|
|
@@ -2662,7 +2706,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
|
|
|
2662
2706
|
}
|
|
2663
2707
|
|
|
2664
2708
|
async function loadOpacityUpdater(engine) {
|
|
2665
|
-
engine.checkVersion("4.5.
|
|
2709
|
+
engine.checkVersion("4.5.2");
|
|
2666
2710
|
await engine.pluginManager.register(e => {
|
|
2667
2711
|
e.pluginManager.addParticleUpdater("opacity", container => {
|
|
2668
2712
|
return Promise.resolve(new OpacityUpdater(container));
|
|
@@ -2991,7 +3035,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
|
|
|
2991
3035
|
}
|
|
2992
3036
|
|
|
2993
3037
|
async function loadOutModesUpdater(engine) {
|
|
2994
|
-
engine.checkVersion("4.5.
|
|
3038
|
+
engine.checkVersion("4.5.2");
|
|
2995
3039
|
await engine.pluginManager.register(e => {
|
|
2996
3040
|
e.pluginManager.addParticleUpdater("outModes", container => {
|
|
2997
3041
|
return Promise.resolve(new OutOfCanvasUpdater(container));
|
|
@@ -3070,7 +3114,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
|
|
|
3070
3114
|
}
|
|
3071
3115
|
|
|
3072
3116
|
async function loadPaintUpdater(engine) {
|
|
3073
|
-
engine.checkVersion("4.5.
|
|
3117
|
+
engine.checkVersion("4.5.2");
|
|
3074
3118
|
await engine.pluginManager.register(e => {
|
|
3075
3119
|
e.pluginManager.addParticleUpdater("paint", container => {
|
|
3076
3120
|
return Promise.resolve(new PaintUpdater(e.pluginManager, container));
|
|
@@ -3125,7 +3169,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
|
|
|
3125
3169
|
}
|
|
3126
3170
|
|
|
3127
3171
|
async function loadRgbColorPlugin(engine) {
|
|
3128
|
-
engine.checkVersion("4.5.
|
|
3172
|
+
engine.checkVersion("4.5.2");
|
|
3129
3173
|
await engine.pluginManager.register(e => {
|
|
3130
3174
|
e.pluginManager.addColorManager("rgb", new RgbColorManager());
|
|
3131
3175
|
});
|
|
@@ -3210,7 +3254,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
|
|
|
3210
3254
|
}
|
|
3211
3255
|
|
|
3212
3256
|
async function loadSizeUpdater(engine) {
|
|
3213
|
-
engine.checkVersion("4.5.
|
|
3257
|
+
engine.checkVersion("4.5.2");
|
|
3214
3258
|
await engine.pluginManager.register(e => {
|
|
3215
3259
|
e.pluginManager.addParticleUpdater("size", container => {
|
|
3216
3260
|
return Promise.resolve(new SizeUpdater(container));
|
|
@@ -3219,7 +3263,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
|
|
|
3219
3263
|
}
|
|
3220
3264
|
|
|
3221
3265
|
async function loadBasic(engine) {
|
|
3222
|
-
engine.checkVersion("4.5.
|
|
3266
|
+
engine.checkVersion("4.5.2");
|
|
3223
3267
|
await engine.pluginManager.register(async (e) => {
|
|
3224
3268
|
await Promise.all([
|
|
3225
3269
|
loadBlendPlugin(e),
|
|
@@ -3473,7 +3517,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
|
|
|
3473
3517
|
})(EmitterClickMode || (EmitterClickMode = {}));
|
|
3474
3518
|
|
|
3475
3519
|
async function loadEmittersPluginSimple(engine) {
|
|
3476
|
-
engine.checkVersion("4.5.
|
|
3520
|
+
engine.checkVersion("4.5.2");
|
|
3477
3521
|
if (typeof process !== "undefined" && process.env.NODE_ENV !== "production") {
|
|
3478
3522
|
addErrorMessages(ErrorMessages);
|
|
3479
3523
|
}
|
|
@@ -3622,7 +3666,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
|
|
|
3622
3666
|
}
|
|
3623
3667
|
|
|
3624
3668
|
async function loadEmittersShapeSquare(engine) {
|
|
3625
|
-
engine.checkVersion("4.5.
|
|
3669
|
+
engine.checkVersion("4.5.2");
|
|
3626
3670
|
await engine.pluginManager.register((e) => {
|
|
3627
3671
|
ensureEmittersPluginLoaded(e);
|
|
3628
3672
|
e.pluginManager.addEmitterShapeGenerator?.("square", new EmittersSquareShapeGenerator());
|
|
@@ -3766,7 +3810,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
|
|
|
3766
3810
|
}
|
|
3767
3811
|
|
|
3768
3812
|
async function loadLifeUpdater(engine) {
|
|
3769
|
-
engine.checkVersion("4.5.
|
|
3813
|
+
engine.checkVersion("4.5.2");
|
|
3770
3814
|
await engine.pluginManager.register(e => {
|
|
3771
3815
|
e.pluginManager.addParticleUpdater("life", container => {
|
|
3772
3816
|
return Promise.resolve(new LifeUpdater(container));
|
|
@@ -3830,7 +3874,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
|
|
|
3830
3874
|
}
|
|
3831
3875
|
|
|
3832
3876
|
async function loadTrailPlugin(engine) {
|
|
3833
|
-
engine.checkVersion("4.5.
|
|
3877
|
+
engine.checkVersion("4.5.2");
|
|
3834
3878
|
await engine.pluginManager.register(e => {
|
|
3835
3879
|
e.pluginManager.addPlugin(new TrailPlugin(e.pluginManager));
|
|
3836
3880
|
});
|
|
@@ -4081,7 +4125,8 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
|
|
|
4081
4125
|
});
|
|
4082
4126
|
}
|
|
4083
4127
|
drawParticles(delta) {
|
|
4084
|
-
const { particles, actualOptions } = this.#container
|
|
4128
|
+
const { particles, actualOptions } = this.#container;
|
|
4129
|
+
this.clear();
|
|
4085
4130
|
particles.update(delta);
|
|
4086
4131
|
this.draw(ctx => {
|
|
4087
4132
|
const width = this.#canvasManager.size.width, height = this.#canvasManager.size.height;
|
|
@@ -4103,9 +4148,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
|
|
|
4103
4148
|
}
|
|
4104
4149
|
}
|
|
4105
4150
|
for (const plugin of this.#getLayerPlugins(DrawLayer.BackgroundMask)) {
|
|
4106
|
-
|
|
4107
|
-
plugin.canvasPaint?.();
|
|
4108
|
-
}
|
|
4151
|
+
plugin.canvasPaint?.();
|
|
4109
4152
|
}
|
|
4110
4153
|
for (const plugin of this.#getLayerPlugins(DrawLayer.CanvasSetup)) {
|
|
4111
4154
|
plugin.drawSettingsSetup?.(ctx, delta);
|
|
@@ -4195,6 +4238,9 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
|
|
|
4195
4238
|
ctx.clearRect(originPoint.x, originPoint.y, this.#canvasManager.size.width, this.#canvasManager.size.height);
|
|
4196
4239
|
});
|
|
4197
4240
|
}
|
|
4241
|
+
updateBackgroundElement() {
|
|
4242
|
+
this.#resolveBackgroundElement();
|
|
4243
|
+
}
|
|
4198
4244
|
#applyPostDrawUpdaters(particle) {
|
|
4199
4245
|
for (const updater of this.#postDrawUpdaters) {
|
|
4200
4246
|
updater.afterDraw?.(particle);
|
|
@@ -4393,7 +4439,14 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
|
|
|
4393
4439
|
}
|
|
4394
4440
|
if (typeof background.element === "string") {
|
|
4395
4441
|
if (typeof document !== "undefined") {
|
|
4396
|
-
|
|
4442
|
+
let node;
|
|
4443
|
+
try {
|
|
4444
|
+
node = document.querySelector(background.element);
|
|
4445
|
+
}
|
|
4446
|
+
catch {
|
|
4447
|
+
this.#warnOnce("background-element-invalid-selector", `Background element selector "${background.element}" is invalid`);
|
|
4448
|
+
return;
|
|
4449
|
+
}
|
|
4397
4450
|
if (node && this.#isSupportedElement(node)) {
|
|
4398
4451
|
this.#backgroundElement = node;
|
|
4399
4452
|
}
|
|
@@ -5217,10 +5270,10 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
|
|
|
5217
5270
|
runParticleCreatedPlugins(container, this);
|
|
5218
5271
|
}
|
|
5219
5272
|
isInsideCanvas(direction) {
|
|
5220
|
-
return this.#getInsideCanvasResult(
|
|
5273
|
+
return this.#getInsideCanvasResult(direction).inside;
|
|
5221
5274
|
}
|
|
5222
5275
|
isInsideCanvasForOutMode(outMode, direction) {
|
|
5223
|
-
return this.#getInsideCanvasResult(
|
|
5276
|
+
return this.#getInsideCanvasResult(direction, outMode).inside;
|
|
5224
5277
|
}
|
|
5225
5278
|
isShowingBack() {
|
|
5226
5279
|
if (!this.roll) {
|
|
@@ -5337,7 +5390,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
|
|
|
5337
5390
|
});
|
|
5338
5391
|
}
|
|
5339
5392
|
#getDefaultInsideCanvasResult(direction, outMode) {
|
|
5340
|
-
const radius = this.getRadius(), canvasSize = this.#container.canvas.size, position = this.position, isBounce = outMode === OutMode.bounce;
|
|
5393
|
+
const radius = this.getRadius(), canvasSize = this.#container.canvas.size, position = this.position, isBounce = outMode === OutMode.bounce || outMode === OutMode.split;
|
|
5341
5394
|
if (direction === OutModeDirection.bottom) {
|
|
5342
5395
|
return {
|
|
5343
5396
|
inside: isBounce ? position.y + radius < canvasSize.height : position.y - radius < canvasSize.height,
|
|
@@ -5379,12 +5432,16 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
|
|
|
5379
5432
|
radius: this.getRadius(),
|
|
5380
5433
|
};
|
|
5381
5434
|
}
|
|
5382
|
-
#getInsideCanvasResult(
|
|
5383
|
-
const defaultResult = this.#getDefaultInsideCanvasResult(
|
|
5384
|
-
if (!
|
|
5435
|
+
#getInsideCanvasResult(direction, outMode) {
|
|
5436
|
+
const defaultResult = this.#getDefaultInsideCanvasResult(direction, outMode), container = this.#container, shapeDrawer = this.shape ? container.shapeDrawers.get(this.shape) : undefined, effectDrawer = this.effect ? container.effectDrawers.get(this.effect) : undefined;
|
|
5437
|
+
if (!shapeDrawer?.isInsideCanvas && !effectDrawer?.isInsideCanvas) {
|
|
5385
5438
|
return defaultResult;
|
|
5386
5439
|
}
|
|
5387
|
-
const callbackData = this.#getInsideCanvasCallbackData(
|
|
5440
|
+
const callbackData = this.#getInsideCanvasCallbackData(direction, outMode), shapeResult = shapeDrawer?.isInsideCanvas
|
|
5441
|
+
? this.#normalizeInsideCanvasResult(shapeDrawer.isInsideCanvas(callbackData), "shape")
|
|
5442
|
+
: undefined, effectResult = effectDrawer?.isInsideCanvas
|
|
5443
|
+
? this.#normalizeInsideCanvasResult(effectDrawer.isInsideCanvas(callbackData), "effect")
|
|
5444
|
+
: undefined;
|
|
5388
5445
|
if (shapeResult && effectResult) {
|
|
5389
5446
|
const margin = Math.max(shapeResult.margin ?? defaultAngle, effectResult.margin ?? defaultAngle);
|
|
5390
5447
|
return {
|
|
@@ -5450,8 +5507,8 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
|
|
|
5450
5507
|
}
|
|
5451
5508
|
|
|
5452
5509
|
class SpatialHashGrid {
|
|
5453
|
-
#cellSize;
|
|
5454
5510
|
#cells = new Map();
|
|
5511
|
+
#cellSize;
|
|
5455
5512
|
#circlePool = [];
|
|
5456
5513
|
#circlePoolIdx;
|
|
5457
5514
|
#pendingCellSize;
|
|
@@ -6109,8 +6166,8 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
|
|
|
6109
6166
|
particleCreatedPlugins;
|
|
6110
6167
|
particleDestroyedPlugins;
|
|
6111
6168
|
particlePositionPlugins;
|
|
6112
|
-
particleUpdaters;
|
|
6113
6169
|
particles;
|
|
6170
|
+
particleUpdaters;
|
|
6114
6171
|
peakNits;
|
|
6115
6172
|
plugins;
|
|
6116
6173
|
retina;
|
|
@@ -6404,6 +6461,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
|
|
|
6404
6461
|
refresh = plugin.updateActualOptions() || refresh;
|
|
6405
6462
|
}
|
|
6406
6463
|
}
|
|
6464
|
+
this.canvas.render.updateBackgroundElement();
|
|
6407
6465
|
return refresh;
|
|
6408
6466
|
}
|
|
6409
6467
|
#initPlugins(allContainerPlugins) {
|
|
@@ -6987,6 +7045,10 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
|
|
|
6987
7045
|
if (this.options.spawn.stroke?.color) {
|
|
6988
7046
|
this.spawnStrokeColor = rangeColorToHsl(this.#pluginManager, this.options.spawn.stroke.color);
|
|
6989
7047
|
}
|
|
7048
|
+
const spawnFill = this.options.spawn.fill, spawnStroke = this.options.spawn.stroke;
|
|
7049
|
+
this.spawnFillOpacity = spawnFill?.opacity === undefined ? defaultOpacity$1 : getRangeValue(spawnFill.opacity);
|
|
7050
|
+
this.spawnStrokeOpacity = spawnStroke?.opacity === undefined ? defaultOpacity$1 : getRangeValue(spawnStroke.opacity);
|
|
7051
|
+
this.spawnStrokeWidth = spawnStroke?.width === undefined ? defaultStrokeWidth : getRangeValue(spawnStroke.width);
|
|
6990
7052
|
this.#paused = !this.options.autoPlay;
|
|
6991
7053
|
this.#particlesOptions = particlesOptions;
|
|
6992
7054
|
this.#size = this.#calcSize();
|