tsparticles 1.41.0 → 1.41.1
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/Core/Container.js +2 -2
- package/Core/Interfaces/IExternalInteractor.d.ts +1 -1
- package/Core/Interfaces/IParticlesInteractor.d.ts +1 -1
- package/Core/Particles.d.ts +3 -3
- package/Core/Particles.js +7 -7
- package/Core/Utils/ExternalInteractorBase.d.ts +1 -1
- package/Core/Utils/FrameManager.d.ts +1 -1
- package/Core/Utils/FrameManager.js +2 -2
- package/Core/Utils/InteractionManager.d.ts +2 -2
- package/Core/Utils/InteractionManager.js +4 -4
- package/Core/Utils/ParticlesInteractorBase.d.ts +1 -1
- package/Interactions/External/Attract/Attractor.d.ts +1 -1
- package/Interactions/External/Attract/Attractor.js +1 -1
- package/Interactions/External/Bounce/Bouncer.d.ts +1 -1
- package/Interactions/External/Bounce/Bouncer.js +1 -1
- package/Interactions/External/Bubble/Bubbler.d.ts +1 -1
- package/Interactions/External/Bubble/Bubbler.js +1 -1
- package/Interactions/External/Connect/Connector.d.ts +1 -1
- package/Interactions/External/Connect/Connector.js +1 -1
- package/Interactions/External/Grab/Grabber.d.ts +1 -1
- package/Interactions/External/Grab/Grabber.js +1 -1
- package/Interactions/External/Repulse/Repulser.d.ts +1 -1
- package/Interactions/External/Repulse/Repulser.js +1 -1
- package/Interactions/External/Trail/TrailMaker.d.ts +1 -1
- package/Interactions/External/Trail/TrailMaker.js +1 -1
- package/Interactions/Particles/Attract/Attractor.d.ts +1 -1
- package/Interactions/Particles/Attract/Attractor.js +1 -1
- package/Interactions/Particles/Collisions/Collider.d.ts +1 -1
- package/Interactions/Particles/Collisions/Collider.js +1 -1
- package/Interactions/Particles/Links/Linker.d.ts +1 -1
- package/Interactions/Particles/Links/Linker.js +1 -1
- package/Plugins/PolygonMask/PolygonMaskInstance.js +1 -1
- package/browser/Core/Container.js +2 -2
- package/browser/Core/Interfaces/IExternalInteractor.d.ts +1 -1
- package/browser/Core/Interfaces/IParticlesInteractor.d.ts +1 -1
- package/browser/Core/Particles.d.ts +3 -3
- package/browser/Core/Particles.js +7 -7
- package/browser/Core/Utils/ExternalInteractorBase.d.ts +1 -1
- package/browser/Core/Utils/FrameManager.d.ts +1 -1
- package/browser/Core/Utils/FrameManager.js +2 -2
- package/browser/Core/Utils/InteractionManager.d.ts +2 -2
- package/browser/Core/Utils/InteractionManager.js +4 -4
- package/browser/Core/Utils/ParticlesInteractorBase.d.ts +1 -1
- package/browser/Interactions/External/Attract/Attractor.d.ts +1 -1
- package/browser/Interactions/External/Attract/Attractor.js +1 -1
- package/browser/Interactions/External/Bounce/Bouncer.d.ts +1 -1
- package/browser/Interactions/External/Bounce/Bouncer.js +1 -1
- package/browser/Interactions/External/Bubble/Bubbler.d.ts +1 -1
- package/browser/Interactions/External/Bubble/Bubbler.js +1 -1
- package/browser/Interactions/External/Connect/Connector.d.ts +1 -1
- package/browser/Interactions/External/Connect/Connector.js +1 -1
- package/browser/Interactions/External/Grab/Grabber.d.ts +1 -1
- package/browser/Interactions/External/Grab/Grabber.js +1 -1
- package/browser/Interactions/External/Repulse/Repulser.d.ts +1 -1
- package/browser/Interactions/External/Repulse/Repulser.js +1 -1
- package/browser/Interactions/External/Trail/TrailMaker.d.ts +1 -1
- package/browser/Interactions/External/Trail/TrailMaker.js +1 -1
- package/browser/Interactions/Particles/Attract/Attractor.d.ts +1 -1
- package/browser/Interactions/Particles/Attract/Attractor.js +1 -1
- package/browser/Interactions/Particles/Collisions/Collider.d.ts +1 -1
- package/browser/Interactions/Particles/Collisions/Collider.js +1 -1
- package/browser/Interactions/Particles/Links/Linker.d.ts +1 -1
- package/browser/Interactions/Particles/Links/Linker.js +1 -1
- package/browser/Plugins/PolygonMask/PolygonMaskInstance.js +1 -1
- package/esm/Core/Container.js +2 -2
- package/esm/Core/Interfaces/IExternalInteractor.d.ts +1 -1
- package/esm/Core/Interfaces/IParticlesInteractor.d.ts +1 -1
- package/esm/Core/Particles.d.ts +3 -3
- package/esm/Core/Particles.js +7 -7
- package/esm/Core/Utils/ExternalInteractorBase.d.ts +1 -1
- package/esm/Core/Utils/FrameManager.d.ts +1 -1
- package/esm/Core/Utils/FrameManager.js +2 -2
- package/esm/Core/Utils/InteractionManager.d.ts +2 -2
- package/esm/Core/Utils/InteractionManager.js +4 -4
- package/esm/Core/Utils/ParticlesInteractorBase.d.ts +1 -1
- package/esm/Interactions/External/Attract/Attractor.d.ts +1 -1
- package/esm/Interactions/External/Attract/Attractor.js +1 -1
- package/esm/Interactions/External/Bounce/Bouncer.d.ts +1 -1
- package/esm/Interactions/External/Bounce/Bouncer.js +1 -1
- package/esm/Interactions/External/Bubble/Bubbler.d.ts +1 -1
- package/esm/Interactions/External/Bubble/Bubbler.js +1 -1
- package/esm/Interactions/External/Connect/Connector.d.ts +1 -1
- package/esm/Interactions/External/Connect/Connector.js +1 -1
- package/esm/Interactions/External/Grab/Grabber.d.ts +1 -1
- package/esm/Interactions/External/Grab/Grabber.js +1 -1
- package/esm/Interactions/External/Repulse/Repulser.d.ts +1 -1
- package/esm/Interactions/External/Repulse/Repulser.js +1 -1
- package/esm/Interactions/External/Trail/TrailMaker.d.ts +1 -1
- package/esm/Interactions/External/Trail/TrailMaker.js +1 -1
- package/esm/Interactions/Particles/Attract/Attractor.d.ts +1 -1
- package/esm/Interactions/Particles/Attract/Attractor.js +1 -1
- package/esm/Interactions/Particles/Collisions/Collider.d.ts +1 -1
- package/esm/Interactions/Particles/Collisions/Collider.js +1 -1
- package/esm/Interactions/Particles/Links/Linker.d.ts +1 -1
- package/esm/Interactions/Particles/Links/Linker.js +1 -1
- package/esm/Plugins/PolygonMask/PolygonMaskInstance.js +1 -1
- package/package.json +1 -1
- package/report.html +6 -5
- package/report.slim.html +6 -5
- package/tsparticles.engine.js +15 -15
- package/tsparticles.engine.min.js +2 -2
- package/tsparticles.interaction.external.attract.js +14 -14
- package/tsparticles.interaction.external.attract.min.js +2 -2
- package/tsparticles.interaction.external.bounce.js +14 -14
- package/tsparticles.interaction.external.bounce.min.js +2 -2
- package/tsparticles.interaction.external.bubble.js +14 -14
- package/tsparticles.interaction.external.bubble.min.js +2 -2
- package/tsparticles.interaction.external.connect.js +14 -14
- package/tsparticles.interaction.external.connect.min.js +2 -2
- package/tsparticles.interaction.external.grab.js +14 -14
- package/tsparticles.interaction.external.grab.min.js +2 -2
- package/tsparticles.interaction.external.repulse.js +14 -14
- package/tsparticles.interaction.external.repulse.min.js +2 -2
- package/tsparticles.interaction.external.trail.js +14 -14
- package/tsparticles.interaction.external.trail.min.js +2 -2
- package/tsparticles.interaction.particles.attract.js +14 -14
- package/tsparticles.interaction.particles.attract.min.js +2 -2
- package/tsparticles.interaction.particles.collisions.js +14 -14
- package/tsparticles.interaction.particles.collisions.min.js +2 -2
- package/tsparticles.interaction.particles.links.js +14 -14
- package/tsparticles.interaction.particles.links.min.js +2 -2
- package/tsparticles.js +27 -27
- package/tsparticles.min.js +2 -2
- package/tsparticles.pathseg.min.js +1 -1
- package/tsparticles.plugins.absorbers.js +13 -13
- package/tsparticles.plugins.absorbers.min.js +1 -1
- package/tsparticles.plugins.emitters.js +13 -13
- package/tsparticles.plugins.emitters.min.js +1 -1
- package/tsparticles.plugins.polygonMask.js +15 -15
- package/tsparticles.plugins.polygonMask.min.js +2 -2
- package/tsparticles.shape.circle.min.js +1 -1
- package/tsparticles.shape.image.js +13 -13
- package/tsparticles.shape.image.min.js +1 -1
- package/tsparticles.shape.line.min.js +1 -1
- package/tsparticles.shape.polygon.min.js +1 -1
- package/tsparticles.shape.square.min.js +1 -1
- package/tsparticles.shape.star.min.js +1 -1
- package/tsparticles.shape.text.js +13 -13
- package/tsparticles.shape.text.min.js +1 -1
- package/tsparticles.slim.js +24 -24
- package/tsparticles.slim.min.js +2 -2
- package/tsparticles.updater.angle.js +13 -13
- package/tsparticles.updater.angle.min.js +1 -1
- package/tsparticles.updater.color.js +13 -13
- package/tsparticles.updater.color.min.js +1 -1
- package/tsparticles.updater.life.js +13 -13
- package/tsparticles.updater.life.min.js +1 -1
- package/tsparticles.updater.opacity.js +13 -13
- package/tsparticles.updater.opacity.min.js +1 -1
- package/tsparticles.updater.outModes.js +13 -13
- package/tsparticles.updater.outModes.min.js +1 -1
- package/tsparticles.updater.roll.js +13 -13
- package/tsparticles.updater.roll.min.js +1 -1
- package/tsparticles.updater.size.js +13 -13
- package/tsparticles.updater.size.min.js +1 -1
- package/tsparticles.updater.strokeColor.js +13 -13
- package/tsparticles.updater.strokeColor.min.js +1 -1
- package/tsparticles.updater.tilt.js +13 -13
- package/tsparticles.updater.tilt.min.js +1 -1
- package/tsparticles.updater.wobble.js +13 -13
- package/tsparticles.updater.wobble.min.js +1 -1
- package/umd/Core/Container.js +2 -2
- package/umd/Core/Interfaces/IExternalInteractor.d.ts +1 -1
- package/umd/Core/Interfaces/IParticlesInteractor.d.ts +1 -1
- package/umd/Core/Particles.d.ts +3 -3
- package/umd/Core/Particles.js +7 -7
- package/umd/Core/Utils/ExternalInteractorBase.d.ts +1 -1
- package/umd/Core/Utils/FrameManager.d.ts +1 -1
- package/umd/Core/Utils/FrameManager.js +2 -2
- package/umd/Core/Utils/InteractionManager.d.ts +2 -2
- package/umd/Core/Utils/InteractionManager.js +4 -4
- package/umd/Core/Utils/ParticlesInteractorBase.d.ts +1 -1
- package/umd/Interactions/External/Attract/Attractor.d.ts +1 -1
- package/umd/Interactions/External/Attract/Attractor.js +1 -1
- package/umd/Interactions/External/Bounce/Bouncer.d.ts +1 -1
- package/umd/Interactions/External/Bounce/Bouncer.js +1 -1
- package/umd/Interactions/External/Bubble/Bubbler.d.ts +1 -1
- package/umd/Interactions/External/Bubble/Bubbler.js +1 -1
- package/umd/Interactions/External/Connect/Connector.d.ts +1 -1
- package/umd/Interactions/External/Connect/Connector.js +1 -1
- package/umd/Interactions/External/Grab/Grabber.d.ts +1 -1
- package/umd/Interactions/External/Grab/Grabber.js +1 -1
- package/umd/Interactions/External/Repulse/Repulser.d.ts +1 -1
- package/umd/Interactions/External/Repulse/Repulser.js +1 -1
- package/umd/Interactions/External/Trail/TrailMaker.d.ts +1 -1
- package/umd/Interactions/External/Trail/TrailMaker.js +1 -1
- package/umd/Interactions/Particles/Attract/Attractor.d.ts +1 -1
- package/umd/Interactions/Particles/Attract/Attractor.js +1 -1
- package/umd/Interactions/Particles/Collisions/Collider.d.ts +1 -1
- package/umd/Interactions/Particles/Collisions/Collider.js +1 -1
- package/umd/Interactions/Particles/Links/Linker.d.ts +1 -1
- package/umd/Interactions/Particles/Links/Linker.js +1 -1
- package/umd/Plugins/PolygonMask/PolygonMaskInstance.js +1 -1
|
@@ -36,7 +36,7 @@ export class Bubbler extends ExternalInteractorBase {
|
|
|
36
36
|
delete particle.bubble.radius;
|
|
37
37
|
delete particle.bubble.color;
|
|
38
38
|
}
|
|
39
|
-
interact() {
|
|
39
|
+
async interact() {
|
|
40
40
|
const options = this.container.actualOptions, events = options.interactivity.events, onHover = events.onHover, onClick = events.onClick, hoverEnabled = onHover.enable, hoverMode = onHover.mode, clickEnabled = onClick.enable, clickMode = onClick.mode, divs = events.onDiv;
|
|
41
41
|
/* on hover event */
|
|
42
42
|
if (hoverEnabled && isInArray("bubble" /* bubble */, hoverMode)) {
|
|
@@ -21,7 +21,7 @@ export class Connector extends ExternalInteractorBase {
|
|
|
21
21
|
/**
|
|
22
22
|
* Connecting particles on hover interactivity
|
|
23
23
|
*/
|
|
24
|
-
interact() {
|
|
24
|
+
async interact() {
|
|
25
25
|
const container = this.container, options = container.actualOptions;
|
|
26
26
|
if (options.interactivity.events.onHover.enable && container.interactivity.status === "mousemove") {
|
|
27
27
|
const mousePos = container.interactivity.mouse.position;
|
|
@@ -15,7 +15,7 @@ export class Grabber extends ExternalInteractorBase {
|
|
|
15
15
|
reset() {
|
|
16
16
|
// do nothing
|
|
17
17
|
}
|
|
18
|
-
interact() {
|
|
18
|
+
async interact() {
|
|
19
19
|
var _a;
|
|
20
20
|
const container = this.container, options = container.actualOptions, interactivity = options.interactivity;
|
|
21
21
|
if (interactivity.events.onHover.enable && container.interactivity.status === Constants.mouseMoveEvent) {
|
|
@@ -8,7 +8,7 @@ export declare class Repulser extends ExternalInteractorBase {
|
|
|
8
8
|
constructor(container: Container);
|
|
9
9
|
isEnabled(): boolean;
|
|
10
10
|
reset(): void;
|
|
11
|
-
interact(): void
|
|
11
|
+
interact(): Promise<void>;
|
|
12
12
|
private singleSelectorRepulse;
|
|
13
13
|
private hoverRepulse;
|
|
14
14
|
private processRepulse;
|
|
@@ -19,7 +19,7 @@ export class Repulser extends ExternalInteractorBase {
|
|
|
19
19
|
reset() {
|
|
20
20
|
// do nothing
|
|
21
21
|
}
|
|
22
|
-
interact() {
|
|
22
|
+
async interact() {
|
|
23
23
|
const container = this.container, options = container.actualOptions, mouseMoveStatus = container.interactivity.status === Constants.mouseMoveEvent, events = options.interactivity.events, hoverEnabled = events.onHover.enable, hoverMode = events.onHover.mode, clickEnabled = events.onClick.enable, clickMode = events.onClick.mode, divs = events.onDiv;
|
|
24
24
|
if (mouseMoveStatus && hoverEnabled && isInArray("repulse" /* repulse */, hoverMode)) {
|
|
25
25
|
this.hoverRepulse();
|
|
@@ -7,7 +7,7 @@ export declare class TrailMaker extends ExternalInteractorBase {
|
|
|
7
7
|
private delay;
|
|
8
8
|
private lastPosition?;
|
|
9
9
|
constructor(container: Container);
|
|
10
|
-
interact(delta: IDelta): void
|
|
10
|
+
interact(delta: IDelta): Promise<void>;
|
|
11
11
|
isEnabled(): boolean;
|
|
12
12
|
reset(): void;
|
|
13
13
|
}
|
|
@@ -5,7 +5,7 @@ import { ParticlesInteractorBase } from "../../../Core";
|
|
|
5
5
|
*/
|
|
6
6
|
export declare class Attractor extends ParticlesInteractorBase {
|
|
7
7
|
constructor(container: Container);
|
|
8
|
-
interact(p1: IParticle): void
|
|
8
|
+
interact(p1: IParticle): Promise<void>;
|
|
9
9
|
isEnabled(particle: Particle): boolean;
|
|
10
10
|
reset(): void;
|
|
11
11
|
}
|
|
@@ -7,7 +7,7 @@ export class Attractor extends ParticlesInteractorBase {
|
|
|
7
7
|
constructor(container) {
|
|
8
8
|
super(container);
|
|
9
9
|
}
|
|
10
|
-
interact(p1) {
|
|
10
|
+
async interact(p1) {
|
|
11
11
|
var _a;
|
|
12
12
|
const container = this.container, distance = (_a = p1.retina.attractDistance) !== null && _a !== void 0 ? _a : container.retina.attractDistance, pos1 = p1.getPosition(), query = container.particles.quadTree.queryCircle(pos1, distance);
|
|
13
13
|
for (const p2 of query) {
|
|
@@ -7,7 +7,7 @@ export declare class Collider extends ParticlesInteractorBase {
|
|
|
7
7
|
constructor(container: Container);
|
|
8
8
|
isEnabled(particle: Particle): boolean;
|
|
9
9
|
reset(): void;
|
|
10
|
-
interact(p1: Particle): void
|
|
10
|
+
interact(p1: Particle): Promise<void>;
|
|
11
11
|
private resolveCollision;
|
|
12
12
|
private absorb;
|
|
13
13
|
}
|
package/esm/Core/Container.js
CHANGED
|
@@ -112,12 +112,12 @@ export class Container {
|
|
|
112
112
|
}
|
|
113
113
|
draw(force) {
|
|
114
114
|
let refreshTime = force;
|
|
115
|
-
this.drawAnimationFrame = animate()((timestamp) => {
|
|
115
|
+
this.drawAnimationFrame = animate()(async (timestamp) => {
|
|
116
116
|
if (refreshTime) {
|
|
117
117
|
this.lastFrameTime = undefined;
|
|
118
118
|
refreshTime = false;
|
|
119
119
|
}
|
|
120
|
-
this.drawer.nextFrame(timestamp);
|
|
120
|
+
await this.drawer.nextFrame(timestamp);
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
123
|
getAnimationStatus() {
|
|
@@ -3,5 +3,5 @@ import type { IInteractor } from "./IInteractor";
|
|
|
3
3
|
import type { Particle } from "../Particle";
|
|
4
4
|
export interface IParticlesInteractor extends IInteractor {
|
|
5
5
|
isEnabled(particle: Particle): boolean;
|
|
6
|
-
interact(particle: Particle, delta: IDelta): void
|
|
6
|
+
interact(particle: Particle, delta: IDelta): Promise<void>;
|
|
7
7
|
}
|
package/esm/Core/Particles.d.ts
CHANGED
|
@@ -26,11 +26,11 @@ export declare class Particles {
|
|
|
26
26
|
private readonly mover;
|
|
27
27
|
constructor(engine: Engine, container: Container);
|
|
28
28
|
init(): void;
|
|
29
|
-
redraw(): void
|
|
29
|
+
redraw(): Promise<void>;
|
|
30
30
|
removeAt(index: number, quantity?: number, group?: string, override?: boolean): void;
|
|
31
31
|
remove(particle: Particle, group?: string, override?: boolean): void;
|
|
32
|
-
update(delta: IDelta): void
|
|
33
|
-
draw(delta: IDelta): void
|
|
32
|
+
update(delta: IDelta): Promise<void>;
|
|
33
|
+
draw(delta: IDelta): Promise<void>;
|
|
34
34
|
clear(): void;
|
|
35
35
|
push(nb: number, mouse?: IMouseData, overrideOptions?: RecursivePartial<IParticles>, group?: string): void;
|
|
36
36
|
addParticle(position?: ICoordinates, overrideOptions?: RecursivePartial<IParticles>, group?: string): Particle | undefined;
|
package/esm/Core/Particles.js
CHANGED
|
@@ -72,10 +72,10 @@ export class Particles {
|
|
|
72
72
|
}
|
|
73
73
|
container.pathGenerator.init(container);
|
|
74
74
|
}
|
|
75
|
-
redraw() {
|
|
75
|
+
async redraw() {
|
|
76
76
|
this.clear();
|
|
77
77
|
this.init();
|
|
78
|
-
this.draw({ value: 0, factor: 0 });
|
|
78
|
+
await this.draw({ value: 0, factor: 0 });
|
|
79
79
|
}
|
|
80
80
|
removeAt(index, quantity = 1, group, override) {
|
|
81
81
|
if (!(index >= 0 && index <= this.count)) {
|
|
@@ -97,7 +97,7 @@ export class Particles {
|
|
|
97
97
|
remove(particle, group, override) {
|
|
98
98
|
this.removeAt(this.array.indexOf(particle), undefined, group, override);
|
|
99
99
|
}
|
|
100
|
-
update(delta) {
|
|
100
|
+
async update(delta) {
|
|
101
101
|
const container = this.container;
|
|
102
102
|
const particlesToDelete = [];
|
|
103
103
|
container.pathGenerator.update();
|
|
@@ -131,23 +131,23 @@ export class Particles {
|
|
|
131
131
|
for (const particle of particlesToDelete) {
|
|
132
132
|
this.remove(particle);
|
|
133
133
|
}
|
|
134
|
-
this.interactionManager.externalInteract(delta);
|
|
134
|
+
await this.interactionManager.externalInteract(delta);
|
|
135
135
|
for (const particle of container.particles.array) {
|
|
136
136
|
for (const updater of this.updaters) {
|
|
137
137
|
updater.update(particle, delta);
|
|
138
138
|
}
|
|
139
139
|
if (!particle.destroyed && !particle.spawning) {
|
|
140
|
-
this.interactionManager.particlesInteract(particle, delta);
|
|
140
|
+
await this.interactionManager.particlesInteract(particle, delta);
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
delete container.canvas.resizeFactor;
|
|
144
144
|
}
|
|
145
|
-
draw(delta) {
|
|
145
|
+
async draw(delta) {
|
|
146
146
|
const container = this.container;
|
|
147
147
|
container.canvas.clear();
|
|
148
148
|
const canvasSize = this.container.canvas.size;
|
|
149
149
|
this.quadTree = new QuadTree(new Rectangle(-canvasSize.width / 4, -canvasSize.height / 4, (canvasSize.width * 3) / 2, (canvasSize.height * 3) / 2), 4);
|
|
150
|
-
this.update(delta);
|
|
150
|
+
await this.update(delta);
|
|
151
151
|
if (this.needsSort) {
|
|
152
152
|
this.zArray.sort((a, b) => b.position.z - a.position.z || a.id - b.id);
|
|
153
153
|
this.lastZIndex = this.zArray[this.zArray.length - 1].position.z;
|
|
@@ -6,7 +6,7 @@ export declare abstract class ExternalInteractorBase implements IExternalInterac
|
|
|
6
6
|
protected readonly container: Container;
|
|
7
7
|
protected constructor(container: Container);
|
|
8
8
|
type: InteractorType;
|
|
9
|
-
abstract interact(delta: IDelta): void
|
|
9
|
+
abstract interact(delta: IDelta): Promise<void>;
|
|
10
10
|
abstract isEnabled(): boolean;
|
|
11
11
|
abstract reset(particle: Particle): void;
|
|
12
12
|
}
|
|
@@ -2,7 +2,7 @@ export class FrameManager {
|
|
|
2
2
|
constructor(container) {
|
|
3
3
|
this.container = container;
|
|
4
4
|
}
|
|
5
|
-
nextFrame(timestamp) {
|
|
5
|
+
async nextFrame(timestamp) {
|
|
6
6
|
var _a;
|
|
7
7
|
try {
|
|
8
8
|
const container = this.container;
|
|
@@ -23,7 +23,7 @@ export class FrameManager {
|
|
|
23
23
|
container.draw(false);
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
26
|
-
container.particles.draw(delta);
|
|
26
|
+
await container.particles.draw(delta);
|
|
27
27
|
if (container.duration > 0 && container.lifeTime > container.duration) {
|
|
28
28
|
container.destroy();
|
|
29
29
|
return;
|
|
@@ -9,6 +9,6 @@ export declare class InteractionManager {
|
|
|
9
9
|
private particleInteractors;
|
|
10
10
|
constructor(engine: Engine, container: Container);
|
|
11
11
|
init(): void;
|
|
12
|
-
externalInteract(delta: IDelta): void
|
|
13
|
-
particlesInteract(particle: Particle, delta: IDelta): void
|
|
12
|
+
externalInteract(delta: IDelta): Promise<void>;
|
|
13
|
+
particlesInteract(particle: Particle, delta: IDelta): Promise<void>;
|
|
14
14
|
}
|
|
@@ -34,20 +34,20 @@ export class InteractionManager {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
externalInteract(delta) {
|
|
37
|
+
async externalInteract(delta) {
|
|
38
38
|
for (const interactor of this.externalInteractors) {
|
|
39
39
|
if (interactor.isEnabled()) {
|
|
40
|
-
interactor.interact(delta);
|
|
40
|
+
await interactor.interact(delta);
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
particlesInteract(particle, delta) {
|
|
44
|
+
async particlesInteract(particle, delta) {
|
|
45
45
|
for (const interactor of this.externalInteractors) {
|
|
46
46
|
interactor.reset(particle);
|
|
47
47
|
}
|
|
48
48
|
for (const interactor of this.particleInteractors) {
|
|
49
49
|
if (interactor.isEnabled(particle)) {
|
|
50
|
-
interactor.interact(particle, delta);
|
|
50
|
+
await interactor.interact(particle, delta);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
}
|
|
@@ -6,7 +6,7 @@ export declare abstract class ParticlesInteractorBase implements IParticlesInter
|
|
|
6
6
|
protected readonly container: Container;
|
|
7
7
|
protected constructor(container: Container);
|
|
8
8
|
type: InteractorType;
|
|
9
|
-
abstract interact(particle: Particle, delta: IDelta): void
|
|
9
|
+
abstract interact(particle: Particle, delta: IDelta): Promise<void>;
|
|
10
10
|
abstract isEnabled(particle: Particle): boolean;
|
|
11
11
|
abstract reset(particle: Particle): void;
|
|
12
12
|
}
|
|
@@ -14,7 +14,7 @@ export class Attractor extends ExternalInteractorBase {
|
|
|
14
14
|
}
|
|
15
15
|
reset() {
|
|
16
16
|
}
|
|
17
|
-
interact() {
|
|
17
|
+
async interact() {
|
|
18
18
|
const container = this.container, options = container.actualOptions, mouseMoveStatus = container.interactivity.status === Constants.mouseMoveEvent, events = options.interactivity.events, hoverEnabled = events.onHover.enable, hoverMode = events.onHover.mode, clickEnabled = events.onClick.enable, clickMode = events.onClick.mode;
|
|
19
19
|
if (mouseMoveStatus && hoverEnabled && isInArray("attract", hoverMode)) {
|
|
20
20
|
this.hoverAttract();
|
|
@@ -3,7 +3,7 @@ import type { Container } from "../../../Core";
|
|
|
3
3
|
export declare class Bouncer extends ExternalInteractorBase {
|
|
4
4
|
constructor(container: Container);
|
|
5
5
|
isEnabled(): boolean;
|
|
6
|
-
interact(): void
|
|
6
|
+
interact(): Promise<void>;
|
|
7
7
|
reset(): void;
|
|
8
8
|
private processMouseBounce;
|
|
9
9
|
private singleSelectorBounce;
|
|
@@ -9,7 +9,7 @@ export class Bouncer extends ExternalInteractorBase {
|
|
|
9
9
|
return ((mouse.position && events.onHover.enable && isInArray("bounce", events.onHover.mode)) ||
|
|
10
10
|
isDivModeEnabled("bounce", divs));
|
|
11
11
|
}
|
|
12
|
-
interact() {
|
|
12
|
+
async interact() {
|
|
13
13
|
const container = this.container, options = container.actualOptions, events = options.interactivity.events, mouseMoveStatus = container.interactivity.status === Constants.mouseMoveEvent, hoverEnabled = events.onHover.enable, hoverMode = events.onHover.mode, divs = events.onDiv;
|
|
14
14
|
if (mouseMoveStatus && hoverEnabled && isInArray("bounce", hoverMode)) {
|
|
15
15
|
this.processMouseBounce();
|
|
@@ -5,7 +5,7 @@ export declare class Bubbler extends ExternalInteractorBase {
|
|
|
5
5
|
constructor(container: Container);
|
|
6
6
|
isEnabled(): boolean;
|
|
7
7
|
reset(particle: Particle, force?: boolean): void;
|
|
8
|
-
interact(): void
|
|
8
|
+
interact(): Promise<void>;
|
|
9
9
|
private singleSelectorHover;
|
|
10
10
|
private process;
|
|
11
11
|
private clickBubble;
|
|
@@ -32,7 +32,7 @@ export class Bubbler extends ExternalInteractorBase {
|
|
|
32
32
|
delete particle.bubble.radius;
|
|
33
33
|
delete particle.bubble.color;
|
|
34
34
|
}
|
|
35
|
-
interact() {
|
|
35
|
+
async interact() {
|
|
36
36
|
const options = this.container.actualOptions, events = options.interactivity.events, onHover = events.onHover, onClick = events.onClick, hoverEnabled = onHover.enable, hoverMode = onHover.mode, clickEnabled = onClick.enable, clickMode = onClick.mode, divs = events.onDiv;
|
|
37
37
|
if (hoverEnabled && isInArray("bubble", hoverMode)) {
|
|
38
38
|
this.hoverBubble();
|
|
@@ -13,7 +13,7 @@ export class Connector extends ExternalInteractorBase {
|
|
|
13
13
|
}
|
|
14
14
|
reset() {
|
|
15
15
|
}
|
|
16
|
-
interact() {
|
|
16
|
+
async interact() {
|
|
17
17
|
const container = this.container, options = container.actualOptions;
|
|
18
18
|
if (options.interactivity.events.onHover.enable && container.interactivity.status === "mousemove") {
|
|
19
19
|
const mousePos = container.interactivity.mouse.position;
|
|
@@ -10,7 +10,7 @@ export class Grabber extends ExternalInteractorBase {
|
|
|
10
10
|
}
|
|
11
11
|
reset() {
|
|
12
12
|
}
|
|
13
|
-
interact() {
|
|
13
|
+
async interact() {
|
|
14
14
|
var _a;
|
|
15
15
|
const container = this.container, options = container.actualOptions, interactivity = options.interactivity;
|
|
16
16
|
if (interactivity.events.onHover.enable && container.interactivity.status === Constants.mouseMoveEvent) {
|
|
@@ -4,7 +4,7 @@ export declare class Repulser extends ExternalInteractorBase {
|
|
|
4
4
|
constructor(container: Container);
|
|
5
5
|
isEnabled(): boolean;
|
|
6
6
|
reset(): void;
|
|
7
|
-
interact(): void
|
|
7
|
+
interact(): Promise<void>;
|
|
8
8
|
private singleSelectorRepulse;
|
|
9
9
|
private hoverRepulse;
|
|
10
10
|
private processRepulse;
|
|
@@ -14,7 +14,7 @@ export class Repulser extends ExternalInteractorBase {
|
|
|
14
14
|
}
|
|
15
15
|
reset() {
|
|
16
16
|
}
|
|
17
|
-
interact() {
|
|
17
|
+
async interact() {
|
|
18
18
|
const container = this.container, options = container.actualOptions, mouseMoveStatus = container.interactivity.status === Constants.mouseMoveEvent, events = options.interactivity.events, hoverEnabled = events.onHover.enable, hoverMode = events.onHover.mode, clickEnabled = events.onClick.enable, clickMode = events.onClick.mode, divs = events.onDiv;
|
|
19
19
|
if (mouseMoveStatus && hoverEnabled && isInArray("repulse", hoverMode)) {
|
|
20
20
|
this.hoverRepulse();
|
|
@@ -2,7 +2,7 @@ import type { Container, IParticle, Particle } from "../../../Core";
|
|
|
2
2
|
import { ParticlesInteractorBase } from "../../../Core";
|
|
3
3
|
export declare class Attractor extends ParticlesInteractorBase {
|
|
4
4
|
constructor(container: Container);
|
|
5
|
-
interact(p1: IParticle): void
|
|
5
|
+
interact(p1: IParticle): Promise<void>;
|
|
6
6
|
isEnabled(particle: Particle): boolean;
|
|
7
7
|
reset(): void;
|
|
8
8
|
}
|
|
@@ -4,7 +4,7 @@ export class Attractor extends ParticlesInteractorBase {
|
|
|
4
4
|
constructor(container) {
|
|
5
5
|
super(container);
|
|
6
6
|
}
|
|
7
|
-
interact(p1) {
|
|
7
|
+
async interact(p1) {
|
|
8
8
|
var _a;
|
|
9
9
|
const container = this.container, distance = (_a = p1.retina.attractDistance) !== null && _a !== void 0 ? _a : container.retina.attractDistance, pos1 = p1.getPosition(), query = container.particles.quadTree.queryCircle(pos1, distance);
|
|
10
10
|
for (const p2 of query) {
|
|
@@ -4,7 +4,7 @@ export declare class Collider extends ParticlesInteractorBase {
|
|
|
4
4
|
constructor(container: Container);
|
|
5
5
|
isEnabled(particle: Particle): boolean;
|
|
6
6
|
reset(): void;
|
|
7
|
-
interact(p1: Particle): void
|
|
7
|
+
interact(p1: Particle): Promise<void>;
|
|
8
8
|
private resolveCollision;
|
|
9
9
|
private absorb;
|
|
10
10
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tsparticles",
|
|
3
|
-
"version": "1.41.
|
|
3
|
+
"version": "1.41.1",
|
|
4
4
|
"description": "Easily create highly customizable particle animations and use them as animated backgrounds for your website. Ready to use components available also for React, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Riot.js, Inferno.",
|
|
5
5
|
"homepage": "https://particles.js.org/",
|
|
6
6
|
"scripts": {
|