@tsparticles/preset-bubbles 3.0.0-beta.1 → 3.0.0-beta.4
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/package.json +8 -5
- package/report.html +5 -5
- package/tsparticles.preset.bubbles.bundle.js +744 -678
- package/tsparticles.preset.bubbles.bundle.min.js +1 -1
- package/tsparticles.preset.bubbles.bundle.min.js.LICENSE.txt +1 -1
- package/tsparticles.preset.bubbles.js +10 -72
- package/tsparticles.preset.bubbles.min.js +1 -1
- package/tsparticles.preset.bubbles.min.js.LICENSE.txt +1 -1
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Demo / Generator : https://particles.js.org/
|
|
5
5
|
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
6
|
* How to use? : Check the GitHub README
|
|
7
|
-
* v3.0.0-beta.
|
|
7
|
+
* v3.0.0-beta.4
|
|
8
8
|
*/
|
|
9
9
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
10
10
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
@@ -61,7 +61,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
61
61
|
tsParticles: () => (/* reexport */ tsParticles)
|
|
62
62
|
});
|
|
63
63
|
|
|
64
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
64
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Core/Utils/Constants.js
|
|
65
65
|
const generatedAttribute = "generated";
|
|
66
66
|
const mouseDownEvent = "pointerdown";
|
|
67
67
|
const mouseUpEvent = "pointerup";
|
|
@@ -76,7 +76,7 @@ const resizeEvent = "resize";
|
|
|
76
76
|
const visibilityChangeEvent = "visibilitychange";
|
|
77
77
|
const errorPrefix = "tsParticles - Error";
|
|
78
78
|
|
|
79
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
79
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Core/Utils/Vector3d.js
|
|
80
80
|
|
|
81
81
|
|
|
82
82
|
class Vector3d {
|
|
@@ -182,7 +182,7 @@ class Vector3d {
|
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
185
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Core/Utils/Vector.js
|
|
186
186
|
|
|
187
187
|
class Vector_Vector extends Vector3d {
|
|
188
188
|
constructor(xOrCoords, y) {
|
|
@@ -199,7 +199,7 @@ class Vector_Vector extends Vector3d {
|
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
201
|
|
|
202
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
202
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Utils/NumberUtils.js
|
|
203
203
|
|
|
204
204
|
|
|
205
205
|
let _random = Math.random;
|
|
@@ -233,7 +233,7 @@ function randomInRange(r) {
|
|
|
233
233
|
}
|
|
234
234
|
return getRandom() * (max - min) + min;
|
|
235
235
|
}
|
|
236
|
-
function
|
|
236
|
+
function NumberUtils_getRangeValue(value) {
|
|
237
237
|
return isNumber(value) ? value : randomInRange(value);
|
|
238
238
|
}
|
|
239
239
|
function getRangeMin(value) {
|
|
@@ -254,15 +254,6 @@ function setRangeValue(source, value) {
|
|
|
254
254
|
}
|
|
255
255
|
: setRangeValue(min, max);
|
|
256
256
|
}
|
|
257
|
-
function NumberUtils_getValue(options) {
|
|
258
|
-
const random = options.random, { enable, minimumValue } = isBoolean(random)
|
|
259
|
-
? {
|
|
260
|
-
enable: random,
|
|
261
|
-
minimumValue: 0,
|
|
262
|
-
}
|
|
263
|
-
: random;
|
|
264
|
-
return enable ? getRangeValue(setRangeValue(options.value, minimumValue)) : getRangeValue(options.value);
|
|
265
|
-
}
|
|
266
257
|
function NumberUtils_getDistances(pointA, pointB) {
|
|
267
258
|
const dx = pointA.x - pointB.x, dy = pointA.y - pointB.y;
|
|
268
259
|
return { dx: dx, dy: dy, distance: Math.sqrt(dx ** 2 + dy ** 2) };
|
|
@@ -276,21 +267,21 @@ function getParticleDirectionAngle(direction, position, center) {
|
|
|
276
267
|
}
|
|
277
268
|
switch (direction) {
|
|
278
269
|
case "top":
|
|
279
|
-
return -Math.PI
|
|
270
|
+
return -Math.PI * 0.5;
|
|
280
271
|
case "top-right":
|
|
281
|
-
return -Math.PI
|
|
272
|
+
return -Math.PI * 0.25;
|
|
282
273
|
case "right":
|
|
283
274
|
return 0;
|
|
284
275
|
case "bottom-right":
|
|
285
|
-
return Math.PI
|
|
276
|
+
return Math.PI * 0.25;
|
|
286
277
|
case "bottom":
|
|
287
|
-
return Math.PI
|
|
278
|
+
return Math.PI * 0.5;
|
|
288
279
|
case "bottom-left":
|
|
289
|
-
return
|
|
280
|
+
return Math.PI * 0.75;
|
|
290
281
|
case "left":
|
|
291
282
|
return Math.PI;
|
|
292
283
|
case "top-left":
|
|
293
|
-
return
|
|
284
|
+
return -Math.PI * 0.75;
|
|
294
285
|
case "inside":
|
|
295
286
|
return Math.atan2(center.y - position.y, center.x - position.x);
|
|
296
287
|
case "outside":
|
|
@@ -324,8 +315,8 @@ function calcPositionOrRandomFromSize(data) {
|
|
|
324
315
|
}
|
|
325
316
|
function calcPositionOrRandomFromSizeRanged(data) {
|
|
326
317
|
const position = {
|
|
327
|
-
x: data.position?.x !== undefined ?
|
|
328
|
-
y: data.position?.y !== undefined ?
|
|
318
|
+
x: data.position?.x !== undefined ? NumberUtils_getRangeValue(data.position.x) : undefined,
|
|
319
|
+
y: data.position?.y !== undefined ? NumberUtils_getRangeValue(data.position.y) : undefined,
|
|
329
320
|
};
|
|
330
321
|
return calcPositionOrRandomFromSize({ size: data.size, position });
|
|
331
322
|
}
|
|
@@ -337,8 +328,8 @@ function calcExactPositionOrRandomFromSize(data) {
|
|
|
337
328
|
}
|
|
338
329
|
function calcExactPositionOrRandomFromSizeRanged(data) {
|
|
339
330
|
const position = {
|
|
340
|
-
x: data.position?.x !== undefined ?
|
|
341
|
-
y: data.position?.y !== undefined ?
|
|
331
|
+
x: data.position?.x !== undefined ? NumberUtils_getRangeValue(data.position.x) : undefined,
|
|
332
|
+
y: data.position?.y !== undefined ? NumberUtils_getRangeValue(data.position.y) : undefined,
|
|
342
333
|
};
|
|
343
334
|
return calcExactPositionOrRandomFromSize({ size: data.size, position });
|
|
344
335
|
}
|
|
@@ -346,7 +337,7 @@ function parseAlpha(input) {
|
|
|
346
337
|
return input ? (input.endsWith("%") ? parseFloat(input) / 100 : parseFloat(input)) : 1;
|
|
347
338
|
}
|
|
348
339
|
|
|
349
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
340
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Utils/Utils.js
|
|
350
341
|
|
|
351
342
|
|
|
352
343
|
const _logger = {
|
|
@@ -376,8 +367,8 @@ function rectSideBounce(data) {
|
|
|
376
367
|
pOtherSide.max > rectOtherSide.max) {
|
|
377
368
|
return res;
|
|
378
369
|
}
|
|
379
|
-
if ((pSide.max >= rectSide.min && pSide.max <= (rectSide.max + rectSide.min)
|
|
380
|
-
(pSide.min <= rectSide.max && pSide.min > (rectSide.max + rectSide.min)
|
|
370
|
+
if ((pSide.max >= rectSide.min && pSide.max <= (rectSide.max + rectSide.min) * 0.5 && velocity > 0) ||
|
|
371
|
+
(pSide.min <= rectSide.max && pSide.min > (rectSide.max + rectSide.min) * 0.5 && velocity < 0)) {
|
|
381
372
|
res.velocity = velocity * -factor;
|
|
382
373
|
res.bounced = true;
|
|
383
374
|
}
|
|
@@ -401,6 +392,12 @@ function safeMatchMedia(query) {
|
|
|
401
392
|
}
|
|
402
393
|
return matchMedia(query);
|
|
403
394
|
}
|
|
395
|
+
function safeIntersectionObserver(callback) {
|
|
396
|
+
if (isSsr() || typeof IntersectionObserver === "undefined") {
|
|
397
|
+
return;
|
|
398
|
+
}
|
|
399
|
+
return new IntersectionObserver(callback);
|
|
400
|
+
}
|
|
404
401
|
function safeMutationObserver(callback) {
|
|
405
402
|
if (isSsr() || typeof MutationObserver === "undefined") {
|
|
406
403
|
return;
|
|
@@ -510,7 +507,7 @@ function circleBounceDataFromParticle(p) {
|
|
|
510
507
|
radius: p.getRadius(),
|
|
511
508
|
mass: p.getMass(),
|
|
512
509
|
velocity: p.velocity,
|
|
513
|
-
factor: Vector.create(
|
|
510
|
+
factor: Vector.create(getRangeValue(p.options.bounce.horizontal.value), getRangeValue(p.options.bounce.vertical.value)),
|
|
514
511
|
};
|
|
515
512
|
}
|
|
516
513
|
function circleBounce(p1, p2) {
|
|
@@ -525,7 +522,7 @@ function circleBounce(p1, p2) {
|
|
|
525
522
|
p2.velocity.y = vFinal2.y * p2.factor.y;
|
|
526
523
|
}
|
|
527
524
|
function rectBounce(particle, divBounds) {
|
|
528
|
-
const pPos = particle.getPosition(), size = particle.getRadius(), bounds = calculateBounds(pPos, size), resH = rectSideBounce({
|
|
525
|
+
const pPos = particle.getPosition(), size = particle.getRadius(), bounds = calculateBounds(pPos, size), bounceOptions = particle.options.bounce, resH = rectSideBounce({
|
|
529
526
|
pSide: {
|
|
530
527
|
min: bounds.left,
|
|
531
528
|
max: bounds.right,
|
|
@@ -543,7 +540,7 @@ function rectBounce(particle, divBounds) {
|
|
|
543
540
|
max: divBounds.bottom,
|
|
544
541
|
},
|
|
545
542
|
velocity: particle.velocity.x,
|
|
546
|
-
factor:
|
|
543
|
+
factor: getRangeValue(bounceOptions.horizontal.value),
|
|
547
544
|
});
|
|
548
545
|
if (resH.bounced) {
|
|
549
546
|
if (resH.velocity !== undefined) {
|
|
@@ -571,7 +568,7 @@ function rectBounce(particle, divBounds) {
|
|
|
571
568
|
max: divBounds.right,
|
|
572
569
|
},
|
|
573
570
|
velocity: particle.velocity.y,
|
|
574
|
-
factor:
|
|
571
|
+
factor: getRangeValue(bounceOptions.vertical.value),
|
|
575
572
|
});
|
|
576
573
|
if (resV.bounced) {
|
|
577
574
|
if (resV.velocity !== undefined) {
|
|
@@ -593,17 +590,17 @@ function findItemFromSingleOrMultiple(obj, callback) {
|
|
|
593
590
|
}
|
|
594
591
|
function initParticleNumericAnimationValue(options, pxRatio) {
|
|
595
592
|
const valueRange = options.value, animationOptions = options.animation, res = {
|
|
596
|
-
delayTime:
|
|
593
|
+
delayTime: NumberUtils_getRangeValue(animationOptions.delay) * 1000,
|
|
597
594
|
enable: animationOptions.enable,
|
|
598
|
-
value:
|
|
595
|
+
value: NumberUtils_getRangeValue(options.value) * pxRatio,
|
|
599
596
|
max: getRangeMax(valueRange) * pxRatio,
|
|
600
597
|
min: getRangeMin(valueRange) * pxRatio,
|
|
601
598
|
loops: 0,
|
|
602
|
-
maxLoops:
|
|
599
|
+
maxLoops: NumberUtils_getRangeValue(animationOptions.count),
|
|
603
600
|
time: 0,
|
|
604
601
|
};
|
|
605
602
|
if (animationOptions.enable) {
|
|
606
|
-
res.decay = 1 -
|
|
603
|
+
res.decay = 1 - NumberUtils_getRangeValue(animationOptions.decay);
|
|
607
604
|
switch (animationOptions.mode) {
|
|
608
605
|
case "increase":
|
|
609
606
|
res.status = "increasing";
|
|
@@ -686,31 +683,13 @@ function isArray(arg) {
|
|
|
686
683
|
return Array.isArray(arg);
|
|
687
684
|
}
|
|
688
685
|
|
|
689
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
686
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Utils/ColorUtils.js
|
|
690
687
|
|
|
691
688
|
|
|
692
689
|
const randomColorValue = "random", midColorValue = "mid", colorManagers = new Map();
|
|
693
690
|
function addColorManager(manager) {
|
|
694
691
|
colorManagers.set(manager.key, manager);
|
|
695
692
|
}
|
|
696
|
-
function hue2rgb(p, q, t) {
|
|
697
|
-
if (t < 0) {
|
|
698
|
-
t += 1;
|
|
699
|
-
}
|
|
700
|
-
if (t > 1) {
|
|
701
|
-
t -= 1;
|
|
702
|
-
}
|
|
703
|
-
if (t < 1 / 6) {
|
|
704
|
-
return p + (q - p) * 6 * t;
|
|
705
|
-
}
|
|
706
|
-
if (t < 1 / 2) {
|
|
707
|
-
return q;
|
|
708
|
-
}
|
|
709
|
-
if (t < 2 / 3) {
|
|
710
|
-
return p + (q - p) * (2 / 3 - t) * 6;
|
|
711
|
-
}
|
|
712
|
-
return p;
|
|
713
|
-
}
|
|
714
693
|
function stringToRgba(input) {
|
|
715
694
|
for (const [, manager] of colorManagers) {
|
|
716
695
|
if (input.startsWith(manager.stringPrefix)) {
|
|
@@ -780,7 +759,7 @@ function rangeColorToHsl(color, index, useIndex = true) {
|
|
|
780
759
|
function rgbToHsl(color) {
|
|
781
760
|
const r1 = color.r / 255, g1 = color.g / 255, b1 = color.b / 255, max = Math.max(r1, g1, b1), min = Math.min(r1, g1, b1), res = {
|
|
782
761
|
h: 0,
|
|
783
|
-
l: (max + min)
|
|
762
|
+
l: (max + min) * 0.5,
|
|
784
763
|
s: 0,
|
|
785
764
|
};
|
|
786
765
|
if (max !== min) {
|
|
@@ -808,26 +787,30 @@ function stringToRgb(input) {
|
|
|
808
787
|
return stringToRgba(input);
|
|
809
788
|
}
|
|
810
789
|
function hslToRgb(hsl) {
|
|
811
|
-
const
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
};
|
|
816
|
-
if (!hslPercent.s) {
|
|
817
|
-
result.r = result.g = result.b = hslPercent.l;
|
|
790
|
+
const h = ((hsl.h % 360) + 360) % 360, s = Math.max(0, Math.min(100, hsl.s)), l = Math.max(0, Math.min(100, hsl.l)), hNormalized = h / 360, sNormalized = s / 100, lNormalized = l / 100;
|
|
791
|
+
if (s === 0) {
|
|
792
|
+
const grayscaleValue = Math.round(lNormalized * 255);
|
|
793
|
+
return { r: grayscaleValue, g: grayscaleValue, b: grayscaleValue };
|
|
818
794
|
}
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
795
|
+
const channel = (temp1, temp2, temp3) => {
|
|
796
|
+
if (temp3 < 0) {
|
|
797
|
+
temp3 += 1;
|
|
798
|
+
}
|
|
799
|
+
if (temp3 > 1) {
|
|
800
|
+
temp3 -= 1;
|
|
801
|
+
}
|
|
802
|
+
if (temp3 * 6 < 1) {
|
|
803
|
+
return temp1 + (temp2 - temp1) * 6 * temp3;
|
|
804
|
+
}
|
|
805
|
+
if (temp3 * 2 < 1) {
|
|
806
|
+
return temp2;
|
|
807
|
+
}
|
|
808
|
+
if (temp3 * 3 < 2) {
|
|
809
|
+
return temp1 + (temp2 - temp1) * (2 / 3 - temp3) * 6;
|
|
810
|
+
}
|
|
811
|
+
return temp1;
|
|
812
|
+
}, temp1 = lNormalized < 0.5 ? lNormalized * (1 + sNormalized) : lNormalized + sNormalized - lNormalized * sNormalized, temp2 = 2 * lNormalized - temp1, red = Math.min(255, 255 * channel(temp2, temp1, hNormalized + 1 / 3)), green = Math.min(255, 255 * channel(temp2, temp1, hNormalized)), blue = Math.min(255, 255 * channel(temp2, temp1, hNormalized - 1 / 3));
|
|
813
|
+
return { r: Math.round(red), g: Math.round(green), b: Math.round(blue) };
|
|
831
814
|
}
|
|
832
815
|
function hslaToRgba(hsla) {
|
|
833
816
|
const rgbResult = hslToRgb(hsla);
|
|
@@ -942,13 +925,13 @@ function getHslAnimationFromHsl(hsl, animationOptions, reduceFactor) {
|
|
|
942
925
|
function setColorAnimation(colorValue, colorAnimation, reduceFactor) {
|
|
943
926
|
colorValue.enable = colorAnimation.enable;
|
|
944
927
|
if (colorValue.enable) {
|
|
945
|
-
colorValue.velocity = (
|
|
946
|
-
colorValue.decay = 1 -
|
|
928
|
+
colorValue.velocity = (NumberUtils_getRangeValue(colorAnimation.speed) / 100) * reduceFactor;
|
|
929
|
+
colorValue.decay = 1 - NumberUtils_getRangeValue(colorAnimation.decay);
|
|
947
930
|
colorValue.status = "increasing";
|
|
948
931
|
colorValue.loops = 0;
|
|
949
|
-
colorValue.maxLoops =
|
|
932
|
+
colorValue.maxLoops = NumberUtils_getRangeValue(colorAnimation.count);
|
|
950
933
|
colorValue.time = 0;
|
|
951
|
-
colorValue.delayTime =
|
|
934
|
+
colorValue.delayTime = NumberUtils_getRangeValue(colorAnimation.delay) * 1000;
|
|
952
935
|
if (!colorAnimation.sync) {
|
|
953
936
|
colorValue.velocity *= getRandom();
|
|
954
937
|
colorValue.value *= getRandom();
|
|
@@ -960,7 +943,7 @@ function setColorAnimation(colorValue, colorAnimation, reduceFactor) {
|
|
|
960
943
|
}
|
|
961
944
|
}
|
|
962
945
|
|
|
963
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
946
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Utils/CanvasUtils.js
|
|
964
947
|
|
|
965
948
|
function drawLine(context, begin, end) {
|
|
966
949
|
context.beginPath();
|
|
@@ -968,13 +951,6 @@ function drawLine(context, begin, end) {
|
|
|
968
951
|
context.lineTo(end.x, end.y);
|
|
969
952
|
context.closePath();
|
|
970
953
|
}
|
|
971
|
-
function drawTriangle(context, p1, p2, p3) {
|
|
972
|
-
context.beginPath();
|
|
973
|
-
context.moveTo(p1.x, p1.y);
|
|
974
|
-
context.lineTo(p2.x, p2.y);
|
|
975
|
-
context.lineTo(p3.x, p3.y);
|
|
976
|
-
context.closePath();
|
|
977
|
-
}
|
|
978
954
|
function paintBase(context, dimension, baseColor) {
|
|
979
955
|
context.fillStyle = baseColor ?? "rgba(0,0,0,0)";
|
|
980
956
|
context.fillRect(0, 0, dimension.width, dimension.height);
|
|
@@ -1002,7 +978,6 @@ function drawParticle(data) {
|
|
|
1002
978
|
d: rotateData.cos * (transform.d ?? 1),
|
|
1003
979
|
};
|
|
1004
980
|
context.setTransform(transformData.a, transformData.b, transformData.c, transformData.d, pos.x, pos.y);
|
|
1005
|
-
context.beginPath();
|
|
1006
981
|
if (backgroundMask) {
|
|
1007
982
|
context.globalCompositeOperation = composite;
|
|
1008
983
|
}
|
|
@@ -1021,39 +996,55 @@ function drawParticle(data) {
|
|
|
1021
996
|
if (colorStyles.stroke) {
|
|
1022
997
|
context.strokeStyle = colorStyles.stroke;
|
|
1023
998
|
}
|
|
1024
|
-
|
|
999
|
+
const drawData = { container, context, particle, radius, opacity, delta };
|
|
1000
|
+
context.beginPath();
|
|
1001
|
+
drawShape(drawData);
|
|
1002
|
+
if (particle.shapeClose) {
|
|
1003
|
+
context.closePath();
|
|
1004
|
+
}
|
|
1025
1005
|
if (strokeWidth > 0) {
|
|
1026
1006
|
context.stroke();
|
|
1027
1007
|
}
|
|
1028
|
-
if (particle.
|
|
1029
|
-
context.closePath();
|
|
1030
|
-
}
|
|
1031
|
-
if (particle.fill) {
|
|
1008
|
+
if (particle.shapeFill) {
|
|
1032
1009
|
context.fill();
|
|
1033
1010
|
}
|
|
1034
|
-
|
|
1011
|
+
drawShapeAfterDraw(drawData);
|
|
1012
|
+
drawEffect(drawData);
|
|
1035
1013
|
context.globalCompositeOperation = "source-over";
|
|
1036
1014
|
context.setTransform(1, 0, 0, 1, 0, 0);
|
|
1037
1015
|
}
|
|
1038
|
-
function
|
|
1016
|
+
function drawEffect(data) {
|
|
1017
|
+
const { container, context, particle, radius, opacity, delta } = data;
|
|
1018
|
+
if (!particle.effect) {
|
|
1019
|
+
return;
|
|
1020
|
+
}
|
|
1021
|
+
const drawer = container.effectDrawers.get(particle.effect);
|
|
1022
|
+
if (!drawer) {
|
|
1023
|
+
return;
|
|
1024
|
+
}
|
|
1025
|
+
drawer.draw({ context, particle, radius, opacity, delta, pixelRatio: container.retina.pixelRatio });
|
|
1026
|
+
}
|
|
1027
|
+
function drawShape(data) {
|
|
1028
|
+
const { container, context, particle, radius, opacity, delta } = data;
|
|
1039
1029
|
if (!particle.shape) {
|
|
1040
1030
|
return;
|
|
1041
1031
|
}
|
|
1042
|
-
const drawer = container.
|
|
1032
|
+
const drawer = container.shapeDrawers.get(particle.shape);
|
|
1043
1033
|
if (!drawer) {
|
|
1044
1034
|
return;
|
|
1045
1035
|
}
|
|
1046
|
-
drawer.draw(context, particle, radius, opacity, delta, container.retina.pixelRatio);
|
|
1036
|
+
drawer.draw({ context, particle, radius, opacity, delta, pixelRatio: container.retina.pixelRatio });
|
|
1047
1037
|
}
|
|
1048
|
-
function
|
|
1038
|
+
function drawShapeAfterDraw(data) {
|
|
1039
|
+
const { container, context, particle, radius, opacity, delta } = data;
|
|
1049
1040
|
if (!particle.shape) {
|
|
1050
1041
|
return;
|
|
1051
1042
|
}
|
|
1052
|
-
const drawer = container.
|
|
1053
|
-
if (!drawer || !drawer.
|
|
1043
|
+
const drawer = container.shapeDrawers.get(particle.shape);
|
|
1044
|
+
if (!drawer || !drawer.afterDraw) {
|
|
1054
1045
|
return;
|
|
1055
1046
|
}
|
|
1056
|
-
drawer.
|
|
1047
|
+
drawer.afterDraw({ context, particle, radius, opacity, delta, pixelRatio: container.retina.pixelRatio });
|
|
1057
1048
|
}
|
|
1058
1049
|
function drawPlugin(context, plugin, delta) {
|
|
1059
1050
|
if (!plugin.draw) {
|
|
@@ -1075,7 +1066,7 @@ function alterHsl(color, type, value) {
|
|
|
1075
1066
|
};
|
|
1076
1067
|
}
|
|
1077
1068
|
|
|
1078
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
1069
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Core/Canvas.js
|
|
1079
1070
|
|
|
1080
1071
|
|
|
1081
1072
|
|
|
@@ -1480,10 +1471,10 @@ class Canvas {
|
|
|
1480
1471
|
this.element.width = size.width = this.element.offsetWidth * pxRatio;
|
|
1481
1472
|
this.element.height = size.height = this.element.offsetHeight * pxRatio;
|
|
1482
1473
|
if (this.container.started) {
|
|
1483
|
-
|
|
1474
|
+
container.particles.setResizeFactor({
|
|
1484
1475
|
width: size.width / oldSize.width,
|
|
1485
1476
|
height: size.height / oldSize.height,
|
|
1486
|
-
};
|
|
1477
|
+
});
|
|
1487
1478
|
}
|
|
1488
1479
|
return true;
|
|
1489
1480
|
}
|
|
@@ -1505,7 +1496,7 @@ class Canvas {
|
|
|
1505
1496
|
}
|
|
1506
1497
|
}
|
|
1507
1498
|
|
|
1508
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
1499
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Core/Utils/EventListeners.js
|
|
1509
1500
|
|
|
1510
1501
|
|
|
1511
1502
|
function manageListener(element, event, handler, add, options) {
|
|
@@ -1826,7 +1817,7 @@ class EventListeners {
|
|
|
1826
1817
|
}
|
|
1827
1818
|
}
|
|
1828
1819
|
|
|
1829
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
1820
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/OptionsColor.js
|
|
1830
1821
|
|
|
1831
1822
|
class OptionsColor {
|
|
1832
1823
|
constructor() {
|
|
@@ -1853,7 +1844,7 @@ class OptionsColor {
|
|
|
1853
1844
|
}
|
|
1854
1845
|
}
|
|
1855
1846
|
|
|
1856
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
1847
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/Background/Background.js
|
|
1857
1848
|
|
|
1858
1849
|
class Background {
|
|
1859
1850
|
constructor() {
|
|
@@ -1890,7 +1881,7 @@ class Background {
|
|
|
1890
1881
|
}
|
|
1891
1882
|
}
|
|
1892
1883
|
|
|
1893
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
1884
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/BackgroundMask/BackgroundMaskCover.js
|
|
1894
1885
|
|
|
1895
1886
|
class BackgroundMaskCover {
|
|
1896
1887
|
constructor() {
|
|
@@ -1911,7 +1902,7 @@ class BackgroundMaskCover {
|
|
|
1911
1902
|
}
|
|
1912
1903
|
}
|
|
1913
1904
|
|
|
1914
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
1905
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/BackgroundMask/BackgroundMask.js
|
|
1915
1906
|
|
|
1916
1907
|
|
|
1917
1908
|
class BackgroundMask {
|
|
@@ -1928,8 +1919,7 @@ class BackgroundMask {
|
|
|
1928
1919
|
this.composite = data.composite;
|
|
1929
1920
|
}
|
|
1930
1921
|
if (data.cover !== undefined) {
|
|
1931
|
-
const cover = data.cover;
|
|
1932
|
-
const color = (Utils_isString(data.cover) ? { color: data.cover } : data.cover);
|
|
1922
|
+
const cover = data.cover, color = (Utils_isString(data.cover) ? { color: data.cover } : data.cover);
|
|
1933
1923
|
this.cover.load(cover.color !== undefined ? cover : { color: color });
|
|
1934
1924
|
}
|
|
1935
1925
|
if (data.enable !== undefined) {
|
|
@@ -1938,7 +1928,7 @@ class BackgroundMask {
|
|
|
1938
1928
|
}
|
|
1939
1929
|
}
|
|
1940
1930
|
|
|
1941
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
1931
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/FullScreen/FullScreen.js
|
|
1942
1932
|
class FullScreen {
|
|
1943
1933
|
constructor() {
|
|
1944
1934
|
this.enable = true;
|
|
@@ -1957,7 +1947,7 @@ class FullScreen {
|
|
|
1957
1947
|
}
|
|
1958
1948
|
}
|
|
1959
1949
|
|
|
1960
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
1950
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/Interactivity/Events/ClickEvent.js
|
|
1961
1951
|
class ClickEvent {
|
|
1962
1952
|
constructor() {
|
|
1963
1953
|
this.enable = false;
|
|
@@ -1976,7 +1966,7 @@ class ClickEvent {
|
|
|
1976
1966
|
}
|
|
1977
1967
|
}
|
|
1978
1968
|
|
|
1979
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
1969
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/Interactivity/Events/DivEvent.js
|
|
1980
1970
|
class DivEvent {
|
|
1981
1971
|
constructor() {
|
|
1982
1972
|
this.selectors = [];
|
|
@@ -2003,7 +1993,7 @@ class DivEvent {
|
|
|
2003
1993
|
}
|
|
2004
1994
|
}
|
|
2005
1995
|
|
|
2006
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
1996
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/Interactivity/Events/Parallax.js
|
|
2007
1997
|
class Parallax {
|
|
2008
1998
|
constructor() {
|
|
2009
1999
|
this.enable = false;
|
|
@@ -2026,7 +2016,7 @@ class Parallax {
|
|
|
2026
2016
|
}
|
|
2027
2017
|
}
|
|
2028
2018
|
|
|
2029
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
2019
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/Interactivity/Events/HoverEvent.js
|
|
2030
2020
|
|
|
2031
2021
|
class HoverEvent {
|
|
2032
2022
|
constructor() {
|
|
@@ -2048,7 +2038,7 @@ class HoverEvent {
|
|
|
2048
2038
|
}
|
|
2049
2039
|
}
|
|
2050
2040
|
|
|
2051
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
2041
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/Interactivity/Events/ResizeEvent.js
|
|
2052
2042
|
class ResizeEvent {
|
|
2053
2043
|
constructor() {
|
|
2054
2044
|
this.delay = 0.5;
|
|
@@ -2067,7 +2057,7 @@ class ResizeEvent {
|
|
|
2067
2057
|
}
|
|
2068
2058
|
}
|
|
2069
2059
|
|
|
2070
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
2060
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/Interactivity/Events/Events.js
|
|
2071
2061
|
|
|
2072
2062
|
|
|
2073
2063
|
|
|
@@ -2103,7 +2093,7 @@ class Events {
|
|
|
2103
2093
|
}
|
|
2104
2094
|
}
|
|
2105
2095
|
|
|
2106
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
2096
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/Interactivity/Modes/Modes.js
|
|
2107
2097
|
class Modes {
|
|
2108
2098
|
constructor(engine, container) {
|
|
2109
2099
|
this._engine = engine;
|
|
@@ -2129,7 +2119,7 @@ class Modes {
|
|
|
2129
2119
|
}
|
|
2130
2120
|
}
|
|
2131
2121
|
|
|
2132
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
2122
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/Interactivity/Interactivity.js
|
|
2133
2123
|
|
|
2134
2124
|
|
|
2135
2125
|
class Interactivity {
|
|
@@ -2151,7 +2141,7 @@ class Interactivity {
|
|
|
2151
2141
|
}
|
|
2152
2142
|
}
|
|
2153
2143
|
|
|
2154
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
2144
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/ManualParticle.js
|
|
2155
2145
|
|
|
2156
2146
|
class ManualParticle {
|
|
2157
2147
|
load(data) {
|
|
@@ -2171,7 +2161,7 @@ class ManualParticle {
|
|
|
2171
2161
|
}
|
|
2172
2162
|
}
|
|
2173
2163
|
|
|
2174
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
2164
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/Responsive.js
|
|
2175
2165
|
|
|
2176
2166
|
class Responsive {
|
|
2177
2167
|
constructor() {
|
|
@@ -2200,7 +2190,7 @@ class Responsive {
|
|
|
2200
2190
|
}
|
|
2201
2191
|
}
|
|
2202
2192
|
|
|
2203
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
2193
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/Theme/ThemeDefault.js
|
|
2204
2194
|
class ThemeDefault {
|
|
2205
2195
|
constructor() {
|
|
2206
2196
|
this.auto = false;
|
|
@@ -2223,7 +2213,7 @@ class ThemeDefault {
|
|
|
2223
2213
|
}
|
|
2224
2214
|
}
|
|
2225
2215
|
|
|
2226
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
2216
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/Theme/Theme.js
|
|
2227
2217
|
|
|
2228
2218
|
|
|
2229
2219
|
class Theme {
|
|
@@ -2245,17 +2235,16 @@ class Theme {
|
|
|
2245
2235
|
}
|
|
2246
2236
|
}
|
|
2247
2237
|
|
|
2248
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
2238
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/AnimationOptions.js
|
|
2249
2239
|
|
|
2250
|
-
class
|
|
2240
|
+
class AnimationOptions {
|
|
2251
2241
|
constructor() {
|
|
2252
2242
|
this.count = 0;
|
|
2253
2243
|
this.enable = false;
|
|
2254
|
-
this.offset = 0;
|
|
2255
2244
|
this.speed = 1;
|
|
2256
|
-
this.delay = 0;
|
|
2257
2245
|
this.decay = 0;
|
|
2258
|
-
this.
|
|
2246
|
+
this.delay = 0;
|
|
2247
|
+
this.sync = false;
|
|
2259
2248
|
}
|
|
2260
2249
|
load(data) {
|
|
2261
2250
|
if (!data) {
|
|
@@ -2267,9 +2256,6 @@ class ColorAnimation {
|
|
|
2267
2256
|
if (data.enable !== undefined) {
|
|
2268
2257
|
this.enable = data.enable;
|
|
2269
2258
|
}
|
|
2270
|
-
if (data.offset !== undefined) {
|
|
2271
|
-
this.offset = setRangeValue(data.offset);
|
|
2272
|
-
}
|
|
2273
2259
|
if (data.speed !== undefined) {
|
|
2274
2260
|
this.speed = setRangeValue(data.speed);
|
|
2275
2261
|
}
|
|
@@ -2284,8 +2270,47 @@ class ColorAnimation {
|
|
|
2284
2270
|
}
|
|
2285
2271
|
}
|
|
2286
2272
|
}
|
|
2273
|
+
class RangedAnimationOptions extends AnimationOptions {
|
|
2274
|
+
constructor() {
|
|
2275
|
+
super();
|
|
2276
|
+
this.mode = "auto";
|
|
2277
|
+
this.startValue = "random";
|
|
2278
|
+
}
|
|
2279
|
+
load(data) {
|
|
2280
|
+
super.load(data);
|
|
2281
|
+
if (!data) {
|
|
2282
|
+
return;
|
|
2283
|
+
}
|
|
2284
|
+
if (data.mode !== undefined) {
|
|
2285
|
+
this.mode = data.mode;
|
|
2286
|
+
}
|
|
2287
|
+
if (data.startValue !== undefined) {
|
|
2288
|
+
this.startValue = data.startValue;
|
|
2289
|
+
}
|
|
2290
|
+
}
|
|
2291
|
+
}
|
|
2287
2292
|
|
|
2288
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
2293
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/ColorAnimation.js
|
|
2294
|
+
|
|
2295
|
+
|
|
2296
|
+
class ColorAnimation extends AnimationOptions {
|
|
2297
|
+
constructor() {
|
|
2298
|
+
super();
|
|
2299
|
+
this.offset = 0;
|
|
2300
|
+
this.sync = true;
|
|
2301
|
+
}
|
|
2302
|
+
load(data) {
|
|
2303
|
+
super.load(data);
|
|
2304
|
+
if (!data) {
|
|
2305
|
+
return;
|
|
2306
|
+
}
|
|
2307
|
+
if (data.offset !== undefined) {
|
|
2308
|
+
this.offset = setRangeValue(data.offset);
|
|
2309
|
+
}
|
|
2310
|
+
}
|
|
2311
|
+
}
|
|
2312
|
+
|
|
2313
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/HslAnimation.js
|
|
2289
2314
|
|
|
2290
2315
|
class HslAnimation {
|
|
2291
2316
|
constructor() {
|
|
@@ -2303,7 +2328,7 @@ class HslAnimation {
|
|
|
2303
2328
|
}
|
|
2304
2329
|
}
|
|
2305
2330
|
|
|
2306
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
2331
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/AnimatableColor.js
|
|
2307
2332
|
|
|
2308
2333
|
|
|
2309
2334
|
|
|
@@ -2342,7 +2367,7 @@ class AnimatableColor extends OptionsColor {
|
|
|
2342
2367
|
}
|
|
2343
2368
|
}
|
|
2344
2369
|
|
|
2345
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
2370
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Collisions/CollisionsAbsorb.js
|
|
2346
2371
|
class CollisionsAbsorb {
|
|
2347
2372
|
constructor() {
|
|
2348
2373
|
this.speed = 2;
|
|
@@ -2357,7 +2382,7 @@ class CollisionsAbsorb {
|
|
|
2357
2382
|
}
|
|
2358
2383
|
}
|
|
2359
2384
|
|
|
2360
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
2385
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Collisions/CollisionsOverlap.js
|
|
2361
2386
|
class CollisionsOverlap {
|
|
2362
2387
|
constructor() {
|
|
2363
2388
|
this.enable = true;
|
|
@@ -2376,106 +2401,23 @@ class CollisionsOverlap {
|
|
|
2376
2401
|
}
|
|
2377
2402
|
}
|
|
2378
2403
|
|
|
2379
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
2380
|
-
|
|
2381
|
-
class AnimationOptions_AnimationOptions {
|
|
2382
|
-
constructor() {
|
|
2383
|
-
this.count = 0;
|
|
2384
|
-
this.enable = false;
|
|
2385
|
-
this.speed = 1;
|
|
2386
|
-
this.decay = 0;
|
|
2387
|
-
this.delay = 0;
|
|
2388
|
-
this.sync = false;
|
|
2389
|
-
}
|
|
2390
|
-
load(data) {
|
|
2391
|
-
if (!data) {
|
|
2392
|
-
return;
|
|
2393
|
-
}
|
|
2394
|
-
if (data.count !== undefined) {
|
|
2395
|
-
this.count = setRangeValue(data.count);
|
|
2396
|
-
}
|
|
2397
|
-
if (data.enable !== undefined) {
|
|
2398
|
-
this.enable = data.enable;
|
|
2399
|
-
}
|
|
2400
|
-
if (data.speed !== undefined) {
|
|
2401
|
-
this.speed = setRangeValue(data.speed);
|
|
2402
|
-
}
|
|
2403
|
-
if (data.decay !== undefined) {
|
|
2404
|
-
this.decay = setRangeValue(data.decay);
|
|
2405
|
-
}
|
|
2406
|
-
if (data.delay !== undefined) {
|
|
2407
|
-
this.delay = setRangeValue(data.delay);
|
|
2408
|
-
}
|
|
2409
|
-
if (data.sync !== undefined) {
|
|
2410
|
-
this.sync = data.sync;
|
|
2411
|
-
}
|
|
2412
|
-
}
|
|
2413
|
-
}
|
|
2414
|
-
class AnimationOptions_RangedAnimationOptions extends AnimationOptions_AnimationOptions {
|
|
2415
|
-
constructor() {
|
|
2416
|
-
super();
|
|
2417
|
-
this.mode = "auto";
|
|
2418
|
-
this.startValue = "random";
|
|
2419
|
-
}
|
|
2420
|
-
load(data) {
|
|
2421
|
-
super.load(data);
|
|
2422
|
-
if (!data) {
|
|
2423
|
-
return;
|
|
2424
|
-
}
|
|
2425
|
-
if (data.mode !== undefined) {
|
|
2426
|
-
this.mode = data.mode;
|
|
2427
|
-
}
|
|
2428
|
-
if (data.startValue !== undefined) {
|
|
2429
|
-
this.startValue = data.startValue;
|
|
2430
|
-
}
|
|
2431
|
-
}
|
|
2432
|
-
}
|
|
2433
|
-
|
|
2434
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.1/node_modules/@tsparticles/engine/browser/Options/Classes/Random.js
|
|
2435
|
-
class Random {
|
|
2436
|
-
constructor() {
|
|
2437
|
-
this.enable = false;
|
|
2438
|
-
this.minimumValue = 0;
|
|
2439
|
-
}
|
|
2440
|
-
load(data) {
|
|
2441
|
-
if (!data) {
|
|
2442
|
-
return;
|
|
2443
|
-
}
|
|
2444
|
-
if (data.enable !== undefined) {
|
|
2445
|
-
this.enable = data.enable;
|
|
2446
|
-
}
|
|
2447
|
-
if (data.minimumValue !== undefined) {
|
|
2448
|
-
this.minimumValue = data.minimumValue;
|
|
2449
|
-
}
|
|
2450
|
-
}
|
|
2451
|
-
}
|
|
2452
|
-
|
|
2453
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.1/node_modules/@tsparticles/engine/browser/Options/Classes/ValueWithRandom.js
|
|
2454
|
-
|
|
2455
|
-
|
|
2404
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/ValueWithRandom.js
|
|
2456
2405
|
|
|
2457
2406
|
|
|
2458
2407
|
class ValueWithRandom {
|
|
2459
2408
|
constructor() {
|
|
2460
|
-
this.random = new Random();
|
|
2461
2409
|
this.value = 0;
|
|
2462
2410
|
}
|
|
2463
2411
|
load(data) {
|
|
2464
2412
|
if (!data) {
|
|
2465
2413
|
return;
|
|
2466
2414
|
}
|
|
2467
|
-
if (isBoolean(data.random)) {
|
|
2468
|
-
this.random.enable = data.random;
|
|
2469
|
-
}
|
|
2470
|
-
else {
|
|
2471
|
-
this.random.load(data.random);
|
|
2472
|
-
}
|
|
2473
2415
|
if (data.value !== undefined) {
|
|
2474
|
-
this.value = setRangeValue(data.value
|
|
2416
|
+
this.value = setRangeValue(data.value);
|
|
2475
2417
|
}
|
|
2476
2418
|
}
|
|
2477
2419
|
}
|
|
2478
|
-
class AnimationValueWithRandom extends
|
|
2420
|
+
class AnimationValueWithRandom extends ValueWithRandom {
|
|
2479
2421
|
constructor() {
|
|
2480
2422
|
super();
|
|
2481
2423
|
this.animation = new AnimationOptions();
|
|
@@ -2491,7 +2433,7 @@ class AnimationValueWithRandom extends (/* unused pure expression or super */ nu
|
|
|
2491
2433
|
}
|
|
2492
2434
|
}
|
|
2493
2435
|
}
|
|
2494
|
-
class RangedAnimationValueWithRandom extends
|
|
2436
|
+
class RangedAnimationValueWithRandom extends AnimationValueWithRandom {
|
|
2495
2437
|
constructor() {
|
|
2496
2438
|
super();
|
|
2497
2439
|
this.animation = new RangedAnimationOptions();
|
|
@@ -2501,17 +2443,16 @@ class RangedAnimationValueWithRandom extends (/* unused pure expression or super
|
|
|
2501
2443
|
}
|
|
2502
2444
|
}
|
|
2503
2445
|
|
|
2504
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
2446
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Bounce/ParticlesBounceFactor.js
|
|
2505
2447
|
|
|
2506
2448
|
class ParticlesBounceFactor extends ValueWithRandom {
|
|
2507
2449
|
constructor() {
|
|
2508
2450
|
super();
|
|
2509
|
-
this.random.minimumValue = 0.1;
|
|
2510
2451
|
this.value = 1;
|
|
2511
2452
|
}
|
|
2512
2453
|
}
|
|
2513
2454
|
|
|
2514
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
2455
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Bounce/ParticlesBounce.js
|
|
2515
2456
|
|
|
2516
2457
|
class ParticlesBounce {
|
|
2517
2458
|
constructor() {
|
|
@@ -2527,7 +2468,7 @@ class ParticlesBounce {
|
|
|
2527
2468
|
}
|
|
2528
2469
|
}
|
|
2529
2470
|
|
|
2530
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
2471
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Collisions/Collisions.js
|
|
2531
2472
|
|
|
2532
2473
|
|
|
2533
2474
|
|
|
@@ -2560,7 +2501,41 @@ class Collisions {
|
|
|
2560
2501
|
}
|
|
2561
2502
|
}
|
|
2562
2503
|
|
|
2563
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
2504
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Effect/Effect.js
|
|
2505
|
+
|
|
2506
|
+
class Effect {
|
|
2507
|
+
constructor() {
|
|
2508
|
+
this.close = true;
|
|
2509
|
+
this.fill = true;
|
|
2510
|
+
this.options = {};
|
|
2511
|
+
this.type = [];
|
|
2512
|
+
}
|
|
2513
|
+
load(data) {
|
|
2514
|
+
if (!data) {
|
|
2515
|
+
return;
|
|
2516
|
+
}
|
|
2517
|
+
const options = data.options;
|
|
2518
|
+
if (options !== undefined) {
|
|
2519
|
+
for (const effect in options) {
|
|
2520
|
+
const item = options[effect];
|
|
2521
|
+
if (item) {
|
|
2522
|
+
this.options[effect] = deepExtend(this.options[effect] ?? {}, item);
|
|
2523
|
+
}
|
|
2524
|
+
}
|
|
2525
|
+
}
|
|
2526
|
+
if (data.close !== undefined) {
|
|
2527
|
+
this.close = data.close;
|
|
2528
|
+
}
|
|
2529
|
+
if (data.fill !== undefined) {
|
|
2530
|
+
this.fill = data.fill;
|
|
2531
|
+
}
|
|
2532
|
+
if (data.type !== undefined) {
|
|
2533
|
+
this.type = data.type;
|
|
2534
|
+
}
|
|
2535
|
+
}
|
|
2536
|
+
}
|
|
2537
|
+
|
|
2538
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Move/MoveAngle.js
|
|
2564
2539
|
|
|
2565
2540
|
class MoveAngle {
|
|
2566
2541
|
constructor() {
|
|
@@ -2580,7 +2555,7 @@ class MoveAngle {
|
|
|
2580
2555
|
}
|
|
2581
2556
|
}
|
|
2582
2557
|
|
|
2583
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
2558
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Move/MoveAttract.js
|
|
2584
2559
|
|
|
2585
2560
|
class MoveAttract {
|
|
2586
2561
|
constructor() {
|
|
@@ -2614,7 +2589,7 @@ class MoveAttract {
|
|
|
2614
2589
|
}
|
|
2615
2590
|
}
|
|
2616
2591
|
|
|
2617
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
2592
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Move/MoveCenter.js
|
|
2618
2593
|
class MoveCenter {
|
|
2619
2594
|
constructor() {
|
|
2620
2595
|
this.x = 50;
|
|
@@ -2641,7 +2616,7 @@ class MoveCenter {
|
|
|
2641
2616
|
}
|
|
2642
2617
|
}
|
|
2643
2618
|
|
|
2644
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
2619
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Move/MoveGravity.js
|
|
2645
2620
|
|
|
2646
2621
|
class MoveGravity {
|
|
2647
2622
|
constructor() {
|
|
@@ -2669,7 +2644,7 @@ class MoveGravity {
|
|
|
2669
2644
|
}
|
|
2670
2645
|
}
|
|
2671
2646
|
|
|
2672
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
2647
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Move/Path/MovePath.js
|
|
2673
2648
|
|
|
2674
2649
|
|
|
2675
2650
|
class MovePath {
|
|
@@ -2697,7 +2672,7 @@ class MovePath {
|
|
|
2697
2672
|
}
|
|
2698
2673
|
}
|
|
2699
2674
|
|
|
2700
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
2675
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Move/MoveTrailFill.js
|
|
2701
2676
|
|
|
2702
2677
|
class MoveTrailFill {
|
|
2703
2678
|
load(data) {
|
|
@@ -2713,7 +2688,7 @@ class MoveTrailFill {
|
|
|
2713
2688
|
}
|
|
2714
2689
|
}
|
|
2715
2690
|
|
|
2716
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
2691
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Move/MoveTrail.js
|
|
2717
2692
|
|
|
2718
2693
|
class MoveTrail {
|
|
2719
2694
|
constructor() {
|
|
@@ -2737,7 +2712,7 @@ class MoveTrail {
|
|
|
2737
2712
|
}
|
|
2738
2713
|
}
|
|
2739
2714
|
|
|
2740
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
2715
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Move/OutModes.js
|
|
2741
2716
|
class OutModes {
|
|
2742
2717
|
constructor() {
|
|
2743
2718
|
this.default = "out";
|
|
@@ -2756,7 +2731,7 @@ class OutModes {
|
|
|
2756
2731
|
}
|
|
2757
2732
|
}
|
|
2758
2733
|
|
|
2759
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
2734
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Move/Spin.js
|
|
2760
2735
|
|
|
2761
2736
|
|
|
2762
2737
|
class Spin {
|
|
@@ -2780,7 +2755,7 @@ class Spin {
|
|
|
2780
2755
|
}
|
|
2781
2756
|
}
|
|
2782
2757
|
|
|
2783
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
2758
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Move/Move.js
|
|
2784
2759
|
|
|
2785
2760
|
|
|
2786
2761
|
|
|
@@ -2876,9 +2851,9 @@ class Move {
|
|
|
2876
2851
|
}
|
|
2877
2852
|
}
|
|
2878
2853
|
|
|
2879
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
2854
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Opacity/OpacityAnimation.js
|
|
2880
2855
|
|
|
2881
|
-
class OpacityAnimation extends
|
|
2856
|
+
class OpacityAnimation extends RangedAnimationOptions {
|
|
2882
2857
|
constructor() {
|
|
2883
2858
|
super();
|
|
2884
2859
|
this.destroy = "none";
|
|
@@ -2895,14 +2870,13 @@ class OpacityAnimation extends AnimationOptions_RangedAnimationOptions {
|
|
|
2895
2870
|
}
|
|
2896
2871
|
}
|
|
2897
2872
|
|
|
2898
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
2873
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Opacity/Opacity.js
|
|
2899
2874
|
|
|
2900
2875
|
|
|
2901
|
-
class Opacity extends
|
|
2876
|
+
class Opacity extends RangedAnimationValueWithRandom {
|
|
2902
2877
|
constructor() {
|
|
2903
2878
|
super();
|
|
2904
2879
|
this.animation = new OpacityAnimation();
|
|
2905
|
-
this.random.minimumValue = 0.1;
|
|
2906
2880
|
this.value = 1;
|
|
2907
2881
|
}
|
|
2908
2882
|
load(data) {
|
|
@@ -2917,7 +2891,7 @@ class Opacity extends ValueWithRandom {
|
|
|
2917
2891
|
}
|
|
2918
2892
|
}
|
|
2919
2893
|
|
|
2920
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
2894
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Number/ParticlesDensity.js
|
|
2921
2895
|
class ParticlesDensity {
|
|
2922
2896
|
constructor() {
|
|
2923
2897
|
this.enable = false;
|
|
@@ -2942,12 +2916,32 @@ class ParticlesDensity {
|
|
|
2942
2916
|
}
|
|
2943
2917
|
}
|
|
2944
2918
|
|
|
2945
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
2919
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Number/ParticlesNumberLimit.js
|
|
2920
|
+
class ParticlesNumberLimit {
|
|
2921
|
+
constructor() {
|
|
2922
|
+
this.mode = "delete";
|
|
2923
|
+
this.value = 0;
|
|
2924
|
+
}
|
|
2925
|
+
load(data) {
|
|
2926
|
+
if (!data) {
|
|
2927
|
+
return;
|
|
2928
|
+
}
|
|
2929
|
+
if (data.mode !== undefined) {
|
|
2930
|
+
this.mode = data.mode;
|
|
2931
|
+
}
|
|
2932
|
+
if (data.value !== undefined) {
|
|
2933
|
+
this.value = data.value;
|
|
2934
|
+
}
|
|
2935
|
+
}
|
|
2936
|
+
}
|
|
2937
|
+
|
|
2938
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Number/ParticlesNumber.js
|
|
2939
|
+
|
|
2946
2940
|
|
|
2947
2941
|
class ParticlesNumber {
|
|
2948
2942
|
constructor() {
|
|
2949
2943
|
this.density = new ParticlesDensity();
|
|
2950
|
-
this.limit =
|
|
2944
|
+
this.limit = new ParticlesNumberLimit();
|
|
2951
2945
|
this.value = 0;
|
|
2952
2946
|
}
|
|
2953
2947
|
load(data) {
|
|
@@ -2955,17 +2949,14 @@ class ParticlesNumber {
|
|
|
2955
2949
|
return;
|
|
2956
2950
|
}
|
|
2957
2951
|
this.density.load(data.density);
|
|
2958
|
-
|
|
2959
|
-
if (limit !== undefined) {
|
|
2960
|
-
this.limit = limit;
|
|
2961
|
-
}
|
|
2952
|
+
this.limit.load(data.limit);
|
|
2962
2953
|
if (data.value !== undefined) {
|
|
2963
2954
|
this.value = data.value;
|
|
2964
2955
|
}
|
|
2965
2956
|
}
|
|
2966
2957
|
}
|
|
2967
2958
|
|
|
2968
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
2959
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Shadow.js
|
|
2969
2960
|
|
|
2970
2961
|
class Shadow {
|
|
2971
2962
|
constructor() {
|
|
@@ -3001,7 +2992,7 @@ class Shadow {
|
|
|
3001
2992
|
}
|
|
3002
2993
|
}
|
|
3003
2994
|
|
|
3004
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
2995
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Shape/Shape.js
|
|
3005
2996
|
|
|
3006
2997
|
class Shape {
|
|
3007
2998
|
constructor() {
|
|
@@ -3035,9 +3026,9 @@ class Shape {
|
|
|
3035
3026
|
}
|
|
3036
3027
|
}
|
|
3037
3028
|
|
|
3038
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
3029
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Size/SizeAnimation.js
|
|
3039
3030
|
|
|
3040
|
-
class SizeAnimation extends
|
|
3031
|
+
class SizeAnimation extends RangedAnimationOptions {
|
|
3041
3032
|
constructor() {
|
|
3042
3033
|
super();
|
|
3043
3034
|
this.destroy = "none";
|
|
@@ -3054,14 +3045,13 @@ class SizeAnimation extends AnimationOptions_RangedAnimationOptions {
|
|
|
3054
3045
|
}
|
|
3055
3046
|
}
|
|
3056
3047
|
|
|
3057
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
3048
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Size/Size.js
|
|
3058
3049
|
|
|
3059
3050
|
|
|
3060
|
-
class Size extends
|
|
3051
|
+
class Size extends RangedAnimationValueWithRandom {
|
|
3061
3052
|
constructor() {
|
|
3062
3053
|
super();
|
|
3063
3054
|
this.animation = new SizeAnimation();
|
|
3064
|
-
this.random.minimumValue = 1;
|
|
3065
3055
|
this.value = 3;
|
|
3066
3056
|
}
|
|
3067
3057
|
load(data) {
|
|
@@ -3076,7 +3066,7 @@ class Size extends ValueWithRandom {
|
|
|
3076
3066
|
}
|
|
3077
3067
|
}
|
|
3078
3068
|
|
|
3079
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
3069
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Stroke.js
|
|
3080
3070
|
|
|
3081
3071
|
|
|
3082
3072
|
class Stroke {
|
|
@@ -3099,7 +3089,7 @@ class Stroke {
|
|
|
3099
3089
|
}
|
|
3100
3090
|
}
|
|
3101
3091
|
|
|
3102
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
3092
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/ZIndex/ZIndex.js
|
|
3103
3093
|
|
|
3104
3094
|
class ZIndex extends ValueWithRandom {
|
|
3105
3095
|
constructor() {
|
|
@@ -3125,7 +3115,8 @@ class ZIndex extends ValueWithRandom {
|
|
|
3125
3115
|
}
|
|
3126
3116
|
}
|
|
3127
3117
|
|
|
3128
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
3118
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/ParticlesOptions.js
|
|
3119
|
+
|
|
3129
3120
|
|
|
3130
3121
|
|
|
3131
3122
|
|
|
@@ -3146,6 +3137,7 @@ class ParticlesOptions {
|
|
|
3146
3137
|
this.collisions = new Collisions();
|
|
3147
3138
|
this.color = new AnimatableColor();
|
|
3148
3139
|
this.color.value = "#fff";
|
|
3140
|
+
this.effect = new Effect();
|
|
3149
3141
|
this.groups = {};
|
|
3150
3142
|
this.move = new Move();
|
|
3151
3143
|
this.number = new ParticlesNumber();
|
|
@@ -3163,6 +3155,7 @@ class ParticlesOptions {
|
|
|
3163
3155
|
}
|
|
3164
3156
|
this.bounce.load(data.bounce);
|
|
3165
3157
|
this.color.load(AnimatableColor.create(this.color, data.color));
|
|
3158
|
+
this.effect.load(data.effect);
|
|
3166
3159
|
if (data.groups !== undefined) {
|
|
3167
3160
|
for (const group in data.groups) {
|
|
3168
3161
|
const item = data.groups[group];
|
|
@@ -3214,7 +3207,7 @@ class ParticlesOptions {
|
|
|
3214
3207
|
}
|
|
3215
3208
|
}
|
|
3216
3209
|
|
|
3217
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
3210
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Utils/OptionsUtils.js
|
|
3218
3211
|
|
|
3219
3212
|
function loadOptions(options, ...sourceOptionsArr) {
|
|
3220
3213
|
for (const sourceOptions of sourceOptionsArr) {
|
|
@@ -3227,7 +3220,7 @@ function loadParticlesOptions(engine, container, ...sourceOptionsArr) {
|
|
|
3227
3220
|
return options;
|
|
3228
3221
|
}
|
|
3229
3222
|
|
|
3230
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
3223
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Options/Classes/Options.js
|
|
3231
3224
|
|
|
3232
3225
|
|
|
3233
3226
|
|
|
@@ -3379,7 +3372,7 @@ class Options {
|
|
|
3379
3372
|
}
|
|
3380
3373
|
}
|
|
3381
3374
|
|
|
3382
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
3375
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Core/Utils/InteractionManager.js
|
|
3383
3376
|
class InteractionManager {
|
|
3384
3377
|
constructor(engine, container) {
|
|
3385
3378
|
this.container = container;
|
|
@@ -3431,7 +3424,7 @@ class InteractionManager {
|
|
|
3431
3424
|
}
|
|
3432
3425
|
}
|
|
3433
3426
|
|
|
3434
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
3427
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Core/Particle.js
|
|
3435
3428
|
|
|
3436
3429
|
|
|
3437
3430
|
|
|
@@ -3441,7 +3434,27 @@ class InteractionManager {
|
|
|
3441
3434
|
|
|
3442
3435
|
|
|
3443
3436
|
|
|
3444
|
-
|
|
3437
|
+
function loadEffectData(effect, effectOptions, id, reduceDuplicates) {
|
|
3438
|
+
const effectData = effectOptions.options[effect];
|
|
3439
|
+
if (!effectData) {
|
|
3440
|
+
return;
|
|
3441
|
+
}
|
|
3442
|
+
return deepExtend({
|
|
3443
|
+
close: effectOptions.close,
|
|
3444
|
+
fill: effectOptions.fill,
|
|
3445
|
+
}, itemFromSingleOrMultiple(effectData, id, reduceDuplicates));
|
|
3446
|
+
}
|
|
3447
|
+
function loadShapeData(shape, shapeOptions, id, reduceDuplicates) {
|
|
3448
|
+
const shapeData = shapeOptions.options[shape];
|
|
3449
|
+
if (!shapeData) {
|
|
3450
|
+
return;
|
|
3451
|
+
}
|
|
3452
|
+
return deepExtend({
|
|
3453
|
+
close: shapeOptions.close,
|
|
3454
|
+
fill: shapeOptions.fill,
|
|
3455
|
+
}, itemFromSingleOrMultiple(shapeData, id, reduceDuplicates));
|
|
3456
|
+
}
|
|
3457
|
+
function fixOutMode(data) {
|
|
3445
3458
|
if (!isInArray(data.outMode, data.checkModes)) {
|
|
3446
3459
|
return;
|
|
3447
3460
|
}
|
|
@@ -3452,7 +3465,7 @@ const fixOutMode = (data) => {
|
|
|
3452
3465
|
else if (data.coord < diameter) {
|
|
3453
3466
|
data.setCb(data.radius);
|
|
3454
3467
|
}
|
|
3455
|
-
}
|
|
3468
|
+
}
|
|
3456
3469
|
class Particle {
|
|
3457
3470
|
constructor(engine, id, container, position, overrideOptions, group) {
|
|
3458
3471
|
this.container = container;
|
|
@@ -3499,9 +3512,9 @@ class Particle {
|
|
|
3499
3512
|
if (moveOptions.direction === "inside" || moveOptions.direction === "outside") {
|
|
3500
3513
|
return res;
|
|
3501
3514
|
}
|
|
3502
|
-
const rad = (Math.PI / 180) *
|
|
3503
|
-
left: radOffset - rad
|
|
3504
|
-
right: radOffset + rad
|
|
3515
|
+
const rad = (Math.PI / 180) * NumberUtils_getRangeValue(moveOptions.angle.value), radOffset = (Math.PI / 180) * NumberUtils_getRangeValue(moveOptions.angle.offset), range = {
|
|
3516
|
+
left: radOffset - rad * 0.5,
|
|
3517
|
+
right: radOffset + rad * 0.5,
|
|
3505
3518
|
};
|
|
3506
3519
|
if (!moveOptions.straight) {
|
|
3507
3520
|
res.angle += randomInRange(setRangeValue(range.left, range.right));
|
|
@@ -3530,7 +3543,7 @@ class Particle {
|
|
|
3530
3543
|
if (!color || !this.roll || (!this.backColor && !this.roll.alter)) {
|
|
3531
3544
|
return color;
|
|
3532
3545
|
}
|
|
3533
|
-
const backFactor = this.roll.horizontal && this.roll.vertical ? 2 : 1, backSum = this.roll.horizontal ? Math.PI
|
|
3546
|
+
const backFactor = this.roll.horizontal && this.roll.vertical ? 2 : 1, backSum = this.roll.horizontal ? Math.PI * 0.5 : 0, rolled = Math.floor(((this.roll.angle ?? 0) + backSum) / (Math.PI / backFactor)) % 2;
|
|
3534
3547
|
if (!rolled) {
|
|
3535
3548
|
return color;
|
|
3536
3549
|
}
|
|
@@ -3543,7 +3556,7 @@ class Particle {
|
|
|
3543
3556
|
return color;
|
|
3544
3557
|
};
|
|
3545
3558
|
this._initPosition = (position) => {
|
|
3546
|
-
const container = this.container, zIndexValue =
|
|
3559
|
+
const container = this.container, zIndexValue = NumberUtils_getRangeValue(this.options.zIndex.value);
|
|
3547
3560
|
this.position = this._calcPosition(container, position, clamp(zIndexValue, 0, container.zLayers));
|
|
3548
3561
|
this.initialPosition = this.position.copy();
|
|
3549
3562
|
const canvasSize = container.canvas.size;
|
|
@@ -3563,16 +3576,6 @@ class Particle {
|
|
|
3563
3576
|
}
|
|
3564
3577
|
this.offset = Vector_Vector.origin;
|
|
3565
3578
|
};
|
|
3566
|
-
this._loadShapeData = (shapeOptions, reduceDuplicates) => {
|
|
3567
|
-
const shapeData = shapeOptions.options[this.shape];
|
|
3568
|
-
if (!shapeData) {
|
|
3569
|
-
return;
|
|
3570
|
-
}
|
|
3571
|
-
return deepExtend({
|
|
3572
|
-
close: shapeOptions.close,
|
|
3573
|
-
fill: shapeOptions.fill,
|
|
3574
|
-
}, itemFromSingleOrMultiple(shapeData, this.id, reduceDuplicates));
|
|
3575
|
-
};
|
|
3576
3579
|
this._engine = engine;
|
|
3577
3580
|
this.init(id, position, overrideOptions, group);
|
|
3578
3581
|
}
|
|
@@ -3585,18 +3588,12 @@ class Particle {
|
|
|
3585
3588
|
this.slow.inRange = false;
|
|
3586
3589
|
const container = this.container, pathGenerator = this.pathGenerator;
|
|
3587
3590
|
for (const [, plugin] of container.plugins) {
|
|
3588
|
-
|
|
3589
|
-
plugin.particleDestroyed(this, override);
|
|
3590
|
-
}
|
|
3591
|
+
plugin.particleDestroyed && plugin.particleDestroyed(this, override);
|
|
3591
3592
|
}
|
|
3592
3593
|
for (const updater of container.particles.updaters) {
|
|
3593
|
-
|
|
3594
|
-
updater.particleDestroyed(this, override);
|
|
3595
|
-
}
|
|
3596
|
-
}
|
|
3597
|
-
if (pathGenerator) {
|
|
3598
|
-
pathGenerator.reset(this);
|
|
3594
|
+
updater.particleDestroyed && updater.particleDestroyed(this, override);
|
|
3599
3595
|
}
|
|
3596
|
+
pathGenerator && pathGenerator.reset(this);
|
|
3600
3597
|
}
|
|
3601
3598
|
draw(delta) {
|
|
3602
3599
|
const container = this.container, canvas = container.canvas;
|
|
@@ -3609,7 +3606,7 @@ class Particle {
|
|
|
3609
3606
|
return this._getRollColor(this.bubble.color ?? getHslFromAnimation(this.color));
|
|
3610
3607
|
}
|
|
3611
3608
|
getMass() {
|
|
3612
|
-
return
|
|
3609
|
+
return this.getRadius() ** 2 * Math.PI * 0.5;
|
|
3613
3610
|
}
|
|
3614
3611
|
getPosition() {
|
|
3615
3612
|
return {
|
|
@@ -3628,9 +3625,11 @@ class Particle {
|
|
|
3628
3625
|
const container = this.container, engine = this._engine;
|
|
3629
3626
|
this.id = id;
|
|
3630
3627
|
this.group = group;
|
|
3631
|
-
this.
|
|
3628
|
+
this.effectClose = true;
|
|
3629
|
+
this.effectFill = true;
|
|
3630
|
+
this.shapeClose = true;
|
|
3631
|
+
this.shapeFill = true;
|
|
3632
3632
|
this.pathRotation = false;
|
|
3633
|
-
this.close = true;
|
|
3634
3633
|
this.lastPathTime = 0;
|
|
3635
3634
|
this.destroyed = false;
|
|
3636
3635
|
this.unbreakable = false;
|
|
@@ -3641,18 +3640,33 @@ class Particle {
|
|
|
3641
3640
|
};
|
|
3642
3641
|
this.outType = "normal";
|
|
3643
3642
|
this.ignoresResizeRatio = true;
|
|
3644
|
-
const pxRatio = container.retina.pixelRatio, mainOptions = container.actualOptions, particlesOptions = loadParticlesOptions(this._engine, container, mainOptions.particles), shapeType = particlesOptions.shape.type, { reduceDuplicates } = particlesOptions;
|
|
3643
|
+
const pxRatio = container.retina.pixelRatio, mainOptions = container.actualOptions, particlesOptions = loadParticlesOptions(this._engine, container, mainOptions.particles), effectType = particlesOptions.effect.type, shapeType = particlesOptions.shape.type, { reduceDuplicates } = particlesOptions;
|
|
3644
|
+
this.effect = itemFromSingleOrMultiple(effectType, this.id, reduceDuplicates);
|
|
3645
3645
|
this.shape = itemFromSingleOrMultiple(shapeType, this.id, reduceDuplicates);
|
|
3646
|
-
const shapeOptions = particlesOptions.shape;
|
|
3647
|
-
if (overrideOptions
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3646
|
+
const effectOptions = particlesOptions.effect, shapeOptions = particlesOptions.shape;
|
|
3647
|
+
if (overrideOptions) {
|
|
3648
|
+
if (overrideOptions.effect && overrideOptions.effect.type) {
|
|
3649
|
+
const overrideEffectType = overrideOptions.effect.type, effect = itemFromSingleOrMultiple(overrideEffectType, this.id, reduceDuplicates);
|
|
3650
|
+
if (effect) {
|
|
3651
|
+
this.effect = effect;
|
|
3652
|
+
effectOptions.load(overrideOptions.effect);
|
|
3653
|
+
}
|
|
3654
|
+
}
|
|
3655
|
+
if (overrideOptions.shape && overrideOptions.shape.type) {
|
|
3656
|
+
const overrideShapeType = overrideOptions.shape.type, shape = itemFromSingleOrMultiple(overrideShapeType, this.id, reduceDuplicates);
|
|
3657
|
+
if (shape) {
|
|
3658
|
+
this.shape = shape;
|
|
3659
|
+
shapeOptions.load(overrideOptions.shape);
|
|
3660
|
+
}
|
|
3652
3661
|
}
|
|
3653
3662
|
}
|
|
3654
|
-
this.
|
|
3663
|
+
this.effectData = loadEffectData(this.effect, effectOptions, this.id, reduceDuplicates);
|
|
3664
|
+
this.shapeData = loadShapeData(this.shape, shapeOptions, this.id, reduceDuplicates);
|
|
3655
3665
|
particlesOptions.load(overrideOptions);
|
|
3666
|
+
const effectData = this.effectData;
|
|
3667
|
+
if (effectData) {
|
|
3668
|
+
particlesOptions.load(effectData.particles);
|
|
3669
|
+
}
|
|
3656
3670
|
const shapeData = this.shapeData;
|
|
3657
3671
|
if (shapeData) {
|
|
3658
3672
|
particlesOptions.load(shapeData.particles);
|
|
@@ -3661,11 +3675,13 @@ class Particle {
|
|
|
3661
3675
|
interactivity.load(container.actualOptions.interactivity);
|
|
3662
3676
|
interactivity.load(particlesOptions.interactivity);
|
|
3663
3677
|
this.interactivity = interactivity;
|
|
3664
|
-
this.
|
|
3665
|
-
this.
|
|
3678
|
+
this.effectFill = effectData?.fill ?? particlesOptions.effect.fill;
|
|
3679
|
+
this.effectClose = effectData?.close ?? particlesOptions.effect.close;
|
|
3680
|
+
this.shapeFill = shapeData?.fill ?? particlesOptions.shape.fill;
|
|
3681
|
+
this.shapeClose = shapeData?.close ?? particlesOptions.shape.close;
|
|
3666
3682
|
this.options = particlesOptions;
|
|
3667
3683
|
const pathOptions = this.options.move.path;
|
|
3668
|
-
this.pathDelay =
|
|
3684
|
+
this.pathDelay = NumberUtils_getRangeValue(pathOptions.delay.value) * 1000;
|
|
3669
3685
|
if (pathOptions.generator) {
|
|
3670
3686
|
this.pathGenerator = this._engine.getPathGenerator(pathOptions.generator);
|
|
3671
3687
|
if (this.pathGenerator && container.addPath(pathOptions.generator, this.pathGenerator)) {
|
|
@@ -3684,36 +3700,48 @@ class Particle {
|
|
|
3684
3700
|
this._initPosition(position);
|
|
3685
3701
|
this.initialVelocity = this._calculateVelocity();
|
|
3686
3702
|
this.velocity = this.initialVelocity.copy();
|
|
3687
|
-
this.moveDecay = 1 -
|
|
3703
|
+
this.moveDecay = 1 - NumberUtils_getRangeValue(this.options.move.decay);
|
|
3688
3704
|
const particles = container.particles;
|
|
3689
|
-
particles.
|
|
3690
|
-
particles.lastZIndex = this.position.z;
|
|
3705
|
+
particles.setLastZIndex(this.position.z);
|
|
3691
3706
|
this.zIndexFactor = this.position.z / container.zLayers;
|
|
3692
3707
|
this.sides = 24;
|
|
3693
|
-
let
|
|
3694
|
-
if (!
|
|
3695
|
-
|
|
3696
|
-
if (
|
|
3697
|
-
container.
|
|
3708
|
+
let effectDrawer = container.effectDrawers.get(this.effect);
|
|
3709
|
+
if (!effectDrawer) {
|
|
3710
|
+
effectDrawer = this._engine.getEffectDrawer(this.effect);
|
|
3711
|
+
if (effectDrawer) {
|
|
3712
|
+
container.effectDrawers.set(this.effect, effectDrawer);
|
|
3698
3713
|
}
|
|
3699
3714
|
}
|
|
3700
|
-
if (
|
|
3701
|
-
|
|
3715
|
+
if (effectDrawer && effectDrawer.loadEffect) {
|
|
3716
|
+
effectDrawer.loadEffect(this);
|
|
3717
|
+
}
|
|
3718
|
+
let shapeDrawer = container.shapeDrawers.get(this.shape);
|
|
3719
|
+
if (!shapeDrawer) {
|
|
3720
|
+
shapeDrawer = this._engine.getShapeDrawer(this.shape);
|
|
3721
|
+
if (shapeDrawer) {
|
|
3722
|
+
container.shapeDrawers.set(this.shape, shapeDrawer);
|
|
3723
|
+
}
|
|
3702
3724
|
}
|
|
3703
|
-
|
|
3725
|
+
if (shapeDrawer && shapeDrawer.loadShape) {
|
|
3726
|
+
shapeDrawer.loadShape(this);
|
|
3727
|
+
}
|
|
3728
|
+
const sideCountFunc = shapeDrawer?.getSidesCount;
|
|
3704
3729
|
if (sideCountFunc) {
|
|
3705
3730
|
this.sides = sideCountFunc(this);
|
|
3706
3731
|
}
|
|
3707
3732
|
this.spawning = false;
|
|
3708
3733
|
this.shadowColor = rangeColorToRgb(this.options.shadow.color);
|
|
3709
|
-
for (const updater of
|
|
3734
|
+
for (const updater of particles.updaters) {
|
|
3710
3735
|
updater.init(this);
|
|
3711
3736
|
}
|
|
3712
|
-
for (const mover of
|
|
3737
|
+
for (const mover of particles.movers) {
|
|
3713
3738
|
mover.init && mover.init(this);
|
|
3714
3739
|
}
|
|
3715
|
-
if (
|
|
3716
|
-
|
|
3740
|
+
if (effectDrawer && effectDrawer.particleInit) {
|
|
3741
|
+
effectDrawer.particleInit(container, this);
|
|
3742
|
+
}
|
|
3743
|
+
if (shapeDrawer && shapeDrawer.particleInit) {
|
|
3744
|
+
shapeDrawer.particleInit(container, this);
|
|
3717
3745
|
}
|
|
3718
3746
|
for (const [, plugin] of container.plugins) {
|
|
3719
3747
|
plugin.particleCreated && plugin.particleCreated(this);
|
|
@@ -3736,7 +3764,7 @@ class Particle {
|
|
|
3736
3764
|
}
|
|
3737
3765
|
}
|
|
3738
3766
|
|
|
3739
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
3767
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Core/Utils/Point.js
|
|
3740
3768
|
class Point {
|
|
3741
3769
|
constructor(position, particle) {
|
|
3742
3770
|
this.position = position;
|
|
@@ -3744,7 +3772,7 @@ class Point {
|
|
|
3744
3772
|
}
|
|
3745
3773
|
}
|
|
3746
3774
|
|
|
3747
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
3775
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Core/Utils/Range.js
|
|
3748
3776
|
class Range {
|
|
3749
3777
|
constructor(x, y) {
|
|
3750
3778
|
this.position = {
|
|
@@ -3754,7 +3782,7 @@ class Range {
|
|
|
3754
3782
|
}
|
|
3755
3783
|
}
|
|
3756
3784
|
|
|
3757
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
3785
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Core/Utils/Rectangle.js
|
|
3758
3786
|
|
|
3759
3787
|
|
|
3760
3788
|
class Rectangle extends Range {
|
|
@@ -3778,7 +3806,7 @@ class Rectangle extends Range {
|
|
|
3778
3806
|
}
|
|
3779
3807
|
}
|
|
3780
3808
|
|
|
3781
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
3809
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Core/Utils/Circle.js
|
|
3782
3810
|
|
|
3783
3811
|
|
|
3784
3812
|
|
|
@@ -3807,7 +3835,7 @@ class Circle extends Range {
|
|
|
3807
3835
|
}
|
|
3808
3836
|
}
|
|
3809
3837
|
|
|
3810
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
3838
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Core/Utils/QuadTree.js
|
|
3811
3839
|
|
|
3812
3840
|
|
|
3813
3841
|
|
|
@@ -3818,7 +3846,7 @@ class QuadTree {
|
|
|
3818
3846
|
this._subdivide = () => {
|
|
3819
3847
|
const { x, y } = this.rectangle.position, { width, height } = this.rectangle.size, { capacity } = this;
|
|
3820
3848
|
for (let i = 0; i < 4; i++) {
|
|
3821
|
-
this._subs.push(new QuadTree(new Rectangle(x +
|
|
3849
|
+
this._subs.push(new QuadTree(new Rectangle(x + width * 0.5 * (i % 2), y + height * 0.5 * (Math.round(i * 0.5) - (i % 2)), width * 0.5, height * 0.5), capacity));
|
|
3822
3850
|
}
|
|
3823
3851
|
this._divided = true;
|
|
3824
3852
|
};
|
|
@@ -3867,7 +3895,7 @@ class QuadTree {
|
|
|
3867
3895
|
}
|
|
3868
3896
|
}
|
|
3869
3897
|
|
|
3870
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
3898
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Core/Particles.js
|
|
3871
3899
|
|
|
3872
3900
|
|
|
3873
3901
|
|
|
@@ -3877,16 +3905,29 @@ class QuadTree {
|
|
|
3877
3905
|
|
|
3878
3906
|
const qTreeCapacity = 4;
|
|
3879
3907
|
const qTreeRectangle = (canvasSize) => {
|
|
3880
|
-
|
|
3908
|
+
const { height, width } = canvasSize, posOffset = -0.25, sizeFactor = 1.5;
|
|
3909
|
+
return new Rectangle(posOffset * width, posOffset * height, sizeFactor * width, sizeFactor * height);
|
|
3881
3910
|
};
|
|
3882
3911
|
class Particles {
|
|
3883
3912
|
constructor(engine, container) {
|
|
3884
3913
|
this._applyDensity = (options, manualCount, group) => {
|
|
3914
|
+
const numberOptions = options.number;
|
|
3885
3915
|
if (!options.number.density?.enable) {
|
|
3916
|
+
if (group === undefined) {
|
|
3917
|
+
this._limit = numberOptions.limit.value;
|
|
3918
|
+
}
|
|
3919
|
+
else {
|
|
3920
|
+
this._groupLimits.set(group, numberOptions.limit.value);
|
|
3921
|
+
}
|
|
3886
3922
|
return;
|
|
3887
3923
|
}
|
|
3888
|
-
const
|
|
3889
|
-
|
|
3924
|
+
const densityFactor = this._initDensityFactor(numberOptions.density), optParticlesNumber = numberOptions.value, optParticlesLimit = numberOptions.limit.value > 0 ? numberOptions.limit.value : optParticlesNumber, particlesNumber = Math.min(optParticlesNumber, optParticlesLimit) * densityFactor + manualCount, particlesCount = Math.min(this.count, this.filter((t) => t.group === group).length);
|
|
3925
|
+
if (group === undefined) {
|
|
3926
|
+
this._limit = numberOptions.limit.value * densityFactor;
|
|
3927
|
+
}
|
|
3928
|
+
else {
|
|
3929
|
+
this._groupLimits.set(group, numberOptions.limit.value * densityFactor);
|
|
3930
|
+
}
|
|
3890
3931
|
if (particlesCount < particlesNumber) {
|
|
3891
3932
|
this.push(Math.abs(particlesNumber - particlesCount), undefined, options, group);
|
|
3892
3933
|
}
|
|
@@ -3904,7 +3945,7 @@ class Particles {
|
|
|
3904
3945
|
};
|
|
3905
3946
|
this._pushParticle = (position, overrideOptions, group, initializer) => {
|
|
3906
3947
|
try {
|
|
3907
|
-
let particle = this.
|
|
3948
|
+
let particle = this._pool.pop();
|
|
3908
3949
|
if (particle) {
|
|
3909
3950
|
particle.init(this._nextId, position, overrideOptions, group);
|
|
3910
3951
|
}
|
|
@@ -3940,9 +3981,10 @@ class Particles {
|
|
|
3940
3981
|
return false;
|
|
3941
3982
|
}
|
|
3942
3983
|
particle.destroy(override);
|
|
3984
|
+
const zIdx = this._zArray.indexOf(particle);
|
|
3943
3985
|
this._array.splice(index, 1);
|
|
3944
|
-
this._zArray
|
|
3945
|
-
this.
|
|
3986
|
+
this._zArray.splice(zIdx, 1);
|
|
3987
|
+
this._pool.push(particle);
|
|
3946
3988
|
this._engine.dispatchEvent("particleRemoved", {
|
|
3947
3989
|
container: this._container,
|
|
3948
3990
|
data: {
|
|
@@ -3956,10 +3998,11 @@ class Particles {
|
|
|
3956
3998
|
this._nextId = 0;
|
|
3957
3999
|
this._array = [];
|
|
3958
4000
|
this._zArray = [];
|
|
3959
|
-
this.
|
|
3960
|
-
this.
|
|
3961
|
-
this.
|
|
3962
|
-
this.
|
|
4001
|
+
this._pool = [];
|
|
4002
|
+
this._limit = 0;
|
|
4003
|
+
this._groupLimits = new Map();
|
|
4004
|
+
this._needsSort = false;
|
|
4005
|
+
this._lastZIndex = 0;
|
|
3963
4006
|
this._interactionManager = new InteractionManager(engine, container);
|
|
3964
4007
|
const canvasSize = container.canvas.size;
|
|
3965
4008
|
this.quadTree = new QuadTree(qTreeRectangle(canvasSize), qTreeCapacity);
|
|
@@ -3976,17 +4019,21 @@ class Particles {
|
|
|
3976
4019
|
}
|
|
3977
4020
|
}
|
|
3978
4021
|
addParticle(position, overrideOptions, group, initializer) {
|
|
3979
|
-
this.
|
|
3980
|
-
const container = this._container, options = container.actualOptions, limit = options.particles.number.limit;
|
|
4022
|
+
const limitOptions = this._container.actualOptions.particles.number.limit, limit = group === undefined ? this._limit : this._groupLimits.get(group) ?? this._limit, currentCount = this.count;
|
|
3981
4023
|
if (limit > 0) {
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
4024
|
+
if (limitOptions.mode === "delete") {
|
|
4025
|
+
const countToRemove = currentCount + 1 - limit;
|
|
4026
|
+
if (countToRemove > 0) {
|
|
4027
|
+
this.removeQuantity(countToRemove);
|
|
4028
|
+
}
|
|
4029
|
+
}
|
|
4030
|
+
else if (limitOptions.mode === "wait") {
|
|
4031
|
+
if (currentCount >= limit) {
|
|
4032
|
+
return;
|
|
4033
|
+
}
|
|
3985
4034
|
}
|
|
3986
4035
|
}
|
|
3987
|
-
|
|
3988
|
-
this.pushing = false;
|
|
3989
|
-
return res;
|
|
4036
|
+
return this._pushParticle(position, overrideOptions, group, initializer);
|
|
3990
4037
|
}
|
|
3991
4038
|
clear() {
|
|
3992
4039
|
this._array = [];
|
|
@@ -4023,8 +4070,8 @@ class Particles {
|
|
|
4023
4070
|
}
|
|
4024
4071
|
init() {
|
|
4025
4072
|
const container = this._container, options = container.actualOptions;
|
|
4026
|
-
this.
|
|
4027
|
-
this.
|
|
4073
|
+
this._lastZIndex = 0;
|
|
4074
|
+
this._needsSort = false;
|
|
4028
4075
|
let handled = false;
|
|
4029
4076
|
this.updaters = this._engine.getUpdaters(container, true);
|
|
4030
4077
|
this._interactionManager.init();
|
|
@@ -4042,7 +4089,7 @@ class Particles {
|
|
|
4042
4089
|
}
|
|
4043
4090
|
this.addManualParticles();
|
|
4044
4091
|
if (!handled) {
|
|
4045
|
-
const particlesOptions = options.particles, groups =
|
|
4092
|
+
const particlesOptions = options.particles, groups = particlesOptions.groups;
|
|
4046
4093
|
for (const group in groups) {
|
|
4047
4094
|
const groupOptions = groups[group];
|
|
4048
4095
|
for (let i = this.count, j = 0; j < groupOptions.number?.value && i < particlesOptions.number.value; i++, j++) {
|
|
@@ -4086,6 +4133,13 @@ class Particles {
|
|
|
4086
4133
|
}
|
|
4087
4134
|
this._applyDensity(options.particles, options.manualParticles.length);
|
|
4088
4135
|
}
|
|
4136
|
+
setLastZIndex(zIndex) {
|
|
4137
|
+
this._lastZIndex = zIndex;
|
|
4138
|
+
this._needsSort = this._needsSort || this._lastZIndex < zIndex;
|
|
4139
|
+
}
|
|
4140
|
+
setResizeFactor(factor) {
|
|
4141
|
+
this._resizeFactor = factor;
|
|
4142
|
+
}
|
|
4089
4143
|
async update(delta) {
|
|
4090
4144
|
const container = this._container, particlesToDelete = new Set();
|
|
4091
4145
|
this.quadTree = new QuadTree(qTreeRectangle(container.canvas.size), qTreeCapacity);
|
|
@@ -4093,10 +4147,10 @@ class Particles {
|
|
|
4093
4147
|
pathGenerator.update();
|
|
4094
4148
|
}
|
|
4095
4149
|
for (const [, plugin] of container.plugins) {
|
|
4096
|
-
plugin.update && plugin.update(delta);
|
|
4150
|
+
plugin.update && (await plugin.update(delta));
|
|
4097
4151
|
}
|
|
4152
|
+
const resizeFactor = this._resizeFactor;
|
|
4098
4153
|
for (const particle of this._array) {
|
|
4099
|
-
const resizeFactor = container.canvas.resizeFactor;
|
|
4100
4154
|
if (resizeFactor && !particle.ignoresResizeRatio) {
|
|
4101
4155
|
particle.position.x *= resizeFactor.width;
|
|
4102
4156
|
particle.position.y *= resizeFactor.height;
|
|
@@ -4124,7 +4178,7 @@ class Particles {
|
|
|
4124
4178
|
const checkDelete = (p) => !particlesToDelete.has(p);
|
|
4125
4179
|
this._array = this.filter(checkDelete);
|
|
4126
4180
|
this._zArray = this._zArray.filter(checkDelete);
|
|
4127
|
-
this.
|
|
4181
|
+
this._pool.push(...particlesToDelete);
|
|
4128
4182
|
}
|
|
4129
4183
|
await this._interactionManager.externalInteract(delta);
|
|
4130
4184
|
for (const particle of this._array) {
|
|
@@ -4135,17 +4189,17 @@ class Particles {
|
|
|
4135
4189
|
await this._interactionManager.particlesInteract(particle, delta);
|
|
4136
4190
|
}
|
|
4137
4191
|
}
|
|
4138
|
-
delete
|
|
4139
|
-
if (this.
|
|
4192
|
+
delete this._resizeFactor;
|
|
4193
|
+
if (this._needsSort) {
|
|
4140
4194
|
const zArray = this._zArray;
|
|
4141
4195
|
zArray.sort((a, b) => b.position.z - a.position.z || a.id - b.id);
|
|
4142
|
-
this.
|
|
4143
|
-
this.
|
|
4196
|
+
this._lastZIndex = zArray[zArray.length - 1].position.z;
|
|
4197
|
+
this._needsSort = false;
|
|
4144
4198
|
}
|
|
4145
4199
|
}
|
|
4146
4200
|
}
|
|
4147
4201
|
|
|
4148
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
4202
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Core/Retina.js
|
|
4149
4203
|
|
|
4150
4204
|
|
|
4151
4205
|
class Retina {
|
|
@@ -4165,24 +4219,22 @@ class Retina {
|
|
|
4165
4219
|
canvas.size.height = element.offsetHeight * ratio;
|
|
4166
4220
|
}
|
|
4167
4221
|
const particles = options.particles, moveOptions = particles.move;
|
|
4168
|
-
this.
|
|
4169
|
-
this.
|
|
4170
|
-
this.sizeAnimationSpeed = getRangeValue(particles.size.animation.speed) * ratio;
|
|
4222
|
+
this.maxSpeed = NumberUtils_getRangeValue(moveOptions.gravity.maxSpeed) * ratio;
|
|
4223
|
+
this.sizeAnimationSpeed = NumberUtils_getRangeValue(particles.size.animation.speed) * ratio;
|
|
4171
4224
|
}
|
|
4172
4225
|
initParticle(particle) {
|
|
4173
4226
|
const options = particle.options, ratio = this.pixelRatio, moveOptions = options.move, moveDistance = moveOptions.distance, props = particle.retina;
|
|
4174
|
-
props.
|
|
4175
|
-
props.
|
|
4176
|
-
props.
|
|
4177
|
-
props.sizeAnimationSpeed = getRangeValue(options.size.animation.speed) * ratio;
|
|
4227
|
+
props.moveDrift = NumberUtils_getRangeValue(moveOptions.drift) * ratio;
|
|
4228
|
+
props.moveSpeed = NumberUtils_getRangeValue(moveOptions.speed) * ratio;
|
|
4229
|
+
props.sizeAnimationSpeed = NumberUtils_getRangeValue(options.size.animation.speed) * ratio;
|
|
4178
4230
|
const maxDistance = props.maxDistance;
|
|
4179
4231
|
maxDistance.horizontal = moveDistance.horizontal !== undefined ? moveDistance.horizontal * ratio : undefined;
|
|
4180
4232
|
maxDistance.vertical = moveDistance.vertical !== undefined ? moveDistance.vertical * ratio : undefined;
|
|
4181
|
-
props.maxSpeed =
|
|
4233
|
+
props.maxSpeed = NumberUtils_getRangeValue(moveOptions.gravity.maxSpeed) * ratio;
|
|
4182
4234
|
}
|
|
4183
4235
|
}
|
|
4184
4236
|
|
|
4185
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
4237
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Core/Container.js
|
|
4186
4238
|
|
|
4187
4239
|
|
|
4188
4240
|
|
|
@@ -4208,7 +4260,6 @@ function loadContainerOptions(engine, container, ...sourceOptionsArr) {
|
|
|
4208
4260
|
}
|
|
4209
4261
|
class Container {
|
|
4210
4262
|
constructor(engine, id, sourceOptions) {
|
|
4211
|
-
this.id = id;
|
|
4212
4263
|
this._intersectionManager = (entries) => {
|
|
4213
4264
|
if (!guardCheck(this) || !this.actualOptions.pauseOnOutsideViewport) {
|
|
4214
4265
|
return;
|
|
@@ -4222,16 +4273,16 @@ class Container {
|
|
|
4222
4273
|
};
|
|
4223
4274
|
this._nextFrame = async (timestamp) => {
|
|
4224
4275
|
try {
|
|
4225
|
-
if (!this.
|
|
4226
|
-
this.
|
|
4227
|
-
timestamp < this.
|
|
4276
|
+
if (!this._smooth &&
|
|
4277
|
+
this._lastFrameTime !== undefined &&
|
|
4278
|
+
timestamp < this._lastFrameTime + 1000 / this.fpsLimit) {
|
|
4228
4279
|
this.draw(false);
|
|
4229
4280
|
return;
|
|
4230
4281
|
}
|
|
4231
|
-
this.
|
|
4232
|
-
const delta = initDelta(timestamp - this.
|
|
4282
|
+
this._lastFrameTime ??= timestamp;
|
|
4283
|
+
const delta = initDelta(timestamp - this._lastFrameTime, this.fpsLimit, this._smooth);
|
|
4233
4284
|
this.addLifeTime(delta.value);
|
|
4234
|
-
this.
|
|
4285
|
+
this._lastFrameTime = timestamp;
|
|
4235
4286
|
if (delta.value > 1000) {
|
|
4236
4287
|
this.draw(false);
|
|
4237
4288
|
return;
|
|
@@ -4250,8 +4301,9 @@ class Container {
|
|
|
4250
4301
|
}
|
|
4251
4302
|
};
|
|
4252
4303
|
this._engine = engine;
|
|
4304
|
+
this.id = Symbol(id);
|
|
4253
4305
|
this.fpsLimit = 120;
|
|
4254
|
-
this.
|
|
4306
|
+
this._smooth = false;
|
|
4255
4307
|
this._delay = 0;
|
|
4256
4308
|
this._duration = 0;
|
|
4257
4309
|
this._lifeTime = 0;
|
|
@@ -4259,7 +4311,7 @@ class Container {
|
|
|
4259
4311
|
this.started = false;
|
|
4260
4312
|
this.destroyed = false;
|
|
4261
4313
|
this._paused = true;
|
|
4262
|
-
this.
|
|
4314
|
+
this._lastFrameTime = 0;
|
|
4263
4315
|
this.zLayers = 100;
|
|
4264
4316
|
this.pageHidden = false;
|
|
4265
4317
|
this._sourceOptions = sourceOptions;
|
|
@@ -4275,13 +4327,12 @@ class Container {
|
|
|
4275
4327
|
},
|
|
4276
4328
|
};
|
|
4277
4329
|
this.plugins = new Map();
|
|
4278
|
-
this.
|
|
4330
|
+
this.effectDrawers = new Map();
|
|
4331
|
+
this.shapeDrawers = new Map();
|
|
4279
4332
|
this._options = loadContainerOptions(this._engine, this);
|
|
4280
4333
|
this.actualOptions = loadContainerOptions(this._engine, this);
|
|
4281
4334
|
this._eventListeners = new EventListeners(this);
|
|
4282
|
-
|
|
4283
|
-
this._intersectionObserver = new IntersectionObserver((entries) => this._intersectionManager(entries));
|
|
4284
|
-
}
|
|
4335
|
+
this._intersectionObserver = safeIntersectionObserver((entries) => this._intersectionManager(entries));
|
|
4285
4336
|
this._engine.dispatchEvent("containerBuilt", { container: this });
|
|
4286
4337
|
}
|
|
4287
4338
|
get options() {
|
|
@@ -4387,11 +4438,17 @@ class Container {
|
|
|
4387
4438
|
this.stop();
|
|
4388
4439
|
this.particles.destroy();
|
|
4389
4440
|
this.canvas.destroy();
|
|
4390
|
-
for (const [,
|
|
4391
|
-
|
|
4441
|
+
for (const [, effectDrawer] of this.effectDrawers) {
|
|
4442
|
+
effectDrawer.destroy && effectDrawer.destroy(this);
|
|
4443
|
+
}
|
|
4444
|
+
for (const [, shapeDrawer] of this.shapeDrawers) {
|
|
4445
|
+
shapeDrawer.destroy && shapeDrawer.destroy(this);
|
|
4446
|
+
}
|
|
4447
|
+
for (const key of this.effectDrawers.keys()) {
|
|
4448
|
+
this.effectDrawers.delete(key);
|
|
4392
4449
|
}
|
|
4393
|
-
for (const key of this.
|
|
4394
|
-
this.
|
|
4450
|
+
for (const key of this.shapeDrawers.keys()) {
|
|
4451
|
+
this.shapeDrawers.delete(key);
|
|
4395
4452
|
}
|
|
4396
4453
|
this._engine.clearPlugins(this);
|
|
4397
4454
|
this.destroyed = true;
|
|
@@ -4408,7 +4465,7 @@ class Container {
|
|
|
4408
4465
|
let refreshTime = force;
|
|
4409
4466
|
this._drawAnimationFrame = requestAnimationFrame(async (timestamp) => {
|
|
4410
4467
|
if (refreshTime) {
|
|
4411
|
-
this.
|
|
4468
|
+
this._lastFrameTime = undefined;
|
|
4412
4469
|
refreshTime = false;
|
|
4413
4470
|
}
|
|
4414
4471
|
await this._nextFrame(timestamp);
|
|
@@ -4443,11 +4500,18 @@ class Container {
|
|
|
4443
4500
|
if (!guardCheck(this)) {
|
|
4444
4501
|
return;
|
|
4445
4502
|
}
|
|
4503
|
+
const effects = this._engine.getSupportedEffects();
|
|
4504
|
+
for (const type of effects) {
|
|
4505
|
+
const drawer = this._engine.getEffectDrawer(type);
|
|
4506
|
+
if (drawer) {
|
|
4507
|
+
this.effectDrawers.set(type, drawer);
|
|
4508
|
+
}
|
|
4509
|
+
}
|
|
4446
4510
|
const shapes = this._engine.getSupportedShapes();
|
|
4447
4511
|
for (const type of shapes) {
|
|
4448
4512
|
const drawer = this._engine.getShapeDrawer(type);
|
|
4449
4513
|
if (drawer) {
|
|
4450
|
-
this.
|
|
4514
|
+
this.shapeDrawers.set(type, drawer);
|
|
4451
4515
|
}
|
|
4452
4516
|
}
|
|
4453
4517
|
this._options = loadContainerOptions(this._engine, this, this._initialSourceOptions, this.sourceOptions);
|
|
@@ -4462,12 +4526,15 @@ class Container {
|
|
|
4462
4526
|
this.canvas.initBackground();
|
|
4463
4527
|
this.canvas.resize();
|
|
4464
4528
|
this.zLayers = this.actualOptions.zLayers;
|
|
4465
|
-
this._duration =
|
|
4466
|
-
this._delay =
|
|
4529
|
+
this._duration = NumberUtils_getRangeValue(this.actualOptions.duration) * 1000;
|
|
4530
|
+
this._delay = NumberUtils_getRangeValue(this.actualOptions.delay) * 1000;
|
|
4467
4531
|
this._lifeTime = 0;
|
|
4468
4532
|
this.fpsLimit = this.actualOptions.fpsLimit > 0 ? this.actualOptions.fpsLimit : 120;
|
|
4469
|
-
this.
|
|
4470
|
-
for (const [, drawer] of this.
|
|
4533
|
+
this._smooth = this.actualOptions.smooth;
|
|
4534
|
+
for (const [, drawer] of this.effectDrawers) {
|
|
4535
|
+
drawer.init && (await drawer.init(this));
|
|
4536
|
+
}
|
|
4537
|
+
for (const [, drawer] of this.shapeDrawers) {
|
|
4471
4538
|
drawer.init && (await drawer.init(this));
|
|
4472
4539
|
}
|
|
4473
4540
|
for (const [, plugin] of this.plugins) {
|
|
@@ -4596,15 +4663,15 @@ class Container {
|
|
|
4596
4663
|
this.actualOptions.responsive = [];
|
|
4597
4664
|
const newMaxWidth = this.actualOptions.setResponsive(this.canvas.size.width, this.retina.pixelRatio, this._options);
|
|
4598
4665
|
this.actualOptions.setTheme(this._currentTheme);
|
|
4599
|
-
if (this.
|
|
4666
|
+
if (this._responsiveMaxWidth === newMaxWidth) {
|
|
4600
4667
|
return false;
|
|
4601
4668
|
}
|
|
4602
|
-
this.
|
|
4669
|
+
this._responsiveMaxWidth = newMaxWidth;
|
|
4603
4670
|
return true;
|
|
4604
4671
|
}
|
|
4605
4672
|
}
|
|
4606
4673
|
|
|
4607
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
4674
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Utils/EventDispatcher.js
|
|
4608
4675
|
class EventDispatcher {
|
|
4609
4676
|
constructor() {
|
|
4610
4677
|
this._listeners = new Map();
|
|
@@ -4651,7 +4718,7 @@ class EventDispatcher {
|
|
|
4651
4718
|
}
|
|
4652
4719
|
}
|
|
4653
4720
|
|
|
4654
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
4721
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Core/Engine.js
|
|
4655
4722
|
|
|
4656
4723
|
|
|
4657
4724
|
|
|
@@ -4693,7 +4760,8 @@ class Engine {
|
|
|
4693
4760
|
this.movers = new Map();
|
|
4694
4761
|
this.updaters = new Map();
|
|
4695
4762
|
this.presets = new Map();
|
|
4696
|
-
this.
|
|
4763
|
+
this.effectDrawers = new Map();
|
|
4764
|
+
this.shapeDrawers = new Map();
|
|
4697
4765
|
this.pathGenerators = new Map();
|
|
4698
4766
|
}
|
|
4699
4767
|
get configs() {
|
|
@@ -4704,18 +4772,18 @@ class Engine {
|
|
|
4704
4772
|
return res;
|
|
4705
4773
|
}
|
|
4706
4774
|
get version() {
|
|
4707
|
-
return "3.0.0-beta.
|
|
4775
|
+
return "3.0.0-beta.4";
|
|
4708
4776
|
}
|
|
4709
|
-
addConfig(
|
|
4710
|
-
|
|
4711
|
-
|
|
4712
|
-
|
|
4713
|
-
|
|
4714
|
-
|
|
4715
|
-
|
|
4716
|
-
|
|
4717
|
-
|
|
4718
|
-
|
|
4777
|
+
addConfig(config) {
|
|
4778
|
+
const name = config.name ?? "default";
|
|
4779
|
+
this._configs.set(name, config);
|
|
4780
|
+
this._eventDispatcher.dispatchEvent("configAdded", { data: { name, config } });
|
|
4781
|
+
}
|
|
4782
|
+
async addEffect(effect, drawer, refresh = true) {
|
|
4783
|
+
executeOnSingleOrMultiple(effect, (type) => {
|
|
4784
|
+
!this.getEffectDrawer(type) && this.effectDrawers.set(type, drawer);
|
|
4785
|
+
});
|
|
4786
|
+
await this.refresh(refresh);
|
|
4719
4787
|
}
|
|
4720
4788
|
addEventListener(type, listener) {
|
|
4721
4789
|
this._eventDispatcher.addEventListener(type, listener);
|
|
@@ -4744,45 +4812,11 @@ class Engine {
|
|
|
4744
4812
|
(override || !this.getPreset(preset)) && this.presets.set(preset, options);
|
|
4745
4813
|
await this.refresh(refresh);
|
|
4746
4814
|
}
|
|
4747
|
-
async addShape(shape, drawer,
|
|
4748
|
-
let customDrawer;
|
|
4749
|
-
let realRefresh = refresh, realInit, realAfterEffect, realDestroy;
|
|
4750
|
-
if (isBoolean(initOrRefresh)) {
|
|
4751
|
-
realRefresh = initOrRefresh;
|
|
4752
|
-
realInit = undefined;
|
|
4753
|
-
}
|
|
4754
|
-
else {
|
|
4755
|
-
realInit = initOrRefresh;
|
|
4756
|
-
}
|
|
4757
|
-
if (isBoolean(afterEffectOrRefresh)) {
|
|
4758
|
-
realRefresh = afterEffectOrRefresh;
|
|
4759
|
-
realAfterEffect = undefined;
|
|
4760
|
-
}
|
|
4761
|
-
else {
|
|
4762
|
-
realAfterEffect = afterEffectOrRefresh;
|
|
4763
|
-
}
|
|
4764
|
-
if (isBoolean(destroyOrRefresh)) {
|
|
4765
|
-
realRefresh = destroyOrRefresh;
|
|
4766
|
-
realDestroy = undefined;
|
|
4767
|
-
}
|
|
4768
|
-
else {
|
|
4769
|
-
realDestroy = destroyOrRefresh;
|
|
4770
|
-
}
|
|
4771
|
-
if (isFunction(drawer)) {
|
|
4772
|
-
customDrawer = {
|
|
4773
|
-
afterEffect: realAfterEffect,
|
|
4774
|
-
destroy: realDestroy,
|
|
4775
|
-
draw: drawer,
|
|
4776
|
-
init: realInit,
|
|
4777
|
-
};
|
|
4778
|
-
}
|
|
4779
|
-
else {
|
|
4780
|
-
customDrawer = drawer;
|
|
4781
|
-
}
|
|
4815
|
+
async addShape(shape, drawer, refresh = true) {
|
|
4782
4816
|
executeOnSingleOrMultiple(shape, (type) => {
|
|
4783
|
-
!this.getShapeDrawer(type) && this.
|
|
4817
|
+
!this.getShapeDrawer(type) && this.shapeDrawers.set(type, drawer);
|
|
4784
4818
|
});
|
|
4785
|
-
await this.refresh(
|
|
4819
|
+
await this.refresh(refresh);
|
|
4786
4820
|
}
|
|
4787
4821
|
clearPlugins(container) {
|
|
4788
4822
|
this.updaters.delete(container);
|
|
@@ -4810,6 +4844,9 @@ class Engine {
|
|
|
4810
4844
|
}
|
|
4811
4845
|
return res;
|
|
4812
4846
|
}
|
|
4847
|
+
getEffectDrawer(type) {
|
|
4848
|
+
return this.effectDrawers.get(type);
|
|
4849
|
+
}
|
|
4813
4850
|
getInteractors(container, force = false) {
|
|
4814
4851
|
return getItemsFromInitializer(container, this.interactors, this._initializers.interactors, force);
|
|
4815
4852
|
}
|
|
@@ -4826,10 +4863,13 @@ class Engine {
|
|
|
4826
4863
|
return this.presets.get(preset);
|
|
4827
4864
|
}
|
|
4828
4865
|
getShapeDrawer(type) {
|
|
4829
|
-
return this.
|
|
4866
|
+
return this.shapeDrawers.get(type);
|
|
4867
|
+
}
|
|
4868
|
+
getSupportedEffects() {
|
|
4869
|
+
return this.effectDrawers.keys();
|
|
4830
4870
|
}
|
|
4831
4871
|
getSupportedShapes() {
|
|
4832
|
-
return this.
|
|
4872
|
+
return this.shapeDrawers.keys();
|
|
4833
4873
|
}
|
|
4834
4874
|
getUpdaters(container, force = false) {
|
|
4835
4875
|
return getItemsFromInitializer(container, this.updaters, this._initializers.updaters, force);
|
|
@@ -4848,7 +4888,7 @@ class Engine {
|
|
|
4848
4888
|
domContainer.id = id;
|
|
4849
4889
|
document.body.append(domContainer);
|
|
4850
4890
|
}
|
|
4851
|
-
const currentOptions = itemFromSingleOrMultiple(options, index), dom = this.dom(), oldIndex = dom.findIndex((v) => v.id === id);
|
|
4891
|
+
const currentOptions = itemFromSingleOrMultiple(options, index), dom = this.dom(), oldIndex = dom.findIndex((v) => v.id.description === id);
|
|
4852
4892
|
if (oldIndex >= 0) {
|
|
4853
4893
|
const old = this.domItem(oldIndex);
|
|
4854
4894
|
if (old && !old.destroyed) {
|
|
@@ -4924,7 +4964,7 @@ class Engine {
|
|
|
4924
4964
|
}
|
|
4925
4965
|
}
|
|
4926
4966
|
|
|
4927
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
4967
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Utils/HslColorManager.js
|
|
4928
4968
|
|
|
4929
4969
|
|
|
4930
4970
|
class HslColorManager {
|
|
@@ -4942,9 +4982,9 @@ class HslColorManager {
|
|
|
4942
4982
|
const colorValue = color.value, hslColor = colorValue.hsl ?? color.value;
|
|
4943
4983
|
if (hslColor.h !== undefined && hslColor.l !== undefined) {
|
|
4944
4984
|
return hslToRgb({
|
|
4945
|
-
h:
|
|
4946
|
-
l:
|
|
4947
|
-
s:
|
|
4985
|
+
h: NumberUtils_getRangeValue(hslColor.h),
|
|
4986
|
+
l: NumberUtils_getRangeValue(hslColor.l),
|
|
4987
|
+
s: NumberUtils_getRangeValue(hslColor.s),
|
|
4948
4988
|
});
|
|
4949
4989
|
}
|
|
4950
4990
|
}
|
|
@@ -4964,7 +5004,7 @@ class HslColorManager {
|
|
|
4964
5004
|
}
|
|
4965
5005
|
}
|
|
4966
5006
|
|
|
4967
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
5007
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/Utils/RgbColorManager.js
|
|
4968
5008
|
|
|
4969
5009
|
class RgbColorManager {
|
|
4970
5010
|
constructor() {
|
|
@@ -4981,9 +5021,9 @@ class RgbColorManager {
|
|
|
4981
5021
|
const colorValue = color.value, rgbColor = colorValue.rgb ?? color.value;
|
|
4982
5022
|
if (rgbColor.r !== undefined) {
|
|
4983
5023
|
return {
|
|
4984
|
-
r:
|
|
4985
|
-
g:
|
|
4986
|
-
b:
|
|
5024
|
+
r: NumberUtils_getRangeValue(rgbColor.r),
|
|
5025
|
+
g: NumberUtils_getRangeValue(rgbColor.g),
|
|
5026
|
+
b: NumberUtils_getRangeValue(rgbColor.b),
|
|
4987
5027
|
};
|
|
4988
5028
|
}
|
|
4989
5029
|
}
|
|
@@ -5003,7 +5043,7 @@ class RgbColorManager {
|
|
|
5003
5043
|
}
|
|
5004
5044
|
}
|
|
5005
5045
|
|
|
5006
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
5046
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/init.js
|
|
5007
5047
|
|
|
5008
5048
|
|
|
5009
5049
|
|
|
@@ -5017,7 +5057,7 @@ function init() {
|
|
|
5017
5057
|
return engine;
|
|
5018
5058
|
}
|
|
5019
5059
|
|
|
5020
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.
|
|
5060
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/exports.js
|
|
5021
5061
|
|
|
5022
5062
|
|
|
5023
5063
|
|
|
@@ -5107,8 +5147,7 @@ function init() {
|
|
|
5107
5147
|
|
|
5108
5148
|
|
|
5109
5149
|
|
|
5110
|
-
|
|
5111
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.1/node_modules/@tsparticles/engine/browser/index.js
|
|
5150
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+engine@3.0.0-beta.4/node_modules/@tsparticles/engine/browser/index.js
|
|
5112
5151
|
|
|
5113
5152
|
|
|
5114
5153
|
const tsParticles = init();
|
|
@@ -5119,7 +5158,7 @@ if (!isSsr()) {
|
|
|
5119
5158
|
|
|
5120
5159
|
|
|
5121
5160
|
|
|
5122
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+move-base@3.0.0-beta.
|
|
5161
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+move-base@3.0.0-beta.4/node_modules/@tsparticles/move-base/browser/Utils.js
|
|
5123
5162
|
|
|
5124
5163
|
function applyDistance(particle) {
|
|
5125
5164
|
const initialPosition = particle.initialPosition, { dx, dy } = NumberUtils_getDistances(initialPosition, particle.position), dxFixed = Math.abs(dx), dyFixed = Math.abs(dy), { maxDistance } = particle.retina, hDistance = maxDistance.horizontal, vDistance = maxDistance.vertical;
|
|
@@ -5129,10 +5168,10 @@ function applyDistance(particle) {
|
|
|
5129
5168
|
if (((hDistance && dxFixed >= hDistance) || (vDistance && dyFixed >= vDistance)) && !particle.misplaced) {
|
|
5130
5169
|
particle.misplaced = (!!hDistance && dxFixed > hDistance) || (!!vDistance && dyFixed > vDistance);
|
|
5131
5170
|
if (hDistance) {
|
|
5132
|
-
particle.velocity.x = particle.velocity.y
|
|
5171
|
+
particle.velocity.x = particle.velocity.y * 0.5 - particle.velocity.x;
|
|
5133
5172
|
}
|
|
5134
5173
|
if (vDistance) {
|
|
5135
|
-
particle.velocity.y = particle.velocity.x
|
|
5174
|
+
particle.velocity.y = particle.velocity.x * 0.5 - particle.velocity.y;
|
|
5136
5175
|
}
|
|
5137
5176
|
}
|
|
5138
5177
|
else if ((!hDistance || dxFixed < hDistance) && (!vDistance || dyFixed < vDistance) && particle.misplaced) {
|
|
@@ -5190,16 +5229,16 @@ function spin(particle, moveSpeed) {
|
|
|
5190
5229
|
particle.position.x = particle.spin.center.x + particle.spin.radius * updateFunc.x(particle.spin.angle);
|
|
5191
5230
|
particle.position.y = particle.spin.center.y + particle.spin.radius * updateFunc.y(particle.spin.angle);
|
|
5192
5231
|
particle.spin.radius += particle.spin.acceleration;
|
|
5193
|
-
const maxCanvasSize = Math.max(container.canvas.size.width, container.canvas.size.height);
|
|
5194
|
-
if (particle.spin.radius >
|
|
5195
|
-
particle.spin.radius =
|
|
5232
|
+
const maxCanvasSize = Math.max(container.canvas.size.width, container.canvas.size.height), halfMaxSize = maxCanvasSize * 0.5;
|
|
5233
|
+
if (particle.spin.radius > halfMaxSize) {
|
|
5234
|
+
particle.spin.radius = halfMaxSize;
|
|
5196
5235
|
particle.spin.acceleration *= -1;
|
|
5197
5236
|
}
|
|
5198
5237
|
else if (particle.spin.radius < 0) {
|
|
5199
5238
|
particle.spin.radius = 0;
|
|
5200
5239
|
particle.spin.acceleration *= -1;
|
|
5201
5240
|
}
|
|
5202
|
-
particle.spin.angle +=
|
|
5241
|
+
particle.spin.angle += moveSpeed * 0.01 * (1 - particle.spin.radius / maxCanvasSize);
|
|
5203
5242
|
}
|
|
5204
5243
|
function applyPath(particle, delta) {
|
|
5205
5244
|
const particlesOptions = particle.options, pathOptions = particlesOptions.move.path, pathEnabled = pathOptions.enable;
|
|
@@ -5224,7 +5263,7 @@ function getProximitySpeedFactor(particle) {
|
|
|
5224
5263
|
return particle.slow.inRange ? particle.slow.factor : 1;
|
|
5225
5264
|
}
|
|
5226
5265
|
|
|
5227
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+move-base@3.0.0-beta.
|
|
5266
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+move-base@3.0.0-beta.4/node_modules/@tsparticles/move-base/browser/BaseMover.js
|
|
5228
5267
|
|
|
5229
5268
|
|
|
5230
5269
|
const diffFactor = 2;
|
|
@@ -5236,9 +5275,9 @@ class BaseMover {
|
|
|
5236
5275
|
return;
|
|
5237
5276
|
}
|
|
5238
5277
|
const spinPos = spinOptions.position ?? { x: 50, y: 50 }, spinCenter = {
|
|
5239
|
-
x:
|
|
5240
|
-
y:
|
|
5241
|
-
}, pos = particle.getPosition(), distance = getDistance(pos, spinCenter), spinAcceleration =
|
|
5278
|
+
x: spinPos.x * 0.01 * container.canvas.size.width,
|
|
5279
|
+
y: spinPos.y * 0.01 * container.canvas.size.height,
|
|
5280
|
+
}, pos = particle.getPosition(), distance = getDistance(pos, spinCenter), spinAcceleration = NumberUtils_getRangeValue(spinOptions.acceleration);
|
|
5242
5281
|
particle.retina.spinAcceleration = spinAcceleration * container.retina.pixelRatio;
|
|
5243
5282
|
particle.spin = {
|
|
5244
5283
|
center: spinCenter,
|
|
@@ -5253,7 +5292,7 @@ class BaseMover {
|
|
|
5253
5292
|
const options = particle.options, gravityOptions = options.move.gravity;
|
|
5254
5293
|
particle.gravity = {
|
|
5255
5294
|
enable: gravityOptions.enable,
|
|
5256
|
-
acceleration:
|
|
5295
|
+
acceleration: NumberUtils_getRangeValue(gravityOptions.acceleration),
|
|
5257
5296
|
inverse: gravityOptions.inverse,
|
|
5258
5297
|
};
|
|
5259
5298
|
this._initSpin(particle);
|
|
@@ -5266,8 +5305,8 @@ class BaseMover {
|
|
|
5266
5305
|
if (!moveOptions.enable) {
|
|
5267
5306
|
return;
|
|
5268
5307
|
}
|
|
5269
|
-
const container = particle.container, pxRatio = container.retina.pixelRatio, slowFactor = getProximitySpeedFactor(particle), baseSpeed = (particle.retina.moveSpeed ??=
|
|
5270
|
-
container.retina.reduceFactor, moveDrift = (particle.retina.moveDrift ??=
|
|
5308
|
+
const container = particle.container, pxRatio = container.retina.pixelRatio, slowFactor = getProximitySpeedFactor(particle), baseSpeed = (particle.retina.moveSpeed ??= NumberUtils_getRangeValue(moveOptions.speed) * pxRatio) *
|
|
5309
|
+
container.retina.reduceFactor, moveDrift = (particle.retina.moveDrift ??= NumberUtils_getRangeValue(particle.options.move.drift) * pxRatio), maxSize = getRangeMax(particleOptions.size.value) * pxRatio, sizeFactor = moveOptions.size ? particle.getRadius() / maxSize : 1, moveSpeed = (baseSpeed * sizeFactor * slowFactor * (delta.factor || 1)) / diffFactor, maxSpeed = particle.retina.maxSpeed ?? container.retina.maxSpeed;
|
|
5271
5310
|
if (moveOptions.spin.enable) {
|
|
5272
5311
|
spin(particle, moveSpeed);
|
|
5273
5312
|
}
|
|
@@ -5278,16 +5317,17 @@ class BaseMover {
|
|
|
5278
5317
|
}
|
|
5279
5318
|
}
|
|
5280
5319
|
|
|
5281
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+move-base@3.0.0-beta.
|
|
5320
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+move-base@3.0.0-beta.4/node_modules/@tsparticles/move-base/browser/index.js
|
|
5282
5321
|
|
|
5283
5322
|
async function loadBaseMover(engine, refresh = true) {
|
|
5284
5323
|
await engine.addMover("base", () => new BaseMover(), refresh);
|
|
5285
5324
|
}
|
|
5286
5325
|
|
|
5287
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+shape-circle@3.0.0-beta.
|
|
5326
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+shape-circle@3.0.0-beta.4/node_modules/@tsparticles/shape-circle/browser/CircleDrawer.js
|
|
5288
5327
|
|
|
5289
5328
|
class CircleDrawer {
|
|
5290
|
-
draw(
|
|
5329
|
+
draw(data) {
|
|
5330
|
+
const { context, particle, radius } = data;
|
|
5291
5331
|
if (!particle.circleRange) {
|
|
5292
5332
|
particle.circleRange = { min: 0, max: Math.PI * 2 };
|
|
5293
5333
|
}
|
|
@@ -5311,13 +5351,13 @@ class CircleDrawer {
|
|
|
5311
5351
|
}
|
|
5312
5352
|
}
|
|
5313
5353
|
|
|
5314
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+shape-circle@3.0.0-beta.
|
|
5354
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+shape-circle@3.0.0-beta.4/node_modules/@tsparticles/shape-circle/browser/index.js
|
|
5315
5355
|
|
|
5316
5356
|
async function loadCircleShape(engine, refresh = true) {
|
|
5317
5357
|
await engine.addShape("circle", new CircleDrawer(), refresh);
|
|
5318
5358
|
}
|
|
5319
5359
|
|
|
5320
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-color@3.0.0-beta.
|
|
5360
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-color@3.0.0-beta.4/node_modules/@tsparticles/updater-color/browser/Utils.js
|
|
5321
5361
|
|
|
5322
5362
|
function updateColorValue(delta, colorValue, valueAnimation, max, decrease) {
|
|
5323
5363
|
if (!colorValue ||
|
|
@@ -5383,7 +5423,7 @@ function updateColor(particle, delta) {
|
|
|
5383
5423
|
}
|
|
5384
5424
|
}
|
|
5385
5425
|
|
|
5386
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-color@3.0.0-beta.
|
|
5426
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-color@3.0.0-beta.4/node_modules/@tsparticles/updater-color/browser/ColorUpdater.js
|
|
5387
5427
|
|
|
5388
5428
|
|
|
5389
5429
|
class ColorUpdater {
|
|
@@ -5409,13 +5449,13 @@ class ColorUpdater {
|
|
|
5409
5449
|
}
|
|
5410
5450
|
}
|
|
5411
5451
|
|
|
5412
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-color@3.0.0-beta.
|
|
5452
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-color@3.0.0-beta.4/node_modules/@tsparticles/updater-color/browser/index.js
|
|
5413
5453
|
|
|
5414
5454
|
async function loadColorUpdater(engine, refresh = true) {
|
|
5415
5455
|
await engine.addParticleUpdater("color", (container) => new ColorUpdater(container), refresh);
|
|
5416
5456
|
}
|
|
5417
5457
|
|
|
5418
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-opacity@3.0.0-beta.
|
|
5458
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-opacity@3.0.0-beta.4/node_modules/@tsparticles/updater-opacity/browser/Utils.js
|
|
5419
5459
|
|
|
5420
5460
|
function checkDestroy(particle, value, minValue, maxValue) {
|
|
5421
5461
|
switch (particle.options.opacity.animation.destroy) {
|
|
@@ -5481,7 +5521,7 @@ function updateOpacity(particle, delta) {
|
|
|
5481
5521
|
}
|
|
5482
5522
|
}
|
|
5483
5523
|
|
|
5484
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-opacity@3.0.0-beta.
|
|
5524
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-opacity@3.0.0-beta.4/node_modules/@tsparticles/updater-opacity/browser/OpacityUpdater.js
|
|
5485
5525
|
|
|
5486
5526
|
|
|
5487
5527
|
class OpacityUpdater {
|
|
@@ -5494,7 +5534,7 @@ class OpacityUpdater {
|
|
|
5494
5534
|
const opacityAnimation = opacityOptions.animation;
|
|
5495
5535
|
if (opacityAnimation.enable) {
|
|
5496
5536
|
particle.opacity.velocity =
|
|
5497
|
-
(
|
|
5537
|
+
(NumberUtils_getRangeValue(opacityAnimation.speed) / 100) * this.container.retina.reduceFactor;
|
|
5498
5538
|
if (!opacityAnimation.sync) {
|
|
5499
5539
|
particle.opacity.velocity *= getRandom();
|
|
5500
5540
|
}
|
|
@@ -5523,13 +5563,13 @@ class OpacityUpdater {
|
|
|
5523
5563
|
}
|
|
5524
5564
|
}
|
|
5525
5565
|
|
|
5526
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-opacity@3.0.0-beta.
|
|
5566
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-opacity@3.0.0-beta.4/node_modules/@tsparticles/updater-opacity/browser/index.js
|
|
5527
5567
|
|
|
5528
5568
|
async function loadOpacityUpdater(engine, refresh = true) {
|
|
5529
5569
|
await engine.addParticleUpdater("opacity", (container) => new OpacityUpdater(container), refresh);
|
|
5530
5570
|
}
|
|
5531
5571
|
|
|
5532
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-out-modes@3.0.0-beta.
|
|
5572
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-out-modes@3.0.0-beta.4/node_modules/@tsparticles/updater-out-modes/browser/Utils.js
|
|
5533
5573
|
|
|
5534
5574
|
function bounceHorizontal(data) {
|
|
5535
5575
|
if ((data.outMode !== "bounce" &&
|
|
@@ -5549,7 +5589,7 @@ function bounceHorizontal(data) {
|
|
|
5549
5589
|
let bounced = false;
|
|
5550
5590
|
if ((data.direction === "right" && data.bounds.right >= data.canvasSize.width && velocity > 0) ||
|
|
5551
5591
|
(data.direction === "left" && data.bounds.left <= 0 && velocity < 0)) {
|
|
5552
|
-
const newVelocity =
|
|
5592
|
+
const newVelocity = NumberUtils_getRangeValue(data.particle.options.bounce.horizontal.value);
|
|
5553
5593
|
data.particle.velocity.x *= -newVelocity;
|
|
5554
5594
|
bounced = true;
|
|
5555
5595
|
}
|
|
@@ -5585,7 +5625,7 @@ function bounceVertical(data) {
|
|
|
5585
5625
|
let bounced = false;
|
|
5586
5626
|
if ((data.direction === "bottom" && data.bounds.bottom >= data.canvasSize.height && velocity > 0) ||
|
|
5587
5627
|
(data.direction === "top" && data.bounds.top <= 0 && velocity < 0)) {
|
|
5588
|
-
const newVelocity =
|
|
5628
|
+
const newVelocity = NumberUtils_getRangeValue(data.particle.options.bounce.vertical.value);
|
|
5589
5629
|
data.particle.velocity.y *= -newVelocity;
|
|
5590
5630
|
bounced = true;
|
|
5591
5631
|
}
|
|
@@ -5604,7 +5644,7 @@ function bounceVertical(data) {
|
|
|
5604
5644
|
}
|
|
5605
5645
|
}
|
|
5606
5646
|
|
|
5607
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-out-modes@3.0.0-beta.
|
|
5647
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-out-modes@3.0.0-beta.4/node_modules/@tsparticles/updater-out-modes/browser/BounceOutMode.js
|
|
5608
5648
|
|
|
5609
5649
|
|
|
5610
5650
|
class BounceOutMode {
|
|
@@ -5642,7 +5682,7 @@ class BounceOutMode {
|
|
|
5642
5682
|
}
|
|
5643
5683
|
}
|
|
5644
5684
|
|
|
5645
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-out-modes@3.0.0-beta.
|
|
5685
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-out-modes@3.0.0-beta.4/node_modules/@tsparticles/updater-out-modes/browser/DestroyOutMode.js
|
|
5646
5686
|
|
|
5647
5687
|
class DestroyOutMode {
|
|
5648
5688
|
constructor(container) {
|
|
@@ -5677,7 +5717,7 @@ class DestroyOutMode {
|
|
|
5677
5717
|
}
|
|
5678
5718
|
}
|
|
5679
5719
|
|
|
5680
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-out-modes@3.0.0-beta.
|
|
5720
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-out-modes@3.0.0-beta.4/node_modules/@tsparticles/updater-out-modes/browser/NoneOutMode.js
|
|
5681
5721
|
|
|
5682
5722
|
class NoneOutMode {
|
|
5683
5723
|
constructor(container) {
|
|
@@ -5720,7 +5760,7 @@ class NoneOutMode {
|
|
|
5720
5760
|
}
|
|
5721
5761
|
}
|
|
5722
5762
|
|
|
5723
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-out-modes@3.0.0-beta.
|
|
5763
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-out-modes@3.0.0-beta.4/node_modules/@tsparticles/updater-out-modes/browser/OutOutMode.js
|
|
5724
5764
|
|
|
5725
5765
|
class OutOutMode {
|
|
5726
5766
|
constructor(container) {
|
|
@@ -5829,7 +5869,7 @@ class OutOutMode {
|
|
|
5829
5869
|
}
|
|
5830
5870
|
}
|
|
5831
5871
|
|
|
5832
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-out-modes@3.0.0-beta.
|
|
5872
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-out-modes@3.0.0-beta.4/node_modules/@tsparticles/updater-out-modes/browser/OutOfCanvasUpdater.js
|
|
5833
5873
|
|
|
5834
5874
|
|
|
5835
5875
|
|
|
@@ -5863,13 +5903,13 @@ class OutOfCanvasUpdater {
|
|
|
5863
5903
|
}
|
|
5864
5904
|
}
|
|
5865
5905
|
|
|
5866
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-out-modes@3.0.0-beta.
|
|
5906
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-out-modes@3.0.0-beta.4/node_modules/@tsparticles/updater-out-modes/browser/index.js
|
|
5867
5907
|
|
|
5868
5908
|
async function loadOutModesUpdater(engine, refresh = true) {
|
|
5869
5909
|
await engine.addParticleUpdater("outModes", (container) => new OutOfCanvasUpdater(container), refresh);
|
|
5870
5910
|
}
|
|
5871
5911
|
|
|
5872
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-size@3.0.0-beta.
|
|
5912
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-size@3.0.0-beta.4/node_modules/@tsparticles/updater-size/browser/Utils.js
|
|
5873
5913
|
|
|
5874
5914
|
function Utils_checkDestroy(particle, value, minValue, maxValue) {
|
|
5875
5915
|
switch (particle.options.size.animation.destroy) {
|
|
@@ -5937,7 +5977,7 @@ function updateSize(particle, delta) {
|
|
|
5937
5977
|
}
|
|
5938
5978
|
}
|
|
5939
5979
|
|
|
5940
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-size@3.0.0-beta.
|
|
5980
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-size@3.0.0-beta.4/node_modules/@tsparticles/updater-size/browser/SizeUpdater.js
|
|
5941
5981
|
|
|
5942
5982
|
|
|
5943
5983
|
class SizeUpdater {
|
|
@@ -5970,13 +6010,13 @@ class SizeUpdater {
|
|
|
5970
6010
|
}
|
|
5971
6011
|
}
|
|
5972
6012
|
|
|
5973
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-size@3.0.0-beta.
|
|
6013
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-size@3.0.0-beta.4/node_modules/@tsparticles/updater-size/browser/index.js
|
|
5974
6014
|
|
|
5975
6015
|
async function loadSizeUpdater(engine, refresh = true) {
|
|
5976
6016
|
await engine.addParticleUpdater("size", () => new SizeUpdater(), refresh);
|
|
5977
6017
|
}
|
|
5978
6018
|
|
|
5979
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+basic@3.0.0-beta.
|
|
6019
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+basic@3.0.0-beta.4/node_modules/@tsparticles/basic/browser/index.js
|
|
5980
6020
|
|
|
5981
6021
|
|
|
5982
6022
|
|
|
@@ -5993,33 +6033,7 @@ async function loadBasic(engine, refresh = true) {
|
|
|
5993
6033
|
await engine.refresh(refresh);
|
|
5994
6034
|
}
|
|
5995
6035
|
|
|
5996
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+plugin-emitters@3.0.0-beta.
|
|
5997
|
-
|
|
5998
|
-
class CircleShape {
|
|
5999
|
-
randomPosition(position, size, fill) {
|
|
6000
|
-
const generateTheta = (x, y) => {
|
|
6001
|
-
const u = getRandom() / 4.0, theta = Math.atan((y / x) * Math.tan(2 * Math.PI * u)), v = getRandom();
|
|
6002
|
-
if (v < 0.25) {
|
|
6003
|
-
return theta;
|
|
6004
|
-
}
|
|
6005
|
-
else if (v < 0.5) {
|
|
6006
|
-
return Math.PI - theta;
|
|
6007
|
-
}
|
|
6008
|
-
else if (v < 0.75) {
|
|
6009
|
-
return Math.PI + theta;
|
|
6010
|
-
}
|
|
6011
|
-
else {
|
|
6012
|
-
return -theta;
|
|
6013
|
-
}
|
|
6014
|
-
}, radius = (x, y, theta) => (x * y) / Math.sqrt((y * Math.cos(theta)) ** 2 + (x * Math.sin(theta)) ** 2), [a, b] = [size.width / 2, size.height / 2], randomTheta = generateTheta(a, b), maxRadius = radius(a, b, randomTheta), randomRadius = fill ? maxRadius * Math.sqrt(getRandom()) : maxRadius;
|
|
6015
|
-
return {
|
|
6016
|
-
x: position.x + randomRadius * Math.cos(randomTheta),
|
|
6017
|
-
y: position.y + randomRadius * Math.sin(randomTheta),
|
|
6018
|
-
};
|
|
6019
|
-
}
|
|
6020
|
-
}
|
|
6021
|
-
|
|
6022
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+plugin-emitters@3.0.0-beta.1/node_modules/@tsparticles/plugin-emitters/browser/Options/Classes/EmitterLife.js
|
|
6036
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+plugin-emitters@3.0.0-beta.4/node_modules/@tsparticles/plugin-emitters/browser/Options/Classes/EmitterLife.js
|
|
6023
6037
|
|
|
6024
6038
|
class EmitterLife {
|
|
6025
6039
|
constructor() {
|
|
@@ -6044,7 +6058,7 @@ class EmitterLife {
|
|
|
6044
6058
|
}
|
|
6045
6059
|
}
|
|
6046
6060
|
|
|
6047
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+plugin-emitters@3.0.0-beta.
|
|
6061
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+plugin-emitters@3.0.0-beta.4/node_modules/@tsparticles/plugin-emitters/browser/Options/Classes/EmitterRate.js
|
|
6048
6062
|
|
|
6049
6063
|
class EmitterRate {
|
|
6050
6064
|
constructor() {
|
|
@@ -6064,7 +6078,49 @@ class EmitterRate {
|
|
|
6064
6078
|
}
|
|
6065
6079
|
}
|
|
6066
6080
|
|
|
6067
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+plugin-emitters@3.0.0-beta.
|
|
6081
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+plugin-emitters@3.0.0-beta.4/node_modules/@tsparticles/plugin-emitters/browser/Options/Classes/EmitterShapeReplace.js
|
|
6082
|
+
class EmitterShapeReplace {
|
|
6083
|
+
constructor() {
|
|
6084
|
+
this.color = false;
|
|
6085
|
+
this.opacity = false;
|
|
6086
|
+
}
|
|
6087
|
+
load(data) {
|
|
6088
|
+
if (!data) {
|
|
6089
|
+
return;
|
|
6090
|
+
}
|
|
6091
|
+
if (data.color !== undefined) {
|
|
6092
|
+
this.color = data.color;
|
|
6093
|
+
}
|
|
6094
|
+
if (data.opacity !== undefined) {
|
|
6095
|
+
this.opacity = data.opacity;
|
|
6096
|
+
}
|
|
6097
|
+
}
|
|
6098
|
+
}
|
|
6099
|
+
|
|
6100
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+plugin-emitters@3.0.0-beta.4/node_modules/@tsparticles/plugin-emitters/browser/Options/Classes/EmitterShape.js
|
|
6101
|
+
|
|
6102
|
+
|
|
6103
|
+
class EmitterShape {
|
|
6104
|
+
constructor() {
|
|
6105
|
+
this.options = {};
|
|
6106
|
+
this.replace = new EmitterShapeReplace();
|
|
6107
|
+
this.type = "square";
|
|
6108
|
+
}
|
|
6109
|
+
load(data) {
|
|
6110
|
+
if (!data) {
|
|
6111
|
+
return;
|
|
6112
|
+
}
|
|
6113
|
+
if (data.options !== undefined) {
|
|
6114
|
+
this.options = deepExtend({}, data.options ?? {});
|
|
6115
|
+
}
|
|
6116
|
+
this.replace.load(data.replace);
|
|
6117
|
+
if (data.type !== undefined) {
|
|
6118
|
+
this.type = data.type;
|
|
6119
|
+
}
|
|
6120
|
+
}
|
|
6121
|
+
}
|
|
6122
|
+
|
|
6123
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+plugin-emitters@3.0.0-beta.4/node_modules/@tsparticles/plugin-emitters/browser/Options/Classes/EmitterSize.js
|
|
6068
6124
|
class EmitterSize {
|
|
6069
6125
|
constructor() {
|
|
6070
6126
|
this.mode = "percent";
|
|
@@ -6087,7 +6143,8 @@ class EmitterSize {
|
|
|
6087
6143
|
}
|
|
6088
6144
|
}
|
|
6089
6145
|
|
|
6090
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+plugin-emitters@3.0.0-beta.
|
|
6146
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+plugin-emitters@3.0.0-beta.4/node_modules/@tsparticles/plugin-emitters/browser/Options/Classes/Emitter.js
|
|
6147
|
+
|
|
6091
6148
|
|
|
6092
6149
|
|
|
6093
6150
|
|
|
@@ -6098,7 +6155,7 @@ class Emitter {
|
|
|
6098
6155
|
this.fill = true;
|
|
6099
6156
|
this.life = new EmitterLife();
|
|
6100
6157
|
this.rate = new EmitterRate();
|
|
6101
|
-
this.shape =
|
|
6158
|
+
this.shape = new EmitterShape();
|
|
6102
6159
|
this.startCount = 0;
|
|
6103
6160
|
}
|
|
6104
6161
|
load(data) {
|
|
@@ -6127,9 +6184,7 @@ class Emitter {
|
|
|
6127
6184
|
return deepExtend({}, particles);
|
|
6128
6185
|
});
|
|
6129
6186
|
this.rate.load(data.rate);
|
|
6130
|
-
|
|
6131
|
-
this.shape = data.shape;
|
|
6132
|
-
}
|
|
6187
|
+
this.shape.load(data.shape);
|
|
6133
6188
|
if (data.position !== undefined) {
|
|
6134
6189
|
this.position = {};
|
|
6135
6190
|
if (data.position.x !== undefined) {
|
|
@@ -6151,21 +6206,29 @@ class Emitter {
|
|
|
6151
6206
|
}
|
|
6152
6207
|
}
|
|
6153
6208
|
|
|
6154
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+plugin-emitters@3.0.0-beta.
|
|
6209
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+plugin-emitters@3.0.0-beta.4/node_modules/@tsparticles/plugin-emitters/browser/EmitterInstance.js
|
|
6155
6210
|
|
|
6156
6211
|
|
|
6157
6212
|
|
|
6213
|
+
function setParticlesOptionsColor(particlesOptions, color) {
|
|
6214
|
+
if (particlesOptions.color) {
|
|
6215
|
+
particlesOptions.color.value = color;
|
|
6216
|
+
}
|
|
6217
|
+
else {
|
|
6218
|
+
particlesOptions.color = {
|
|
6219
|
+
value: color,
|
|
6220
|
+
};
|
|
6221
|
+
}
|
|
6222
|
+
}
|
|
6158
6223
|
class EmitterInstance {
|
|
6159
6224
|
constructor(engine, emitters, container, options, position) {
|
|
6160
6225
|
this.emitters = emitters;
|
|
6161
6226
|
this.container = container;
|
|
6162
|
-
this._calcPosition = () => {
|
|
6163
|
-
return calcPositionOrRandomFromSizeRanged({
|
|
6164
|
-
size: this.container.canvas.size,
|
|
6165
|
-
position: this.options.position,
|
|
6166
|
-
});
|
|
6167
|
-
};
|
|
6168
6227
|
this._destroy = () => {
|
|
6228
|
+
this._mutationObserver?.disconnect();
|
|
6229
|
+
this._mutationObserver = undefined;
|
|
6230
|
+
this._resizeObserver?.disconnect();
|
|
6231
|
+
this._resizeObserver = undefined;
|
|
6169
6232
|
this.emitters.removeEmitter(this);
|
|
6170
6233
|
this._engine.dispatchEvent("emitterDestroyed", {
|
|
6171
6234
|
container: this.container,
|
|
@@ -6174,45 +6237,11 @@ class EmitterInstance {
|
|
|
6174
6237
|
},
|
|
6175
6238
|
});
|
|
6176
6239
|
};
|
|
6177
|
-
this._emit = () => {
|
|
6178
|
-
if (this._paused) {
|
|
6179
|
-
return;
|
|
6180
|
-
}
|
|
6181
|
-
const quantity = getRangeValue(this.options.rate.quantity);
|
|
6182
|
-
this._emitParticles(quantity);
|
|
6183
|
-
};
|
|
6184
|
-
this._emitParticles = (quantity) => {
|
|
6185
|
-
const position = this.getPosition(), size = this.getSize(), singleParticlesOptions = itemFromSingleOrMultiple(this._particlesOptions);
|
|
6186
|
-
for (let i = 0; i < quantity; i++) {
|
|
6187
|
-
const particlesOptions = deepExtend({}, singleParticlesOptions);
|
|
6188
|
-
if (this.spawnColor) {
|
|
6189
|
-
const hslAnimation = this.options.spawnColor?.animation;
|
|
6190
|
-
if (hslAnimation) {
|
|
6191
|
-
this.spawnColor.h = this._setColorAnimation(hslAnimation.h, this.spawnColor.h, 360);
|
|
6192
|
-
this.spawnColor.s = this._setColorAnimation(hslAnimation.s, this.spawnColor.s, 100);
|
|
6193
|
-
this.spawnColor.l = this._setColorAnimation(hslAnimation.l, this.spawnColor.l, 100);
|
|
6194
|
-
}
|
|
6195
|
-
if (!particlesOptions.color) {
|
|
6196
|
-
particlesOptions.color = {
|
|
6197
|
-
value: this.spawnColor,
|
|
6198
|
-
};
|
|
6199
|
-
}
|
|
6200
|
-
else {
|
|
6201
|
-
particlesOptions.color.value = this.spawnColor;
|
|
6202
|
-
}
|
|
6203
|
-
}
|
|
6204
|
-
if (!position) {
|
|
6205
|
-
return;
|
|
6206
|
-
}
|
|
6207
|
-
const pPosition = this._shape?.randomPosition(position, size, this.fill) ?? position;
|
|
6208
|
-
this.container.particles.addParticle(pPosition, particlesOptions);
|
|
6209
|
-
}
|
|
6210
|
-
};
|
|
6211
6240
|
this._prepareToDie = () => {
|
|
6212
6241
|
if (this._paused) {
|
|
6213
6242
|
return;
|
|
6214
6243
|
}
|
|
6215
|
-
const duration = this.options.life?.duration !== undefined ?
|
|
6244
|
+
const duration = this.options.life?.duration !== undefined ? NumberUtils_getRangeValue(this.options.life.duration) : undefined;
|
|
6216
6245
|
if (this.container.retina.reduceFactor &&
|
|
6217
6246
|
(this._lifeCount > 0 || this._immortal) &&
|
|
6218
6247
|
duration !== undefined &&
|
|
@@ -6225,7 +6254,7 @@ class EmitterInstance {
|
|
|
6225
6254
|
if (!animation.enable) {
|
|
6226
6255
|
return initValue;
|
|
6227
6256
|
}
|
|
6228
|
-
const colorOffset = randomInRange(animation.offset), delay =
|
|
6257
|
+
const colorOffset = randomInRange(animation.offset), delay = NumberUtils_getRangeValue(this.options.rate.delay), emitFactor = (1000 * delay) / container.retina.reduceFactor, colorSpeed = NumberUtils_getRangeValue(animation.speed ?? 0);
|
|
6229
6258
|
return (initValue + (colorSpeed * container.fpsLimit) / emitFactor + colorOffset * 3.6) % maxValue;
|
|
6230
6259
|
};
|
|
6231
6260
|
this._engine = engine;
|
|
@@ -6240,10 +6269,9 @@ class EmitterInstance {
|
|
|
6240
6269
|
this.options = new Emitter();
|
|
6241
6270
|
this.options.load(options);
|
|
6242
6271
|
}
|
|
6243
|
-
this._spawnDelay = (
|
|
6272
|
+
this._spawnDelay = (NumberUtils_getRangeValue(this.options.life.delay ?? 0) * 1000) / this.container.retina.reduceFactor;
|
|
6244
6273
|
this.position = this._initialPosition ?? this._calcPosition();
|
|
6245
6274
|
this.name = this.options.name;
|
|
6246
|
-
this._shape = this._engine.emitterShapeManager?.getShape(this.options.shape);
|
|
6247
6275
|
this.fill = this.options.fill;
|
|
6248
6276
|
this._firstSpawn = !this.options.life.wait;
|
|
6249
6277
|
this._startParticlesAdded = false;
|
|
@@ -6256,19 +6284,30 @@ class EmitterInstance {
|
|
|
6256
6284
|
}
|
|
6257
6285
|
this._paused = !this.options.autoPlay;
|
|
6258
6286
|
this._particlesOptions = particlesOptions;
|
|
6259
|
-
this.
|
|
6260
|
-
|
|
6261
|
-
(() => {
|
|
6262
|
-
const size = new EmitterSize();
|
|
6263
|
-
size.load({
|
|
6264
|
-
height: 0,
|
|
6265
|
-
mode: "percent",
|
|
6266
|
-
width: 0,
|
|
6267
|
-
});
|
|
6268
|
-
return size;
|
|
6269
|
-
})();
|
|
6287
|
+
this._size = this._calcSize();
|
|
6288
|
+
this.size = getSize(this._size, this.container.canvas.size);
|
|
6270
6289
|
this._lifeCount = this.options.life.count ?? -1;
|
|
6271
6290
|
this._immortal = this._lifeCount <= 0;
|
|
6291
|
+
if (this.options.domId) {
|
|
6292
|
+
const element = document.getElementById(this.options.domId);
|
|
6293
|
+
if (element) {
|
|
6294
|
+
this._mutationObserver = new MutationObserver(() => {
|
|
6295
|
+
this.resize();
|
|
6296
|
+
});
|
|
6297
|
+
this._resizeObserver = new ResizeObserver(() => {
|
|
6298
|
+
this.resize();
|
|
6299
|
+
});
|
|
6300
|
+
this._mutationObserver.observe(element, {
|
|
6301
|
+
attributes: true,
|
|
6302
|
+
attributeFilter: ["style", "width", "height"],
|
|
6303
|
+
});
|
|
6304
|
+
this._resizeObserver.observe(element);
|
|
6305
|
+
}
|
|
6306
|
+
}
|
|
6307
|
+
const shapeOptions = this.options.shape, shapeGenerator = this._engine.emitterShapeManager?.getShapeGenerator(shapeOptions.type);
|
|
6308
|
+
if (shapeGenerator) {
|
|
6309
|
+
this._shape = shapeGenerator.generate(this.position, this.size, this.fill, shapeOptions.options);
|
|
6310
|
+
}
|
|
6272
6311
|
this._engine.dispatchEvent("emitterCreated", {
|
|
6273
6312
|
container,
|
|
6274
6313
|
data: {
|
|
@@ -6285,32 +6324,8 @@ class EmitterInstance {
|
|
|
6285
6324
|
this._paused = false;
|
|
6286
6325
|
this.play();
|
|
6287
6326
|
}
|
|
6288
|
-
|
|
6289
|
-
|
|
6290
|
-
const container = this.container, element = document.getElementById(this.options.domId);
|
|
6291
|
-
if (element) {
|
|
6292
|
-
const elRect = element.getBoundingClientRect();
|
|
6293
|
-
return {
|
|
6294
|
-
x: (elRect.x + elRect.width / 2) * container.retina.pixelRatio,
|
|
6295
|
-
y: (elRect.y + elRect.height / 2) * container.retina.pixelRatio,
|
|
6296
|
-
};
|
|
6297
|
-
}
|
|
6298
|
-
}
|
|
6299
|
-
return this.position;
|
|
6300
|
-
}
|
|
6301
|
-
getSize() {
|
|
6302
|
-
const container = this.container;
|
|
6303
|
-
if (this.options.domId) {
|
|
6304
|
-
const element = document.getElementById(this.options.domId);
|
|
6305
|
-
if (element) {
|
|
6306
|
-
const elRect = element.getBoundingClientRect();
|
|
6307
|
-
return {
|
|
6308
|
-
width: elRect.width * container.retina.pixelRatio,
|
|
6309
|
-
height: elRect.height * container.retina.pixelRatio,
|
|
6310
|
-
};
|
|
6311
|
-
}
|
|
6312
|
-
}
|
|
6313
|
-
return getSize(this.size, container.canvas.size);
|
|
6327
|
+
async init() {
|
|
6328
|
+
await this._shape?.init();
|
|
6314
6329
|
}
|
|
6315
6330
|
pause() {
|
|
6316
6331
|
if (this._paused) {
|
|
@@ -6328,7 +6343,7 @@ class EmitterInstance {
|
|
|
6328
6343
|
return;
|
|
6329
6344
|
}
|
|
6330
6345
|
if (this._emitDelay === undefined) {
|
|
6331
|
-
const delay =
|
|
6346
|
+
const delay = NumberUtils_getRangeValue(this.options.rate.delay);
|
|
6332
6347
|
this._emitDelay = (1000 * delay) / this.container.retina.reduceFactor;
|
|
6333
6348
|
}
|
|
6334
6349
|
if (this._lifeCount > 0 || this._immortal) {
|
|
@@ -6341,8 +6356,11 @@ class EmitterInstance {
|
|
|
6341
6356
|
initialPosition && isPointInside(initialPosition, this.container.canvas.size, Vector_Vector.origin)
|
|
6342
6357
|
? initialPosition
|
|
6343
6358
|
: this._calcPosition();
|
|
6359
|
+
this._size = this._calcSize();
|
|
6360
|
+
this.size = getSize(this._size, this.container.canvas.size);
|
|
6361
|
+
this._shape?.resize(this.position, this.size);
|
|
6344
6362
|
}
|
|
6345
|
-
update(delta) {
|
|
6363
|
+
async update(delta) {
|
|
6346
6364
|
if (this._paused) {
|
|
6347
6365
|
return;
|
|
6348
6366
|
}
|
|
@@ -6353,7 +6371,7 @@ class EmitterInstance {
|
|
|
6353
6371
|
}
|
|
6354
6372
|
if (!this._startParticlesAdded) {
|
|
6355
6373
|
this._startParticlesAdded = true;
|
|
6356
|
-
this._emitParticles(this.options.startCount);
|
|
6374
|
+
await this._emitParticles(this.options.startCount);
|
|
6357
6375
|
}
|
|
6358
6376
|
if (this._duration !== undefined) {
|
|
6359
6377
|
this._currentDuration += delta.value;
|
|
@@ -6368,7 +6386,7 @@ class EmitterInstance {
|
|
|
6368
6386
|
if (this._lifeCount > 0 || this._immortal) {
|
|
6369
6387
|
this.position = this._calcPosition();
|
|
6370
6388
|
this._spawnDelay =
|
|
6371
|
-
(
|
|
6389
|
+
(NumberUtils_getRangeValue(this.options.life.delay ?? 0) * 1000) / this.container.retina.reduceFactor;
|
|
6372
6390
|
}
|
|
6373
6391
|
else {
|
|
6374
6392
|
this._destroy();
|
|
@@ -6396,9 +6414,99 @@ class EmitterInstance {
|
|
|
6396
6414
|
}
|
|
6397
6415
|
}
|
|
6398
6416
|
}
|
|
6417
|
+
_calcPosition() {
|
|
6418
|
+
if (this.options.domId) {
|
|
6419
|
+
const container = this.container, element = document.getElementById(this.options.domId);
|
|
6420
|
+
if (element) {
|
|
6421
|
+
const elRect = element.getBoundingClientRect();
|
|
6422
|
+
return {
|
|
6423
|
+
x: (elRect.x + elRect.width / 2) * container.retina.pixelRatio,
|
|
6424
|
+
y: (elRect.y + elRect.height / 2) * container.retina.pixelRatio,
|
|
6425
|
+
};
|
|
6426
|
+
}
|
|
6427
|
+
}
|
|
6428
|
+
return calcPositionOrRandomFromSizeRanged({
|
|
6429
|
+
size: this.container.canvas.size,
|
|
6430
|
+
position: this.options.position,
|
|
6431
|
+
});
|
|
6432
|
+
}
|
|
6433
|
+
_calcSize() {
|
|
6434
|
+
const container = this.container;
|
|
6435
|
+
if (this.options.domId) {
|
|
6436
|
+
const element = document.getElementById(this.options.domId);
|
|
6437
|
+
if (element) {
|
|
6438
|
+
const elRect = element.getBoundingClientRect();
|
|
6439
|
+
return {
|
|
6440
|
+
width: elRect.width * container.retina.pixelRatio,
|
|
6441
|
+
height: elRect.height * container.retina.pixelRatio,
|
|
6442
|
+
mode: "precise",
|
|
6443
|
+
};
|
|
6444
|
+
}
|
|
6445
|
+
}
|
|
6446
|
+
return (this.options.size ??
|
|
6447
|
+
(() => {
|
|
6448
|
+
const size = new EmitterSize();
|
|
6449
|
+
size.load({
|
|
6450
|
+
height: 0,
|
|
6451
|
+
mode: "percent",
|
|
6452
|
+
width: 0,
|
|
6453
|
+
});
|
|
6454
|
+
return size;
|
|
6455
|
+
})());
|
|
6456
|
+
}
|
|
6457
|
+
async _emit() {
|
|
6458
|
+
if (this._paused) {
|
|
6459
|
+
return;
|
|
6460
|
+
}
|
|
6461
|
+
const quantity = NumberUtils_getRangeValue(this.options.rate.quantity);
|
|
6462
|
+
await this._emitParticles(quantity);
|
|
6463
|
+
}
|
|
6464
|
+
async _emitParticles(quantity) {
|
|
6465
|
+
const singleParticlesOptions = itemFromSingleOrMultiple(this._particlesOptions);
|
|
6466
|
+
for (let i = 0; i < quantity; i++) {
|
|
6467
|
+
const particlesOptions = deepExtend({}, singleParticlesOptions);
|
|
6468
|
+
if (this.spawnColor) {
|
|
6469
|
+
const hslAnimation = this.options.spawnColor?.animation;
|
|
6470
|
+
if (hslAnimation) {
|
|
6471
|
+
this.spawnColor.h = this._setColorAnimation(hslAnimation.h, this.spawnColor.h, 360);
|
|
6472
|
+
this.spawnColor.s = this._setColorAnimation(hslAnimation.s, this.spawnColor.s, 100);
|
|
6473
|
+
this.spawnColor.l = this._setColorAnimation(hslAnimation.l, this.spawnColor.l, 100);
|
|
6474
|
+
}
|
|
6475
|
+
setParticlesOptionsColor(particlesOptions, this.spawnColor);
|
|
6476
|
+
}
|
|
6477
|
+
const shapeOptions = this.options.shape;
|
|
6478
|
+
let position = this.position;
|
|
6479
|
+
if (this._shape) {
|
|
6480
|
+
const shapePosData = await this._shape.randomPosition();
|
|
6481
|
+
if (shapePosData) {
|
|
6482
|
+
position = shapePosData.position;
|
|
6483
|
+
const replaceData = shapeOptions.replace;
|
|
6484
|
+
if (replaceData.color && shapePosData.color) {
|
|
6485
|
+
setParticlesOptionsColor(particlesOptions, shapePosData.color);
|
|
6486
|
+
}
|
|
6487
|
+
if (replaceData.opacity) {
|
|
6488
|
+
if (particlesOptions.opacity) {
|
|
6489
|
+
particlesOptions.opacity.value = shapePosData.opacity;
|
|
6490
|
+
}
|
|
6491
|
+
else {
|
|
6492
|
+
particlesOptions.opacity = {
|
|
6493
|
+
value: shapePosData.opacity,
|
|
6494
|
+
};
|
|
6495
|
+
}
|
|
6496
|
+
}
|
|
6497
|
+
}
|
|
6498
|
+
else {
|
|
6499
|
+
position = null;
|
|
6500
|
+
}
|
|
6501
|
+
}
|
|
6502
|
+
if (position) {
|
|
6503
|
+
this.container.particles.addParticle(position, particlesOptions);
|
|
6504
|
+
}
|
|
6505
|
+
}
|
|
6506
|
+
}
|
|
6399
6507
|
}
|
|
6400
6508
|
|
|
6401
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+plugin-emitters@3.0.0-beta.
|
|
6509
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+plugin-emitters@3.0.0-beta.4/node_modules/@tsparticles/plugin-emitters/browser/Emitters.js
|
|
6402
6510
|
|
|
6403
6511
|
|
|
6404
6512
|
|
|
@@ -6418,7 +6526,7 @@ class Emitters {
|
|
|
6418
6526
|
container.getEmitter = (idxOrName) => idxOrName === undefined || isNumber(idxOrName)
|
|
6419
6527
|
? this.array[idxOrName || 0]
|
|
6420
6528
|
: this.array.find((t) => t.name === idxOrName);
|
|
6421
|
-
container.addEmitter = (options, position) => this.addEmitter(options, position);
|
|
6529
|
+
container.addEmitter = async (options, position) => this.addEmitter(options, position);
|
|
6422
6530
|
container.removeEmitter = (idxOrName) => {
|
|
6423
6531
|
const emitter = container.getEmitter(idxOrName);
|
|
6424
6532
|
if (emitter) {
|
|
@@ -6438,10 +6546,11 @@ class Emitters {
|
|
|
6438
6546
|
}
|
|
6439
6547
|
};
|
|
6440
6548
|
}
|
|
6441
|
-
addEmitter(options, position) {
|
|
6549
|
+
async addEmitter(options, position) {
|
|
6442
6550
|
const emitterOptions = new Emitter();
|
|
6443
6551
|
emitterOptions.load(options);
|
|
6444
6552
|
const emitter = new EmitterInstance(this._engine, this, this.container, emitterOptions, position);
|
|
6553
|
+
await emitter.init();
|
|
6445
6554
|
this.array.push(emitter);
|
|
6446
6555
|
return emitter;
|
|
6447
6556
|
}
|
|
@@ -6485,11 +6594,11 @@ class Emitters {
|
|
|
6485
6594
|
}
|
|
6486
6595
|
if (isArray(this.emitters)) {
|
|
6487
6596
|
for (const emitterOptions of this.emitters) {
|
|
6488
|
-
this.addEmitter(emitterOptions);
|
|
6597
|
+
await this.addEmitter(emitterOptions);
|
|
6489
6598
|
}
|
|
6490
6599
|
}
|
|
6491
6600
|
else {
|
|
6492
|
-
this.addEmitter(this.emitters);
|
|
6601
|
+
await this.addEmitter(this.emitters);
|
|
6493
6602
|
}
|
|
6494
6603
|
}
|
|
6495
6604
|
pause() {
|
|
@@ -6516,77 +6625,33 @@ class Emitters {
|
|
|
6516
6625
|
stop() {
|
|
6517
6626
|
this.array = [];
|
|
6518
6627
|
}
|
|
6519
|
-
update(delta) {
|
|
6628
|
+
async update(delta) {
|
|
6520
6629
|
for (const emitter of this.array) {
|
|
6521
|
-
emitter.update(delta);
|
|
6630
|
+
await emitter.update(delta);
|
|
6522
6631
|
}
|
|
6523
6632
|
}
|
|
6524
6633
|
}
|
|
6525
6634
|
|
|
6526
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+plugin-emitters@3.0.0-beta.
|
|
6527
|
-
const
|
|
6635
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+plugin-emitters@3.0.0-beta.4/node_modules/@tsparticles/plugin-emitters/browser/ShapeManager.js
|
|
6636
|
+
const shapeGeneratorss = new Map();
|
|
6528
6637
|
class ShapeManager {
|
|
6529
6638
|
constructor(engine) {
|
|
6530
6639
|
this._engine = engine;
|
|
6531
6640
|
}
|
|
6532
|
-
|
|
6533
|
-
if (!this.
|
|
6534
|
-
|
|
6641
|
+
addShapeGenerator(name, generator) {
|
|
6642
|
+
if (!this.getShapeGenerator(name)) {
|
|
6643
|
+
shapeGeneratorss.set(name, generator);
|
|
6535
6644
|
}
|
|
6536
6645
|
}
|
|
6537
|
-
|
|
6538
|
-
return
|
|
6646
|
+
getShapeGenerator(name) {
|
|
6647
|
+
return shapeGeneratorss.get(name);
|
|
6539
6648
|
}
|
|
6540
|
-
|
|
6541
|
-
return
|
|
6649
|
+
getSupportedShapeGenerators() {
|
|
6650
|
+
return shapeGeneratorss.keys();
|
|
6542
6651
|
}
|
|
6543
6652
|
}
|
|
6544
6653
|
|
|
6545
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+plugin-emitters@3.0.0-beta.
|
|
6546
|
-
|
|
6547
|
-
function randomSquareCoordinate(position, offset) {
|
|
6548
|
-
return position + offset * (getRandom() - 0.5);
|
|
6549
|
-
}
|
|
6550
|
-
class SquareShape {
|
|
6551
|
-
randomPosition(position, size, fill) {
|
|
6552
|
-
if (fill) {
|
|
6553
|
-
return {
|
|
6554
|
-
x: randomSquareCoordinate(position.x, size.width),
|
|
6555
|
-
y: randomSquareCoordinate(position.y, size.height),
|
|
6556
|
-
};
|
|
6557
|
-
}
|
|
6558
|
-
else {
|
|
6559
|
-
const halfW = size.width / 2, halfH = size.height / 2, side = Math.floor(getRandom() * 4), v = (getRandom() - 0.5) * 2;
|
|
6560
|
-
switch (side) {
|
|
6561
|
-
case 0:
|
|
6562
|
-
return {
|
|
6563
|
-
x: position.x + v * halfW,
|
|
6564
|
-
y: position.y - halfH,
|
|
6565
|
-
};
|
|
6566
|
-
case 1:
|
|
6567
|
-
return {
|
|
6568
|
-
x: position.x - halfW,
|
|
6569
|
-
y: position.y + v * halfH,
|
|
6570
|
-
};
|
|
6571
|
-
case 2:
|
|
6572
|
-
return {
|
|
6573
|
-
x: position.x + v * halfW,
|
|
6574
|
-
y: position.y + halfH,
|
|
6575
|
-
};
|
|
6576
|
-
case 3:
|
|
6577
|
-
default:
|
|
6578
|
-
return {
|
|
6579
|
-
x: position.x + halfW,
|
|
6580
|
-
y: position.y + v * halfH,
|
|
6581
|
-
};
|
|
6582
|
-
}
|
|
6583
|
-
}
|
|
6584
|
-
}
|
|
6585
|
-
}
|
|
6586
|
-
|
|
6587
|
-
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+plugin-emitters@3.0.0-beta.1/node_modules/@tsparticles/plugin-emitters/browser/index.js
|
|
6588
|
-
|
|
6589
|
-
|
|
6654
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+plugin-emitters@3.0.0-beta.4/node_modules/@tsparticles/plugin-emitters/browser/index.js
|
|
6590
6655
|
|
|
6591
6656
|
|
|
6592
6657
|
|
|
@@ -6681,21 +6746,22 @@ async function loadEmittersPlugin(engine, refresh = true) {
|
|
|
6681
6746
|
if (!engine.emitterShapeManager) {
|
|
6682
6747
|
engine.emitterShapeManager = new ShapeManager(engine);
|
|
6683
6748
|
}
|
|
6684
|
-
if (!engine.
|
|
6685
|
-
engine.
|
|
6686
|
-
engine.emitterShapeManager?.
|
|
6749
|
+
if (!engine.addEmitterShapeGenerator) {
|
|
6750
|
+
engine.addEmitterShapeGenerator = (name, generator) => {
|
|
6751
|
+
engine.emitterShapeManager?.addShapeGenerator(name, generator);
|
|
6687
6752
|
};
|
|
6688
6753
|
}
|
|
6689
6754
|
const plugin = new EmittersPlugin(engine);
|
|
6690
6755
|
await engine.addPlugin(plugin, refresh);
|
|
6691
|
-
engine.addEmitterShape("circle", new CircleShape());
|
|
6692
|
-
engine.addEmitterShape("square", new SquareShape());
|
|
6693
6756
|
}
|
|
6694
6757
|
|
|
6695
6758
|
|
|
6696
6759
|
|
|
6697
6760
|
|
|
6698
6761
|
|
|
6762
|
+
|
|
6763
|
+
|
|
6764
|
+
|
|
6699
6765
|
;// CONCATENATED MODULE: ./dist/browser/options.js
|
|
6700
6766
|
const options = {
|
|
6701
6767
|
fpsLimit: 120,
|