@tsparticles/interaction-particles-links 3.1.0 → 3.2.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/356.min.js +2 -0
- package/356.min.js.LICENSE.txt +1 -0
- package/806.min.js +2 -0
- package/806.min.js.LICENSE.txt +1 -0
- package/838.min.js +2 -0
- package/838.min.js.LICENSE.txt +1 -0
- package/browser/LinkInstance.js +2 -1
- package/browser/Linker.js +10 -5
- package/browser/interaction.js +4 -2
- package/browser/plugin.js +2 -2
- package/cjs/LinkInstance.js +2 -1
- package/cjs/Linker.js +33 -5
- package/cjs/interaction.js +27 -2
- package/cjs/plugin.js +26 -3
- package/dist_browser_CircleWarp_js.js +30 -0
- package/dist_browser_LinkInstance_js.js +40 -0
- package/dist_browser_Linker_js.js +30 -0
- package/esm/LinkInstance.js +2 -1
- package/esm/Linker.js +10 -5
- package/esm/interaction.js +4 -2
- package/esm/plugin.js +2 -2
- package/package.json +2 -2
- package/report.html +3 -3
- package/tsparticles.interaction.particles.links.js +291 -635
- package/tsparticles.interaction.particles.links.min.js +1 -1
- package/tsparticles.interaction.particles.links.min.js.LICENSE.txt +1 -1
- package/types/LinkInstance.d.ts +1 -1
- package/umd/LinkInstance.js +2 -1
- package/umd/Linker.js +35 -6
- package/umd/interaction.js +29 -3
- package/umd/plugin.js +28 -4
|
@@ -4,7 +4,15 @@
|
|
|
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
|
-
* v3.1
|
|
7
|
+
* v3.2.1
|
|
8
|
+
*/
|
|
9
|
+
/*
|
|
10
|
+
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
11
|
+
* This devtool is neither made for production nor for readable output files.
|
|
12
|
+
* It uses "eval()" calls to create a separate source file in the browser devtools.
|
|
13
|
+
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
|
|
14
|
+
* or disable the default devtool with "devtool: false".
|
|
15
|
+
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
|
|
8
16
|
*/
|
|
9
17
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
10
18
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
@@ -15,15 +23,78 @@
|
|
|
15
23
|
var a = typeof exports === 'object' ? factory(require("@tsparticles/engine")) : factory(root["window"]);
|
|
16
24
|
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
|
|
17
25
|
}
|
|
18
|
-
})(this, (
|
|
26
|
+
})(this, (__WEBPACK_EXTERNAL_MODULE__tsparticles_engine__) => {
|
|
19
27
|
return /******/ (() => { // webpackBootstrap
|
|
20
28
|
/******/ "use strict";
|
|
21
29
|
/******/ var __webpack_modules__ = ({
|
|
22
30
|
|
|
23
|
-
/***/
|
|
31
|
+
/***/ "./dist/browser/Options/Classes/Links.js":
|
|
32
|
+
/*!***********************************************!*\
|
|
33
|
+
!*** ./dist/browser/Options/Classes/Links.js ***!
|
|
34
|
+
\***********************************************/
|
|
35
|
+
/***/ ((__unused_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 */ Links: () => (/* binding */ Links)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _LinksShadow_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./LinksShadow.js */ \"./dist/browser/Options/Classes/LinksShadow.js\");\n/* harmony import */ var _LinksTriangle_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./LinksTriangle.js */ \"./dist/browser/Options/Classes/LinksTriangle.js\");\n\n\n\nclass Links {\n constructor() {\n this.blink = false;\n this.color = new _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OptionsColor();\n this.color.value = \"#fff\";\n this.consent = false;\n this.distance = 100;\n this.enable = false;\n this.frequency = 1;\n this.opacity = 1;\n this.shadow = new _LinksShadow_js__WEBPACK_IMPORTED_MODULE_1__.LinksShadow();\n this.triangles = new _LinksTriangle_js__WEBPACK_IMPORTED_MODULE_2__.LinksTriangle();\n this.width = 1;\n this.warp = false;\n }\n load(data) {\n if (!data) {\n return;\n }\n if (data.id !== undefined) {\n this.id = data.id;\n }\n if (data.blink !== undefined) {\n this.blink = data.blink;\n }\n this.color = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OptionsColor.create(this.color, data.color);\n if (data.consent !== undefined) {\n this.consent = data.consent;\n }\n if (data.distance !== undefined) {\n this.distance = data.distance;\n }\n if (data.enable !== undefined) {\n this.enable = data.enable;\n }\n if (data.frequency !== undefined) {\n this.frequency = data.frequency;\n }\n if (data.opacity !== undefined) {\n this.opacity = data.opacity;\n }\n this.shadow.load(data.shadow);\n this.triangles.load(data.triangles);\n if (data.width !== undefined) {\n this.width = data.width;\n }\n if (data.warp !== undefined) {\n this.warp = data.warp;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/interaction-particles-links/./dist/browser/Options/Classes/Links.js?");
|
|
38
|
+
|
|
39
|
+
/***/ }),
|
|
40
|
+
|
|
41
|
+
/***/ "./dist/browser/Options/Classes/LinksShadow.js":
|
|
42
|
+
/*!*****************************************************!*\
|
|
43
|
+
!*** ./dist/browser/Options/Classes/LinksShadow.js ***!
|
|
44
|
+
\*****************************************************/
|
|
45
|
+
/***/ ((__unused_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 */ LinksShadow: () => (/* binding */ LinksShadow)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n\nclass LinksShadow {\n constructor() {\n this.blur = 5;\n this.color = new _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OptionsColor();\n this.color.value = \"#000\";\n this.enable = false;\n }\n load(data) {\n if (!data) {\n return;\n }\n if (data.blur !== undefined) {\n this.blur = data.blur;\n }\n this.color = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OptionsColor.create(this.color, data.color);\n if (data.enable !== undefined) {\n this.enable = data.enable;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/interaction-particles-links/./dist/browser/Options/Classes/LinksShadow.js?");
|
|
48
|
+
|
|
49
|
+
/***/ }),
|
|
50
|
+
|
|
51
|
+
/***/ "./dist/browser/Options/Classes/LinksTriangle.js":
|
|
52
|
+
/*!*******************************************************!*\
|
|
53
|
+
!*** ./dist/browser/Options/Classes/LinksTriangle.js ***!
|
|
54
|
+
\*******************************************************/
|
|
55
|
+
/***/ ((__unused_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 */ LinksTriangle: () => (/* binding */ LinksTriangle)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n\nclass LinksTriangle {\n constructor() {\n this.enable = false;\n this.frequency = 1;\n }\n load(data) {\n if (!data) {\n return;\n }\n if (data.color !== undefined) {\n this.color = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OptionsColor.create(this.color, data.color);\n }\n if (data.enable !== undefined) {\n this.enable = data.enable;\n }\n if (data.frequency !== undefined) {\n this.frequency = data.frequency;\n }\n if (data.opacity !== undefined) {\n this.opacity = data.opacity;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/interaction-particles-links/./dist/browser/Options/Classes/LinksTriangle.js?");
|
|
58
|
+
|
|
59
|
+
/***/ }),
|
|
60
|
+
|
|
61
|
+
/***/ "./dist/browser/index.js":
|
|
62
|
+
/*!*******************************!*\
|
|
63
|
+
!*** ./dist/browser/index.js ***!
|
|
64
|
+
\*******************************/
|
|
65
|
+
/***/ ((__unused_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 */ Links: () => (/* reexport safe */ _Options_Classes_Links_js__WEBPACK_IMPORTED_MODULE_2__.Links),\n/* harmony export */ LinksShadow: () => (/* reexport safe */ _Options_Classes_LinksShadow_js__WEBPACK_IMPORTED_MODULE_3__.LinksShadow),\n/* harmony export */ LinksTriangle: () => (/* reexport safe */ _Options_Classes_LinksTriangle_js__WEBPACK_IMPORTED_MODULE_4__.LinksTriangle),\n/* harmony export */ loadParticlesLinksInteraction: () => (/* binding */ loadParticlesLinksInteraction)\n/* harmony export */ });\n/* harmony import */ var _interaction_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./interaction.js */ \"./dist/browser/interaction.js\");\n/* harmony import */ var _plugin_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./plugin.js */ \"./dist/browser/plugin.js\");\n/* harmony import */ var _Options_Classes_Links_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Options/Classes/Links.js */ \"./dist/browser/Options/Classes/Links.js\");\n/* harmony import */ var _Options_Classes_LinksShadow_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Options/Classes/LinksShadow.js */ \"./dist/browser/Options/Classes/LinksShadow.js\");\n/* harmony import */ var _Options_Classes_LinksTriangle_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Options/Classes/LinksTriangle.js */ \"./dist/browser/Options/Classes/LinksTriangle.js\");\n\n\nasync function loadParticlesLinksInteraction(engine, refresh = true) {\n await (0,_interaction_js__WEBPACK_IMPORTED_MODULE_0__.loadLinksInteraction)(engine, refresh);\n await (0,_plugin_js__WEBPACK_IMPORTED_MODULE_1__.loadLinksPlugin)(engine, refresh);\n}\n\n\n\n\n\n\n\n//# sourceURL=webpack://@tsparticles/interaction-particles-links/./dist/browser/index.js?");
|
|
68
|
+
|
|
69
|
+
/***/ }),
|
|
70
|
+
|
|
71
|
+
/***/ "./dist/browser/interaction.js":
|
|
72
|
+
/*!*************************************!*\
|
|
73
|
+
!*** ./dist/browser/interaction.js ***!
|
|
74
|
+
\*************************************/
|
|
75
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
76
|
+
|
|
77
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadLinksInteraction: () => (/* binding */ loadLinksInteraction)\n/* harmony export */ });\nasync function loadLinksInteraction(engine, refresh = true) {\n await engine.addInteractor(\"particlesLinks\", async container => {\n const {\n Linker\n } = await __webpack_require__.e(/*! import() */ \"dist_browser_Linker_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./Linker.js */ \"./dist/browser/Linker.js\"));\n return new Linker(container);\n }, refresh);\n}\n\n//# sourceURL=webpack://@tsparticles/interaction-particles-links/./dist/browser/interaction.js?");
|
|
78
|
+
|
|
79
|
+
/***/ }),
|
|
80
|
+
|
|
81
|
+
/***/ "./dist/browser/plugin.js":
|
|
82
|
+
/*!********************************!*\
|
|
83
|
+
!*** ./dist/browser/plugin.js ***!
|
|
84
|
+
\********************************/
|
|
85
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
86
|
+
|
|
87
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadLinksPlugin: () => (/* binding */ loadLinksPlugin)\n/* harmony export */ });\nclass LinksPlugin {\n constructor() {\n this.id = \"links\";\n }\n async getPlugin(container) {\n const {\n LinkInstance\n } = await __webpack_require__.e(/*! import() */ \"dist_browser_LinkInstance_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./LinkInstance.js */ \"./dist/browser/LinkInstance.js\"));\n return new LinkInstance(container);\n }\n loadOptions() {}\n needsPlugin() {\n return true;\n }\n}\nasync function loadLinksPlugin(engine, refresh = true) {\n const plugin = new LinksPlugin();\n await engine.addPlugin(plugin, refresh);\n}\n\n//# sourceURL=webpack://@tsparticles/interaction-particles-links/./dist/browser/plugin.js?");
|
|
88
|
+
|
|
89
|
+
/***/ }),
|
|
90
|
+
|
|
91
|
+
/***/ "@tsparticles/engine":
|
|
92
|
+
/*!*********************************************************************************************************************************!*\
|
|
93
|
+
!*** external {"commonjs":"@tsparticles/engine","commonjs2":"@tsparticles/engine","amd":"@tsparticles/engine","root":"window"} ***!
|
|
94
|
+
\*********************************************************************************************************************************/
|
|
24
95
|
/***/ ((module) => {
|
|
25
96
|
|
|
26
|
-
module.exports =
|
|
97
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
|
|
27
98
|
|
|
28
99
|
/***/ })
|
|
29
100
|
|
|
@@ -53,7 +124,22 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__533__;
|
|
|
53
124
|
/******/ return module.exports;
|
|
54
125
|
/******/ }
|
|
55
126
|
/******/
|
|
127
|
+
/******/ // expose the modules object (__webpack_modules__)
|
|
128
|
+
/******/ __webpack_require__.m = __webpack_modules__;
|
|
129
|
+
/******/
|
|
56
130
|
/************************************************************************/
|
|
131
|
+
/******/ /* webpack/runtime/compat get default export */
|
|
132
|
+
/******/ (() => {
|
|
133
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
134
|
+
/******/ __webpack_require__.n = (module) => {
|
|
135
|
+
/******/ var getter = module && module.__esModule ?
|
|
136
|
+
/******/ () => (module['default']) :
|
|
137
|
+
/******/ () => (module);
|
|
138
|
+
/******/ __webpack_require__.d(getter, { a: getter });
|
|
139
|
+
/******/ return getter;
|
|
140
|
+
/******/ };
|
|
141
|
+
/******/ })();
|
|
142
|
+
/******/
|
|
57
143
|
/******/ /* webpack/runtime/define property getters */
|
|
58
144
|
/******/ (() => {
|
|
59
145
|
/******/ // define getter functions for harmony exports
|
|
@@ -66,11 +152,91 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__533__;
|
|
|
66
152
|
/******/ };
|
|
67
153
|
/******/ })();
|
|
68
154
|
/******/
|
|
155
|
+
/******/ /* webpack/runtime/ensure chunk */
|
|
156
|
+
/******/ (() => {
|
|
157
|
+
/******/ __webpack_require__.f = {};
|
|
158
|
+
/******/ // This file contains only the entry chunk.
|
|
159
|
+
/******/ // The chunk loading function for additional chunks
|
|
160
|
+
/******/ __webpack_require__.e = (chunkId) => {
|
|
161
|
+
/******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
|
|
162
|
+
/******/ __webpack_require__.f[key](chunkId, promises);
|
|
163
|
+
/******/ return promises;
|
|
164
|
+
/******/ }, []));
|
|
165
|
+
/******/ };
|
|
166
|
+
/******/ })();
|
|
167
|
+
/******/
|
|
168
|
+
/******/ /* webpack/runtime/get javascript chunk filename */
|
|
169
|
+
/******/ (() => {
|
|
170
|
+
/******/ // This function allow to reference async chunks
|
|
171
|
+
/******/ __webpack_require__.u = (chunkId) => {
|
|
172
|
+
/******/ // return url for filenames based on template
|
|
173
|
+
/******/ return "" + chunkId + ".js";
|
|
174
|
+
/******/ };
|
|
175
|
+
/******/ })();
|
|
176
|
+
/******/
|
|
177
|
+
/******/ /* webpack/runtime/global */
|
|
178
|
+
/******/ (() => {
|
|
179
|
+
/******/ __webpack_require__.g = (function() {
|
|
180
|
+
/******/ if (typeof globalThis === 'object') return globalThis;
|
|
181
|
+
/******/ try {
|
|
182
|
+
/******/ return this || new Function('return this')();
|
|
183
|
+
/******/ } catch (e) {
|
|
184
|
+
/******/ if (typeof window === 'object') return window;
|
|
185
|
+
/******/ }
|
|
186
|
+
/******/ })();
|
|
187
|
+
/******/ })();
|
|
188
|
+
/******/
|
|
69
189
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
70
190
|
/******/ (() => {
|
|
71
191
|
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
72
192
|
/******/ })();
|
|
73
193
|
/******/
|
|
194
|
+
/******/ /* webpack/runtime/load script */
|
|
195
|
+
/******/ (() => {
|
|
196
|
+
/******/ var inProgress = {};
|
|
197
|
+
/******/ var dataWebpackPrefix = "@tsparticles/interaction-particles-links:";
|
|
198
|
+
/******/ // loadScript function to load a script via script tag
|
|
199
|
+
/******/ __webpack_require__.l = (url, done, key, chunkId) => {
|
|
200
|
+
/******/ if(inProgress[url]) { inProgress[url].push(done); return; }
|
|
201
|
+
/******/ var script, needAttach;
|
|
202
|
+
/******/ if(key !== undefined) {
|
|
203
|
+
/******/ var scripts = document.getElementsByTagName("script");
|
|
204
|
+
/******/ for(var i = 0; i < scripts.length; i++) {
|
|
205
|
+
/******/ var s = scripts[i];
|
|
206
|
+
/******/ if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; }
|
|
207
|
+
/******/ }
|
|
208
|
+
/******/ }
|
|
209
|
+
/******/ if(!script) {
|
|
210
|
+
/******/ needAttach = true;
|
|
211
|
+
/******/ script = document.createElement('script');
|
|
212
|
+
/******/
|
|
213
|
+
/******/ script.charset = 'utf-8';
|
|
214
|
+
/******/ script.timeout = 120;
|
|
215
|
+
/******/ if (__webpack_require__.nc) {
|
|
216
|
+
/******/ script.setAttribute("nonce", __webpack_require__.nc);
|
|
217
|
+
/******/ }
|
|
218
|
+
/******/ script.setAttribute("data-webpack", dataWebpackPrefix + key);
|
|
219
|
+
/******/
|
|
220
|
+
/******/ script.src = url;
|
|
221
|
+
/******/ }
|
|
222
|
+
/******/ inProgress[url] = [done];
|
|
223
|
+
/******/ var onScriptComplete = (prev, event) => {
|
|
224
|
+
/******/ // avoid mem leaks in IE.
|
|
225
|
+
/******/ script.onerror = script.onload = null;
|
|
226
|
+
/******/ clearTimeout(timeout);
|
|
227
|
+
/******/ var doneFns = inProgress[url];
|
|
228
|
+
/******/ delete inProgress[url];
|
|
229
|
+
/******/ script.parentNode && script.parentNode.removeChild(script);
|
|
230
|
+
/******/ doneFns && doneFns.forEach((fn) => (fn(event)));
|
|
231
|
+
/******/ if(prev) return prev(event);
|
|
232
|
+
/******/ }
|
|
233
|
+
/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
|
|
234
|
+
/******/ script.onerror = onScriptComplete.bind(null, script.onerror);
|
|
235
|
+
/******/ script.onload = onScriptComplete.bind(null, script.onload);
|
|
236
|
+
/******/ needAttach && document.head.appendChild(script);
|
|
237
|
+
/******/ };
|
|
238
|
+
/******/ })();
|
|
239
|
+
/******/
|
|
74
240
|
/******/ /* webpack/runtime/make namespace object */
|
|
75
241
|
/******/ (() => {
|
|
76
242
|
/******/ // define __esModule on exports
|
|
@@ -82,638 +248,128 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__533__;
|
|
|
82
248
|
/******/ };
|
|
83
249
|
/******/ })();
|
|
84
250
|
/******/
|
|
251
|
+
/******/ /* webpack/runtime/publicPath */
|
|
252
|
+
/******/ (() => {
|
|
253
|
+
/******/ var scriptUrl;
|
|
254
|
+
/******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
|
|
255
|
+
/******/ var document = __webpack_require__.g.document;
|
|
256
|
+
/******/ if (!scriptUrl && document) {
|
|
257
|
+
/******/ if (document.currentScript)
|
|
258
|
+
/******/ scriptUrl = document.currentScript.src;
|
|
259
|
+
/******/ if (!scriptUrl) {
|
|
260
|
+
/******/ var scripts = document.getElementsByTagName("script");
|
|
261
|
+
/******/ if(scripts.length) {
|
|
262
|
+
/******/ var i = scripts.length - 1;
|
|
263
|
+
/******/ while (i > -1 && !scriptUrl) scriptUrl = scripts[i--].src;
|
|
264
|
+
/******/ }
|
|
265
|
+
/******/ }
|
|
266
|
+
/******/ }
|
|
267
|
+
/******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
|
|
268
|
+
/******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
|
|
269
|
+
/******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
|
|
270
|
+
/******/ scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
|
|
271
|
+
/******/ __webpack_require__.p = scriptUrl;
|
|
272
|
+
/******/ })();
|
|
273
|
+
/******/
|
|
274
|
+
/******/ /* webpack/runtime/jsonp chunk loading */
|
|
275
|
+
/******/ (() => {
|
|
276
|
+
/******/ // no baseURI
|
|
277
|
+
/******/
|
|
278
|
+
/******/ // object to store loaded and loading chunks
|
|
279
|
+
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
|
|
280
|
+
/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
|
|
281
|
+
/******/ var installedChunks = {
|
|
282
|
+
/******/ "tsparticles.interaction.particles.links": 0
|
|
283
|
+
/******/ };
|
|
284
|
+
/******/
|
|
285
|
+
/******/ __webpack_require__.f.j = (chunkId, promises) => {
|
|
286
|
+
/******/ // JSONP chunk loading for javascript
|
|
287
|
+
/******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;
|
|
288
|
+
/******/ if(installedChunkData !== 0) { // 0 means "already installed".
|
|
289
|
+
/******/
|
|
290
|
+
/******/ // a Promise means "currently loading".
|
|
291
|
+
/******/ if(installedChunkData) {
|
|
292
|
+
/******/ promises.push(installedChunkData[2]);
|
|
293
|
+
/******/ } else {
|
|
294
|
+
/******/ if(true) { // all chunks have JS
|
|
295
|
+
/******/ // setup Promise in chunk cache
|
|
296
|
+
/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));
|
|
297
|
+
/******/ promises.push(installedChunkData[2] = promise);
|
|
298
|
+
/******/
|
|
299
|
+
/******/ // start chunk loading
|
|
300
|
+
/******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId);
|
|
301
|
+
/******/ // create error before stack unwound to get useful stacktrace later
|
|
302
|
+
/******/ var error = new Error();
|
|
303
|
+
/******/ var loadingEnded = (event) => {
|
|
304
|
+
/******/ if(__webpack_require__.o(installedChunks, chunkId)) {
|
|
305
|
+
/******/ installedChunkData = installedChunks[chunkId];
|
|
306
|
+
/******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined;
|
|
307
|
+
/******/ if(installedChunkData) {
|
|
308
|
+
/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
|
|
309
|
+
/******/ var realSrc = event && event.target && event.target.src;
|
|
310
|
+
/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
|
|
311
|
+
/******/ error.name = 'ChunkLoadError';
|
|
312
|
+
/******/ error.type = errorType;
|
|
313
|
+
/******/ error.request = realSrc;
|
|
314
|
+
/******/ installedChunkData[1](error);
|
|
315
|
+
/******/ }
|
|
316
|
+
/******/ }
|
|
317
|
+
/******/ };
|
|
318
|
+
/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId);
|
|
319
|
+
/******/ }
|
|
320
|
+
/******/ }
|
|
321
|
+
/******/ }
|
|
322
|
+
/******/ };
|
|
323
|
+
/******/
|
|
324
|
+
/******/ // no prefetching
|
|
325
|
+
/******/
|
|
326
|
+
/******/ // no preloaded
|
|
327
|
+
/******/
|
|
328
|
+
/******/ // no HMR
|
|
329
|
+
/******/
|
|
330
|
+
/******/ // no HMR manifest
|
|
331
|
+
/******/
|
|
332
|
+
/******/ // no on chunks loaded
|
|
333
|
+
/******/
|
|
334
|
+
/******/ // install a JSONP callback for chunk loading
|
|
335
|
+
/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
|
|
336
|
+
/******/ var chunkIds = data[0];
|
|
337
|
+
/******/ var moreModules = data[1];
|
|
338
|
+
/******/ var runtime = data[2];
|
|
339
|
+
/******/ // add "moreModules" to the modules object,
|
|
340
|
+
/******/ // then flag all "chunkIds" as loaded and fire callback
|
|
341
|
+
/******/ var moduleId, chunkId, i = 0;
|
|
342
|
+
/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
|
|
343
|
+
/******/ for(moduleId in moreModules) {
|
|
344
|
+
/******/ if(__webpack_require__.o(moreModules, moduleId)) {
|
|
345
|
+
/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
|
|
346
|
+
/******/ }
|
|
347
|
+
/******/ }
|
|
348
|
+
/******/ if(runtime) var result = runtime(__webpack_require__);
|
|
349
|
+
/******/ }
|
|
350
|
+
/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
|
|
351
|
+
/******/ for(;i < chunkIds.length; i++) {
|
|
352
|
+
/******/ chunkId = chunkIds[i];
|
|
353
|
+
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
|
|
354
|
+
/******/ installedChunks[chunkId][0]();
|
|
355
|
+
/******/ }
|
|
356
|
+
/******/ installedChunks[chunkId] = 0;
|
|
357
|
+
/******/ }
|
|
358
|
+
/******/
|
|
359
|
+
/******/ }
|
|
360
|
+
/******/
|
|
361
|
+
/******/ var chunkLoadingGlobal = this["webpackChunk_tsparticles_interaction_particles_links"] = this["webpackChunk_tsparticles_interaction_particles_links"] || [];
|
|
362
|
+
/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
|
|
363
|
+
/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
|
|
364
|
+
/******/ })();
|
|
365
|
+
/******/
|
|
85
366
|
/************************************************************************/
|
|
86
|
-
|
|
87
|
-
//
|
|
88
|
-
|
|
89
|
-
//
|
|
90
|
-
__webpack_require__.
|
|
91
|
-
|
|
92
|
-
// EXPORTS
|
|
93
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
94
|
-
Links: () => (/* reexport */ Links),
|
|
95
|
-
LinksShadow: () => (/* reexport */ LinksShadow),
|
|
96
|
-
LinksTriangle: () => (/* reexport */ LinksTriangle),
|
|
97
|
-
loadParticlesLinksInteraction: () => (/* binding */ loadParticlesLinksInteraction)
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
// EXTERNAL MODULE: external {"commonjs":"@tsparticles/engine","commonjs2":"@tsparticles/engine","amd":"@tsparticles/engine","root":"window"}
|
|
101
|
-
var engine_root_window_ = __webpack_require__(533);
|
|
102
|
-
;// CONCATENATED MODULE: ./dist/browser/CircleWarp.js
|
|
103
|
-
|
|
104
|
-
const CircleWarp_double = 2;
|
|
105
|
-
class CircleWarp extends engine_root_window_.Circle {
|
|
106
|
-
constructor(x, y, radius, canvasSize) {
|
|
107
|
-
super(x, y, radius);
|
|
108
|
-
this.canvasSize = canvasSize;
|
|
109
|
-
this.canvasSize = {
|
|
110
|
-
...canvasSize
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
contains(point) {
|
|
114
|
-
const {
|
|
115
|
-
width,
|
|
116
|
-
height
|
|
117
|
-
} = this.canvasSize;
|
|
118
|
-
const {
|
|
119
|
-
x,
|
|
120
|
-
y
|
|
121
|
-
} = point;
|
|
122
|
-
return super.contains(point) || super.contains({
|
|
123
|
-
x: x - width,
|
|
124
|
-
y
|
|
125
|
-
}) || super.contains({
|
|
126
|
-
x: x - width,
|
|
127
|
-
y: y - height
|
|
128
|
-
}) || super.contains({
|
|
129
|
-
x,
|
|
130
|
-
y: y - height
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
intersects(range) {
|
|
134
|
-
if (super.intersects(range)) {
|
|
135
|
-
return true;
|
|
136
|
-
}
|
|
137
|
-
const rect = range,
|
|
138
|
-
circle = range,
|
|
139
|
-
newPos = {
|
|
140
|
-
x: range.position.x - this.canvasSize.width,
|
|
141
|
-
y: range.position.y - this.canvasSize.height
|
|
142
|
-
};
|
|
143
|
-
if (circle.radius !== undefined) {
|
|
144
|
-
const biggerCircle = new engine_root_window_.Circle(newPos.x, newPos.y, circle.radius * CircleWarp_double);
|
|
145
|
-
return super.intersects(biggerCircle);
|
|
146
|
-
} else if (rect.size !== undefined) {
|
|
147
|
-
const rectSW = new engine_root_window_.Rectangle(newPos.x, newPos.y, rect.size.width * CircleWarp_double, rect.size.height * CircleWarp_double);
|
|
148
|
-
return super.intersects(rectSW);
|
|
149
|
-
}
|
|
150
|
-
return false;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
;// CONCATENATED MODULE: ./dist/browser/Options/Classes/LinksShadow.js
|
|
154
|
-
|
|
155
|
-
class LinksShadow {
|
|
156
|
-
constructor() {
|
|
157
|
-
this.blur = 5;
|
|
158
|
-
this.color = new engine_root_window_.OptionsColor();
|
|
159
|
-
this.color.value = "#000";
|
|
160
|
-
this.enable = false;
|
|
161
|
-
}
|
|
162
|
-
load(data) {
|
|
163
|
-
if (!data) {
|
|
164
|
-
return;
|
|
165
|
-
}
|
|
166
|
-
if (data.blur !== undefined) {
|
|
167
|
-
this.blur = data.blur;
|
|
168
|
-
}
|
|
169
|
-
this.color = engine_root_window_.OptionsColor.create(this.color, data.color);
|
|
170
|
-
if (data.enable !== undefined) {
|
|
171
|
-
this.enable = data.enable;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
;// CONCATENATED MODULE: ./dist/browser/Options/Classes/LinksTriangle.js
|
|
176
|
-
|
|
177
|
-
class LinksTriangle {
|
|
178
|
-
constructor() {
|
|
179
|
-
this.enable = false;
|
|
180
|
-
this.frequency = 1;
|
|
181
|
-
}
|
|
182
|
-
load(data) {
|
|
183
|
-
if (!data) {
|
|
184
|
-
return;
|
|
185
|
-
}
|
|
186
|
-
if (data.color !== undefined) {
|
|
187
|
-
this.color = engine_root_window_.OptionsColor.create(this.color, data.color);
|
|
188
|
-
}
|
|
189
|
-
if (data.enable !== undefined) {
|
|
190
|
-
this.enable = data.enable;
|
|
191
|
-
}
|
|
192
|
-
if (data.frequency !== undefined) {
|
|
193
|
-
this.frequency = data.frequency;
|
|
194
|
-
}
|
|
195
|
-
if (data.opacity !== undefined) {
|
|
196
|
-
this.opacity = data.opacity;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
;// CONCATENATED MODULE: ./dist/browser/Options/Classes/Links.js
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
class Links {
|
|
205
|
-
constructor() {
|
|
206
|
-
this.blink = false;
|
|
207
|
-
this.color = new engine_root_window_.OptionsColor();
|
|
208
|
-
this.color.value = "#fff";
|
|
209
|
-
this.consent = false;
|
|
210
|
-
this.distance = 100;
|
|
211
|
-
this.enable = false;
|
|
212
|
-
this.frequency = 1;
|
|
213
|
-
this.opacity = 1;
|
|
214
|
-
this.shadow = new LinksShadow();
|
|
215
|
-
this.triangles = new LinksTriangle();
|
|
216
|
-
this.width = 1;
|
|
217
|
-
this.warp = false;
|
|
218
|
-
}
|
|
219
|
-
load(data) {
|
|
220
|
-
if (!data) {
|
|
221
|
-
return;
|
|
222
|
-
}
|
|
223
|
-
if (data.id !== undefined) {
|
|
224
|
-
this.id = data.id;
|
|
225
|
-
}
|
|
226
|
-
if (data.blink !== undefined) {
|
|
227
|
-
this.blink = data.blink;
|
|
228
|
-
}
|
|
229
|
-
this.color = engine_root_window_.OptionsColor.create(this.color, data.color);
|
|
230
|
-
if (data.consent !== undefined) {
|
|
231
|
-
this.consent = data.consent;
|
|
232
|
-
}
|
|
233
|
-
if (data.distance !== undefined) {
|
|
234
|
-
this.distance = data.distance;
|
|
235
|
-
}
|
|
236
|
-
if (data.enable !== undefined) {
|
|
237
|
-
this.enable = data.enable;
|
|
238
|
-
}
|
|
239
|
-
if (data.frequency !== undefined) {
|
|
240
|
-
this.frequency = data.frequency;
|
|
241
|
-
}
|
|
242
|
-
if (data.opacity !== undefined) {
|
|
243
|
-
this.opacity = data.opacity;
|
|
244
|
-
}
|
|
245
|
-
this.shadow.load(data.shadow);
|
|
246
|
-
this.triangles.load(data.triangles);
|
|
247
|
-
if (data.width !== undefined) {
|
|
248
|
-
this.width = data.width;
|
|
249
|
-
}
|
|
250
|
-
if (data.warp !== undefined) {
|
|
251
|
-
this.warp = data.warp;
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
;// CONCATENATED MODULE: ./dist/browser/Linker.js
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
const squarePower = 2,
|
|
260
|
-
opacityOffset = 1,
|
|
261
|
-
origin = {
|
|
262
|
-
x: 0,
|
|
263
|
-
y: 0
|
|
264
|
-
},
|
|
265
|
-
minDistance = 0;
|
|
266
|
-
function getLinkDistance(pos1, pos2, optDistance, canvasSize, warp) {
|
|
267
|
-
const {
|
|
268
|
-
dx,
|
|
269
|
-
dy,
|
|
270
|
-
distance
|
|
271
|
-
} = (0,engine_root_window_.getDistances)(pos1, pos2);
|
|
272
|
-
if (!warp || distance <= optDistance) {
|
|
273
|
-
return distance;
|
|
274
|
-
}
|
|
275
|
-
const absDiffs = {
|
|
276
|
-
x: Math.abs(dx),
|
|
277
|
-
y: Math.abs(dy)
|
|
278
|
-
},
|
|
279
|
-
warpDistances = {
|
|
280
|
-
x: Math.min(absDiffs.x, canvasSize.width - absDiffs.x),
|
|
281
|
-
y: Math.min(absDiffs.y, canvasSize.height - absDiffs.y)
|
|
282
|
-
};
|
|
283
|
-
return Math.sqrt(warpDistances.x ** squarePower + warpDistances.y ** squarePower);
|
|
284
|
-
}
|
|
285
|
-
class Linker extends engine_root_window_.ParticlesInteractorBase {
|
|
286
|
-
constructor(container) {
|
|
287
|
-
super(container);
|
|
288
|
-
this._setColor = p1 => {
|
|
289
|
-
if (!p1.options.links) {
|
|
290
|
-
return;
|
|
291
|
-
}
|
|
292
|
-
const container = this.linkContainer,
|
|
293
|
-
linksOptions = p1.options.links;
|
|
294
|
-
let linkColor = linksOptions.id === undefined ? container.particles.linksColor : container.particles.linksColors.get(linksOptions.id);
|
|
295
|
-
if (linkColor) {
|
|
296
|
-
return;
|
|
297
|
-
}
|
|
298
|
-
const optColor = linksOptions.color;
|
|
299
|
-
linkColor = (0,engine_root_window_.getLinkRandomColor)(optColor, linksOptions.blink, linksOptions.consent);
|
|
300
|
-
if (linksOptions.id === undefined) {
|
|
301
|
-
container.particles.linksColor = linkColor;
|
|
302
|
-
} else {
|
|
303
|
-
container.particles.linksColors.set(linksOptions.id, linkColor);
|
|
304
|
-
}
|
|
305
|
-
};
|
|
306
|
-
this.linkContainer = container;
|
|
307
|
-
}
|
|
308
|
-
clear() {}
|
|
309
|
-
init() {
|
|
310
|
-
this.linkContainer.particles.linksColor = undefined;
|
|
311
|
-
this.linkContainer.particles.linksColors = new Map();
|
|
312
|
-
}
|
|
313
|
-
async interact(p1) {
|
|
314
|
-
if (!p1.options.links) {
|
|
315
|
-
return;
|
|
316
|
-
}
|
|
317
|
-
p1.links = [];
|
|
318
|
-
const pos1 = p1.getPosition(),
|
|
319
|
-
container = this.container,
|
|
320
|
-
canvasSize = container.canvas.size;
|
|
321
|
-
if (pos1.x < origin.x || pos1.y < origin.y || pos1.x > canvasSize.width || pos1.y > canvasSize.height) {
|
|
322
|
-
return;
|
|
323
|
-
}
|
|
324
|
-
const linkOpt1 = p1.options.links,
|
|
325
|
-
optOpacity = linkOpt1.opacity,
|
|
326
|
-
optDistance = p1.retina.linksDistance ?? minDistance,
|
|
327
|
-
warp = linkOpt1.warp,
|
|
328
|
-
range = warp ? new CircleWarp(pos1.x, pos1.y, optDistance, canvasSize) : new engine_root_window_.Circle(pos1.x, pos1.y, optDistance),
|
|
329
|
-
query = container.particles.quadTree.query(range);
|
|
330
|
-
for (const p2 of query) {
|
|
331
|
-
const linkOpt2 = p2.options.links;
|
|
332
|
-
if (p1 === p2 || !linkOpt2?.enable || linkOpt1.id !== linkOpt2.id || p2.spawning || p2.destroyed || !p2.links || p1.links.some(t => t.destination === p2) || p2.links.some(t => t.destination === p1)) {
|
|
333
|
-
continue;
|
|
334
|
-
}
|
|
335
|
-
const pos2 = p2.getPosition();
|
|
336
|
-
if (pos2.x < origin.x || pos2.y < origin.y || pos2.x > canvasSize.width || pos2.y > canvasSize.height) {
|
|
337
|
-
continue;
|
|
338
|
-
}
|
|
339
|
-
const distance = getLinkDistance(pos1, pos2, optDistance, canvasSize, warp && linkOpt2.warp);
|
|
340
|
-
if (distance > optDistance) {
|
|
341
|
-
continue;
|
|
342
|
-
}
|
|
343
|
-
const opacityLine = (opacityOffset - distance / optDistance) * optOpacity;
|
|
344
|
-
this._setColor(p1);
|
|
345
|
-
p1.links.push({
|
|
346
|
-
destination: p2,
|
|
347
|
-
opacity: opacityLine
|
|
348
|
-
});
|
|
349
|
-
}
|
|
350
|
-
await Promise.resolve();
|
|
351
|
-
}
|
|
352
|
-
isEnabled(particle) {
|
|
353
|
-
return !!particle.options.links?.enable;
|
|
354
|
-
}
|
|
355
|
-
loadParticlesOptions(options, ...sources) {
|
|
356
|
-
if (!options.links) {
|
|
357
|
-
options.links = new Links();
|
|
358
|
-
}
|
|
359
|
-
for (const source of sources) {
|
|
360
|
-
options.links.load(source?.links);
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
reset() {}
|
|
364
|
-
}
|
|
365
|
-
;// CONCATENATED MODULE: ./dist/browser/interaction.js
|
|
366
|
-
|
|
367
|
-
async function loadLinksInteraction(engine, refresh = true) {
|
|
368
|
-
await engine.addInteractor("particlesLinks", container => new Linker(container), refresh);
|
|
369
|
-
}
|
|
370
|
-
;// CONCATENATED MODULE: ./dist/browser/Utils.js
|
|
371
|
-
|
|
372
|
-
function drawTriangle(context, p1, p2, p3) {
|
|
373
|
-
context.beginPath();
|
|
374
|
-
context.moveTo(p1.x, p1.y);
|
|
375
|
-
context.lineTo(p2.x, p2.y);
|
|
376
|
-
context.lineTo(p3.x, p3.y);
|
|
377
|
-
context.closePath();
|
|
378
|
-
}
|
|
379
|
-
function drawLinkLine(params) {
|
|
380
|
-
let drawn = false;
|
|
381
|
-
const {
|
|
382
|
-
begin,
|
|
383
|
-
end,
|
|
384
|
-
maxDistance,
|
|
385
|
-
context,
|
|
386
|
-
canvasSize,
|
|
387
|
-
width,
|
|
388
|
-
backgroundMask,
|
|
389
|
-
colorLine,
|
|
390
|
-
opacity,
|
|
391
|
-
links
|
|
392
|
-
} = params;
|
|
393
|
-
if ((0,engine_root_window_.getDistance)(begin, end) <= maxDistance) {
|
|
394
|
-
(0,engine_root_window_.drawLine)(context, begin, end);
|
|
395
|
-
drawn = true;
|
|
396
|
-
} else if (links.warp) {
|
|
397
|
-
let pi1;
|
|
398
|
-
let pi2;
|
|
399
|
-
const endNE = {
|
|
400
|
-
x: end.x - canvasSize.width,
|
|
401
|
-
y: end.y
|
|
402
|
-
};
|
|
403
|
-
const d1 = (0,engine_root_window_.getDistances)(begin, endNE);
|
|
404
|
-
if (d1.distance <= maxDistance) {
|
|
405
|
-
const yi = begin.y - d1.dy / d1.dx * begin.x;
|
|
406
|
-
pi1 = {
|
|
407
|
-
x: 0,
|
|
408
|
-
y: yi
|
|
409
|
-
};
|
|
410
|
-
pi2 = {
|
|
411
|
-
x: canvasSize.width,
|
|
412
|
-
y: yi
|
|
413
|
-
};
|
|
414
|
-
} else {
|
|
415
|
-
const endSW = {
|
|
416
|
-
x: end.x,
|
|
417
|
-
y: end.y - canvasSize.height
|
|
418
|
-
};
|
|
419
|
-
const d2 = (0,engine_root_window_.getDistances)(begin, endSW);
|
|
420
|
-
if (d2.distance <= maxDistance) {
|
|
421
|
-
const yi = begin.y - d2.dy / d2.dx * begin.x;
|
|
422
|
-
const xi = -yi / (d2.dy / d2.dx);
|
|
423
|
-
pi1 = {
|
|
424
|
-
x: xi,
|
|
425
|
-
y: 0
|
|
426
|
-
};
|
|
427
|
-
pi2 = {
|
|
428
|
-
x: xi,
|
|
429
|
-
y: canvasSize.height
|
|
430
|
-
};
|
|
431
|
-
} else {
|
|
432
|
-
const endSE = {
|
|
433
|
-
x: end.x - canvasSize.width,
|
|
434
|
-
y: end.y - canvasSize.height
|
|
435
|
-
};
|
|
436
|
-
const d3 = (0,engine_root_window_.getDistances)(begin, endSE);
|
|
437
|
-
if (d3.distance <= maxDistance) {
|
|
438
|
-
const yi = begin.y - d3.dy / d3.dx * begin.x;
|
|
439
|
-
const xi = -yi / (d3.dy / d3.dx);
|
|
440
|
-
pi1 = {
|
|
441
|
-
x: xi,
|
|
442
|
-
y: yi
|
|
443
|
-
};
|
|
444
|
-
pi2 = {
|
|
445
|
-
x: pi1.x + canvasSize.width,
|
|
446
|
-
y: pi1.y + canvasSize.height
|
|
447
|
-
};
|
|
448
|
-
}
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
if (pi1 && pi2) {
|
|
452
|
-
(0,engine_root_window_.drawLine)(context, begin, pi1);
|
|
453
|
-
(0,engine_root_window_.drawLine)(context, end, pi2);
|
|
454
|
-
drawn = true;
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
if (!drawn) {
|
|
458
|
-
return;
|
|
459
|
-
}
|
|
460
|
-
context.lineWidth = width;
|
|
461
|
-
if (backgroundMask.enable) {
|
|
462
|
-
context.globalCompositeOperation = backgroundMask.composite;
|
|
463
|
-
}
|
|
464
|
-
context.strokeStyle = (0,engine_root_window_.getStyleFromRgb)(colorLine, opacity);
|
|
465
|
-
const {
|
|
466
|
-
shadow
|
|
467
|
-
} = links;
|
|
468
|
-
if (shadow.enable) {
|
|
469
|
-
const shadowColor = (0,engine_root_window_.rangeColorToRgb)(shadow.color);
|
|
470
|
-
if (shadowColor) {
|
|
471
|
-
context.shadowBlur = shadow.blur;
|
|
472
|
-
context.shadowColor = (0,engine_root_window_.getStyleFromRgb)(shadowColor);
|
|
473
|
-
}
|
|
474
|
-
}
|
|
475
|
-
context.stroke();
|
|
476
|
-
}
|
|
477
|
-
function drawLinkTriangle(params) {
|
|
478
|
-
const {
|
|
479
|
-
context,
|
|
480
|
-
pos1,
|
|
481
|
-
pos2,
|
|
482
|
-
pos3,
|
|
483
|
-
backgroundMask,
|
|
484
|
-
colorTriangle,
|
|
485
|
-
opacityTriangle
|
|
486
|
-
} = params;
|
|
487
|
-
drawTriangle(context, pos1, pos2, pos3);
|
|
488
|
-
if (backgroundMask.enable) {
|
|
489
|
-
context.globalCompositeOperation = backgroundMask.composite;
|
|
490
|
-
}
|
|
491
|
-
context.fillStyle = (0,engine_root_window_.getStyleFromRgb)(colorTriangle, opacityTriangle);
|
|
492
|
-
context.fill();
|
|
493
|
-
}
|
|
494
|
-
function getLinkKey(ids) {
|
|
495
|
-
ids.sort((a, b) => a - b);
|
|
496
|
-
return ids.join("_");
|
|
497
|
-
}
|
|
498
|
-
function setLinkFrequency(particles, dictionary) {
|
|
499
|
-
const key = getLinkKey(particles.map(t => t.id));
|
|
500
|
-
let res = dictionary.get(key);
|
|
501
|
-
if (res === undefined) {
|
|
502
|
-
res = (0,engine_root_window_.getRandom)();
|
|
503
|
-
dictionary.set(key, res);
|
|
504
|
-
}
|
|
505
|
-
return res;
|
|
506
|
-
}
|
|
507
|
-
;// CONCATENATED MODULE: ./dist/browser/LinkInstance.js
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
const minOpacity = 0,
|
|
511
|
-
minWidth = 0,
|
|
512
|
-
LinkInstance_minDistance = 0,
|
|
513
|
-
half = 0.5;
|
|
514
|
-
class LinkInstance {
|
|
515
|
-
constructor(container) {
|
|
516
|
-
this.container = container;
|
|
517
|
-
this._drawLinkLine = (p1, link) => {
|
|
518
|
-
const p1LinksOptions = p1.options.links;
|
|
519
|
-
if (!p1LinksOptions?.enable) {
|
|
520
|
-
return;
|
|
521
|
-
}
|
|
522
|
-
const container = this.container,
|
|
523
|
-
options = container.actualOptions,
|
|
524
|
-
p2 = link.destination,
|
|
525
|
-
pos1 = p1.getPosition(),
|
|
526
|
-
pos2 = p2.getPosition();
|
|
527
|
-
let opacity = link.opacity;
|
|
528
|
-
container.canvas.draw(ctx => {
|
|
529
|
-
let colorLine;
|
|
530
|
-
const twinkle = p1.options.twinkle?.lines;
|
|
531
|
-
if (twinkle?.enable) {
|
|
532
|
-
const twinkleFreq = twinkle.frequency,
|
|
533
|
-
twinkleRgb = (0,engine_root_window_.rangeColorToRgb)(twinkle.color),
|
|
534
|
-
twinkling = (0,engine_root_window_.getRandom)() < twinkleFreq;
|
|
535
|
-
if (twinkling && twinkleRgb) {
|
|
536
|
-
colorLine = twinkleRgb;
|
|
537
|
-
opacity = (0,engine_root_window_.getRangeValue)(twinkle.opacity);
|
|
538
|
-
}
|
|
539
|
-
}
|
|
540
|
-
if (!colorLine) {
|
|
541
|
-
const linkColor = p1LinksOptions.id !== undefined ? container.particles.linksColors.get(p1LinksOptions.id) : container.particles.linksColor;
|
|
542
|
-
colorLine = (0,engine_root_window_.getLinkColor)(p1, p2, linkColor);
|
|
543
|
-
}
|
|
544
|
-
if (!colorLine) {
|
|
545
|
-
return;
|
|
546
|
-
}
|
|
547
|
-
const width = p1.retina.linksWidth ?? minWidth,
|
|
548
|
-
maxDistance = p1.retina.linksDistance ?? LinkInstance_minDistance,
|
|
549
|
-
{
|
|
550
|
-
backgroundMask
|
|
551
|
-
} = options;
|
|
552
|
-
drawLinkLine({
|
|
553
|
-
context: ctx,
|
|
554
|
-
width,
|
|
555
|
-
begin: pos1,
|
|
556
|
-
end: pos2,
|
|
557
|
-
maxDistance,
|
|
558
|
-
canvasSize: container.canvas.size,
|
|
559
|
-
links: p1LinksOptions,
|
|
560
|
-
backgroundMask: backgroundMask,
|
|
561
|
-
colorLine,
|
|
562
|
-
opacity
|
|
563
|
-
});
|
|
564
|
-
});
|
|
565
|
-
};
|
|
566
|
-
this._drawLinkTriangle = (p1, link1, link2) => {
|
|
567
|
-
const linksOptions = p1.options.links;
|
|
568
|
-
if (!linksOptions?.enable) {
|
|
569
|
-
return;
|
|
570
|
-
}
|
|
571
|
-
const triangleOptions = linksOptions.triangles;
|
|
572
|
-
if (!triangleOptions.enable) {
|
|
573
|
-
return;
|
|
574
|
-
}
|
|
575
|
-
const container = this.container,
|
|
576
|
-
options = container.actualOptions,
|
|
577
|
-
p2 = link1.destination,
|
|
578
|
-
p3 = link2.destination,
|
|
579
|
-
opacityTriangle = triangleOptions.opacity ?? (link1.opacity + link2.opacity) * half;
|
|
580
|
-
if (opacityTriangle <= minOpacity) {
|
|
581
|
-
return;
|
|
582
|
-
}
|
|
583
|
-
container.canvas.draw(ctx => {
|
|
584
|
-
const pos1 = p1.getPosition(),
|
|
585
|
-
pos2 = p2.getPosition(),
|
|
586
|
-
pos3 = p3.getPosition(),
|
|
587
|
-
linksDistance = p1.retina.linksDistance ?? LinkInstance_minDistance;
|
|
588
|
-
if ((0,engine_root_window_.getDistance)(pos1, pos2) > linksDistance || (0,engine_root_window_.getDistance)(pos3, pos2) > linksDistance || (0,engine_root_window_.getDistance)(pos3, pos1) > linksDistance) {
|
|
589
|
-
return;
|
|
590
|
-
}
|
|
591
|
-
let colorTriangle = (0,engine_root_window_.rangeColorToRgb)(triangleOptions.color);
|
|
592
|
-
if (!colorTriangle) {
|
|
593
|
-
const linkColor = linksOptions.id !== undefined ? container.particles.linksColors.get(linksOptions.id) : container.particles.linksColor;
|
|
594
|
-
colorTriangle = (0,engine_root_window_.getLinkColor)(p1, p2, linkColor);
|
|
595
|
-
}
|
|
596
|
-
if (!colorTriangle) {
|
|
597
|
-
return;
|
|
598
|
-
}
|
|
599
|
-
drawLinkTriangle({
|
|
600
|
-
context: ctx,
|
|
601
|
-
pos1,
|
|
602
|
-
pos2,
|
|
603
|
-
pos3,
|
|
604
|
-
backgroundMask: options.backgroundMask,
|
|
605
|
-
colorTriangle,
|
|
606
|
-
opacityTriangle
|
|
607
|
-
});
|
|
608
|
-
});
|
|
609
|
-
};
|
|
610
|
-
this._drawTriangles = (options, p1, link, p1Links) => {
|
|
611
|
-
const p2 = link.destination;
|
|
612
|
-
if (!(options.links?.triangles.enable && p2.options.links?.triangles.enable)) {
|
|
613
|
-
return;
|
|
614
|
-
}
|
|
615
|
-
const vertices = p2.links?.filter(t => {
|
|
616
|
-
const linkFreq = this._getLinkFrequency(p2, t.destination),
|
|
617
|
-
minCount = 0;
|
|
618
|
-
return p2.options.links && linkFreq <= p2.options.links.frequency && p1Links.findIndex(l => l.destination === t.destination) >= minCount;
|
|
619
|
-
});
|
|
620
|
-
if (!vertices?.length) {
|
|
621
|
-
return;
|
|
622
|
-
}
|
|
623
|
-
for (const vertex of vertices) {
|
|
624
|
-
const p3 = vertex.destination,
|
|
625
|
-
triangleFreq = this._getTriangleFrequency(p1, p2, p3);
|
|
626
|
-
if (triangleFreq > options.links.triangles.frequency) {
|
|
627
|
-
continue;
|
|
628
|
-
}
|
|
629
|
-
this._drawLinkTriangle(p1, link, vertex);
|
|
630
|
-
}
|
|
631
|
-
};
|
|
632
|
-
this._getLinkFrequency = (p1, p2) => {
|
|
633
|
-
return setLinkFrequency([p1, p2], this._freqs.links);
|
|
634
|
-
};
|
|
635
|
-
this._getTriangleFrequency = (p1, p2, p3) => {
|
|
636
|
-
return setLinkFrequency([p1, p2, p3], this._freqs.triangles);
|
|
637
|
-
};
|
|
638
|
-
this._freqs = {
|
|
639
|
-
links: new Map(),
|
|
640
|
-
triangles: new Map()
|
|
641
|
-
};
|
|
642
|
-
}
|
|
643
|
-
drawParticle(context, particle) {
|
|
644
|
-
const {
|
|
645
|
-
links,
|
|
646
|
-
options
|
|
647
|
-
} = particle;
|
|
648
|
-
if (!links?.length) {
|
|
649
|
-
return;
|
|
650
|
-
}
|
|
651
|
-
const p1Links = links.filter(l => options.links && this._getLinkFrequency(particle, l.destination) <= options.links.frequency);
|
|
652
|
-
for (const link of p1Links) {
|
|
653
|
-
this._drawTriangles(options, particle, link, p1Links);
|
|
654
|
-
if (link.opacity > minOpacity && (particle.retina.linksWidth ?? minWidth) > minWidth) {
|
|
655
|
-
this._drawLinkLine(particle, link);
|
|
656
|
-
}
|
|
657
|
-
}
|
|
658
|
-
}
|
|
659
|
-
async init() {
|
|
660
|
-
this._freqs.links = new Map();
|
|
661
|
-
this._freqs.triangles = new Map();
|
|
662
|
-
await Promise.resolve();
|
|
663
|
-
}
|
|
664
|
-
particleCreated(particle) {
|
|
665
|
-
particle.links = [];
|
|
666
|
-
if (!particle.options.links) {
|
|
667
|
-
return;
|
|
668
|
-
}
|
|
669
|
-
const ratio = this.container.retina.pixelRatio,
|
|
670
|
-
{
|
|
671
|
-
retina
|
|
672
|
-
} = particle,
|
|
673
|
-
{
|
|
674
|
-
distance,
|
|
675
|
-
width
|
|
676
|
-
} = particle.options.links;
|
|
677
|
-
retina.linksDistance = distance * ratio;
|
|
678
|
-
retina.linksWidth = width * ratio;
|
|
679
|
-
}
|
|
680
|
-
particleDestroyed(particle) {
|
|
681
|
-
particle.links = [];
|
|
682
|
-
}
|
|
683
|
-
}
|
|
684
|
-
;// CONCATENATED MODULE: ./dist/browser/plugin.js
|
|
685
|
-
|
|
686
|
-
class LinksPlugin {
|
|
687
|
-
constructor() {
|
|
688
|
-
this.id = "links";
|
|
689
|
-
}
|
|
690
|
-
getPlugin(container) {
|
|
691
|
-
return new LinkInstance(container);
|
|
692
|
-
}
|
|
693
|
-
loadOptions() {}
|
|
694
|
-
needsPlugin() {
|
|
695
|
-
return true;
|
|
696
|
-
}
|
|
697
|
-
}
|
|
698
|
-
async function loadLinksPlugin(engine, refresh = true) {
|
|
699
|
-
const plugin = new LinksPlugin();
|
|
700
|
-
await engine.addPlugin(plugin, refresh);
|
|
701
|
-
}
|
|
702
|
-
;// CONCATENATED MODULE: ./dist/browser/index.js
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
async function loadParticlesLinksInteraction(engine, refresh = true) {
|
|
706
|
-
await loadLinksInteraction(engine, refresh);
|
|
707
|
-
await loadLinksPlugin(engine, refresh);
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
})();
|
|
716
|
-
|
|
367
|
+
/******/
|
|
368
|
+
/******/ // startup
|
|
369
|
+
/******/ // Load entry module and return exports
|
|
370
|
+
/******/ // This entry module can't be inlined because the eval devtool is used.
|
|
371
|
+
/******/ var __webpack_exports__ = __webpack_require__("./dist/browser/index.js");
|
|
372
|
+
/******/
|
|
717
373
|
/******/ return __webpack_exports__;
|
|
718
374
|
/******/ })()
|
|
719
375
|
;
|