@tsparticles/interaction-particles-links 4.1.3 → 4.2.1
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/browser/Linker.js +2 -5
- package/browser/Options/Classes/Links.js +21 -50
- package/browser/Options/Classes/LinksShadow.js +6 -13
- package/browser/Options/Classes/LinksTriangle.js +6 -16
- package/browser/index.js +1 -1
- package/browser/index.lazy.js +1 -1
- package/cjs/Linker.js +2 -5
- package/cjs/Options/Classes/Links.js +21 -50
- package/cjs/Options/Classes/LinksShadow.js +6 -13
- package/cjs/Options/Classes/LinksTriangle.js +6 -16
- package/cjs/index.js +1 -1
- package/cjs/index.lazy.js +1 -1
- package/esm/Linker.js +2 -5
- package/esm/Options/Classes/Links.js +21 -50
- package/esm/Options/Classes/LinksShadow.js +6 -13
- package/esm/Options/Classes/LinksTriangle.js +6 -16
- package/esm/index.js +1 -1
- package/esm/index.lazy.js +1 -1
- package/package.json +4 -4
- package/report.html +1 -1
- package/tsparticles.interaction.particles.links.js +33 -82
- package/tsparticles.interaction.particles.links.min.js +1 -1
- package/types/Interfaces.d.ts +2 -12
- package/types/Options/Classes/LinksTriangle.d.ts +0 -1
- package/types/Types.d.ts +10 -1
package/browser/Linker.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Circle, getDistances, getLinkColor, getLinkRandomColor, originPoint, } from "@tsparticles/engine";
|
|
1
|
+
import { Circle, getDistances, getLinkColor, getLinkRandomColor, loadOptionProperty, originPoint, } from "@tsparticles/engine";
|
|
2
2
|
import { CircleWarp } from "./CircleWarp.js";
|
|
3
3
|
import { Links } from "./Options/Classes/Links.js";
|
|
4
4
|
import { ParticlesInteractorBase } from "@tsparticles/plugin-interactivity";
|
|
@@ -74,10 +74,7 @@ export class Linker extends ParticlesInteractorBase {
|
|
|
74
74
|
return !!particle.options.links?.enable;
|
|
75
75
|
}
|
|
76
76
|
loadParticlesOptions(options, ...sources) {
|
|
77
|
-
options
|
|
78
|
-
for (const source of sources) {
|
|
79
|
-
options.links.load(source?.links);
|
|
80
|
-
}
|
|
77
|
+
loadOptionProperty(options, "links", Links, ...sources);
|
|
81
78
|
}
|
|
82
79
|
reset() {
|
|
83
80
|
}
|
|
@@ -1,66 +1,37 @@
|
|
|
1
|
-
import { OptionsColor, isNull } from "@tsparticles/engine";
|
|
1
|
+
import { OptionsColor, isNull, loadProperty } from "@tsparticles/engine";
|
|
2
2
|
import { LinksShadow } from "./LinksShadow.js";
|
|
3
3
|
import { LinksTriangle } from "./LinksTriangle.js";
|
|
4
4
|
export class Links {
|
|
5
|
-
blink;
|
|
6
|
-
color;
|
|
7
|
-
consent;
|
|
8
|
-
distance;
|
|
9
|
-
enable;
|
|
10
|
-
frequency;
|
|
5
|
+
blink = false;
|
|
6
|
+
color = new OptionsColor();
|
|
7
|
+
consent = false;
|
|
8
|
+
distance = 100;
|
|
9
|
+
enable = false;
|
|
10
|
+
frequency = 1;
|
|
11
11
|
id;
|
|
12
|
-
opacity;
|
|
13
|
-
shadow;
|
|
14
|
-
triangles;
|
|
15
|
-
warp;
|
|
16
|
-
width;
|
|
12
|
+
opacity = 1;
|
|
13
|
+
shadow = new LinksShadow();
|
|
14
|
+
triangles = new LinksTriangle();
|
|
15
|
+
warp = false;
|
|
16
|
+
width = 1;
|
|
17
17
|
constructor() {
|
|
18
|
-
this.blink = false;
|
|
19
|
-
this.color = new OptionsColor();
|
|
20
18
|
this.color.value = "#fff";
|
|
21
|
-
this.consent = false;
|
|
22
|
-
this.distance = 100;
|
|
23
|
-
this.enable = false;
|
|
24
|
-
this.frequency = 1;
|
|
25
|
-
this.opacity = 1;
|
|
26
|
-
this.shadow = new LinksShadow();
|
|
27
|
-
this.triangles = new LinksTriangle();
|
|
28
|
-
this.width = 1;
|
|
29
|
-
this.warp = false;
|
|
30
19
|
}
|
|
31
20
|
load(data) {
|
|
32
21
|
if (isNull(data)) {
|
|
33
22
|
return;
|
|
34
23
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
if (data.blink !== undefined) {
|
|
39
|
-
this.blink = data.blink;
|
|
40
|
-
}
|
|
24
|
+
loadProperty(this, "id", data.id);
|
|
25
|
+
loadProperty(this, "blink", data.blink);
|
|
41
26
|
this.color = OptionsColor.create(this.color, data.color);
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
if (data.enable !== undefined) {
|
|
49
|
-
this.enable = data.enable;
|
|
50
|
-
}
|
|
51
|
-
if (data.frequency !== undefined) {
|
|
52
|
-
this.frequency = data.frequency;
|
|
53
|
-
}
|
|
54
|
-
if (data.opacity !== undefined) {
|
|
55
|
-
this.opacity = data.opacity;
|
|
56
|
-
}
|
|
27
|
+
loadProperty(this, "consent", data.consent);
|
|
28
|
+
loadProperty(this, "distance", data.distance);
|
|
29
|
+
loadProperty(this, "enable", data.enable);
|
|
30
|
+
loadProperty(this, "frequency", data.frequency);
|
|
31
|
+
loadProperty(this, "opacity", data.opacity);
|
|
57
32
|
this.shadow.load(data.shadow);
|
|
58
33
|
this.triangles.load(data.triangles);
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
if (data.warp !== undefined) {
|
|
63
|
-
this.warp = data.warp;
|
|
64
|
-
}
|
|
34
|
+
loadProperty(this, "width", data.width);
|
|
35
|
+
loadProperty(this, "warp", data.warp);
|
|
65
36
|
}
|
|
66
37
|
}
|
|
@@ -1,24 +1,17 @@
|
|
|
1
|
-
import { OptionsColor, isNull } from "@tsparticles/engine";
|
|
1
|
+
import { OptionsColor, isNull, loadProperty } from "@tsparticles/engine";
|
|
2
2
|
export class LinksShadow {
|
|
3
|
-
blur;
|
|
4
|
-
color;
|
|
5
|
-
enable;
|
|
3
|
+
blur = 5;
|
|
4
|
+
color = new OptionsColor();
|
|
5
|
+
enable = false;
|
|
6
6
|
constructor() {
|
|
7
|
-
this.blur = 5;
|
|
8
|
-
this.color = new OptionsColor();
|
|
9
7
|
this.color.value = "#000";
|
|
10
|
-
this.enable = false;
|
|
11
8
|
}
|
|
12
9
|
load(data) {
|
|
13
10
|
if (isNull(data)) {
|
|
14
11
|
return;
|
|
15
12
|
}
|
|
16
|
-
|
|
17
|
-
this.blur = data.blur;
|
|
18
|
-
}
|
|
13
|
+
loadProperty(this, "blur", data.blur);
|
|
19
14
|
this.color = OptionsColor.create(this.color, data.color);
|
|
20
|
-
|
|
21
|
-
this.enable = data.enable;
|
|
22
|
-
}
|
|
15
|
+
loadProperty(this, "enable", data.enable);
|
|
23
16
|
}
|
|
24
17
|
}
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
import { OptionsColor, isNull } from "@tsparticles/engine";
|
|
1
|
+
import { OptionsColor, isNull, loadProperty } from "@tsparticles/engine";
|
|
2
2
|
export class LinksTriangle {
|
|
3
3
|
color;
|
|
4
|
-
enable;
|
|
5
|
-
frequency;
|
|
4
|
+
enable = false;
|
|
5
|
+
frequency = 1;
|
|
6
6
|
opacity;
|
|
7
|
-
constructor() {
|
|
8
|
-
this.enable = false;
|
|
9
|
-
this.frequency = 1;
|
|
10
|
-
}
|
|
11
7
|
load(data) {
|
|
12
8
|
if (isNull(data)) {
|
|
13
9
|
return;
|
|
@@ -15,14 +11,8 @@ export class LinksTriangle {
|
|
|
15
11
|
if (data.color !== undefined) {
|
|
16
12
|
this.color = OptionsColor.create(this.color, data.color);
|
|
17
13
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
if (data.frequency !== undefined) {
|
|
22
|
-
this.frequency = data.frequency;
|
|
23
|
-
}
|
|
24
|
-
if (data.opacity !== undefined) {
|
|
25
|
-
this.opacity = data.opacity;
|
|
26
|
-
}
|
|
14
|
+
loadProperty(this, "enable", data.enable);
|
|
15
|
+
loadProperty(this, "frequency", data.frequency);
|
|
16
|
+
loadProperty(this, "opacity", data.opacity);
|
|
27
17
|
}
|
|
28
18
|
}
|
package/browser/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { ensureInteractivityPluginLoaded } from "@tsparticles/plugin-interactivi
|
|
|
2
2
|
import { Linker } from "./Linker.js";
|
|
3
3
|
import { LinksPlugin } from "./LinksPlugin.js";
|
|
4
4
|
export async function loadParticlesLinksInteraction(engine) {
|
|
5
|
-
engine.checkVersion("4.1
|
|
5
|
+
engine.checkVersion("4.2.1");
|
|
6
6
|
await engine.pluginManager.register((e) => {
|
|
7
7
|
const pluginManager = e.pluginManager;
|
|
8
8
|
ensureInteractivityPluginLoaded(e);
|
package/browser/index.lazy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadParticlesLinksInteraction(engine) {
|
|
2
|
-
engine.checkVersion("4.1
|
|
2
|
+
engine.checkVersion("4.2.1");
|
|
3
3
|
await engine.pluginManager.register(async (e) => {
|
|
4
4
|
const pluginManager = e.pluginManager, [{ ensureInteractivityPluginLoaded }, { LinksPlugin },] = await Promise.all([
|
|
5
5
|
import("@tsparticles/plugin-interactivity/lazy"),
|
package/cjs/Linker.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Circle, getDistances, getLinkColor, getLinkRandomColor, originPoint, } from "@tsparticles/engine";
|
|
1
|
+
import { Circle, getDistances, getLinkColor, getLinkRandomColor, loadOptionProperty, originPoint, } from "@tsparticles/engine";
|
|
2
2
|
import { CircleWarp } from "./CircleWarp.js";
|
|
3
3
|
import { Links } from "./Options/Classes/Links.js";
|
|
4
4
|
import { ParticlesInteractorBase } from "@tsparticles/plugin-interactivity";
|
|
@@ -74,10 +74,7 @@ export class Linker extends ParticlesInteractorBase {
|
|
|
74
74
|
return !!particle.options.links?.enable;
|
|
75
75
|
}
|
|
76
76
|
loadParticlesOptions(options, ...sources) {
|
|
77
|
-
options
|
|
78
|
-
for (const source of sources) {
|
|
79
|
-
options.links.load(source?.links);
|
|
80
|
-
}
|
|
77
|
+
loadOptionProperty(options, "links", Links, ...sources);
|
|
81
78
|
}
|
|
82
79
|
reset() {
|
|
83
80
|
}
|
|
@@ -1,66 +1,37 @@
|
|
|
1
|
-
import { OptionsColor, isNull } from "@tsparticles/engine";
|
|
1
|
+
import { OptionsColor, isNull, loadProperty } from "@tsparticles/engine";
|
|
2
2
|
import { LinksShadow } from "./LinksShadow.js";
|
|
3
3
|
import { LinksTriangle } from "./LinksTriangle.js";
|
|
4
4
|
export class Links {
|
|
5
|
-
blink;
|
|
6
|
-
color;
|
|
7
|
-
consent;
|
|
8
|
-
distance;
|
|
9
|
-
enable;
|
|
10
|
-
frequency;
|
|
5
|
+
blink = false;
|
|
6
|
+
color = new OptionsColor();
|
|
7
|
+
consent = false;
|
|
8
|
+
distance = 100;
|
|
9
|
+
enable = false;
|
|
10
|
+
frequency = 1;
|
|
11
11
|
id;
|
|
12
|
-
opacity;
|
|
13
|
-
shadow;
|
|
14
|
-
triangles;
|
|
15
|
-
warp;
|
|
16
|
-
width;
|
|
12
|
+
opacity = 1;
|
|
13
|
+
shadow = new LinksShadow();
|
|
14
|
+
triangles = new LinksTriangle();
|
|
15
|
+
warp = false;
|
|
16
|
+
width = 1;
|
|
17
17
|
constructor() {
|
|
18
|
-
this.blink = false;
|
|
19
|
-
this.color = new OptionsColor();
|
|
20
18
|
this.color.value = "#fff";
|
|
21
|
-
this.consent = false;
|
|
22
|
-
this.distance = 100;
|
|
23
|
-
this.enable = false;
|
|
24
|
-
this.frequency = 1;
|
|
25
|
-
this.opacity = 1;
|
|
26
|
-
this.shadow = new LinksShadow();
|
|
27
|
-
this.triangles = new LinksTriangle();
|
|
28
|
-
this.width = 1;
|
|
29
|
-
this.warp = false;
|
|
30
19
|
}
|
|
31
20
|
load(data) {
|
|
32
21
|
if (isNull(data)) {
|
|
33
22
|
return;
|
|
34
23
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
if (data.blink !== undefined) {
|
|
39
|
-
this.blink = data.blink;
|
|
40
|
-
}
|
|
24
|
+
loadProperty(this, "id", data.id);
|
|
25
|
+
loadProperty(this, "blink", data.blink);
|
|
41
26
|
this.color = OptionsColor.create(this.color, data.color);
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
if (data.enable !== undefined) {
|
|
49
|
-
this.enable = data.enable;
|
|
50
|
-
}
|
|
51
|
-
if (data.frequency !== undefined) {
|
|
52
|
-
this.frequency = data.frequency;
|
|
53
|
-
}
|
|
54
|
-
if (data.opacity !== undefined) {
|
|
55
|
-
this.opacity = data.opacity;
|
|
56
|
-
}
|
|
27
|
+
loadProperty(this, "consent", data.consent);
|
|
28
|
+
loadProperty(this, "distance", data.distance);
|
|
29
|
+
loadProperty(this, "enable", data.enable);
|
|
30
|
+
loadProperty(this, "frequency", data.frequency);
|
|
31
|
+
loadProperty(this, "opacity", data.opacity);
|
|
57
32
|
this.shadow.load(data.shadow);
|
|
58
33
|
this.triangles.load(data.triangles);
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
if (data.warp !== undefined) {
|
|
63
|
-
this.warp = data.warp;
|
|
64
|
-
}
|
|
34
|
+
loadProperty(this, "width", data.width);
|
|
35
|
+
loadProperty(this, "warp", data.warp);
|
|
65
36
|
}
|
|
66
37
|
}
|
|
@@ -1,24 +1,17 @@
|
|
|
1
|
-
import { OptionsColor, isNull } from "@tsparticles/engine";
|
|
1
|
+
import { OptionsColor, isNull, loadProperty } from "@tsparticles/engine";
|
|
2
2
|
export class LinksShadow {
|
|
3
|
-
blur;
|
|
4
|
-
color;
|
|
5
|
-
enable;
|
|
3
|
+
blur = 5;
|
|
4
|
+
color = new OptionsColor();
|
|
5
|
+
enable = false;
|
|
6
6
|
constructor() {
|
|
7
|
-
this.blur = 5;
|
|
8
|
-
this.color = new OptionsColor();
|
|
9
7
|
this.color.value = "#000";
|
|
10
|
-
this.enable = false;
|
|
11
8
|
}
|
|
12
9
|
load(data) {
|
|
13
10
|
if (isNull(data)) {
|
|
14
11
|
return;
|
|
15
12
|
}
|
|
16
|
-
|
|
17
|
-
this.blur = data.blur;
|
|
18
|
-
}
|
|
13
|
+
loadProperty(this, "blur", data.blur);
|
|
19
14
|
this.color = OptionsColor.create(this.color, data.color);
|
|
20
|
-
|
|
21
|
-
this.enable = data.enable;
|
|
22
|
-
}
|
|
15
|
+
loadProperty(this, "enable", data.enable);
|
|
23
16
|
}
|
|
24
17
|
}
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
import { OptionsColor, isNull } from "@tsparticles/engine";
|
|
1
|
+
import { OptionsColor, isNull, loadProperty } from "@tsparticles/engine";
|
|
2
2
|
export class LinksTriangle {
|
|
3
3
|
color;
|
|
4
|
-
enable;
|
|
5
|
-
frequency;
|
|
4
|
+
enable = false;
|
|
5
|
+
frequency = 1;
|
|
6
6
|
opacity;
|
|
7
|
-
constructor() {
|
|
8
|
-
this.enable = false;
|
|
9
|
-
this.frequency = 1;
|
|
10
|
-
}
|
|
11
7
|
load(data) {
|
|
12
8
|
if (isNull(data)) {
|
|
13
9
|
return;
|
|
@@ -15,14 +11,8 @@ export class LinksTriangle {
|
|
|
15
11
|
if (data.color !== undefined) {
|
|
16
12
|
this.color = OptionsColor.create(this.color, data.color);
|
|
17
13
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
if (data.frequency !== undefined) {
|
|
22
|
-
this.frequency = data.frequency;
|
|
23
|
-
}
|
|
24
|
-
if (data.opacity !== undefined) {
|
|
25
|
-
this.opacity = data.opacity;
|
|
26
|
-
}
|
|
14
|
+
loadProperty(this, "enable", data.enable);
|
|
15
|
+
loadProperty(this, "frequency", data.frequency);
|
|
16
|
+
loadProperty(this, "opacity", data.opacity);
|
|
27
17
|
}
|
|
28
18
|
}
|
package/cjs/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { ensureInteractivityPluginLoaded } from "@tsparticles/plugin-interactivi
|
|
|
2
2
|
import { Linker } from "./Linker.js";
|
|
3
3
|
import { LinksPlugin } from "./LinksPlugin.js";
|
|
4
4
|
export async function loadParticlesLinksInteraction(engine) {
|
|
5
|
-
engine.checkVersion("4.1
|
|
5
|
+
engine.checkVersion("4.2.1");
|
|
6
6
|
await engine.pluginManager.register((e) => {
|
|
7
7
|
const pluginManager = e.pluginManager;
|
|
8
8
|
ensureInteractivityPluginLoaded(e);
|
package/cjs/index.lazy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadParticlesLinksInteraction(engine) {
|
|
2
|
-
engine.checkVersion("4.1
|
|
2
|
+
engine.checkVersion("4.2.1");
|
|
3
3
|
await engine.pluginManager.register(async (e) => {
|
|
4
4
|
const pluginManager = e.pluginManager, [{ ensureInteractivityPluginLoaded }, { LinksPlugin },] = await Promise.all([
|
|
5
5
|
import("@tsparticles/plugin-interactivity/lazy"),
|
package/esm/Linker.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Circle, getDistances, getLinkColor, getLinkRandomColor, originPoint, } from "@tsparticles/engine";
|
|
1
|
+
import { Circle, getDistances, getLinkColor, getLinkRandomColor, loadOptionProperty, originPoint, } from "@tsparticles/engine";
|
|
2
2
|
import { CircleWarp } from "./CircleWarp.js";
|
|
3
3
|
import { Links } from "./Options/Classes/Links.js";
|
|
4
4
|
import { ParticlesInteractorBase } from "@tsparticles/plugin-interactivity";
|
|
@@ -74,10 +74,7 @@ export class Linker extends ParticlesInteractorBase {
|
|
|
74
74
|
return !!particle.options.links?.enable;
|
|
75
75
|
}
|
|
76
76
|
loadParticlesOptions(options, ...sources) {
|
|
77
|
-
options
|
|
78
|
-
for (const source of sources) {
|
|
79
|
-
options.links.load(source?.links);
|
|
80
|
-
}
|
|
77
|
+
loadOptionProperty(options, "links", Links, ...sources);
|
|
81
78
|
}
|
|
82
79
|
reset() {
|
|
83
80
|
}
|
|
@@ -1,66 +1,37 @@
|
|
|
1
|
-
import { OptionsColor, isNull } from "@tsparticles/engine";
|
|
1
|
+
import { OptionsColor, isNull, loadProperty } from "@tsparticles/engine";
|
|
2
2
|
import { LinksShadow } from "./LinksShadow.js";
|
|
3
3
|
import { LinksTriangle } from "./LinksTriangle.js";
|
|
4
4
|
export class Links {
|
|
5
|
-
blink;
|
|
6
|
-
color;
|
|
7
|
-
consent;
|
|
8
|
-
distance;
|
|
9
|
-
enable;
|
|
10
|
-
frequency;
|
|
5
|
+
blink = false;
|
|
6
|
+
color = new OptionsColor();
|
|
7
|
+
consent = false;
|
|
8
|
+
distance = 100;
|
|
9
|
+
enable = false;
|
|
10
|
+
frequency = 1;
|
|
11
11
|
id;
|
|
12
|
-
opacity;
|
|
13
|
-
shadow;
|
|
14
|
-
triangles;
|
|
15
|
-
warp;
|
|
16
|
-
width;
|
|
12
|
+
opacity = 1;
|
|
13
|
+
shadow = new LinksShadow();
|
|
14
|
+
triangles = new LinksTriangle();
|
|
15
|
+
warp = false;
|
|
16
|
+
width = 1;
|
|
17
17
|
constructor() {
|
|
18
|
-
this.blink = false;
|
|
19
|
-
this.color = new OptionsColor();
|
|
20
18
|
this.color.value = "#fff";
|
|
21
|
-
this.consent = false;
|
|
22
|
-
this.distance = 100;
|
|
23
|
-
this.enable = false;
|
|
24
|
-
this.frequency = 1;
|
|
25
|
-
this.opacity = 1;
|
|
26
|
-
this.shadow = new LinksShadow();
|
|
27
|
-
this.triangles = new LinksTriangle();
|
|
28
|
-
this.width = 1;
|
|
29
|
-
this.warp = false;
|
|
30
19
|
}
|
|
31
20
|
load(data) {
|
|
32
21
|
if (isNull(data)) {
|
|
33
22
|
return;
|
|
34
23
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
if (data.blink !== undefined) {
|
|
39
|
-
this.blink = data.blink;
|
|
40
|
-
}
|
|
24
|
+
loadProperty(this, "id", data.id);
|
|
25
|
+
loadProperty(this, "blink", data.blink);
|
|
41
26
|
this.color = OptionsColor.create(this.color, data.color);
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
if (data.enable !== undefined) {
|
|
49
|
-
this.enable = data.enable;
|
|
50
|
-
}
|
|
51
|
-
if (data.frequency !== undefined) {
|
|
52
|
-
this.frequency = data.frequency;
|
|
53
|
-
}
|
|
54
|
-
if (data.opacity !== undefined) {
|
|
55
|
-
this.opacity = data.opacity;
|
|
56
|
-
}
|
|
27
|
+
loadProperty(this, "consent", data.consent);
|
|
28
|
+
loadProperty(this, "distance", data.distance);
|
|
29
|
+
loadProperty(this, "enable", data.enable);
|
|
30
|
+
loadProperty(this, "frequency", data.frequency);
|
|
31
|
+
loadProperty(this, "opacity", data.opacity);
|
|
57
32
|
this.shadow.load(data.shadow);
|
|
58
33
|
this.triangles.load(data.triangles);
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
if (data.warp !== undefined) {
|
|
63
|
-
this.warp = data.warp;
|
|
64
|
-
}
|
|
34
|
+
loadProperty(this, "width", data.width);
|
|
35
|
+
loadProperty(this, "warp", data.warp);
|
|
65
36
|
}
|
|
66
37
|
}
|
|
@@ -1,24 +1,17 @@
|
|
|
1
|
-
import { OptionsColor, isNull } from "@tsparticles/engine";
|
|
1
|
+
import { OptionsColor, isNull, loadProperty } from "@tsparticles/engine";
|
|
2
2
|
export class LinksShadow {
|
|
3
|
-
blur;
|
|
4
|
-
color;
|
|
5
|
-
enable;
|
|
3
|
+
blur = 5;
|
|
4
|
+
color = new OptionsColor();
|
|
5
|
+
enable = false;
|
|
6
6
|
constructor() {
|
|
7
|
-
this.blur = 5;
|
|
8
|
-
this.color = new OptionsColor();
|
|
9
7
|
this.color.value = "#000";
|
|
10
|
-
this.enable = false;
|
|
11
8
|
}
|
|
12
9
|
load(data) {
|
|
13
10
|
if (isNull(data)) {
|
|
14
11
|
return;
|
|
15
12
|
}
|
|
16
|
-
|
|
17
|
-
this.blur = data.blur;
|
|
18
|
-
}
|
|
13
|
+
loadProperty(this, "blur", data.blur);
|
|
19
14
|
this.color = OptionsColor.create(this.color, data.color);
|
|
20
|
-
|
|
21
|
-
this.enable = data.enable;
|
|
22
|
-
}
|
|
15
|
+
loadProperty(this, "enable", data.enable);
|
|
23
16
|
}
|
|
24
17
|
}
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
import { OptionsColor, isNull } from "@tsparticles/engine";
|
|
1
|
+
import { OptionsColor, isNull, loadProperty } from "@tsparticles/engine";
|
|
2
2
|
export class LinksTriangle {
|
|
3
3
|
color;
|
|
4
|
-
enable;
|
|
5
|
-
frequency;
|
|
4
|
+
enable = false;
|
|
5
|
+
frequency = 1;
|
|
6
6
|
opacity;
|
|
7
|
-
constructor() {
|
|
8
|
-
this.enable = false;
|
|
9
|
-
this.frequency = 1;
|
|
10
|
-
}
|
|
11
7
|
load(data) {
|
|
12
8
|
if (isNull(data)) {
|
|
13
9
|
return;
|
|
@@ -15,14 +11,8 @@ export class LinksTriangle {
|
|
|
15
11
|
if (data.color !== undefined) {
|
|
16
12
|
this.color = OptionsColor.create(this.color, data.color);
|
|
17
13
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
if (data.frequency !== undefined) {
|
|
22
|
-
this.frequency = data.frequency;
|
|
23
|
-
}
|
|
24
|
-
if (data.opacity !== undefined) {
|
|
25
|
-
this.opacity = data.opacity;
|
|
26
|
-
}
|
|
14
|
+
loadProperty(this, "enable", data.enable);
|
|
15
|
+
loadProperty(this, "frequency", data.frequency);
|
|
16
|
+
loadProperty(this, "opacity", data.opacity);
|
|
27
17
|
}
|
|
28
18
|
}
|
package/esm/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { ensureInteractivityPluginLoaded } from "@tsparticles/plugin-interactivi
|
|
|
2
2
|
import { Linker } from "./Linker.js";
|
|
3
3
|
import { LinksPlugin } from "./LinksPlugin.js";
|
|
4
4
|
export async function loadParticlesLinksInteraction(engine) {
|
|
5
|
-
engine.checkVersion("4.1
|
|
5
|
+
engine.checkVersion("4.2.1");
|
|
6
6
|
await engine.pluginManager.register((e) => {
|
|
7
7
|
const pluginManager = e.pluginManager;
|
|
8
8
|
ensureInteractivityPluginLoaded(e);
|
package/esm/index.lazy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadParticlesLinksInteraction(engine) {
|
|
2
|
-
engine.checkVersion("4.1
|
|
2
|
+
engine.checkVersion("4.2.1");
|
|
3
3
|
await engine.pluginManager.register(async (e) => {
|
|
4
4
|
const pluginManager = e.pluginManager, [{ ensureInteractivityPluginLoaded }, { LinksPlugin },] = await Promise.all([
|
|
5
5
|
import("@tsparticles/plugin-interactivity/lazy"),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/interaction-particles-links",
|
|
3
|
-
"version": "4.1
|
|
3
|
+
"version": "4.2.1",
|
|
4
4
|
"description": "tsParticles links particles interaction",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -97,10 +97,10 @@
|
|
|
97
97
|
},
|
|
98
98
|
"type": "module",
|
|
99
99
|
"peerDependencies": {
|
|
100
|
-
"@tsparticles/engine": "4.1
|
|
101
|
-
"@tsparticles/plugin-interactivity": "4.1
|
|
100
|
+
"@tsparticles/engine": "4.2.1",
|
|
101
|
+
"@tsparticles/plugin-interactivity": "4.2.1"
|
|
102
102
|
},
|
|
103
103
|
"dependencies": {
|
|
104
|
-
"@tsparticles/canvas-utils": "4.1
|
|
104
|
+
"@tsparticles/canvas-utils": "4.2.1"
|
|
105
105
|
}
|
|
106
106
|
}
|
package/report.html
CHANGED
|
@@ -4930,7 +4930,7 @@ var drawChart = (function (exports) {
|
|
|
4930
4930
|
</script>
|
|
4931
4931
|
<script>
|
|
4932
4932
|
/*<!--*/
|
|
4933
|
-
const data = {"version":2,"tree":{"name":"root","children":[{"name":"tsparticles.interaction.particles.links.js","children":[{"name":"dist/browser","children":[{"uid":"
|
|
4933
|
+
const data = {"version":2,"tree":{"name":"root","children":[{"name":"tsparticles.interaction.particles.links.js","children":[{"name":"dist/browser","children":[{"uid":"d0f118c9-1","name":"CircleWarp.js"},{"name":"Options/Classes","children":[{"uid":"d0f118c9-3","name":"LinksShadow.js"},{"uid":"d0f118c9-5","name":"LinksTriangle.js"},{"uid":"d0f118c9-7","name":"Links.js"}]},{"uid":"d0f118c9-9","name":"Linker.js"},{"uid":"d0f118c9-11","name":"LinksPlugin.js"},{"uid":"d0f118c9-13","name":"index.js"},{"uid":"d0f118c9-15","name":"browser.js"},{"uid":"d0f118c9-17","name":"Utils.js"},{"uid":"d0f118c9-19","name":"LinkInstance.js"}]}]}],"isRoot":true},"nodeParts":{"d0f118c9-1":{"renderedLength":2053,"gzipLength":0,"brotliLength":0,"metaUid":"d0f118c9-0"},"d0f118c9-3":{"renderedLength":492,"gzipLength":0,"brotliLength":0,"metaUid":"d0f118c9-2"},"d0f118c9-5":{"renderedLength":551,"gzipLength":0,"brotliLength":0,"metaUid":"d0f118c9-4"},"d0f118c9-7":{"renderedLength":1242,"gzipLength":0,"brotliLength":0,"metaUid":"d0f118c9-6"},"d0f118c9-9":{"renderedLength":4795,"gzipLength":0,"brotliLength":0,"metaUid":"d0f118c9-8"},"d0f118c9-11":{"renderedLength":487,"gzipLength":0,"brotliLength":0,"metaUid":"d0f118c9-10"},"d0f118c9-13":{"renderedLength":524,"gzipLength":0,"brotliLength":0,"metaUid":"d0f118c9-12"},"d0f118c9-15":{"renderedLength":201,"gzipLength":0,"brotliLength":0,"metaUid":"d0f118c9-14"},"d0f118c9-17":{"renderedLength":390,"gzipLength":0,"brotliLength":0,"metaUid":"d0f118c9-16"},"d0f118c9-19":{"renderedLength":7639,"gzipLength":0,"brotliLength":0,"metaUid":"d0f118c9-18"}},"nodeMetas":{"d0f118c9-0":{"id":"/dist/browser/CircleWarp.js","moduleParts":{"tsparticles.interaction.particles.links.js":"d0f118c9-1"},"imported":[{"uid":"d0f118c9-21"}],"importedBy":[{"uid":"d0f118c9-8"}]},"d0f118c9-2":{"id":"/dist/browser/Options/Classes/LinksShadow.js","moduleParts":{"tsparticles.interaction.particles.links.js":"d0f118c9-3"},"imported":[{"uid":"d0f118c9-21"}],"importedBy":[{"uid":"d0f118c9-12"},{"uid":"d0f118c9-6"}]},"d0f118c9-4":{"id":"/dist/browser/Options/Classes/LinksTriangle.js","moduleParts":{"tsparticles.interaction.particles.links.js":"d0f118c9-5"},"imported":[{"uid":"d0f118c9-21"}],"importedBy":[{"uid":"d0f118c9-12"},{"uid":"d0f118c9-6"}]},"d0f118c9-6":{"id":"/dist/browser/Options/Classes/Links.js","moduleParts":{"tsparticles.interaction.particles.links.js":"d0f118c9-7"},"imported":[{"uid":"d0f118c9-21"},{"uid":"d0f118c9-2"},{"uid":"d0f118c9-4"}],"importedBy":[{"uid":"d0f118c9-12"},{"uid":"d0f118c9-8"}]},"d0f118c9-8":{"id":"/dist/browser/Linker.js","moduleParts":{"tsparticles.interaction.particles.links.js":"d0f118c9-9"},"imported":[{"uid":"d0f118c9-21"},{"uid":"d0f118c9-0"},{"uid":"d0f118c9-6"},{"uid":"d0f118c9-20"}],"importedBy":[{"uid":"d0f118c9-12"}]},"d0f118c9-10":{"id":"/dist/browser/LinksPlugin.js","moduleParts":{"tsparticles.interaction.particles.links.js":"d0f118c9-11"},"imported":[{"uid":"d0f118c9-18","dynamic":true}],"importedBy":[{"uid":"d0f118c9-12"}]},"d0f118c9-12":{"id":"/dist/browser/index.js","moduleParts":{"tsparticles.interaction.particles.links.js":"d0f118c9-13"},"imported":[{"uid":"d0f118c9-20"},{"uid":"d0f118c9-8"},{"uid":"d0f118c9-10"},{"uid":"d0f118c9-6"},{"uid":"d0f118c9-2"},{"uid":"d0f118c9-4"}],"importedBy":[{"uid":"d0f118c9-14"}]},"d0f118c9-14":{"id":"/dist/browser/browser.js","moduleParts":{"tsparticles.interaction.particles.links.js":"d0f118c9-15"},"imported":[{"uid":"d0f118c9-12"}],"importedBy":[],"isEntry":true},"d0f118c9-16":{"id":"/dist/browser/Utils.js","moduleParts":{"tsparticles.interaction.particles.links.js":"d0f118c9-17"},"imported":[{"uid":"d0f118c9-21"}],"importedBy":[{"uid":"d0f118c9-18"}]},"d0f118c9-18":{"id":"/dist/browser/LinkInstance.js","moduleParts":{"tsparticles.interaction.particles.links.js":"d0f118c9-19"},"imported":[{"uid":"d0f118c9-21"},{"uid":"d0f118c9-16"}],"importedBy":[{"uid":"d0f118c9-10"}]},"d0f118c9-20":{"id":"@tsparticles/plugin-interactivity","moduleParts":{},"imported":[],"importedBy":[{"uid":"d0f118c9-12"},{"uid":"d0f118c9-8"}],"isExternal":true},"d0f118c9-21":{"id":"@tsparticles/engine","moduleParts":{},"imported":[],"importedBy":[{"uid":"d0f118c9-8"},{"uid":"d0f118c9-6"},{"uid":"d0f118c9-2"},{"uid":"d0f118c9-4"},{"uid":"d0f118c9-0"},{"uid":"d0f118c9-18"},{"uid":"d0f118c9-16"}],"isExternal":true}},"env":{"rollup":"4.62.0"},"options":{"gzip":false,"brotli":false,"sourcemap":false}};
|
|
4934
4934
|
|
|
4935
4935
|
const run = () => {
|
|
4936
4936
|
const width = window.innerWidth;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
(function(g){g.__tsParticlesInternals=g.__tsParticlesInternals||{};g.__tsParticlesInternals.bundles=g.__tsParticlesInternals.bundles||{};g.__tsParticlesInternals.effects=g.__tsParticlesInternals.effects||{};g.__tsParticlesInternals.engine=g.__tsParticlesInternals.engine||{};g.__tsParticlesInternals.interactions=g.__tsParticlesInternals.interactions||{};g.__tsParticlesInternals.palettes=g.__tsParticlesInternals.palettes||{};g.__tsParticlesInternals.paths=g.__tsParticlesInternals.paths||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins.emittersShapes=g.__tsParticlesInternals.plugins.emittersShapes||{};g.__tsParticlesInternals.presets=g.__tsParticlesInternals.presets||{};g.__tsParticlesInternals.shapes=g.__tsParticlesInternals.shapes||{};g.__tsParticlesInternals.updaters=g.__tsParticlesInternals.updaters||{};g.__tsParticlesInternals.utils=g.__tsParticlesInternals.utils||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas.utils=g.__tsParticlesInternals.canvas.utils||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path.utils=g.__tsParticlesInternals.path.utils||{};var __tsProxyFactory=typeof Proxy!=="undefined"?function(obj){return new Proxy(obj,{get:function(target,key){if(!(key in target)){target[key]={};}return target[key];}});}:function(obj){return obj;};g.__tsParticlesInternals.bundles=__tsProxyFactory(g.__tsParticlesInternals.bundles);g.__tsParticlesInternals.effects=__tsProxyFactory(g.__tsParticlesInternals.effects);g.__tsParticlesInternals.interactions=__tsProxyFactory(g.__tsParticlesInternals.interactions);g.__tsParticlesInternals.palettes=__tsProxyFactory(g.__tsParticlesInternals.palettes);g.__tsParticlesInternals.paths=__tsProxyFactory(g.__tsParticlesInternals.paths);g.__tsParticlesInternals.plugins=__tsProxyFactory(g.__tsParticlesInternals.plugins);g.__tsParticlesInternals.plugins.emittersShapes=__tsProxyFactory(g.__tsParticlesInternals.plugins.emittersShapes);g.__tsParticlesInternals.presets=__tsProxyFactory(g.__tsParticlesInternals.presets);g.__tsParticlesInternals.shapes=__tsProxyFactory(g.__tsParticlesInternals.shapes);g.__tsParticlesInternals.updaters=__tsProxyFactory(g.__tsParticlesInternals.updaters);g.__tsParticlesInternals.utils=__tsProxyFactory(g.__tsParticlesInternals.utils);g.__tsParticlesInternals.canvas=__tsProxyFactory(g.__tsParticlesInternals.canvas);g.__tsParticlesInternals.path=__tsProxyFactory(g.__tsParticlesInternals.path);g.tsparticlesInternalExports=g.tsparticlesInternalExports||{};})(typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:this);
|
|
2
|
-
/* Particles Interaction v4.1
|
|
2
|
+
/* Particles Interaction v4.2.1 */
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tsparticles/plugin-interactivity'), require('@tsparticles/engine')) :
|
|
5
5
|
typeof define === 'function' && define.amd ? define(['exports', '@tsparticles/plugin-interactivity', '@tsparticles/engine'], factory) :
|
|
@@ -56,38 +56,27 @@
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
class LinksShadow {
|
|
59
|
-
blur;
|
|
60
|
-
color;
|
|
61
|
-
enable;
|
|
59
|
+
blur = 5;
|
|
60
|
+
color = new engine.OptionsColor();
|
|
61
|
+
enable = false;
|
|
62
62
|
constructor() {
|
|
63
|
-
this.blur = 5;
|
|
64
|
-
this.color = new engine.OptionsColor();
|
|
65
63
|
this.color.value = "#000";
|
|
66
|
-
this.enable = false;
|
|
67
64
|
}
|
|
68
65
|
load(data) {
|
|
69
66
|
if (engine.isNull(data)) {
|
|
70
67
|
return;
|
|
71
68
|
}
|
|
72
|
-
|
|
73
|
-
this.blur = data.blur;
|
|
74
|
-
}
|
|
69
|
+
engine.loadProperty(this, "blur", data.blur);
|
|
75
70
|
this.color = engine.OptionsColor.create(this.color, data.color);
|
|
76
|
-
|
|
77
|
-
this.enable = data.enable;
|
|
78
|
-
}
|
|
71
|
+
engine.loadProperty(this, "enable", data.enable);
|
|
79
72
|
}
|
|
80
73
|
}
|
|
81
74
|
|
|
82
75
|
class LinksTriangle {
|
|
83
76
|
color;
|
|
84
|
-
enable;
|
|
85
|
-
frequency;
|
|
77
|
+
enable = false;
|
|
78
|
+
frequency = 1;
|
|
86
79
|
opacity;
|
|
87
|
-
constructor() {
|
|
88
|
-
this.enable = false;
|
|
89
|
-
this.frequency = 1;
|
|
90
|
-
}
|
|
91
80
|
load(data) {
|
|
92
81
|
if (engine.isNull(data)) {
|
|
93
82
|
return;
|
|
@@ -95,79 +84,44 @@
|
|
|
95
84
|
if (data.color !== undefined) {
|
|
96
85
|
this.color = engine.OptionsColor.create(this.color, data.color);
|
|
97
86
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
if (data.frequency !== undefined) {
|
|
102
|
-
this.frequency = data.frequency;
|
|
103
|
-
}
|
|
104
|
-
if (data.opacity !== undefined) {
|
|
105
|
-
this.opacity = data.opacity;
|
|
106
|
-
}
|
|
87
|
+
engine.loadProperty(this, "enable", data.enable);
|
|
88
|
+
engine.loadProperty(this, "frequency", data.frequency);
|
|
89
|
+
engine.loadProperty(this, "opacity", data.opacity);
|
|
107
90
|
}
|
|
108
91
|
}
|
|
109
92
|
|
|
110
93
|
class Links {
|
|
111
|
-
blink;
|
|
112
|
-
color;
|
|
113
|
-
consent;
|
|
114
|
-
distance;
|
|
115
|
-
enable;
|
|
116
|
-
frequency;
|
|
94
|
+
blink = false;
|
|
95
|
+
color = new engine.OptionsColor();
|
|
96
|
+
consent = false;
|
|
97
|
+
distance = 100;
|
|
98
|
+
enable = false;
|
|
99
|
+
frequency = 1;
|
|
117
100
|
id;
|
|
118
|
-
opacity;
|
|
119
|
-
shadow;
|
|
120
|
-
triangles;
|
|
121
|
-
warp;
|
|
122
|
-
width;
|
|
101
|
+
opacity = 1;
|
|
102
|
+
shadow = new LinksShadow();
|
|
103
|
+
triangles = new LinksTriangle();
|
|
104
|
+
warp = false;
|
|
105
|
+
width = 1;
|
|
123
106
|
constructor() {
|
|
124
|
-
this.blink = false;
|
|
125
|
-
this.color = new engine.OptionsColor();
|
|
126
107
|
this.color.value = "#fff";
|
|
127
|
-
this.consent = false;
|
|
128
|
-
this.distance = 100;
|
|
129
|
-
this.enable = false;
|
|
130
|
-
this.frequency = 1;
|
|
131
|
-
this.opacity = 1;
|
|
132
|
-
this.shadow = new LinksShadow();
|
|
133
|
-
this.triangles = new LinksTriangle();
|
|
134
|
-
this.width = 1;
|
|
135
|
-
this.warp = false;
|
|
136
108
|
}
|
|
137
109
|
load(data) {
|
|
138
110
|
if (engine.isNull(data)) {
|
|
139
111
|
return;
|
|
140
112
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}
|
|
144
|
-
if (data.blink !== undefined) {
|
|
145
|
-
this.blink = data.blink;
|
|
146
|
-
}
|
|
113
|
+
engine.loadProperty(this, "id", data.id);
|
|
114
|
+
engine.loadProperty(this, "blink", data.blink);
|
|
147
115
|
this.color = engine.OptionsColor.create(this.color, data.color);
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
}
|
|
154
|
-
if (data.enable !== undefined) {
|
|
155
|
-
this.enable = data.enable;
|
|
156
|
-
}
|
|
157
|
-
if (data.frequency !== undefined) {
|
|
158
|
-
this.frequency = data.frequency;
|
|
159
|
-
}
|
|
160
|
-
if (data.opacity !== undefined) {
|
|
161
|
-
this.opacity = data.opacity;
|
|
162
|
-
}
|
|
116
|
+
engine.loadProperty(this, "consent", data.consent);
|
|
117
|
+
engine.loadProperty(this, "distance", data.distance);
|
|
118
|
+
engine.loadProperty(this, "enable", data.enable);
|
|
119
|
+
engine.loadProperty(this, "frequency", data.frequency);
|
|
120
|
+
engine.loadProperty(this, "opacity", data.opacity);
|
|
163
121
|
this.shadow.load(data.shadow);
|
|
164
122
|
this.triangles.load(data.triangles);
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
}
|
|
168
|
-
if (data.warp !== undefined) {
|
|
169
|
-
this.warp = data.warp;
|
|
170
|
-
}
|
|
123
|
+
engine.loadProperty(this, "width", data.width);
|
|
124
|
+
engine.loadProperty(this, "warp", data.warp);
|
|
171
125
|
}
|
|
172
126
|
}
|
|
173
127
|
|
|
@@ -243,10 +197,7 @@
|
|
|
243
197
|
return !!particle.options.links?.enable;
|
|
244
198
|
}
|
|
245
199
|
loadParticlesOptions(options, ...sources) {
|
|
246
|
-
options
|
|
247
|
-
for (const source of sources) {
|
|
248
|
-
options.links.load(source?.links);
|
|
249
|
-
}
|
|
200
|
+
engine.loadOptionProperty(options, "links", Links, ...sources);
|
|
250
201
|
}
|
|
251
202
|
reset() {
|
|
252
203
|
}
|
|
@@ -299,7 +250,7 @@
|
|
|
299
250
|
}
|
|
300
251
|
|
|
301
252
|
async function loadParticlesLinksInteraction(engine) {
|
|
302
|
-
engine.checkVersion("4.1
|
|
253
|
+
engine.checkVersion("4.2.1");
|
|
303
254
|
await engine.pluginManager.register((e) => {
|
|
304
255
|
const pluginManager = e.pluginManager;
|
|
305
256
|
pluginInteractivity.ensureInteractivityPluginLoaded(e);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t){t.__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.bundles=t.__tsParticlesInternals.bundles||{},t.__tsParticlesInternals.effects=t.__tsParticlesInternals.effects||{},t.__tsParticlesInternals.engine=t.__tsParticlesInternals.engine||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.palettes=t.__tsParticlesInternals.palettes||{},t.__tsParticlesInternals.paths=t.__tsParticlesInternals.paths||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins.emittersShapes=t.__tsParticlesInternals.plugins.emittersShapes||{},t.__tsParticlesInternals.presets=t.__tsParticlesInternals.presets||{},t.__tsParticlesInternals.shapes=t.__tsParticlesInternals.shapes||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.utils=t.__tsParticlesInternals.utils||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas.utils=t.__tsParticlesInternals.canvas.utils||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path.utils=t.__tsParticlesInternals.path.utils||{};var s="undefined"!=typeof Proxy?function(t){return new Proxy(t,{get:function(t,s){return s in t||(t[s]={}),t[s]}})}:function(t){return t};t.__tsParticlesInternals.bundles=s(t.__tsParticlesInternals.bundles),t.__tsParticlesInternals.effects=s(t.__tsParticlesInternals.effects),t.__tsParticlesInternals.interactions=s(t.__tsParticlesInternals.interactions),t.__tsParticlesInternals.palettes=s(t.__tsParticlesInternals.palettes),t.__tsParticlesInternals.paths=s(t.__tsParticlesInternals.paths),t.__tsParticlesInternals.plugins=s(t.__tsParticlesInternals.plugins),t.__tsParticlesInternals.plugins.emittersShapes=s(t.__tsParticlesInternals.plugins.emittersShapes),t.__tsParticlesInternals.presets=s(t.__tsParticlesInternals.presets),t.__tsParticlesInternals.shapes=s(t.__tsParticlesInternals.shapes),t.__tsParticlesInternals.updaters=s(t.__tsParticlesInternals.updaters),t.__tsParticlesInternals.utils=s(t.__tsParticlesInternals.utils),t.__tsParticlesInternals.canvas=s(t.__tsParticlesInternals.canvas),t.__tsParticlesInternals.path=s(t.__tsParticlesInternals.path),t.tsparticlesInternalExports=t.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t,s){"object"==typeof exports&&"undefined"!=typeof module?s(exports,require("@tsparticles/plugin-interactivity"),require("@tsparticles/engine")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/plugin-interactivity","@tsparticles/engine"],s):s(((t="undefined"!=typeof globalThis?globalThis:t||self).__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.interactions.particlesLinks=t.__tsParticlesInternals.interactions.particlesLinks||{}),t.__tsParticlesInternals.plugins.interactivity,t.__tsParticlesInternals.engine)}(this,function(t,s,n){"use strict";class e extends n.Circle{#t;constructor(t,s,n,e){super(t,s,n),this.#t=e}contains(t){if(super.contains(t))return!0;const{width:s,height:n}=this.#t,{x:e,y:i}=t;return super.contains({x:e-s,y:i})||super.contains({x:e+s,y:i})||super.contains({x:e,y:i-n})||super.contains({x:e,y:i+n})||super.contains({x:e-s,y:i-n})||super.contains({x:e+s,y:i+n})||super.contains({x:e-s,y:i+n})||super.contains({x:e+s,y:i-n})}intersects(t){if(super.intersects(t))return!0;const{width:s,height:e}=this.#t,i=t.position,a=[{x:-s,y:0},{x:s,y:0},{x:0,y:-e},{x:0,y:e},{x:-s,y:-e},{x:s,y:e},{x:-s,y:e},{x:s,y:-e}];for(const s of a){const e={x:i.x+s.x,y:i.y+s.y};let a;if(t instanceof n.Circle)a=new n.Circle(e.x,e.y,t.radius);else{const s=t;a=new n.Rectangle(e.x,e.y,s.size.width,s.size.height)}if(super.intersects(a))return!0}return!1}}class i{blur;color;enable;constructor(){this.blur=5,this.color=new n.OptionsColor,this.color.value="#000",this.enable=!1}load(t){n.isNull(t)||(void 0!==t.blur&&(this.blur=t.blur),this.color=n.OptionsColor.create(this.color,t.color),void 0!==t.enable&&(this.enable=t.enable))}}class a{color;enable;frequency;opacity;constructor(){this.enable=!1,this.frequency=1}load(t){n.isNull(t)||(void 0!==t.color&&(this.color=n.OptionsColor.create(this.color,t.color)),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.frequency&&(this.frequency=t.frequency),void 0!==t.opacity&&(this.opacity=t.opacity))}}class r{blink;color;consent;distance;enable;frequency;id;opacity;shadow;triangles;warp;width;constructor(){this.blink=!1,this.color=new n.OptionsColor,this.color.value="#fff",this.consent=!1,this.distance=100,this.enable=!1,this.frequency=1,this.opacity=1,this.shadow=new i,this.triangles=new a,this.width=1,this.warp=!1}load(t){n.isNull(t)||(void 0!==t.id&&(this.id=t.id),void 0!==t.blink&&(this.blink=t.blink),this.color=n.OptionsColor.create(this.color,t.color),void 0!==t.consent&&(this.consent=t.consent),void 0!==t.distance&&(this.distance=t.distance),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.frequency&&(this.frequency=t.frequency),void 0!==t.opacity&&(this.opacity=t.opacity),this.shadow.load(t.shadow),this.triangles.load(t.triangles),void 0!==t.width&&(this.width=t.width),void 0!==t.warp&&(this.warp=t.warp))}}function l(t,s,e){const{dx:i,dy:a}=n.getDistances(t,s),r={x:Math.abs(i),y:Math.abs(a)},l={x:Math.min(r.x,e.width-r.x),y:Math.min(r.y,e.height-r.y)};return Math.hypot(l.x,l.y)}class o extends s.ParticlesInteractorBase{#s;#n;constructor(t,s){super(s),this.#n=t,this.#s=0}get maxDistance(){return this.#s}clear(){}init(){this.container.particles.linksColor=void 0,this.container.particles.linksColors=new Map}interact(t){if(!t.options.links)return;t.links=[],t.linksDistance&&t.linksDistance>this.#s&&(this.#s=t.linksDistance);const s=t.getPosition(),i=this.container,a=i.canvas.size;if(s.x<n.originPoint.x||s.y<n.originPoint.y||s.x>a.width||s.y>a.height)return;const r=t.options.links,o=r.opacity,c=t.retina.linksDistance??0,h=r.warp,p=h?new e(s.x,s.y,c,a):new n.Circle(s.x,s.y,c),u=i.particles.grid.query(p);for(const e of u){const i=e.options.links;if(t===e||!i?.enable||r.id!==i.id||e.spawning||e.destroyed||!e.links||t.links.some(t=>t.destination===e)||e.links.some(s=>s.destination===t))continue;const p=e.getPosition();if(p.x<n.originPoint.x||p.y<n.originPoint.y||p.x>a.width||p.y>a.height)continue;const u=n.getDistances(s,p).distance,_=h&&i.warp?l(s,p,a):u,d=Math.min(u,_);if(d>c)continue;const g=(1-d/c)*o;this.#e(t),t.links.push({destination:e,opacity:g,color:this.#i(t,e),isWarped:_<u})}}isEnabled(t){return!!t.options.links?.enable}loadParticlesOptions(t,...s){t.links??=new r;for(const n of s)t.links.load(n?.links)}reset(){}#i(t,s){const e=this.container,i=t.options.links;if(!i)return;const a=void 0!==i.id?e.particles.linksColors.get(i.id):e.particles.linksColor;return n.getLinkColor(t,s,a)}#e(t){if(!t.options.links)return;const s=this.container,e=t.options.links;let i=void 0===e.id?s.particles.linksColor:s.particles.linksColors.get(e.id);i||(i=n.getLinkRandomColor(this.#n,e.color,e.blink,e.consent),void 0===e.id?s.particles.linksColor=i:s.particles.linksColors.set(e.id,i))}}class c{id="links";#n;constructor(t){this.#n=t}async getPlugin(t){const{LinkInstance:s}=await Promise.resolve().then(function(){return _});return new s(this.#n,t)}loadOptions(){}needsPlugin(){return!0}}async function h(t){t.checkVersion("4.1.3"),await t.pluginManager.register(t=>{const n=t.pluginManager;s.ensureInteractivityPluginLoaded(t),n.addPlugin(new c(n)),n.addInteractor?.("particlesLinks",t=>Promise.resolve(new o(n,t)))})}const p=globalThis;function u(t,s){const e=(i=t.map(t=>t.id),[...i].sort((t,s)=>t-s).join("_"));var i;let a=s.get(e);return void 0===a&&(a=n.getRandom(),s.set(e,a)),a}p.__tsParticlesInternals=p.__tsParticlesInternals??{},p.loadParticlesLinksInteraction=h;var _=Object.freeze({__proto__:null,LinkInstance:class{#a=new Map;#r;#l;#n;constructor(t,s){this.#n=t,this.#r=s,this.#l={links:new Map,triangles:new Map}}drawParticle(t,s){const{links:e,options:i}=s;if(!e?.length||!i.links)return;const a=i.links,r=s.retina.linksWidth??0,l=s.getPosition(),o=s.options.twinkle?.links,c=a.triangles.enable,h=c?new Set(e.map(t=>t.destination.id)):null,p=t.globalAlpha;let u="",_=-1,d=-1,g=!1;const y=()=>{g&&(t.stroke(),g=!1)};for(const p of e){if(a.frequency<1&&this.#o(s,p.destination)>a.frequency)continue;const e=p.destination.getPosition();if(c&&!p.isWarped&&h&&(y(),this.#c(i,s,p,h,l,e,t)),p.opacity<=0||r<=0)continue;if(!a.enable)continue;let P=p.opacity,f=p.color;const I=o?.enable&&n.getRandom()<o.frequency?n.rangeColorToRgb(this.#n,o.color):void 0;if(o&&I&&(f=I,P=n.getRangeValue(o.opacity)),!f){const t=void 0!==a.id?this.#r.particles.linksColors.get(a.id):this.#r.particles.linksColor;f=n.getLinkColor(s,p.destination,t)}if(!f)continue;const k=this.#h(f);if(k===u&&r===_&&P===d||(y(),t.strokeStyle=k,t.lineWidth=r,t.globalAlpha=P,u=k,_=r,d=P,t.beginPath(),g=!0),p.isWarped){const s=this.#r.canvas.size,i=e.x-l.x,a=e.y-l.y;let r=n.originPoint.x,o=n.originPoint.y;Math.abs(i)>s.width*n.half&&(r=i>0?-s.width:s.width),Math.abs(a)>s.height*n.half&&(o=a>0?-s.height:s.height),t.moveTo(l.x,l.y),t.lineTo(e.x+r,e.y+o),t.moveTo(l.x-r,l.y-o),t.lineTo(e.x,e.y)}else t.moveTo(l.x,l.y),t.lineTo(e.x,e.y)}y(),t.globalAlpha=p}init(){return this.#l.links.clear(),this.#l.triangles.clear(),this.#a.clear(),Promise.resolve()}particleCreated(t){if(t.links=[],!t.options.links)return;t.linksDistance=t.options.links.distance,t.linksWidth=t.options.links.width;const s=this.#r.retina.pixelRatio;t.retina.linksDistance=t.linksDistance*s,t.retina.linksWidth=t.linksWidth*s}particleDestroyed(t){t.links=[]}#c(t,s,e,i,a,r,l){const o=e.destination,c=t.links?.triangles;if(!c?.enable||!o.options.links?.triangles.enable)return;const h=o.links;if(h?.length)for(const p of h){if(p.isWarped||this.#o(o,p.destination)>o.options.links.frequency||!i.has(p.destination.id))continue;const h=p.destination;if(this.#p(s,o,h)>(t.links?.triangles.frequency??0))continue;const u=c.opacity??(e.opacity+p.opacity)*n.half,_=n.rangeColorToRgb(this.#n,c.color)??e.color;if(!_||u<=0)continue;const d=h.getPosition();l.save(),l.fillStyle=this.#h(_),l.globalAlpha=u,l.beginPath(),l.moveTo(a.x,a.y),l.lineTo(r.x,r.y),l.lineTo(d.x,d.y),l.closePath(),l.fill(),l.restore()}}#h(t){const s=`${t.r},${t.g},${t.b}`;let e=this.#a.get(s);return e||(e=n.getStyleFromRgb(t,this.#r.hdr),this.#a.set(s,e)),e}#o(t,s){return u([t,s],this.#l.links)}#p(t,s,n){return u([t,s,n],this.#l.triangles)}}});t.Links=r,t.LinksShadow=i,t.LinksTriangle=a,t.loadParticlesLinksInteraction=h}),Object.assign(globalThis.window||globalThis,{loadParticlesLinksInteraction:(globalThis.__tsParticlesInternals.interactions.particlesLinks||{}).loadParticlesLinksInteraction}),delete(globalThis.window||globalThis).tsparticlesInternalExports;
|
|
1
|
+
!function(t){t.__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.bundles=t.__tsParticlesInternals.bundles||{},t.__tsParticlesInternals.effects=t.__tsParticlesInternals.effects||{},t.__tsParticlesInternals.engine=t.__tsParticlesInternals.engine||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.palettes=t.__tsParticlesInternals.palettes||{},t.__tsParticlesInternals.paths=t.__tsParticlesInternals.paths||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins.emittersShapes=t.__tsParticlesInternals.plugins.emittersShapes||{},t.__tsParticlesInternals.presets=t.__tsParticlesInternals.presets||{},t.__tsParticlesInternals.shapes=t.__tsParticlesInternals.shapes||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.utils=t.__tsParticlesInternals.utils||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas.utils=t.__tsParticlesInternals.canvas.utils||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path.utils=t.__tsParticlesInternals.path.utils||{};var s="undefined"!=typeof Proxy?function(t){return new Proxy(t,{get:function(t,s){return s in t||(t[s]={}),t[s]}})}:function(t){return t};t.__tsParticlesInternals.bundles=s(t.__tsParticlesInternals.bundles),t.__tsParticlesInternals.effects=s(t.__tsParticlesInternals.effects),t.__tsParticlesInternals.interactions=s(t.__tsParticlesInternals.interactions),t.__tsParticlesInternals.palettes=s(t.__tsParticlesInternals.palettes),t.__tsParticlesInternals.paths=s(t.__tsParticlesInternals.paths),t.__tsParticlesInternals.plugins=s(t.__tsParticlesInternals.plugins),t.__tsParticlesInternals.plugins.emittersShapes=s(t.__tsParticlesInternals.plugins.emittersShapes),t.__tsParticlesInternals.presets=s(t.__tsParticlesInternals.presets),t.__tsParticlesInternals.shapes=s(t.__tsParticlesInternals.shapes),t.__tsParticlesInternals.updaters=s(t.__tsParticlesInternals.updaters),t.__tsParticlesInternals.utils=s(t.__tsParticlesInternals.utils),t.__tsParticlesInternals.canvas=s(t.__tsParticlesInternals.canvas),t.__tsParticlesInternals.path=s(t.__tsParticlesInternals.path),t.tsparticlesInternalExports=t.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t,s){"object"==typeof exports&&"undefined"!=typeof module?s(exports,require("@tsparticles/plugin-interactivity"),require("@tsparticles/engine")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/plugin-interactivity","@tsparticles/engine"],s):s(((t="undefined"!=typeof globalThis?globalThis:t||self).__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.interactions.particlesLinks=t.__tsParticlesInternals.interactions.particlesLinks||{}),t.__tsParticlesInternals.plugins.interactivity,t.__tsParticlesInternals.engine)}(this,function(t,s,n){"use strict";class e extends n.Circle{#t;constructor(t,s,n,e){super(t,s,n),this.#t=e}contains(t){if(super.contains(t))return!0;const{width:s,height:n}=this.#t,{x:e,y:i}=t;return super.contains({x:e-s,y:i})||super.contains({x:e+s,y:i})||super.contains({x:e,y:i-n})||super.contains({x:e,y:i+n})||super.contains({x:e-s,y:i-n})||super.contains({x:e+s,y:i+n})||super.contains({x:e-s,y:i+n})||super.contains({x:e+s,y:i-n})}intersects(t){if(super.intersects(t))return!0;const{width:s,height:e}=this.#t,i=t.position,a=[{x:-s,y:0},{x:s,y:0},{x:0,y:-e},{x:0,y:e},{x:-s,y:-e},{x:s,y:e},{x:-s,y:e},{x:s,y:-e}];for(const s of a){const e={x:i.x+s.x,y:i.y+s.y};let a;if(t instanceof n.Circle)a=new n.Circle(e.x,e.y,t.radius);else{const s=t;a=new n.Rectangle(e.x,e.y,s.size.width,s.size.height)}if(super.intersects(a))return!0}return!1}}class i{blur=5;color=new n.OptionsColor;enable=!1;constructor(){this.color.value="#000"}load(t){n.isNull(t)||(n.loadProperty(this,"blur",t.blur),this.color=n.OptionsColor.create(this.color,t.color),n.loadProperty(this,"enable",t.enable))}}class a{color;enable=!1;frequency=1;opacity;load(t){n.isNull(t)||(void 0!==t.color&&(this.color=n.OptionsColor.create(this.color,t.color)),n.loadProperty(this,"enable",t.enable),n.loadProperty(this,"frequency",t.frequency),n.loadProperty(this,"opacity",t.opacity))}}class r{blink=!1;color=new n.OptionsColor;consent=!1;distance=100;enable=!1;frequency=1;id;opacity=1;shadow=new i;triangles=new a;warp=!1;width=1;constructor(){this.color.value="#fff"}load(t){n.isNull(t)||(n.loadProperty(this,"id",t.id),n.loadProperty(this,"blink",t.blink),this.color=n.OptionsColor.create(this.color,t.color),n.loadProperty(this,"consent",t.consent),n.loadProperty(this,"distance",t.distance),n.loadProperty(this,"enable",t.enable),n.loadProperty(this,"frequency",t.frequency),n.loadProperty(this,"opacity",t.opacity),this.shadow.load(t.shadow),this.triangles.load(t.triangles),n.loadProperty(this,"width",t.width),n.loadProperty(this,"warp",t.warp))}}function l(t,s,e){const{dx:i,dy:a}=n.getDistances(t,s),r={x:Math.abs(i),y:Math.abs(a)},l={x:Math.min(r.x,e.width-r.x),y:Math.min(r.y,e.height-r.y)};return Math.hypot(l.x,l.y)}class o extends s.ParticlesInteractorBase{#s;#n;constructor(t,s){super(s),this.#n=t,this.#s=0}get maxDistance(){return this.#s}clear(){}init(){this.container.particles.linksColor=void 0,this.container.particles.linksColors=new Map}interact(t){if(!t.options.links)return;t.links=[],t.linksDistance&&t.linksDistance>this.#s&&(this.#s=t.linksDistance);const s=t.getPosition(),i=this.container,a=i.canvas.size;if(s.x<n.originPoint.x||s.y<n.originPoint.y||s.x>a.width||s.y>a.height)return;const r=t.options.links,o=r.opacity,c=t.retina.linksDistance??0,p=r.warp,h=p?new e(s.x,s.y,c,a):new n.Circle(s.x,s.y,c),_=i.particles.grid.query(h);for(const e of _){const i=e.options.links;if(t===e||!i?.enable||r.id!==i.id||e.spawning||e.destroyed||!e.links||t.links.some(t=>t.destination===e)||e.links.some(s=>s.destination===t))continue;const h=e.getPosition();if(h.x<n.originPoint.x||h.y<n.originPoint.y||h.x>a.width||h.y>a.height)continue;const _=n.getDistances(s,h).distance,u=p&&i.warp?l(s,h,a):_,d=Math.min(_,u);if(d>c)continue;const g=(1-d/c)*o;this.#e(t),t.links.push({destination:e,opacity:g,color:this.#i(t,e),isWarped:u<_})}}isEnabled(t){return!!t.options.links?.enable}loadParticlesOptions(t,...s){n.loadOptionProperty(t,"links",r,...s)}reset(){}#i(t,s){const e=this.container,i=t.options.links;if(!i)return;const a=void 0!==i.id?e.particles.linksColors.get(i.id):e.particles.linksColor;return n.getLinkColor(t,s,a)}#e(t){if(!t.options.links)return;const s=this.container,e=t.options.links;let i=void 0===e.id?s.particles.linksColor:s.particles.linksColors.get(e.id);i||(i=n.getLinkRandomColor(this.#n,e.color,e.blink,e.consent),void 0===e.id?s.particles.linksColor=i:s.particles.linksColors.set(e.id,i))}}class c{id="links";#n;constructor(t){this.#n=t}async getPlugin(t){const{LinkInstance:s}=await Promise.resolve().then(function(){return u});return new s(this.#n,t)}loadOptions(){}needsPlugin(){return!0}}async function p(t){t.checkVersion("4.2.1"),await t.pluginManager.register(t=>{const n=t.pluginManager;s.ensureInteractivityPluginLoaded(t),n.addPlugin(new c(n)),n.addInteractor?.("particlesLinks",t=>Promise.resolve(new o(n,t)))})}const h=globalThis;function _(t,s){const e=(i=t.map(t=>t.id),[...i].sort((t,s)=>t-s).join("_"));var i;let a=s.get(e);return void 0===a&&(a=n.getRandom(),s.set(e,a)),a}h.__tsParticlesInternals=h.__tsParticlesInternals??{},h.loadParticlesLinksInteraction=p;var u=Object.freeze({__proto__:null,LinkInstance:class{#a=new Map;#r;#l;#n;constructor(t,s){this.#n=t,this.#r=s,this.#l={links:new Map,triangles:new Map}}drawParticle(t,s){const{links:e,options:i}=s;if(!e?.length||!i.links)return;const a=i.links,r=s.retina.linksWidth??0,l=s.getPosition(),o=s.options.twinkle?.links,c=a.triangles.enable,p=c?new Set(e.map(t=>t.destination.id)):null,h=t.globalAlpha;let _="",u=-1,d=-1,g=!1;const P=()=>{g&&(t.stroke(),g=!1)};for(const h of e){if(a.frequency<1&&this.#o(s,h.destination)>a.frequency)continue;const e=h.destination.getPosition();if(c&&!h.isWarped&&p&&(P(),this.#c(i,s,h,p,l,e,t)),h.opacity<=0||r<=0)continue;if(!a.enable)continue;let y=h.opacity,f=h.color;const I=o?.enable&&n.getRandom()<o.frequency?n.rangeColorToRgb(this.#n,o.color):void 0;if(o&&I&&(f=I,y=n.getRangeValue(o.opacity)),!f){const t=void 0!==a.id?this.#r.particles.linksColors.get(a.id):this.#r.particles.linksColor;f=n.getLinkColor(s,h.destination,t)}if(!f)continue;const k=this.#p(f);if(k===_&&r===u&&y===d||(P(),t.strokeStyle=k,t.lineWidth=r,t.globalAlpha=y,_=k,u=r,d=y,t.beginPath(),g=!0),h.isWarped){const s=this.#r.canvas.size,i=e.x-l.x,a=e.y-l.y;let r=n.originPoint.x,o=n.originPoint.y;Math.abs(i)>s.width*n.half&&(r=i>0?-s.width:s.width),Math.abs(a)>s.height*n.half&&(o=a>0?-s.height:s.height),t.moveTo(l.x,l.y),t.lineTo(e.x+r,e.y+o),t.moveTo(l.x-r,l.y-o),t.lineTo(e.x,e.y)}else t.moveTo(l.x,l.y),t.lineTo(e.x,e.y)}P(),t.globalAlpha=h}init(){return this.#l.links.clear(),this.#l.triangles.clear(),this.#a.clear(),Promise.resolve()}particleCreated(t){if(t.links=[],!t.options.links)return;t.linksDistance=t.options.links.distance,t.linksWidth=t.options.links.width;const s=this.#r.retina.pixelRatio;t.retina.linksDistance=t.linksDistance*s,t.retina.linksWidth=t.linksWidth*s}particleDestroyed(t){t.links=[]}#c(t,s,e,i,a,r,l){const o=e.destination,c=t.links?.triangles;if(!c?.enable||!o.options.links?.triangles.enable)return;const p=o.links;if(p?.length)for(const h of p){if(h.isWarped||this.#o(o,h.destination)>o.options.links.frequency||!i.has(h.destination.id))continue;const p=h.destination;if(this.#h(s,o,p)>(t.links?.triangles.frequency??0))continue;const _=c.opacity??(e.opacity+h.opacity)*n.half,u=n.rangeColorToRgb(this.#n,c.color)??e.color;if(!u||_<=0)continue;const d=p.getPosition();l.save(),l.fillStyle=this.#p(u),l.globalAlpha=_,l.beginPath(),l.moveTo(a.x,a.y),l.lineTo(r.x,r.y),l.lineTo(d.x,d.y),l.closePath(),l.fill(),l.restore()}}#p(t){const s=`${t.r},${t.g},${t.b}`;let e=this.#a.get(s);return e||(e=n.getStyleFromRgb(t,this.#r.hdr),this.#a.set(s,e)),e}#o(t,s){return _([t,s],this.#l.links)}#h(t,s,n){return _([t,s,n],this.#l.triangles)}}});t.Links=r,t.LinksShadow=i,t.LinksTriangle=a,t.loadParticlesLinksInteraction=p}),Object.assign(globalThis.window||globalThis,{loadParticlesLinksInteraction:(globalThis.__tsParticlesInternals.interactions.particlesLinks||{}).loadParticlesLinksInteraction}),delete(globalThis.window||globalThis).tsparticlesInternalExports;
|
package/types/Interfaces.d.ts
CHANGED
|
@@ -1,15 +1,5 @@
|
|
|
1
|
-
import type { IRangeColor,
|
|
2
|
-
|
|
3
|
-
export interface ILink {
|
|
4
|
-
color?: IRgb;
|
|
5
|
-
destination: LinkParticle;
|
|
6
|
-
isWarped?: boolean;
|
|
7
|
-
opacity: number;
|
|
8
|
-
}
|
|
9
|
-
export interface ILinkTriangle {
|
|
10
|
-
opacity: number;
|
|
11
|
-
vertices: LinkParticle[];
|
|
12
|
-
}
|
|
1
|
+
import type { IRangeColor, RangeValue } from "@tsparticles/engine";
|
|
2
|
+
export type { ILink, ILinkTriangle } from "./Types.js";
|
|
13
3
|
export interface IParticlesFrequencies {
|
|
14
4
|
links: Map<string, number>;
|
|
15
5
|
triangles: Map<string, number>;
|
package/types/Types.d.ts
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
import type { IInteractivityParticlesOptions, InteractivityContainer, InteractivityParticle, InteractivityParticlesOptions } from "@tsparticles/plugin-interactivity";
|
|
2
|
-
import type { ILink } from "./Interfaces.js";
|
|
3
2
|
import type { ILinks } from "./Options/Interfaces/ILinks.js";
|
|
4
3
|
import type { IRgb } from "@tsparticles/engine";
|
|
5
4
|
import type { Links } from "./Options/Classes/Links.js";
|
|
5
|
+
export interface ILink {
|
|
6
|
+
color?: IRgb;
|
|
7
|
+
destination: LinkParticle;
|
|
8
|
+
isWarped?: boolean;
|
|
9
|
+
opacity: number;
|
|
10
|
+
}
|
|
11
|
+
export interface ILinkTriangle {
|
|
12
|
+
opacity: number;
|
|
13
|
+
vertices: LinkParticle[];
|
|
14
|
+
}
|
|
6
15
|
export type LinkContainer = InteractivityContainer & {
|
|
7
16
|
particles: {
|
|
8
17
|
linksColor?: IRgb | string;
|