@tsparticles/plugin-trail 4.5.3 → 4.6.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.
- package/browser/index.js +1 -1
- package/browser/index.lazy.js +1 -1
- package/cjs/Options/Classes/Trail.js +11 -7
- package/cjs/Options/Classes/TrailFill.js +9 -5
- package/cjs/Options/Interfaces/ITrail.js +2 -1
- package/cjs/Options/Interfaces/ITrailFill.js +2 -1
- package/cjs/TrailPlugin.js +7 -3
- package/cjs/TrailPluginInstance.js +13 -9
- package/cjs/browser.js +19 -3
- package/cjs/index.js +7 -4
- package/cjs/index.lazy.js +5 -2
- package/cjs/types.js +2 -1
- package/esm/index.js +1 -1
- package/esm/index.lazy.js +1 -1
- package/package.json +2 -2
- package/tsparticles.plugin.trail.js +2 -2
- package/tsparticles.plugin.trail.min.js +1 -1
package/browser/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TrailPlugin } from "./TrailPlugin.js";
|
|
2
2
|
export async function loadTrailPlugin(engine) {
|
|
3
|
-
engine.checkVersion("4.
|
|
3
|
+
engine.checkVersion("4.6.0");
|
|
4
4
|
await engine.pluginManager.register(e => {
|
|
5
5
|
e.pluginManager.addPlugin(new TrailPlugin(e.pluginManager));
|
|
6
6
|
});
|
package/browser/index.lazy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadTrailPlugin(engine) {
|
|
2
|
-
engine.checkVersion("4.
|
|
2
|
+
engine.checkVersion("4.6.0");
|
|
3
3
|
await engine.pluginManager.register(async (e) => {
|
|
4
4
|
const { TrailPlugin } = await import("./TrailPlugin.js");
|
|
5
5
|
e.pluginManager.addPlugin(new TrailPlugin(e.pluginManager));
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Trail = void 0;
|
|
4
|
+
const engine_1 = require("@tsparticles/engine");
|
|
5
|
+
const TrailFill_js_1 = require("./TrailFill.js");
|
|
6
|
+
class Trail {
|
|
4
7
|
enable = false;
|
|
5
|
-
fill = new TrailFill();
|
|
8
|
+
fill = new TrailFill_js_1.TrailFill();
|
|
6
9
|
length = 10;
|
|
7
10
|
load(data) {
|
|
8
|
-
if (isNull(data)) {
|
|
11
|
+
if ((0, engine_1.isNull)(data)) {
|
|
9
12
|
return;
|
|
10
13
|
}
|
|
11
|
-
loadProperty(this, "enable", data.enable);
|
|
14
|
+
(0, engine_1.loadProperty)(this, "enable", data.enable);
|
|
12
15
|
if (data.fill !== undefined) {
|
|
13
16
|
this.fill.load(data.fill);
|
|
14
17
|
}
|
|
15
|
-
loadProperty(this, "length", data.length);
|
|
18
|
+
(0, engine_1.loadProperty)(this, "length", data.length);
|
|
16
19
|
}
|
|
17
20
|
}
|
|
21
|
+
exports.Trail = Trail;
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TrailFill = void 0;
|
|
4
|
+
const engine_1 = require("@tsparticles/engine");
|
|
5
|
+
class TrailFill {
|
|
3
6
|
color;
|
|
4
7
|
image;
|
|
5
8
|
load(data) {
|
|
6
|
-
if (isNull(data)) {
|
|
9
|
+
if ((0, engine_1.isNull)(data)) {
|
|
7
10
|
return;
|
|
8
11
|
}
|
|
9
12
|
if (data.color !== undefined) {
|
|
10
|
-
this.color = OptionsColor.create(this.color, data.color);
|
|
13
|
+
this.color = engine_1.OptionsColor.create(this.color, data.color);
|
|
11
14
|
}
|
|
12
|
-
loadProperty(this, "image", data.image);
|
|
15
|
+
(0, engine_1.loadProperty)(this, "image", data.image);
|
|
13
16
|
}
|
|
14
17
|
}
|
|
18
|
+
exports.TrailFill = TrailFill;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/cjs/TrailPlugin.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TrailPlugin = void 0;
|
|
4
|
+
const Trail_js_1 = require("./Options/Classes/Trail.js");
|
|
5
|
+
class TrailPlugin {
|
|
3
6
|
id = "trail";
|
|
4
7
|
#pluginManager;
|
|
5
8
|
constructor(pluginManager) {
|
|
@@ -15,7 +18,7 @@ export class TrailPlugin {
|
|
|
15
18
|
}
|
|
16
19
|
let trailOptions = options.trail;
|
|
17
20
|
if (!trailOptions?.load) {
|
|
18
|
-
options.trail = trailOptions = new Trail();
|
|
21
|
+
options.trail = trailOptions = new Trail_js_1.Trail();
|
|
19
22
|
}
|
|
20
23
|
trailOptions.load(source?.trail);
|
|
21
24
|
}
|
|
@@ -23,3 +26,4 @@ export class TrailPlugin {
|
|
|
23
26
|
return true;
|
|
24
27
|
}
|
|
25
28
|
}
|
|
29
|
+
exports.TrailPlugin = TrailPlugin;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TrailPluginInstance = void 0;
|
|
4
|
+
const engine_1 = require("@tsparticles/engine");
|
|
2
5
|
const minimumLength = 0;
|
|
3
|
-
|
|
4
|
-
layer = DrawLayer.PluginContent;
|
|
6
|
+
class TrailPluginInstance {
|
|
7
|
+
layer = engine_1.DrawLayer.PluginContent;
|
|
5
8
|
#container;
|
|
6
9
|
#pluginManager;
|
|
7
10
|
#trailFill;
|
|
@@ -17,7 +20,7 @@ export class TrailPluginInstance {
|
|
|
17
20
|
let handled = false;
|
|
18
21
|
const canvas = container.canvas;
|
|
19
22
|
if (trailFill.color) {
|
|
20
|
-
canvas.render.paintBase(getStyleFromRgb(trailFill.color, container.hdr, trailFill.opacity, container.peakNits, container.hdrMode));
|
|
23
|
+
canvas.render.paintBase((0, engine_1.getStyleFromRgb)(trailFill.color, container.hdr, trailFill.opacity, container.peakNits, container.hdrMode));
|
|
21
24
|
handled = true;
|
|
22
25
|
}
|
|
23
26
|
else if (trailFill.image) {
|
|
@@ -31,7 +34,7 @@ export class TrailPluginInstance {
|
|
|
31
34
|
await this.#initTrail();
|
|
32
35
|
}
|
|
33
36
|
catch (e) {
|
|
34
|
-
getLogger().error(e);
|
|
37
|
+
(0, engine_1.getLogger)().error(e);
|
|
35
38
|
}
|
|
36
39
|
}
|
|
37
40
|
async #initTrail() {
|
|
@@ -39,9 +42,9 @@ export class TrailPluginInstance {
|
|
|
39
42
|
if (!trail?.enable) {
|
|
40
43
|
return;
|
|
41
44
|
}
|
|
42
|
-
const trailFill = trail.fill, opacity = inverseFactorNumerator / trail.length;
|
|
45
|
+
const trailFill = trail.fill, opacity = engine_1.inverseFactorNumerator / trail.length;
|
|
43
46
|
if (trailFill.color) {
|
|
44
|
-
const fillColor = rangeColorToRgb(this.#pluginManager, trailFill.color);
|
|
47
|
+
const fillColor = (0, engine_1.rangeColorToRgb)(this.#pluginManager, trailFill.color);
|
|
45
48
|
if (!fillColor) {
|
|
46
49
|
return;
|
|
47
50
|
}
|
|
@@ -57,7 +60,7 @@ export class TrailPluginInstance {
|
|
|
57
60
|
if (!trailFill.image) {
|
|
58
61
|
return;
|
|
59
62
|
}
|
|
60
|
-
const img = safeDocument().createElement("img");
|
|
63
|
+
const img = (0, engine_1.safeDocument)().createElement("img");
|
|
61
64
|
img.addEventListener("load", () => {
|
|
62
65
|
this.#trailFill = {
|
|
63
66
|
image: img,
|
|
@@ -66,7 +69,7 @@ export class TrailPluginInstance {
|
|
|
66
69
|
resolve();
|
|
67
70
|
});
|
|
68
71
|
img.addEventListener("error", evt => {
|
|
69
|
-
getLogger().error(evt);
|
|
72
|
+
(0, engine_1.getLogger)().error(evt);
|
|
70
73
|
reject(new Error("Error loading image"));
|
|
71
74
|
});
|
|
72
75
|
img.src = trailFill.image;
|
|
@@ -74,3 +77,4 @@ export class TrailPluginInstance {
|
|
|
74
77
|
}
|
|
75
78
|
}
|
|
76
79
|
}
|
|
80
|
+
exports.TrailPluginInstance = TrailPluginInstance;
|
package/cjs/browser.js
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
const index_js_1 = require("./index.js");
|
|
2
18
|
const globalObject = globalThis;
|
|
3
19
|
globalObject.__tsParticlesInternals = globalObject.__tsParticlesInternals ?? {};
|
|
4
|
-
globalObject.loadTrailPlugin = loadTrailPlugin;
|
|
5
|
-
|
|
20
|
+
globalObject.loadTrailPlugin = index_js_1.loadTrailPlugin;
|
|
21
|
+
__exportStar(require("./index.js"), exports);
|
package/cjs/index.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loadTrailPlugin = loadTrailPlugin;
|
|
4
|
+
const TrailPlugin_js_1 = require("./TrailPlugin.js");
|
|
5
|
+
async function loadTrailPlugin(engine) {
|
|
6
|
+
engine.checkVersion("4.6.0");
|
|
4
7
|
await engine.pluginManager.register(e => {
|
|
5
|
-
e.pluginManager.addPlugin(new TrailPlugin(e.pluginManager));
|
|
8
|
+
e.pluginManager.addPlugin(new TrailPlugin_js_1.TrailPlugin(e.pluginManager));
|
|
6
9
|
});
|
|
7
10
|
}
|
package/cjs/index.lazy.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loadTrailPlugin = loadTrailPlugin;
|
|
4
|
+
async function loadTrailPlugin(engine) {
|
|
5
|
+
engine.checkVersion("4.6.0");
|
|
3
6
|
await engine.pluginManager.register(async (e) => {
|
|
4
7
|
const { TrailPlugin } = await import("./TrailPlugin.js");
|
|
5
8
|
e.pluginManager.addPlugin(new TrailPlugin(e.pluginManager));
|
package/cjs/types.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TrailPlugin } from "./TrailPlugin.js";
|
|
2
2
|
export async function loadTrailPlugin(engine) {
|
|
3
|
-
engine.checkVersion("4.
|
|
3
|
+
engine.checkVersion("4.6.0");
|
|
4
4
|
await engine.pluginManager.register(e => {
|
|
5
5
|
e.pluginManager.addPlugin(new TrailPlugin(e.pluginManager));
|
|
6
6
|
});
|
package/esm/index.lazy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadTrailPlugin(engine) {
|
|
2
|
-
engine.checkVersion("4.
|
|
2
|
+
engine.checkVersion("4.6.0");
|
|
3
3
|
await engine.pluginManager.register(async (e) => {
|
|
4
4
|
const { TrailPlugin } = await import("./TrailPlugin.js");
|
|
5
5
|
e.pluginManager.addPlugin(new TrailPlugin(e.pluginManager));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/plugin-trail",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.6.0",
|
|
4
4
|
"description": "tsParticles trail plugin",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"./package.json": "./package.json"
|
|
93
93
|
},
|
|
94
94
|
"peerDependencies": {
|
|
95
|
-
"@tsparticles/engine": "4.
|
|
95
|
+
"@tsparticles/engine": "4.6.0"
|
|
96
96
|
},
|
|
97
97
|
"publishConfig": {
|
|
98
98
|
"access": "public"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
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);})(typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:this);
|
|
2
2
|
(function (g) {
|
|
3
|
-
/* Plugin v4.
|
|
3
|
+
/* Plugin v4.6.0 */
|
|
4
4
|
g.__tsParticlesInternals = g.__tsParticlesInternals || {};
|
|
5
5
|
g.__tsParticlesInternals.plugins = g.__tsParticlesInternals.plugins || {};
|
|
6
6
|
(function (exports, engine) {
|
|
@@ -62,7 +62,7 @@ g.__tsParticlesInternals.plugins = g.__tsParticlesInternals.plugins || {};
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
async function loadTrailPlugin(engine) {
|
|
65
|
-
engine.checkVersion("4.
|
|
65
|
+
engine.checkVersion("4.6.0");
|
|
66
66
|
await engine.pluginManager.register(e => {
|
|
67
67
|
e.pluginManager.addPlugin(new TrailPlugin(e.pluginManager));
|
|
68
68
|
});
|
|
@@ -1 +1 @@
|
|
|
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)}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t){t.__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},function(t,s){"use strict";class e{color;image;load(t){s.isNull(t)||(void 0!==t.color&&(this.color=s.OptionsColor.create(this.color,t.color)),s.loadProperty(this,"image",t.image))}}class n{enable=!1;fill=new e;length=10;load(t){s.isNull(t)||(s.loadProperty(this,"enable",t.enable),void 0!==t.fill&&this.fill.load(t.fill),s.loadProperty(this,"length",t.length))}}class a{id="trail";#t;constructor(t){this.#t=t}async getPlugin(t){const{TrailPluginInstance:s}=await Promise.resolve().then(function(){return i});return new s(this.#t,t)}loadOptions(t,s,e){if(!this.needsPlugin())return;let a=s.trail;a?.load||(s.trail=a=new n),a.load(e?.trail)}needsPlugin(){return!0}}async function l(t){t.checkVersion("4.
|
|
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)}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t){t.__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},function(t,s){"use strict";class e{color;image;load(t){s.isNull(t)||(void 0!==t.color&&(this.color=s.OptionsColor.create(this.color,t.color)),s.loadProperty(this,"image",t.image))}}class n{enable=!1;fill=new e;length=10;load(t){s.isNull(t)||(s.loadProperty(this,"enable",t.enable),void 0!==t.fill&&this.fill.load(t.fill),s.loadProperty(this,"length",t.length))}}class a{id="trail";#t;constructor(t){this.#t=t}async getPlugin(t){const{TrailPluginInstance:s}=await Promise.resolve().then(function(){return i});return new s(this.#t,t)}loadOptions(t,s,e){if(!this.needsPlugin())return;let a=s.trail;a?.load||(s.trail=a=new n),a.load(e?.trail)}needsPlugin(){return!0}}async function l(t){t.checkVersion("4.6.0"),await t.pluginManager.register(t=>{t.pluginManager.addPlugin(new a(t.pluginManager))})}const r=globalThis;r.__tsParticlesInternals=r.__tsParticlesInternals??{},r.loadTrailPlugin=l;var i=Object.freeze({__proto__:null,TrailPluginInstance:class{layer=s.DrawLayer.PluginContent;#s;#t;#e;constructor(t,s){this.#s=s,this.#t=t}canvasClear(){const t=this.#s,e=t.actualOptions.trail,n=this.#e;if(!e?.enable||!n||e.length<=0)return!1;let a=!1;const l=t.canvas;return n.color?(l.render.paintBase(s.getStyleFromRgb(n.color,t.hdr,n.opacity,t.peakNits,t.hdrMode)),a=!0):n.image&&(l.render.paintImage(n.image,n.opacity),a=!0),a}async init(){try{await this.#n()}catch(t){s.getLogger().error(t)}}async#n(){const t=this.#s.actualOptions.trail;if(!t?.enable)return;const e=t.fill,n=s.inverseFactorNumerator/t.length;if(e.color){const t=s.rangeColorToRgb(this.#t,e.color);if(!t)return;this.#e={color:{...t},opacity:n}}else await new Promise((t,a)=>{if(!e.image)return;const l=s.safeDocument().createElement("img");l.addEventListener("load",()=>{this.#e={image:l,opacity:n},t()}),l.addEventListener("error",t=>{s.getLogger().error(t),a(new Error("Error loading image"))}),l.src=e.image})}}});t.loadTrailPlugin=l}(t.__tsParticlesInternals.plugins.trail=t.__tsParticlesInternals.plugins.trail||{},t.__tsParticlesInternals.engine)}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:self),Object.assign(globalThis.window||globalThis,{loadTrailPlugin:(globalThis.__tsParticlesInternals.plugins.trail||{}).loadTrailPlugin});
|