@tsparticles/interaction-external-connect 4.1.3 → 4.2.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/browser/Connector.js +2 -5
- package/browser/Options/Classes/Connect.js +6 -15
- package/browser/Options/Classes/ConnectLinks.js +3 -8
- package/browser/index.js +1 -1
- package/browser/index.lazy.js +1 -1
- package/cjs/Connector.js +2 -5
- package/cjs/Options/Classes/Connect.js +6 -15
- package/cjs/Options/Classes/ConnectLinks.js +3 -8
- package/cjs/index.js +1 -1
- package/cjs/index.lazy.js +1 -1
- package/esm/Connector.js +2 -5
- package/esm/Options/Classes/Connect.js +6 -15
- package/esm/Options/Classes/ConnectLinks.js +3 -8
- 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.external.connect.js +10 -27
- package/tsparticles.interaction.external.connect.min.js +1 -1
- package/types/Options/Classes/Connect.d.ts +1 -2
- package/types/Options/Classes/ConnectLinks.d.ts +0 -1
- package/types/Options/Classes/ConnectOptions.d.ts +4 -2
package/browser/Connector.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ExternalInteractorBase, } from "@tsparticles/plugin-interactivity";
|
|
2
|
-
import { isInArray } from "@tsparticles/engine";
|
|
2
|
+
import { isInArray, loadOptionProperty } from "@tsparticles/engine";
|
|
3
3
|
import { Connect } from "./Options/Classes/Connect.js";
|
|
4
4
|
import { drawConnection } from "./Utils.js";
|
|
5
5
|
const connectMode = "connect", minDistance = 0;
|
|
@@ -54,10 +54,7 @@ export class Connector extends ExternalInteractorBase {
|
|
|
54
54
|
return isInArray(connectMode, events.onHover.mode);
|
|
55
55
|
}
|
|
56
56
|
loadModeOptions(options, ...sources) {
|
|
57
|
-
options
|
|
58
|
-
for (const source of sources) {
|
|
59
|
-
options.connect.load(source?.connect);
|
|
60
|
-
}
|
|
57
|
+
loadOptionProperty(options, "connect", Connect, ...sources);
|
|
61
58
|
}
|
|
62
59
|
reset() {
|
|
63
60
|
}
|
|
@@ -1,24 +1,15 @@
|
|
|
1
|
-
import { isNull } from "@tsparticles/engine";
|
|
1
|
+
import { isNull, loadProperty } from "@tsparticles/engine";
|
|
2
2
|
import { ConnectLinks } from "./ConnectLinks.js";
|
|
3
3
|
export class Connect {
|
|
4
|
-
distance;
|
|
5
|
-
links;
|
|
6
|
-
radius;
|
|
7
|
-
constructor() {
|
|
8
|
-
this.distance = 80;
|
|
9
|
-
this.links = new ConnectLinks();
|
|
10
|
-
this.radius = 60;
|
|
11
|
-
}
|
|
4
|
+
distance = 80;
|
|
5
|
+
links = new ConnectLinks();
|
|
6
|
+
radius = 60;
|
|
12
7
|
load(data) {
|
|
13
8
|
if (isNull(data)) {
|
|
14
9
|
return;
|
|
15
10
|
}
|
|
16
|
-
|
|
17
|
-
this.distance = data.distance;
|
|
18
|
-
}
|
|
11
|
+
loadProperty(this, "distance", data.distance);
|
|
19
12
|
this.links.load(data.links);
|
|
20
|
-
|
|
21
|
-
this.radius = data.radius;
|
|
22
|
-
}
|
|
13
|
+
loadProperty(this, "radius", data.radius);
|
|
23
14
|
}
|
|
24
15
|
}
|
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
import { isNull } from "@tsparticles/engine";
|
|
1
|
+
import { isNull, loadRangeProperty } from "@tsparticles/engine";
|
|
2
2
|
export class ConnectLinks {
|
|
3
|
-
opacity;
|
|
4
|
-
constructor() {
|
|
5
|
-
this.opacity = 0.5;
|
|
6
|
-
}
|
|
3
|
+
opacity = 0.5;
|
|
7
4
|
load(data) {
|
|
8
5
|
if (isNull(data)) {
|
|
9
6
|
return;
|
|
10
7
|
}
|
|
11
|
-
|
|
12
|
-
this.opacity = data.opacity;
|
|
13
|
-
}
|
|
8
|
+
loadRangeProperty(this, "opacity", data.opacity);
|
|
14
9
|
}
|
|
15
10
|
}
|
package/browser/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ensureInteractivityPluginLoaded } from "@tsparticles/plugin-interactivity";
|
|
2
2
|
import { Connector } from "./Connector.js";
|
|
3
3
|
export async function loadExternalConnectInteraction(engine) {
|
|
4
|
-
engine.checkVersion("4.
|
|
4
|
+
engine.checkVersion("4.2.0");
|
|
5
5
|
await engine.pluginManager.register((e) => {
|
|
6
6
|
ensureInteractivityPluginLoaded(e);
|
|
7
7
|
e.pluginManager.addInteractor?.("externalConnect", container => {
|
package/browser/index.lazy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadExternalConnectInteraction(engine) {
|
|
2
|
-
engine.checkVersion("4.
|
|
2
|
+
engine.checkVersion("4.2.0");
|
|
3
3
|
await engine.pluginManager.register(async (e) => {
|
|
4
4
|
const { ensureInteractivityPluginLoaded } = await import("@tsparticles/plugin-interactivity/lazy");
|
|
5
5
|
ensureInteractivityPluginLoaded(e);
|
package/cjs/Connector.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ExternalInteractorBase, } from "@tsparticles/plugin-interactivity";
|
|
2
|
-
import { isInArray } from "@tsparticles/engine";
|
|
2
|
+
import { isInArray, loadOptionProperty } from "@tsparticles/engine";
|
|
3
3
|
import { Connect } from "./Options/Classes/Connect.js";
|
|
4
4
|
import { drawConnection } from "./Utils.js";
|
|
5
5
|
const connectMode = "connect", minDistance = 0;
|
|
@@ -54,10 +54,7 @@ export class Connector extends ExternalInteractorBase {
|
|
|
54
54
|
return isInArray(connectMode, events.onHover.mode);
|
|
55
55
|
}
|
|
56
56
|
loadModeOptions(options, ...sources) {
|
|
57
|
-
options
|
|
58
|
-
for (const source of sources) {
|
|
59
|
-
options.connect.load(source?.connect);
|
|
60
|
-
}
|
|
57
|
+
loadOptionProperty(options, "connect", Connect, ...sources);
|
|
61
58
|
}
|
|
62
59
|
reset() {
|
|
63
60
|
}
|
|
@@ -1,24 +1,15 @@
|
|
|
1
|
-
import { isNull } from "@tsparticles/engine";
|
|
1
|
+
import { isNull, loadProperty } from "@tsparticles/engine";
|
|
2
2
|
import { ConnectLinks } from "./ConnectLinks.js";
|
|
3
3
|
export class Connect {
|
|
4
|
-
distance;
|
|
5
|
-
links;
|
|
6
|
-
radius;
|
|
7
|
-
constructor() {
|
|
8
|
-
this.distance = 80;
|
|
9
|
-
this.links = new ConnectLinks();
|
|
10
|
-
this.radius = 60;
|
|
11
|
-
}
|
|
4
|
+
distance = 80;
|
|
5
|
+
links = new ConnectLinks();
|
|
6
|
+
radius = 60;
|
|
12
7
|
load(data) {
|
|
13
8
|
if (isNull(data)) {
|
|
14
9
|
return;
|
|
15
10
|
}
|
|
16
|
-
|
|
17
|
-
this.distance = data.distance;
|
|
18
|
-
}
|
|
11
|
+
loadProperty(this, "distance", data.distance);
|
|
19
12
|
this.links.load(data.links);
|
|
20
|
-
|
|
21
|
-
this.radius = data.radius;
|
|
22
|
-
}
|
|
13
|
+
loadProperty(this, "radius", data.radius);
|
|
23
14
|
}
|
|
24
15
|
}
|
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
import { isNull } from "@tsparticles/engine";
|
|
1
|
+
import { isNull, loadRangeProperty } from "@tsparticles/engine";
|
|
2
2
|
export class ConnectLinks {
|
|
3
|
-
opacity;
|
|
4
|
-
constructor() {
|
|
5
|
-
this.opacity = 0.5;
|
|
6
|
-
}
|
|
3
|
+
opacity = 0.5;
|
|
7
4
|
load(data) {
|
|
8
5
|
if (isNull(data)) {
|
|
9
6
|
return;
|
|
10
7
|
}
|
|
11
|
-
|
|
12
|
-
this.opacity = data.opacity;
|
|
13
|
-
}
|
|
8
|
+
loadRangeProperty(this, "opacity", data.opacity);
|
|
14
9
|
}
|
|
15
10
|
}
|
package/cjs/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ensureInteractivityPluginLoaded } from "@tsparticles/plugin-interactivity";
|
|
2
2
|
import { Connector } from "./Connector.js";
|
|
3
3
|
export async function loadExternalConnectInteraction(engine) {
|
|
4
|
-
engine.checkVersion("4.
|
|
4
|
+
engine.checkVersion("4.2.0");
|
|
5
5
|
await engine.pluginManager.register((e) => {
|
|
6
6
|
ensureInteractivityPluginLoaded(e);
|
|
7
7
|
e.pluginManager.addInteractor?.("externalConnect", container => {
|
package/cjs/index.lazy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadExternalConnectInteraction(engine) {
|
|
2
|
-
engine.checkVersion("4.
|
|
2
|
+
engine.checkVersion("4.2.0");
|
|
3
3
|
await engine.pluginManager.register(async (e) => {
|
|
4
4
|
const { ensureInteractivityPluginLoaded } = await import("@tsparticles/plugin-interactivity/lazy");
|
|
5
5
|
ensureInteractivityPluginLoaded(e);
|
package/esm/Connector.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ExternalInteractorBase, } from "@tsparticles/plugin-interactivity";
|
|
2
|
-
import { isInArray } from "@tsparticles/engine";
|
|
2
|
+
import { isInArray, loadOptionProperty } from "@tsparticles/engine";
|
|
3
3
|
import { Connect } from "./Options/Classes/Connect.js";
|
|
4
4
|
import { drawConnection } from "./Utils.js";
|
|
5
5
|
const connectMode = "connect", minDistance = 0;
|
|
@@ -54,10 +54,7 @@ export class Connector extends ExternalInteractorBase {
|
|
|
54
54
|
return isInArray(connectMode, events.onHover.mode);
|
|
55
55
|
}
|
|
56
56
|
loadModeOptions(options, ...sources) {
|
|
57
|
-
options
|
|
58
|
-
for (const source of sources) {
|
|
59
|
-
options.connect.load(source?.connect);
|
|
60
|
-
}
|
|
57
|
+
loadOptionProperty(options, "connect", Connect, ...sources);
|
|
61
58
|
}
|
|
62
59
|
reset() {
|
|
63
60
|
}
|
|
@@ -1,24 +1,15 @@
|
|
|
1
|
-
import { isNull } from "@tsparticles/engine";
|
|
1
|
+
import { isNull, loadProperty } from "@tsparticles/engine";
|
|
2
2
|
import { ConnectLinks } from "./ConnectLinks.js";
|
|
3
3
|
export class Connect {
|
|
4
|
-
distance;
|
|
5
|
-
links;
|
|
6
|
-
radius;
|
|
7
|
-
constructor() {
|
|
8
|
-
this.distance = 80;
|
|
9
|
-
this.links = new ConnectLinks();
|
|
10
|
-
this.radius = 60;
|
|
11
|
-
}
|
|
4
|
+
distance = 80;
|
|
5
|
+
links = new ConnectLinks();
|
|
6
|
+
radius = 60;
|
|
12
7
|
load(data) {
|
|
13
8
|
if (isNull(data)) {
|
|
14
9
|
return;
|
|
15
10
|
}
|
|
16
|
-
|
|
17
|
-
this.distance = data.distance;
|
|
18
|
-
}
|
|
11
|
+
loadProperty(this, "distance", data.distance);
|
|
19
12
|
this.links.load(data.links);
|
|
20
|
-
|
|
21
|
-
this.radius = data.radius;
|
|
22
|
-
}
|
|
13
|
+
loadProperty(this, "radius", data.radius);
|
|
23
14
|
}
|
|
24
15
|
}
|
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
import { isNull } from "@tsparticles/engine";
|
|
1
|
+
import { isNull, loadRangeProperty } from "@tsparticles/engine";
|
|
2
2
|
export class ConnectLinks {
|
|
3
|
-
opacity;
|
|
4
|
-
constructor() {
|
|
5
|
-
this.opacity = 0.5;
|
|
6
|
-
}
|
|
3
|
+
opacity = 0.5;
|
|
7
4
|
load(data) {
|
|
8
5
|
if (isNull(data)) {
|
|
9
6
|
return;
|
|
10
7
|
}
|
|
11
|
-
|
|
12
|
-
this.opacity = data.opacity;
|
|
13
|
-
}
|
|
8
|
+
loadRangeProperty(this, "opacity", data.opacity);
|
|
14
9
|
}
|
|
15
10
|
}
|
package/esm/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ensureInteractivityPluginLoaded } from "@tsparticles/plugin-interactivity";
|
|
2
2
|
import { Connector } from "./Connector.js";
|
|
3
3
|
export async function loadExternalConnectInteraction(engine) {
|
|
4
|
-
engine.checkVersion("4.
|
|
4
|
+
engine.checkVersion("4.2.0");
|
|
5
5
|
await engine.pluginManager.register((e) => {
|
|
6
6
|
ensureInteractivityPluginLoaded(e);
|
|
7
7
|
e.pluginManager.addInteractor?.("externalConnect", container => {
|
package/esm/index.lazy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadExternalConnectInteraction(engine) {
|
|
2
|
-
engine.checkVersion("4.
|
|
2
|
+
engine.checkVersion("4.2.0");
|
|
3
3
|
await engine.pluginManager.register(async (e) => {
|
|
4
4
|
const { ensureInteractivityPluginLoaded } = await import("@tsparticles/plugin-interactivity/lazy");
|
|
5
5
|
ensureInteractivityPluginLoaded(e);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/interaction-external-connect",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "tsParticles connect external 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.
|
|
101
|
-
"@tsparticles/plugin-interactivity": "4.
|
|
100
|
+
"@tsparticles/engine": "4.2.0",
|
|
101
|
+
"@tsparticles/plugin-interactivity": "4.2.0"
|
|
102
102
|
},
|
|
103
103
|
"dependencies": {
|
|
104
|
-
"@tsparticles/canvas-utils": "4.
|
|
104
|
+
"@tsparticles/canvas-utils": "4.2.0"
|
|
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.external.connect.js","children":[{"name":"dist/browser","children":[{"name":"Options/Classes","children":[{"uid":"
|
|
4933
|
+
const data = {"version":2,"tree":{"name":"root","children":[{"name":"tsparticles.interaction.external.connect.js","children":[{"name":"dist/browser","children":[{"name":"Options/Classes","children":[{"uid":"fe130070-1","name":"ConnectLinks.js"},{"uid":"fe130070-3","name":"Connect.js"}]},{"uid":"fe130070-5","name":"Utils.js"},{"uid":"fe130070-7","name":"Connector.js"},{"uid":"fe130070-9","name":"index.js"},{"uid":"fe130070-11","name":"browser.js"}]}]}],"isRoot":true},"nodeParts":{"fe130070-1":{"renderedLength":230,"gzipLength":0,"brotliLength":0,"metaUid":"fe130070-0"},"fe130070-3":{"renderedLength":382,"gzipLength":0,"brotliLength":0,"metaUid":"fe130070-2"},"fe130070-5":{"renderedLength":1821,"gzipLength":0,"brotliLength":0,"metaUid":"fe130070-4"},"fe130070-7":{"renderedLength":2751,"gzipLength":0,"brotliLength":0,"metaUid":"fe130070-6"},"fe130070-9":{"renderedLength":396,"gzipLength":0,"brotliLength":0,"metaUid":"fe130070-8"},"fe130070-11":{"renderedLength":203,"gzipLength":0,"brotliLength":0,"metaUid":"fe130070-10"}},"nodeMetas":{"fe130070-0":{"id":"/dist/browser/Options/Classes/ConnectLinks.js","moduleParts":{"tsparticles.interaction.external.connect.js":"fe130070-1"},"imported":[{"uid":"fe130070-13"}],"importedBy":[{"uid":"fe130070-8"},{"uid":"fe130070-2"}]},"fe130070-2":{"id":"/dist/browser/Options/Classes/Connect.js","moduleParts":{"tsparticles.interaction.external.connect.js":"fe130070-3"},"imported":[{"uid":"fe130070-13"},{"uid":"fe130070-0"}],"importedBy":[{"uid":"fe130070-8"},{"uid":"fe130070-6"}]},"fe130070-4":{"id":"/dist/browser/Utils.js","moduleParts":{"tsparticles.interaction.external.connect.js":"fe130070-5"},"imported":[{"uid":"fe130070-13"},{"uid":"fe130070-14"}],"importedBy":[{"uid":"fe130070-6"}]},"fe130070-6":{"id":"/dist/browser/Connector.js","moduleParts":{"tsparticles.interaction.external.connect.js":"fe130070-7"},"imported":[{"uid":"fe130070-12"},{"uid":"fe130070-13"},{"uid":"fe130070-2"},{"uid":"fe130070-4"}],"importedBy":[{"uid":"fe130070-8"}]},"fe130070-8":{"id":"/dist/browser/index.js","moduleParts":{"tsparticles.interaction.external.connect.js":"fe130070-9"},"imported":[{"uid":"fe130070-12"},{"uid":"fe130070-6"},{"uid":"fe130070-2"},{"uid":"fe130070-0"}],"importedBy":[{"uid":"fe130070-10"}]},"fe130070-10":{"id":"/dist/browser/browser.js","moduleParts":{"tsparticles.interaction.external.connect.js":"fe130070-11"},"imported":[{"uid":"fe130070-8"}],"importedBy":[],"isEntry":true},"fe130070-12":{"id":"@tsparticles/plugin-interactivity","moduleParts":{},"imported":[],"importedBy":[{"uid":"fe130070-8"},{"uid":"fe130070-6"}],"isExternal":true},"fe130070-13":{"id":"@tsparticles/engine","moduleParts":{},"imported":[],"importedBy":[{"uid":"fe130070-6"},{"uid":"fe130070-2"},{"uid":"fe130070-0"},{"uid":"fe130070-4"}],"isExternal":true},"fe130070-14":{"id":"@tsparticles/canvas-utils","moduleParts":{},"imported":[],"importedBy":[{"uid":"fe130070-4"}],"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
|
-
/* External Interaction v4.
|
|
2
|
+
/* External Interaction v4.2.0 */
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tsparticles/plugin-interactivity'), require('@tsparticles/engine'), require('@tsparticles/canvas-utils')) :
|
|
5
5
|
typeof define === 'function' && define.amd ? define(['exports', '@tsparticles/plugin-interactivity', '@tsparticles/engine', '@tsparticles/canvas-utils'], factory) :
|
|
@@ -7,40 +7,26 @@
|
|
|
7
7
|
})(this, (function (exports, pluginInteractivity, engine, canvasUtils) { 'use strict';
|
|
8
8
|
|
|
9
9
|
class ConnectLinks {
|
|
10
|
-
opacity;
|
|
11
|
-
constructor() {
|
|
12
|
-
this.opacity = 0.5;
|
|
13
|
-
}
|
|
10
|
+
opacity = 0.5;
|
|
14
11
|
load(data) {
|
|
15
12
|
if (engine.isNull(data)) {
|
|
16
13
|
return;
|
|
17
14
|
}
|
|
18
|
-
|
|
19
|
-
this.opacity = data.opacity;
|
|
20
|
-
}
|
|
15
|
+
engine.loadRangeProperty(this, "opacity", data.opacity);
|
|
21
16
|
}
|
|
22
17
|
}
|
|
23
18
|
|
|
24
19
|
class Connect {
|
|
25
|
-
distance;
|
|
26
|
-
links;
|
|
27
|
-
radius;
|
|
28
|
-
constructor() {
|
|
29
|
-
this.distance = 80;
|
|
30
|
-
this.links = new ConnectLinks();
|
|
31
|
-
this.radius = 60;
|
|
32
|
-
}
|
|
20
|
+
distance = 80;
|
|
21
|
+
links = new ConnectLinks();
|
|
22
|
+
radius = 60;
|
|
33
23
|
load(data) {
|
|
34
24
|
if (engine.isNull(data)) {
|
|
35
25
|
return;
|
|
36
26
|
}
|
|
37
|
-
|
|
38
|
-
this.distance = data.distance;
|
|
39
|
-
}
|
|
27
|
+
engine.loadProperty(this, "distance", data.distance);
|
|
40
28
|
this.links.load(data.links);
|
|
41
|
-
|
|
42
|
-
this.radius = data.radius;
|
|
43
|
-
}
|
|
29
|
+
engine.loadProperty(this, "radius", data.radius);
|
|
44
30
|
}
|
|
45
31
|
}
|
|
46
32
|
|
|
@@ -132,17 +118,14 @@
|
|
|
132
118
|
return engine.isInArray(connectMode, events.onHover.mode);
|
|
133
119
|
}
|
|
134
120
|
loadModeOptions(options, ...sources) {
|
|
135
|
-
options
|
|
136
|
-
for (const source of sources) {
|
|
137
|
-
options.connect.load(source?.connect);
|
|
138
|
-
}
|
|
121
|
+
engine.loadOptionProperty(options, "connect", Connect, ...sources);
|
|
139
122
|
}
|
|
140
123
|
reset() {
|
|
141
124
|
}
|
|
142
125
|
}
|
|
143
126
|
|
|
144
127
|
async function loadExternalConnectInteraction(engine) {
|
|
145
|
-
engine.checkVersion("4.
|
|
128
|
+
engine.checkVersion("4.2.0");
|
|
146
129
|
await engine.pluginManager.register((e) => {
|
|
147
130
|
pluginInteractivity.ensureInteractivityPluginLoaded(e);
|
|
148
131
|
e.pluginManager.addInteractor?.("externalConnect", container => {
|
|
@@ -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"),require("@tsparticles/canvas-utils")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/plugin-interactivity","@tsparticles/engine","@tsparticles/canvas-utils"],s):s(((t="undefined"!=typeof globalThis?globalThis:t||self).__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.interactions.externalConnect=t.__tsParticlesInternals.interactions.externalConnect||{}),t.__tsParticlesInternals.plugins.interactivity,t.__tsParticlesInternals.engine,t.__tsParticlesInternals.canvas.utils)}(this,function(t,s,e,n){"use strict";class a{opacity
|
|
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"),require("@tsparticles/canvas-utils")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/plugin-interactivity","@tsparticles/engine","@tsparticles/canvas-utils"],s):s(((t="undefined"!=typeof globalThis?globalThis:t||self).__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.interactions.externalConnect=t.__tsParticlesInternals.interactions.externalConnect||{}),t.__tsParticlesInternals.plugins.interactivity,t.__tsParticlesInternals.engine,t.__tsParticlesInternals.canvas.utils)}(this,function(t,s,e,n){"use strict";class a{opacity=.5;load(t){e.isNull(t)||e.loadRangeProperty(this,"opacity",t.opacity)}}class i{distance=80;links=new a;radius=60;load(t){e.isNull(t)||(e.loadProperty(this,"distance",t.distance),this.links.load(t.links),e.loadProperty(this,"radius",t.radius))}}function r(t,s,n,a){const i=t.actualOptions,r=i.interactivity?.modes.connect;if(r)return function(t,s,n,a,i){const r=Math.floor(a.getRadius()/n.getRadius()),l=n.getFillColor(),c=a.getFillColor();if(!l||!c)return;const o=n.getPosition(),_=a.getPosition(),p=e.colorMix(l,c,n.getRadius(),a.getRadius()),P=s.createLinearGradient(o.x,o.y,_.x,_.y);return P.addColorStop(0,e.getStyleFromHsl(l,t.hdr,i)),P.addColorStop(e.clamp(r,0,1),e.getStyleFromRgb(p,t.hdr,i)),P.addColorStop(1,e.getStyleFromHsl(c,t.hdr,i)),P}(t,s,n,a,r.links.opacity)}function l(t,s,e){t.canvas.render.draw(a=>{const i=r(t,a,s,e);if(!i)return;const l=s.getPosition(),c=e.getPosition();!function(t,s,e,a,i){n.drawLine(t,a,i),t.lineWidth=s,t.strokeStyle=e,t.stroke()}(a,s.retina.linksWidth??0,i,l,c)})}class c extends s.ExternalInteractorBase{#t;constructor(t){super(t),this.#t=0}get maxDistance(){return this.#t}clear(){}init(){const t=this.container,s=t.actualOptions.interactivity?.modes.connect;s&&(this.#t=s.distance,t.retina.connectModeDistance=s.distance*t.retina.pixelRatio,t.retina.connectModeRadius=s.radius*t.retina.pixelRatio)}interact(t){const s=this.container,e=s.actualOptions;if(e.interactivity?.events.onHover.enable&&"pointermove"===t.status){const e=t.mouse.position,{connectModeDistance:n,connectModeRadius:a}=s.retina;if(!n||n<0||!a||a<0||!e)return;const i=Math.abs(a),r=s.particles.grid.queryCircle(e,i,s=>this.isEnabled(t,s));r.forEach((t,e)=>{const a=t.getPosition();for(const i of r.slice(e+1)){const e=i.getPosition(),r=Math.abs(n),c=Math.abs(a.x-e.x),o=Math.abs(a.y-e.y);c<r&&o<r&&l(s,t,i)}})}}isEnabled(t,s){const n=this.container,a=t.mouse,i=(s?.interactivity??n.actualOptions.interactivity)?.events;return!(!i?.onHover.enable||!a.position)&&e.isInArray("connect",i.onHover.mode)}loadModeOptions(t,...s){e.loadOptionProperty(t,"connect",i,...s)}reset(){}}async function o(t){t.checkVersion("4.2.0"),await t.pluginManager.register(t=>{s.ensureInteractivityPluginLoaded(t),t.pluginManager.addInteractor?.("externalConnect",t=>Promise.resolve(new c(t)))})}const _=globalThis;_.__tsParticlesInternals=_.__tsParticlesInternals??{},_.loadExternalConnectInteraction=o,t.Connect=i,t.ConnectLinks=a,t.loadExternalConnectInteraction=o}),Object.assign(globalThis.window||globalThis,{loadExternalConnectInteraction:(globalThis.__tsParticlesInternals.interactions.externalConnect||{}).loadExternalConnectInteraction}),delete(globalThis.window||globalThis).tsparticlesInternalExports;
|
|
@@ -3,8 +3,7 @@ import { ConnectLinks } from "./ConnectLinks.js";
|
|
|
3
3
|
import type { IConnect } from "../Interfaces/IConnect.js";
|
|
4
4
|
export declare class Connect implements IConnect, IOptionLoader<IConnect> {
|
|
5
5
|
distance: number;
|
|
6
|
-
links: ConnectLinks;
|
|
6
|
+
readonly links: ConnectLinks;
|
|
7
7
|
radius: number;
|
|
8
|
-
constructor();
|
|
9
8
|
load(data?: RecursivePartial<IConnect>): void;
|
|
10
9
|
}
|
|
@@ -2,6 +2,5 @@ import { type IOptionLoader, type RecursivePartial } from "@tsparticles/engine";
|
|
|
2
2
|
import type { IConnectLinks } from "../Interfaces/IConnectLinks.js";
|
|
3
3
|
export declare class ConnectLinks implements IConnectLinks, IOptionLoader<IConnectLinks> {
|
|
4
4
|
opacity: number;
|
|
5
|
-
constructor();
|
|
6
5
|
load(data?: RecursivePartial<IConnectLinks>): void;
|
|
7
6
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Connect } from "./Connect.js";
|
|
2
2
|
import type { InteractivityOptions } from "@tsparticles/plugin-interactivity";
|
|
3
3
|
export type ConnectOptions = InteractivityOptions & {
|
|
4
4
|
interactivity?: {
|
|
5
|
-
modes:
|
|
5
|
+
modes: {
|
|
6
|
+
connect?: Connect;
|
|
7
|
+
};
|
|
6
8
|
};
|
|
7
9
|
};
|