@tsparticles/interaction-external-grab 4.0.0-beta.12 → 4.0.0-beta.16
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/browser/browser.js +5 -0
- package/browser/index.js +6 -6
- package/browser/index.lazy.js +13 -0
- package/cjs/browser.js +5 -0
- package/cjs/index.js +6 -6
- package/cjs/index.lazy.js +13 -0
- package/esm/browser.js +5 -0
- package/esm/index.js +6 -6
- package/esm/index.lazy.js +13 -0
- package/package.json +11 -4
- package/report.html +4949 -94
- package/tsparticles.interaction.external.grab.js +163 -387
- package/tsparticles.interaction.external.grab.min.js +1 -2
- package/types/browser.d.ts +1 -0
- package/types/index.lazy.d.ts +6 -0
- package/328.min.js +0 -1
- package/dist_browser_Grabber_js.js +0 -40
|
@@ -1,387 +1,163 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
(
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
/******/ }
|
|
165
|
-
/******/ }
|
|
166
|
-
/******/ };
|
|
167
|
-
/******/ })();
|
|
168
|
-
/******/
|
|
169
|
-
/******/ /* webpack/runtime/ensure chunk */
|
|
170
|
-
/******/ (() => {
|
|
171
|
-
/******/ __webpack_require__.f = {};
|
|
172
|
-
/******/ // This file contains only the entry chunk.
|
|
173
|
-
/******/ // The chunk loading function for additional chunks
|
|
174
|
-
/******/ __webpack_require__.e = (chunkId) => {
|
|
175
|
-
/******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
|
|
176
|
-
/******/ __webpack_require__.f[key](chunkId, promises);
|
|
177
|
-
/******/ return promises;
|
|
178
|
-
/******/ }, []));
|
|
179
|
-
/******/ };
|
|
180
|
-
/******/ })();
|
|
181
|
-
/******/
|
|
182
|
-
/******/ /* webpack/runtime/get javascript chunk filename */
|
|
183
|
-
/******/ (() => {
|
|
184
|
-
/******/ // This function allow to reference async chunks
|
|
185
|
-
/******/ __webpack_require__.u = (chunkId) => {
|
|
186
|
-
/******/ // return url for filenames based on template
|
|
187
|
-
/******/ return "" + chunkId + ".js";
|
|
188
|
-
/******/ };
|
|
189
|
-
/******/ })();
|
|
190
|
-
/******/
|
|
191
|
-
/******/ /* webpack/runtime/global */
|
|
192
|
-
/******/ (() => {
|
|
193
|
-
/******/ __webpack_require__.g = (function() {
|
|
194
|
-
/******/ if (typeof globalThis === 'object') return globalThis;
|
|
195
|
-
/******/ try {
|
|
196
|
-
/******/ return this || new Function('return this')();
|
|
197
|
-
/******/ } catch (e) {
|
|
198
|
-
/******/ if (typeof window === 'object') return window;
|
|
199
|
-
/******/ }
|
|
200
|
-
/******/ })();
|
|
201
|
-
/******/ })();
|
|
202
|
-
/******/
|
|
203
|
-
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
204
|
-
/******/ (() => {
|
|
205
|
-
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
206
|
-
/******/ })();
|
|
207
|
-
/******/
|
|
208
|
-
/******/ /* webpack/runtime/load script */
|
|
209
|
-
/******/ (() => {
|
|
210
|
-
/******/ var inProgress = {};
|
|
211
|
-
/******/ var dataWebpackPrefix = "@tsparticles/interaction-external-grab:";
|
|
212
|
-
/******/ // loadScript function to load a script via script tag
|
|
213
|
-
/******/ __webpack_require__.l = (url, done, key, chunkId) => {
|
|
214
|
-
/******/ if(inProgress[url]) { inProgress[url].push(done); return; }
|
|
215
|
-
/******/ var script, needAttach;
|
|
216
|
-
/******/ if(key !== undefined) {
|
|
217
|
-
/******/ var scripts = document.getElementsByTagName("script");
|
|
218
|
-
/******/ for(var i = 0; i < scripts.length; i++) {
|
|
219
|
-
/******/ var s = scripts[i];
|
|
220
|
-
/******/ if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; }
|
|
221
|
-
/******/ }
|
|
222
|
-
/******/ }
|
|
223
|
-
/******/ if(!script) {
|
|
224
|
-
/******/ needAttach = true;
|
|
225
|
-
/******/ script = document.createElement('script');
|
|
226
|
-
/******/
|
|
227
|
-
/******/ script.charset = 'utf-8';
|
|
228
|
-
/******/ if (__webpack_require__.nc) {
|
|
229
|
-
/******/ script.setAttribute("nonce", __webpack_require__.nc);
|
|
230
|
-
/******/ }
|
|
231
|
-
/******/ script.setAttribute("data-webpack", dataWebpackPrefix + key);
|
|
232
|
-
/******/
|
|
233
|
-
/******/ script.src = url;
|
|
234
|
-
/******/ }
|
|
235
|
-
/******/ inProgress[url] = [done];
|
|
236
|
-
/******/ var onScriptComplete = (prev, event) => {
|
|
237
|
-
/******/ // avoid mem leaks in IE.
|
|
238
|
-
/******/ script.onerror = script.onload = null;
|
|
239
|
-
/******/ clearTimeout(timeout);
|
|
240
|
-
/******/ var doneFns = inProgress[url];
|
|
241
|
-
/******/ delete inProgress[url];
|
|
242
|
-
/******/ script.parentNode && script.parentNode.removeChild(script);
|
|
243
|
-
/******/ doneFns && doneFns.forEach((fn) => (fn(event)));
|
|
244
|
-
/******/ if(prev) return prev(event);
|
|
245
|
-
/******/ }
|
|
246
|
-
/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
|
|
247
|
-
/******/ script.onerror = onScriptComplete.bind(null, script.onerror);
|
|
248
|
-
/******/ script.onload = onScriptComplete.bind(null, script.onload);
|
|
249
|
-
/******/ needAttach && document.head.appendChild(script);
|
|
250
|
-
/******/ };
|
|
251
|
-
/******/ })();
|
|
252
|
-
/******/
|
|
253
|
-
/******/ /* webpack/runtime/make namespace object */
|
|
254
|
-
/******/ (() => {
|
|
255
|
-
/******/ // define __esModule on exports
|
|
256
|
-
/******/ __webpack_require__.r = (exports) => {
|
|
257
|
-
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
258
|
-
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
259
|
-
/******/ }
|
|
260
|
-
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
261
|
-
/******/ };
|
|
262
|
-
/******/ })();
|
|
263
|
-
/******/
|
|
264
|
-
/******/ /* webpack/runtime/publicPath */
|
|
265
|
-
/******/ (() => {
|
|
266
|
-
/******/ var scriptUrl;
|
|
267
|
-
/******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
|
|
268
|
-
/******/ var document = __webpack_require__.g.document;
|
|
269
|
-
/******/ if (!scriptUrl && document) {
|
|
270
|
-
/******/ if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')
|
|
271
|
-
/******/ scriptUrl = document.currentScript.src;
|
|
272
|
-
/******/ if (!scriptUrl) {
|
|
273
|
-
/******/ var scripts = document.getElementsByTagName("script");
|
|
274
|
-
/******/ if(scripts.length) {
|
|
275
|
-
/******/ var i = scripts.length - 1;
|
|
276
|
-
/******/ while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;
|
|
277
|
-
/******/ }
|
|
278
|
-
/******/ }
|
|
279
|
-
/******/ }
|
|
280
|
-
/******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
|
|
281
|
-
/******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
|
|
282
|
-
/******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
|
|
283
|
-
/******/ scriptUrl = scriptUrl.replace(/^blob:/, "").replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
|
|
284
|
-
/******/ __webpack_require__.p = scriptUrl;
|
|
285
|
-
/******/ })();
|
|
286
|
-
/******/
|
|
287
|
-
/******/ /* webpack/runtime/jsonp chunk loading */
|
|
288
|
-
/******/ (() => {
|
|
289
|
-
/******/ // no baseURI
|
|
290
|
-
/******/
|
|
291
|
-
/******/ // object to store loaded and loading chunks
|
|
292
|
-
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
|
|
293
|
-
/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
|
|
294
|
-
/******/ var installedChunks = {
|
|
295
|
-
/******/ "tsparticles.interaction.external.grab": 0
|
|
296
|
-
/******/ };
|
|
297
|
-
/******/
|
|
298
|
-
/******/ __webpack_require__.f.j = (chunkId, promises) => {
|
|
299
|
-
/******/ // JSONP chunk loading for javascript
|
|
300
|
-
/******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;
|
|
301
|
-
/******/ if(installedChunkData !== 0) { // 0 means "already installed".
|
|
302
|
-
/******/
|
|
303
|
-
/******/ // a Promise means "currently loading".
|
|
304
|
-
/******/ if(installedChunkData) {
|
|
305
|
-
/******/ promises.push(installedChunkData[2]);
|
|
306
|
-
/******/ } else {
|
|
307
|
-
/******/ if(true) { // all chunks have JS
|
|
308
|
-
/******/ // setup Promise in chunk cache
|
|
309
|
-
/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));
|
|
310
|
-
/******/ promises.push(installedChunkData[2] = promise);
|
|
311
|
-
/******/
|
|
312
|
-
/******/ // start chunk loading
|
|
313
|
-
/******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId);
|
|
314
|
-
/******/ // create error before stack unwound to get useful stacktrace later
|
|
315
|
-
/******/ var error = new Error();
|
|
316
|
-
/******/ var loadingEnded = (event) => {
|
|
317
|
-
/******/ if(__webpack_require__.o(installedChunks, chunkId)) {
|
|
318
|
-
/******/ installedChunkData = installedChunks[chunkId];
|
|
319
|
-
/******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined;
|
|
320
|
-
/******/ if(installedChunkData) {
|
|
321
|
-
/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
|
|
322
|
-
/******/ var realSrc = event && event.target && event.target.src;
|
|
323
|
-
/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
|
|
324
|
-
/******/ error.name = 'ChunkLoadError';
|
|
325
|
-
/******/ error.type = errorType;
|
|
326
|
-
/******/ error.request = realSrc;
|
|
327
|
-
/******/ installedChunkData[1](error);
|
|
328
|
-
/******/ }
|
|
329
|
-
/******/ }
|
|
330
|
-
/******/ };
|
|
331
|
-
/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId);
|
|
332
|
-
/******/ }
|
|
333
|
-
/******/ }
|
|
334
|
-
/******/ }
|
|
335
|
-
/******/ };
|
|
336
|
-
/******/
|
|
337
|
-
/******/ // no prefetching
|
|
338
|
-
/******/
|
|
339
|
-
/******/ // no preloaded
|
|
340
|
-
/******/
|
|
341
|
-
/******/ // no HMR
|
|
342
|
-
/******/
|
|
343
|
-
/******/ // no HMR manifest
|
|
344
|
-
/******/
|
|
345
|
-
/******/ // no on chunks loaded
|
|
346
|
-
/******/
|
|
347
|
-
/******/ // install a JSONP callback for chunk loading
|
|
348
|
-
/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
|
|
349
|
-
/******/ var [chunkIds, moreModules, runtime] = data;
|
|
350
|
-
/******/ // add "moreModules" to the modules object,
|
|
351
|
-
/******/ // then flag all "chunkIds" as loaded and fire callback
|
|
352
|
-
/******/ var moduleId, chunkId, i = 0;
|
|
353
|
-
/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
|
|
354
|
-
/******/ for(moduleId in moreModules) {
|
|
355
|
-
/******/ if(__webpack_require__.o(moreModules, moduleId)) {
|
|
356
|
-
/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
|
|
357
|
-
/******/ }
|
|
358
|
-
/******/ }
|
|
359
|
-
/******/ if(runtime) var result = runtime(__webpack_require__);
|
|
360
|
-
/******/ }
|
|
361
|
-
/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
|
|
362
|
-
/******/ for(;i < chunkIds.length; i++) {
|
|
363
|
-
/******/ chunkId = chunkIds[i];
|
|
364
|
-
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
|
|
365
|
-
/******/ installedChunks[chunkId][0]();
|
|
366
|
-
/******/ }
|
|
367
|
-
/******/ installedChunks[chunkId] = 0;
|
|
368
|
-
/******/ }
|
|
369
|
-
/******/
|
|
370
|
-
/******/ }
|
|
371
|
-
/******/
|
|
372
|
-
/******/ var chunkLoadingGlobal = this["webpackChunk_tsparticles_interaction_external_grab"] = this["webpackChunk_tsparticles_interaction_external_grab"] || [];
|
|
373
|
-
/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
|
|
374
|
-
/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
|
|
375
|
-
/******/ })();
|
|
376
|
-
/******/
|
|
377
|
-
/************************************************************************/
|
|
378
|
-
/******/
|
|
379
|
-
/******/ // startup
|
|
380
|
-
/******/ // Load entry module and return exports
|
|
381
|
-
/******/ // This entry module can't be inlined because the eval devtool is used.
|
|
382
|
-
/******/ var __webpack_exports__ = __webpack_require__("./dist/browser/index.js");
|
|
383
|
-
/******/
|
|
384
|
-
/******/ return __webpack_exports__;
|
|
385
|
-
/******/ })()
|
|
386
|
-
;
|
|
387
|
-
});
|
|
1
|
+
(function(g){g.__tsParticlesInternals=g.__tsParticlesInternals||{};g.__tsParticlesInternals.bundles=g.__tsParticlesInternals.bundles||{};g.__tsParticlesInternals.effects=g.__tsParticlesInternals.effects||{};g.__tsParticlesInternals.engine=g.__tsParticlesInternals.engine||{};g.__tsParticlesInternals.interactions=g.__tsParticlesInternals.interactions||{};g.__tsParticlesInternals.palettes=g.__tsParticlesInternals.palettes||{};g.__tsParticlesInternals.paths=g.__tsParticlesInternals.paths||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins.emittersShapes=g.__tsParticlesInternals.plugins.emittersShapes||{};g.__tsParticlesInternals.presets=g.__tsParticlesInternals.presets||{};g.__tsParticlesInternals.shapes=g.__tsParticlesInternals.shapes||{};g.__tsParticlesInternals.updaters=g.__tsParticlesInternals.updaters||{};g.__tsParticlesInternals.utils=g.__tsParticlesInternals.utils||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas.utils=g.__tsParticlesInternals.canvas.utils||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path.utils=g.__tsParticlesInternals.path.utils||{};var __tsProxyFactory=typeof Proxy!=="undefined"?function(obj){return new Proxy(obj,{get:function(target,key){if(!(key in target)){target[key]={};}return target[key];}});}:function(obj){return obj;};g.__tsParticlesInternals.bundles=__tsProxyFactory(g.__tsParticlesInternals.bundles);g.__tsParticlesInternals.effects=__tsProxyFactory(g.__tsParticlesInternals.effects);g.__tsParticlesInternals.interactions=__tsProxyFactory(g.__tsParticlesInternals.interactions);g.__tsParticlesInternals.palettes=__tsProxyFactory(g.__tsParticlesInternals.palettes);g.__tsParticlesInternals.paths=__tsProxyFactory(g.__tsParticlesInternals.paths);g.__tsParticlesInternals.plugins=__tsProxyFactory(g.__tsParticlesInternals.plugins);g.__tsParticlesInternals.plugins.emittersShapes=__tsProxyFactory(g.__tsParticlesInternals.plugins.emittersShapes);g.__tsParticlesInternals.presets=__tsProxyFactory(g.__tsParticlesInternals.presets);g.__tsParticlesInternals.shapes=__tsProxyFactory(g.__tsParticlesInternals.shapes);g.__tsParticlesInternals.updaters=__tsProxyFactory(g.__tsParticlesInternals.updaters);g.__tsParticlesInternals.utils=__tsProxyFactory(g.__tsParticlesInternals.utils);g.__tsParticlesInternals.canvas=__tsProxyFactory(g.__tsParticlesInternals.canvas);g.__tsParticlesInternals.path=__tsProxyFactory(g.__tsParticlesInternals.path);g.tsparticlesInternalExports=g.tsparticlesInternalExports||{};})(typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:this);
|
|
2
|
+
/* External Interaction v4.0.0-beta.16 */
|
|
3
|
+
(function (global, factory) {
|
|
4
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tsparticles/plugin-interactivity'), require('@tsparticles/engine'), require('@tsparticles/canvas-utils')) :
|
|
5
|
+
typeof define === 'function' && define.amd ? define(['exports', '@tsparticles/plugin-interactivity', '@tsparticles/engine', '@tsparticles/canvas-utils'], factory) :
|
|
6
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.__tsParticlesInternals = global.__tsParticlesInternals || {}, global.__tsParticlesInternals.interactions = global.__tsParticlesInternals.interactions || {}, global.__tsParticlesInternals.interactions.externalGrab = global.__tsParticlesInternals.interactions.externalGrab || {}), global.__tsParticlesInternals.plugins.interactivity, global.__tsParticlesInternals.engine, global.__tsParticlesInternals.canvas.utils));
|
|
7
|
+
})(this, (function (exports, pluginInteractivity, engine, canvasUtils) { 'use strict';
|
|
8
|
+
|
|
9
|
+
class GrabLinks {
|
|
10
|
+
blink;
|
|
11
|
+
color;
|
|
12
|
+
consent;
|
|
13
|
+
opacity;
|
|
14
|
+
constructor() {
|
|
15
|
+
this.blink = false;
|
|
16
|
+
this.consent = false;
|
|
17
|
+
this.opacity = 1;
|
|
18
|
+
}
|
|
19
|
+
load(data) {
|
|
20
|
+
if (engine.isNull(data)) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
if (data.blink !== undefined) {
|
|
24
|
+
this.blink = data.blink;
|
|
25
|
+
}
|
|
26
|
+
if (data.color !== undefined) {
|
|
27
|
+
this.color = engine.OptionsColor.create(this.color, data.color);
|
|
28
|
+
}
|
|
29
|
+
if (data.consent !== undefined) {
|
|
30
|
+
this.consent = data.consent;
|
|
31
|
+
}
|
|
32
|
+
if (data.opacity !== undefined) {
|
|
33
|
+
this.opacity = data.opacity;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
class Grab {
|
|
39
|
+
distance;
|
|
40
|
+
links;
|
|
41
|
+
constructor() {
|
|
42
|
+
this.distance = 100;
|
|
43
|
+
this.links = new GrabLinks();
|
|
44
|
+
}
|
|
45
|
+
load(data) {
|
|
46
|
+
if (engine.isNull(data)) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
if (data.distance !== undefined) {
|
|
50
|
+
this.distance = data.distance;
|
|
51
|
+
}
|
|
52
|
+
this.links.load(data.links);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const defaultWidth = 0;
|
|
57
|
+
function drawGrabLine(context, width, begin, end, colorLine, opacity, hdr = false) {
|
|
58
|
+
canvasUtils.drawLine(context, begin, end);
|
|
59
|
+
context.strokeStyle = engine.getStyleFromRgb(colorLine, hdr, opacity);
|
|
60
|
+
context.lineWidth = width;
|
|
61
|
+
context.stroke();
|
|
62
|
+
}
|
|
63
|
+
function drawGrab(container, particle, lineColor, opacity, mousePos) {
|
|
64
|
+
container.canvas.render.draw(ctx => {
|
|
65
|
+
const beginPos = particle.getPosition();
|
|
66
|
+
drawGrabLine(ctx, particle.retina.linksWidth ?? defaultWidth, beginPos, mousePos, lineColor, opacity, container.hdr);
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const grabMode = "grab", minDistance = 0, minOpacity = 0;
|
|
71
|
+
class Grabber extends pluginInteractivity.ExternalInteractorBase {
|
|
72
|
+
_maxDistance;
|
|
73
|
+
_pluginManager;
|
|
74
|
+
constructor(pluginManager, container) {
|
|
75
|
+
super(container);
|
|
76
|
+
this._pluginManager = pluginManager;
|
|
77
|
+
this._maxDistance = 0;
|
|
78
|
+
}
|
|
79
|
+
get maxDistance() {
|
|
80
|
+
return this._maxDistance;
|
|
81
|
+
}
|
|
82
|
+
clear() {
|
|
83
|
+
}
|
|
84
|
+
init() {
|
|
85
|
+
const container = this.container, grab = container.actualOptions.interactivity?.modes.grab;
|
|
86
|
+
if (!grab) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
this._maxDistance = grab.distance;
|
|
90
|
+
container.retina.grabModeDistance = grab.distance * container.retina.pixelRatio;
|
|
91
|
+
}
|
|
92
|
+
interact(interactivityData) {
|
|
93
|
+
const container = this.container, options = container.actualOptions, interactivity = options.interactivity;
|
|
94
|
+
if (!interactivity?.modes.grab ||
|
|
95
|
+
!interactivity.events.onHover.enable ||
|
|
96
|
+
interactivityData.status !== pluginInteractivity.mouseMoveEvent) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
const mousePos = interactivityData.mouse.position;
|
|
100
|
+
if (!mousePos) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
const distance = container.retina.grabModeDistance;
|
|
104
|
+
if (!distance || distance < minDistance) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
const query = container.particles.grid.queryCircle(mousePos, distance, p => this.isEnabled(interactivityData, p));
|
|
108
|
+
for (const particle of query) {
|
|
109
|
+
const pos = particle.getPosition(), pointDistance = engine.getDistance(pos, mousePos);
|
|
110
|
+
if (pointDistance > distance) {
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
const grabLineOptions = interactivity.modes.grab.links, lineOpacity = grabLineOptions.opacity, opacityLine = lineOpacity - (pointDistance * lineOpacity) / distance;
|
|
114
|
+
if (opacityLine <= minOpacity) {
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
const optColor = grabLineOptions.color ?? particle.options.links?.color;
|
|
118
|
+
if (!container.particles.grabLineColor && optColor) {
|
|
119
|
+
const linksOptions = interactivity.modes.grab.links;
|
|
120
|
+
container.particles.grabLineColor = engine.getLinkRandomColor(this._pluginManager, optColor, linksOptions.blink, linksOptions.consent);
|
|
121
|
+
}
|
|
122
|
+
const colorLine = engine.getLinkColor(particle, undefined, container.particles.grabLineColor);
|
|
123
|
+
if (!colorLine) {
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
drawGrab(container, particle, colorLine, opacityLine, mousePos);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
isEnabled(interactivityData, particle) {
|
|
130
|
+
const container = this.container, mouse = interactivityData.mouse, events = (particle?.interactivity ?? container.actualOptions.interactivity)?.events;
|
|
131
|
+
return !!events?.onHover.enable && !!mouse.position && engine.isInArray(grabMode, events.onHover.mode);
|
|
132
|
+
}
|
|
133
|
+
loadModeOptions(options, ...sources) {
|
|
134
|
+
options.grab ??= new Grab();
|
|
135
|
+
for (const source of sources) {
|
|
136
|
+
options.grab.load(source?.grab);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
reset() {
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
async function loadExternalGrabInteraction(engine) {
|
|
144
|
+
engine.checkVersion("4.0.0-beta.16");
|
|
145
|
+
await engine.pluginManager.register((e) => {
|
|
146
|
+
pluginInteractivity.ensureInteractivityPluginLoaded(e);
|
|
147
|
+
e.pluginManager.addInteractor?.("externalGrab", container => {
|
|
148
|
+
return Promise.resolve(new Grabber(e.pluginManager, container));
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
const globalObject = globalThis;
|
|
154
|
+
globalObject.__tsParticlesInternals = globalObject.__tsParticlesInternals ?? {};
|
|
155
|
+
globalObject.loadExternalGrabInteraction = loadExternalGrabInteraction;
|
|
156
|
+
|
|
157
|
+
exports.Grab = Grab;
|
|
158
|
+
exports.GrabLinks = GrabLinks;
|
|
159
|
+
exports.loadExternalGrabInteraction = loadExternalGrabInteraction;
|
|
160
|
+
|
|
161
|
+
}));
|
|
162
|
+
Object.assign(globalThis.window || globalThis, { loadExternalGrabInteraction: (globalThis.__tsParticlesInternals.interactions.externalGrab || {}).loadExternalGrabInteraction });
|
|
163
|
+
delete (globalThis.window || globalThis).tsparticlesInternalExports;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
!function(
|
|
2
|
-
(`+n+": "+o+")",a.name="ChunkLoadError",a.type=n,a.request=o,r[1](a)}},"chunk-"+e,e)}},n=(e,t)=>{var r,n,[o,a,s]=t,l=0;if(o.some(e=>0!==i[e])){for(r in a)c.o(a,r)&&(c.m[r]=a[r]);s&&s(c)}for(e&&e(t);l<o.length;l++)n=o[l],c.o(i,n)&&i[n]&&i[n][0](),i[n]=0},(o=this.webpackChunk_tsparticles_interaction_external_grab=this.webpackChunk_tsparticles_interaction_external_grab||[]).forEach(n.bind(null,0)),o.push=n.bind(null,o.push.bind(o));var g={};c.r(g),c.d(g,{Grab:()=>v.f,GrabLinks:()=>y.q,loadExternalGrabInteraction:()=>m});var v=c(620),y=c(127);async function m(e){e.checkVersion("4.0.0-beta.12"),await e.pluginManager.register(async e=>{let{ensureInteractivityPluginLoaded:t}=await Promise.resolve().then(c.t.bind(c,702,19));t(e),e.pluginManager.addInteractor?.("externalGrab",async t=>{let{Grabber:r}=await c.e(328).then(c.bind(c,328));return new r(e.pluginManager,t)})})}return g})());
|
|
1
|
+
!function(t){t.__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.bundles=t.__tsParticlesInternals.bundles||{},t.__tsParticlesInternals.effects=t.__tsParticlesInternals.effects||{},t.__tsParticlesInternals.engine=t.__tsParticlesInternals.engine||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.palettes=t.__tsParticlesInternals.palettes||{},t.__tsParticlesInternals.paths=t.__tsParticlesInternals.paths||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins.emittersShapes=t.__tsParticlesInternals.plugins.emittersShapes||{},t.__tsParticlesInternals.presets=t.__tsParticlesInternals.presets||{},t.__tsParticlesInternals.shapes=t.__tsParticlesInternals.shapes||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.utils=t.__tsParticlesInternals.utils||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas.utils=t.__tsParticlesInternals.canvas.utils||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path.utils=t.__tsParticlesInternals.path.utils||{};var s="undefined"!=typeof Proxy?function(t){return new Proxy(t,{get:function(t,s){return s in t||(t[s]={}),t[s]}})}:function(t){return t};t.__tsParticlesInternals.bundles=s(t.__tsParticlesInternals.bundles),t.__tsParticlesInternals.effects=s(t.__tsParticlesInternals.effects),t.__tsParticlesInternals.interactions=s(t.__tsParticlesInternals.interactions),t.__tsParticlesInternals.palettes=s(t.__tsParticlesInternals.palettes),t.__tsParticlesInternals.paths=s(t.__tsParticlesInternals.paths),t.__tsParticlesInternals.plugins=s(t.__tsParticlesInternals.plugins),t.__tsParticlesInternals.plugins.emittersShapes=s(t.__tsParticlesInternals.plugins.emittersShapes),t.__tsParticlesInternals.presets=s(t.__tsParticlesInternals.presets),t.__tsParticlesInternals.shapes=s(t.__tsParticlesInternals.shapes),t.__tsParticlesInternals.updaters=s(t.__tsParticlesInternals.updaters),t.__tsParticlesInternals.utils=s(t.__tsParticlesInternals.utils),t.__tsParticlesInternals.canvas=s(t.__tsParticlesInternals.canvas),t.__tsParticlesInternals.path=s(t.__tsParticlesInternals.path),t.tsparticlesInternalExports=t.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t,s){"object"==typeof exports&&"undefined"!=typeof module?s(exports,require("@tsparticles/plugin-interactivity"),require("@tsparticles/engine"),require("@tsparticles/canvas-utils")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/plugin-interactivity","@tsparticles/engine","@tsparticles/canvas-utils"],s):s(((t="undefined"!=typeof globalThis?globalThis:t||self).__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.interactions.externalGrab=t.__tsParticlesInternals.interactions.externalGrab||{}),t.__tsParticlesInternals.plugins.interactivity,t.__tsParticlesInternals.engine,t.__tsParticlesInternals.canvas.utils)}(this,function(t,s,e,n){"use strict";class a{blink;color;consent;opacity;constructor(){this.blink=!1,this.consent=!1,this.opacity=1}load(t){e.isNull(t)||(void 0!==t.blink&&(this.blink=t.blink),void 0!==t.color&&(this.color=e.OptionsColor.create(this.color,t.color)),void 0!==t.consent&&(this.consent=t.consent),void 0!==t.opacity&&(this.opacity=t.opacity))}}class r{distance;links;constructor(){this.distance=100,this.links=new a}load(t){e.isNull(t)||(void 0!==t.distance&&(this.distance=t.distance),this.links.load(t.links))}}function i(t,s,a,r,i){t.canvas.render.draw(l=>{const c=s.getPosition();!function(t,s,a,r,i,l,c=!1){n.drawLine(t,a,r),t.strokeStyle=e.getStyleFromRgb(i,c,l),t.lineWidth=s,t.stroke()}(l,s.retina.linksWidth??0,c,i,a,r,t.hdr)})}class l extends s.ExternalInteractorBase{_maxDistance;_pluginManager;constructor(t,s){super(s),this._pluginManager=t,this._maxDistance=0}get maxDistance(){return this._maxDistance}clear(){}init(){const t=this.container,s=t.actualOptions.interactivity?.modes.grab;s&&(this._maxDistance=s.distance,t.retina.grabModeDistance=s.distance*t.retina.pixelRatio)}interact(t){const n=this.container,a=n.actualOptions.interactivity;if(!a?.modes.grab||!a.events.onHover.enable||t.status!==s.mouseMoveEvent)return;const r=t.mouse.position;if(!r)return;const l=n.retina.grabModeDistance;if(!l||l<0)return;const c=n.particles.grid.queryCircle(r,l,s=>this.isEnabled(t,s));for(const t of c){const s=t.getPosition(),c=e.getDistance(s,r);if(c>l)continue;const o=a.modes.grab.links,_=o.opacity,p=_-c*_/l;if(p<=0)continue;const I=o.color??t.options.links?.color;if(!n.particles.grabLineColor&&I){const t=a.modes.grab.links;n.particles.grabLineColor=e.getLinkRandomColor(this._pluginManager,I,t.blink,t.consent)}const u=e.getLinkColor(t,void 0,n.particles.grabLineColor);u&&i(n,t,u,p,r)}}isEnabled(t,s){const n=this.container,a=t.mouse,r=(s?.interactivity??n.actualOptions.interactivity)?.events;return!!r?.onHover.enable&&!!a.position&&e.isInArray("grab",r.onHover.mode)}loadModeOptions(t,...s){t.grab??=new r;for(const e of s)t.grab.load(e?.grab)}reset(){}}async function c(t){t.checkVersion("4.0.0-beta.16"),await t.pluginManager.register(t=>{s.ensureInteractivityPluginLoaded(t),t.pluginManager.addInteractor?.("externalGrab",s=>Promise.resolve(new l(t.pluginManager,s)))})}const o=globalThis;o.__tsParticlesInternals=o.__tsParticlesInternals??{},o.loadExternalGrabInteraction=c,t.Grab=r,t.GrabLinks=a,t.loadExternalGrabInteraction=c}),Object.assign(globalThis.window||globalThis,{loadExternalGrabInteraction:(globalThis.__tsParticlesInternals.interactions.externalGrab||{}).loadExternalGrabInteraction}),delete(globalThis.window||globalThis).tsparticlesInternalExports;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./index.js";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type Engine } from "@tsparticles/engine/lazy";
|
|
2
|
+
export declare function loadExternalGrabInteraction(engine: Engine): Promise<void>;
|
|
3
|
+
export * from "./Options/Classes/Grab.js";
|
|
4
|
+
export * from "./Options/Classes/GrabLinks.js";
|
|
5
|
+
export type * from "./Options/Interfaces/IGrab.js";
|
|
6
|
+
export type * from "./Options/Interfaces/IGrabLinks.js";
|