@tsparticles/plugin-absorbers 4.0.0-alpha.8 → 4.0.0-beta.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/162.min.js +1 -0
- package/166.min.js +1 -0
- package/49.min.js +1 -0
- package/497.min.js +1 -0
- package/598.min.js +1 -0
- package/README.md +5 -0
- package/browser/AbsorberInstance.js +126 -53
- package/browser/AbsorbersInstancesManager.js +2 -0
- package/browser/AbsorbersInteractor.js +11 -6
- package/browser/AbsorbersPlugin.js +2 -1
- package/browser/AbsorbersPluginInstance.js +2 -0
- package/browser/Options/Classes/Absorber.js +14 -0
- package/browser/Options/Classes/AbsorberLife.js +27 -0
- package/browser/Options/Classes/AbsorberSize.js +2 -0
- package/browser/Options/Classes/AbsorberSizeLimit.js +2 -0
- package/browser/Options/Interfaces/IAbsorberLife.js +1 -0
- package/browser/index.js +7 -3
- package/cjs/AbsorberInstance.js +126 -53
- package/cjs/AbsorbersInstancesManager.js +2 -0
- package/cjs/AbsorbersInteractor.js +11 -6
- package/cjs/AbsorbersPlugin.js +2 -1
- package/cjs/AbsorbersPluginInstance.js +2 -0
- package/cjs/Options/Classes/Absorber.js +14 -0
- package/cjs/Options/Classes/AbsorberLife.js +27 -0
- package/cjs/Options/Classes/AbsorberSize.js +2 -0
- package/cjs/Options/Classes/AbsorberSizeLimit.js +2 -0
- package/cjs/Options/Interfaces/IAbsorberLife.js +1 -0
- package/cjs/index.js +7 -3
- package/dist_browser_AbsorberInstance_js.js +15 -5
- package/dist_browser_AbsorbersInstancesManager_js.js +2 -2
- package/dist_browser_AbsorbersInteractor_js.js +15 -5
- package/dist_browser_AbsorbersPluginInstance_js.js +2 -2
- package/dist_browser_AbsorbersPlugin_js.js +15 -5
- package/esm/AbsorberInstance.js +126 -53
- package/esm/AbsorbersInstancesManager.js +2 -0
- package/esm/AbsorbersInteractor.js +11 -6
- package/esm/AbsorbersPlugin.js +2 -1
- package/esm/AbsorbersPluginInstance.js +2 -0
- package/esm/Options/Classes/Absorber.js +14 -0
- package/esm/Options/Classes/AbsorberLife.js +27 -0
- package/esm/Options/Classes/AbsorberSize.js +2 -0
- package/esm/Options/Classes/AbsorberSizeLimit.js +2 -0
- package/esm/Options/Interfaces/IAbsorberLife.js +1 -0
- package/esm/index.js +7 -3
- package/package.json +3 -3
- package/report.html +1 -1
- package/tsparticles.plugin.absorbers.js +31 -19
- package/tsparticles.plugin.absorbers.min.js +2 -2
- package/types/AbsorberInstance.d.ts +10 -0
- package/types/AbsorbersInteractor.d.ts +3 -2
- package/types/AbsorbersPlugin.d.ts +1 -1
- package/types/Options/Classes/Absorber.d.ts +2 -0
- package/types/Options/Classes/AbsorberLife.d.ts +10 -0
- package/types/Options/Interfaces/IAbsorber.d.ts +2 -0
- package/types/Options/Interfaces/IAbsorberLife.d.ts +7 -0
- package/umd/AbsorberInstance.js +125 -52
- package/umd/AbsorbersInstancesManager.js +2 -0
- package/umd/AbsorbersInteractor.js +11 -6
- package/umd/AbsorbersPlugin.js +2 -1
- package/umd/AbsorbersPluginInstance.js +2 -0
- package/umd/Options/Classes/Absorber.js +15 -1
- package/umd/Options/Classes/AbsorberLife.js +41 -0
- package/umd/Options/Classes/AbsorberSize.js +2 -0
- package/umd/Options/Classes/AbsorberSizeLimit.js +2 -0
- package/umd/Options/Interfaces/IAbsorberLife.js +12 -0
- package/umd/index.js +7 -3
- package/215.min.js +0 -2
- package/215.min.js.LICENSE.txt +0 -1
- package/384.min.js +0 -2
- package/384.min.js.LICENSE.txt +0 -1
- package/688.min.js +0 -2
- package/688.min.js.LICENSE.txt +0 -1
- package/903.min.js +0 -2
- package/903.min.js.LICENSE.txt +0 -1
- package/980.min.js +0 -2
- package/980.min.js.LICENSE.txt +0 -1
- package/tsparticles.plugin.absorbers.min.js.LICENSE.txt +0 -1
package/esm/AbsorberInstance.js
CHANGED
|
@@ -1,61 +1,30 @@
|
|
|
1
|
-
import { RotateDirection, Vector, calcPositionOrRandomFromSize, calcPositionOrRandomFromSizeRanged, doublePI, getDistance, getDistances, getRandom, getRangeValue, getStyleFromRgb, isPointInside, originPoint, percentDenominator, rangeColorToRgb, } from "@tsparticles/engine";
|
|
1
|
+
import { RotateDirection, Vector, calcPositionOrRandomFromSize, calcPositionOrRandomFromSizeRanged, doublePI, getDistance, getDistances, getRandom, getRangeValue, getStyleFromRgb, isPointInside, millisecondsToSeconds, originPoint, percentDenominator, rangeColorToRgb, } from "@tsparticles/engine";
|
|
2
2
|
import { Absorber } from "./Options/Classes/Absorber.js";
|
|
3
|
-
const squareExp = 2, absorbFactor = 0.033, minOrbitLength = 0, minRadius = 0, minMass = 0, minAngle = 0, maxAngle = doublePI, minVelocity = 0;
|
|
3
|
+
const squareExp = 2, absorbFactor = 0.033, minOrbitLength = 0, minRadius = 0, minMass = 0, minAngle = 0, maxAngle = doublePI, minVelocity = 0, defaultLifeDelay = 0, minLifeCount = 0, defaultSpawnDelay = 0, defaultLifeCount = -1;
|
|
4
4
|
export class AbsorberInstance {
|
|
5
|
+
color;
|
|
6
|
+
limit;
|
|
7
|
+
mass;
|
|
8
|
+
name;
|
|
9
|
+
opacity;
|
|
10
|
+
options;
|
|
11
|
+
position;
|
|
12
|
+
size;
|
|
13
|
+
_container;
|
|
14
|
+
_currentDuration;
|
|
15
|
+
_currentSpawnDelay;
|
|
16
|
+
_duration;
|
|
17
|
+
_engine;
|
|
18
|
+
_firstSpawn;
|
|
19
|
+
_immortal;
|
|
20
|
+
_lifeCount;
|
|
21
|
+
_spawnDelay;
|
|
22
|
+
initialPosition;
|
|
5
23
|
constructor(engine, container, options, position) {
|
|
6
|
-
this._calcPosition = () => {
|
|
7
|
-
const exactPosition = calcPositionOrRandomFromSizeRanged({
|
|
8
|
-
size: this._container.canvas.size,
|
|
9
|
-
position: this.options.position,
|
|
10
|
-
});
|
|
11
|
-
return Vector.create(exactPosition.x, exactPosition.y);
|
|
12
|
-
};
|
|
13
|
-
this._updateParticlePosition = (particle, v) => {
|
|
14
|
-
if (particle.destroyed) {
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
const container = this._container, canvasSize = container.canvas.size;
|
|
18
|
-
if (particle.needsNewPosition) {
|
|
19
|
-
const newPosition = calcPositionOrRandomFromSize({ size: canvasSize });
|
|
20
|
-
particle.position.setTo(newPosition);
|
|
21
|
-
particle.velocity.setTo(particle.initialVelocity);
|
|
22
|
-
particle.absorberOrbit = undefined;
|
|
23
|
-
particle.needsNewPosition = false;
|
|
24
|
-
}
|
|
25
|
-
if (this.options.orbits) {
|
|
26
|
-
if (particle.absorberOrbit === undefined) {
|
|
27
|
-
particle.absorberOrbit = Vector.origin;
|
|
28
|
-
particle.absorberOrbit.length = getDistance(particle.getPosition(), this.position);
|
|
29
|
-
particle.absorberOrbit.angle = getRandom() * maxAngle;
|
|
30
|
-
}
|
|
31
|
-
if (particle.absorberOrbit.length <= this.size && !this.options.destroy) {
|
|
32
|
-
const minSize = Math.min(canvasSize.width, canvasSize.height), offset = 1, randomOffset = 0.1, randomFactor = 0.2;
|
|
33
|
-
particle.absorberOrbit.length = minSize * (offset + (getRandom() * randomFactor - randomOffset));
|
|
34
|
-
}
|
|
35
|
-
particle.absorberOrbitDirection ??=
|
|
36
|
-
particle.velocity.x >= minVelocity ? RotateDirection.clockwise : RotateDirection.counterClockwise;
|
|
37
|
-
const orbitRadius = particle.absorberOrbit.length, orbitAngle = particle.absorberOrbit.angle, orbitDirection = particle.absorberOrbitDirection;
|
|
38
|
-
particle.velocity.setTo(Vector.origin);
|
|
39
|
-
const updateFunc = {
|
|
40
|
-
x: orbitDirection === RotateDirection.clockwise ? Math.cos : Math.sin,
|
|
41
|
-
y: orbitDirection === RotateDirection.clockwise ? Math.sin : Math.cos,
|
|
42
|
-
};
|
|
43
|
-
particle.position.x = this.position.x + orbitRadius * updateFunc.x(orbitAngle);
|
|
44
|
-
particle.position.y = this.position.y + orbitRadius * updateFunc.y(orbitAngle);
|
|
45
|
-
particle.absorberOrbit.length -= v.length;
|
|
46
|
-
particle.absorberOrbit.angle +=
|
|
47
|
-
(((particle.retina.moveSpeed ?? minVelocity) * container.retina.pixelRatio) / percentDenominator) *
|
|
48
|
-
container.retina.reduceFactor;
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
const addV = Vector.origin;
|
|
52
|
-
addV.length = v.length;
|
|
53
|
-
addV.angle = v.angle;
|
|
54
|
-
particle.velocity.addTo(addV);
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
24
|
this._container = container;
|
|
58
25
|
this._engine = engine;
|
|
26
|
+
this._currentDuration = 0;
|
|
27
|
+
this._currentSpawnDelay = 0;
|
|
59
28
|
this.initialPosition = position ? Vector.create(position.x, position.y) : undefined;
|
|
60
29
|
if (options instanceof Absorber) {
|
|
61
30
|
this.options = options;
|
|
@@ -79,6 +48,13 @@ export class AbsorberInstance {
|
|
|
79
48
|
r: 0,
|
|
80
49
|
};
|
|
81
50
|
this.position = this.initialPosition?.copy() ?? this._calcPosition();
|
|
51
|
+
this._firstSpawn = !this.options.life.wait;
|
|
52
|
+
this._lifeCount = this.options.life.count ?? defaultLifeCount;
|
|
53
|
+
this._immortal = this._lifeCount <= minLifeCount;
|
|
54
|
+
this._spawnDelay = container.retina.reduceFactor
|
|
55
|
+
? (getRangeValue(this.options.life.delay ?? defaultLifeDelay) * millisecondsToSeconds) /
|
|
56
|
+
container.retina.reduceFactor
|
|
57
|
+
: Infinity;
|
|
82
58
|
}
|
|
83
59
|
attract(particle, delta) {
|
|
84
60
|
const container = this._container, options = this.options, pos = particle.getPosition(), { dx, dy, distance } = getDistances(this.position, pos), v = Vector.create(dx, dy);
|
|
@@ -127,4 +103,101 @@ export class AbsorberInstance {
|
|
|
127
103
|
? initialPosition
|
|
128
104
|
: this._calcPosition();
|
|
129
105
|
}
|
|
106
|
+
update(delta) {
|
|
107
|
+
if (this._firstSpawn) {
|
|
108
|
+
this._firstSpawn = false;
|
|
109
|
+
this._currentSpawnDelay = this._spawnDelay ?? defaultSpawnDelay;
|
|
110
|
+
}
|
|
111
|
+
if (this._duration !== undefined) {
|
|
112
|
+
this._currentDuration += delta.value;
|
|
113
|
+
if (this._currentDuration >= this._duration) {
|
|
114
|
+
if (!this._immortal) {
|
|
115
|
+
this._lifeCount--;
|
|
116
|
+
}
|
|
117
|
+
if (this._lifeCount > minLifeCount || this._immortal) {
|
|
118
|
+
this.position = this._calcPosition();
|
|
119
|
+
this._spawnDelay = this._container.retina.reduceFactor
|
|
120
|
+
? (getRangeValue(this.options.life.delay ?? defaultLifeDelay) * millisecondsToSeconds) /
|
|
121
|
+
this._container.retina.reduceFactor
|
|
122
|
+
: Infinity;
|
|
123
|
+
}
|
|
124
|
+
this._currentDuration -= this._duration;
|
|
125
|
+
delete this._duration;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
if (this._spawnDelay !== undefined) {
|
|
129
|
+
this._currentSpawnDelay += delta.value;
|
|
130
|
+
if (this._currentSpawnDelay >= this._spawnDelay) {
|
|
131
|
+
this.play();
|
|
132
|
+
this._currentSpawnDelay -= this._spawnDelay;
|
|
133
|
+
delete this._spawnDelay;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
_calcPosition = () => {
|
|
138
|
+
const exactPosition = calcPositionOrRandomFromSizeRanged({
|
|
139
|
+
size: this._container.canvas.size,
|
|
140
|
+
position: this.options.position,
|
|
141
|
+
});
|
|
142
|
+
return Vector.create(exactPosition.x, exactPosition.y);
|
|
143
|
+
};
|
|
144
|
+
_prepareToDie = () => {
|
|
145
|
+
const duration = this.options.life.duration !== undefined ? getRangeValue(this.options.life.duration) : undefined, minDuration = 0;
|
|
146
|
+
if ((this._lifeCount > minLifeCount || this._immortal) && duration !== undefined && duration > minDuration) {
|
|
147
|
+
this._duration = duration * millisecondsToSeconds;
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
_updateParticlePosition = (particle, v) => {
|
|
151
|
+
if (particle.destroyed) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
const container = this._container, canvasSize = container.canvas.size;
|
|
155
|
+
if (particle.needsNewPosition) {
|
|
156
|
+
const newPosition = calcPositionOrRandomFromSize({ size: canvasSize });
|
|
157
|
+
particle.position.setTo(newPosition);
|
|
158
|
+
particle.velocity.setTo(particle.initialVelocity);
|
|
159
|
+
particle.absorberOrbit = undefined;
|
|
160
|
+
particle.needsNewPosition = false;
|
|
161
|
+
}
|
|
162
|
+
if (this.options.orbits) {
|
|
163
|
+
if (particle.absorberOrbit === undefined) {
|
|
164
|
+
particle.absorberOrbit = Vector.origin;
|
|
165
|
+
particle.absorberOrbit.length = getDistance(particle.getPosition(), this.position);
|
|
166
|
+
particle.absorberOrbit.angle = getRandom() * maxAngle;
|
|
167
|
+
}
|
|
168
|
+
if (particle.absorberOrbit.length <= this.size && !this.options.destroy) {
|
|
169
|
+
const minSize = Math.min(canvasSize.width, canvasSize.height), offset = 1, randomOffset = 0.1, randomFactor = 0.2;
|
|
170
|
+
particle.absorberOrbit.length = minSize * (offset + (getRandom() * randomFactor - randomOffset));
|
|
171
|
+
}
|
|
172
|
+
particle.absorberOrbitDirection ??=
|
|
173
|
+
particle.velocity.x >= minVelocity ? RotateDirection.clockwise : RotateDirection.counterClockwise;
|
|
174
|
+
const orbitRadius = particle.absorberOrbit.length, orbitAngle = particle.absorberOrbit.angle, orbitDirection = particle.absorberOrbitDirection;
|
|
175
|
+
particle.velocity.setTo(Vector.origin);
|
|
176
|
+
const updateFunc = {
|
|
177
|
+
x: orbitDirection === RotateDirection.clockwise ? Math.cos : Math.sin,
|
|
178
|
+
y: orbitDirection === RotateDirection.clockwise ? Math.sin : Math.cos,
|
|
179
|
+
};
|
|
180
|
+
particle.position.x = this.position.x + orbitRadius * updateFunc.x(orbitAngle);
|
|
181
|
+
particle.position.y = this.position.y + orbitRadius * updateFunc.y(orbitAngle);
|
|
182
|
+
particle.absorberOrbit.length -= v.length;
|
|
183
|
+
particle.absorberOrbit.angle +=
|
|
184
|
+
(((particle.retina.moveSpeed ?? minVelocity) * container.retina.pixelRatio) / percentDenominator) *
|
|
185
|
+
container.retina.reduceFactor;
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
const addV = Vector.origin;
|
|
189
|
+
addV.length = v.length;
|
|
190
|
+
addV.angle = v.angle;
|
|
191
|
+
particle.velocity.addTo(addV);
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
play = () => {
|
|
195
|
+
if (!((this._lifeCount > minLifeCount || this._immortal || !this.options.life.count) &&
|
|
196
|
+
(this._firstSpawn || this._currentSpawnDelay >= (this._spawnDelay ?? defaultSpawnDelay)))) {
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
if (this._lifeCount > minLifeCount || this._immortal) {
|
|
200
|
+
this._prepareToDie();
|
|
201
|
+
}
|
|
202
|
+
};
|
|
130
203
|
}
|
|
@@ -3,9 +3,14 @@ import { getDistance, isArray, isInArray, itemFromArray, } from "@tsparticles/en
|
|
|
3
3
|
import { Absorber } from "./Options/Classes/Absorber.js";
|
|
4
4
|
const absorbersMode = "absorbers";
|
|
5
5
|
export class AbsorbersInteractor extends ExternalInteractorBase {
|
|
6
|
+
handleClickMode;
|
|
7
|
+
maxDistance;
|
|
8
|
+
_dragging = false;
|
|
9
|
+
_draggingAbsorber;
|
|
10
|
+
_instancesManager;
|
|
6
11
|
constructor(container, instancesManager) {
|
|
7
12
|
super(container);
|
|
8
|
-
this.
|
|
13
|
+
this.maxDistance = 0;
|
|
9
14
|
this._instancesManager = instancesManager;
|
|
10
15
|
this._instancesManager.initContainer(container);
|
|
11
16
|
this.handleClickMode = (mode, interactivityData) => {
|
|
@@ -38,15 +43,15 @@ export class AbsorbersInteractor extends ExternalInteractorBase {
|
|
|
38
43
|
if (mouse.clicking && mouse.downPosition) {
|
|
39
44
|
const mouseDist = getDistance(absorber.position, mouse.downPosition);
|
|
40
45
|
if (mouseDist <= absorber.size) {
|
|
41
|
-
this.
|
|
42
|
-
this.
|
|
46
|
+
this._dragging = true;
|
|
47
|
+
this._draggingAbsorber = absorber;
|
|
43
48
|
}
|
|
44
49
|
}
|
|
45
50
|
else {
|
|
46
|
-
this.
|
|
47
|
-
this.
|
|
51
|
+
this._dragging = false;
|
|
52
|
+
this._draggingAbsorber = undefined;
|
|
48
53
|
}
|
|
49
|
-
if (this.
|
|
54
|
+
if (this._dragging && this._draggingAbsorber == absorber && mouse.position) {
|
|
50
55
|
absorber.position.x = mouse.position.x;
|
|
51
56
|
absorber.position.y = mouse.position.y;
|
|
52
57
|
}
|
package/esm/AbsorbersPlugin.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { executeOnSingleOrMultiple, isArray, } from "@tsparticles/engine";
|
|
2
2
|
import { Absorber } from "./Options/Classes/Absorber.js";
|
|
3
3
|
export class AbsorbersPlugin {
|
|
4
|
+
id = "absorbers";
|
|
5
|
+
_instancesManager;
|
|
4
6
|
constructor(instancesManager) {
|
|
5
|
-
this.id = "absorbers";
|
|
6
7
|
this._instancesManager = instancesManager;
|
|
7
8
|
}
|
|
8
9
|
async getPlugin(container) {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { executeOnSingleOrMultiple, isArray, } from "@tsparticles/engine";
|
|
2
2
|
export class AbsorbersPluginInstance {
|
|
3
|
+
_container;
|
|
4
|
+
_instancesManager;
|
|
3
5
|
constructor(container, instancesManager) {
|
|
4
6
|
this._container = container;
|
|
5
7
|
this._instancesManager = instancesManager;
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import { OptionsColor, isNull, setRangeValue, } from "@tsparticles/engine";
|
|
2
|
+
import { AbsorberLife } from "./AbsorberLife.js";
|
|
2
3
|
import { AbsorberSize } from "./AbsorberSize.js";
|
|
3
4
|
export class Absorber {
|
|
5
|
+
color;
|
|
6
|
+
destroy;
|
|
7
|
+
draggable;
|
|
8
|
+
life;
|
|
9
|
+
name;
|
|
10
|
+
opacity;
|
|
11
|
+
orbits;
|
|
12
|
+
position;
|
|
13
|
+
size;
|
|
4
14
|
constructor() {
|
|
5
15
|
this.color = new OptionsColor();
|
|
6
16
|
this.color.value = "#000000";
|
|
@@ -8,6 +18,7 @@ export class Absorber {
|
|
|
8
18
|
this.opacity = 1;
|
|
9
19
|
this.destroy = true;
|
|
10
20
|
this.orbits = false;
|
|
21
|
+
this.life = new AbsorberLife();
|
|
11
22
|
this.size = new AbsorberSize();
|
|
12
23
|
}
|
|
13
24
|
load(data) {
|
|
@@ -20,6 +31,9 @@ export class Absorber {
|
|
|
20
31
|
if (data.draggable !== undefined) {
|
|
21
32
|
this.draggable = data.draggable;
|
|
22
33
|
}
|
|
34
|
+
if (data.life !== undefined) {
|
|
35
|
+
this.life.load(data.life);
|
|
36
|
+
}
|
|
23
37
|
this.name = data.name;
|
|
24
38
|
if (data.opacity !== undefined) {
|
|
25
39
|
this.opacity = data.opacity;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { isNull, setRangeValue } from "@tsparticles/engine";
|
|
2
|
+
export class AbsorberLife {
|
|
3
|
+
count;
|
|
4
|
+
delay;
|
|
5
|
+
duration;
|
|
6
|
+
wait;
|
|
7
|
+
constructor() {
|
|
8
|
+
this.wait = false;
|
|
9
|
+
}
|
|
10
|
+
load(data) {
|
|
11
|
+
if (isNull(data)) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
if (data.count !== undefined) {
|
|
15
|
+
this.count = data.count;
|
|
16
|
+
}
|
|
17
|
+
if (data.delay !== undefined) {
|
|
18
|
+
this.delay = setRangeValue(data.delay);
|
|
19
|
+
}
|
|
20
|
+
if (data.duration !== undefined) {
|
|
21
|
+
this.duration = setRangeValue(data.duration);
|
|
22
|
+
}
|
|
23
|
+
if (data.wait !== undefined) {
|
|
24
|
+
this.wait = data.wait;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/esm/index.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
export async function loadAbsorbersPlugin(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-
|
|
2
|
+
engine.checkVersion("4.0.0-beta.0");
|
|
3
3
|
await engine.register(async (e) => {
|
|
4
|
-
const {
|
|
5
|
-
|
|
4
|
+
const [{ ensureInteractivityPluginLoaded }, { AbsorbersInstancesManager }, { AbsorbersPlugin },] = await Promise.all([
|
|
5
|
+
import("@tsparticles/plugin-interactivity"),
|
|
6
|
+
import("./AbsorbersInstancesManager.js"),
|
|
7
|
+
import("./AbsorbersPlugin.js"),
|
|
8
|
+
]), instancesManager = new AbsorbersInstancesManager(e);
|
|
9
|
+
ensureInteractivityPluginLoaded(e);
|
|
6
10
|
e.addPlugin(new AbsorbersPlugin(instancesManager));
|
|
7
11
|
e.addInteractor?.("externalAbsorbers", async (container) => {
|
|
8
12
|
const { AbsorbersInteractor } = await import("./AbsorbersInteractor.js");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/plugin-absorbers",
|
|
3
|
-
"version": "4.0.0-
|
|
3
|
+
"version": "4.0.0-beta.0",
|
|
4
4
|
"description": "tsParticles absorbers plugin",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -86,8 +86,8 @@
|
|
|
86
86
|
"./package.json": "./package.json"
|
|
87
87
|
},
|
|
88
88
|
"dependencies": {
|
|
89
|
-
"@tsparticles/engine": "4.0.0-
|
|
90
|
-
"@tsparticles/plugin-interactivity": "4.0.0-
|
|
89
|
+
"@tsparticles/engine": "4.0.0-beta.0",
|
|
90
|
+
"@tsparticles/plugin-interactivity": "4.0.0-beta.0"
|
|
91
91
|
},
|
|
92
92
|
"publishConfig": {
|
|
93
93
|
"access": "public"
|
package/report.html
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8"/>
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
6
|
-
<title>@tsparticles/plugin-absorbers [
|
|
6
|
+
<title>@tsparticles/plugin-absorbers [19 Mar 2026 at 14:00]</title>
|
|
7
7
|
<link rel="shortcut icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAABrVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+O1foceMD///+J0/qK1Pr7/v8Xdr/9///W8P4UdL7L7P0Scr2r4Pyj3vwad8D5/f/2/f+55f3E6f34+/2H0/ojfMKpzOd0rNgQcb3F3O/j9f7c8v6g3Pz0/P/w+v/q+P7n9v6T1/uQ1vuE0vqLut/y+v+Z2fvt+f+15Pzv9fuc2/vR7v2V2Pvd6/bg9P7I6/285/2y4/yp3/zp8vk8i8kqgMT7/P31+fyv4vxGkcz6/P6/6P3j7vfS5PNnpNUxhcbO7f7F6v3O4vHK3/DA2u631Ouy0eqXweKJud5wqthfoNMMbLvY8f73+v2dxeR8sNtTmdDx9/zX6PSjyeaCtd1YnNGX2PuQveCGt95Nls42h8dLlM3F4vBtAAAAM3RSTlMAAyOx0/sKBvik8opWGBMOAe3l1snDm2E9LSb06eHcu5JpHbarfHZCN9CBb08zzkdNS0kYaptYAAAFV0lEQVRYw92X51/aYBDHHS2O2qqttVbrqNq9m+TJIAYIShBkWwqIiCgoWvfeq7Z2/s29hyQNyUcR7LveGwVyXy6XH8/9rqxglLfUPLxVduUor3h0rfp2TYvpivk37929TkG037hffoX0+peVtZQc1589rigVUdXS/ABSAyEmGIO/1XfvldSK8vs3OqB6u3m0nxmIrvgB0dj7rr7Y9IbuF68hnfFaiHA/sxqm0wciIG43P60qKv9WXWc1RXGh/mFESFABTSBi0sNAKzqet17eCtOb3kZIDwxEEU0oAIJGYxNBDhBND29e0rtXXbcpuPmED9IhEAAQ/AXEaF8EPmnrrKsv0LvWR3fg5sWDNAFZOgAgaKvZDogHNU9MFwnnYROkc56RD5CjAbQX9Ow4g7upCsvYu55aSI/Nj0H1akgKQEUM94dwK65hYRmFU9MIcH/fqJYOZYcnuJSU/waKDgTOEVaVKhwrTRP5XzgSpAITYzom7UvkhFX5VutmxeNnWDjjswTKTyfgluNDGbUpWissXhF3s7mlSml+czWkg3D0l1nNjGNjz3myOQOa1KM/jOS6ebdbAVTCi4gljHSFrviza7tOgRWcS0MOUX9zdNgag5w7rRqA44Lzw0hr1WqES36dFliSJFlh2rXIae3FFcDDgKdxrUIDePr8jGcSClV1u7A9xeN0ModY/pHMxmR1EzRh8TJiwqsHmKW0l4FCEZI+jHio+JdPPE9qwQtTRxku2D8sIeRL2LnxWSllANCQGOIiqVHAz2ye2JR0DcH+HoxDkaADLjgxjKQ+AwCX/g0+DNgdG0ukYCONAe+dbc2IAc6fwt1ARoDSezNHxV2Cmzwv3O6lDMV55edBGwGK9n1+x2F8EDfAGCxug8MhpsMEcTEAWf3rx2vZhe/LAmtIn/6apE6PN0ULKgywD9mmdxbmFl3OvD5AS5fW5zLbv/YHmcsBTjf/afDz3MaZTVCfAP9z6/Bw6ycv8EUBWJIn9zYcoAWWlW9+OzO3vkTy8H+RANLmdrpOuYWdZYEXpo+TlCJrW5EARb7fF+bWdqf3hhyZI1nWJQHgznErZhbjoEsWqi8dQNoE294aldzFurwSABL2XXMf9+H1VQGke9exw5P/AnA5Pv5ngMul7LOvO922iwACu8WkCwLCafvM4CeWPxfA8lNHcWZSoi8EwMAIciKX2Z4SWCMAa3snCZ/G4EA8D6CMLNFsGQhkkz/gQNEBbPCbWsxGUpYVu3z8IyNAknwJkfPMEhLyrdi5RTyUVACkw4GSFRNWJNEW+fgPGwHD8/JxnRuLabN4CGNRkAE23na2+VmEAUmrYymSGjMAYqH84YUIyzgzs3XC7gNgH36Vcc4zKY9o9fgPBXUAiHHwVboBHGLiX6Zcjp1f2wu4tvzZKo0ecPnDtQYDQvJXaBeNzce45Fp28ZQLrEZVuFqgBwOalArKXnW1UzlnSusQKJqKYNuz4tOnI6sZG4zanpemv+7ySU2jbA9h6uhcgpfy6G2PahirDZ6zvq6zDduMVFTKvzw8wgyEdelwY9in3XkEPs3osJuwRQ4qTkfzifndg9Gfc4pdsu82+tTnHZTBa2EAMrqr2t43pguc8tNm7JQVQ2S0ukj2d22dhXYP0/veWtwKrCkNoNimAN5+Xr/oLrxswKbVJjteWrX7eR63o4j9q0GxnaBdWgGA5VStpanIjQmEhV0/nVt5VOFUvix6awJhPcAaTEShgrG+iGyvb5a0Ndb1YGHFPEwoqAinoaykaID1o1pdPNu7XsnCKQ3R+hwWIIhGvORcJUBYXe3Xa3vq/mF/N9V13ugufMkfXn+KHsRD0B8AAAAASUVORK5CYII=" type="image/x-icon" />
|
|
8
8
|
|
|
9
9
|
<script>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Demo / Generator : https://particles.js.org/
|
|
5
5
|
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
6
|
* How to use? : Check the GitHub README
|
|
7
|
-
* v4.0.0-
|
|
7
|
+
* v4.0.0-beta.0
|
|
8
8
|
*/
|
|
9
9
|
/*
|
|
10
10
|
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
@@ -28,16 +28,6 @@ return /******/ (() => { // webpackBootstrap
|
|
|
28
28
|
/******/ "use strict";
|
|
29
29
|
/******/ var __webpack_modules__ = ({
|
|
30
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 */ loadAbsorbersPlugin: () => (/* binding */ loadAbsorbersPlugin)\n/* harmony export */ });\nasync function loadAbsorbersPlugin(engine) {\n engine.checkVersion(\"4.0.0-alpha.8\");\n await engine.register(async e => {\n const {\n loadInteractivityPlugin\n } = await Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! @tsparticles/plugin-interactivity */ \"@tsparticles/plugin-interactivity\", 19)),\n {\n AbsorbersInstancesManager\n } = await __webpack_require__.e(/*! import() */ \"dist_browser_AbsorbersInstancesManager_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./AbsorbersInstancesManager.js */ \"./dist/browser/AbsorbersInstancesManager.js\")),\n {\n AbsorbersPlugin\n } = await __webpack_require__.e(/*! import() */ \"dist_browser_AbsorbersPlugin_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./AbsorbersPlugin.js */ \"./dist/browser/AbsorbersPlugin.js\")),\n instancesManager = new AbsorbersInstancesManager(e);\n await loadInteractivityPlugin(e);\n e.addPlugin(new AbsorbersPlugin(instancesManager));\n e.addInteractor?.(\"externalAbsorbers\", async container => {\n const {\n AbsorbersInteractor\n } = await __webpack_require__.e(/*! import() */ \"dist_browser_AbsorbersInteractor_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./AbsorbersInteractor.js */ \"./dist/browser/AbsorbersInteractor.js\"));\n return new AbsorbersInteractor(container, instancesManager);\n });\n });\n}\n\n//# sourceURL=webpack://@tsparticles/plugin-absorbers/./dist/browser/index.js?\n}");
|
|
38
|
-
|
|
39
|
-
/***/ },
|
|
40
|
-
|
|
41
31
|
/***/ "@tsparticles/engine"
|
|
42
32
|
/*!*********************************************************************************************************************************!*\
|
|
43
33
|
!*** external {"commonjs":"@tsparticles/engine","commonjs2":"@tsparticles/engine","amd":"@tsparticles/engine","root":"window"} ***!
|
|
@@ -56,6 +46,16 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
|
|
|
56
46
|
|
|
57
47
|
module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_interactivity__;
|
|
58
48
|
|
|
49
|
+
/***/ },
|
|
50
|
+
|
|
51
|
+
/***/ "./dist/browser/index.js"
|
|
52
|
+
/*!*******************************!*\
|
|
53
|
+
!*** ./dist/browser/index.js ***!
|
|
54
|
+
\*******************************/
|
|
55
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
56
|
+
|
|
57
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadAbsorbersPlugin: () => (/* binding */ loadAbsorbersPlugin)\n/* harmony export */ });\nasync function loadAbsorbersPlugin(engine) {\n engine.checkVersion(\"4.0.0-beta.0\");\n await engine.register(async (e)=>{\n const [{ ensureInteractivityPluginLoaded }, { AbsorbersInstancesManager }, { AbsorbersPlugin }] = await Promise.all([\n Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! @tsparticles/plugin-interactivity */ \"@tsparticles/plugin-interactivity\", 19)),\n __webpack_require__.e(/*! import() */ \"dist_browser_AbsorbersInstancesManager_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./AbsorbersInstancesManager.js */ \"./dist/browser/AbsorbersInstancesManager.js\")),\n __webpack_require__.e(/*! import() */ \"dist_browser_AbsorbersPlugin_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./AbsorbersPlugin.js */ \"./dist/browser/AbsorbersPlugin.js\"))\n ]), instancesManager = new AbsorbersInstancesManager(e);\n ensureInteractivityPluginLoaded(e);\n e.addPlugin(new AbsorbersPlugin(instancesManager));\n e.addInteractor?.(\"externalAbsorbers\", async (container)=>{\n const { AbsorbersInteractor } = await __webpack_require__.e(/*! import() */ \"dist_browser_AbsorbersInteractor_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./AbsorbersInteractor.js */ \"./dist/browser/AbsorbersInteractor.js\"));\n return new AbsorbersInteractor(container, instancesManager);\n });\n });\n}\n\n\n//# sourceURL=webpack://@tsparticles/plugin-absorbers/./dist/browser/index.js?\n}");
|
|
58
|
+
|
|
59
59
|
/***/ }
|
|
60
60
|
|
|
61
61
|
/******/ });
|
|
@@ -70,12 +70,6 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_interactivity__;
|
|
|
70
70
|
/******/ if (cachedModule !== undefined) {
|
|
71
71
|
/******/ return cachedModule.exports;
|
|
72
72
|
/******/ }
|
|
73
|
-
/******/ // Check if module exists (development only)
|
|
74
|
-
/******/ if (__webpack_modules__[moduleId] === undefined) {
|
|
75
|
-
/******/ var e = new Error("Cannot find module '" + moduleId + "'");
|
|
76
|
-
/******/ e.code = 'MODULE_NOT_FOUND';
|
|
77
|
-
/******/ throw e;
|
|
78
|
-
/******/ }
|
|
79
73
|
/******/ // Create a new module (and put it into the cache)
|
|
80
74
|
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
81
75
|
/******/ // no module.id needed
|
|
@@ -84,6 +78,12 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_interactivity__;
|
|
|
84
78
|
/******/ };
|
|
85
79
|
/******/
|
|
86
80
|
/******/ // Execute the module function
|
|
81
|
+
/******/ if (!(moduleId in __webpack_modules__)) {
|
|
82
|
+
/******/ delete __webpack_module_cache__[moduleId];
|
|
83
|
+
/******/ var e = new Error("Cannot find module '" + moduleId + "'");
|
|
84
|
+
/******/ e.code = 'MODULE_NOT_FOUND';
|
|
85
|
+
/******/ throw e;
|
|
86
|
+
/******/ }
|
|
87
87
|
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
88
88
|
/******/
|
|
89
89
|
/******/ // Return the exports of the module
|
|
@@ -158,6 +158,18 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_interactivity__;
|
|
|
158
158
|
/******/ };
|
|
159
159
|
/******/ })();
|
|
160
160
|
/******/
|
|
161
|
+
/******/ /* webpack/runtime/global */
|
|
162
|
+
/******/ (() => {
|
|
163
|
+
/******/ __webpack_require__.g = (function() {
|
|
164
|
+
/******/ if (typeof globalThis === 'object') return globalThis;
|
|
165
|
+
/******/ try {
|
|
166
|
+
/******/ return this || new Function('return this')();
|
|
167
|
+
/******/ } catch (e) {
|
|
168
|
+
/******/ if (typeof window === 'object') return window;
|
|
169
|
+
/******/ }
|
|
170
|
+
/******/ })();
|
|
171
|
+
/******/ })();
|
|
172
|
+
/******/
|
|
161
173
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
162
174
|
/******/ (() => {
|
|
163
175
|
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
@@ -222,8 +234,8 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_interactivity__;
|
|
|
222
234
|
/******/ /* webpack/runtime/publicPath */
|
|
223
235
|
/******/ (() => {
|
|
224
236
|
/******/ var scriptUrl;
|
|
225
|
-
/******/ if (
|
|
226
|
-
/******/ var document =
|
|
237
|
+
/******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
|
|
238
|
+
/******/ var document = __webpack_require__.g.document;
|
|
227
239
|
/******/ if (!scriptUrl && document) {
|
|
228
240
|
/******/ if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')
|
|
229
241
|
/******/ scriptUrl = document.currentScript.src;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/plugin-interactivity"),require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/plugin-interactivity","@tsparticles/engine"],t);else{var r="object"==typeof exports?t(require("@tsparticles/plugin-interactivity"),require("@tsparticles/engine")):t(e.window,e.window);for(var o in r)("object"==typeof exports?exports:e)[o]=r[o]}}(this,(e,t)=>(()=>{"use strict";var r,o,i,n={303(e){e.exports=t},702(t){t.exports=e}},a={};function s(e){var t=a[e];if(void 0!==t)return t.exports;var r=a[e]={exports:{}};return n[e](r,r.exports,s),r.exports}s.m=n,l=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,s.t=function(e,t){if(1&t&&(e=this(e)),8&t||"object"==typeof e&&e&&(4&t&&e.__esModule||16&t&&"function"==typeof e.then))return e;var r=Object.create(null);s.r(r);var o={};c=c||[null,l({}),l([]),l(l)];for(var i=2&t&&e;("object"==typeof i||"function"==typeof i)&&!~c.indexOf(i);i=l(i))Object.getOwnPropertyNames(i).forEach(t=>o[t]=()=>e[t]);return o.default=()=>e,s.d(r,o),r},s.d=(e,t)=>{for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce((t,r)=>(s.f[r](e,t),t),[])),s.u=e=>""+e+".min.js",s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),p={},s.l=(e,t,r,o)=>{if(p[e])return void p[e].push(t);if(void 0!==r)for(var i,n,a=document.getElementsByTagName("script"),c=0;c<a.length;c++){var l=a[c];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")=="@tsparticles/plugin-absorbers:"+r){i=l;break}}i||(n=!0,(i=document.createElement("script")).charset="utf-8",s.nc&&i.setAttribute("nonce",s.nc),i.setAttribute("data-webpack","@tsparticles/plugin-absorbers:"+r),i.src=e),p[e]=[t];var u=(t,r)=>{i.onerror=i.onload=null,clearTimeout(d);var o=p[e];if(delete p[e],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach(e=>e(r)),t)return t(r)},d=setTimeout(u.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=u.bind(null,i.onerror),i.onload=u.bind(null,i.onload),n&&document.head.appendChild(i)},s.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.g.importScripts&&(u=s.g.location+"");var c,l,p,u,d=s.g.document;if(!u&&d&&(d.currentScript&&"SCRIPT"===d.currentScript.tagName.toUpperCase()&&(u=d.currentScript.src),!u)){var f=d.getElementsByTagName("script");if(f.length)for(var b=f.length-1;b>-1&&(!u||!/^http(s?):/.test(u));)u=f[b--].src}if(!u)throw Error("Automatic publicPath is not supported in this browser");s.p=u=u.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r={425:0},s.f.j=(e,t)=>{var o=s.o(r,e)?r[e]:void 0;if(0!==o)if(o)t.push(o[2]);else{var i=new Promise((t,i)=>o=r[e]=[t,i]);t.push(o[2]=i);var n=s.p+s.u(e),a=Error();s.l(n,t=>{if(s.o(r,e)&&(0!==(o=r[e])&&(r[e]=void 0),o)){var i=t&&("load"===t.type?"missing":t.type),n=t&&t.target&&t.target.src;a.message="Loading chunk "+e+` failed.
|
|
2
|
+
(`+i+": "+n+")",a.name="ChunkLoadError",a.type=i,a.request=n,o[1](a)}},"chunk-"+e,e)}},o=(e,t)=>{var o,i,[n,a,c]=t,l=0;if(n.some(e=>0!==r[e])){for(o in a)s.o(a,o)&&(s.m[o]=a[o]);c&&c(s)}for(e&&e(t);l<n.length;l++)i=n[l],s.o(r,i)&&r[i]&&r[i][0](),r[i]=0},(i=this.webpackChunk_tsparticles_plugin_absorbers=this.webpackChunk_tsparticles_plugin_absorbers||[]).forEach(o.bind(null,0)),i.push=o.bind(null,i.push.bind(i));var g={};async function h(e){e.checkVersion("4.0.0-beta.0"),await e.register(async e=>{let[{ensureInteractivityPluginLoaded:t},{AbsorbersInstancesManager:r},{AbsorbersPlugin:o}]=await Promise.all([Promise.resolve().then(s.t.bind(s,702,19)),s.e(598).then(s.bind(s,598)),s.e(162).then(s.bind(s,162))]),i=new r(e);t(e),e.addPlugin(new o(i)),e.addInteractor?.("externalAbsorbers",async e=>{let{AbsorbersInteractor:t}=await s.e(166).then(s.bind(s,166));return new t(e,i)})})}return s.r(g),s.d(g,{loadAbsorbersPlugin:()=>h}),g})());
|
|
@@ -17,13 +17,23 @@ export declare class AbsorberInstance {
|
|
|
17
17
|
position: Vector;
|
|
18
18
|
size: number;
|
|
19
19
|
private readonly _container;
|
|
20
|
+
private _currentDuration;
|
|
21
|
+
private _currentSpawnDelay;
|
|
22
|
+
private _duration?;
|
|
20
23
|
private readonly _engine;
|
|
24
|
+
private _firstSpawn;
|
|
25
|
+
private readonly _immortal;
|
|
26
|
+
private _lifeCount;
|
|
27
|
+
private _spawnDelay?;
|
|
21
28
|
private readonly initialPosition?;
|
|
22
29
|
constructor(engine: Engine, container: Container, options: RecursivePartial<IAbsorber>, position?: ICoordinates);
|
|
23
30
|
attract(particle: OrbitingParticle, delta: IDelta): void;
|
|
24
31
|
draw(context: CanvasRenderingContext2D): void;
|
|
25
32
|
resize(): void;
|
|
33
|
+
update(delta: IDelta): void;
|
|
26
34
|
private readonly _calcPosition;
|
|
35
|
+
private readonly _prepareToDie;
|
|
27
36
|
private readonly _updateParticlePosition;
|
|
37
|
+
private readonly play;
|
|
28
38
|
}
|
|
29
39
|
export {};
|
|
@@ -5,9 +5,10 @@ import type { AbsorberContainer } from "./AbsorberContainer.js";
|
|
|
5
5
|
import type { AbsorbersInstancesManager } from "./AbsorbersInstancesManager.js";
|
|
6
6
|
export declare class AbsorbersInteractor extends ExternalInteractorBase<AbsorberContainer> {
|
|
7
7
|
handleClickMode: (mode: string, interactivityData: IInteractivityData) => void;
|
|
8
|
+
readonly maxDistance: number;
|
|
9
|
+
private _dragging;
|
|
10
|
+
private _draggingAbsorber;
|
|
8
11
|
private readonly _instancesManager;
|
|
9
|
-
private dragging;
|
|
10
|
-
private draggingAbsorber;
|
|
11
12
|
constructor(container: AbsorberContainer, instancesManager: AbsorbersInstancesManager);
|
|
12
13
|
clear(): void;
|
|
13
14
|
init(): void;
|
|
@@ -3,7 +3,7 @@ import { type Container, type IContainerPlugin, type IOptions, type IPlugin, typ
|
|
|
3
3
|
import type { AbsorberContainer } from "./AbsorberContainer.js";
|
|
4
4
|
import type { AbsorbersInstancesManager } from "./AbsorbersInstancesManager.js";
|
|
5
5
|
export declare class AbsorbersPlugin implements IPlugin {
|
|
6
|
-
readonly id
|
|
6
|
+
readonly id = "absorbers";
|
|
7
7
|
private readonly _instancesManager;
|
|
8
8
|
constructor(instancesManager: AbsorbersInstancesManager);
|
|
9
9
|
getPlugin(container: AbsorberContainer): Promise<IContainerPlugin>;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { type IOptionLoader, type IRangedCoordinates, OptionsColor, type RecursivePartial } from "@tsparticles/engine";
|
|
2
|
+
import { AbsorberLife } from "./AbsorberLife.js";
|
|
2
3
|
import { AbsorberSize } from "./AbsorberSize.js";
|
|
3
4
|
import type { IAbsorber } from "../Interfaces/IAbsorber.js";
|
|
4
5
|
export declare class Absorber implements IAbsorber, IOptionLoader<IAbsorber> {
|
|
5
6
|
color: OptionsColor;
|
|
6
7
|
destroy: boolean;
|
|
7
8
|
draggable: boolean;
|
|
9
|
+
life: AbsorberLife;
|
|
8
10
|
name?: string;
|
|
9
11
|
opacity: number;
|
|
10
12
|
orbits: boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type IOptionLoader, type RangeValue, type RecursivePartial } from "@tsparticles/engine";
|
|
2
|
+
import type { IAbsorberLife } from "../Interfaces/IAbsorberLife.js";
|
|
3
|
+
export declare class AbsorberLife implements IAbsorberLife, IOptionLoader<IAbsorberLife> {
|
|
4
|
+
count?: number;
|
|
5
|
+
delay?: RangeValue;
|
|
6
|
+
duration?: RangeValue;
|
|
7
|
+
wait: boolean;
|
|
8
|
+
constructor();
|
|
9
|
+
load(data?: RecursivePartial<IAbsorberLife>): void;
|
|
10
|
+
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { IOptionsColor, IRangedCoordinates, RecursivePartial } from "@tsparticles/engine";
|
|
2
|
+
import type { IAbsorberLife } from "./IAbsorberLife.js";
|
|
2
3
|
import type { IAbsorberSize } from "./IAbsorberSize.js";
|
|
3
4
|
export interface IAbsorber {
|
|
4
5
|
color: string | IOptionsColor;
|
|
5
6
|
destroy: boolean;
|
|
6
7
|
draggable: boolean;
|
|
8
|
+
life: IAbsorberLife;
|
|
7
9
|
name?: string;
|
|
8
10
|
opacity: number;
|
|
9
11
|
orbits: boolean;
|