@tsparticles/interaction-particles-links 3.0.3 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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.0.3
7
+ * v3.2.0
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, (__WEBPACK_EXTERNAL_MODULE__533__) => {
26
+ })(this, (__WEBPACK_EXTERNAL_MODULE__tsparticles_engine__) => {
19
27
  return /******/ (() => { // webpackBootstrap
20
28
  /******/ "use strict";
21
29
  /******/ var __webpack_modules__ = ({
22
30
 
23
- /***/ 533:
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 = __WEBPACK_EXTERNAL_MODULE__533__;
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,623 +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
- var __webpack_exports__ = {};
87
- // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
88
- (() => {
89
- // ESM COMPAT FLAG
90
- __webpack_require__.r(__webpack_exports__);
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
- class CircleWarp extends engine_root_window_.Circle {
105
- constructor(x, y, radius, canvasSize) {
106
- super(x, y, radius);
107
- this.canvasSize = canvasSize;
108
- this.canvasSize = {
109
- ...canvasSize
110
- };
111
- }
112
- contains(point) {
113
- const {
114
- width,
115
- height
116
- } = this.canvasSize;
117
- const {
118
- x,
119
- y
120
- } = point;
121
- return super.contains(point) || super.contains({
122
- x: x - width,
123
- y
124
- }) || super.contains({
125
- x: x - width,
126
- y: y - height
127
- }) || super.contains({
128
- x,
129
- y: y - height
130
- });
131
- }
132
- intersects(range) {
133
- if (super.intersects(range)) {
134
- return true;
135
- }
136
- const rect = range,
137
- circle = range,
138
- newPos = {
139
- x: range.position.x - this.canvasSize.width,
140
- y: range.position.y - this.canvasSize.height
141
- };
142
- if (circle.radius !== undefined) {
143
- const biggerCircle = new engine_root_window_.Circle(newPos.x, newPos.y, circle.radius * 2);
144
- return super.intersects(biggerCircle);
145
- } else if (rect.size !== undefined) {
146
- const rectSW = new engine_root_window_.Rectangle(newPos.x, newPos.y, rect.size.width * 2, rect.size.height * 2);
147
- return super.intersects(rectSW);
148
- }
149
- return false;
150
- }
151
- }
152
- ;// CONCATENATED MODULE: ./dist/browser/Options/Classes/LinksShadow.js
153
-
154
- class LinksShadow {
155
- constructor() {
156
- this.blur = 5;
157
- this.color = new engine_root_window_.OptionsColor();
158
- this.color.value = "#000";
159
- this.enable = false;
160
- }
161
- load(data) {
162
- if (!data) {
163
- return;
164
- }
165
- if (data.blur !== undefined) {
166
- this.blur = data.blur;
167
- }
168
- this.color = engine_root_window_.OptionsColor.create(this.color, data.color);
169
- if (data.enable !== undefined) {
170
- this.enable = data.enable;
171
- }
172
- }
173
- }
174
- ;// CONCATENATED MODULE: ./dist/browser/Options/Classes/LinksTriangle.js
175
-
176
- class LinksTriangle {
177
- constructor() {
178
- this.enable = false;
179
- this.frequency = 1;
180
- }
181
- load(data) {
182
- if (!data) {
183
- return;
184
- }
185
- if (data.color !== undefined) {
186
- this.color = engine_root_window_.OptionsColor.create(this.color, data.color);
187
- }
188
- if (data.enable !== undefined) {
189
- this.enable = data.enable;
190
- }
191
- if (data.frequency !== undefined) {
192
- this.frequency = data.frequency;
193
- }
194
- if (data.opacity !== undefined) {
195
- this.opacity = data.opacity;
196
- }
197
- }
198
- }
199
- ;// CONCATENATED MODULE: ./dist/browser/Options/Classes/Links.js
200
-
201
-
202
-
203
- class Links {
204
- constructor() {
205
- this.blink = false;
206
- this.color = new engine_root_window_.OptionsColor();
207
- this.color.value = "#fff";
208
- this.consent = false;
209
- this.distance = 100;
210
- this.enable = false;
211
- this.frequency = 1;
212
- this.opacity = 1;
213
- this.shadow = new LinksShadow();
214
- this.triangles = new LinksTriangle();
215
- this.width = 1;
216
- this.warp = false;
217
- }
218
- load(data) {
219
- if (!data) {
220
- return;
221
- }
222
- if (data.id !== undefined) {
223
- this.id = data.id;
224
- }
225
- if (data.blink !== undefined) {
226
- this.blink = data.blink;
227
- }
228
- this.color = engine_root_window_.OptionsColor.create(this.color, data.color);
229
- if (data.consent !== undefined) {
230
- this.consent = data.consent;
231
- }
232
- if (data.distance !== undefined) {
233
- this.distance = data.distance;
234
- }
235
- if (data.enable !== undefined) {
236
- this.enable = data.enable;
237
- }
238
- if (data.frequency !== undefined) {
239
- this.frequency = data.frequency;
240
- }
241
- if (data.opacity !== undefined) {
242
- this.opacity = data.opacity;
243
- }
244
- this.shadow.load(data.shadow);
245
- this.triangles.load(data.triangles);
246
- if (data.width !== undefined) {
247
- this.width = data.width;
248
- }
249
- if (data.warp !== undefined) {
250
- this.warp = data.warp;
251
- }
252
- }
253
- }
254
- ;// CONCATENATED MODULE: ./dist/browser/Linker.js
255
-
256
-
257
-
258
- function getLinkDistance(pos1, pos2, optDistance, canvasSize, warp) {
259
- const {
260
- dx,
261
- dy,
262
- distance
263
- } = (0,engine_root_window_.getDistances)(pos1, pos2);
264
- if (!warp || distance <= optDistance) {
265
- return distance;
266
- }
267
- const absDiffs = {
268
- x: Math.abs(dx),
269
- y: Math.abs(dy)
270
- },
271
- warpDistances = {
272
- x: Math.min(absDiffs.x, canvasSize.width - absDiffs.x),
273
- y: Math.min(absDiffs.y, canvasSize.height - absDiffs.y)
274
- };
275
- return Math.sqrt(warpDistances.x ** 2 + warpDistances.y ** 2);
276
- }
277
- class Linker extends engine_root_window_.ParticlesInteractorBase {
278
- constructor(container) {
279
- super(container);
280
- this._setColor = p1 => {
281
- if (!p1.options.links) {
282
- return;
283
- }
284
- const container = this.linkContainer,
285
- linksOptions = p1.options.links;
286
- let linkColor = linksOptions.id === undefined ? container.particles.linksColor : container.particles.linksColors.get(linksOptions.id);
287
- if (linkColor) {
288
- return;
289
- }
290
- const optColor = linksOptions.color;
291
- linkColor = (0,engine_root_window_.getLinkRandomColor)(optColor, linksOptions.blink, linksOptions.consent);
292
- if (linksOptions.id === undefined) {
293
- container.particles.linksColor = linkColor;
294
- } else {
295
- container.particles.linksColors.set(linksOptions.id, linkColor);
296
- }
297
- };
298
- this.linkContainer = container;
299
- }
300
- clear() {}
301
- init() {
302
- this.linkContainer.particles.linksColor = undefined;
303
- this.linkContainer.particles.linksColors = new Map();
304
- }
305
- async interact(p1) {
306
- if (!p1.options.links) {
307
- return;
308
- }
309
- p1.links = [];
310
- const pos1 = p1.getPosition(),
311
- container = this.container,
312
- canvasSize = container.canvas.size;
313
- if (pos1.x < 0 || pos1.y < 0 || pos1.x > canvasSize.width || pos1.y > canvasSize.height) {
314
- return;
315
- }
316
- const linkOpt1 = p1.options.links,
317
- optOpacity = linkOpt1.opacity,
318
- optDistance = p1.retina.linksDistance ?? 0,
319
- warp = linkOpt1.warp,
320
- range = warp ? new CircleWarp(pos1.x, pos1.y, optDistance, canvasSize) : new engine_root_window_.Circle(pos1.x, pos1.y, optDistance),
321
- query = container.particles.quadTree.query(range);
322
- for (const p2 of query) {
323
- const linkOpt2 = p2.options.links;
324
- 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)) {
325
- continue;
326
- }
327
- const pos2 = p2.getPosition();
328
- if (pos2.x < 0 || pos2.y < 0 || pos2.x > canvasSize.width || pos2.y > canvasSize.height) {
329
- continue;
330
- }
331
- const distance = getLinkDistance(pos1, pos2, optDistance, canvasSize, warp && linkOpt2.warp);
332
- if (distance > optDistance) {
333
- continue;
334
- }
335
- const opacityLine = (1 - distance / optDistance) * optOpacity;
336
- this._setColor(p1);
337
- p1.links.push({
338
- destination: p2,
339
- opacity: opacityLine
340
- });
341
- }
342
- }
343
- isEnabled(particle) {
344
- return !!particle.options.links?.enable;
345
- }
346
- loadParticlesOptions(options, ...sources) {
347
- if (!options.links) {
348
- options.links = new Links();
349
- }
350
- for (const source of sources) {
351
- options.links.load(source?.links);
352
- }
353
- }
354
- reset() {}
355
- }
356
- ;// CONCATENATED MODULE: ./dist/browser/interaction.js
357
-
358
- async function loadLinksInteraction(engine, refresh = true) {
359
- await engine.addInteractor("particlesLinks", container => new Linker(container), refresh);
360
- }
361
- ;// CONCATENATED MODULE: ./dist/browser/Utils.js
362
-
363
- function drawTriangle(context, p1, p2, p3) {
364
- context.beginPath();
365
- context.moveTo(p1.x, p1.y);
366
- context.lineTo(p2.x, p2.y);
367
- context.lineTo(p3.x, p3.y);
368
- context.closePath();
369
- }
370
- function drawLinkLine(params) {
371
- let drawn = false;
372
- const {
373
- begin,
374
- end,
375
- maxDistance,
376
- context,
377
- canvasSize,
378
- width,
379
- backgroundMask,
380
- colorLine,
381
- opacity,
382
- links
383
- } = params;
384
- if ((0,engine_root_window_.getDistance)(begin, end) <= maxDistance) {
385
- (0,engine_root_window_.drawLine)(context, begin, end);
386
- drawn = true;
387
- } else if (links.warp) {
388
- let pi1;
389
- let pi2;
390
- const endNE = {
391
- x: end.x - canvasSize.width,
392
- y: end.y
393
- };
394
- const d1 = (0,engine_root_window_.getDistances)(begin, endNE);
395
- if (d1.distance <= maxDistance) {
396
- const yi = begin.y - d1.dy / d1.dx * begin.x;
397
- pi1 = {
398
- x: 0,
399
- y: yi
400
- };
401
- pi2 = {
402
- x: canvasSize.width,
403
- y: yi
404
- };
405
- } else {
406
- const endSW = {
407
- x: end.x,
408
- y: end.y - canvasSize.height
409
- };
410
- const d2 = (0,engine_root_window_.getDistances)(begin, endSW);
411
- if (d2.distance <= maxDistance) {
412
- const yi = begin.y - d2.dy / d2.dx * begin.x;
413
- const xi = -yi / (d2.dy / d2.dx);
414
- pi1 = {
415
- x: xi,
416
- y: 0
417
- };
418
- pi2 = {
419
- x: xi,
420
- y: canvasSize.height
421
- };
422
- } else {
423
- const endSE = {
424
- x: end.x - canvasSize.width,
425
- y: end.y - canvasSize.height
426
- };
427
- const d3 = (0,engine_root_window_.getDistances)(begin, endSE);
428
- if (d3.distance <= maxDistance) {
429
- const yi = begin.y - d3.dy / d3.dx * begin.x;
430
- const xi = -yi / (d3.dy / d3.dx);
431
- pi1 = {
432
- x: xi,
433
- y: yi
434
- };
435
- pi2 = {
436
- x: pi1.x + canvasSize.width,
437
- y: pi1.y + canvasSize.height
438
- };
439
- }
440
- }
441
- }
442
- if (pi1 && pi2) {
443
- (0,engine_root_window_.drawLine)(context, begin, pi1);
444
- (0,engine_root_window_.drawLine)(context, end, pi2);
445
- drawn = true;
446
- }
447
- }
448
- if (!drawn) {
449
- return;
450
- }
451
- context.lineWidth = width;
452
- if (backgroundMask.enable) {
453
- context.globalCompositeOperation = backgroundMask.composite;
454
- }
455
- context.strokeStyle = (0,engine_root_window_.getStyleFromRgb)(colorLine, opacity);
456
- const {
457
- shadow
458
- } = links;
459
- if (shadow.enable) {
460
- const shadowColor = (0,engine_root_window_.rangeColorToRgb)(shadow.color);
461
- if (shadowColor) {
462
- context.shadowBlur = shadow.blur;
463
- context.shadowColor = (0,engine_root_window_.getStyleFromRgb)(shadowColor);
464
- }
465
- }
466
- context.stroke();
467
- }
468
- function drawLinkTriangle(params) {
469
- const {
470
- context,
471
- pos1,
472
- pos2,
473
- pos3,
474
- backgroundMask,
475
- colorTriangle,
476
- opacityTriangle
477
- } = params;
478
- drawTriangle(context, pos1, pos2, pos3);
479
- if (backgroundMask.enable) {
480
- context.globalCompositeOperation = backgroundMask.composite;
481
- }
482
- context.fillStyle = (0,engine_root_window_.getStyleFromRgb)(colorTriangle, opacityTriangle);
483
- context.fill();
484
- }
485
- function getLinkKey(ids) {
486
- ids.sort((a, b) => a - b);
487
- return ids.join("_");
488
- }
489
- function setLinkFrequency(particles, dictionary) {
490
- const key = getLinkKey(particles.map(t => t.id));
491
- let res = dictionary.get(key);
492
- if (res === undefined) {
493
- res = (0,engine_root_window_.getRandom)();
494
- dictionary.set(key, res);
495
- }
496
- return res;
497
- }
498
- ;// CONCATENATED MODULE: ./dist/browser/LinkInstance.js
499
-
500
-
501
- class LinkInstance {
502
- constructor(container) {
503
- this.container = container;
504
- this._drawLinkLine = (p1, link) => {
505
- const p1LinksOptions = p1.options.links;
506
- if (!p1LinksOptions?.enable) {
507
- return;
508
- }
509
- const container = this.container,
510
- options = container.actualOptions,
511
- p2 = link.destination,
512
- pos1 = p1.getPosition(),
513
- pos2 = p2.getPosition();
514
- let opacity = link.opacity;
515
- container.canvas.draw(ctx => {
516
- let colorLine;
517
- const twinkle = p1.options.twinkle?.lines;
518
- if (twinkle?.enable) {
519
- const twinkleFreq = twinkle.frequency,
520
- twinkleRgb = (0,engine_root_window_.rangeColorToRgb)(twinkle.color),
521
- twinkling = (0,engine_root_window_.getRandom)() < twinkleFreq;
522
- if (twinkling && twinkleRgb) {
523
- colorLine = twinkleRgb;
524
- opacity = (0,engine_root_window_.getRangeValue)(twinkle.opacity);
525
- }
526
- }
527
- if (!colorLine) {
528
- const linkColor = p1LinksOptions.id !== undefined ? container.particles.linksColors.get(p1LinksOptions.id) : container.particles.linksColor;
529
- colorLine = (0,engine_root_window_.getLinkColor)(p1, p2, linkColor);
530
- }
531
- if (!colorLine) {
532
- return;
533
- }
534
- const width = p1.retina.linksWidth ?? 0,
535
- maxDistance = p1.retina.linksDistance ?? 0,
536
- {
537
- backgroundMask
538
- } = options;
539
- drawLinkLine({
540
- context: ctx,
541
- width,
542
- begin: pos1,
543
- end: pos2,
544
- maxDistance,
545
- canvasSize: container.canvas.size,
546
- links: p1LinksOptions,
547
- backgroundMask: backgroundMask,
548
- colorLine,
549
- opacity
550
- });
551
- });
552
- };
553
- this._drawLinkTriangle = (p1, link1, link2) => {
554
- const linksOptions = p1.options.links;
555
- if (!linksOptions?.enable) {
556
- return;
557
- }
558
- const triangleOptions = linksOptions.triangles;
559
- if (!triangleOptions.enable) {
560
- return;
561
- }
562
- const container = this.container,
563
- options = container.actualOptions,
564
- p2 = link1.destination,
565
- p3 = link2.destination,
566
- opacityTriangle = triangleOptions.opacity ?? (link1.opacity + link2.opacity) / 2;
567
- if (opacityTriangle <= 0) {
568
- return;
569
- }
570
- container.canvas.draw(ctx => {
571
- const pos1 = p1.getPosition(),
572
- pos2 = p2.getPosition(),
573
- pos3 = p3.getPosition(),
574
- linksDistance = p1.retina.linksDistance ?? 0;
575
- 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) {
576
- return;
577
- }
578
- let colorTriangle = (0,engine_root_window_.rangeColorToRgb)(triangleOptions.color);
579
- if (!colorTriangle) {
580
- const linkColor = linksOptions.id !== undefined ? container.particles.linksColors.get(linksOptions.id) : container.particles.linksColor;
581
- colorTriangle = (0,engine_root_window_.getLinkColor)(p1, p2, linkColor);
582
- }
583
- if (!colorTriangle) {
584
- return;
585
- }
586
- drawLinkTriangle({
587
- context: ctx,
588
- pos1,
589
- pos2,
590
- pos3,
591
- backgroundMask: options.backgroundMask,
592
- colorTriangle,
593
- opacityTriangle
594
- });
595
- });
596
- };
597
- this._drawTriangles = (options, p1, link, p1Links) => {
598
- const p2 = link.destination;
599
- if (!(options.links?.triangles.enable && p2.options.links?.triangles.enable)) {
600
- return;
601
- }
602
- const vertices = p2.links?.filter(t => {
603
- const linkFreq = this._getLinkFrequency(p2, t.destination);
604
- return p2.options.links && linkFreq <= p2.options.links.frequency && p1Links.findIndex(l => l.destination === t.destination) >= 0;
605
- });
606
- if (!vertices?.length) {
607
- return;
608
- }
609
- for (const vertex of vertices) {
610
- const p3 = vertex.destination,
611
- triangleFreq = this._getTriangleFrequency(p1, p2, p3);
612
- if (triangleFreq > options.links.triangles.frequency) {
613
- continue;
614
- }
615
- this._drawLinkTriangle(p1, link, vertex);
616
- }
617
- };
618
- this._getLinkFrequency = (p1, p2) => {
619
- return setLinkFrequency([p1, p2], this._freqs.links);
620
- };
621
- this._getTriangleFrequency = (p1, p2, p3) => {
622
- return setLinkFrequency([p1, p2, p3], this._freqs.triangles);
623
- };
624
- this._freqs = {
625
- links: new Map(),
626
- triangles: new Map()
627
- };
628
- }
629
- drawParticle(context, particle) {
630
- const {
631
- links,
632
- options
633
- } = particle;
634
- if (!links || links.length <= 0) {
635
- return;
636
- }
637
- const p1Links = links.filter(l => options.links && this._getLinkFrequency(particle, l.destination) <= options.links.frequency);
638
- for (const link of p1Links) {
639
- this._drawTriangles(options, particle, link, p1Links);
640
- if (link.opacity > 0 && (particle.retina.linksWidth ?? 0) > 0) {
641
- this._drawLinkLine(particle, link);
642
- }
643
- }
644
- }
645
- async init() {
646
- this._freqs.links = new Map();
647
- this._freqs.triangles = new Map();
648
- }
649
- particleCreated(particle) {
650
- particle.links = [];
651
- if (!particle.options.links) {
652
- return;
653
- }
654
- const ratio = this.container.retina.pixelRatio,
655
- {
656
- retina
657
- } = particle,
658
- {
659
- distance,
660
- width
661
- } = particle.options.links;
662
- retina.linksDistance = distance * ratio;
663
- retina.linksWidth = width * ratio;
664
- }
665
- particleDestroyed(particle) {
666
- particle.links = [];
667
- }
668
- }
669
- ;// CONCATENATED MODULE: ./dist/browser/plugin.js
670
-
671
- class LinksPlugin {
672
- constructor() {
673
- this.id = "links";
674
- }
675
- getPlugin(container) {
676
- return new LinkInstance(container);
677
- }
678
- loadOptions() {}
679
- needsPlugin() {
680
- return true;
681
- }
682
- }
683
- async function loadLinksPlugin(engine, refresh = true) {
684
- const plugin = new LinksPlugin();
685
- await engine.addPlugin(plugin, refresh);
686
- }
687
- ;// CONCATENATED MODULE: ./dist/browser/index.js
688
-
689
-
690
- async function loadParticlesLinksInteraction(engine, refresh = true) {
691
- await loadLinksInteraction(engine, refresh);
692
- await loadLinksPlugin(engine, refresh);
693
- }
694
-
695
-
696
-
697
-
698
-
699
-
700
- })();
701
-
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
+ /******/
702
373
  /******/ return __webpack_exports__;
703
374
  /******/ })()
704
375
  ;