@tsparticles/interaction-external-slow 4.0.0-alpha.8 → 4.0.0-beta.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/253.min.js +1 -0
- package/README.md +5 -0
- package/browser/Options/Classes/Slow.js +2 -0
- package/browser/Slower.js +6 -0
- package/browser/index.js +3 -3
- package/cjs/Options/Classes/Slow.js +2 -0
- package/cjs/Slower.js +6 -0
- package/cjs/index.js +3 -3
- package/dist_browser_Slower_js.js +2 -2
- package/esm/Options/Classes/Slow.js +2 -0
- package/esm/Slower.js +6 -0
- package/esm/index.js +3 -3
- package/package.json +3 -3
- package/report.html +1 -1
- package/tsparticles.interaction.external.slow.js +41 -29
- package/tsparticles.interaction.external.slow.min.js +2 -2
- package/types/Slower.d.ts +2 -0
- package/umd/Options/Classes/Slow.js +2 -0
- package/umd/Slower.js +6 -0
- package/umd/index.js +3 -3
- package/361.min.js +0 -2
- package/361.min.js.LICENSE.txt +0 -1
- package/tsparticles.interaction.external.slow.min.js.LICENSE.txt +0 -1
package/253.min.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(this.webpackChunk_tsparticles_interaction_external_slow=this.webpackChunk_tsparticles_interaction_external_slow||[]).push([[253],{253(t,e,i){i.d(e,{Slower:()=>o});var s=i(702),a=i(303),n=i(268);class o extends s.ExternalInteractorBase{_maxDistance;constructor(t){super(t),this._maxDistance=0}get maxDistance(){return this._maxDistance}clear(t,e,i){(!t.slow.inRange||i)&&(t.slow.factor=1)}init(){let t=this.container,e=t.actualOptions.interactivity?.modes.slow;e&&(this._maxDistance=e.radius,t.retina.slowModeRadius=e.radius*t.retina.pixelRatio)}interact(){}isEnabled(t,e){let i=this.container,s=t.mouse,n=(e?.interactivity??i.actualOptions.interactivity)?.events;return!!n?.onHover.enable&&!!s.position&&(0,a.isInArray)("slow",n.onHover.mode)}loadModeOptions(t,...e){for(let i of(t.slow??=new n.w,e))t.slow.load(i?.slow)}reset(t,e){e.slow.inRange=!1;let i=this.container,s=i.actualOptions,n=t.mouse.position,o=i.retina.slowModeRadius,r=s.interactivity?.modes.slow;if(!r||!o||o<0||!n)return;let l=e.getPosition(),c=(0,a.getDistance)(n,l),u=r.factor,{slow:w}=e;c>o||(w.inRange=!0,w.factor=c/o/u)}}}}]);
|
package/README.md
CHANGED
|
@@ -28,6 +28,7 @@ Once the scripts are loaded you can set up `tsParticles` and the interaction plu
|
|
|
28
28
|
|
|
29
29
|
```javascript
|
|
30
30
|
(async () => {
|
|
31
|
+
await loadInteractivityPlugin(tsParticles);
|
|
31
32
|
await loadExternalSlowInteraction(tsParticles);
|
|
32
33
|
|
|
33
34
|
await tsParticles.load({
|
|
@@ -57,9 +58,11 @@ Then you need to import it in the app, like this:
|
|
|
57
58
|
|
|
58
59
|
```javascript
|
|
59
60
|
const { tsParticles } = require("@tsparticles/engine");
|
|
61
|
+
const { loadInteractivityPlugin } = require("@tsparticles/plugin-interactivity");
|
|
60
62
|
const { loadExternalSlowInteraction } = require("@tsparticles/interaction-external-slow");
|
|
61
63
|
|
|
62
64
|
(async () => {
|
|
65
|
+
await loadInteractivityPlugin(tsParticles);
|
|
63
66
|
await loadExternalSlowInteraction(tsParticles);
|
|
64
67
|
})();
|
|
65
68
|
```
|
|
@@ -68,9 +71,11 @@ or
|
|
|
68
71
|
|
|
69
72
|
```javascript
|
|
70
73
|
import { tsParticles } from "@tsparticles/engine";
|
|
74
|
+
import { loadInteractivityPlugin } from "@tsparticles/plugin-interactivity";
|
|
71
75
|
import { loadExternalSlowInteraction } from "@tsparticles/interaction-external-slow";
|
|
72
76
|
|
|
73
77
|
(async () => {
|
|
78
|
+
await loadInteractivityPlugin(tsParticles);
|
|
74
79
|
await loadExternalSlowInteraction(tsParticles);
|
|
75
80
|
})();
|
|
76
81
|
```
|
package/browser/Slower.js
CHANGED
|
@@ -3,8 +3,13 @@ import { getDistance, isInArray } from "@tsparticles/engine";
|
|
|
3
3
|
import { Slow } from "./Options/Classes/Slow.js";
|
|
4
4
|
const slowMode = "slow", minRadius = 0;
|
|
5
5
|
export class Slower extends ExternalInteractorBase {
|
|
6
|
+
_maxDistance;
|
|
6
7
|
constructor(container) {
|
|
7
8
|
super(container);
|
|
9
|
+
this._maxDistance = 0;
|
|
10
|
+
}
|
|
11
|
+
get maxDistance() {
|
|
12
|
+
return this._maxDistance;
|
|
8
13
|
}
|
|
9
14
|
clear(particle, _delta, force) {
|
|
10
15
|
if (particle.slow.inRange && !force) {
|
|
@@ -17,6 +22,7 @@ export class Slower extends ExternalInteractorBase {
|
|
|
17
22
|
if (!slow) {
|
|
18
23
|
return;
|
|
19
24
|
}
|
|
25
|
+
this._maxDistance = slow.radius;
|
|
20
26
|
container.retina.slowModeRadius = slow.radius * container.retina.pixelRatio;
|
|
21
27
|
}
|
|
22
28
|
interact() {
|
package/browser/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export async function loadExternalSlowInteraction(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-
|
|
2
|
+
engine.checkVersion("4.0.0-beta.0");
|
|
3
3
|
await engine.register(async (e) => {
|
|
4
|
-
const {
|
|
5
|
-
|
|
4
|
+
const { ensureInteractivityPluginLoaded } = await import("@tsparticles/plugin-interactivity");
|
|
5
|
+
ensureInteractivityPluginLoaded(e);
|
|
6
6
|
e.addInteractor?.("externalSlow", async (container) => {
|
|
7
7
|
const { Slower } = await import("./Slower.js");
|
|
8
8
|
return new Slower(container);
|
package/cjs/Slower.js
CHANGED
|
@@ -3,8 +3,13 @@ import { getDistance, isInArray } from "@tsparticles/engine";
|
|
|
3
3
|
import { Slow } from "./Options/Classes/Slow.js";
|
|
4
4
|
const slowMode = "slow", minRadius = 0;
|
|
5
5
|
export class Slower extends ExternalInteractorBase {
|
|
6
|
+
_maxDistance;
|
|
6
7
|
constructor(container) {
|
|
7
8
|
super(container);
|
|
9
|
+
this._maxDistance = 0;
|
|
10
|
+
}
|
|
11
|
+
get maxDistance() {
|
|
12
|
+
return this._maxDistance;
|
|
8
13
|
}
|
|
9
14
|
clear(particle, _delta, force) {
|
|
10
15
|
if (particle.slow.inRange && !force) {
|
|
@@ -17,6 +22,7 @@ export class Slower extends ExternalInteractorBase {
|
|
|
17
22
|
if (!slow) {
|
|
18
23
|
return;
|
|
19
24
|
}
|
|
25
|
+
this._maxDistance = slow.radius;
|
|
20
26
|
container.retina.slowModeRadius = slow.radius * container.retina.pixelRatio;
|
|
21
27
|
}
|
|
22
28
|
interact() {
|
package/cjs/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export async function loadExternalSlowInteraction(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-
|
|
2
|
+
engine.checkVersion("4.0.0-beta.0");
|
|
3
3
|
await engine.register(async (e) => {
|
|
4
|
-
const {
|
|
5
|
-
|
|
4
|
+
const { ensureInteractivityPluginLoaded } = await import("@tsparticles/plugin-interactivity");
|
|
5
|
+
ensureInteractivityPluginLoaded(e);
|
|
6
6
|
e.addInteractor?.("externalSlow", async (container) => {
|
|
7
7
|
const { Slower } = await import("./Slower.js");
|
|
8
8
|
return new Slower(container);
|
|
@@ -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
|
-
* v4.0.0-
|
|
7
|
+
* v4.0.0-beta.0
|
|
8
8
|
*/
|
|
9
9
|
"use strict";
|
|
10
10
|
/*
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
\********************************/
|
|
24
24
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
25
25
|
|
|
26
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Slower: () => (/* binding */ Slower)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_plugin_interactivity__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/plugin-interactivity */ \"@tsparticles/plugin-interactivity\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _Options_Classes_Slow_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Options/Classes/Slow.js */ \"./dist/browser/Options/Classes/Slow.js\");\n\n\n\nconst slowMode = \"slow\"
|
|
26
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Slower: () => (/* binding */ Slower)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_plugin_interactivity__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/plugin-interactivity */ \"@tsparticles/plugin-interactivity\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _Options_Classes_Slow_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Options/Classes/Slow.js */ \"./dist/browser/Options/Classes/Slow.js\");\n\n\n\nconst slowMode = \"slow\", minRadius = 0;\nclass Slower extends _tsparticles_plugin_interactivity__WEBPACK_IMPORTED_MODULE_0__.ExternalInteractorBase {\n _maxDistance;\n constructor(container){\n super(container);\n this._maxDistance = 0;\n }\n get maxDistance() {\n return this._maxDistance;\n }\n clear(particle, _delta, force) {\n if (particle.slow.inRange && !force) {\n return;\n }\n particle.slow.factor = 1;\n }\n init() {\n const container = this.container, slow = container.actualOptions.interactivity?.modes.slow;\n if (!slow) {\n return;\n }\n this._maxDistance = slow.radius;\n container.retina.slowModeRadius = slow.radius * container.retina.pixelRatio;\n }\n interact() {}\n isEnabled(interactivityData, particle) {\n const container = this.container, mouse = interactivityData.mouse, events = (particle?.interactivity ?? container.actualOptions.interactivity)?.events;\n return !!events?.onHover.enable && !!mouse.position && (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.isInArray)(slowMode, events.onHover.mode);\n }\n loadModeOptions(options, ...sources) {\n options.slow ??= new _Options_Classes_Slow_js__WEBPACK_IMPORTED_MODULE_2__.Slow();\n for (const source of sources){\n options.slow.load(source?.slow);\n }\n }\n reset(interactivityData, particle) {\n particle.slow.inRange = false;\n const container = this.container, options = container.actualOptions, mousePos = interactivityData.mouse.position, radius = container.retina.slowModeRadius, slowOptions = options.interactivity?.modes.slow;\n if (!slowOptions || !radius || radius < minRadius || !mousePos) {\n return;\n }\n const particlePos = particle.getPosition(), dist = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.getDistance)(mousePos, particlePos), proximityFactor = dist / radius, slowFactor = slowOptions.factor, { slow } = particle;\n if (dist > radius) {\n return;\n }\n slow.inRange = true;\n slow.factor = proximityFactor / slowFactor;\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/interaction-external-slow/./dist/browser/Slower.js?\n}");
|
|
27
27
|
|
|
28
28
|
/***/ }
|
|
29
29
|
|
package/esm/Slower.js
CHANGED
|
@@ -3,8 +3,13 @@ import { getDistance, isInArray } from "@tsparticles/engine";
|
|
|
3
3
|
import { Slow } from "./Options/Classes/Slow.js";
|
|
4
4
|
const slowMode = "slow", minRadius = 0;
|
|
5
5
|
export class Slower extends ExternalInteractorBase {
|
|
6
|
+
_maxDistance;
|
|
6
7
|
constructor(container) {
|
|
7
8
|
super(container);
|
|
9
|
+
this._maxDistance = 0;
|
|
10
|
+
}
|
|
11
|
+
get maxDistance() {
|
|
12
|
+
return this._maxDistance;
|
|
8
13
|
}
|
|
9
14
|
clear(particle, _delta, force) {
|
|
10
15
|
if (particle.slow.inRange && !force) {
|
|
@@ -17,6 +22,7 @@ export class Slower extends ExternalInteractorBase {
|
|
|
17
22
|
if (!slow) {
|
|
18
23
|
return;
|
|
19
24
|
}
|
|
25
|
+
this._maxDistance = slow.radius;
|
|
20
26
|
container.retina.slowModeRadius = slow.radius * container.retina.pixelRatio;
|
|
21
27
|
}
|
|
22
28
|
interact() {
|
package/esm/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export async function loadExternalSlowInteraction(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-
|
|
2
|
+
engine.checkVersion("4.0.0-beta.0");
|
|
3
3
|
await engine.register(async (e) => {
|
|
4
|
-
const {
|
|
5
|
-
|
|
4
|
+
const { ensureInteractivityPluginLoaded } = await import("@tsparticles/plugin-interactivity");
|
|
5
|
+
ensureInteractivityPluginLoaded(e);
|
|
6
6
|
e.addInteractor?.("externalSlow", async (container) => {
|
|
7
7
|
const { Slower } = await import("./Slower.js");
|
|
8
8
|
return new Slower(container);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/interaction-external-slow",
|
|
3
|
-
"version": "4.0.0-
|
|
3
|
+
"version": "4.0.0-beta.0",
|
|
4
4
|
"description": "tsParticles slow external interaction",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -87,8 +87,8 @@
|
|
|
87
87
|
"./package.json": "./package.json"
|
|
88
88
|
},
|
|
89
89
|
"dependencies": {
|
|
90
|
-
"@tsparticles/engine": "4.0.0-
|
|
91
|
-
"@tsparticles/plugin-interactivity": "4.0.0-
|
|
90
|
+
"@tsparticles/engine": "4.0.0-beta.0",
|
|
91
|
+
"@tsparticles/plugin-interactivity": "4.0.0-beta.0"
|
|
92
92
|
},
|
|
93
93
|
"publishConfig": {
|
|
94
94
|
"access": "public"
|
package/report.html
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8"/>
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
6
|
-
<title>@tsparticles/interaction-external-slow [
|
|
6
|
+
<title>@tsparticles/interaction-external-slow [19 Mar 2026 at 13:59]</title>
|
|
7
7
|
<link rel="shortcut icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAABrVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+O1foceMD///+J0/qK1Pr7/v8Xdr/9///W8P4UdL7L7P0Scr2r4Pyj3vwad8D5/f/2/f+55f3E6f34+/2H0/ojfMKpzOd0rNgQcb3F3O/j9f7c8v6g3Pz0/P/w+v/q+P7n9v6T1/uQ1vuE0vqLut/y+v+Z2fvt+f+15Pzv9fuc2/vR7v2V2Pvd6/bg9P7I6/285/2y4/yp3/zp8vk8i8kqgMT7/P31+fyv4vxGkcz6/P6/6P3j7vfS5PNnpNUxhcbO7f7F6v3O4vHK3/DA2u631Ouy0eqXweKJud5wqthfoNMMbLvY8f73+v2dxeR8sNtTmdDx9/zX6PSjyeaCtd1YnNGX2PuQveCGt95Nls42h8dLlM3F4vBtAAAAM3RSTlMAAyOx0/sKBvik8opWGBMOAe3l1snDm2E9LSb06eHcu5JpHbarfHZCN9CBb08zzkdNS0kYaptYAAAFV0lEQVRYw92X51/aYBDHHS2O2qqttVbrqNq9m+TJIAYIShBkWwqIiCgoWvfeq7Z2/s29hyQNyUcR7LveGwVyXy6XH8/9rqxglLfUPLxVduUor3h0rfp2TYvpivk37929TkG037hffoX0+peVtZQc1589rigVUdXS/ABSAyEmGIO/1XfvldSK8vs3OqB6u3m0nxmIrvgB0dj7rr7Y9IbuF68hnfFaiHA/sxqm0wciIG43P60qKv9WXWc1RXGh/mFESFABTSBi0sNAKzqet17eCtOb3kZIDwxEEU0oAIJGYxNBDhBND29e0rtXXbcpuPmED9IhEAAQ/AXEaF8EPmnrrKsv0LvWR3fg5sWDNAFZOgAgaKvZDogHNU9MFwnnYROkc56RD5CjAbQX9Ow4g7upCsvYu55aSI/Nj0H1akgKQEUM94dwK65hYRmFU9MIcH/fqJYOZYcnuJSU/waKDgTOEVaVKhwrTRP5XzgSpAITYzom7UvkhFX5VutmxeNnWDjjswTKTyfgluNDGbUpWissXhF3s7mlSml+czWkg3D0l1nNjGNjz3myOQOa1KM/jOS6ebdbAVTCi4gljHSFrviza7tOgRWcS0MOUX9zdNgag5w7rRqA44Lzw0hr1WqES36dFliSJFlh2rXIae3FFcDDgKdxrUIDePr8jGcSClV1u7A9xeN0ModY/pHMxmR1EzRh8TJiwqsHmKW0l4FCEZI+jHio+JdPPE9qwQtTRxku2D8sIeRL2LnxWSllANCQGOIiqVHAz2ye2JR0DcH+HoxDkaADLjgxjKQ+AwCX/g0+DNgdG0ukYCONAe+dbc2IAc6fwt1ARoDSezNHxV2Cmzwv3O6lDMV55edBGwGK9n1+x2F8EDfAGCxug8MhpsMEcTEAWf3rx2vZhe/LAmtIn/6apE6PN0ULKgywD9mmdxbmFl3OvD5AS5fW5zLbv/YHmcsBTjf/afDz3MaZTVCfAP9z6/Bw6ycv8EUBWJIn9zYcoAWWlW9+OzO3vkTy8H+RANLmdrpOuYWdZYEXpo+TlCJrW5EARb7fF+bWdqf3hhyZI1nWJQHgznErZhbjoEsWqi8dQNoE294aldzFurwSABL2XXMf9+H1VQGke9exw5P/AnA5Pv5ngMul7LOvO922iwACu8WkCwLCafvM4CeWPxfA8lNHcWZSoi8EwMAIciKX2Z4SWCMAa3snCZ/G4EA8D6CMLNFsGQhkkz/gQNEBbPCbWsxGUpYVu3z8IyNAknwJkfPMEhLyrdi5RTyUVACkw4GSFRNWJNEW+fgPGwHD8/JxnRuLabN4CGNRkAE23na2+VmEAUmrYymSGjMAYqH84YUIyzgzs3XC7gNgH36Vcc4zKY9o9fgPBXUAiHHwVboBHGLiX6Zcjp1f2wu4tvzZKo0ecPnDtQYDQvJXaBeNzce45Fp28ZQLrEZVuFqgBwOalArKXnW1UzlnSusQKJqKYNuz4tOnI6sZG4zanpemv+7ySU2jbA9h6uhcgpfy6G2PahirDZ6zvq6zDduMVFTKvzw8wgyEdelwY9in3XkEPs3osJuwRQ4qTkfzifndg9Gfc4pdsu82+tTnHZTBa2EAMrqr2t43pguc8tNm7JQVQ2S0ukj2d22dhXYP0/veWtwKrCkNoNimAN5+Xr/oLrxswKbVJjteWrX7eR63o4j9q0GxnaBdWgGA5VStpanIjQmEhV0/nVt5VOFUvix6awJhPcAaTEShgrG+iGyvb5a0Ndb1YGHFPEwoqAinoaykaID1o1pdPNu7XsnCKQ3R+hwWIIhGvORcJUBYXe3Xa3vq/mF/N9V13ugufMkfXn+KHsRD0B8AAAAASUVORK5CYII=" type="image/x-icon" />
|
|
8
8
|
|
|
9
9
|
<script>
|
|
@@ -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
|
-
* v4.0.0-
|
|
7
|
+
* v4.0.0-beta.0
|
|
8
8
|
*/
|
|
9
9
|
/*
|
|
10
10
|
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
@@ -28,26 +28,6 @@ return /******/ (() => { // webpackBootstrap
|
|
|
28
28
|
/******/ "use strict";
|
|
29
29
|
/******/ var __webpack_modules__ = ({
|
|
30
30
|
|
|
31
|
-
/***/ "./dist/browser/Options/Classes/Slow.js"
|
|
32
|
-
/*!**********************************************!*\
|
|
33
|
-
!*** ./dist/browser/Options/Classes/Slow.js ***!
|
|
34
|
-
\**********************************************/
|
|
35
|
-
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
36
|
-
|
|
37
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Slow: () => (/* binding */ Slow)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nclass Slow {\n constructor() {\n this.factor = 3;\n this.radius = 200;\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n if (data.factor !== undefined) {\n this.factor = data.factor;\n }\n if (data.radius !== undefined) {\n this.radius = data.radius;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/interaction-external-slow/./dist/browser/Options/Classes/Slow.js?\n}");
|
|
38
|
-
|
|
39
|
-
/***/ },
|
|
40
|
-
|
|
41
|
-
/***/ "./dist/browser/index.js"
|
|
42
|
-
/*!*******************************!*\
|
|
43
|
-
!*** ./dist/browser/index.js ***!
|
|
44
|
-
\*******************************/
|
|
45
|
-
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
46
|
-
|
|
47
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Slow: () => (/* reexport safe */ _Options_Classes_Slow_js__WEBPACK_IMPORTED_MODULE_0__.Slow),\n/* harmony export */ loadExternalSlowInteraction: () => (/* binding */ loadExternalSlowInteraction)\n/* harmony export */ });\n/* harmony import */ var _Options_Classes_Slow_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Options/Classes/Slow.js */ \"./dist/browser/Options/Classes/Slow.js\");\nasync function loadExternalSlowInteraction(engine) {\n engine.checkVersion(\"4.0.0-alpha.8\");\n await engine.register(async e => {\n const {\n loadInteractivityPlugin\n } = await Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! @tsparticles/plugin-interactivity */ \"@tsparticles/plugin-interactivity\", 19));\n await loadInteractivityPlugin(e);\n e.addInteractor?.(\"externalSlow\", async container => {\n const {\n Slower\n } = await __webpack_require__.e(/*! import() */ \"dist_browser_Slower_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./Slower.js */ \"./dist/browser/Slower.js\"));\n return new Slower(container);\n });\n });\n}\n\n\n//# sourceURL=webpack://@tsparticles/interaction-external-slow/./dist/browser/index.js?\n}");
|
|
48
|
-
|
|
49
|
-
/***/ },
|
|
50
|
-
|
|
51
31
|
/***/ "@tsparticles/engine"
|
|
52
32
|
/*!*********************************************************************************************************************************!*\
|
|
53
33
|
!*** external {"commonjs":"@tsparticles/engine","commonjs2":"@tsparticles/engine","amd":"@tsparticles/engine","root":"window"} ***!
|
|
@@ -66,6 +46,26 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
|
|
|
66
46
|
|
|
67
47
|
module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_interactivity__;
|
|
68
48
|
|
|
49
|
+
/***/ },
|
|
50
|
+
|
|
51
|
+
/***/ "./dist/browser/Options/Classes/Slow.js"
|
|
52
|
+
/*!**********************************************!*\
|
|
53
|
+
!*** ./dist/browser/Options/Classes/Slow.js ***!
|
|
54
|
+
\**********************************************/
|
|
55
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
56
|
+
|
|
57
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Slow: () => (/* binding */ Slow)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nclass Slow {\n factor;\n radius;\n constructor(){\n this.factor = 3;\n this.radius = 200;\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n if (data.factor !== undefined) {\n this.factor = data.factor;\n }\n if (data.radius !== undefined) {\n this.radius = data.radius;\n }\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/interaction-external-slow/./dist/browser/Options/Classes/Slow.js?\n}");
|
|
58
|
+
|
|
59
|
+
/***/ },
|
|
60
|
+
|
|
61
|
+
/***/ "./dist/browser/index.js"
|
|
62
|
+
/*!*******************************!*\
|
|
63
|
+
!*** ./dist/browser/index.js ***!
|
|
64
|
+
\*******************************/
|
|
65
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
66
|
+
|
|
67
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Slow: () => (/* reexport safe */ _Options_Classes_Slow_js__WEBPACK_IMPORTED_MODULE_0__.Slow),\n/* harmony export */ loadExternalSlowInteraction: () => (/* binding */ loadExternalSlowInteraction)\n/* harmony export */ });\n/* harmony import */ var _Options_Classes_Slow_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Options/Classes/Slow.js */ \"./dist/browser/Options/Classes/Slow.js\");\nasync function loadExternalSlowInteraction(engine) {\n engine.checkVersion(\"4.0.0-beta.0\");\n await engine.register(async (e)=>{\n const { ensureInteractivityPluginLoaded } = await Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! @tsparticles/plugin-interactivity */ \"@tsparticles/plugin-interactivity\", 19));\n ensureInteractivityPluginLoaded(e);\n e.addInteractor?.(\"externalSlow\", async (container)=>{\n const { Slower } = await __webpack_require__.e(/*! import() */ \"dist_browser_Slower_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./Slower.js */ \"./dist/browser/Slower.js\"));\n return new Slower(container);\n });\n });\n}\n\n\n\n//# sourceURL=webpack://@tsparticles/interaction-external-slow/./dist/browser/index.js?\n}");
|
|
68
|
+
|
|
69
69
|
/***/ }
|
|
70
70
|
|
|
71
71
|
/******/ });
|
|
@@ -80,12 +80,6 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_interactivity__;
|
|
|
80
80
|
/******/ if (cachedModule !== undefined) {
|
|
81
81
|
/******/ return cachedModule.exports;
|
|
82
82
|
/******/ }
|
|
83
|
-
/******/ // Check if module exists (development only)
|
|
84
|
-
/******/ if (__webpack_modules__[moduleId] === undefined) {
|
|
85
|
-
/******/ var e = new Error("Cannot find module '" + moduleId + "'");
|
|
86
|
-
/******/ e.code = 'MODULE_NOT_FOUND';
|
|
87
|
-
/******/ throw e;
|
|
88
|
-
/******/ }
|
|
89
83
|
/******/ // Create a new module (and put it into the cache)
|
|
90
84
|
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
91
85
|
/******/ // no module.id needed
|
|
@@ -94,6 +88,12 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_interactivity__;
|
|
|
94
88
|
/******/ };
|
|
95
89
|
/******/
|
|
96
90
|
/******/ // Execute the module function
|
|
91
|
+
/******/ if (!(moduleId in __webpack_modules__)) {
|
|
92
|
+
/******/ delete __webpack_module_cache__[moduleId];
|
|
93
|
+
/******/ var e = new Error("Cannot find module '" + moduleId + "'");
|
|
94
|
+
/******/ e.code = 'MODULE_NOT_FOUND';
|
|
95
|
+
/******/ throw e;
|
|
96
|
+
/******/ }
|
|
97
97
|
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
98
98
|
/******/
|
|
99
99
|
/******/ // Return the exports of the module
|
|
@@ -168,6 +168,18 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_interactivity__;
|
|
|
168
168
|
/******/ };
|
|
169
169
|
/******/ })();
|
|
170
170
|
/******/
|
|
171
|
+
/******/ /* webpack/runtime/global */
|
|
172
|
+
/******/ (() => {
|
|
173
|
+
/******/ __webpack_require__.g = (function() {
|
|
174
|
+
/******/ if (typeof globalThis === 'object') return globalThis;
|
|
175
|
+
/******/ try {
|
|
176
|
+
/******/ return this || new Function('return this')();
|
|
177
|
+
/******/ } catch (e) {
|
|
178
|
+
/******/ if (typeof window === 'object') return window;
|
|
179
|
+
/******/ }
|
|
180
|
+
/******/ })();
|
|
181
|
+
/******/ })();
|
|
182
|
+
/******/
|
|
171
183
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
172
184
|
/******/ (() => {
|
|
173
185
|
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
@@ -232,8 +244,8 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_interactivity__;
|
|
|
232
244
|
/******/ /* webpack/runtime/publicPath */
|
|
233
245
|
/******/ (() => {
|
|
234
246
|
/******/ var scriptUrl;
|
|
235
|
-
/******/ if (
|
|
236
|
-
/******/ var document =
|
|
247
|
+
/******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
|
|
248
|
+
/******/ var document = __webpack_require__.g.document;
|
|
237
249
|
/******/ if (!scriptUrl && document) {
|
|
238
250
|
/******/ if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')
|
|
239
251
|
/******/ scriptUrl = document.currentScript.src;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/engine"),require("@tsparticles/plugin-interactivity"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine","@tsparticles/plugin-interactivity"],t);else{var r="object"==typeof exports?t(require("@tsparticles/engine"),require("@tsparticles/plugin-interactivity")):t(e.window,e.window);for(var o in r)("object"==typeof exports?exports:e)[o]=r[o]}}(this,(e,t)=>(()=>{"use strict";var r,o,i,n={303(t){t.exports=e},702(e){e.exports=t},268(e,t,r){r.d(t,{w:()=>i});var o=r(303);class i{factor;radius;constructor(){this.factor=3,this.radius=200}load(e){(0,o.isNull)(e)||(void 0!==e.factor&&(this.factor=e.factor),void 0!==e.radius&&(this.radius=e.radius))}}}},a={};function s(e){var t=a[e];if(void 0!==t)return t.exports;var r=a[e]={exports:{}};return n[e](r,r.exports,s),r.exports}s.m=n,l=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,s.t=function(e,t){if(1&t&&(e=this(e)),8&t||"object"==typeof e&&e&&(4&t&&e.__esModule||16&t&&"function"==typeof e.then))return e;var r=Object.create(null);s.r(r);var o={};c=c||[null,l({}),l([]),l(l)];for(var i=2&t&&e;("object"==typeof i||"function"==typeof i)&&!~c.indexOf(i);i=l(i))Object.getOwnPropertyNames(i).forEach(t=>o[t]=()=>e[t]);return o.default=()=>e,s.d(r,o),r},s.d=(e,t)=>{for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce((t,r)=>(s.f[r](e,t),t),[])),s.u=e=>""+e+".min.js",s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),u={},s.l=(e,t,r,o)=>{if(u[e])return void u[e].push(t);if(void 0!==r)for(var i,n,a=document.getElementsByTagName("script"),c=0;c<a.length;c++){var l=a[c];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")=="@tsparticles/interaction-external-slow:"+r){i=l;break}}i||(n=!0,(i=document.createElement("script")).charset="utf-8",s.nc&&i.setAttribute("nonce",s.nc),i.setAttribute("data-webpack","@tsparticles/interaction-external-slow:"+r),i.src=e),u[e]=[t];var p=(t,r)=>{i.onerror=i.onload=null,clearTimeout(d);var o=u[e];if(delete u[e],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach(e=>e(r)),t)return t(r)},d=setTimeout(p.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=p.bind(null,i.onerror),i.onload=p.bind(null,i.onload),n&&document.head.appendChild(i)},s.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.g.importScripts&&(p=s.g.location+"");var c,l,u,p,d=s.g.document;if(!p&&d&&(d.currentScript&&"SCRIPT"===d.currentScript.tagName.toUpperCase()&&(p=d.currentScript.src),!p)){var f=d.getElementsByTagName("script");if(f.length)for(var b=f.length-1;b>-1&&(!p||!/^http(s?):/.test(p));)p=f[b--].src}if(!p)throw Error("Automatic publicPath is not supported in this browser");s.p=p=p.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r={617:0},s.f.j=(e,t)=>{var o=s.o(r,e)?r[e]:void 0;if(0!==o)if(o)t.push(o[2]);else{var i=new Promise((t,i)=>o=r[e]=[t,i]);t.push(o[2]=i);var n=s.p+s.u(e),a=Error();s.l(n,t=>{if(s.o(r,e)&&(0!==(o=r[e])&&(r[e]=void 0),o)){var i=t&&("load"===t.type?"missing":t.type),n=t&&t.target&&t.target.src;a.message="Loading chunk "+e+` failed.
|
|
2
|
+
(`+i+": "+n+")",a.name="ChunkLoadError",a.type=i,a.request=n,o[1](a)}},"chunk-"+e,e)}},o=(e,t)=>{var o,i,[n,a,c]=t,l=0;if(n.some(e=>0!==r[e])){for(o in a)s.o(a,o)&&(s.m[o]=a[o]);c&&c(s)}for(e&&e(t);l<n.length;l++)i=n[l],s.o(r,i)&&r[i]&&r[i][0](),r[i]=0},(i=this.webpackChunk_tsparticles_interaction_external_slow=this.webpackChunk_tsparticles_interaction_external_slow||[]).forEach(o.bind(null,0)),i.push=o.bind(null,i.push.bind(i));var h={};s.r(h),s.d(h,{Slow:()=>v.w,loadExternalSlowInteraction:()=>g});var v=s(268);async function g(e){e.checkVersion("4.0.0-beta.0"),await e.register(async e=>{let{ensureInteractivityPluginLoaded:t}=await Promise.resolve().then(s.t.bind(s,702,19));t(e),e.addInteractor?.("externalSlow",async e=>{let{Slower:t}=await s.e(253).then(s.bind(s,253));return new t(e)})})}return h})());
|
package/types/Slower.d.ts
CHANGED
|
@@ -2,7 +2,9 @@ import { ExternalInteractorBase, type IInteractivityData, type IModes, type Inte
|
|
|
2
2
|
import { type IDelta, type Particle, type RecursivePartial } from "@tsparticles/engine";
|
|
3
3
|
import type { ISlowMode, SlowContainer, SlowMode } from "./Types.js";
|
|
4
4
|
export declare class Slower extends ExternalInteractorBase<SlowContainer> {
|
|
5
|
+
private _maxDistance;
|
|
5
6
|
constructor(container: SlowContainer);
|
|
7
|
+
get maxDistance(): number;
|
|
6
8
|
clear(particle: Particle, _delta: IDelta, force?: boolean): void;
|
|
7
9
|
init(): void;
|
|
8
10
|
interact(): void;
|
package/umd/Slower.js
CHANGED
|
@@ -15,8 +15,13 @@
|
|
|
15
15
|
const Slow_js_1 = require("./Options/Classes/Slow.js");
|
|
16
16
|
const slowMode = "slow", minRadius = 0;
|
|
17
17
|
class Slower extends plugin_interactivity_1.ExternalInteractorBase {
|
|
18
|
+
_maxDistance;
|
|
18
19
|
constructor(container) {
|
|
19
20
|
super(container);
|
|
21
|
+
this._maxDistance = 0;
|
|
22
|
+
}
|
|
23
|
+
get maxDistance() {
|
|
24
|
+
return this._maxDistance;
|
|
20
25
|
}
|
|
21
26
|
clear(particle, _delta, force) {
|
|
22
27
|
if (particle.slow.inRange && !force) {
|
|
@@ -29,6 +34,7 @@
|
|
|
29
34
|
if (!slow) {
|
|
30
35
|
return;
|
|
31
36
|
}
|
|
37
|
+
this._maxDistance = slow.radius;
|
|
32
38
|
container.retina.slowModeRadius = slow.radius * container.retina.pixelRatio;
|
|
33
39
|
}
|
|
34
40
|
interact() {
|
package/umd/index.js
CHANGED
|
@@ -48,10 +48,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
48
48
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49
49
|
exports.loadExternalSlowInteraction = loadExternalSlowInteraction;
|
|
50
50
|
async function loadExternalSlowInteraction(engine) {
|
|
51
|
-
engine.checkVersion("4.0.0-
|
|
51
|
+
engine.checkVersion("4.0.0-beta.0");
|
|
52
52
|
await engine.register(async (e) => {
|
|
53
|
-
const {
|
|
54
|
-
|
|
53
|
+
const { ensureInteractivityPluginLoaded } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("@tsparticles/plugin-interactivity"))) : new Promise((resolve_1, reject_1) => { require(["@tsparticles/plugin-interactivity"], resolve_1, reject_1); }).then(__importStar));
|
|
54
|
+
ensureInteractivityPluginLoaded(e);
|
|
55
55
|
e.addInteractor?.("externalSlow", async (container) => {
|
|
56
56
|
const { Slower } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./Slower.js"))) : new Promise((resolve_2, reject_2) => { require(["./Slower.js"], resolve_2, reject_2); }).then(__importStar));
|
|
57
57
|
return new Slower(container);
|
package/361.min.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 361.min.js.LICENSE.txt */
|
|
2
|
-
(this.webpackChunk_tsparticles_interaction_external_slow=this.webpackChunk_tsparticles_interaction_external_slow||[]).push([[361],{361(t,o,e){e.d(o,{Slower:()=>a});var n=e(702),i=e(303),s=e(800);class a extends n.ExternalInteractorBase{constructor(t){super(t)}clear(t,o,e){t.slow.inRange&&!e||(t.slow.factor=1)}init(){const t=this.container,o=t.actualOptions.interactivity?.modes.slow;o&&(t.retina.slowModeRadius=o.radius*t.retina.pixelRatio)}interact(){}isEnabled(t,o){const e=this.container,n=t.mouse,s=(o?.interactivity??e.actualOptions.interactivity)?.events;return!!s?.onHover.enable&&!!n.position&&(0,i.isInArray)("slow",s.onHover.mode)}loadModeOptions(t,...o){t.slow??=new s.w;for(const e of o)t.slow.load(e?.slow)}reset(t,o){o.slow.inRange=!1;const e=this.container,n=e.actualOptions,s=t.mouse.position,a=e.retina.slowModeRadius,r=n.interactivity?.modes.slow;if(!r||!a||a<0||!s)return;const c=o.getPosition(),l=(0,i.getDistance)(s,c),w=l/a,u=r.factor,{slow:d}=o;l>a||(d.inRange=!0,d.factor=w/u)}}}}]);
|
package/361.min.js.LICENSE.txt
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! tsParticles Slow External Interaction v4.0.0-alpha.8 by Matteo Bruni */
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! tsParticles Slow External Interaction v4.0.0-alpha.8 by Matteo Bruni */
|