@tsparticles/interaction-external-grab 3.0.0-beta.2 → 3.0.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Demo / Generator : https://particles.js.org/
|
|
5
5
|
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
6
|
* How to use? : Check the GitHub README
|
|
7
|
-
* v3.0.0-beta.
|
|
7
|
+
* v3.0.0-beta.4
|
|
8
8
|
*/
|
|
9
9
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
10
10
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
@@ -171,6 +171,7 @@ function drawGrab(container, particle, lineColor, opacity, mousePos) {
|
|
|
171
171
|
|
|
172
172
|
|
|
173
173
|
|
|
174
|
+
const grabMode = "grab";
|
|
174
175
|
class Grabber extends engine_root_window_.ExternalInteractorBase {
|
|
175
176
|
constructor(container) {
|
|
176
177
|
super(container);
|
|
@@ -228,7 +229,7 @@ class Grabber extends engine_root_window_.ExternalInteractorBase {
|
|
|
228
229
|
const container = this.container,
|
|
229
230
|
mouse = container.interactivity.mouse,
|
|
230
231
|
events = (particle?.interactivity ?? container.actualOptions.interactivity).events;
|
|
231
|
-
return events.onHover.enable && !!mouse.position && (0,engine_root_window_.isInArray)(
|
|
232
|
+
return events.onHover.enable && !!mouse.position && (0,engine_root_window_.isInArray)(grabMode, events.onHover.mode);
|
|
232
233
|
}
|
|
233
234
|
loadModeOptions(options, ...sources) {
|
|
234
235
|
if (!options.grab) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! tsParticles Grab External Interaction v3.0.0-beta.
|
|
1
|
+
/*! tsParticles Grab External Interaction v3.0.0-beta.4 by Matteo Bruni */
|
package/umd/Grabber.js
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
const engine_1 = require("@tsparticles/engine");
|
|
14
14
|
const Grab_js_1 = require("./Options/Classes/Grab.js");
|
|
15
15
|
const Utils_js_1 = require("./Utils.js");
|
|
16
|
+
const grabMode = "grab";
|
|
16
17
|
class Grabber extends engine_1.ExternalInteractorBase {
|
|
17
18
|
constructor(container) {
|
|
18
19
|
super(container);
|
|
@@ -65,7 +66,7 @@
|
|
|
65
66
|
}
|
|
66
67
|
isEnabled(particle) {
|
|
67
68
|
const container = this.container, mouse = container.interactivity.mouse, events = (particle?.interactivity ?? container.actualOptions.interactivity).events;
|
|
68
|
-
return events.onHover.enable && !!mouse.position && (0, engine_1.isInArray)(
|
|
69
|
+
return events.onHover.enable && !!mouse.position && (0, engine_1.isInArray)(grabMode, events.onHover.mode);
|
|
69
70
|
}
|
|
70
71
|
loadModeOptions(options, ...sources) {
|
|
71
72
|
if (!options.grab) {
|