@tsparticles/plugin-trail 4.0.0-alpha.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.
Files changed (53) hide show
  1. package/877.min.js +2 -0
  2. package/877.min.js.LICENSE.txt +1 -0
  3. package/LICENSE +21 -0
  4. package/README.md +74 -0
  5. package/browser/Options/Classes/Trail.js +23 -0
  6. package/browser/Options/Classes/TrailFill.js +14 -0
  7. package/browser/Options/Interfaces/ITrail.js +1 -0
  8. package/browser/Options/Interfaces/ITrailFill.js +1 -0
  9. package/browser/TrailInstance.js +72 -0
  10. package/browser/TrailPlugin.js +24 -0
  11. package/browser/index.js +7 -0
  12. package/browser/package.json +1 -0
  13. package/browser/types.js +1 -0
  14. package/cjs/Options/Classes/Trail.js +23 -0
  15. package/cjs/Options/Classes/TrailFill.js +14 -0
  16. package/cjs/Options/Interfaces/ITrail.js +1 -0
  17. package/cjs/Options/Interfaces/ITrailFill.js +1 -0
  18. package/cjs/TrailInstance.js +72 -0
  19. package/cjs/TrailPlugin.js +24 -0
  20. package/cjs/index.js +7 -0
  21. package/cjs/package.json +1 -0
  22. package/cjs/types.js +1 -0
  23. package/dist_browser_TrailPlugin_js.js +60 -0
  24. package/esm/Options/Classes/Trail.js +23 -0
  25. package/esm/Options/Classes/TrailFill.js +14 -0
  26. package/esm/Options/Interfaces/ITrail.js +1 -0
  27. package/esm/Options/Interfaces/ITrailFill.js +1 -0
  28. package/esm/TrailInstance.js +72 -0
  29. package/esm/TrailPlugin.js +24 -0
  30. package/esm/index.js +7 -0
  31. package/esm/package.json +1 -0
  32. package/esm/types.js +1 -0
  33. package/package.json +95 -0
  34. package/report.html +40 -0
  35. package/tsparticles.plugin.trail.js +317 -0
  36. package/tsparticles.plugin.trail.min.js +2 -0
  37. package/tsparticles.plugin.trail.min.js.LICENSE.txt +1 -0
  38. package/types/Options/Classes/Trail.d.ts +10 -0
  39. package/types/Options/Classes/TrailFill.d.ts +7 -0
  40. package/types/Options/Interfaces/ITrail.d.ts +6 -0
  41. package/types/Options/Interfaces/ITrailFill.d.ts +5 -0
  42. package/types/TrailInstance.d.ts +11 -0
  43. package/types/TrailPlugin.d.ts +11 -0
  44. package/types/index.d.ts +2 -0
  45. package/types/types.d.ts +12 -0
  46. package/umd/Options/Classes/Trail.js +37 -0
  47. package/umd/Options/Classes/TrailFill.js +28 -0
  48. package/umd/Options/Interfaces/ITrail.js +12 -0
  49. package/umd/Options/Interfaces/ITrailFill.js +12 -0
  50. package/umd/TrailInstance.js +86 -0
  51. package/umd/TrailPlugin.js +38 -0
  52. package/umd/index.js +54 -0
  53. package/umd/types.js +12 -0
@@ -0,0 +1,317 @@
1
+ /*!
2
+ * Author : Matteo Bruni
3
+ * MIT license: https://opensource.org/licenses/MIT
4
+ * Demo / Generator : https://particles.js.org/
5
+ * GitHub : https://www.github.com/matteobruni/tsparticles
6
+ * How to use? : Check the GitHub README
7
+ * v4.0.0-alpha.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/).
16
+ */
17
+ (function webpackUniversalModuleDefinition(root, factory) {
18
+ if(typeof exports === 'object' && typeof module === 'object')
19
+ module.exports = factory(require("@tsparticles/engine"));
20
+ else if(typeof define === 'function' && define.amd)
21
+ define(["@tsparticles/engine"], factory);
22
+ else {
23
+ var a = typeof exports === 'object' ? factory(require("@tsparticles/engine")) : factory(root["window"]);
24
+ for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
25
+ }
26
+ })(this, (__WEBPACK_EXTERNAL_MODULE__tsparticles_engine__) => {
27
+ return /******/ (() => { // webpackBootstrap
28
+ /******/ "use strict";
29
+ /******/ var __webpack_modules__ = ({
30
+
31
+ /***/ "./dist/browser/index.js"
32
+ /*!*******************************!*\
33
+ !*** ./dist/browser/index.js ***!
34
+ \*******************************/
35
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
36
+
37
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadTrailPlugin: () => (/* binding */ loadTrailPlugin)\n/* harmony export */ });\nfunction loadTrailPlugin(engine) {\n engine.checkVersion(\"4.0.0-alpha.0\");\n engine.register(async e => {\n const {\n TrailPlugin\n } = await __webpack_require__.e(/*! import() */ \"dist_browser_TrailPlugin_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./TrailPlugin.js */ \"./dist/browser/TrailPlugin.js\"));\n e.addPlugin(new TrailPlugin(engine));\n });\n}\n\n//# sourceURL=webpack://@tsparticles/plugin-trail/./dist/browser/index.js?\n}");
38
+
39
+ /***/ },
40
+
41
+ /***/ "@tsparticles/engine"
42
+ /*!*********************************************************************************************************************************!*\
43
+ !*** external {"commonjs":"@tsparticles/engine","commonjs2":"@tsparticles/engine","amd":"@tsparticles/engine","root":"window"} ***!
44
+ \*********************************************************************************************************************************/
45
+ (module) {
46
+
47
+ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
48
+
49
+ /***/ }
50
+
51
+ /******/ });
52
+ /************************************************************************/
53
+ /******/ // The module cache
54
+ /******/ var __webpack_module_cache__ = {};
55
+ /******/
56
+ /******/ // The require function
57
+ /******/ function __webpack_require__(moduleId) {
58
+ /******/ // Check if module is in cache
59
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
60
+ /******/ if (cachedModule !== undefined) {
61
+ /******/ return cachedModule.exports;
62
+ /******/ }
63
+ /******/ // Check if module exists (development only)
64
+ /******/ if (__webpack_modules__[moduleId] === undefined) {
65
+ /******/ var e = new Error("Cannot find module '" + moduleId + "'");
66
+ /******/ e.code = 'MODULE_NOT_FOUND';
67
+ /******/ throw e;
68
+ /******/ }
69
+ /******/ // Create a new module (and put it into the cache)
70
+ /******/ var module = __webpack_module_cache__[moduleId] = {
71
+ /******/ // no module.id needed
72
+ /******/ // no module.loaded needed
73
+ /******/ exports: {}
74
+ /******/ };
75
+ /******/
76
+ /******/ // Execute the module function
77
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
78
+ /******/
79
+ /******/ // Return the exports of the module
80
+ /******/ return module.exports;
81
+ /******/ }
82
+ /******/
83
+ /******/ // expose the modules object (__webpack_modules__)
84
+ /******/ __webpack_require__.m = __webpack_modules__;
85
+ /******/
86
+ /************************************************************************/
87
+ /******/ /* webpack/runtime/define property getters */
88
+ /******/ (() => {
89
+ /******/ // define getter functions for harmony exports
90
+ /******/ __webpack_require__.d = (exports, definition) => {
91
+ /******/ for(var key in definition) {
92
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
93
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
94
+ /******/ }
95
+ /******/ }
96
+ /******/ };
97
+ /******/ })();
98
+ /******/
99
+ /******/ /* webpack/runtime/ensure chunk */
100
+ /******/ (() => {
101
+ /******/ __webpack_require__.f = {};
102
+ /******/ // This file contains only the entry chunk.
103
+ /******/ // The chunk loading function for additional chunks
104
+ /******/ __webpack_require__.e = (chunkId) => {
105
+ /******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
106
+ /******/ __webpack_require__.f[key](chunkId, promises);
107
+ /******/ return promises;
108
+ /******/ }, []));
109
+ /******/ };
110
+ /******/ })();
111
+ /******/
112
+ /******/ /* webpack/runtime/get javascript chunk filename */
113
+ /******/ (() => {
114
+ /******/ // This function allow to reference async chunks
115
+ /******/ __webpack_require__.u = (chunkId) => {
116
+ /******/ // return url for filenames based on template
117
+ /******/ return "" + chunkId + ".js";
118
+ /******/ };
119
+ /******/ })();
120
+ /******/
121
+ /******/ /* webpack/runtime/global */
122
+ /******/ (() => {
123
+ /******/ __webpack_require__.g = (function() {
124
+ /******/ if (typeof globalThis === 'object') return globalThis;
125
+ /******/ try {
126
+ /******/ return this || new Function('return this')();
127
+ /******/ } catch (e) {
128
+ /******/ if (typeof window === 'object') return window;
129
+ /******/ }
130
+ /******/ })();
131
+ /******/ })();
132
+ /******/
133
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
134
+ /******/ (() => {
135
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
136
+ /******/ })();
137
+ /******/
138
+ /******/ /* webpack/runtime/load script */
139
+ /******/ (() => {
140
+ /******/ var inProgress = {};
141
+ /******/ var dataWebpackPrefix = "@tsparticles/plugin-trail:";
142
+ /******/ // loadScript function to load a script via script tag
143
+ /******/ __webpack_require__.l = (url, done, key, chunkId) => {
144
+ /******/ if(inProgress[url]) { inProgress[url].push(done); return; }
145
+ /******/ var script, needAttach;
146
+ /******/ if(key !== undefined) {
147
+ /******/ var scripts = document.getElementsByTagName("script");
148
+ /******/ for(var i = 0; i < scripts.length; i++) {
149
+ /******/ var s = scripts[i];
150
+ /******/ if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; }
151
+ /******/ }
152
+ /******/ }
153
+ /******/ if(!script) {
154
+ /******/ needAttach = true;
155
+ /******/ script = document.createElement('script');
156
+ /******/
157
+ /******/ script.charset = 'utf-8';
158
+ /******/ if (__webpack_require__.nc) {
159
+ /******/ script.setAttribute("nonce", __webpack_require__.nc);
160
+ /******/ }
161
+ /******/ script.setAttribute("data-webpack", dataWebpackPrefix + key);
162
+ /******/
163
+ /******/ script.src = url;
164
+ /******/ }
165
+ /******/ inProgress[url] = [done];
166
+ /******/ var onScriptComplete = (prev, event) => {
167
+ /******/ // avoid mem leaks in IE.
168
+ /******/ script.onerror = script.onload = null;
169
+ /******/ clearTimeout(timeout);
170
+ /******/ var doneFns = inProgress[url];
171
+ /******/ delete inProgress[url];
172
+ /******/ script.parentNode && script.parentNode.removeChild(script);
173
+ /******/ doneFns && doneFns.forEach((fn) => (fn(event)));
174
+ /******/ if(prev) return prev(event);
175
+ /******/ }
176
+ /******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
177
+ /******/ script.onerror = onScriptComplete.bind(null, script.onerror);
178
+ /******/ script.onload = onScriptComplete.bind(null, script.onload);
179
+ /******/ needAttach && document.head.appendChild(script);
180
+ /******/ };
181
+ /******/ })();
182
+ /******/
183
+ /******/ /* webpack/runtime/make namespace object */
184
+ /******/ (() => {
185
+ /******/ // define __esModule on exports
186
+ /******/ __webpack_require__.r = (exports) => {
187
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
188
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
189
+ /******/ }
190
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
191
+ /******/ };
192
+ /******/ })();
193
+ /******/
194
+ /******/ /* webpack/runtime/publicPath */
195
+ /******/ (() => {
196
+ /******/ var scriptUrl;
197
+ /******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
198
+ /******/ var document = __webpack_require__.g.document;
199
+ /******/ if (!scriptUrl && document) {
200
+ /******/ if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')
201
+ /******/ scriptUrl = document.currentScript.src;
202
+ /******/ if (!scriptUrl) {
203
+ /******/ var scripts = document.getElementsByTagName("script");
204
+ /******/ if(scripts.length) {
205
+ /******/ var i = scripts.length - 1;
206
+ /******/ while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;
207
+ /******/ }
208
+ /******/ }
209
+ /******/ }
210
+ /******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
211
+ /******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
212
+ /******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
213
+ /******/ scriptUrl = scriptUrl.replace(/^blob:/, "").replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
214
+ /******/ __webpack_require__.p = scriptUrl;
215
+ /******/ })();
216
+ /******/
217
+ /******/ /* webpack/runtime/jsonp chunk loading */
218
+ /******/ (() => {
219
+ /******/ // no baseURI
220
+ /******/
221
+ /******/ // object to store loaded and loading chunks
222
+ /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
223
+ /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
224
+ /******/ var installedChunks = {
225
+ /******/ "tsparticles.plugin.trail": 0
226
+ /******/ };
227
+ /******/
228
+ /******/ __webpack_require__.f.j = (chunkId, promises) => {
229
+ /******/ // JSONP chunk loading for javascript
230
+ /******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;
231
+ /******/ if(installedChunkData !== 0) { // 0 means "already installed".
232
+ /******/
233
+ /******/ // a Promise means "currently loading".
234
+ /******/ if(installedChunkData) {
235
+ /******/ promises.push(installedChunkData[2]);
236
+ /******/ } else {
237
+ /******/ if(true) { // all chunks have JS
238
+ /******/ // setup Promise in chunk cache
239
+ /******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));
240
+ /******/ promises.push(installedChunkData[2] = promise);
241
+ /******/
242
+ /******/ // start chunk loading
243
+ /******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId);
244
+ /******/ // create error before stack unwound to get useful stacktrace later
245
+ /******/ var error = new Error();
246
+ /******/ var loadingEnded = (event) => {
247
+ /******/ if(__webpack_require__.o(installedChunks, chunkId)) {
248
+ /******/ installedChunkData = installedChunks[chunkId];
249
+ /******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined;
250
+ /******/ if(installedChunkData) {
251
+ /******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
252
+ /******/ var realSrc = event && event.target && event.target.src;
253
+ /******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
254
+ /******/ error.name = 'ChunkLoadError';
255
+ /******/ error.type = errorType;
256
+ /******/ error.request = realSrc;
257
+ /******/ installedChunkData[1](error);
258
+ /******/ }
259
+ /******/ }
260
+ /******/ };
261
+ /******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId);
262
+ /******/ }
263
+ /******/ }
264
+ /******/ }
265
+ /******/ };
266
+ /******/
267
+ /******/ // no prefetching
268
+ /******/
269
+ /******/ // no preloaded
270
+ /******/
271
+ /******/ // no HMR
272
+ /******/
273
+ /******/ // no HMR manifest
274
+ /******/
275
+ /******/ // no on chunks loaded
276
+ /******/
277
+ /******/ // install a JSONP callback for chunk loading
278
+ /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
279
+ /******/ var [chunkIds, moreModules, runtime] = data;
280
+ /******/ // add "moreModules" to the modules object,
281
+ /******/ // then flag all "chunkIds" as loaded and fire callback
282
+ /******/ var moduleId, chunkId, i = 0;
283
+ /******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
284
+ /******/ for(moduleId in moreModules) {
285
+ /******/ if(__webpack_require__.o(moreModules, moduleId)) {
286
+ /******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
287
+ /******/ }
288
+ /******/ }
289
+ /******/ if(runtime) var result = runtime(__webpack_require__);
290
+ /******/ }
291
+ /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
292
+ /******/ for(;i < chunkIds.length; i++) {
293
+ /******/ chunkId = chunkIds[i];
294
+ /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
295
+ /******/ installedChunks[chunkId][0]();
296
+ /******/ }
297
+ /******/ installedChunks[chunkId] = 0;
298
+ /******/ }
299
+ /******/
300
+ /******/ }
301
+ /******/
302
+ /******/ var chunkLoadingGlobal = this["webpackChunk_tsparticles_plugin_trail"] = this["webpackChunk_tsparticles_plugin_trail"] || [];
303
+ /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
304
+ /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
305
+ /******/ })();
306
+ /******/
307
+ /************************************************************************/
308
+ /******/
309
+ /******/ // startup
310
+ /******/ // Load entry module and return exports
311
+ /******/ // This entry module can't be inlined because the eval devtool is used.
312
+ /******/ var __webpack_exports__ = __webpack_require__("./dist/browser/index.js");
313
+ /******/
314
+ /******/ return __webpack_exports__;
315
+ /******/ })()
316
+ ;
317
+ });
@@ -0,0 +1,2 @@
1
+ /*! For license information please see tsparticles.plugin.trail.min.js.LICENSE.txt */
2
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine"],t);else{var r="object"==typeof exports?t(require("@tsparticles/engine")):t(e.window);for(var o in r)("object"==typeof exports?exports:e)[o]=r[o]}}(this,(e=>(()=>{var t,r,o={303(t){t.exports=e}},i={};function n(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={exports:{}};return o[e](r,r.exports,n),r.exports}n.m=o,n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((t,r)=>(n.f[r](e,t),t)),[])),n.u=e=>e+".min.js",n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),t={},r="@tsparticles/plugin-trail:",n.l=(e,o,i,a)=>{if(t[e])t[e].push(o);else{var l,s;if(void 0!==i)for(var c=document.getElementsByTagName("script"),p=0;p<c.length;p++){var u=c[p];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")==r+i){l=u;break}}l||(s=!0,(l=document.createElement("script")).charset="utf-8",n.nc&&l.setAttribute("nonce",n.nc),l.setAttribute("data-webpack",r+i),l.src=e),t[e]=[o];var d=(r,o)=>{l.onerror=l.onload=null,clearTimeout(f);var i=t[e];if(delete t[e],l.parentNode&&l.parentNode.removeChild(l),i&&i.forEach((e=>e(o))),r)return r(o)},f=setTimeout(d.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=d.bind(null,l.onerror),l.onload=d.bind(null,l.onload),s&&document.head.appendChild(l)}},n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var o=r.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=r[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{var e={576:0};n.f.j=(t,r)=>{var o=n.o(e,t)?e[t]:void 0;if(0!==o)if(o)r.push(o[2]);else{var i=new Promise(((r,i)=>o=e[t]=[r,i]));r.push(o[2]=i);var a=n.p+n.u(t),l=new Error;n.l(a,(r=>{if(n.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var i=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;l.message="Loading chunk "+t+" failed.\n("+i+": "+a+")",l.name="ChunkLoadError",l.type=i,l.request=a,o[1](l)}}),"chunk-"+t,t)}};var t=(t,r)=>{var o,i,[a,l,s]=r,c=0;if(a.some((t=>0!==e[t]))){for(o in l)n.o(l,o)&&(n.m[o]=l[o]);if(s)s(n)}for(t&&t(r);c<a.length;c++)i=a[c],n.o(e,i)&&e[i]&&e[i][0](),e[i]=0},r=this.webpackChunk_tsparticles_plugin_trail=this.webpackChunk_tsparticles_plugin_trail||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var a={};function l(e){e.checkVersion("4.0.0-alpha.0"),e.register((async t=>{const{TrailPlugin:r}=await n.e(877).then(n.bind(n,877));t.addPlugin(new r(e))}))}return n.r(a),n.d(a,{loadTrailPlugin:()=>l}),a})()));
@@ -0,0 +1 @@
1
+ /*! tsParticles Trail Plugin v4.0.0-alpha.0 by Matteo Bruni */
@@ -0,0 +1,10 @@
1
+ import { type IOptionLoader, type RecursivePartial } from "@tsparticles/engine";
2
+ import { type ITrail } from "../Interfaces/ITrail.js";
3
+ import { TrailFill } from "./TrailFill.js";
4
+ export declare class Trail implements ITrail, IOptionLoader<ITrail> {
5
+ enable: boolean;
6
+ readonly fill: TrailFill;
7
+ length: number;
8
+ constructor();
9
+ load(data?: RecursivePartial<ITrail>): void;
10
+ }
@@ -0,0 +1,7 @@
1
+ import { type IOptionLoader, OptionsColor, type RecursivePartial } from "@tsparticles/engine";
2
+ import { type ITrailFill } from "../Interfaces/ITrailFill.js";
3
+ export declare class TrailFill implements ITrailFill, IOptionLoader<ITrailFill> {
4
+ color?: OptionsColor;
5
+ image?: string;
6
+ load(data?: RecursivePartial<ITrailFill>): void;
7
+ }
@@ -0,0 +1,6 @@
1
+ import type { ITrailFill } from "./ITrailFill.js";
2
+ export interface ITrail {
3
+ enable: boolean;
4
+ fill: ITrailFill;
5
+ length: number;
6
+ }
@@ -0,0 +1,5 @@
1
+ import { type IOptionsColor } from "@tsparticles/engine";
2
+ export interface ITrailFill {
3
+ color?: string | IOptionsColor;
4
+ image?: string;
5
+ }
@@ -0,0 +1,11 @@
1
+ import { type Engine, type IContainerPlugin } from "@tsparticles/engine";
2
+ import type { TrailContainer } from "./types.js";
3
+ export declare class TrailInstance implements IContainerPlugin {
4
+ private readonly _container;
5
+ private readonly _engine;
6
+ private _trailFill?;
7
+ constructor(container: TrailContainer, engine: Engine);
8
+ canvasClear(): boolean;
9
+ init(): Promise<void>;
10
+ private readonly _initTrail;
11
+ }
@@ -0,0 +1,11 @@
1
+ import type { Container, Engine, IPlugin, RecursivePartial } from "@tsparticles/engine";
2
+ import type { ITrailOptions, TrailOptions } from "./types.js";
3
+ import { TrailInstance } from "./TrailInstance.js";
4
+ export declare class TrailPlugin implements IPlugin {
5
+ readonly id: string;
6
+ private readonly _engine;
7
+ constructor(engine: Engine);
8
+ getPlugin(container: Container): Promise<TrailInstance>;
9
+ loadOptions(options: TrailOptions, source?: RecursivePartial<ITrailOptions>): void;
10
+ needsPlugin(): boolean;
11
+ }
@@ -0,0 +1,2 @@
1
+ import { type Engine } from "@tsparticles/engine";
2
+ export declare function loadTrailPlugin(engine: Engine): void;
@@ -0,0 +1,12 @@
1
+ import type { Container, IOptions, Options } from "@tsparticles/engine";
2
+ import type { ITrail } from "./Options/Interfaces/ITrail.js";
3
+ import type { Trail } from "./Options/Classes/Trail.js";
4
+ export type ITrailOptions = IOptions & {
5
+ trail?: ITrail;
6
+ };
7
+ export type TrailOptions = Options & {
8
+ trail?: Trail;
9
+ };
10
+ export type TrailContainer = Container & {
11
+ actualOptions: TrailOptions;
12
+ };
@@ -0,0 +1,37 @@
1
+ (function (factory) {
2
+ if (typeof module === "object" && typeof module.exports === "object") {
3
+ var v = factory(require, exports);
4
+ if (v !== undefined) module.exports = v;
5
+ }
6
+ else if (typeof define === "function" && define.amd) {
7
+ define(["require", "exports", "@tsparticles/engine", "./TrailFill.js"], factory);
8
+ }
9
+ })(function (require, exports) {
10
+ "use strict";
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.Trail = void 0;
13
+ const engine_1 = require("@tsparticles/engine");
14
+ const TrailFill_js_1 = require("./TrailFill.js");
15
+ class Trail {
16
+ constructor() {
17
+ this.enable = false;
18
+ this.length = 10;
19
+ this.fill = new TrailFill_js_1.TrailFill();
20
+ }
21
+ load(data) {
22
+ if ((0, engine_1.isNull)(data)) {
23
+ return;
24
+ }
25
+ if (data.enable !== undefined) {
26
+ this.enable = data.enable;
27
+ }
28
+ if (data.fill !== undefined) {
29
+ this.fill.load(data.fill);
30
+ }
31
+ if (data.length !== undefined) {
32
+ this.length = data.length;
33
+ }
34
+ }
35
+ }
36
+ exports.Trail = Trail;
37
+ });
@@ -0,0 +1,28 @@
1
+ (function (factory) {
2
+ if (typeof module === "object" && typeof module.exports === "object") {
3
+ var v = factory(require, exports);
4
+ if (v !== undefined) module.exports = v;
5
+ }
6
+ else if (typeof define === "function" && define.amd) {
7
+ define(["require", "exports", "@tsparticles/engine"], factory);
8
+ }
9
+ })(function (require, exports) {
10
+ "use strict";
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.TrailFill = void 0;
13
+ const engine_1 = require("@tsparticles/engine");
14
+ class TrailFill {
15
+ load(data) {
16
+ if ((0, engine_1.isNull)(data)) {
17
+ return;
18
+ }
19
+ if (data.color !== undefined) {
20
+ this.color = engine_1.OptionsColor.create(this.color, data.color);
21
+ }
22
+ if (data.image !== undefined) {
23
+ this.image = data.image;
24
+ }
25
+ }
26
+ }
27
+ exports.TrailFill = TrailFill;
28
+ });
@@ -0,0 +1,12 @@
1
+ (function (factory) {
2
+ if (typeof module === "object" && typeof module.exports === "object") {
3
+ var v = factory(require, exports);
4
+ if (v !== undefined) module.exports = v;
5
+ }
6
+ else if (typeof define === "function" && define.amd) {
7
+ define(["require", "exports"], factory);
8
+ }
9
+ })(function (require, exports) {
10
+ "use strict";
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ });
@@ -0,0 +1,12 @@
1
+ (function (factory) {
2
+ if (typeof module === "object" && typeof module.exports === "object") {
3
+ var v = factory(require, exports);
4
+ if (v !== undefined) module.exports = v;
5
+ }
6
+ else if (typeof define === "function" && define.amd) {
7
+ define(["require", "exports"], factory);
8
+ }
9
+ })(function (require, exports) {
10
+ "use strict";
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ });
@@ -0,0 +1,86 @@
1
+ (function (factory) {
2
+ if (typeof module === "object" && typeof module.exports === "object") {
3
+ var v = factory(require, exports);
4
+ if (v !== undefined) module.exports = v;
5
+ }
6
+ else if (typeof define === "function" && define.amd) {
7
+ define(["require", "exports", "@tsparticles/engine"], factory);
8
+ }
9
+ })(function (require, exports) {
10
+ "use strict";
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.TrailInstance = void 0;
13
+ const engine_1 = require("@tsparticles/engine");
14
+ const minimumLength = 0;
15
+ class TrailInstance {
16
+ constructor(container, engine) {
17
+ this._initTrail = async () => {
18
+ const options = this._container.actualOptions, trail = options.trail;
19
+ if (!trail?.enable) {
20
+ return;
21
+ }
22
+ const trailFill = trail.fill, opacity = engine_1.inverseFactorNumerator / trail.length;
23
+ if (trailFill.color) {
24
+ const fillColor = (0, engine_1.rangeColorToRgb)(this._engine, trailFill.color);
25
+ if (!fillColor) {
26
+ return;
27
+ }
28
+ this._trailFill = {
29
+ color: {
30
+ ...fillColor,
31
+ },
32
+ opacity,
33
+ };
34
+ }
35
+ else {
36
+ await new Promise((resolve, reject) => {
37
+ if (!trailFill.image) {
38
+ return;
39
+ }
40
+ const img = (0, engine_1.safeDocument)().createElement("img");
41
+ img.addEventListener("load", () => {
42
+ this._trailFill = {
43
+ image: img,
44
+ opacity,
45
+ };
46
+ resolve();
47
+ });
48
+ img.addEventListener("error", evt => {
49
+ (0, engine_1.getLogger)().error(evt);
50
+ reject(new Error("Error loading image"));
51
+ });
52
+ img.src = trailFill.image;
53
+ });
54
+ }
55
+ };
56
+ this._container = container;
57
+ this._engine = engine;
58
+ }
59
+ canvasClear() {
60
+ const container = this._container, trail = container.actualOptions.trail, trailFill = this._trailFill;
61
+ if (!trail?.enable || !trailFill || trail.length <= minimumLength) {
62
+ return false;
63
+ }
64
+ let handled = false;
65
+ const canvas = container.canvas;
66
+ if (trailFill.color) {
67
+ canvas.paintBase((0, engine_1.getStyleFromRgb)(trailFill.color, container.hdr, trailFill.opacity));
68
+ handled = true;
69
+ }
70
+ else if (trailFill.image) {
71
+ canvas.paintImage(trailFill.image, trailFill.opacity);
72
+ handled = true;
73
+ }
74
+ return handled;
75
+ }
76
+ async init() {
77
+ try {
78
+ await this._initTrail();
79
+ }
80
+ catch (e) {
81
+ (0, engine_1.getLogger)().error(e);
82
+ }
83
+ }
84
+ }
85
+ exports.TrailInstance = TrailInstance;
86
+ });
@@ -0,0 +1,38 @@
1
+ (function (factory) {
2
+ if (typeof module === "object" && typeof module.exports === "object") {
3
+ var v = factory(require, exports);
4
+ if (v !== undefined) module.exports = v;
5
+ }
6
+ else if (typeof define === "function" && define.amd) {
7
+ define(["require", "exports", "./Options/Classes/Trail.js", "./TrailInstance.js"], factory);
8
+ }
9
+ })(function (require, exports) {
10
+ "use strict";
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.TrailPlugin = void 0;
13
+ const Trail_js_1 = require("./Options/Classes/Trail.js");
14
+ const TrailInstance_js_1 = require("./TrailInstance.js");
15
+ class TrailPlugin {
16
+ constructor(engine) {
17
+ this.id = "trail";
18
+ this._engine = engine;
19
+ }
20
+ getPlugin(container) {
21
+ return Promise.resolve(new TrailInstance_js_1.TrailInstance(container, this._engine));
22
+ }
23
+ loadOptions(options, source) {
24
+ if (!this.needsPlugin()) {
25
+ return;
26
+ }
27
+ let trailOptions = options.trail;
28
+ if (!trailOptions?.load) {
29
+ options.trail = trailOptions = new Trail_js_1.Trail();
30
+ }
31
+ trailOptions.load(source?.trail);
32
+ }
33
+ needsPlugin() {
34
+ return true;
35
+ }
36
+ }
37
+ exports.TrailPlugin = TrailPlugin;
38
+ });