tsparticles 2.5.3 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -2
- package/package.json +11 -11
- package/report.html +2 -2
- package/tsparticles.bundle.js +127 -94
- package/tsparticles.bundle.min.js +1 -1
- package/tsparticles.bundle.min.js.LICENSE.txt +1 -1
- package/tsparticles.js +1 -1
- package/tsparticles.min.js.LICENSE.txt +1 -1
package/tsparticles.bundle.js
CHANGED
|
@@ -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
|
-
* v2.
|
|
7
|
+
* v2.6.0
|
|
8
8
|
*/
|
|
9
9
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
10
10
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
@@ -100,6 +100,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
100
100
|
"Point": () => (/* reexport */ Point),
|
|
101
101
|
"Range": () => (/* reexport */ Range),
|
|
102
102
|
"Rectangle": () => (/* reexport */ Rectangle),
|
|
103
|
+
"ResizeEvent": () => (/* reexport */ ResizeEvent),
|
|
103
104
|
"Responsive": () => (/* reexport */ Responsive),
|
|
104
105
|
"RgbColorManager": () => (/* reexport */ RgbColorManager),
|
|
105
106
|
"Shadow": () => (/* reexport */ Shadow),
|
|
@@ -372,9 +373,7 @@ function addEasing(name, easing) {
|
|
|
372
373
|
}
|
|
373
374
|
}
|
|
374
375
|
function getEasing(name) {
|
|
375
|
-
|
|
376
|
-
const noEasing = value => value;
|
|
377
|
-
return (_a = easings.get(name)) !== null && _a !== void 0 ? _a : noEasing;
|
|
376
|
+
return easings.get(name) || (value => value);
|
|
378
377
|
}
|
|
379
378
|
function setRandom(rnd = Math.random) {
|
|
380
379
|
_random = rnd;
|
|
@@ -433,7 +432,7 @@ function getDistances(pointA, pointB) {
|
|
|
433
432
|
return {
|
|
434
433
|
dx: dx,
|
|
435
434
|
dy: dy,
|
|
436
|
-
distance: Math.sqrt(dx
|
|
435
|
+
distance: Math.sqrt(dx ** 2 + dy ** 2)
|
|
437
436
|
};
|
|
438
437
|
}
|
|
439
438
|
function getDistance(pointA, pointB) {
|
|
@@ -1019,7 +1018,7 @@ function setColorAnimation(colorValue, colorAnimation, reduceFactor) {
|
|
|
1019
1018
|
if (colorValue.enable) {
|
|
1020
1019
|
colorValue.velocity = getRangeValue(colorAnimation.speed) / 100 * reduceFactor;
|
|
1021
1020
|
colorValue.decay = 1 - getRangeValue(colorAnimation.decay);
|
|
1022
|
-
colorValue.status =
|
|
1021
|
+
colorValue.status = "increasing";
|
|
1023
1022
|
if (!colorAnimation.sync) {
|
|
1024
1023
|
colorValue.velocity *= getRandom();
|
|
1025
1024
|
colorValue.value *= getRandom();
|
|
@@ -1589,19 +1588,21 @@ class EventListeners {
|
|
|
1589
1588
|
constructor(container) {
|
|
1590
1589
|
this.container = container;
|
|
1591
1590
|
this.canPush = true;
|
|
1592
|
-
this.
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1591
|
+
this.handlers = {
|
|
1592
|
+
mouseMove: e => this.mouseTouchMove(e),
|
|
1593
|
+
touchStart: e => this.mouseTouchMove(e),
|
|
1594
|
+
touchMove: e => this.mouseTouchMove(e),
|
|
1595
|
+
touchEnd: () => this.mouseTouchFinish(),
|
|
1596
|
+
mouseLeave: () => this.mouseTouchFinish(),
|
|
1597
|
+
touchCancel: () => this.mouseTouchFinish(),
|
|
1598
|
+
touchEndClick: e => this.mouseTouchClick(e),
|
|
1599
|
+
mouseUp: e => this.mouseTouchClick(e),
|
|
1600
|
+
mouseDown: () => this.mouseDown(),
|
|
1601
|
+
visibilityChange: () => this.handleVisibilityChange(),
|
|
1602
|
+
themeChange: e => this.handleThemeChange(e),
|
|
1603
|
+
oldThemeChange: e => this.handleThemeChange(e),
|
|
1604
|
+
resize: () => this.handleWindowResize()
|
|
1605
|
+
};
|
|
1605
1606
|
}
|
|
1606
1607
|
addListeners() {
|
|
1607
1608
|
this.manageListeners(true);
|
|
@@ -1613,12 +1614,13 @@ class EventListeners {
|
|
|
1613
1614
|
const container = this.container,
|
|
1614
1615
|
options = container.actualOptions;
|
|
1615
1616
|
if (this.canPush) {
|
|
1616
|
-
const
|
|
1617
|
+
const mouseInteractivity = container.interactivity.mouse,
|
|
1618
|
+
mousePos = mouseInteractivity.position;
|
|
1617
1619
|
if (!mousePos) {
|
|
1618
1620
|
return;
|
|
1619
1621
|
}
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
+
mouseInteractivity.clickPosition = Object.assign({}, mousePos);
|
|
1623
|
+
mouseInteractivity.clickTime = new Date().getTime();
|
|
1622
1624
|
const onClick = options.interactivity.events.onClick;
|
|
1623
1625
|
executeOnSingleOrMultiple(onClick.mode, mode => this.handleClickMode(mode));
|
|
1624
1626
|
}
|
|
@@ -1631,10 +1633,13 @@ class EventListeners {
|
|
|
1631
1633
|
}
|
|
1632
1634
|
handleThemeChange(e) {
|
|
1633
1635
|
const mediaEvent = e,
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
+
container = this.container,
|
|
1637
|
+
options = container.options,
|
|
1638
|
+
defaultThemes = options.defaultThemes,
|
|
1639
|
+
themeName = mediaEvent.matches ? defaultThemes.dark : defaultThemes.light,
|
|
1640
|
+
theme = options.themes.find(theme => theme.name === themeName);
|
|
1636
1641
|
if (theme && theme.default.auto) {
|
|
1637
|
-
|
|
1642
|
+
container.loadTheme(themeName);
|
|
1638
1643
|
}
|
|
1639
1644
|
}
|
|
1640
1645
|
handleVisibilityChange() {
|
|
@@ -1664,11 +1669,12 @@ class EventListeners {
|
|
|
1664
1669
|
this.resizeTimeout = setTimeout(async () => {
|
|
1665
1670
|
var _a;
|
|
1666
1671
|
return (_a = this.container.canvas) === null || _a === void 0 ? void 0 : _a.windowResize();
|
|
1667
|
-
},
|
|
1672
|
+
}, this.container.actualOptions.interactivity.events.resize.delay * 1000);
|
|
1668
1673
|
}
|
|
1669
1674
|
manageListeners(add) {
|
|
1670
1675
|
var _a;
|
|
1671
|
-
const
|
|
1676
|
+
const handlers = this.handlers,
|
|
1677
|
+
container = this.container,
|
|
1672
1678
|
options = container.actualOptions,
|
|
1673
1679
|
detectType = options.interactivity.detectsOn;
|
|
1674
1680
|
let mouseLeaveTmpEvent = mouseLeaveEvent;
|
|
@@ -1684,12 +1690,12 @@ class EventListeners {
|
|
|
1684
1690
|
const mediaMatch = safeMatchMedia("(prefers-color-scheme: dark)");
|
|
1685
1691
|
if (mediaMatch) {
|
|
1686
1692
|
if (mediaMatch.addEventListener !== undefined) {
|
|
1687
|
-
manageListener(mediaMatch, "change",
|
|
1693
|
+
manageListener(mediaMatch, "change", handlers.themeChange, add);
|
|
1688
1694
|
} else if (mediaMatch.addListener !== undefined) {
|
|
1689
1695
|
if (add) {
|
|
1690
|
-
mediaMatch.addListener(
|
|
1696
|
+
mediaMatch.addListener(handlers.oldThemeChange);
|
|
1691
1697
|
} else {
|
|
1692
|
-
mediaMatch.removeListener(
|
|
1698
|
+
mediaMatch.removeListener(handlers.oldThemeChange);
|
|
1693
1699
|
}
|
|
1694
1700
|
}
|
|
1695
1701
|
}
|
|
@@ -1699,18 +1705,18 @@ class EventListeners {
|
|
|
1699
1705
|
}
|
|
1700
1706
|
const html = interactivityEl;
|
|
1701
1707
|
if (options.interactivity.events.onHover.enable || options.interactivity.events.onClick.enable) {
|
|
1702
|
-
manageListener(interactivityEl, mouseMoveEvent,
|
|
1703
|
-
manageListener(interactivityEl, touchStartEvent,
|
|
1704
|
-
manageListener(interactivityEl, touchMoveEvent,
|
|
1708
|
+
manageListener(interactivityEl, mouseMoveEvent, handlers.mouseMove, add);
|
|
1709
|
+
manageListener(interactivityEl, touchStartEvent, handlers.touchStart, add);
|
|
1710
|
+
manageListener(interactivityEl, touchMoveEvent, handlers.touchMove, add);
|
|
1705
1711
|
if (!options.interactivity.events.onClick.enable) {
|
|
1706
|
-
manageListener(interactivityEl, touchEndEvent,
|
|
1712
|
+
manageListener(interactivityEl, touchEndEvent, handlers.touchEnd, add);
|
|
1707
1713
|
} else {
|
|
1708
|
-
manageListener(interactivityEl, touchEndEvent,
|
|
1709
|
-
manageListener(interactivityEl, mouseUpEvent,
|
|
1710
|
-
manageListener(interactivityEl, mouseDownEvent,
|
|
1714
|
+
manageListener(interactivityEl, touchEndEvent, handlers.touchEndClick, add);
|
|
1715
|
+
manageListener(interactivityEl, mouseUpEvent, handlers.mouseUp, add);
|
|
1716
|
+
manageListener(interactivityEl, mouseDownEvent, handlers.mouseDown, add);
|
|
1711
1717
|
}
|
|
1712
|
-
manageListener(interactivityEl, mouseLeaveTmpEvent,
|
|
1713
|
-
manageListener(interactivityEl, touchCancelEvent,
|
|
1718
|
+
manageListener(interactivityEl, mouseLeaveTmpEvent, handlers.mouseLeave, add);
|
|
1719
|
+
manageListener(interactivityEl, touchCancelEvent, handlers.touchCancel, add);
|
|
1714
1720
|
}
|
|
1715
1721
|
if (container.canvas.element) {
|
|
1716
1722
|
container.canvas.element.style.pointerEvents = html === container.canvas.element ? "initial" : "none";
|
|
@@ -1734,11 +1740,11 @@ class EventListeners {
|
|
|
1734
1740
|
this.resizeObserver.observe(container.canvas.element);
|
|
1735
1741
|
}
|
|
1736
1742
|
} else {
|
|
1737
|
-
manageListener(window, resizeEvent,
|
|
1743
|
+
manageListener(window, resizeEvent, handlers.resize, add);
|
|
1738
1744
|
}
|
|
1739
1745
|
}
|
|
1740
1746
|
if (document) {
|
|
1741
|
-
manageListener(document, visibilityChangeEvent,
|
|
1747
|
+
manageListener(document, visibilityChangeEvent, handlers.visibilityChange, add, false);
|
|
1742
1748
|
}
|
|
1743
1749
|
}
|
|
1744
1750
|
mouseDown() {
|
|
@@ -2130,17 +2136,36 @@ class HoverEvent {
|
|
|
2130
2136
|
this.parallax.load(data.parallax);
|
|
2131
2137
|
}
|
|
2132
2138
|
}
|
|
2139
|
+
;// CONCATENATED MODULE: ../../engine/dist/esm/Options/Classes/Interactivity/Events/ResizeEvent.js
|
|
2140
|
+
class ResizeEvent {
|
|
2141
|
+
constructor() {
|
|
2142
|
+
this.delay = 0.5;
|
|
2143
|
+
this.enable = true;
|
|
2144
|
+
}
|
|
2145
|
+
load(data) {
|
|
2146
|
+
if (data === undefined) {
|
|
2147
|
+
return;
|
|
2148
|
+
}
|
|
2149
|
+
if (data.delay !== undefined) {
|
|
2150
|
+
this.delay = data.delay;
|
|
2151
|
+
}
|
|
2152
|
+
if (data.enable !== undefined) {
|
|
2153
|
+
this.enable = data.enable;
|
|
2154
|
+
}
|
|
2155
|
+
}
|
|
2156
|
+
}
|
|
2133
2157
|
;// CONCATENATED MODULE: ../../engine/dist/esm/Options/Classes/Interactivity/Events/Events.js
|
|
2134
2158
|
|
|
2135
2159
|
|
|
2136
2160
|
|
|
2137
2161
|
|
|
2162
|
+
|
|
2138
2163
|
class Events {
|
|
2139
2164
|
constructor() {
|
|
2140
2165
|
this.onClick = new ClickEvent();
|
|
2141
2166
|
this.onDiv = new DivEvent();
|
|
2142
2167
|
this.onHover = new HoverEvent();
|
|
2143
|
-
this.resize =
|
|
2168
|
+
this.resize = new ResizeEvent();
|
|
2144
2169
|
}
|
|
2145
2170
|
get onclick() {
|
|
2146
2171
|
return this.onClick;
|
|
@@ -2175,8 +2200,10 @@ class Events {
|
|
|
2175
2200
|
});
|
|
2176
2201
|
}
|
|
2177
2202
|
this.onHover.load((_c = data.onHover) !== null && _c !== void 0 ? _c : data.onhover);
|
|
2178
|
-
if (data.resize
|
|
2179
|
-
this.resize = data.resize;
|
|
2203
|
+
if (typeof data.resize === "boolean") {
|
|
2204
|
+
this.resize.enable = data.resize;
|
|
2205
|
+
} else {
|
|
2206
|
+
this.resize.load(data.resize);
|
|
2180
2207
|
}
|
|
2181
2208
|
}
|
|
2182
2209
|
}
|
|
@@ -3495,9 +3522,14 @@ class Options {
|
|
|
3495
3522
|
this.responsive.sort((a, b) => a.maxWidth - b.maxWidth);
|
|
3496
3523
|
if (data.themes !== undefined) {
|
|
3497
3524
|
for (const theme of data.themes) {
|
|
3498
|
-
const
|
|
3499
|
-
|
|
3500
|
-
|
|
3525
|
+
const existingTheme = this.themes.find(t => t.name === theme.name);
|
|
3526
|
+
if (!existingTheme) {
|
|
3527
|
+
const optTheme = new Theme();
|
|
3528
|
+
optTheme.load(theme);
|
|
3529
|
+
this.themes.push(optTheme);
|
|
3530
|
+
} else {
|
|
3531
|
+
existingTheme.load(theme);
|
|
3532
|
+
}
|
|
3501
3533
|
}
|
|
3502
3534
|
}
|
|
3503
3535
|
this.defaultThemes.dark = (_d = this._findDefaultTheme("dark")) === null || _d === void 0 ? void 0 : _d.name;
|
|
@@ -3560,10 +3592,10 @@ class InteractionManager {
|
|
|
3560
3592
|
this._particleInteractors = [];
|
|
3561
3593
|
for (const interactor of this._interactors) {
|
|
3562
3594
|
switch (interactor.type) {
|
|
3563
|
-
case
|
|
3595
|
+
case "external":
|
|
3564
3596
|
this._externalInteractors.push(interactor);
|
|
3565
3597
|
break;
|
|
3566
|
-
case
|
|
3598
|
+
case "particles":
|
|
3567
3599
|
this._particleInteractors.push(interactor);
|
|
3568
3600
|
break;
|
|
3569
3601
|
}
|
|
@@ -3619,6 +3651,7 @@ class Particle {
|
|
|
3619
3651
|
this.init(id, position, overrideOptions, group);
|
|
3620
3652
|
}
|
|
3621
3653
|
destroy(override) {
|
|
3654
|
+
var _a;
|
|
3622
3655
|
if (this.unbreakable || this.destroyed) {
|
|
3623
3656
|
return;
|
|
3624
3657
|
}
|
|
@@ -3635,6 +3668,7 @@ class Particle {
|
|
|
3635
3668
|
updater.particleDestroyed(this, override);
|
|
3636
3669
|
}
|
|
3637
3670
|
}
|
|
3671
|
+
(_a = this.pathGenerator) === null || _a === void 0 ? void 0 : _a.reset(this);
|
|
3638
3672
|
}
|
|
3639
3673
|
draw(delta) {
|
|
3640
3674
|
const container = this.container;
|
|
@@ -3746,21 +3780,21 @@ class Particle {
|
|
|
3746
3780
|
maxLoops: getRangeValue(sizeOptions.animation.count)
|
|
3747
3781
|
};
|
|
3748
3782
|
if (sizeAnimation.enable) {
|
|
3749
|
-
this.size.status =
|
|
3783
|
+
this.size.status = "increasing";
|
|
3750
3784
|
this.size.decay = 1 - getRangeValue(sizeAnimation.decay);
|
|
3751
3785
|
switch (sizeAnimation.startValue) {
|
|
3752
3786
|
case "min":
|
|
3753
3787
|
this.size.value = this.size.min;
|
|
3754
|
-
this.size.status =
|
|
3788
|
+
this.size.status = "increasing";
|
|
3755
3789
|
break;
|
|
3756
3790
|
case "random":
|
|
3757
3791
|
this.size.value = randomInRange(this.size) * pxRatio;
|
|
3758
|
-
this.size.status = getRandom() >= 0.5 ?
|
|
3792
|
+
this.size.status = getRandom() >= 0.5 ? "increasing" : "decreasing";
|
|
3759
3793
|
break;
|
|
3760
3794
|
case "max":
|
|
3761
3795
|
default:
|
|
3762
3796
|
this.size.value = this.size.max;
|
|
3763
|
-
this.size.status =
|
|
3797
|
+
this.size.status = "decreasing";
|
|
3764
3798
|
break;
|
|
3765
3799
|
}
|
|
3766
3800
|
}
|
|
@@ -3889,9 +3923,9 @@ class Particle {
|
|
|
3889
3923
|
return pos;
|
|
3890
3924
|
}
|
|
3891
3925
|
_calculateVelocity() {
|
|
3892
|
-
const baseVelocity = getParticleBaseVelocity(this.direction)
|
|
3893
|
-
|
|
3894
|
-
|
|
3926
|
+
const baseVelocity = getParticleBaseVelocity(this.direction),
|
|
3927
|
+
res = baseVelocity.copy(),
|
|
3928
|
+
moveOptions = this.options.move;
|
|
3895
3929
|
if (moveOptions.direction === "inside" || moveOptions.direction === "outside") {
|
|
3896
3930
|
return res;
|
|
3897
3931
|
}
|
|
@@ -4426,7 +4460,8 @@ const defaultPathGeneratorKey = "default",
|
|
|
4426
4460
|
return v;
|
|
4427
4461
|
},
|
|
4428
4462
|
init: () => {},
|
|
4429
|
-
update: () => {}
|
|
4463
|
+
update: () => {},
|
|
4464
|
+
reset: () => {}
|
|
4430
4465
|
};
|
|
4431
4466
|
class Container {
|
|
4432
4467
|
constructor(engine, id, sourceOptions) {
|
|
@@ -4864,9 +4899,6 @@ class Container {
|
|
|
4864
4899
|
|
|
4865
4900
|
|
|
4866
4901
|
|
|
4867
|
-
function fetchError(statusCode) {
|
|
4868
|
-
console.error(`tsParticles - Error ${statusCode} while retrieving config file`);
|
|
4869
|
-
}
|
|
4870
4902
|
async function getDataFromUrl(jsonUrl, index) {
|
|
4871
4903
|
const url = itemFromSingleOrMultiple(jsonUrl, index);
|
|
4872
4904
|
if (!url) {
|
|
@@ -4876,7 +4908,7 @@ async function getDataFromUrl(jsonUrl, index) {
|
|
|
4876
4908
|
if (response.ok) {
|
|
4877
4909
|
return response.json();
|
|
4878
4910
|
}
|
|
4879
|
-
|
|
4911
|
+
console.error(`tsParticles - Error ${response.status} while retrieving config file`);
|
|
4880
4912
|
}
|
|
4881
4913
|
class Loader {
|
|
4882
4914
|
constructor(engine) {
|
|
@@ -5244,7 +5276,7 @@ class HslColorManager {
|
|
|
5244
5276
|
var _a;
|
|
5245
5277
|
const colorValue = color.value,
|
|
5246
5278
|
hslColor = (_a = colorValue.hsl) !== null && _a !== void 0 ? _a : color.value;
|
|
5247
|
-
if (hslColor.h !== undefined && hslColor.l !== undefined) {
|
|
5279
|
+
if (hslColor.h !== undefined && hslColor.s !== undefined && hslColor.l !== undefined) {
|
|
5248
5280
|
return hslToRgb(hslColor);
|
|
5249
5281
|
}
|
|
5250
5282
|
}
|
|
@@ -5319,14 +5351,14 @@ class RgbColorManager {
|
|
|
5319
5351
|
class ExternalInteractorBase {
|
|
5320
5352
|
constructor(container) {
|
|
5321
5353
|
this.container = container;
|
|
5322
|
-
this.type =
|
|
5354
|
+
this.type = "external";
|
|
5323
5355
|
}
|
|
5324
5356
|
}
|
|
5325
5357
|
;// CONCATENATED MODULE: ../../engine/dist/esm/Core/Utils/ParticlesInteractorBase.js
|
|
5326
5358
|
class ParticlesInteractorBase {
|
|
5327
5359
|
constructor(container) {
|
|
5328
5360
|
this.container = container;
|
|
5329
|
-
this.type =
|
|
5361
|
+
this.type = "particles";
|
|
5330
5362
|
}
|
|
5331
5363
|
}
|
|
5332
5364
|
;// CONCATENATED MODULE: ../../engine/dist/esm/index.js
|
|
@@ -5517,6 +5549,7 @@ tsParticles.init();
|
|
|
5517
5549
|
|
|
5518
5550
|
|
|
5519
5551
|
|
|
5552
|
+
|
|
5520
5553
|
|
|
5521
5554
|
|
|
5522
5555
|
;// CONCATENATED MODULE: ../../plugins/absorbers/dist/esm/Options/Classes/AbsorberSizeLimit.js
|
|
@@ -7117,13 +7150,13 @@ function updateAngle(particle, delta) {
|
|
|
7117
7150
|
return;
|
|
7118
7151
|
}
|
|
7119
7152
|
switch (rotate.status) {
|
|
7120
|
-
case
|
|
7153
|
+
case "increasing":
|
|
7121
7154
|
rotate.value += speed;
|
|
7122
7155
|
if (rotate.value > max) {
|
|
7123
7156
|
rotate.value -= max;
|
|
7124
7157
|
}
|
|
7125
7158
|
break;
|
|
7126
|
-
case
|
|
7159
|
+
case "decreasing":
|
|
7127
7160
|
default:
|
|
7128
7161
|
rotate.value -= speed;
|
|
7129
7162
|
if (rotate.value < 0) {
|
|
@@ -7157,10 +7190,10 @@ class RotateUpdater {
|
|
|
7157
7190
|
switch (rotateDirection) {
|
|
7158
7191
|
case "counter-clockwise":
|
|
7159
7192
|
case "counterClockwise":
|
|
7160
|
-
particle.rotate.status =
|
|
7193
|
+
particle.rotate.status = "decreasing";
|
|
7161
7194
|
break;
|
|
7162
7195
|
case "clockwise":
|
|
7163
|
-
particle.rotate.status =
|
|
7196
|
+
particle.rotate.status = "increasing";
|
|
7164
7197
|
break;
|
|
7165
7198
|
}
|
|
7166
7199
|
const rotateAnimation = rotateOptions.animation;
|
|
@@ -7410,16 +7443,16 @@ function updateColorValue(delta, value, valueAnimation, max, decrease) {
|
|
|
7410
7443
|
const offset = randomInRange(valueAnimation.offset),
|
|
7411
7444
|
velocity = ((_a = value.velocity) !== null && _a !== void 0 ? _a : 0) * delta.factor + offset * 3.6,
|
|
7412
7445
|
decay = (_b = value.decay) !== null && _b !== void 0 ? _b : 1;
|
|
7413
|
-
if (!decrease || colorValue.status ===
|
|
7446
|
+
if (!decrease || colorValue.status === "increasing") {
|
|
7414
7447
|
colorValue.value += velocity;
|
|
7415
7448
|
if (decrease && colorValue.value > max) {
|
|
7416
|
-
colorValue.status =
|
|
7449
|
+
colorValue.status = "decreasing";
|
|
7417
7450
|
colorValue.value -= colorValue.value % max;
|
|
7418
7451
|
}
|
|
7419
7452
|
} else {
|
|
7420
7453
|
colorValue.value -= velocity;
|
|
7421
7454
|
if (colorValue.value < 0) {
|
|
7422
|
-
colorValue.status =
|
|
7455
|
+
colorValue.status = "increasing";
|
|
7423
7456
|
colorValue.value += colorValue.value;
|
|
7424
7457
|
}
|
|
7425
7458
|
}
|
|
@@ -9476,9 +9509,9 @@ function updateOpacity(particle, delta) {
|
|
|
9476
9509
|
return;
|
|
9477
9510
|
}
|
|
9478
9511
|
switch (particle.opacity.status) {
|
|
9479
|
-
case
|
|
9512
|
+
case "increasing":
|
|
9480
9513
|
if (particle.opacity.value >= maxValue) {
|
|
9481
|
-
particle.opacity.status =
|
|
9514
|
+
particle.opacity.status = "decreasing";
|
|
9482
9515
|
if (!particle.opacity.loops) {
|
|
9483
9516
|
particle.opacity.loops = 0;
|
|
9484
9517
|
}
|
|
@@ -9487,9 +9520,9 @@ function updateOpacity(particle, delta) {
|
|
|
9487
9520
|
particle.opacity.value += ((_e = particle.opacity.velocity) !== null && _e !== void 0 ? _e : 0) * delta.factor;
|
|
9488
9521
|
}
|
|
9489
9522
|
break;
|
|
9490
|
-
case
|
|
9523
|
+
case "decreasing":
|
|
9491
9524
|
if (particle.opacity.value <= minValue) {
|
|
9492
|
-
particle.opacity.status =
|
|
9525
|
+
particle.opacity.status = "increasing";
|
|
9493
9526
|
if (!particle.opacity.loops) {
|
|
9494
9527
|
particle.opacity.loops = 0;
|
|
9495
9528
|
}
|
|
@@ -9524,23 +9557,23 @@ class OpacityUpdater {
|
|
|
9524
9557
|
const opacityAnimation = opacityOptions.animation;
|
|
9525
9558
|
if (opacityAnimation.enable) {
|
|
9526
9559
|
particle.opacity.decay = 1 - getRangeValue(opacityAnimation.decay);
|
|
9527
|
-
particle.opacity.status =
|
|
9560
|
+
particle.opacity.status = "increasing";
|
|
9528
9561
|
const opacityRange = opacityOptions.value;
|
|
9529
9562
|
particle.opacity.min = getRangeMin(opacityRange);
|
|
9530
9563
|
particle.opacity.max = getRangeMax(opacityRange);
|
|
9531
9564
|
switch (opacityAnimation.startValue) {
|
|
9532
9565
|
case "min":
|
|
9533
9566
|
particle.opacity.value = particle.opacity.min;
|
|
9534
|
-
particle.opacity.status =
|
|
9567
|
+
particle.opacity.status = "increasing";
|
|
9535
9568
|
break;
|
|
9536
9569
|
case "random":
|
|
9537
9570
|
particle.opacity.value = randomInRange(particle.opacity);
|
|
9538
|
-
particle.opacity.status = getRandom() >= 0.5 ?
|
|
9571
|
+
particle.opacity.status = getRandom() >= 0.5 ? "increasing" : "decreasing";
|
|
9539
9572
|
break;
|
|
9540
9573
|
case "max":
|
|
9541
9574
|
default:
|
|
9542
9575
|
particle.opacity.value = particle.opacity.max;
|
|
9543
|
-
particle.opacity.status =
|
|
9576
|
+
particle.opacity.status = "decreasing";
|
|
9544
9577
|
break;
|
|
9545
9578
|
}
|
|
9546
9579
|
particle.opacity.velocity = getRangeValue(opacityAnimation.speed) / 100 * this.container.retina.reduceFactor;
|
|
@@ -10290,6 +10323,7 @@ class Linker extends ParticlesInteractorBase {
|
|
|
10290
10323
|
}
|
|
10291
10324
|
clear() {}
|
|
10292
10325
|
init() {
|
|
10326
|
+
this.linkContainer.particles.linksColor = undefined;
|
|
10293
10327
|
this.linkContainer.particles.linksColors = new Map();
|
|
10294
10328
|
}
|
|
10295
10329
|
async interact(p1) {
|
|
@@ -10488,14 +10522,13 @@ class LinkInstance {
|
|
|
10488
10522
|
}
|
|
10489
10523
|
drawParticle(context, particle) {
|
|
10490
10524
|
var _a;
|
|
10491
|
-
const
|
|
10492
|
-
pOptions = particle.options;
|
|
10525
|
+
const pOptions = particle.options;
|
|
10493
10526
|
if (!particle.links || particle.links.length <= 0) {
|
|
10494
10527
|
return;
|
|
10495
10528
|
}
|
|
10496
10529
|
const p1Links = particle.links.filter(l => pOptions.links && this.getLinkFrequency(particle, l.destination) <= pOptions.links.frequency);
|
|
10497
10530
|
for (const link of p1Links) {
|
|
10498
|
-
this.drawTriangles(
|
|
10531
|
+
this.drawTriangles(pOptions, particle, link, p1Links);
|
|
10499
10532
|
if (link.opacity > 0 && ((_a = particle.retina.linksWidth) !== null && _a !== void 0 ? _a : 0) > 0) {
|
|
10500
10533
|
this.drawLinkLine(particle, link);
|
|
10501
10534
|
}
|
|
@@ -10588,7 +10621,7 @@ class LinkInstance {
|
|
|
10588
10621
|
drawLinkTriangle(ctx, pos1, pos2, pos3, options.backgroundMask.enable, options.backgroundMask.composite, colorTriangle, opacityTriangle);
|
|
10589
10622
|
});
|
|
10590
10623
|
}
|
|
10591
|
-
drawTriangles(
|
|
10624
|
+
drawTriangles(options, p1, link, p1Links) {
|
|
10592
10625
|
var _a, _b, _c;
|
|
10593
10626
|
const p2 = link.destination;
|
|
10594
10627
|
if (!(((_a = options.links) === null || _a === void 0 ? void 0 : _a.triangles.enable) && ((_b = p2.options.links) === null || _b === void 0 ? void 0 : _b.triangles.enable))) {
|
|
@@ -10759,9 +10792,9 @@ function updateSize(particle, delta) {
|
|
|
10759
10792
|
return;
|
|
10760
10793
|
}
|
|
10761
10794
|
switch (particle.size.status) {
|
|
10762
|
-
case
|
|
10795
|
+
case "increasing":
|
|
10763
10796
|
if (particle.size.value >= maxValue) {
|
|
10764
|
-
particle.size.status =
|
|
10797
|
+
particle.size.status = "decreasing";
|
|
10765
10798
|
if (!particle.size.loops) {
|
|
10766
10799
|
particle.size.loops = 0;
|
|
10767
10800
|
}
|
|
@@ -10770,9 +10803,9 @@ function updateSize(particle, delta) {
|
|
|
10770
10803
|
particle.size.value += sizeVelocity;
|
|
10771
10804
|
}
|
|
10772
10805
|
break;
|
|
10773
|
-
case
|
|
10806
|
+
case "decreasing":
|
|
10774
10807
|
if (particle.size.value <= minValue) {
|
|
10775
|
-
particle.size.status =
|
|
10808
|
+
particle.size.status = "increasing";
|
|
10776
10809
|
if (!particle.size.loops) {
|
|
10777
10810
|
particle.size.loops = 0;
|
|
10778
10811
|
}
|
|
@@ -10875,16 +10908,16 @@ function StrokeColorUpdater_updateColorValue(delta, value, valueAnimation, max,
|
|
|
10875
10908
|
const offset = randomInRange(valueAnimation.offset),
|
|
10876
10909
|
velocity = ((_a = value.velocity) !== null && _a !== void 0 ? _a : 0) * delta.factor + offset * 3.6,
|
|
10877
10910
|
decay = (_b = value.decay) !== null && _b !== void 0 ? _b : 1;
|
|
10878
|
-
if (!decrease || colorValue.status ===
|
|
10911
|
+
if (!decrease || colorValue.status === "increasing") {
|
|
10879
10912
|
colorValue.value += velocity;
|
|
10880
10913
|
if (decrease && colorValue.value > max) {
|
|
10881
|
-
colorValue.status =
|
|
10914
|
+
colorValue.status = "decreasing";
|
|
10882
10915
|
colorValue.value -= colorValue.value % max;
|
|
10883
10916
|
}
|
|
10884
10917
|
} else {
|
|
10885
10918
|
colorValue.value -= velocity;
|
|
10886
10919
|
if (colorValue.value < 0) {
|
|
10887
|
-
colorValue.status =
|
|
10920
|
+
colorValue.status = "increasing";
|
|
10888
10921
|
colorValue.value += colorValue.value;
|
|
10889
10922
|
}
|
|
10890
10923
|
}
|
|
@@ -11138,13 +11171,13 @@ function updateTilt(particle, delta) {
|
|
|
11138
11171
|
return;
|
|
11139
11172
|
}
|
|
11140
11173
|
switch (particle.tilt.status) {
|
|
11141
|
-
case
|
|
11174
|
+
case "increasing":
|
|
11142
11175
|
particle.tilt.value += speed;
|
|
11143
11176
|
if (particle.tilt.value > max) {
|
|
11144
11177
|
particle.tilt.value -= max;
|
|
11145
11178
|
}
|
|
11146
11179
|
break;
|
|
11147
|
-
case
|
|
11180
|
+
case "decreasing":
|
|
11148
11181
|
default:
|
|
11149
11182
|
particle.tilt.value -= speed;
|
|
11150
11183
|
if (particle.tilt.value < 0) {
|
|
@@ -11188,10 +11221,10 @@ class TiltUpdater {
|
|
|
11188
11221
|
switch (tiltDirection) {
|
|
11189
11222
|
case "counter-clockwise":
|
|
11190
11223
|
case "counterClockwise":
|
|
11191
|
-
particle.tilt.status =
|
|
11224
|
+
particle.tilt.status = "decreasing";
|
|
11192
11225
|
break;
|
|
11193
11226
|
case "clockwise":
|
|
11194
|
-
particle.tilt.status =
|
|
11227
|
+
particle.tilt.status = "increasing";
|
|
11195
11228
|
break;
|
|
11196
11229
|
}
|
|
11197
11230
|
const tiltAnimation = (_a = particle.options.tilt) === null || _a === void 0 ? void 0 : _a.animation;
|