@tsparticles/interaction-external-bounce 4.0.0-alpha.8 → 4.0.0-beta.1
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/624.min.js +1 -0
- package/README.md +5 -0
- package/browser/Bouncer.js +6 -0
- package/browser/Options/Classes/Bounce.js +1 -0
- package/browser/Utils.js +1 -1
- package/browser/index.js +5 -5
- package/cjs/Bouncer.js +6 -0
- package/cjs/Options/Classes/Bounce.js +1 -0
- package/cjs/Utils.js +1 -1
- package/cjs/index.js +5 -5
- package/dist_browser_Bouncer_js.js +3 -3
- package/esm/Bouncer.js +6 -0
- package/esm/Options/Classes/Bounce.js +1 -0
- package/esm/Utils.js +1 -1
- package/esm/index.js +5 -5
- package/package.json +3 -3
- package/report.html +84 -29
- package/tsparticles.interaction.external.bounce.js +41 -29
- package/tsparticles.interaction.external.bounce.min.js +2 -2
- package/types/Bouncer.d.ts +2 -0
- package/umd/Bouncer.js +6 -0
- package/umd/Options/Classes/Bounce.js +1 -0
- package/umd/Utils.js +1 -1
- package/umd/index.js +5 -5
- package/820.min.js +0 -2
- package/820.min.js.LICENSE.txt +0 -1
- package/tsparticles.interaction.external.bounce.min.js.LICENSE.txt +0 -1
|
@@ -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.1
|
|
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/Bounce.js"
|
|
32
|
-
/*!************************************************!*\
|
|
33
|
-
!*** ./dist/browser/Options/Classes/Bounce.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 */ Bounce: () => (/* binding */ Bounce)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nclass Bounce {\n constructor() {\n this.distance = 200;\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n if (data.distance !== undefined) {\n this.distance = data.distance;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/interaction-external-bounce/./dist/browser/Options/Classes/Bounce.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 */ Bounce: () => (/* reexport safe */ _Options_Classes_Bounce_js__WEBPACK_IMPORTED_MODULE_0__.Bounce),\n/* harmony export */ loadExternalBounceInteraction: () => (/* binding */ loadExternalBounceInteraction)\n/* harmony export */ });\n/* harmony import */ var _Options_Classes_Bounce_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Options/Classes/Bounce.js */ \"./dist/browser/Options/Classes/Bounce.js\");\nasync function loadExternalBounceInteraction(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?.(\"externalBounce\", async container => {\n const {\n Bouncer\n } = await __webpack_require__.e(/*! import() */ \"dist_browser_Bouncer_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./Bouncer.js */ \"./dist/browser/Bouncer.js\"));\n return new Bouncer(container);\n });\n });\n}\n\n\n//# sourceURL=webpack://@tsparticles/interaction-external-bounce/./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/Bounce.js"
|
|
52
|
+
/*!************************************************!*\
|
|
53
|
+
!*** ./dist/browser/Options/Classes/Bounce.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 */ Bounce: () => (/* binding */ Bounce)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nclass Bounce {\n distance;\n constructor(){\n this.distance = 200;\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n if (data.distance !== undefined) {\n this.distance = data.distance;\n }\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/interaction-external-bounce/./dist/browser/Options/Classes/Bounce.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 */ Bounce: () => (/* reexport safe */ _Options_Classes_Bounce_js__WEBPACK_IMPORTED_MODULE_0__.Bounce),\n/* harmony export */ loadExternalBounceInteraction: () => (/* binding */ loadExternalBounceInteraction)\n/* harmony export */ });\n/* harmony import */ var _Options_Classes_Bounce_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Options/Classes/Bounce.js */ \"./dist/browser/Options/Classes/Bounce.js\");\nasync function loadExternalBounceInteraction(engine) {\n engine.checkVersion(\"4.0.0-beta.1\");\n await engine.pluginManager.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.pluginManager.addInteractor?.(\"externalBounce\", async (container)=>{\n const { Bouncer } = await __webpack_require__.e(/*! import() */ \"dist_browser_Bouncer_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./Bouncer.js */ \"./dist/browser/Bouncer.js\"));\n return new Bouncer(container);\n });\n });\n}\n\n\n\n//# sourceURL=webpack://@tsparticles/interaction-external-bounce/./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 n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(this,(e,t)=>(()=>{"use strict";var r,n,o,i={303(t){t.exports=e},702(e){e.exports=t},701(e,t,r){r.d(t,{b:()=>o});var n=r(303);class o{distance;constructor(){this.distance=200}load(e){(0,n.isNull)(e)||void 0!==e.distance&&(this.distance=e.distance)}}}},a={};function c(e){var t=a[e];if(void 0!==t)return t.exports;var r=a[e]={exports:{}};return i[e](r,r.exports,c),r.exports}c.m=i,l=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,c.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);c.r(r);var n={};s=s||[null,l({}),l([]),l(l)];for(var o=2&t&&e;("object"==typeof o||"function"==typeof o)&&!~s.indexOf(o);o=l(o))Object.getOwnPropertyNames(o).forEach(t=>n[t]=()=>e[t]);return n.default=()=>e,c.d(r,n),r},c.d=(e,t)=>{for(var r in t)c.o(t,r)&&!c.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},c.f={},c.e=e=>Promise.all(Object.keys(c.f).reduce((t,r)=>(c.f[r](e,t),t),[])),c.u=e=>""+e+".min.js",c.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),u={},c.l=(e,t,r,n)=>{if(u[e])return void u[e].push(t);if(void 0!==r)for(var o,i,a=document.getElementsByTagName("script"),s=0;s<a.length;s++){var l=a[s];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")=="@tsparticles/interaction-external-bounce:"+r){o=l;break}}o||(i=!0,(o=document.createElement("script")).charset="utf-8",c.nc&&o.setAttribute("nonce",c.nc),o.setAttribute("data-webpack","@tsparticles/interaction-external-bounce:"+r),o.src=e),u[e]=[t];var p=(t,r)=>{o.onerror=o.onload=null,clearTimeout(d);var n=u[e];if(delete u[e],o.parentNode&&o.parentNode.removeChild(o),n&&n.forEach(e=>e(r)),t)return t(r)},d=setTimeout(p.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=p.bind(null,o.onerror),o.onload=p.bind(null,o.onload),i&&document.head.appendChild(o)},c.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.g.importScripts&&(p=c.g.location+"");var s,l,u,p,d=c.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");c.p=p=p.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r={186:0},c.f.j=(e,t)=>{var n=c.o(r,e)?r[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var o=new Promise((t,o)=>n=r[e]=[t,o]);t.push(n[2]=o);var i=c.p+c.u(e),a=Error();c.l(i,t=>{if(c.o(r,e)&&(0!==(n=r[e])&&(r[e]=void 0),n)){var o=t&&("load"===t.type?"missing":t.type),i=t&&t.target&&t.target.src;a.message="Loading chunk "+e+` failed.
|
|
2
|
+
(`+o+": "+i+")",a.name="ChunkLoadError",a.type=o,a.request=i,n[1](a)}},"chunk-"+e,e)}},n=(e,t)=>{var n,o,[i,a,s]=t,l=0;if(i.some(e=>0!==r[e])){for(n in a)c.o(a,n)&&(c.m[n]=a[n]);s&&s(c)}for(e&&e(t);l<i.length;l++)o=i[l],c.o(r,o)&&r[o]&&r[o][0](),r[o]=0},(o=this.webpackChunk_tsparticles_interaction_external_bounce=this.webpackChunk_tsparticles_interaction_external_bounce||[]).forEach(n.bind(null,0)),o.push=n.bind(null,o.push.bind(o));var g={};c.r(g),c.d(g,{Bounce:()=>h.b,loadExternalBounceInteraction:()=>v});var h=c(701);async function v(e){e.checkVersion("4.0.0-beta.1"),await e.pluginManager.register(async e=>{let{ensureInteractivityPluginLoaded:t}=await Promise.resolve().then(c.t.bind(c,702,19));t(e),e.pluginManager.addInteractor?.("externalBounce",async e=>{let{Bouncer:t}=await c.e(624).then(c.bind(c,624));return new t(e)})})}return g})());
|
package/types/Bouncer.d.ts
CHANGED
|
@@ -2,7 +2,9 @@ import type { BounceContainer, BounceMode, IBounceMode } from "./Types.js";
|
|
|
2
2
|
import { ExternalInteractorBase, type IInteractivityData, type IModes, type InteractivityParticle, type Modes } from "@tsparticles/plugin-interactivity";
|
|
3
3
|
import { type RecursivePartial } from "@tsparticles/engine";
|
|
4
4
|
export declare class Bouncer extends ExternalInteractorBase<BounceContainer> {
|
|
5
|
+
private _maxDistance;
|
|
5
6
|
constructor(container: BounceContainer);
|
|
7
|
+
get maxDistance(): number;
|
|
6
8
|
clear(): void;
|
|
7
9
|
init(): void;
|
|
8
10
|
interact(interactivityData: IInteractivityData): void;
|
package/umd/Bouncer.js
CHANGED
|
@@ -16,8 +16,13 @@
|
|
|
16
16
|
const Bounce_js_1 = require("./Options/Classes/Bounce.js");
|
|
17
17
|
const bounceMode = "bounce";
|
|
18
18
|
class Bouncer extends plugin_interactivity_1.ExternalInteractorBase {
|
|
19
|
+
_maxDistance;
|
|
19
20
|
constructor(container) {
|
|
20
21
|
super(container);
|
|
22
|
+
this._maxDistance = 0;
|
|
23
|
+
}
|
|
24
|
+
get maxDistance() {
|
|
25
|
+
return this._maxDistance;
|
|
21
26
|
}
|
|
22
27
|
clear() {
|
|
23
28
|
}
|
|
@@ -26,6 +31,7 @@
|
|
|
26
31
|
if (!bounce) {
|
|
27
32
|
return;
|
|
28
33
|
}
|
|
34
|
+
this._maxDistance = bounce.distance;
|
|
29
35
|
container.retina.bounceModeDistance = bounce.distance * container.retina.pixelRatio;
|
|
30
36
|
}
|
|
31
37
|
interact(interactivityData) {
|
package/umd/Utils.js
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
const plugin_interactivity_1 = require("@tsparticles/plugin-interactivity");
|
|
17
17
|
const squareExp = 2, halfPI = Math.PI * engine_1.half, toleranceFactor = 10, minRadius = 0, minVelocity = 0;
|
|
18
18
|
function processBounce(container, position, radius, area, enabledCb) {
|
|
19
|
-
const query = container.particles.
|
|
19
|
+
const query = container.particles.grid.query(area, enabledCb);
|
|
20
20
|
for (const particle of query) {
|
|
21
21
|
if (area instanceof engine_1.Circle) {
|
|
22
22
|
(0, engine_1.circleBounce)((0, engine_1.circleBounceDataFromParticle)(particle), {
|
package/umd/index.js
CHANGED
|
@@ -48,11 +48,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
48
48
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49
49
|
exports.loadExternalBounceInteraction = loadExternalBounceInteraction;
|
|
50
50
|
async function loadExternalBounceInteraction(engine) {
|
|
51
|
-
engine.checkVersion("4.0.0-
|
|
52
|
-
await engine.register(async (e) => {
|
|
53
|
-
const {
|
|
54
|
-
|
|
55
|
-
e.addInteractor?.("externalBounce", async (container) => {
|
|
51
|
+
engine.checkVersion("4.0.0-beta.1");
|
|
52
|
+
await engine.pluginManager.register(async (e) => {
|
|
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
|
+
e.pluginManager.addInteractor?.("externalBounce", async (container) => {
|
|
56
56
|
const { Bouncer } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./Bouncer.js"))) : new Promise((resolve_2, reject_2) => { require(["./Bouncer.js"], resolve_2, reject_2); }).then(__importStar));
|
|
57
57
|
return new Bouncer(container);
|
|
58
58
|
});
|
package/820.min.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 820.min.js.LICENSE.txt */
|
|
2
|
-
(this.webpackChunk_tsparticles_interaction_external_bounce=this.webpackChunk_tsparticles_interaction_external_bounce||[]).push([[820],{820(t,e,i){i.d(e,{Bouncer:()=>d});var o=i(702),n=i(303);const c=Math.PI*n.half;function a(t,e,i,o,a){const r=t.particles.quadTree.query(o,a);for(const t of r)o instanceof n.Circle?(0,n.circleBounce)((0,n.circleBounceDataFromParticle)(t),{position:e,radius:i,mass:i**2*c,velocity:n.Vector.origin,factor:n.Vector.origin}):o instanceof n.Rectangle&&l(t,(0,n.calculateBounds)(e,i))}function r(t,e,i,c){(0,o.divModeExecute)(i,e,((e,i)=>{!function(t,e,i,c){const a=(0,n.safeDocument)().querySelectorAll(e);a.length&&a.forEach((e=>{const a=e,r=t.retina.pixelRatio,s={x:(a.offsetLeft+a.offsetWidth*n.half)*r,y:(a.offsetTop+a.offsetHeight*n.half)*r},l=a.offsetWidth*n.half*r,u=10*r,f=i.type===o.DivType.circle?new n.Circle(s.x,s.y,l+u):new n.Rectangle(a.offsetLeft*r-u,a.offsetTop*r-u,a.offsetWidth*r+u*n.double,a.offsetHeight*r+u*n.double);c(s,l,f)}))}(t,e,i,((e,i,o)=>{a(t,e,i,o,c)}))}))}function s(t){const e={bounced:!1},{pSide:i,pOtherSide:o,rectSide:c,rectOtherSide:a,velocity:r,factor:s}=t;return o.min<a.min||o.min>a.max||o.max<a.min||o.max>a.max||(i.max>=c.min&&i.max<=(c.max+c.min)*n.half&&r>0||i.min<=c.max&&i.min>(c.max+c.min)*n.half&&r<0)&&(e.velocity=r*-s,e.bounced=!0),e}function l(t,e){const i=t.getPosition(),o=t.getRadius(),c=(0,n.calculateBounds)(i,o),a=t.options.bounce,r=s({pSide:{min:c.left,max:c.right},pOtherSide:{min:c.top,max:c.bottom},rectSide:{min:e.left,max:e.right},rectOtherSide:{min:e.top,max:e.bottom},velocity:t.velocity.x,factor:(0,n.getRangeValue)(a.horizontal.value)});r.bounced&&(void 0!==r.velocity&&(t.velocity.x=r.velocity),void 0!==r.position&&(t.position.x=r.position));const l=s({pSide:{min:c.top,max:c.bottom},pOtherSide:{min:c.left,max:c.right},rectSide:{min:e.top,max:e.bottom},rectOtherSide:{min:e.left,max:e.right},velocity:t.velocity.y,factor:(0,n.getRangeValue)(a.vertical.value)});l.bounced&&(void 0!==l.velocity&&(t.velocity.y=l.velocity),void 0!==l.position&&(t.position.y=l.position))}var u=i(405);const f="bounce";class d extends o.ExternalInteractorBase{constructor(t){super(t)}clear(){}init(){const t=this.container,e=t.actualOptions.interactivity?.modes.bounce;e&&(t.retina.bounceModeDistance=e.distance*t.retina.pixelRatio)}interact(t){const e=this.container.actualOptions,i=e.interactivity?.events,c=t.status===o.mouseMoveEvent;if(!i)return;const s=i.onHover.enable,l=i.onHover.mode,u=i.onDiv;c&&s&&(0,n.isInArray)(f,l)?function(t,e,i){const o=10*t.retina.pixelRatio,c=e.mouse.position,r=t.retina.bounceModeDistance;!r||r<0||!c||a(t,c,r,new n.Circle(c.x,c.y,r+o),i)}(this.container,t,(e=>this.isEnabled(t,e))):r(this.container,u,f,(e=>this.isEnabled(t,e)))}isEnabled(t,e){const i=this.container.actualOptions,c=t.mouse,a=(e?.interactivity??i.interactivity)?.events;if(!a)return!1;const r=a.onDiv;return!!c.position&&a.onHover.enable&&(0,n.isInArray)(f,a.onHover.mode)||(0,o.isDivModeEnabled)(f,r)}loadModeOptions(t,...e){t.bounce??=new u.b;for(const i of e)t.bounce.load(i?.bounce)}reset(){}}}}]);
|
package/820.min.js.LICENSE.txt
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! tsParticles Bounce External Interaction v4.0.0-alpha.8 by Matteo Bruni */
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! tsParticles Bounce External Interaction v4.0.0-alpha.8 by Matteo Bruni */
|