@tsparticles/interaction-external-grab 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/Grabber.js +2 -5
- package/browser/Options/Classes/Grab.js +4 -10
- package/browser/Options/Classes/GrabLinks.js +7 -18
- package/browser/index.js +1 -1
- package/browser/index.lazy.js +1 -1
- package/cjs/Grabber.js +2 -5
- package/cjs/Options/Classes/Grab.js +4 -10
- package/cjs/Options/Classes/GrabLinks.js +7 -18
- package/cjs/index.js +1 -1
- package/cjs/index.lazy.js +1 -1
- package/esm/Grabber.js +2 -5
- package/esm/Options/Classes/Grab.js +4 -10
- package/esm/Options/Classes/GrabLinks.js +7 -18
- 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.grab.js +12 -32
- package/tsparticles.interaction.external.grab.min.js +1 -1
- package/types/Options/Classes/Grab.d.ts +1 -2
- package/types/Options/Classes/GrabLinks.d.ts +0 -1
- package/types/Options/Classes/GrabOptions.d.ts +4 -2
package/browser/Grabber.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ExternalInteractorBase, mouseMoveEvent, } from "@tsparticles/plugin-interactivity";
|
|
2
|
-
import { getDistance, getLinkColor, getLinkRandomColor, isInArray, } from "@tsparticles/engine";
|
|
2
|
+
import { getDistance, getLinkColor, getLinkRandomColor, isInArray, loadOptionProperty, } from "@tsparticles/engine";
|
|
3
3
|
import { Grab } from "./Options/Classes/Grab.js";
|
|
4
4
|
import { drawGrab } from "./Utils.js";
|
|
5
5
|
const grabMode = "grab", minDistance = 0, minOpacity = 0;
|
|
@@ -66,10 +66,7 @@ export class Grabber extends ExternalInteractorBase {
|
|
|
66
66
|
return !!events?.onHover.enable && !!mouse.position && isInArray(grabMode, events.onHover.mode);
|
|
67
67
|
}
|
|
68
68
|
loadModeOptions(options, ...sources) {
|
|
69
|
-
options
|
|
70
|
-
for (const source of sources) {
|
|
71
|
-
options.grab.load(source?.grab);
|
|
72
|
-
}
|
|
69
|
+
loadOptionProperty(options, "grab", Grab, ...sources);
|
|
73
70
|
}
|
|
74
71
|
reset() {
|
|
75
72
|
}
|
|
@@ -1,19 +1,13 @@
|
|
|
1
|
-
import { isNull } from "@tsparticles/engine";
|
|
1
|
+
import { isNull, loadProperty } from "@tsparticles/engine";
|
|
2
2
|
import { GrabLinks } from "./GrabLinks.js";
|
|
3
3
|
export class Grab {
|
|
4
|
-
distance;
|
|
5
|
-
links;
|
|
6
|
-
constructor() {
|
|
7
|
-
this.distance = 100;
|
|
8
|
-
this.links = new GrabLinks();
|
|
9
|
-
}
|
|
4
|
+
distance = 100;
|
|
5
|
+
links = new GrabLinks();
|
|
10
6
|
load(data) {
|
|
11
7
|
if (isNull(data)) {
|
|
12
8
|
return;
|
|
13
9
|
}
|
|
14
|
-
|
|
15
|
-
this.distance = data.distance;
|
|
16
|
-
}
|
|
10
|
+
loadProperty(this, "distance", data.distance);
|
|
17
11
|
this.links.load(data.links);
|
|
18
12
|
}
|
|
19
13
|
}
|
|
@@ -1,29 +1,18 @@
|
|
|
1
|
-
import { OptionsColor, isNull } from "@tsparticles/engine";
|
|
1
|
+
import { OptionsColor, isNull, loadProperty, loadRangeProperty, } from "@tsparticles/engine";
|
|
2
2
|
export class GrabLinks {
|
|
3
|
-
blink;
|
|
3
|
+
blink = false;
|
|
4
4
|
color;
|
|
5
|
-
consent;
|
|
6
|
-
opacity;
|
|
7
|
-
constructor() {
|
|
8
|
-
this.blink = false;
|
|
9
|
-
this.consent = false;
|
|
10
|
-
this.opacity = 1;
|
|
11
|
-
}
|
|
5
|
+
consent = false;
|
|
6
|
+
opacity = 1;
|
|
12
7
|
load(data) {
|
|
13
8
|
if (isNull(data)) {
|
|
14
9
|
return;
|
|
15
10
|
}
|
|
16
|
-
|
|
17
|
-
this.blink = data.blink;
|
|
18
|
-
}
|
|
11
|
+
loadProperty(this, "blink", data.blink);
|
|
19
12
|
if (data.color !== undefined) {
|
|
20
13
|
this.color = OptionsColor.create(this.color, data.color);
|
|
21
14
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
if (data.opacity !== undefined) {
|
|
26
|
-
this.opacity = data.opacity;
|
|
27
|
-
}
|
|
15
|
+
loadProperty(this, "consent", data.consent);
|
|
16
|
+
loadRangeProperty(this, "opacity", data.opacity);
|
|
28
17
|
}
|
|
29
18
|
}
|
package/browser/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ensureInteractivityPluginLoaded } from "@tsparticles/plugin-interactivity";
|
|
2
2
|
import { Grabber } from "./Grabber.js";
|
|
3
3
|
export async function loadExternalGrabInteraction(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?.("externalGrab", container => {
|
package/browser/index.lazy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadExternalGrabInteraction(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/Grabber.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ExternalInteractorBase, mouseMoveEvent, } from "@tsparticles/plugin-interactivity";
|
|
2
|
-
import { getDistance, getLinkColor, getLinkRandomColor, isInArray, } from "@tsparticles/engine";
|
|
2
|
+
import { getDistance, getLinkColor, getLinkRandomColor, isInArray, loadOptionProperty, } from "@tsparticles/engine";
|
|
3
3
|
import { Grab } from "./Options/Classes/Grab.js";
|
|
4
4
|
import { drawGrab } from "./Utils.js";
|
|
5
5
|
const grabMode = "grab", minDistance = 0, minOpacity = 0;
|
|
@@ -66,10 +66,7 @@ export class Grabber extends ExternalInteractorBase {
|
|
|
66
66
|
return !!events?.onHover.enable && !!mouse.position && isInArray(grabMode, events.onHover.mode);
|
|
67
67
|
}
|
|
68
68
|
loadModeOptions(options, ...sources) {
|
|
69
|
-
options
|
|
70
|
-
for (const source of sources) {
|
|
71
|
-
options.grab.load(source?.grab);
|
|
72
|
-
}
|
|
69
|
+
loadOptionProperty(options, "grab", Grab, ...sources);
|
|
73
70
|
}
|
|
74
71
|
reset() {
|
|
75
72
|
}
|
|
@@ -1,19 +1,13 @@
|
|
|
1
|
-
import { isNull } from "@tsparticles/engine";
|
|
1
|
+
import { isNull, loadProperty } from "@tsparticles/engine";
|
|
2
2
|
import { GrabLinks } from "./GrabLinks.js";
|
|
3
3
|
export class Grab {
|
|
4
|
-
distance;
|
|
5
|
-
links;
|
|
6
|
-
constructor() {
|
|
7
|
-
this.distance = 100;
|
|
8
|
-
this.links = new GrabLinks();
|
|
9
|
-
}
|
|
4
|
+
distance = 100;
|
|
5
|
+
links = new GrabLinks();
|
|
10
6
|
load(data) {
|
|
11
7
|
if (isNull(data)) {
|
|
12
8
|
return;
|
|
13
9
|
}
|
|
14
|
-
|
|
15
|
-
this.distance = data.distance;
|
|
16
|
-
}
|
|
10
|
+
loadProperty(this, "distance", data.distance);
|
|
17
11
|
this.links.load(data.links);
|
|
18
12
|
}
|
|
19
13
|
}
|
|
@@ -1,29 +1,18 @@
|
|
|
1
|
-
import { OptionsColor, isNull } from "@tsparticles/engine";
|
|
1
|
+
import { OptionsColor, isNull, loadProperty, loadRangeProperty, } from "@tsparticles/engine";
|
|
2
2
|
export class GrabLinks {
|
|
3
|
-
blink;
|
|
3
|
+
blink = false;
|
|
4
4
|
color;
|
|
5
|
-
consent;
|
|
6
|
-
opacity;
|
|
7
|
-
constructor() {
|
|
8
|
-
this.blink = false;
|
|
9
|
-
this.consent = false;
|
|
10
|
-
this.opacity = 1;
|
|
11
|
-
}
|
|
5
|
+
consent = false;
|
|
6
|
+
opacity = 1;
|
|
12
7
|
load(data) {
|
|
13
8
|
if (isNull(data)) {
|
|
14
9
|
return;
|
|
15
10
|
}
|
|
16
|
-
|
|
17
|
-
this.blink = data.blink;
|
|
18
|
-
}
|
|
11
|
+
loadProperty(this, "blink", data.blink);
|
|
19
12
|
if (data.color !== undefined) {
|
|
20
13
|
this.color = OptionsColor.create(this.color, data.color);
|
|
21
14
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
if (data.opacity !== undefined) {
|
|
26
|
-
this.opacity = data.opacity;
|
|
27
|
-
}
|
|
15
|
+
loadProperty(this, "consent", data.consent);
|
|
16
|
+
loadRangeProperty(this, "opacity", data.opacity);
|
|
28
17
|
}
|
|
29
18
|
}
|
package/cjs/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ensureInteractivityPluginLoaded } from "@tsparticles/plugin-interactivity";
|
|
2
2
|
import { Grabber } from "./Grabber.js";
|
|
3
3
|
export async function loadExternalGrabInteraction(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?.("externalGrab", container => {
|
package/cjs/index.lazy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadExternalGrabInteraction(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/Grabber.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ExternalInteractorBase, mouseMoveEvent, } from "@tsparticles/plugin-interactivity";
|
|
2
|
-
import { getDistance, getLinkColor, getLinkRandomColor, isInArray, } from "@tsparticles/engine";
|
|
2
|
+
import { getDistance, getLinkColor, getLinkRandomColor, isInArray, loadOptionProperty, } from "@tsparticles/engine";
|
|
3
3
|
import { Grab } from "./Options/Classes/Grab.js";
|
|
4
4
|
import { drawGrab } from "./Utils.js";
|
|
5
5
|
const grabMode = "grab", minDistance = 0, minOpacity = 0;
|
|
@@ -66,10 +66,7 @@ export class Grabber extends ExternalInteractorBase {
|
|
|
66
66
|
return !!events?.onHover.enable && !!mouse.position && isInArray(grabMode, events.onHover.mode);
|
|
67
67
|
}
|
|
68
68
|
loadModeOptions(options, ...sources) {
|
|
69
|
-
options
|
|
70
|
-
for (const source of sources) {
|
|
71
|
-
options.grab.load(source?.grab);
|
|
72
|
-
}
|
|
69
|
+
loadOptionProperty(options, "grab", Grab, ...sources);
|
|
73
70
|
}
|
|
74
71
|
reset() {
|
|
75
72
|
}
|
|
@@ -1,19 +1,13 @@
|
|
|
1
|
-
import { isNull } from "@tsparticles/engine";
|
|
1
|
+
import { isNull, loadProperty } from "@tsparticles/engine";
|
|
2
2
|
import { GrabLinks } from "./GrabLinks.js";
|
|
3
3
|
export class Grab {
|
|
4
|
-
distance;
|
|
5
|
-
links;
|
|
6
|
-
constructor() {
|
|
7
|
-
this.distance = 100;
|
|
8
|
-
this.links = new GrabLinks();
|
|
9
|
-
}
|
|
4
|
+
distance = 100;
|
|
5
|
+
links = new GrabLinks();
|
|
10
6
|
load(data) {
|
|
11
7
|
if (isNull(data)) {
|
|
12
8
|
return;
|
|
13
9
|
}
|
|
14
|
-
|
|
15
|
-
this.distance = data.distance;
|
|
16
|
-
}
|
|
10
|
+
loadProperty(this, "distance", data.distance);
|
|
17
11
|
this.links.load(data.links);
|
|
18
12
|
}
|
|
19
13
|
}
|
|
@@ -1,29 +1,18 @@
|
|
|
1
|
-
import { OptionsColor, isNull } from "@tsparticles/engine";
|
|
1
|
+
import { OptionsColor, isNull, loadProperty, loadRangeProperty, } from "@tsparticles/engine";
|
|
2
2
|
export class GrabLinks {
|
|
3
|
-
blink;
|
|
3
|
+
blink = false;
|
|
4
4
|
color;
|
|
5
|
-
consent;
|
|
6
|
-
opacity;
|
|
7
|
-
constructor() {
|
|
8
|
-
this.blink = false;
|
|
9
|
-
this.consent = false;
|
|
10
|
-
this.opacity = 1;
|
|
11
|
-
}
|
|
5
|
+
consent = false;
|
|
6
|
+
opacity = 1;
|
|
12
7
|
load(data) {
|
|
13
8
|
if (isNull(data)) {
|
|
14
9
|
return;
|
|
15
10
|
}
|
|
16
|
-
|
|
17
|
-
this.blink = data.blink;
|
|
18
|
-
}
|
|
11
|
+
loadProperty(this, "blink", data.blink);
|
|
19
12
|
if (data.color !== undefined) {
|
|
20
13
|
this.color = OptionsColor.create(this.color, data.color);
|
|
21
14
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
if (data.opacity !== undefined) {
|
|
26
|
-
this.opacity = data.opacity;
|
|
27
|
-
}
|
|
15
|
+
loadProperty(this, "consent", data.consent);
|
|
16
|
+
loadRangeProperty(this, "opacity", data.opacity);
|
|
28
17
|
}
|
|
29
18
|
}
|
package/esm/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ensureInteractivityPluginLoaded } from "@tsparticles/plugin-interactivity";
|
|
2
2
|
import { Grabber } from "./Grabber.js";
|
|
3
3
|
export async function loadExternalGrabInteraction(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?.("externalGrab", container => {
|
package/esm/index.lazy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadExternalGrabInteraction(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-grab",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "tsParticles grab 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.grab.js","children":[{"name":"dist/browser","children":[{"name":"Options/Classes","children":[{"uid":"
|
|
4933
|
+
const data = {"version":2,"tree":{"name":"root","children":[{"name":"tsparticles.interaction.external.grab.js","children":[{"name":"dist/browser","children":[{"name":"Options/Classes","children":[{"uid":"be5038aa-1","name":"GrabLinks.js"},{"uid":"be5038aa-3","name":"Grab.js"}]},{"uid":"be5038aa-5","name":"Utils.js"},{"uid":"be5038aa-7","name":"Grabber.js"},{"uid":"be5038aa-9","name":"index.js"},{"uid":"be5038aa-11","name":"browser.js"}]}]}],"isRoot":true},"nodeParts":{"be5038aa-1":{"renderedLength":551,"gzipLength":0,"brotliLength":0,"metaUid":"be5038aa-0"},"be5038aa-3":{"renderedLength":294,"gzipLength":0,"brotliLength":0,"metaUid":"be5038aa-2"},"be5038aa-5":{"renderedLength":635,"gzipLength":0,"brotliLength":0,"metaUid":"be5038aa-4"},"be5038aa-7":{"renderedLength":3312,"gzipLength":0,"brotliLength":0,"metaUid":"be5038aa-6"},"be5038aa-9":{"renderedLength":405,"gzipLength":0,"brotliLength":0,"metaUid":"be5038aa-8"},"be5038aa-11":{"renderedLength":197,"gzipLength":0,"brotliLength":0,"metaUid":"be5038aa-10"}},"nodeMetas":{"be5038aa-0":{"id":"/dist/browser/Options/Classes/GrabLinks.js","moduleParts":{"tsparticles.interaction.external.grab.js":"be5038aa-1"},"imported":[{"uid":"be5038aa-13"}],"importedBy":[{"uid":"be5038aa-8"},{"uid":"be5038aa-2"}]},"be5038aa-2":{"id":"/dist/browser/Options/Classes/Grab.js","moduleParts":{"tsparticles.interaction.external.grab.js":"be5038aa-3"},"imported":[{"uid":"be5038aa-13"},{"uid":"be5038aa-0"}],"importedBy":[{"uid":"be5038aa-8"},{"uid":"be5038aa-6"}]},"be5038aa-4":{"id":"/dist/browser/Utils.js","moduleParts":{"tsparticles.interaction.external.grab.js":"be5038aa-5"},"imported":[{"uid":"be5038aa-13"},{"uid":"be5038aa-14"}],"importedBy":[{"uid":"be5038aa-6"}]},"be5038aa-6":{"id":"/dist/browser/Grabber.js","moduleParts":{"tsparticles.interaction.external.grab.js":"be5038aa-7"},"imported":[{"uid":"be5038aa-12"},{"uid":"be5038aa-13"},{"uid":"be5038aa-2"},{"uid":"be5038aa-4"}],"importedBy":[{"uid":"be5038aa-8"}]},"be5038aa-8":{"id":"/dist/browser/index.js","moduleParts":{"tsparticles.interaction.external.grab.js":"be5038aa-9"},"imported":[{"uid":"be5038aa-12"},{"uid":"be5038aa-6"},{"uid":"be5038aa-2"},{"uid":"be5038aa-0"}],"importedBy":[{"uid":"be5038aa-10"}]},"be5038aa-10":{"id":"/dist/browser/browser.js","moduleParts":{"tsparticles.interaction.external.grab.js":"be5038aa-11"},"imported":[{"uid":"be5038aa-8"}],"importedBy":[],"isEntry":true},"be5038aa-12":{"id":"@tsparticles/plugin-interactivity","moduleParts":{},"imported":[],"importedBy":[{"uid":"be5038aa-8"},{"uid":"be5038aa-6"}],"isExternal":true},"be5038aa-13":{"id":"@tsparticles/engine","moduleParts":{},"imported":[],"importedBy":[{"uid":"be5038aa-6"},{"uid":"be5038aa-2"},{"uid":"be5038aa-0"},{"uid":"be5038aa-4"}],"isExternal":true},"be5038aa-14":{"id":"@tsparticles/canvas-utils","moduleParts":{},"imported":[],"importedBy":[{"uid":"be5038aa-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,48 +7,31 @@
|
|
|
7
7
|
})(this, (function (exports, pluginInteractivity, engine, canvasUtils) { 'use strict';
|
|
8
8
|
|
|
9
9
|
class GrabLinks {
|
|
10
|
-
blink;
|
|
10
|
+
blink = false;
|
|
11
11
|
color;
|
|
12
|
-
consent;
|
|
13
|
-
opacity;
|
|
14
|
-
constructor() {
|
|
15
|
-
this.blink = false;
|
|
16
|
-
this.consent = false;
|
|
17
|
-
this.opacity = 1;
|
|
18
|
-
}
|
|
12
|
+
consent = false;
|
|
13
|
+
opacity = 1;
|
|
19
14
|
load(data) {
|
|
20
15
|
if (engine.isNull(data)) {
|
|
21
16
|
return;
|
|
22
17
|
}
|
|
23
|
-
|
|
24
|
-
this.blink = data.blink;
|
|
25
|
-
}
|
|
18
|
+
engine.loadProperty(this, "blink", data.blink);
|
|
26
19
|
if (data.color !== undefined) {
|
|
27
20
|
this.color = engine.OptionsColor.create(this.color, data.color);
|
|
28
21
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
if (data.opacity !== undefined) {
|
|
33
|
-
this.opacity = data.opacity;
|
|
34
|
-
}
|
|
22
|
+
engine.loadProperty(this, "consent", data.consent);
|
|
23
|
+
engine.loadRangeProperty(this, "opacity", data.opacity);
|
|
35
24
|
}
|
|
36
25
|
}
|
|
37
26
|
|
|
38
27
|
class Grab {
|
|
39
|
-
distance;
|
|
40
|
-
links;
|
|
41
|
-
constructor() {
|
|
42
|
-
this.distance = 100;
|
|
43
|
-
this.links = new GrabLinks();
|
|
44
|
-
}
|
|
28
|
+
distance = 100;
|
|
29
|
+
links = new GrabLinks();
|
|
45
30
|
load(data) {
|
|
46
31
|
if (engine.isNull(data)) {
|
|
47
32
|
return;
|
|
48
33
|
}
|
|
49
|
-
|
|
50
|
-
this.distance = data.distance;
|
|
51
|
-
}
|
|
34
|
+
engine.loadProperty(this, "distance", data.distance);
|
|
52
35
|
this.links.load(data.links);
|
|
53
36
|
}
|
|
54
37
|
}
|
|
@@ -131,17 +114,14 @@
|
|
|
131
114
|
return !!events?.onHover.enable && !!mouse.position && engine.isInArray(grabMode, events.onHover.mode);
|
|
132
115
|
}
|
|
133
116
|
loadModeOptions(options, ...sources) {
|
|
134
|
-
options
|
|
135
|
-
for (const source of sources) {
|
|
136
|
-
options.grab.load(source?.grab);
|
|
137
|
-
}
|
|
117
|
+
engine.loadOptionProperty(options, "grab", Grab, ...sources);
|
|
138
118
|
}
|
|
139
119
|
reset() {
|
|
140
120
|
}
|
|
141
121
|
}
|
|
142
122
|
|
|
143
123
|
async function loadExternalGrabInteraction(engine) {
|
|
144
|
-
engine.checkVersion("4.
|
|
124
|
+
engine.checkVersion("4.2.0");
|
|
145
125
|
await engine.pluginManager.register((e) => {
|
|
146
126
|
pluginInteractivity.ensureInteractivityPluginLoaded(e);
|
|
147
127
|
e.pluginManager.addInteractor?.("externalGrab", 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.externalGrab=t.__tsParticlesInternals.interactions.externalGrab||{}),t.__tsParticlesInternals.plugins.interactivity,t.__tsParticlesInternals.engine,t.__tsParticlesInternals.canvas.utils)}(this,function(t,s,e,n){"use strict";class a{blink;color;consent
|
|
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.externalGrab=t.__tsParticlesInternals.interactions.externalGrab||{}),t.__tsParticlesInternals.plugins.interactivity,t.__tsParticlesInternals.engine,t.__tsParticlesInternals.canvas.utils)}(this,function(t,s,e,n){"use strict";class a{blink=!1;color;consent=!1;opacity=1;load(t){e.isNull(t)||(e.loadProperty(this,"blink",t.blink),void 0!==t.color&&(this.color=e.OptionsColor.create(this.color,t.color)),e.loadProperty(this,"consent",t.consent),e.loadRangeProperty(this,"opacity",t.opacity))}}class r{distance=100;links=new a;load(t){e.isNull(t)||(e.loadProperty(this,"distance",t.distance),this.links.load(t.links))}}function i(t,s,a,r,i){t.canvas.render.draw(l=>{const c=s.getPosition();!function(t,s,a,r,i,l,c=!1){n.drawLine(t,a,r),t.strokeStyle=e.getStyleFromRgb(i,c,l),t.lineWidth=s,t.stroke()}(l,s.retina.linksWidth??0,c,i,a,r,t.hdr)})}class l extends s.ExternalInteractorBase{#t;#s;constructor(t,s){super(s),this.#s=t,this.#t=0}get maxDistance(){return this.#t}clear(){}init(){const t=this.container,s=t.actualOptions.interactivity?.modes.grab;s&&(this.#t=s.distance,t.retina.grabModeDistance=s.distance*t.retina.pixelRatio)}interact(t){const n=this.container,a=n.actualOptions.interactivity;if(!a?.modes.grab||!a.events.onHover.enable||t.status!==s.mouseMoveEvent)return;const r=t.mouse.position;if(!r)return;const l=n.retina.grabModeDistance;if(!l||l<0)return;const c=n.particles.grid.queryCircle(r,l,s=>this.isEnabled(t,s));for(const t of c){const s=t.getPosition(),c=e.getDistance(s,r);if(c>l)continue;const o=a.modes.grab.links,_=o.opacity,p=_-c*_/l;if(p<=0)continue;const I=o.color??t.options.links?.color;if(!n.particles.grabLineColor&&I){const t=a.modes.grab.links;n.particles.grabLineColor=e.getLinkRandomColor(this.#s,I,t.blink,t.consent)}const P=e.getLinkColor(t,void 0,n.particles.grabLineColor);P&&i(n,t,P,p,r)}}isEnabled(t,s){const n=this.container,a=t.mouse,r=(s?.interactivity??n.actualOptions.interactivity)?.events;return!!r?.onHover.enable&&!!a.position&&e.isInArray("grab",r.onHover.mode)}loadModeOptions(t,...s){e.loadOptionProperty(t,"grab",r,...s)}reset(){}}async function c(t){t.checkVersion("4.2.0"),await t.pluginManager.register(t=>{s.ensureInteractivityPluginLoaded(t),t.pluginManager.addInteractor?.("externalGrab",s=>Promise.resolve(new l(t.pluginManager,s)))})}const o=globalThis;o.__tsParticlesInternals=o.__tsParticlesInternals??{},o.loadExternalGrabInteraction=c,t.Grab=r,t.GrabLinks=a,t.loadExternalGrabInteraction=c}),Object.assign(globalThis.window||globalThis,{loadExternalGrabInteraction:(globalThis.__tsParticlesInternals.interactions.externalGrab||{}).loadExternalGrabInteraction}),delete(globalThis.window||globalThis).tsparticlesInternalExports;
|
|
@@ -3,7 +3,6 @@ import { GrabLinks } from "./GrabLinks.js";
|
|
|
3
3
|
import type { IGrab } from "../Interfaces/IGrab.js";
|
|
4
4
|
export declare class Grab implements IGrab, IOptionLoader<IGrab> {
|
|
5
5
|
distance: number;
|
|
6
|
-
links: GrabLinks;
|
|
7
|
-
constructor();
|
|
6
|
+
readonly links: GrabLinks;
|
|
8
7
|
load(data?: RecursivePartial<IGrab>): void;
|
|
9
8
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Grab } from "./Grab.js";
|
|
2
2
|
import type { InteractivityOptions } from "@tsparticles/plugin-interactivity";
|
|
3
3
|
export type GrabOptions = InteractivityOptions & {
|
|
4
4
|
interactivity?: {
|
|
5
|
-
modes:
|
|
5
|
+
modes: {
|
|
6
|
+
grab?: Grab;
|
|
7
|
+
};
|
|
6
8
|
};
|
|
7
9
|
};
|