@tsparticles/engine 3.0.0-beta.1 → 3.0.0-beta.3
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/README.md +8 -8
- package/browser/Core/Container.js +3 -5
- package/browser/Core/Engine.js +10 -50
- package/browser/Core/Particle.js +13 -13
- package/browser/Core/Particles.js +3 -2
- package/browser/Utils/CanvasUtils.js +9 -6
- package/browser/Utils/Utils.js +6 -0
- package/browser/export-types.js +0 -2
- package/cjs/Core/Container.js +3 -5
- package/cjs/Core/Engine.js +9 -49
- package/cjs/Core/Particle.js +13 -13
- package/cjs/Core/Particles.js +3 -2
- package/cjs/Utils/CanvasUtils.js +9 -6
- package/cjs/Utils/Utils.js +8 -1
- package/cjs/export-types.js +0 -2
- package/esm/Core/Container.js +3 -5
- package/esm/Core/Engine.js +10 -50
- package/esm/Core/Particle.js +13 -13
- package/esm/Core/Particles.js +3 -2
- package/esm/Utils/CanvasUtils.js +9 -6
- package/esm/Utils/Utils.js +6 -0
- package/esm/export-types.js +0 -2
- package/package.json +3 -3
- package/report.html +23 -5
- package/scripts/install.js +8 -8
- package/tsparticles.engine.js +83 -72
- package/tsparticles.engine.min.js +1 -1
- package/tsparticles.engine.min.js.LICENSE.txt +1 -1
- package/types/Core/Container.d.ts +2 -2
- package/types/Core/Engine.d.ts +3 -4
- package/types/Core/Interfaces/IShapeDrawer.d.ts +19 -9
- package/types/Core/Particle.d.ts +1 -3
- package/types/Enums/Types/EventType.d.ts +1 -0
- package/types/Types/CustomEventArgs.d.ts +1 -1
- package/types/Utils/CanvasUtils.d.ts +11 -2
- package/types/Utils/ColorUtils.d.ts +2 -2
- package/types/Utils/Utils.d.ts +4 -3
- package/types/export-types.d.ts +0 -2
- package/umd/Core/Container.js +4 -6
- package/umd/Core/Engine.js +9 -49
- package/umd/Core/Particle.js +13 -13
- package/umd/Core/Particles.js +3 -2
- package/umd/Utils/CanvasUtils.js +9 -6
- package/umd/Utils/Utils.js +8 -1
- package/umd/export-types.js +1 -3
- package/browser/Core/Interfaces/IParticle.js +0 -1
- package/browser/Types/ShapeDrawerFunctions.js +0 -1
- package/cjs/Core/Interfaces/IParticle.js +0 -2
- package/cjs/Types/ShapeDrawerFunctions.js +0 -2
- package/esm/Core/Interfaces/IParticle.js +0 -1
- package/esm/Types/ShapeDrawerFunctions.js +0 -1
- package/types/Core/Interfaces/IParticle.d.ts +0 -48
- package/types/Types/ShapeDrawerFunctions.d.ts +0 -10
- package/umd/Core/Interfaces/IParticle.js +0 -12
- package/umd/Types/ShapeDrawerFunctions.js +0 -12
package/umd/Core/Container.js
CHANGED
|
@@ -4,19 +4,19 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "./Canvas.js", "./Utils/EventListeners.js", "../Options/Classes/Options.js", "./Particles.js", "./Retina.js", "./Utils/Constants.js", "../Utils/
|
|
7
|
+
define(["require", "exports", "../Utils/Utils.js", "./Canvas.js", "./Utils/EventListeners.js", "../Options/Classes/Options.js", "./Particles.js", "./Retina.js", "./Utils/Constants.js", "../Utils/NumberUtils.js", "../Utils/OptionsUtils.js"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.Container = void 0;
|
|
13
|
+
const Utils_js_1 = require("../Utils/Utils.js");
|
|
13
14
|
const Canvas_js_1 = require("./Canvas.js");
|
|
14
15
|
const EventListeners_js_1 = require("./Utils/EventListeners.js");
|
|
15
16
|
const Options_js_1 = require("../Options/Classes/Options.js");
|
|
16
17
|
const Particles_js_1 = require("./Particles.js");
|
|
17
18
|
const Retina_js_1 = require("./Retina.js");
|
|
18
19
|
const Constants_js_1 = require("./Utils/Constants.js");
|
|
19
|
-
const Utils_js_1 = require("../Utils/Utils.js");
|
|
20
20
|
const NumberUtils_js_1 = require("../Utils/NumberUtils.js");
|
|
21
21
|
const OptionsUtils_js_1 = require("../Utils/OptionsUtils.js");
|
|
22
22
|
function guardCheck(container) {
|
|
@@ -35,7 +35,6 @@
|
|
|
35
35
|
}
|
|
36
36
|
class Container {
|
|
37
37
|
constructor(engine, id, sourceOptions) {
|
|
38
|
-
this.id = id;
|
|
39
38
|
this._intersectionManager = (entries) => {
|
|
40
39
|
if (!guardCheck(this) || !this.actualOptions.pauseOnOutsideViewport) {
|
|
41
40
|
return;
|
|
@@ -77,6 +76,7 @@
|
|
|
77
76
|
}
|
|
78
77
|
};
|
|
79
78
|
this._engine = engine;
|
|
79
|
+
this.id = Symbol(id);
|
|
80
80
|
this.fpsLimit = 120;
|
|
81
81
|
this.smooth = false;
|
|
82
82
|
this._delay = 0;
|
|
@@ -106,9 +106,7 @@
|
|
|
106
106
|
this._options = loadContainerOptions(this._engine, this);
|
|
107
107
|
this.actualOptions = loadContainerOptions(this._engine, this);
|
|
108
108
|
this._eventListeners = new EventListeners_js_1.EventListeners(this);
|
|
109
|
-
|
|
110
|
-
this._intersectionObserver = new IntersectionObserver((entries) => this._intersectionManager(entries));
|
|
111
|
-
}
|
|
109
|
+
this._intersectionObserver = (0, Utils_js_1.safeIntersectionObserver)((entries) => this._intersectionManager(entries));
|
|
112
110
|
this._engine.dispatchEvent("containerBuilt", { container: this });
|
|
113
111
|
}
|
|
114
112
|
get options() {
|
package/umd/Core/Engine.js
CHANGED
|
@@ -62,18 +62,12 @@
|
|
|
62
62
|
return res;
|
|
63
63
|
}
|
|
64
64
|
get version() {
|
|
65
|
-
return "3.0.0-beta.
|
|
65
|
+
return "3.0.0-beta.3";
|
|
66
66
|
}
|
|
67
|
-
addConfig(
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
this._configs.set(nameOrConfig, config);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
this._configs.set(nameOrConfig.name ?? "default", nameOrConfig);
|
|
76
|
-
}
|
|
67
|
+
addConfig(config) {
|
|
68
|
+
const name = config.name ?? "default";
|
|
69
|
+
this._configs.set(name, config);
|
|
70
|
+
this._eventDispatcher.dispatchEvent("configAdded", { data: { name, config } });
|
|
77
71
|
}
|
|
78
72
|
addEventListener(type, listener) {
|
|
79
73
|
this._eventDispatcher.addEventListener(type, listener);
|
|
@@ -102,45 +96,11 @@
|
|
|
102
96
|
(override || !this.getPreset(preset)) && this.presets.set(preset, options);
|
|
103
97
|
await this.refresh(refresh);
|
|
104
98
|
}
|
|
105
|
-
async addShape(shape, drawer,
|
|
106
|
-
let customDrawer;
|
|
107
|
-
let realRefresh = refresh, realInit, realAfterEffect, realDestroy;
|
|
108
|
-
if ((0, Utils_js_1.isBoolean)(initOrRefresh)) {
|
|
109
|
-
realRefresh = initOrRefresh;
|
|
110
|
-
realInit = undefined;
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
113
|
-
realInit = initOrRefresh;
|
|
114
|
-
}
|
|
115
|
-
if ((0, Utils_js_1.isBoolean)(afterEffectOrRefresh)) {
|
|
116
|
-
realRefresh = afterEffectOrRefresh;
|
|
117
|
-
realAfterEffect = undefined;
|
|
118
|
-
}
|
|
119
|
-
else {
|
|
120
|
-
realAfterEffect = afterEffectOrRefresh;
|
|
121
|
-
}
|
|
122
|
-
if ((0, Utils_js_1.isBoolean)(destroyOrRefresh)) {
|
|
123
|
-
realRefresh = destroyOrRefresh;
|
|
124
|
-
realDestroy = undefined;
|
|
125
|
-
}
|
|
126
|
-
else {
|
|
127
|
-
realDestroy = destroyOrRefresh;
|
|
128
|
-
}
|
|
129
|
-
if ((0, Utils_js_1.isFunction)(drawer)) {
|
|
130
|
-
customDrawer = {
|
|
131
|
-
afterEffect: realAfterEffect,
|
|
132
|
-
destroy: realDestroy,
|
|
133
|
-
draw: drawer,
|
|
134
|
-
init: realInit,
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
else {
|
|
138
|
-
customDrawer = drawer;
|
|
139
|
-
}
|
|
99
|
+
async addShape(shape, drawer, refresh = true) {
|
|
140
100
|
(0, Utils_js_1.executeOnSingleOrMultiple)(shape, (type) => {
|
|
141
|
-
!this.getShapeDrawer(type) && this.drawers.set(type,
|
|
101
|
+
!this.getShapeDrawer(type) && this.drawers.set(type, drawer);
|
|
142
102
|
});
|
|
143
|
-
await this.refresh(
|
|
103
|
+
await this.refresh(refresh);
|
|
144
104
|
}
|
|
145
105
|
clearPlugins(container) {
|
|
146
106
|
this.updaters.delete(container);
|
|
@@ -206,7 +166,7 @@
|
|
|
206
166
|
domContainer.id = id;
|
|
207
167
|
document.body.append(domContainer);
|
|
208
168
|
}
|
|
209
|
-
const currentOptions = (0, Utils_js_1.itemFromSingleOrMultiple)(options, index), dom = this.dom(), oldIndex = dom.findIndex((v) => v.id === id);
|
|
169
|
+
const currentOptions = (0, Utils_js_1.itemFromSingleOrMultiple)(options, index), dom = this.dom(), oldIndex = dom.findIndex((v) => v.id.description === id);
|
|
210
170
|
if (oldIndex >= 0) {
|
|
211
171
|
const old = this.domItem(oldIndex);
|
|
212
172
|
if (old && !old.destroyed) {
|
package/umd/Core/Particle.js
CHANGED
|
@@ -19,7 +19,17 @@
|
|
|
19
19
|
const CanvasUtils_js_1 = require("../Utils/CanvasUtils.js");
|
|
20
20
|
const Constants_js_1 = require("./Utils/Constants.js");
|
|
21
21
|
const OptionsUtils_js_1 = require("../Utils/OptionsUtils.js");
|
|
22
|
-
|
|
22
|
+
function loadShapeData(shape, shapeOptions, id, reduceDuplicates) {
|
|
23
|
+
const shapeData = shapeOptions.options[shape];
|
|
24
|
+
if (!shapeData) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
return (0, Utils_js_1.deepExtend)({
|
|
28
|
+
close: shapeOptions.close,
|
|
29
|
+
fill: shapeOptions.fill,
|
|
30
|
+
}, (0, Utils_js_1.itemFromSingleOrMultiple)(shapeData, id, reduceDuplicates));
|
|
31
|
+
}
|
|
32
|
+
function fixOutMode(data) {
|
|
23
33
|
if (!(0, Utils_js_1.isInArray)(data.outMode, data.checkModes)) {
|
|
24
34
|
return;
|
|
25
35
|
}
|
|
@@ -30,7 +40,7 @@
|
|
|
30
40
|
else if (data.coord < diameter) {
|
|
31
41
|
data.setCb(data.radius);
|
|
32
42
|
}
|
|
33
|
-
}
|
|
43
|
+
}
|
|
34
44
|
class Particle {
|
|
35
45
|
constructor(engine, id, container, position, overrideOptions, group) {
|
|
36
46
|
this.container = container;
|
|
@@ -141,16 +151,6 @@
|
|
|
141
151
|
}
|
|
142
152
|
this.offset = Vector_js_1.Vector.origin;
|
|
143
153
|
};
|
|
144
|
-
this._loadShapeData = (shapeOptions, reduceDuplicates) => {
|
|
145
|
-
const shapeData = shapeOptions.options[this.shape];
|
|
146
|
-
if (!shapeData) {
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
return (0, Utils_js_1.deepExtend)({
|
|
150
|
-
close: shapeOptions.close,
|
|
151
|
-
fill: shapeOptions.fill,
|
|
152
|
-
}, (0, Utils_js_1.itemFromSingleOrMultiple)(shapeData, this.id, reduceDuplicates));
|
|
153
|
-
};
|
|
154
154
|
this._engine = engine;
|
|
155
155
|
this.init(id, position, overrideOptions, group);
|
|
156
156
|
}
|
|
@@ -229,7 +229,7 @@
|
|
|
229
229
|
shapeOptions.load(overrideOptions.shape);
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
|
-
this.shapeData = this.
|
|
232
|
+
this.shapeData = loadShapeData(this.shape, shapeOptions, this.id, reduceDuplicates);
|
|
233
233
|
particlesOptions.load(overrideOptions);
|
|
234
234
|
const shapeData = this.shapeData;
|
|
235
235
|
if (shapeData) {
|
package/umd/Core/Particles.js
CHANGED
|
@@ -82,8 +82,9 @@
|
|
|
82
82
|
return false;
|
|
83
83
|
}
|
|
84
84
|
particle.destroy(override);
|
|
85
|
+
const zIdx = this._zArray.indexOf(particle);
|
|
85
86
|
this._array.splice(index, 1);
|
|
86
|
-
this._zArray
|
|
87
|
+
this._zArray.splice(zIdx, 1);
|
|
87
88
|
this.pool.push(particle);
|
|
88
89
|
this._engine.dispatchEvent("particleRemoved", {
|
|
89
90
|
container: this._container,
|
|
@@ -184,7 +185,7 @@
|
|
|
184
185
|
}
|
|
185
186
|
this.addManualParticles();
|
|
186
187
|
if (!handled) {
|
|
187
|
-
const particlesOptions = options.particles, groups =
|
|
188
|
+
const particlesOptions = options.particles, groups = particlesOptions.groups;
|
|
188
189
|
for (const group in groups) {
|
|
189
190
|
const groupOptions = groups[group];
|
|
190
191
|
for (let i = this.count, j = 0; j < groupOptions.number?.value && i < particlesOptions.number.value; i++, j++) {
|
package/umd/Utils/CanvasUtils.js
CHANGED
|
@@ -75,7 +75,8 @@
|
|
|
75
75
|
if (colorStyles.stroke) {
|
|
76
76
|
context.strokeStyle = colorStyles.stroke;
|
|
77
77
|
}
|
|
78
|
-
|
|
78
|
+
const drawData = { container, context, particle, radius, opacity, delta };
|
|
79
|
+
drawShape(drawData);
|
|
79
80
|
if (strokeWidth > 0) {
|
|
80
81
|
context.stroke();
|
|
81
82
|
}
|
|
@@ -85,12 +86,13 @@
|
|
|
85
86
|
if (particle.fill) {
|
|
86
87
|
context.fill();
|
|
87
88
|
}
|
|
88
|
-
drawShapeAfterEffect(
|
|
89
|
+
drawShapeAfterEffect(drawData);
|
|
89
90
|
context.globalCompositeOperation = "source-over";
|
|
90
91
|
context.setTransform(1, 0, 0, 1, 0, 0);
|
|
91
92
|
}
|
|
92
93
|
exports.drawParticle = drawParticle;
|
|
93
|
-
function drawShape(
|
|
94
|
+
function drawShape(data) {
|
|
95
|
+
const { container, context, particle, radius, opacity, delta } = data;
|
|
94
96
|
if (!particle.shape) {
|
|
95
97
|
return;
|
|
96
98
|
}
|
|
@@ -98,10 +100,11 @@
|
|
|
98
100
|
if (!drawer) {
|
|
99
101
|
return;
|
|
100
102
|
}
|
|
101
|
-
drawer.draw(context, particle, radius, opacity, delta, container.retina.pixelRatio);
|
|
103
|
+
drawer.draw({ context, particle, radius, opacity, delta, pixelRatio: container.retina.pixelRatio });
|
|
102
104
|
}
|
|
103
105
|
exports.drawShape = drawShape;
|
|
104
|
-
function drawShapeAfterEffect(
|
|
106
|
+
function drawShapeAfterEffect(data) {
|
|
107
|
+
const { container, context, particle, radius, opacity, delta } = data;
|
|
105
108
|
if (!particle.shape) {
|
|
106
109
|
return;
|
|
107
110
|
}
|
|
@@ -109,7 +112,7 @@
|
|
|
109
112
|
if (!drawer || !drawer.afterEffect) {
|
|
110
113
|
return;
|
|
111
114
|
}
|
|
112
|
-
drawer.afterEffect(context, particle, radius, opacity, delta, container.retina.pixelRatio);
|
|
115
|
+
drawer.afterEffect({ context, particle, radius, opacity, delta, pixelRatio: container.retina.pixelRatio });
|
|
113
116
|
}
|
|
114
117
|
exports.drawShapeAfterEffect = drawShapeAfterEffect;
|
|
115
118
|
function drawPlugin(context, plugin, delta) {
|
package/umd/Utils/Utils.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.isArray = exports.isObject = exports.isFunction = exports.isNumber = exports.isString = exports.isBoolean = exports.getSize = exports.getPosition = exports.initParticleNumericAnimationValue = exports.findItemFromSingleOrMultiple = exports.itemFromSingleOrMultiple = exports.executeOnSingleOrMultiple = exports.rectBounce = exports.circleBounce = exports.circleBounceDataFromParticle = exports.divMode = exports.singleDivModeExecute = exports.divModeExecute = exports.isDivModeEnabled = exports.deepExtend = exports.calculateBounds = exports.areBoundsInside = exports.isPointInside = exports.itemFromArray = exports.arrayRandomIndex = exports.loadFont = exports.isInArray = exports.safeMutationObserver = exports.safeMatchMedia = exports.hasMatchMedia = exports.isSsr = exports.getLogger = exports.setLogger = void 0;
|
|
12
|
+
exports.isArray = exports.isObject = exports.isFunction = exports.isNumber = exports.isString = exports.isBoolean = exports.getSize = exports.getPosition = exports.initParticleNumericAnimationValue = exports.findItemFromSingleOrMultiple = exports.itemFromSingleOrMultiple = exports.executeOnSingleOrMultiple = exports.rectBounce = exports.circleBounce = exports.circleBounceDataFromParticle = exports.divMode = exports.singleDivModeExecute = exports.divModeExecute = exports.isDivModeEnabled = exports.deepExtend = exports.calculateBounds = exports.areBoundsInside = exports.isPointInside = exports.itemFromArray = exports.arrayRandomIndex = exports.loadFont = exports.isInArray = exports.safeMutationObserver = exports.safeIntersectionObserver = exports.safeMatchMedia = exports.hasMatchMedia = exports.isSsr = exports.getLogger = exports.setLogger = void 0;
|
|
13
13
|
const NumberUtils_js_1 = require("./NumberUtils.js");
|
|
14
14
|
const Vector_js_1 = require("../Core/Utils/Vector.js");
|
|
15
15
|
const _logger = {
|
|
@@ -69,6 +69,13 @@
|
|
|
69
69
|
return matchMedia(query);
|
|
70
70
|
}
|
|
71
71
|
exports.safeMatchMedia = safeMatchMedia;
|
|
72
|
+
function safeIntersectionObserver(callback) {
|
|
73
|
+
if (isSsr() || typeof IntersectionObserver === "undefined") {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
return new IntersectionObserver(callback);
|
|
77
|
+
}
|
|
78
|
+
exports.safeIntersectionObserver = safeIntersectionObserver;
|
|
72
79
|
function safeMutationObserver(callback) {
|
|
73
80
|
if (isSsr() || typeof MutationObserver === "undefined") {
|
|
74
81
|
return;
|
package/umd/export-types.js
CHANGED
|
@@ -18,7 +18,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
18
18
|
if (v !== undefined) module.exports = v;
|
|
19
19
|
}
|
|
20
20
|
else if (typeof define === "function" && define.amd) {
|
|
21
|
-
define(["require", "exports", "./Core/Interfaces/Colors.js", "./Core/Interfaces/IBounds.js", "./Core/Interfaces/IBubbleParticleData.js", "./Core/Interfaces/ICircleBouncer.js", "./Core/Interfaces/IColorManager.js", "./Core/Interfaces/IContainerInteractivity.js", "./Core/Interfaces/IContainerPlugin.js", "./Core/Interfaces/ICoordinates.js", "./Core/Interfaces/IDelta.js", "./Core/Interfaces/IDimension.js", "./Core/Interfaces/IDistance.js", "./Core/Interfaces/IDrawParticleParams.js", "./Core/Interfaces/IExternalInteractor.js", "./Core/Interfaces/IInteractor.js", "./Core/Interfaces/ILoadParams.js", "./Core/Interfaces/IMouseData.js", "./Core/Interfaces/IMovePathGenerator.js", "./Core/Interfaces/
|
|
21
|
+
define(["require", "exports", "./Core/Interfaces/Colors.js", "./Core/Interfaces/IBounds.js", "./Core/Interfaces/IBubbleParticleData.js", "./Core/Interfaces/ICircleBouncer.js", "./Core/Interfaces/IColorManager.js", "./Core/Interfaces/IContainerInteractivity.js", "./Core/Interfaces/IContainerPlugin.js", "./Core/Interfaces/ICoordinates.js", "./Core/Interfaces/IDelta.js", "./Core/Interfaces/IDimension.js", "./Core/Interfaces/IDistance.js", "./Core/Interfaces/IDrawParticleParams.js", "./Core/Interfaces/IExternalInteractor.js", "./Core/Interfaces/IInteractor.js", "./Core/Interfaces/ILoadParams.js", "./Core/Interfaces/IMouseData.js", "./Core/Interfaces/IMovePathGenerator.js", "./Core/Interfaces/IParticleColorStyle.js", "./Core/Interfaces/IParticleHslAnimation.js", "./Core/Interfaces/IParticleLife.js", "./Core/Interfaces/IParticleMover.js", "./Core/Interfaces/IParticleRetinaProps.js", "./Core/Interfaces/IParticleRoll.js", "./Core/Interfaces/IParticleTransformValues.js", "./Core/Interfaces/IParticleUpdater.js", "./Core/Interfaces/IParticleValueAnimation.js", "./Core/Interfaces/IParticlesInteractor.js", "./Core/Interfaces/IPlugin.js", "./Core/Interfaces/IPositionFromSizeParams.js", "./Core/Interfaces/IRangeValue.js", "./Core/Interfaces/IRectSideResult.js", "./Core/Interfaces/IShapeDrawer.js", "./Core/Interfaces/IShapeValues.js", "./Core/Interfaces/ISlowParticleData.js", "./Core/Interfaces/ITrailFillData.js", "./Options/Interfaces/Background/IBackground.js", "./Options/Interfaces/BackgroundMask/IBackgroundMask.js", "./Options/Interfaces/BackgroundMask/IBackgroundMaskCover.js", "./Options/Interfaces/FullScreen/IFullScreen.js", "./Options/Interfaces/IAnimatable.js", "./Options/Interfaces/IAnimatableColor.js", "./Options/Interfaces/IAnimation.js", "./Options/Interfaces/IColorAnimation.js", "./Options/Interfaces/IHslAnimation.js", "./Options/Interfaces/IManualParticle.js", "./Options/Interfaces/IOptionLoader.js", "./Options/Interfaces/IOptions.js", "./Options/Interfaces/IOptionsColor.js", "./Options/Interfaces/IResponsive.js", "./Options/Interfaces/IValueWithRandom.js", "./Options/Interfaces/Interactivity/Events/IClickEvent.js", "./Options/Interfaces/Interactivity/Events/IDivEvent.js", "./Options/Interfaces/Interactivity/Events/IEvents.js", "./Options/Interfaces/Interactivity/Events/IHoverEvent.js", "./Options/Interfaces/Interactivity/Events/IParallax.js", "./Options/Interfaces/Interactivity/Events/IResizeEvent.js", "./Options/Interfaces/Interactivity/Modes/IModeDiv.js", "./Options/Interfaces/Interactivity/Modes/IModes.js", "./Options/Interfaces/Interactivity/IInteractivity.js", "./Options/Interfaces/Particles/Bounce/IParticlesBounce.js", "./Options/Interfaces/Particles/Collisions/ICollisions.js", "./Options/Interfaces/Particles/Collisions/ICollisionsAbsorb.js", "./Options/Interfaces/Particles/Collisions/ICollisionsOverlap.js", "./Options/Interfaces/Particles/IParticlesOptions.js", "./Options/Interfaces/Particles/IShadow.js", "./Options/Interfaces/Particles/IStroke.js", "./Options/Interfaces/Particles/Move/IMoveAttract.js", "./Options/Interfaces/Particles/Move/IMove.js", "./Options/Interfaces/Particles/Move/IMoveAngle.js", "./Options/Interfaces/Particles/Move/IMoveCenter.js", "./Options/Interfaces/Particles/Move/IMoveGravity.js", "./Options/Interfaces/Particles/Move/Path/IMovePath.js", "./Options/Interfaces/Particles/Move/IOutModes.js", "./Options/Interfaces/Particles/Move/ISpin.js", "./Options/Interfaces/Particles/Move/IMoveTrail.js", "./Options/Interfaces/Particles/Number/IParticlesDensity.js", "./Options/Interfaces/Particles/Number/IParticlesNumber.js", "./Options/Interfaces/Particles/Opacity/IOpacity.js", "./Options/Interfaces/Particles/Opacity/IOpacityAnimation.js", "./Options/Interfaces/Particles/Shape/IShape.js", "./Options/Interfaces/Particles/Size/ISize.js", "./Options/Interfaces/Particles/Size/ISizeAnimation.js", "./Options/Interfaces/Particles/ZIndex/IZIndex.js", "./Options/Interfaces/Theme/ITheme.js", "./Options/Interfaces/Theme/IThemeDefault.js", "./Types/CustomEventArgs.js", "./Types/CustomEventListener.js", "./Types/ExportResult.js", "./Types/ISourceOptions.js", "./Types/ParticlesGroups.js", "./Types/PathOptions.js", "./Types/RangeValue.js", "./Types/RecursivePartial.js", "./Types/ShapeData.js", "./Types/SingleOrMultiple.js"], factory);
|
|
22
22
|
}
|
|
23
23
|
})(function (require, exports) {
|
|
24
24
|
"use strict";
|
|
@@ -40,7 +40,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
40
40
|
__exportStar(require("./Core/Interfaces/ILoadParams.js"), exports);
|
|
41
41
|
__exportStar(require("./Core/Interfaces/IMouseData.js"), exports);
|
|
42
42
|
__exportStar(require("./Core/Interfaces/IMovePathGenerator.js"), exports);
|
|
43
|
-
__exportStar(require("./Core/Interfaces/IParticle.js"), exports);
|
|
44
43
|
__exportStar(require("./Core/Interfaces/IParticleColorStyle.js"), exports);
|
|
45
44
|
__exportStar(require("./Core/Interfaces/IParticleHslAnimation.js"), exports);
|
|
46
45
|
__exportStar(require("./Core/Interfaces/IParticleLife.js"), exports);
|
|
@@ -118,6 +117,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
118
117
|
__exportStar(require("./Types/RangeValue.js"), exports);
|
|
119
118
|
__exportStar(require("./Types/RecursivePartial.js"), exports);
|
|
120
119
|
__exportStar(require("./Types/ShapeData.js"), exports);
|
|
121
|
-
__exportStar(require("./Types/ShapeDrawerFunctions.js"), exports);
|
|
122
120
|
__exportStar(require("./Types/SingleOrMultiple.js"), exports);
|
|
123
121
|
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import type { IHsl, IRgb } from "./Colors.js";
|
|
2
|
-
import type { IBubbleParticleData } from "./IBubbleParticleData.js";
|
|
3
|
-
import type { ICoordinates3d } from "./ICoordinates.js";
|
|
4
|
-
import type { IParticleHslAnimation } from "./IParticleHslAnimation.js";
|
|
5
|
-
import type { IParticleNumericValueAnimation } from "./IParticleValueAnimation.js";
|
|
6
|
-
import type { IParticleRetinaProps } from "./IParticleRetinaProps.js";
|
|
7
|
-
import type { IParticleRoll } from "./IParticleRoll.js";
|
|
8
|
-
import type { IParticlesOptions } from "../../Options/Interfaces/Particles/IParticlesOptions.js";
|
|
9
|
-
import type { IShapeValues } from "./IShapeValues.js";
|
|
10
|
-
import type { Interactivity } from "../../Options/Classes/Interactivity/Interactivity.js";
|
|
11
|
-
import type { Vector } from "../Utils/Vector.js";
|
|
12
|
-
export interface IParticle {
|
|
13
|
-
readonly backColor?: IHsl;
|
|
14
|
-
readonly bubble: IBubbleParticleData;
|
|
15
|
-
readonly close: boolean;
|
|
16
|
-
readonly color?: IParticleHslAnimation;
|
|
17
|
-
readonly destroyed: boolean;
|
|
18
|
-
readonly direction: number;
|
|
19
|
-
readonly fill: boolean;
|
|
20
|
-
readonly id: number;
|
|
21
|
-
readonly initialVelocity: Vector;
|
|
22
|
-
readonly interactivity: Interactivity;
|
|
23
|
-
misplaced: boolean;
|
|
24
|
-
readonly offset: Vector;
|
|
25
|
-
readonly opacity?: IParticleNumericValueAnimation;
|
|
26
|
-
readonly options: IParticlesOptions;
|
|
27
|
-
readonly position: Vector;
|
|
28
|
-
randomIndexData?: number;
|
|
29
|
-
readonly retina: IParticleRetinaProps;
|
|
30
|
-
readonly roll?: IParticleRoll;
|
|
31
|
-
readonly rotation: number;
|
|
32
|
-
readonly shadowColor?: IRgb;
|
|
33
|
-
readonly shape?: string;
|
|
34
|
-
readonly shapeData?: IShapeValues;
|
|
35
|
-
readonly sides: number;
|
|
36
|
-
readonly size: IParticleNumericValueAnimation;
|
|
37
|
-
readonly strokeColor?: IParticleHslAnimation;
|
|
38
|
-
readonly strokeOpacity?: number;
|
|
39
|
-
readonly strokeWidth?: number;
|
|
40
|
-
readonly velocity: Vector;
|
|
41
|
-
getFillColor(): IHsl | undefined;
|
|
42
|
-
getMass(): number;
|
|
43
|
-
getPosition(): ICoordinates3d;
|
|
44
|
-
getRadius(): number;
|
|
45
|
-
getStrokeColor(): IHsl | undefined;
|
|
46
|
-
isInsideCanvas(): boolean;
|
|
47
|
-
isVisible(): boolean;
|
|
48
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { Container } from "../Core/Container.js";
|
|
2
|
-
import type { IDelta } from "../Core/Interfaces/IDelta.js";
|
|
3
|
-
import type { Particle } from "../Core/Particle.js";
|
|
4
|
-
export type ShapeDrawerDrawFunction = (context: CanvasRenderingContext2D, particle: Particle, radius: number, opacity: number, delta: IDelta, pixelRatio: number) => void;
|
|
5
|
-
export type ShapeDrawerInitFunction = (container: Container) => Promise<void>;
|
|
6
|
-
export type ShapeDrawerParticleInitFunction = (container: Container, particle: Particle) => void;
|
|
7
|
-
export type ShapeDrawerAfterEffectFunction = (context: CanvasRenderingContext2D, particle: Particle, radius: number, opacity: number, delta: IDelta, pixelRatio: number) => void;
|
|
8
|
-
export type ShapeDrawerDestroyFunction = (container: Container) => void;
|
|
9
|
-
export type ShapeDrawerSidesCountFunction = (particle: Particle) => number;
|
|
10
|
-
export type ShapeDrawerLoadFunction = (particle: Particle) => void;
|
|
@@ -1,12 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
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
|
-
});
|