@tsparticles/interaction-external-repulse 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/471.min.js +1 -0
- package/README.md +5 -0
- package/browser/Options/Classes/Repulse.js +1 -0
- package/browser/Options/Classes/RepulseBase.js +6 -0
- package/browser/Options/Classes/RepulseDiv.js +1 -0
- package/browser/Repulser.js +94 -79
- package/browser/index.js +7 -6
- package/cjs/Options/Classes/Repulse.js +1 -0
- package/cjs/Options/Classes/RepulseBase.js +6 -0
- package/cjs/Options/Classes/RepulseDiv.js +1 -0
- package/cjs/Repulser.js +94 -79
- package/cjs/index.js +7 -6
- package/dist_browser_Repulser_js.js +2 -2
- package/esm/Options/Classes/Repulse.js +1 -0
- package/esm/Options/Classes/RepulseBase.js +6 -0
- package/esm/Options/Classes/RepulseDiv.js +1 -0
- package/esm/Repulser.js +94 -79
- package/esm/index.js +7 -6
- package/package.json +3 -3
- package/report.html +84 -29
- package/tsparticles.interaction.external.repulse.js +45 -33
- package/tsparticles.interaction.external.repulse.min.js +2 -2
- package/types/Repulser.d.ts +7 -3
- package/umd/Options/Classes/Repulse.js +1 -0
- package/umd/Options/Classes/RepulseBase.js +6 -0
- package/umd/Options/Classes/RepulseDiv.js +1 -0
- package/umd/Repulser.js +94 -79
- package/umd/index.js +7 -6
- package/783.min.js +0 -2
- package/783.min.js.LICENSE.txt +0 -1
- package/tsparticles.interaction.external.repulse.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,13 +28,33 @@ return /******/ (() => { // webpackBootstrap
|
|
|
28
28
|
/******/ "use strict";
|
|
29
29
|
/******/ var __webpack_modules__ = ({
|
|
30
30
|
|
|
31
|
+
/***/ "@tsparticles/engine"
|
|
32
|
+
/*!*********************************************************************************************************************************!*\
|
|
33
|
+
!*** external {"commonjs":"@tsparticles/engine","commonjs2":"@tsparticles/engine","amd":"@tsparticles/engine","root":"window"} ***!
|
|
34
|
+
\*********************************************************************************************************************************/
|
|
35
|
+
(module) {
|
|
36
|
+
|
|
37
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
|
|
38
|
+
|
|
39
|
+
/***/ },
|
|
40
|
+
|
|
41
|
+
/***/ "@tsparticles/plugin-interactivity"
|
|
42
|
+
/*!***************************************************************************************************************************************************************************!*\
|
|
43
|
+
!*** external {"commonjs":"@tsparticles/plugin-interactivity","commonjs2":"@tsparticles/plugin-interactivity","amd":"@tsparticles/plugin-interactivity","root":"window"} ***!
|
|
44
|
+
\***************************************************************************************************************************************************************************/
|
|
45
|
+
(module) {
|
|
46
|
+
|
|
47
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_interactivity__;
|
|
48
|
+
|
|
49
|
+
/***/ },
|
|
50
|
+
|
|
31
51
|
/***/ "./dist/browser/Options/Classes/Repulse.js"
|
|
32
52
|
/*!*************************************************!*\
|
|
33
53
|
!*** ./dist/browser/Options/Classes/Repulse.js ***!
|
|
34
54
|
\*************************************************/
|
|
35
55
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
36
56
|
|
|
37
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Repulse: () => (/* binding */ Repulse)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _RepulseBase_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./RepulseBase.js */ \"./dist/browser/Options/Classes/RepulseBase.js\");\n/* harmony import */ var _RepulseDiv_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./RepulseDiv.js */ \"./dist/browser/Options/Classes/RepulseDiv.js\");\n\n\n\nclass Repulse extends _RepulseBase_js__WEBPACK_IMPORTED_MODULE_1__.RepulseBase {\n
|
|
57
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Repulse: () => (/* binding */ Repulse)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _RepulseBase_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./RepulseBase.js */ \"./dist/browser/Options/Classes/RepulseBase.js\");\n/* harmony import */ var _RepulseDiv_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./RepulseDiv.js */ \"./dist/browser/Options/Classes/RepulseDiv.js\");\n\n\n\nclass Repulse extends _RepulseBase_js__WEBPACK_IMPORTED_MODULE_1__.RepulseBase {\n divs;\n load(data) {\n super.load(data);\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n this.divs = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.executeOnSingleOrMultiple)(data.divs, (div)=>{\n const tmp = new _RepulseDiv_js__WEBPACK_IMPORTED_MODULE_2__.RepulseDiv();\n tmp.load(div);\n return tmp;\n });\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/interaction-external-repulse/./dist/browser/Options/Classes/Repulse.js?\n}");
|
|
38
58
|
|
|
39
59
|
/***/ },
|
|
40
60
|
|
|
@@ -44,7 +64,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
44
64
|
\*****************************************************/
|
|
45
65
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
46
66
|
|
|
47
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ RepulseBase: () => (/* binding */ RepulseBase)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nclass RepulseBase {\n
|
|
67
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ RepulseBase: () => (/* binding */ RepulseBase)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nclass RepulseBase {\n distance;\n duration;\n easing;\n factor;\n maxSpeed;\n speed;\n constructor(){\n this.distance = 200;\n this.duration = 0.4;\n this.factor = 100;\n this.speed = 1;\n this.maxSpeed = 50;\n this.easing = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.EasingType.easeOutQuad;\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 if (data.duration !== undefined) {\n this.duration = data.duration;\n }\n if (data.easing !== undefined) {\n this.easing = data.easing;\n }\n if (data.factor !== undefined) {\n this.factor = data.factor;\n }\n if (data.speed !== undefined) {\n this.speed = data.speed;\n }\n if (data.maxSpeed !== undefined) {\n this.maxSpeed = data.maxSpeed;\n }\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/interaction-external-repulse/./dist/browser/Options/Classes/RepulseBase.js?\n}");
|
|
48
68
|
|
|
49
69
|
/***/ },
|
|
50
70
|
|
|
@@ -54,7 +74,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
54
74
|
\****************************************************/
|
|
55
75
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
56
76
|
|
|
57
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ RepulseDiv: () => (/* binding */ RepulseDiv)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _RepulseBase_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./RepulseBase.js */ \"./dist/browser/Options/Classes/RepulseBase.js\");\n\n\nclass RepulseDiv extends _RepulseBase_js__WEBPACK_IMPORTED_MODULE_1__.RepulseBase {\n
|
|
77
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ RepulseDiv: () => (/* binding */ RepulseDiv)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _RepulseBase_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./RepulseBase.js */ \"./dist/browser/Options/Classes/RepulseBase.js\");\n\n\nclass RepulseDiv extends _RepulseBase_js__WEBPACK_IMPORTED_MODULE_1__.RepulseBase {\n selectors;\n constructor(){\n super();\n this.selectors = [];\n }\n load(data) {\n super.load(data);\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n if (data.selectors !== undefined) {\n this.selectors = data.selectors;\n }\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/interaction-external-repulse/./dist/browser/Options/Classes/RepulseDiv.js?\n}");
|
|
58
78
|
|
|
59
79
|
/***/ },
|
|
60
80
|
|
|
@@ -64,27 +84,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
64
84
|
\*******************************/
|
|
65
85
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
66
86
|
|
|
67
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Repulse: () => (/* reexport safe */ _Options_Classes_Repulse_js__WEBPACK_IMPORTED_MODULE_2__.Repulse),\n/* harmony export */ RepulseBase: () => (/* reexport safe */ _Options_Classes_RepulseBase_js__WEBPACK_IMPORTED_MODULE_0__.RepulseBase),\n/* harmony export */ RepulseDiv: () => (/* reexport safe */ _Options_Classes_RepulseDiv_js__WEBPACK_IMPORTED_MODULE_1__.RepulseDiv),\n/* harmony export */ loadExternalRepulseInteraction: () => (/* binding */ loadExternalRepulseInteraction)\n/* harmony export */ });\n/* harmony import */ var _Options_Classes_RepulseBase_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Options/Classes/RepulseBase.js */ \"./dist/browser/Options/Classes/RepulseBase.js\");\n/* harmony import */ var _Options_Classes_RepulseDiv_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Options/Classes/RepulseDiv.js */ \"./dist/browser/Options/Classes/RepulseDiv.js\");\n/* harmony import */ var _Options_Classes_Repulse_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Options/Classes/Repulse.js */ \"./dist/browser/Options/Classes/Repulse.js\");\nasync function loadExternalRepulseInteraction(engine) {\n
|
|
68
|
-
|
|
69
|
-
/***/ },
|
|
70
|
-
|
|
71
|
-
/***/ "@tsparticles/engine"
|
|
72
|
-
/*!*********************************************************************************************************************************!*\
|
|
73
|
-
!*** external {"commonjs":"@tsparticles/engine","commonjs2":"@tsparticles/engine","amd":"@tsparticles/engine","root":"window"} ***!
|
|
74
|
-
\*********************************************************************************************************************************/
|
|
75
|
-
(module) {
|
|
76
|
-
|
|
77
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
|
|
78
|
-
|
|
79
|
-
/***/ },
|
|
80
|
-
|
|
81
|
-
/***/ "@tsparticles/plugin-interactivity"
|
|
82
|
-
/*!***************************************************************************************************************************************************************************!*\
|
|
83
|
-
!*** external {"commonjs":"@tsparticles/plugin-interactivity","commonjs2":"@tsparticles/plugin-interactivity","amd":"@tsparticles/plugin-interactivity","root":"window"} ***!
|
|
84
|
-
\***************************************************************************************************************************************************************************/
|
|
85
|
-
(module) {
|
|
86
|
-
|
|
87
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_interactivity__;
|
|
87
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Repulse: () => (/* reexport safe */ _Options_Classes_Repulse_js__WEBPACK_IMPORTED_MODULE_2__.Repulse),\n/* harmony export */ RepulseBase: () => (/* reexport safe */ _Options_Classes_RepulseBase_js__WEBPACK_IMPORTED_MODULE_0__.RepulseBase),\n/* harmony export */ RepulseDiv: () => (/* reexport safe */ _Options_Classes_RepulseDiv_js__WEBPACK_IMPORTED_MODULE_1__.RepulseDiv),\n/* harmony export */ loadExternalRepulseInteraction: () => (/* binding */ loadExternalRepulseInteraction)\n/* harmony export */ });\n/* harmony import */ var _Options_Classes_RepulseBase_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Options/Classes/RepulseBase.js */ \"./dist/browser/Options/Classes/RepulseBase.js\");\n/* harmony import */ var _Options_Classes_RepulseDiv_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Options/Classes/RepulseDiv.js */ \"./dist/browser/Options/Classes/RepulseDiv.js\");\n/* harmony import */ var _Options_Classes_Repulse_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Options/Classes/Repulse.js */ \"./dist/browser/Options/Classes/Repulse.js\");\nasync function loadExternalRepulseInteraction(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 const pluginManager = e.pluginManager;\n pluginManager.addInteractor?.(\"externalRepulse\", async (container)=>{\n const { Repulser } = await __webpack_require__.e(/*! import() */ \"dist_browser_Repulser_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./Repulser.js */ \"./dist/browser/Repulser.js\"));\n return new Repulser(pluginManager, container);\n });\n });\n}\n\n\n\n\n\n//# sourceURL=webpack://@tsparticles/interaction-external-repulse/./dist/browser/index.js?\n}");
|
|
88
88
|
|
|
89
89
|
/***/ }
|
|
90
90
|
|
|
@@ -100,12 +100,6 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_interactivity__;
|
|
|
100
100
|
/******/ if (cachedModule !== undefined) {
|
|
101
101
|
/******/ return cachedModule.exports;
|
|
102
102
|
/******/ }
|
|
103
|
-
/******/ // Check if module exists (development only)
|
|
104
|
-
/******/ if (__webpack_modules__[moduleId] === undefined) {
|
|
105
|
-
/******/ var e = new Error("Cannot find module '" + moduleId + "'");
|
|
106
|
-
/******/ e.code = 'MODULE_NOT_FOUND';
|
|
107
|
-
/******/ throw e;
|
|
108
|
-
/******/ }
|
|
109
103
|
/******/ // Create a new module (and put it into the cache)
|
|
110
104
|
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
111
105
|
/******/ // no module.id needed
|
|
@@ -114,6 +108,12 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_interactivity__;
|
|
|
114
108
|
/******/ };
|
|
115
109
|
/******/
|
|
116
110
|
/******/ // Execute the module function
|
|
111
|
+
/******/ if (!(moduleId in __webpack_modules__)) {
|
|
112
|
+
/******/ delete __webpack_module_cache__[moduleId];
|
|
113
|
+
/******/ var e = new Error("Cannot find module '" + moduleId + "'");
|
|
114
|
+
/******/ e.code = 'MODULE_NOT_FOUND';
|
|
115
|
+
/******/ throw e;
|
|
116
|
+
/******/ }
|
|
117
117
|
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
118
118
|
/******/
|
|
119
119
|
/******/ // Return the exports of the module
|
|
@@ -188,6 +188,18 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_interactivity__;
|
|
|
188
188
|
/******/ };
|
|
189
189
|
/******/ })();
|
|
190
190
|
/******/
|
|
191
|
+
/******/ /* webpack/runtime/global */
|
|
192
|
+
/******/ (() => {
|
|
193
|
+
/******/ __webpack_require__.g = (function() {
|
|
194
|
+
/******/ if (typeof globalThis === 'object') return globalThis;
|
|
195
|
+
/******/ try {
|
|
196
|
+
/******/ return this || new Function('return this')();
|
|
197
|
+
/******/ } catch (e) {
|
|
198
|
+
/******/ if (typeof window === 'object') return window;
|
|
199
|
+
/******/ }
|
|
200
|
+
/******/ })();
|
|
201
|
+
/******/ })();
|
|
202
|
+
/******/
|
|
191
203
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
192
204
|
/******/ (() => {
|
|
193
205
|
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
@@ -252,8 +264,8 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_interactivity__;
|
|
|
252
264
|
/******/ /* webpack/runtime/publicPath */
|
|
253
265
|
/******/ (() => {
|
|
254
266
|
/******/ var scriptUrl;
|
|
255
|
-
/******/ if (
|
|
256
|
-
/******/ var document =
|
|
267
|
+
/******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
|
|
268
|
+
/******/ var document = __webpack_require__.g.document;
|
|
257
269
|
/******/ if (!scriptUrl && document) {
|
|
258
270
|
/******/ if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')
|
|
259
271
|
/******/ 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 i in r)("object"==typeof exports?exports:e)[i]=r[i]}}(this,(e,t)=>(()=>{"use strict";var r,i,o,n={303(t){t.exports=e},702(e){e.exports=t},991(e,t,r){r.d(t,{Z:()=>a});var i=r(303),o=r(542),n=r(320);class a extends o._{divs;load(e){super.load(e),(0,i.isNull)(e)||(this.divs=(0,i.executeOnSingleOrMultiple)(e.divs,e=>{let t=new n.W;return t.load(e),t}))}}},542(e,t,r){r.d(t,{_:()=>o});var i=r(303);class o{distance;duration;easing;factor;maxSpeed;speed;constructor(){this.distance=200,this.duration=.4,this.factor=100,this.speed=1,this.maxSpeed=50,this.easing=i.EasingType.easeOutQuad}load(e){(0,i.isNull)(e)||(void 0!==e.distance&&(this.distance=e.distance),void 0!==e.duration&&(this.duration=e.duration),void 0!==e.easing&&(this.easing=e.easing),void 0!==e.factor&&(this.factor=e.factor),void 0!==e.speed&&(this.speed=e.speed),void 0!==e.maxSpeed&&(this.maxSpeed=e.maxSpeed))}}},320(e,t,r){r.d(t,{W:()=>n});var i=r(303),o=r(542);class n extends o._{selectors;constructor(){super(),this.selectors=[]}load(e){super.load(e),(0,i.isNull)(e)||void 0!==e.selectors&&(this.selectors=e.selectors)}}}},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,c=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 i={};l=l||[null,c({}),c([]),c(c)];for(var o=2&t&&e;("object"==typeof o||"function"==typeof o)&&!~l.indexOf(o);o=c(o))Object.getOwnPropertyNames(o).forEach(t=>i[t]=()=>e[t]);return i.default=()=>e,s.d(r,i),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),p={},s.l=(e,t,r,i)=>{if(p[e])return void p[e].push(t);if(void 0!==r)for(var o,n,a=document.getElementsByTagName("script"),l=0;l<a.length;l++){var c=a[l];if(c.getAttribute("src")==e||c.getAttribute("data-webpack")=="@tsparticles/interaction-external-repulse:"+r){o=c;break}}o||(n=!0,(o=document.createElement("script")).charset="utf-8",s.nc&&o.setAttribute("nonce",s.nc),o.setAttribute("data-webpack","@tsparticles/interaction-external-repulse:"+r),o.src=e),p[e]=[t];var u=(t,r)=>{o.onerror=o.onload=null,clearTimeout(d);var i=p[e];if(delete p[e],o.parentNode&&o.parentNode.removeChild(o),i&&i.forEach(e=>e(r)),t)return t(r)},d=setTimeout(u.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=u.bind(null,o.onerror),o.onload=u.bind(null,o.onload),n&&document.head.appendChild(o)},s.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.g.importScripts&&(u=s.g.location+"");var l,c,p,u,d=s.g.document;if(!u&&d&&(d.currentScript&&"SCRIPT"===d.currentScript.tagName.toUpperCase()&&(u=d.currentScript.src),!u)){var f=d.getElementsByTagName("script");if(f.length)for(var h=f.length-1;h>-1&&(!u||!/^http(s?):/.test(u));)u=f[h--].src}if(!u)throw Error("Automatic publicPath is not supported in this browser");s.p=u=u.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r={64:0},s.f.j=(e,t)=>{var i=s.o(r,e)?r[e]:void 0;if(0!==i)if(i)t.push(i[2]);else{var o=new Promise((t,o)=>i=r[e]=[t,o]);t.push(i[2]=o);var n=s.p+s.u(e),a=Error();s.l(n,t=>{if(s.o(r,e)&&(0!==(i=r[e])&&(r[e]=void 0),i)){var o=t&&("load"===t.type?"missing":t.type),n=t&&t.target&&t.target.src;a.message="Loading chunk "+e+` failed.
|
|
2
|
+
(`+o+": "+n+")",a.name="ChunkLoadError",a.type=o,a.request=n,i[1](a)}},"chunk-"+e,e)}},i=(e,t)=>{var i,o,[n,a,l]=t,c=0;if(n.some(e=>0!==r[e])){for(i in a)s.o(a,i)&&(s.m[i]=a[i]);l&&l(s)}for(e&&e(t);c<n.length;c++)o=n[c],s.o(r,o)&&r[o]&&r[o][0](),r[o]=0},(o=this.webpackChunk_tsparticles_interaction_external_repulse=this.webpackChunk_tsparticles_interaction_external_repulse||[]).forEach(i.bind(null,0)),o.push=i.bind(null,o.push.bind(o));var v={};s.r(v),s.d(v,{Repulse:()=>m.Z,RepulseBase:()=>g._,RepulseDiv:()=>b.W,loadExternalRepulseInteraction:()=>y});var g=s(542),b=s(320),m=s(991);async function y(e){e.checkVersion("4.0.0-beta.1"),await e.pluginManager.register(async e=>{let{ensureInteractivityPluginLoaded:t}=await Promise.resolve().then(s.t.bind(s,702,19));t(e);let r=e.pluginManager;r.addInteractor?.("externalRepulse",async e=>{let{Repulser:t}=await s.e(471).then(s.bind(s,471));return new t(r,e)})})}return v})());
|
package/types/Repulser.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type PluginManager, type RecursivePartial } from "@tsparticles/engine";
|
|
2
2
|
import { ExternalInteractorBase, type IInteractivityData, type IModes, type InteractivityParticle, type Modes } from "@tsparticles/plugin-interactivity";
|
|
3
3
|
import type { IRepulseMode, RepulseContainer, RepulseMode } from "./Types.js";
|
|
4
4
|
export declare class Repulser extends ExternalInteractorBase<RepulseContainer> {
|
|
5
5
|
handleClickMode: (mode: string, interactivityData: IInteractivityData) => void;
|
|
6
|
-
private readonly
|
|
7
|
-
|
|
6
|
+
private readonly _clickVec;
|
|
7
|
+
private _maxDistance;
|
|
8
|
+
private readonly _normVec;
|
|
9
|
+
private readonly _pluginManager;
|
|
10
|
+
constructor(pluginManager: PluginManager, container: RepulseContainer);
|
|
11
|
+
get maxDistance(): number;
|
|
8
12
|
clear(): void;
|
|
9
13
|
init(): void;
|
|
10
14
|
interact(interactivityData: IInteractivityData): void;
|
package/umd/Repulser.js
CHANGED
|
@@ -15,86 +15,17 @@
|
|
|
15
15
|
const Repulse_js_1 = require("./Options/Classes/Repulse.js");
|
|
16
16
|
const repulseMode = "repulse", minDistance = 0, repulseRadiusFactor = 6, repulseRadiusPower = 3, squarePower = 2, minRadius = 0, minSpeed = 0, easingOffset = 1;
|
|
17
17
|
class Repulser extends plugin_interactivity_1.ExternalInteractorBase {
|
|
18
|
-
|
|
18
|
+
handleClickMode;
|
|
19
|
+
_clickVec;
|
|
20
|
+
_maxDistance;
|
|
21
|
+
_normVec;
|
|
22
|
+
_pluginManager;
|
|
23
|
+
constructor(pluginManager, container) {
|
|
19
24
|
super(container);
|
|
20
|
-
this.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
const repulse = container.repulse ?? { particles: [] };
|
|
26
|
-
if (!repulse.finish) {
|
|
27
|
-
repulse.count ??= 0;
|
|
28
|
-
repulse.count++;
|
|
29
|
-
if (repulse.count === container.particles.count) {
|
|
30
|
-
repulse.finish = true;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
if (repulse.clicking) {
|
|
34
|
-
const repulseDistance = container.retina.repulseModeDistance;
|
|
35
|
-
if (!repulseDistance || repulseDistance < minDistance) {
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
const repulseRadius = Math.pow(repulseDistance / repulseRadiusFactor, repulseRadiusPower), mouseClickPos = interactivityData.mouse.clickPosition;
|
|
39
|
-
if (mouseClickPos === undefined) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
const range = new engine_1.Circle(mouseClickPos.x, mouseClickPos.y, repulseRadius), query = container.particles.quadTree.query(range, p => this.isEnabled(interactivityData, p));
|
|
43
|
-
for (const particle of query) {
|
|
44
|
-
const { dx, dy, distance } = (0, engine_1.getDistances)(mouseClickPos, particle.position), d = distance ** squarePower, velocity = repulseOptions.speed, force = (-repulseRadius * velocity) / d;
|
|
45
|
-
if (d <= repulseRadius) {
|
|
46
|
-
repulse.particles.push(particle);
|
|
47
|
-
const vect = engine_1.Vector.create(dx, dy);
|
|
48
|
-
vect.length = force;
|
|
49
|
-
particle.velocity.setTo(vect);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
else if (repulse.clicking === false) {
|
|
54
|
-
for (const particle of repulse.particles) {
|
|
55
|
-
particle.velocity.setTo(particle.initialVelocity);
|
|
56
|
-
}
|
|
57
|
-
repulse.particles = [];
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
this._hoverRepulse = interactivityData => {
|
|
61
|
-
const container = this.container, mousePos = interactivityData.mouse.position, repulseRadius = container.retina.repulseModeDistance;
|
|
62
|
-
if (!repulseRadius || repulseRadius < minRadius || !mousePos) {
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
this._processRepulse(interactivityData, mousePos, repulseRadius, new engine_1.Circle(mousePos.x, mousePos.y, repulseRadius));
|
|
66
|
-
};
|
|
67
|
-
this._processRepulse = (interactivityData, position, repulseRadius, area, divRepulse) => {
|
|
68
|
-
const container = this.container, query = container.particles.quadTree.query(area, p => this.isEnabled(interactivityData, p)), repulseOptions = container.actualOptions.interactivity?.modes.repulse;
|
|
69
|
-
if (!repulseOptions) {
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
const { easing, speed, factor, maxSpeed } = repulseOptions, easingFunc = this._engine.getEasing(easing), velocity = (divRepulse?.speed ?? speed) * factor;
|
|
73
|
-
for (const particle of query) {
|
|
74
|
-
const { dx, dy, distance } = (0, engine_1.getDistances)(particle.position, position), repulseFactor = (0, engine_1.clamp)(easingFunc(easingOffset - distance / repulseRadius) * velocity, minSpeed, maxSpeed), normVec = engine_1.Vector.create(!distance ? velocity : (dx / distance) * repulseFactor, !distance ? velocity : (dy / distance) * repulseFactor);
|
|
75
|
-
particle.position.addTo(normVec);
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
this._singleSelectorRepulse = (interactivityData, selector, div) => {
|
|
79
|
-
const container = this.container, repulse = container.actualOptions.interactivity?.modes.repulse;
|
|
80
|
-
if (!repulse) {
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
const query = (0, engine_1.safeDocument)().querySelectorAll(selector);
|
|
84
|
-
if (!query.length) {
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
query.forEach(item => {
|
|
88
|
-
const elem = item, pxRatio = container.retina.pixelRatio, pos = {
|
|
89
|
-
x: (elem.offsetLeft + elem.offsetWidth * engine_1.half) * pxRatio,
|
|
90
|
-
y: (elem.offsetTop + elem.offsetHeight * engine_1.half) * pxRatio,
|
|
91
|
-
}, repulseRadius = elem.offsetWidth * engine_1.half * pxRatio, area = div.type === plugin_interactivity_1.DivType.circle
|
|
92
|
-
? new engine_1.Circle(pos.x, pos.y, repulseRadius)
|
|
93
|
-
: new engine_1.Rectangle(elem.offsetLeft * pxRatio, elem.offsetTop * pxRatio, elem.offsetWidth * pxRatio, elem.offsetHeight * pxRatio), divs = repulse.divs, divRepulse = (0, plugin_interactivity_1.divMode)(divs, elem);
|
|
94
|
-
this._processRepulse(interactivityData, pos, repulseRadius, area, divRepulse);
|
|
95
|
-
});
|
|
96
|
-
};
|
|
97
|
-
this._engine = engine;
|
|
25
|
+
this._pluginManager = pluginManager;
|
|
26
|
+
this._maxDistance = 0;
|
|
27
|
+
this._normVec = engine_1.Vector.origin;
|
|
28
|
+
this._clickVec = engine_1.Vector.origin;
|
|
98
29
|
container.repulse ??= { particles: [] };
|
|
99
30
|
this.handleClickMode = (mode, interactivityData) => {
|
|
100
31
|
const options = this.container.actualOptions, repulseOpts = options.interactivity?.modes.repulse;
|
|
@@ -121,6 +52,9 @@
|
|
|
121
52
|
}, repulseOpts.duration * engine_1.millisecondsToSeconds);
|
|
122
53
|
};
|
|
123
54
|
}
|
|
55
|
+
get maxDistance() {
|
|
56
|
+
return this._maxDistance;
|
|
57
|
+
}
|
|
124
58
|
clear() {
|
|
125
59
|
}
|
|
126
60
|
init() {
|
|
@@ -128,6 +62,7 @@
|
|
|
128
62
|
if (!repulse) {
|
|
129
63
|
return;
|
|
130
64
|
}
|
|
65
|
+
this._maxDistance = repulse.distance;
|
|
131
66
|
container.retina.repulseModeDistance = repulse.distance * container.retina.pixelRatio;
|
|
132
67
|
}
|
|
133
68
|
interact(interactivityData) {
|
|
@@ -168,6 +103,86 @@
|
|
|
168
103
|
}
|
|
169
104
|
reset() {
|
|
170
105
|
}
|
|
106
|
+
_clickRepulse = interactivityData => {
|
|
107
|
+
const container = this.container, repulseOptions = container.actualOptions.interactivity?.modes.repulse;
|
|
108
|
+
if (!repulseOptions) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
const repulse = container.repulse ?? { particles: [] };
|
|
112
|
+
if (!repulse.finish) {
|
|
113
|
+
repulse.count ??= 0;
|
|
114
|
+
repulse.count++;
|
|
115
|
+
if (repulse.count === container.particles.count) {
|
|
116
|
+
repulse.finish = true;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
if (repulse.clicking) {
|
|
120
|
+
const repulseDistance = container.retina.repulseModeDistance;
|
|
121
|
+
if (!repulseDistance || repulseDistance < minDistance) {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
const repulseRadius = Math.pow(repulseDistance / repulseRadiusFactor, repulseRadiusPower), mouseClickPos = interactivityData.mouse.clickPosition;
|
|
125
|
+
if (mouseClickPos === undefined) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
const range = new engine_1.Circle(mouseClickPos.x, mouseClickPos.y, repulseRadius), query = container.particles.grid.query(range, p => this.isEnabled(interactivityData, p));
|
|
129
|
+
for (const particle of query) {
|
|
130
|
+
const { dx, dy, distance } = (0, engine_1.getDistances)(mouseClickPos, particle.position), d = distance ** squarePower, velocity = repulseOptions.speed, force = (-repulseRadius * velocity) / d;
|
|
131
|
+
if (d <= repulseRadius) {
|
|
132
|
+
repulse.particles.push(particle);
|
|
133
|
+
this._clickVec.x = dx;
|
|
134
|
+
this._clickVec.y = dy;
|
|
135
|
+
this._clickVec.length = force;
|
|
136
|
+
particle.velocity.setTo(this._clickVec);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
else if (repulse.clicking === false) {
|
|
141
|
+
for (const particle of repulse.particles) {
|
|
142
|
+
particle.velocity.setTo(particle.initialVelocity);
|
|
143
|
+
}
|
|
144
|
+
repulse.particles = [];
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
_hoverRepulse = interactivityData => {
|
|
148
|
+
const container = this.container, mousePos = interactivityData.mouse.position, repulseRadius = container.retina.repulseModeDistance;
|
|
149
|
+
if (!repulseRadius || repulseRadius < minRadius || !mousePos) {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
this._processRepulse(interactivityData, mousePos, repulseRadius, new engine_1.Circle(mousePos.x, mousePos.y, repulseRadius));
|
|
153
|
+
};
|
|
154
|
+
_processRepulse = (interactivityData, position, repulseRadius, area, divRepulse) => {
|
|
155
|
+
const container = this.container, query = container.particles.grid.query(area, p => this.isEnabled(interactivityData, p)), repulseOptions = container.actualOptions.interactivity?.modes.repulse;
|
|
156
|
+
if (!repulseOptions) {
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
const { easing, speed, factor, maxSpeed } = repulseOptions, easingFunc = this._pluginManager.getEasing(easing), velocity = (divRepulse?.speed ?? speed) * factor;
|
|
160
|
+
for (const particle of query) {
|
|
161
|
+
const { dx, dy, distance } = (0, engine_1.getDistances)(particle.position, position), repulseFactor = (0, engine_1.clamp)(easingFunc(easingOffset - distance / repulseRadius) * velocity, minSpeed, maxSpeed);
|
|
162
|
+
this._normVec.x = !distance ? velocity : (dx / distance) * repulseFactor;
|
|
163
|
+
this._normVec.y = !distance ? velocity : (dy / distance) * repulseFactor;
|
|
164
|
+
particle.position.addTo(this._normVec);
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
_singleSelectorRepulse = (interactivityData, selector, div) => {
|
|
168
|
+
const container = this.container, repulse = container.actualOptions.interactivity?.modes.repulse;
|
|
169
|
+
if (!repulse) {
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
const query = (0, engine_1.safeDocument)().querySelectorAll(selector);
|
|
173
|
+
if (!query.length) {
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
query.forEach(item => {
|
|
177
|
+
const elem = item, pxRatio = container.retina.pixelRatio, pos = {
|
|
178
|
+
x: (elem.offsetLeft + elem.offsetWidth * engine_1.half) * pxRatio,
|
|
179
|
+
y: (elem.offsetTop + elem.offsetHeight * engine_1.half) * pxRatio,
|
|
180
|
+
}, repulseRadius = elem.offsetWidth * engine_1.half * pxRatio, area = div.type === plugin_interactivity_1.DivType.circle
|
|
181
|
+
? new engine_1.Circle(pos.x, pos.y, repulseRadius)
|
|
182
|
+
: new engine_1.Rectangle(elem.offsetLeft * pxRatio, elem.offsetTop * pxRatio, elem.offsetWidth * pxRatio, elem.offsetHeight * pxRatio), divs = repulse.divs, divRepulse = (0, plugin_interactivity_1.divMode)(divs, elem);
|
|
183
|
+
this._processRepulse(interactivityData, pos, repulseRadius, area, divRepulse);
|
|
184
|
+
});
|
|
185
|
+
};
|
|
171
186
|
}
|
|
172
187
|
exports.Repulser = Repulser;
|
|
173
188
|
});
|
package/umd/index.js
CHANGED
|
@@ -48,13 +48,14 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
48
48
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49
49
|
exports.loadExternalRepulseInteraction = loadExternalRepulseInteraction;
|
|
50
50
|
async function loadExternalRepulseInteraction(engine) {
|
|
51
|
-
engine.checkVersion("4.0.0-
|
|
52
|
-
await engine.register(async (e) => {
|
|
53
|
-
const {
|
|
54
|
-
|
|
55
|
-
|
|
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
|
+
const pluginManager = e.pluginManager;
|
|
56
|
+
pluginManager.addInteractor?.("externalRepulse", async (container) => {
|
|
56
57
|
const { Repulser } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./Repulser.js"))) : new Promise((resolve_2, reject_2) => { require(["./Repulser.js"], resolve_2, reject_2); }).then(__importStar));
|
|
57
|
-
return new Repulser(
|
|
58
|
+
return new Repulser(pluginManager, container);
|
|
58
59
|
});
|
|
59
60
|
});
|
|
60
61
|
}
|
package/783.min.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 783.min.js.LICENSE.txt */
|
|
2
|
-
(this.webpackChunk_tsparticles_interaction_external_repulse=this.webpackChunk_tsparticles_interaction_external_repulse||[]).push([[783],{783(e,t,i){i.d(t,{Repulser:()=>r});var s=i(303),n=i(702),o=i(591);const c="repulse";class r extends n.ExternalInteractorBase{constructor(e,t){super(t),this._clickRepulse=e=>{const t=this.container,i=t.actualOptions.interactivity?.modes.repulse;if(!i)return;const n=t.repulse??{particles:[]};if(n.finish||(n.count??=0,n.count++,n.count===t.particles.count&&(n.finish=!0)),n.clicking){const o=t.retina.repulseModeDistance;if(!o||o<0)return;const c=Math.pow(o/6,3),r=e.mouse.clickPosition;if(void 0===r)return;const a=new s.Circle(r.x,r.y,c),l=t.particles.quadTree.query(a,(t=>this.isEnabled(e,t)));for(const e of l){const{dx:t,dy:o,distance:a}=(0,s.getDistances)(r,e.position),l=a**2,p=-c*i.speed/l;if(l<=c){n.particles.push(e);const i=s.Vector.create(t,o);i.length=p,e.velocity.setTo(i)}}}else if(!1===n.clicking){for(const e of n.particles)e.velocity.setTo(e.initialVelocity);n.particles=[]}},this._hoverRepulse=e=>{const t=this.container,i=e.mouse.position,n=t.retina.repulseModeDistance;!n||n<0||!i||this._processRepulse(e,i,n,new s.Circle(i.x,i.y,n))},this._processRepulse=(e,t,i,n,o)=>{const c=this.container,r=c.particles.quadTree.query(n,(t=>this.isEnabled(e,t))),a=c.actualOptions.interactivity?.modes.repulse;if(!a)return;const{easing:l,speed:p,factor:u,maxSpeed:d}=a,f=this._engine.getEasing(l),h=(o?.speed??p)*u;for(const e of r){const{dx:n,dy:o,distance:c}=(0,s.getDistances)(e.position,t),r=(0,s.clamp)(f(1-c/i)*h,0,d),a=s.Vector.create(c?n/c*r:h,c?o/c*r:h);e.position.addTo(a)}},this._singleSelectorRepulse=(e,t,i)=>{const o=this.container,c=o.actualOptions.interactivity?.modes.repulse;if(!c)return;const r=(0,s.safeDocument)().querySelectorAll(t);r.length&&r.forEach((t=>{const r=t,a=o.retina.pixelRatio,l={x:(r.offsetLeft+r.offsetWidth*s.half)*a,y:(r.offsetTop+r.offsetHeight*s.half)*a},p=r.offsetWidth*s.half*a,u=i.type===n.DivType.circle?new s.Circle(l.x,l.y,p):new s.Rectangle(r.offsetLeft*a,r.offsetTop*a,r.offsetWidth*a,r.offsetHeight*a),d=c.divs,f=(0,n.divMode)(d,r);this._processRepulse(e,l,p,u,f)}))},this._engine=e,t.repulse??={particles:[]},this.handleClickMode=(e,i)=>{const n=this.container.actualOptions,o=n.interactivity?.modes.repulse;if(!o||e!==c)return;t.repulse??={particles:[]};const r=t.repulse;r.clicking=!0,r.count=0;for(const e of t.repulse.particles)this.isEnabled(i,e)&&e.velocity.setTo(e.initialVelocity);r.particles=[],r.finish=!1,setTimeout((()=>{t.destroyed||(r.clicking=!1)}),o.duration*s.millisecondsToSeconds)}}clear(){}init(){const e=this.container,t=e.actualOptions.interactivity?.modes.repulse;t&&(e.retina.repulseModeDistance=t.distance*e.retina.pixelRatio)}interact(e){const t=this.container.actualOptions,i=e.status===n.mouseMoveEvent,o=t.interactivity?.events;if(!o)return;const r=o.onHover,a=r.enable,l=r.mode,p=o.onClick,u=p.enable,d=p.mode,f=o.onDiv;i&&a&&(0,s.isInArray)(c,l)?this._hoverRepulse(e):u&&(0,s.isInArray)(c,d)?this._clickRepulse(e):(0,n.divModeExecute)(c,f,((t,i)=>{this._singleSelectorRepulse(e,t,i)}))}isEnabled(e,t){const i=this.container.actualOptions,o=e.mouse,r=(t?.interactivity??i.interactivity)?.events;if(!r)return!1;const a=r.onDiv,l=r.onHover,p=r.onClick,u=(0,n.isDivModeEnabled)(c,a);if(!(u||l.enable&&o.position||p.enable&&o.clickPosition))return!1;const d=l.mode,f=p.mode;return(0,s.isInArray)(c,d)||(0,s.isInArray)(c,f)||u}loadModeOptions(e,...t){e.repulse??=new o.Z;for(const i of t)e.repulse.load(i?.repulse)}reset(){}}}}]);
|
package/783.min.js.LICENSE.txt
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! tsParticles Repulse External Interaction v4.0.0-alpha.8 by Matteo Bruni */
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! tsParticles Repulse External Interaction v4.0.0-alpha.8 by Matteo Bruni */
|