@tsparticles/interaction-external-bounce 3.0.0-beta.3 → 3.0.0-beta.4
Sign up to get free protection for your applications and to get access to all the features.
- package/browser/Bouncer.js +5 -4
- package/cjs/Bouncer.js +5 -4
- package/esm/Bouncer.js +5 -4
- package/package.json +3 -3
- package/report.html +4 -22
- package/tsparticles.interaction.external.bounce.js +5 -4
- package/tsparticles.interaction.external.bounce.min.js +1 -1
- package/tsparticles.interaction.external.bounce.min.js.LICENSE.txt +1 -1
- package/umd/Bouncer.js +5 -4
package/browser/Bouncer.js
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
import { Circle, ExternalInteractorBase, Rectangle, Vector, calculateBounds, circleBounce, circleBounceDataFromParticle, divModeExecute, isDivModeEnabled, isInArray, mouseMoveEvent, rectBounce, } from "@tsparticles/engine";
|
2
2
|
import { Bounce } from "./Options/Classes/Bounce.js";
|
3
|
+
const bounceMode = "bounce";
|
3
4
|
export class Bouncer extends ExternalInteractorBase {
|
4
5
|
constructor(container) {
|
5
6
|
super(container);
|
@@ -54,17 +55,17 @@ export class Bouncer extends ExternalInteractorBase {
|
|
54
55
|
}
|
55
56
|
async interact() {
|
56
57
|
const container = this.container, options = container.actualOptions, events = options.interactivity.events, mouseMoveStatus = container.interactivity.status === mouseMoveEvent, hoverEnabled = events.onHover.enable, hoverMode = events.onHover.mode, divs = events.onDiv;
|
57
|
-
if (mouseMoveStatus && hoverEnabled && isInArray(
|
58
|
+
if (mouseMoveStatus && hoverEnabled && isInArray(bounceMode, hoverMode)) {
|
58
59
|
this._processMouseBounce();
|
59
60
|
}
|
60
61
|
else {
|
61
|
-
divModeExecute(
|
62
|
+
divModeExecute(bounceMode, divs, (selector, div) => this._singleSelectorBounce(selector, div));
|
62
63
|
}
|
63
64
|
}
|
64
65
|
isEnabled(particle) {
|
65
66
|
const container = this.container, options = container.actualOptions, mouse = container.interactivity.mouse, events = (particle?.interactivity ?? options.interactivity).events, divs = events.onDiv;
|
66
|
-
return ((mouse.position && events.onHover.enable && isInArray(
|
67
|
-
isDivModeEnabled(
|
67
|
+
return ((mouse.position && events.onHover.enable && isInArray(bounceMode, events.onHover.mode)) ||
|
68
|
+
isDivModeEnabled(bounceMode, divs));
|
68
69
|
}
|
69
70
|
loadModeOptions(options, ...sources) {
|
70
71
|
if (!options.bounce) {
|
package/cjs/Bouncer.js
CHANGED
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Bouncer = void 0;
|
4
4
|
const engine_1 = require("@tsparticles/engine");
|
5
5
|
const Bounce_js_1 = require("./Options/Classes/Bounce.js");
|
6
|
+
const bounceMode = "bounce";
|
6
7
|
class Bouncer extends engine_1.ExternalInteractorBase {
|
7
8
|
constructor(container) {
|
8
9
|
super(container);
|
@@ -57,17 +58,17 @@ class Bouncer extends engine_1.ExternalInteractorBase {
|
|
57
58
|
}
|
58
59
|
async interact() {
|
59
60
|
const container = this.container, options = container.actualOptions, events = options.interactivity.events, mouseMoveStatus = container.interactivity.status === engine_1.mouseMoveEvent, hoverEnabled = events.onHover.enable, hoverMode = events.onHover.mode, divs = events.onDiv;
|
60
|
-
if (mouseMoveStatus && hoverEnabled && (0, engine_1.isInArray)(
|
61
|
+
if (mouseMoveStatus && hoverEnabled && (0, engine_1.isInArray)(bounceMode, hoverMode)) {
|
61
62
|
this._processMouseBounce();
|
62
63
|
}
|
63
64
|
else {
|
64
|
-
(0, engine_1.divModeExecute)(
|
65
|
+
(0, engine_1.divModeExecute)(bounceMode, divs, (selector, div) => this._singleSelectorBounce(selector, div));
|
65
66
|
}
|
66
67
|
}
|
67
68
|
isEnabled(particle) {
|
68
69
|
const container = this.container, options = container.actualOptions, mouse = container.interactivity.mouse, events = (particle?.interactivity ?? options.interactivity).events, divs = events.onDiv;
|
69
|
-
return ((mouse.position && events.onHover.enable && (0, engine_1.isInArray)(
|
70
|
-
(0, engine_1.isDivModeEnabled)(
|
70
|
+
return ((mouse.position && events.onHover.enable && (0, engine_1.isInArray)(bounceMode, events.onHover.mode)) ||
|
71
|
+
(0, engine_1.isDivModeEnabled)(bounceMode, divs));
|
71
72
|
}
|
72
73
|
loadModeOptions(options, ...sources) {
|
73
74
|
if (!options.bounce) {
|
package/esm/Bouncer.js
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
import { Circle, ExternalInteractorBase, Rectangle, Vector, calculateBounds, circleBounce, circleBounceDataFromParticle, divModeExecute, isDivModeEnabled, isInArray, mouseMoveEvent, rectBounce, } from "@tsparticles/engine";
|
2
2
|
import { Bounce } from "./Options/Classes/Bounce.js";
|
3
|
+
const bounceMode = "bounce";
|
3
4
|
export class Bouncer extends ExternalInteractorBase {
|
4
5
|
constructor(container) {
|
5
6
|
super(container);
|
@@ -54,17 +55,17 @@ export class Bouncer extends ExternalInteractorBase {
|
|
54
55
|
}
|
55
56
|
async interact() {
|
56
57
|
const container = this.container, options = container.actualOptions, events = options.interactivity.events, mouseMoveStatus = container.interactivity.status === mouseMoveEvent, hoverEnabled = events.onHover.enable, hoverMode = events.onHover.mode, divs = events.onDiv;
|
57
|
-
if (mouseMoveStatus && hoverEnabled && isInArray(
|
58
|
+
if (mouseMoveStatus && hoverEnabled && isInArray(bounceMode, hoverMode)) {
|
58
59
|
this._processMouseBounce();
|
59
60
|
}
|
60
61
|
else {
|
61
|
-
divModeExecute(
|
62
|
+
divModeExecute(bounceMode, divs, (selector, div) => this._singleSelectorBounce(selector, div));
|
62
63
|
}
|
63
64
|
}
|
64
65
|
isEnabled(particle) {
|
65
66
|
const container = this.container, options = container.actualOptions, mouse = container.interactivity.mouse, events = (particle?.interactivity ?? options.interactivity).events, divs = events.onDiv;
|
66
|
-
return ((mouse.position && events.onHover.enable && isInArray(
|
67
|
-
isDivModeEnabled(
|
67
|
+
return ((mouse.position && events.onHover.enable && isInArray(bounceMode, events.onHover.mode)) ||
|
68
|
+
isDivModeEnabled(bounceMode, divs));
|
68
69
|
}
|
69
70
|
loadModeOptions(options, ...sources) {
|
70
71
|
if (!options.bounce) {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@tsparticles/interaction-external-bounce",
|
3
|
-
"version": "3.0.0-beta.
|
3
|
+
"version": "3.0.0-beta.4",
|
4
4
|
"description": "tsParticles bounce 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.4"
|
91
91
|
},
|
92
92
|
"publishConfig": {
|
93
93
|
"access": "public"
|