@tsparticles/interaction-external-slow 3.0.0-beta.3 → 3.0.0-beta.5
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/Slower.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ExternalInteractorBase, getDistance, isInArray, } from "@tsparticles/engine";
|
|
2
2
|
import { Slow } from "./Options/Classes/Slow.js";
|
|
3
|
+
const slowMode = "slow";
|
|
3
4
|
export class Slower extends ExternalInteractorBase {
|
|
4
5
|
constructor(container) {
|
|
5
6
|
super(container);
|
|
@@ -21,7 +22,7 @@ export class Slower extends ExternalInteractorBase {
|
|
|
21
22
|
}
|
|
22
23
|
isEnabled(particle) {
|
|
23
24
|
const container = this.container, mouse = container.interactivity.mouse, events = (particle?.interactivity ?? container.actualOptions.interactivity).events;
|
|
24
|
-
return events.onHover.enable && !!mouse.position && isInArray(
|
|
25
|
+
return events.onHover.enable && !!mouse.position && isInArray(slowMode, events.onHover.mode);
|
|
25
26
|
}
|
|
26
27
|
loadModeOptions(options, ...sources) {
|
|
27
28
|
if (!options.slow) {
|
package/cjs/Slower.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Slower = void 0;
|
|
4
4
|
const engine_1 = require("@tsparticles/engine");
|
|
5
5
|
const Slow_js_1 = require("./Options/Classes/Slow.js");
|
|
6
|
+
const slowMode = "slow";
|
|
6
7
|
class Slower extends engine_1.ExternalInteractorBase {
|
|
7
8
|
constructor(container) {
|
|
8
9
|
super(container);
|
|
@@ -24,7 +25,7 @@ class Slower extends engine_1.ExternalInteractorBase {
|
|
|
24
25
|
}
|
|
25
26
|
isEnabled(particle) {
|
|
26
27
|
const container = this.container, mouse = container.interactivity.mouse, events = (particle?.interactivity ?? container.actualOptions.interactivity).events;
|
|
27
|
-
return events.onHover.enable && !!mouse.position && (0, engine_1.isInArray)(
|
|
28
|
+
return events.onHover.enable && !!mouse.position && (0, engine_1.isInArray)(slowMode, events.onHover.mode);
|
|
28
29
|
}
|
|
29
30
|
loadModeOptions(options, ...sources) {
|
|
30
31
|
if (!options.slow) {
|
package/esm/Slower.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ExternalInteractorBase, getDistance, isInArray, } from "@tsparticles/engine";
|
|
2
2
|
import { Slow } from "./Options/Classes/Slow.js";
|
|
3
|
+
const slowMode = "slow";
|
|
3
4
|
export class Slower extends ExternalInteractorBase {
|
|
4
5
|
constructor(container) {
|
|
5
6
|
super(container);
|
|
@@ -21,7 +22,7 @@ export class Slower extends ExternalInteractorBase {
|
|
|
21
22
|
}
|
|
22
23
|
isEnabled(particle) {
|
|
23
24
|
const container = this.container, mouse = container.interactivity.mouse, events = (particle?.interactivity ?? container.actualOptions.interactivity).events;
|
|
24
|
-
return events.onHover.enable && !!mouse.position && isInArray(
|
|
25
|
+
return events.onHover.enable && !!mouse.position && isInArray(slowMode, events.onHover.mode);
|
|
25
26
|
}
|
|
26
27
|
loadModeOptions(options, ...sources) {
|
|
27
28
|
if (!options.slow) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/interaction-external-slow",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.5",
|
|
4
4
|
"description": "tsParticles slow external interaction",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"confettijs",
|
|
61
61
|
"fireworksjs",
|
|
62
62
|
"canvas-confetti",
|
|
63
|
-
"
|
|
63
|
+
"tsparticles-plugin",
|
|
64
64
|
"@tsparticles/interaction"
|
|
65
65
|
],
|
|
66
66
|
"author": "Matteo Bruni <matteo.bruni@me.com>",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"./package.json": "./package.json"
|
|
88
88
|
},
|
|
89
89
|
"dependencies": {
|
|
90
|
-
"@tsparticles/engine": "^3.0.0-beta.
|
|
90
|
+
"@tsparticles/engine": "^3.0.0-beta.5"
|
|
91
91
|
},
|
|
92
92
|
"publishConfig": {
|
|
93
93
|
"access": "public"
|