tsparticles 1.36.0 → 1.37.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/Core/Container.d.ts +3 -1
- package/Core/Container.js +16 -11
- package/Core/InteractionManager.d.ts +1 -0
- package/Core/InteractionManager.js +4 -1
- package/Core/Particles.d.ts +1 -1
- package/Core/Particles.js +3 -1
- package/Enums/Modes/ResponsiveMode.d.ts +4 -0
- package/Enums/Modes/ResponsiveMode.js +8 -0
- package/Enums/Modes/index.d.ts +1 -0
- package/Enums/Modes/index.js +1 -0
- package/Interactions/External/Attract/index.d.ts +1 -1
- package/Interactions/External/Attract/index.js +2 -2
- package/Interactions/External/Bounce/index.d.ts +1 -1
- package/Interactions/External/Bounce/index.js +2 -2
- package/Interactions/External/Bubble/index.d.ts +1 -1
- package/Interactions/External/Bubble/index.js +2 -2
- package/Interactions/External/Connect/index.d.ts +1 -1
- package/Interactions/External/Connect/index.js +2 -2
- package/Interactions/External/Grab/index.d.ts +1 -1
- package/Interactions/External/Grab/index.js +2 -2
- package/Interactions/External/Repulse/index.d.ts +1 -1
- package/Interactions/External/Repulse/index.js +2 -2
- package/Interactions/External/Trail/index.d.ts +1 -1
- package/Interactions/External/Trail/index.js +2 -2
- package/Interactions/Particles/Attract/index.d.ts +1 -1
- package/Interactions/Particles/Attract/index.js +2 -2
- package/Interactions/Particles/Collisions/index.d.ts +1 -1
- package/Interactions/Particles/Collisions/index.js +2 -2
- package/Interactions/Particles/Links/index.d.ts +2 -2
- package/Interactions/Particles/Links/index.js +5 -5
- package/Interactions/Particles/Links/plugin.d.ts +1 -1
- package/Interactions/Particles/Links/plugin.js +2 -2
- package/Options/Classes/FullScreen/FullScreen.js +2 -2
- package/Options/Classes/Interactivity/Interactivity.js +1 -1
- package/Options/Classes/Options.js +3 -1
- package/Options/Classes/Responsive.d.ts +2 -0
- package/Options/Classes/Responsive.js +10 -0
- package/Options/Interfaces/IResponsive.d.ts +2 -0
- package/Plugins/Absorbers/AbsorberInstance.d.ts +2 -1
- package/Plugins/Absorbers/AbsorberInstance.js +21 -9
- package/Plugins/Absorbers/Options/Classes/AbsorberSize.d.ts +2 -1
- package/Plugins/Absorbers/Options/Classes/AbsorberSize.js +6 -4
- package/Plugins/Absorbers/Options/Classes/AbsorberSizeLimit.d.ts +9 -0
- package/Plugins/Absorbers/Options/Classes/AbsorberSizeLimit.js +21 -0
- package/Plugins/Absorbers/Options/Interfaces/IAbsorberSize.d.ts +3 -2
- package/Plugins/Absorbers/Options/Interfaces/IAbsorberSizeLimit.d.ts +4 -0
- package/Plugins/Absorbers/Options/Interfaces/IAbsorberSizeLimit.js +2 -0
- package/Plugins/Absorbers/plugin.d.ts +1 -1
- package/Plugins/Absorbers/plugin.js +2 -2
- package/Plugins/Emitters/plugin.d.ts +1 -1
- package/Plugins/Emitters/plugin.js +2 -2
- package/Plugins/PolygonMask/plugin.js +1 -1
- package/Shapes/Circle/index.d.ts +1 -1
- package/Shapes/Circle/index.js +2 -2
- package/Shapes/Image/index.d.ts +1 -1
- package/Shapes/Image/index.js +3 -3
- package/Shapes/Line/index.d.ts +1 -1
- package/Shapes/Line/index.js +2 -2
- package/Shapes/Polygon/index.d.ts +3 -3
- package/Shapes/Polygon/index.js +7 -7
- package/Shapes/Square/index.d.ts +1 -1
- package/Shapes/Square/index.js +3 -3
- package/Shapes/Star/index.d.ts +1 -1
- package/Shapes/Star/index.js +2 -2
- package/Shapes/Text/index.d.ts +1 -1
- package/Shapes/Text/index.js +2 -2
- package/Updaters/Angle/index.d.ts +1 -1
- package/Updaters/Angle/index.js +2 -2
- package/Updaters/Color/index.d.ts +1 -1
- package/Updaters/Color/index.js +2 -2
- package/Updaters/Life/index.d.ts +1 -1
- package/Updaters/Life/index.js +2 -2
- package/Updaters/Opacity/index.d.ts +1 -1
- package/Updaters/Opacity/index.js +2 -2
- package/Updaters/OutModes/index.d.ts +1 -1
- package/Updaters/OutModes/index.js +2 -2
- package/Updaters/Roll/index.d.ts +1 -1
- package/Updaters/Roll/index.js +2 -2
- package/Updaters/Size/index.d.ts +1 -1
- package/Updaters/Size/index.js +2 -2
- package/Updaters/StrokeColor/index.d.ts +1 -1
- package/Updaters/StrokeColor/index.js +2 -2
- package/Updaters/Tilt/index.d.ts +1 -1
- package/Updaters/Tilt/index.js +2 -2
- package/Updaters/Wobble/index.d.ts +1 -1
- package/Updaters/Wobble/index.js +2 -2
- package/Utils/Plugins.d.ts +2 -2
- package/Utils/Plugins.js +4 -4
- package/Utils/Utils.d.ts +1 -2
- package/browser/Core/Container.d.ts +3 -1
- package/browser/Core/Container.js +17 -12
- package/browser/Core/InteractionManager.d.ts +1 -0
- package/browser/Core/InteractionManager.js +4 -1
- package/browser/Core/Particles.d.ts +1 -1
- package/browser/Core/Particles.js +3 -1
- package/browser/Enums/Modes/ResponsiveMode.d.ts +4 -0
- package/browser/Enums/Modes/ResponsiveMode.js +5 -0
- package/browser/Enums/Modes/index.d.ts +1 -0
- package/browser/Enums/Modes/index.js +1 -0
- package/browser/Interactions/External/Attract/index.d.ts +1 -1
- package/browser/Interactions/External/Attract/index.js +2 -2
- package/browser/Interactions/External/Bounce/index.d.ts +1 -1
- package/browser/Interactions/External/Bounce/index.js +2 -2
- package/browser/Interactions/External/Bubble/index.d.ts +1 -1
- package/browser/Interactions/External/Bubble/index.js +2 -2
- package/browser/Interactions/External/Connect/index.d.ts +1 -1
- package/browser/Interactions/External/Connect/index.js +2 -2
- package/browser/Interactions/External/Grab/index.d.ts +1 -1
- package/browser/Interactions/External/Grab/index.js +2 -2
- package/browser/Interactions/External/Repulse/index.d.ts +1 -1
- package/browser/Interactions/External/Repulse/index.js +2 -2
- package/browser/Interactions/External/Trail/index.d.ts +1 -1
- package/browser/Interactions/External/Trail/index.js +2 -2
- package/browser/Interactions/Particles/Attract/index.d.ts +1 -1
- package/browser/Interactions/Particles/Attract/index.js +2 -2
- package/browser/Interactions/Particles/Collisions/index.d.ts +1 -1
- package/browser/Interactions/Particles/Collisions/index.js +2 -2
- package/browser/Interactions/Particles/Links/index.d.ts +2 -2
- package/browser/Interactions/Particles/Links/index.js +5 -5
- package/browser/Interactions/Particles/Links/plugin.d.ts +1 -1
- package/browser/Interactions/Particles/Links/plugin.js +2 -2
- package/browser/Options/Classes/FullScreen/FullScreen.js +2 -2
- package/browser/Options/Classes/Interactivity/Interactivity.js +1 -1
- package/browser/Options/Classes/Options.js +4 -2
- package/browser/Options/Classes/Responsive.d.ts +2 -0
- package/browser/Options/Classes/Responsive.js +11 -0
- package/browser/Options/Interfaces/IResponsive.d.ts +2 -0
- package/browser/Plugins/Absorbers/AbsorberInstance.d.ts +2 -1
- package/browser/Plugins/Absorbers/AbsorberInstance.js +21 -9
- package/browser/Plugins/Absorbers/Options/Classes/AbsorberSize.d.ts +2 -1
- package/browser/Plugins/Absorbers/Options/Classes/AbsorberSize.js +6 -4
- package/browser/Plugins/Absorbers/Options/Classes/AbsorberSizeLimit.d.ts +9 -0
- package/browser/Plugins/Absorbers/Options/Classes/AbsorberSizeLimit.js +17 -0
- package/browser/Plugins/Absorbers/Options/Interfaces/IAbsorberSize.d.ts +3 -2
- package/browser/Plugins/Absorbers/Options/Interfaces/IAbsorberSizeLimit.d.ts +4 -0
- package/browser/Plugins/Absorbers/Options/Interfaces/IAbsorberSizeLimit.js +1 -0
- package/browser/Plugins/Absorbers/plugin.d.ts +1 -1
- package/browser/Plugins/Absorbers/plugin.js +2 -2
- package/browser/Plugins/Emitters/plugin.d.ts +1 -1
- package/browser/Plugins/Emitters/plugin.js +2 -2
- package/browser/Plugins/PolygonMask/plugin.js +4 -2
- package/browser/Shapes/Circle/index.d.ts +1 -1
- package/browser/Shapes/Circle/index.js +2 -2
- package/browser/Shapes/Image/index.d.ts +1 -1
- package/browser/Shapes/Image/index.js +3 -3
- package/browser/Shapes/Line/index.d.ts +1 -1
- package/browser/Shapes/Line/index.js +2 -2
- package/browser/Shapes/Polygon/index.d.ts +3 -3
- package/browser/Shapes/Polygon/index.js +7 -7
- package/browser/Shapes/Square/index.d.ts +1 -1
- package/browser/Shapes/Square/index.js +3 -3
- package/browser/Shapes/Star/index.d.ts +1 -1
- package/browser/Shapes/Star/index.js +2 -2
- package/browser/Shapes/Text/index.d.ts +1 -1
- package/browser/Shapes/Text/index.js +2 -2
- package/browser/Updaters/Angle/index.d.ts +1 -1
- package/browser/Updaters/Angle/index.js +2 -2
- package/browser/Updaters/Color/index.d.ts +1 -1
- package/browser/Updaters/Color/index.js +2 -2
- package/browser/Updaters/Life/index.d.ts +1 -1
- package/browser/Updaters/Life/index.js +2 -2
- package/browser/Updaters/Opacity/index.d.ts +1 -1
- package/browser/Updaters/Opacity/index.js +2 -2
- package/browser/Updaters/OutModes/index.d.ts +1 -1
- package/browser/Updaters/OutModes/index.js +2 -2
- package/browser/Updaters/Roll/index.d.ts +1 -1
- package/browser/Updaters/Roll/index.js +2 -2
- package/browser/Updaters/Size/index.d.ts +1 -1
- package/browser/Updaters/Size/index.js +2 -2
- package/browser/Updaters/StrokeColor/index.d.ts +1 -1
- package/browser/Updaters/StrokeColor/index.js +2 -2
- package/browser/Updaters/Tilt/index.d.ts +1 -1
- package/browser/Updaters/Tilt/index.js +2 -2
- package/browser/Updaters/Wobble/index.d.ts +1 -1
- package/browser/Updaters/Wobble/index.js +2 -2
- package/browser/Utils/Plugins.d.ts +2 -2
- package/browser/Utils/Plugins.js +4 -4
- package/browser/Utils/Utils.d.ts +1 -2
- package/browser/full.d.ts +1 -1
- package/browser/full.js +9 -9
- package/browser/index.js +1 -1
- package/browser/index.slim.js +1 -1
- package/browser/main.d.ts +10 -6
- package/browser/main.js +20 -6
- package/browser/slim.d.ts +1 -1
- package/browser/slim.js +24 -24
- package/esm/Core/Container.d.ts +3 -1
- package/esm/Core/Container.js +16 -11
- package/esm/Core/InteractionManager.d.ts +1 -0
- package/esm/Core/InteractionManager.js +4 -1
- package/esm/Core/Particles.d.ts +1 -1
- package/esm/Core/Particles.js +3 -1
- package/esm/Enums/Modes/ResponsiveMode.d.ts +4 -0
- package/esm/Enums/Modes/ResponsiveMode.js +5 -0
- package/esm/Enums/Modes/index.d.ts +1 -0
- package/esm/Enums/Modes/index.js +1 -0
- package/esm/Interactions/External/Attract/index.d.ts +1 -1
- package/esm/Interactions/External/Attract/index.js +2 -2
- package/esm/Interactions/External/Bounce/index.d.ts +1 -1
- package/esm/Interactions/External/Bounce/index.js +2 -2
- package/esm/Interactions/External/Bubble/index.d.ts +1 -1
- package/esm/Interactions/External/Bubble/index.js +2 -2
- package/esm/Interactions/External/Connect/index.d.ts +1 -1
- package/esm/Interactions/External/Connect/index.js +2 -2
- package/esm/Interactions/External/Grab/index.d.ts +1 -1
- package/esm/Interactions/External/Grab/index.js +2 -2
- package/esm/Interactions/External/Repulse/index.d.ts +1 -1
- package/esm/Interactions/External/Repulse/index.js +2 -2
- package/esm/Interactions/External/Trail/index.d.ts +1 -1
- package/esm/Interactions/External/Trail/index.js +2 -2
- package/esm/Interactions/Particles/Attract/index.d.ts +1 -1
- package/esm/Interactions/Particles/Attract/index.js +2 -2
- package/esm/Interactions/Particles/Collisions/index.d.ts +1 -1
- package/esm/Interactions/Particles/Collisions/index.js +2 -2
- package/esm/Interactions/Particles/Links/index.d.ts +2 -2
- package/esm/Interactions/Particles/Links/index.js +5 -5
- package/esm/Interactions/Particles/Links/plugin.d.ts +1 -1
- package/esm/Interactions/Particles/Links/plugin.js +2 -2
- package/esm/Options/Classes/FullScreen/FullScreen.js +2 -2
- package/esm/Options/Classes/Interactivity/Interactivity.js +1 -1
- package/esm/Options/Classes/Options.js +4 -2
- package/esm/Options/Classes/Responsive.d.ts +2 -0
- package/esm/Options/Classes/Responsive.js +10 -0
- package/esm/Options/Interfaces/IResponsive.d.ts +2 -0
- package/esm/Plugins/Absorbers/AbsorberInstance.d.ts +2 -1
- package/esm/Plugins/Absorbers/AbsorberInstance.js +21 -9
- package/esm/Plugins/Absorbers/Options/Classes/AbsorberSize.d.ts +2 -1
- package/esm/Plugins/Absorbers/Options/Classes/AbsorberSize.js +6 -4
- package/esm/Plugins/Absorbers/Options/Classes/AbsorberSizeLimit.d.ts +9 -0
- package/esm/Plugins/Absorbers/Options/Classes/AbsorberSizeLimit.js +17 -0
- package/esm/Plugins/Absorbers/Options/Interfaces/IAbsorberSize.d.ts +3 -2
- package/esm/Plugins/Absorbers/Options/Interfaces/IAbsorberSizeLimit.d.ts +4 -0
- package/esm/Plugins/Absorbers/Options/Interfaces/IAbsorberSizeLimit.js +1 -0
- package/esm/Plugins/Absorbers/plugin.d.ts +1 -1
- package/esm/Plugins/Absorbers/plugin.js +2 -2
- package/esm/Plugins/Emitters/plugin.d.ts +1 -1
- package/esm/Plugins/Emitters/plugin.js +2 -2
- package/esm/Plugins/PolygonMask/plugin.js +1 -1
- package/esm/Shapes/Circle/index.d.ts +1 -1
- package/esm/Shapes/Circle/index.js +2 -2
- package/esm/Shapes/Image/index.d.ts +1 -1
- package/esm/Shapes/Image/index.js +3 -3
- package/esm/Shapes/Line/index.d.ts +1 -1
- package/esm/Shapes/Line/index.js +2 -2
- package/esm/Shapes/Polygon/index.d.ts +3 -3
- package/esm/Shapes/Polygon/index.js +7 -7
- package/esm/Shapes/Square/index.d.ts +1 -1
- package/esm/Shapes/Square/index.js +3 -3
- package/esm/Shapes/Star/index.d.ts +1 -1
- package/esm/Shapes/Star/index.js +2 -2
- package/esm/Shapes/Text/index.d.ts +1 -1
- package/esm/Shapes/Text/index.js +2 -2
- package/esm/Updaters/Angle/index.d.ts +1 -1
- package/esm/Updaters/Angle/index.js +2 -2
- package/esm/Updaters/Color/index.d.ts +1 -1
- package/esm/Updaters/Color/index.js +2 -2
- package/esm/Updaters/Life/index.d.ts +1 -1
- package/esm/Updaters/Life/index.js +2 -2
- package/esm/Updaters/Opacity/index.d.ts +1 -1
- package/esm/Updaters/Opacity/index.js +2 -2
- package/esm/Updaters/OutModes/index.d.ts +1 -1
- package/esm/Updaters/OutModes/index.js +2 -2
- package/esm/Updaters/Roll/index.d.ts +1 -1
- package/esm/Updaters/Roll/index.js +2 -2
- package/esm/Updaters/Size/index.d.ts +1 -1
- package/esm/Updaters/Size/index.js +2 -2
- package/esm/Updaters/StrokeColor/index.d.ts +1 -1
- package/esm/Updaters/StrokeColor/index.js +2 -2
- package/esm/Updaters/Tilt/index.d.ts +1 -1
- package/esm/Updaters/Tilt/index.js +2 -2
- package/esm/Updaters/Wobble/index.d.ts +1 -1
- package/esm/Updaters/Wobble/index.js +2 -2
- package/esm/Utils/Plugins.d.ts +2 -2
- package/esm/Utils/Plugins.js +4 -4
- package/esm/Utils/Utils.d.ts +1 -2
- package/esm/full.d.ts +1 -1
- package/esm/full.js +9 -9
- package/esm/index.js +1 -1
- package/esm/index.slim.js +1 -1
- package/esm/main.d.ts +7 -6
- package/esm/main.js +17 -6
- package/esm/slim.d.ts +1 -1
- package/esm/slim.js +24 -24
- package/full.d.ts +1 -1
- package/full.js +9 -9
- package/index.js +1 -1
- package/index.slim.js +1 -1
- package/main.d.ts +7 -6
- package/main.js +17 -6
- package/package.json +1 -1
- package/report.html +2 -2
- package/report.slim.html +2 -2
- package/slim.d.ts +1 -1
- package/slim.js +24 -24
- package/tsparticles.js +743 -363
- package/tsparticles.min.js +2 -2
- package/tsparticles.pathseg.js +2 -2
- package/tsparticles.slim.js +539 -284
- package/tsparticles.slim.min.js +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Collider } from "./Collider";
|
|
2
|
-
export function loadParticlesCollisionsInteraction(tsParticles) {
|
|
3
|
-
tsParticles.addInteractor("particlesCollisions", (container) => new Collider(container));
|
|
2
|
+
export async function loadParticlesCollisionsInteraction(tsParticles) {
|
|
3
|
+
await tsParticles.addInteractor("particlesCollisions", (container) => new Collider(container));
|
|
4
4
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { Main } from "../../../main";
|
|
2
|
-
export declare function loadInteraction(tsParticles: Main): void
|
|
3
|
-
export declare function loadParticlesLinksInteraction(tsParticles: Main): void
|
|
2
|
+
export declare function loadInteraction(tsParticles: Main): Promise<void>;
|
|
3
|
+
export declare function loadParticlesLinksInteraction(tsParticles: Main): Promise<void>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Linker } from "./Linker";
|
|
2
2
|
import { loadPlugin } from "./plugin";
|
|
3
|
-
export function loadInteraction(tsParticles) {
|
|
4
|
-
tsParticles.addInteractor("particlesLinks", (container) => new Linker(container));
|
|
3
|
+
export async function loadInteraction(tsParticles) {
|
|
4
|
+
await tsParticles.addInteractor("particlesLinks", (container) => new Linker(container));
|
|
5
5
|
}
|
|
6
|
-
export function loadParticlesLinksInteraction(tsParticles) {
|
|
7
|
-
loadInteraction(tsParticles);
|
|
8
|
-
loadPlugin(tsParticles);
|
|
6
|
+
export async function loadParticlesLinksInteraction(tsParticles) {
|
|
7
|
+
await loadInteraction(tsParticles);
|
|
8
|
+
await loadPlugin(tsParticles);
|
|
9
9
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Main } from "../../../main";
|
|
2
|
-
export declare function loadPlugin(tsParticles: Main): void
|
|
2
|
+
export declare function loadPlugin(tsParticles: Main): Promise<void>;
|
|
@@ -3,7 +3,7 @@ import { Events } from "./Events/Events";
|
|
|
3
3
|
import { Modes } from "./Modes/Modes";
|
|
4
4
|
export class Interactivity {
|
|
5
5
|
constructor() {
|
|
6
|
-
this.detectsOn = InteractivityDetect.
|
|
6
|
+
this.detectsOn = InteractivityDetect.window;
|
|
7
7
|
this.events = new Events();
|
|
8
8
|
this.modes = new Modes();
|
|
9
9
|
}
|
|
@@ -10,7 +10,7 @@ import { BackgroundMask } from "./BackgroundMask/BackgroundMask";
|
|
|
10
10
|
import { Background } from "./Background/Background";
|
|
11
11
|
import { Plugins } from "../../Utils";
|
|
12
12
|
import { Theme } from "./Theme/Theme";
|
|
13
|
-
import { ThemeMode } from "../../Enums";
|
|
13
|
+
import { ResponsiveMode, ThemeMode } from "../../Enums";
|
|
14
14
|
import { FullScreen } from "./FullScreen/FullScreen";
|
|
15
15
|
import { Motion } from "./Motion/Motion";
|
|
16
16
|
import { ManualParticle } from "./ManualParticle";
|
|
@@ -145,7 +145,9 @@ export class Options {
|
|
|
145
145
|
}
|
|
146
146
|
setResponsive(width, pxRatio, defaultOptions) {
|
|
147
147
|
this.load(defaultOptions);
|
|
148
|
-
const responsiveOptions = this.responsive.find((t) => t.
|
|
148
|
+
const responsiveOptions = this.responsive.find((t) => t.mode === ResponsiveMode.screen && screen
|
|
149
|
+
? t.maxWidth * pxRatio > screen.availWidth
|
|
150
|
+
: t.maxWidth * pxRatio > width);
|
|
149
151
|
this.load(responsiveOptions === null || responsiveOptions === void 0 ? void 0 : responsiveOptions.options);
|
|
150
152
|
return responsiveOptions === null || responsiveOptions === void 0 ? void 0 : responsiveOptions.maxWidth;
|
|
151
153
|
}
|
|
@@ -2,9 +2,11 @@ import type { IResponsive } from "../Interfaces/IResponsive";
|
|
|
2
2
|
import type { IOptionLoader } from "../Interfaces/IOptionLoader";
|
|
3
3
|
import type { RecursivePartial } from "../../Types";
|
|
4
4
|
import type { IOptions } from "../Interfaces/IOptions";
|
|
5
|
+
import { ResponsiveMode } from "../../Enums";
|
|
5
6
|
export declare class Responsive implements IResponsive, IOptionLoader<IResponsive> {
|
|
6
7
|
maxWidth: number;
|
|
7
8
|
options: RecursivePartial<IOptions>;
|
|
9
|
+
mode: ResponsiveMode;
|
|
8
10
|
constructor();
|
|
9
11
|
load(data?: RecursivePartial<IResponsive>): void;
|
|
10
12
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { deepExtend } from "../../Utils";
|
|
2
|
+
import { ResponsiveMode } from "../../Enums";
|
|
2
3
|
export class Responsive {
|
|
3
4
|
constructor() {
|
|
4
5
|
this.maxWidth = Infinity;
|
|
5
6
|
this.options = {};
|
|
7
|
+
this.mode = ResponsiveMode.canvas;
|
|
6
8
|
}
|
|
7
9
|
load(data) {
|
|
8
10
|
if (!data) {
|
|
@@ -11,6 +13,14 @@ export class Responsive {
|
|
|
11
13
|
if (data.maxWidth !== undefined) {
|
|
12
14
|
this.maxWidth = data.maxWidth;
|
|
13
15
|
}
|
|
16
|
+
if (data.mode !== undefined) {
|
|
17
|
+
if (data.mode === ResponsiveMode.screen) {
|
|
18
|
+
this.mode = ResponsiveMode.screen;
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
this.mode = ResponsiveMode.canvas;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
14
24
|
if (data.options !== undefined) {
|
|
15
25
|
this.options = deepExtend({}, data.options);
|
|
16
26
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { ResponsiveMode } from "../../Enums";
|
|
1
2
|
import type { RecursivePartial } from "../../Types";
|
|
2
3
|
import type { IOptions } from "./IOptions";
|
|
3
4
|
export interface IResponsive {
|
|
4
5
|
maxWidth: number;
|
|
5
6
|
options: RecursivePartial<IOptions>;
|
|
7
|
+
mode: ResponsiveMode;
|
|
6
8
|
}
|
|
@@ -5,6 +5,7 @@ import type { IAbsorber } from "./Options/Interfaces/IAbsorber";
|
|
|
5
5
|
import type { Absorbers } from "./Absorbers";
|
|
6
6
|
import { Vector } from "../../Core/Particle/Vector";
|
|
7
7
|
import { RotateDirection } from "../../Enums";
|
|
8
|
+
import { IAbsorberSizeLimit } from "./Options/Interfaces/IAbsorberSizeLimit";
|
|
8
9
|
declare type OrbitingParticle = Particle & {
|
|
9
10
|
absorberOrbit?: Vector;
|
|
10
11
|
absorberOrbitDirection?: RotateDirection;
|
|
@@ -17,7 +18,7 @@ export declare class AbsorberInstance {
|
|
|
17
18
|
opacity: number;
|
|
18
19
|
size: number;
|
|
19
20
|
color: IRgb;
|
|
20
|
-
limit
|
|
21
|
+
limit: IAbsorberSizeLimit;
|
|
21
22
|
readonly name?: string;
|
|
22
23
|
position: Vector;
|
|
23
24
|
private dragging;
|
|
@@ -3,7 +3,7 @@ import { Vector } from "../../Core/Particle/Vector";
|
|
|
3
3
|
import { RotateDirection } from "../../Enums";
|
|
4
4
|
export class AbsorberInstance {
|
|
5
5
|
constructor(absorbers, container, options, position) {
|
|
6
|
-
var _a, _b, _c;
|
|
6
|
+
var _a, _b, _c, _d, _e;
|
|
7
7
|
this.absorbers = absorbers;
|
|
8
8
|
this.container = container;
|
|
9
9
|
this.initialPosition = position ? Vector.create(position.x, position.y) : undefined;
|
|
@@ -14,14 +14,23 @@ export class AbsorberInstance {
|
|
|
14
14
|
this.size = getRangeValue(options.size.value) * container.retina.pixelRatio;
|
|
15
15
|
this.mass = this.size * options.size.density * container.retina.reduceFactor;
|
|
16
16
|
const limit = options.size.limit;
|
|
17
|
-
this.limit =
|
|
17
|
+
this.limit =
|
|
18
|
+
typeof limit === "number"
|
|
19
|
+
? {
|
|
20
|
+
radius: limit * container.retina.pixelRatio * container.retina.reduceFactor,
|
|
21
|
+
mass: 0,
|
|
22
|
+
}
|
|
23
|
+
: {
|
|
24
|
+
radius: ((_a = limit === null || limit === void 0 ? void 0 : limit.radius) !== null && _a !== void 0 ? _a : 0) * container.retina.pixelRatio * container.retina.reduceFactor,
|
|
25
|
+
mass: (_b = limit === null || limit === void 0 ? void 0 : limit.mass) !== null && _b !== void 0 ? _b : 0,
|
|
26
|
+
};
|
|
18
27
|
const color = typeof options.color === "string" ? { value: options.color } : options.color;
|
|
19
|
-
this.color = (
|
|
28
|
+
this.color = (_c = colorToRgb(color)) !== null && _c !== void 0 ? _c : {
|
|
20
29
|
b: 0,
|
|
21
30
|
g: 0,
|
|
22
31
|
r: 0,
|
|
23
32
|
};
|
|
24
|
-
this.position = (
|
|
33
|
+
this.position = (_e = (_d = this.initialPosition) === null || _d === void 0 ? void 0 : _d.copy()) !== null && _e !== void 0 ? _e : this.calcPosition();
|
|
25
34
|
}
|
|
26
35
|
attract(particle) {
|
|
27
36
|
const container = this.container;
|
|
@@ -64,10 +73,12 @@ export class AbsorberInstance {
|
|
|
64
73
|
}
|
|
65
74
|
this.updateParticlePosition(particle, v);
|
|
66
75
|
}
|
|
67
|
-
if (this.limit
|
|
76
|
+
if (this.limit.radius <= 0 || this.size < this.limit.radius) {
|
|
68
77
|
this.size += sizeFactor;
|
|
69
78
|
}
|
|
70
|
-
this.mass
|
|
79
|
+
if (this.limit.mass <= 0 || this.mass < this.limit.mass) {
|
|
80
|
+
this.mass += sizeFactor * this.options.size.density * container.retina.reduceFactor;
|
|
81
|
+
}
|
|
71
82
|
}
|
|
72
83
|
else {
|
|
73
84
|
this.updateParticlePosition(particle, v);
|
|
@@ -102,9 +113,10 @@ export class AbsorberInstance {
|
|
|
102
113
|
const container = this.container;
|
|
103
114
|
const canvasSize = container.canvas.size;
|
|
104
115
|
if (particle.needsNewPosition) {
|
|
105
|
-
|
|
106
|
-
particle.position.
|
|
107
|
-
particle.
|
|
116
|
+
particle.position.x = Math.floor(Math.random() * canvasSize.width);
|
|
117
|
+
particle.position.y = Math.floor(Math.random() * canvasSize.height);
|
|
118
|
+
particle.velocity.setTo(particle.initialVelocity);
|
|
119
|
+
particle.absorberOrbit = undefined;
|
|
108
120
|
particle.needsNewPosition = false;
|
|
109
121
|
}
|
|
110
122
|
if (this.options.orbits) {
|
|
@@ -2,9 +2,10 @@ import type { IAbsorberSize } from "../Interfaces/IAbsorberSize";
|
|
|
2
2
|
import type { RecursivePartial } from "../../../../Types";
|
|
3
3
|
import type { IOptionLoader } from "../../../../Options/Interfaces/IOptionLoader";
|
|
4
4
|
import { ValueWithRandom } from "../../../../Options/Classes/ValueWithRandom";
|
|
5
|
+
import { AbsorberSizeLimit } from "./AbsorberSizeLimit";
|
|
5
6
|
export declare class AbsorberSize extends ValueWithRandom implements IAbsorberSize, IOptionLoader<IAbsorberSize> {
|
|
6
7
|
density: number;
|
|
7
|
-
limit
|
|
8
|
+
limit: AbsorberSizeLimit;
|
|
8
9
|
constructor();
|
|
9
10
|
load(data?: RecursivePartial<IAbsorberSize>): void;
|
|
10
11
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { ValueWithRandom } from "../../../../Options/Classes/ValueWithRandom";
|
|
2
|
+
import { AbsorberSizeLimit } from "./AbsorberSizeLimit";
|
|
2
3
|
export class AbsorberSize extends ValueWithRandom {
|
|
3
4
|
constructor() {
|
|
4
5
|
super();
|
|
5
6
|
this.density = 5;
|
|
6
7
|
this.random.minimumValue = 1;
|
|
7
8
|
this.value = 50;
|
|
9
|
+
this.limit = new AbsorberSizeLimit();
|
|
8
10
|
}
|
|
9
11
|
load(data) {
|
|
10
12
|
if (!data) {
|
|
@@ -14,11 +16,11 @@ export class AbsorberSize extends ValueWithRandom {
|
|
|
14
16
|
if (data.density !== undefined) {
|
|
15
17
|
this.density = data.density;
|
|
16
18
|
}
|
|
17
|
-
if (data.limit
|
|
18
|
-
this.limit = data.limit;
|
|
19
|
+
if (typeof data.limit === "number") {
|
|
20
|
+
this.limit.radius = data.limit;
|
|
19
21
|
}
|
|
20
|
-
|
|
21
|
-
this.limit
|
|
22
|
+
else {
|
|
23
|
+
this.limit.load(data.limit);
|
|
22
24
|
}
|
|
23
25
|
}
|
|
24
26
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { RecursivePartial } from "../../../../Types";
|
|
2
|
+
import type { IOptionLoader } from "../../../../Options/Interfaces/IOptionLoader";
|
|
3
|
+
import type { IAbsorberSizeLimit } from "../Interfaces/IAbsorberSizeLimit";
|
|
4
|
+
export declare class AbsorberSizeLimit implements IAbsorberSizeLimit, IOptionLoader<IAbsorberSizeLimit> {
|
|
5
|
+
radius: number;
|
|
6
|
+
mass: number;
|
|
7
|
+
constructor();
|
|
8
|
+
load(data?: RecursivePartial<IAbsorberSizeLimit>): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export class AbsorberSizeLimit {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.radius = 0;
|
|
4
|
+
this.mass = 0;
|
|
5
|
+
}
|
|
6
|
+
load(data) {
|
|
7
|
+
if (!data) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
if (data.mass !== undefined) {
|
|
11
|
+
this.mass = data.mass;
|
|
12
|
+
}
|
|
13
|
+
if (data.radius !== undefined) {
|
|
14
|
+
this.radius = data.radius;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { IValueWithRandom } from "../../../../Options/Interfaces/IValueWithRandom";
|
|
1
|
+
import type { IValueWithRandom } from "../../../../Options/Interfaces/IValueWithRandom";
|
|
2
|
+
import type { IAbsorberSizeLimit } from "./IAbsorberSizeLimit";
|
|
2
3
|
export interface IAbsorberSize extends IValueWithRandom {
|
|
3
|
-
limit?: number;
|
|
4
|
+
limit?: number | IAbsorberSizeLimit;
|
|
4
5
|
density: number;
|
|
5
6
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Main } from "../../main";
|
|
2
|
-
export declare function loadAbsorbersPlugin(tsParticles: Main): void
|
|
2
|
+
export declare function loadAbsorbersPlugin(tsParticles: Main): Promise<void>;
|
|
@@ -64,9 +64,9 @@ class EmittersPlugin {
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
export function loadEmittersPlugin(tsParticles) {
|
|
67
|
+
export async function loadEmittersPlugin(tsParticles) {
|
|
68
68
|
const plugin = new EmittersPlugin();
|
|
69
|
-
tsParticles.addPlugin(plugin);
|
|
69
|
+
await tsParticles.addPlugin(plugin);
|
|
70
70
|
if (!tsParticles.addEmitterShape) {
|
|
71
71
|
tsParticles.addEmitterShape = (name, shape) => {
|
|
72
72
|
ShapeManager.addShape(name, shape);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Main } from "../../main";
|
|
2
|
-
export declare function loadCircleShape(tsParticles: Main): void
|
|
2
|
+
export declare function loadCircleShape(tsParticles: Main): Promise<void>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Main } from "../../main";
|
|
2
|
-
export declare function loadImageShape(tsParticles: Main): void
|
|
2
|
+
export declare function loadImageShape(tsParticles: Main): Promise<void>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ImageDrawer } from "./ImageDrawer";
|
|
2
|
-
export function loadImageShape(tsParticles) {
|
|
2
|
+
export async function loadImageShape(tsParticles) {
|
|
3
3
|
const imageDrawer = new ImageDrawer();
|
|
4
|
-
tsParticles.addShape("image", imageDrawer);
|
|
5
|
-
tsParticles.addShape("images", imageDrawer);
|
|
4
|
+
await tsParticles.addShape("image", imageDrawer);
|
|
5
|
+
await tsParticles.addShape("images", imageDrawer);
|
|
6
6
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Main } from "../../main";
|
|
2
|
-
export declare function loadLineShape(tsParticles: Main): void
|
|
2
|
+
export declare function loadLineShape(tsParticles: Main): Promise<void>;
|
package/esm/Shapes/Line/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Main } from "../../main";
|
|
2
|
-
export declare function loadGenericPolygonShape(tsParticles: Main): void
|
|
3
|
-
export declare function loadTriangleShape(tsParticles: Main): void
|
|
4
|
-
export declare function loadPolygonShape(tsParticles: Main): void
|
|
2
|
+
export declare function loadGenericPolygonShape(tsParticles: Main): Promise<void>;
|
|
3
|
+
export declare function loadTriangleShape(tsParticles: Main): Promise<void>;
|
|
4
|
+
export declare function loadPolygonShape(tsParticles: Main): Promise<void>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { PolygonDrawer } from "./PolygonDrawer";
|
|
2
2
|
import { TriangleDrawer } from "./TriangleDrawer";
|
|
3
|
-
export function loadGenericPolygonShape(tsParticles) {
|
|
4
|
-
tsParticles.addShape("polygon", new PolygonDrawer());
|
|
3
|
+
export async function loadGenericPolygonShape(tsParticles) {
|
|
4
|
+
await tsParticles.addShape("polygon", new PolygonDrawer());
|
|
5
5
|
}
|
|
6
|
-
export function loadTriangleShape(tsParticles) {
|
|
7
|
-
tsParticles.addShape("triangle", new TriangleDrawer());
|
|
6
|
+
export async function loadTriangleShape(tsParticles) {
|
|
7
|
+
await tsParticles.addShape("triangle", new TriangleDrawer());
|
|
8
8
|
}
|
|
9
|
-
export function loadPolygonShape(tsParticles) {
|
|
10
|
-
loadGenericPolygonShape(tsParticles);
|
|
11
|
-
loadTriangleShape(tsParticles);
|
|
9
|
+
export async function loadPolygonShape(tsParticles) {
|
|
10
|
+
await loadGenericPolygonShape(tsParticles);
|
|
11
|
+
await loadTriangleShape(tsParticles);
|
|
12
12
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Main } from "../../main";
|
|
2
|
-
export declare function loadSquareShape(tsParticles: Main): void
|
|
2
|
+
export declare function loadSquareShape(tsParticles: Main): Promise<void>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SquareDrawer } from "./SquareDrawer";
|
|
2
|
-
export function loadSquareShape(tsParticles) {
|
|
2
|
+
export async function loadSquareShape(tsParticles) {
|
|
3
3
|
const drawer = new SquareDrawer();
|
|
4
|
-
tsParticles.addShape("edge", drawer);
|
|
5
|
-
tsParticles.addShape("square", drawer);
|
|
4
|
+
await tsParticles.addShape("edge", drawer);
|
|
5
|
+
await tsParticles.addShape("square", drawer);
|
|
6
6
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Main } from "../../main";
|
|
2
|
-
export declare function loadStarShape(tsParticles: Main): void
|
|
2
|
+
export declare function loadStarShape(tsParticles: Main): Promise<void>;
|
package/esm/Shapes/Star/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Main } from "../../main";
|
|
2
|
-
export declare function loadTextShape(tsParticles: Main): void
|
|
2
|
+
export declare function loadTextShape(tsParticles: Main): Promise<void>;
|
package/esm/Shapes/Text/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { validTypes, TextDrawer } from "./TextDrawer";
|
|
2
|
-
export function loadTextShape(tsParticles) {
|
|
2
|
+
export async function loadTextShape(tsParticles) {
|
|
3
3
|
const drawer = new TextDrawer();
|
|
4
4
|
for (const type of validTypes) {
|
|
5
|
-
tsParticles.addShape(type, drawer);
|
|
5
|
+
await tsParticles.addShape(type, drawer);
|
|
6
6
|
}
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Main } from "../../main";
|
|
2
|
-
export declare function loadAngleUpdater(tsParticles: Main): void
|
|
2
|
+
export declare function loadAngleUpdater(tsParticles: Main): Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { AngleUpdater } from "./AngleUpdater";
|
|
2
|
-
export function loadAngleUpdater(tsParticles) {
|
|
3
|
-
tsParticles.addParticleUpdater("angle", (container) => new AngleUpdater(container));
|
|
2
|
+
export async function loadAngleUpdater(tsParticles) {
|
|
3
|
+
await tsParticles.addParticleUpdater("angle", (container) => new AngleUpdater(container));
|
|
4
4
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Main } from "../../main";
|
|
2
|
-
export declare function loadColorUpdater(tsParticles: Main): void
|
|
2
|
+
export declare function loadColorUpdater(tsParticles: Main): Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ColorUpdater } from "./ColorUpdater";
|
|
2
|
-
export function loadColorUpdater(tsParticles) {
|
|
3
|
-
tsParticles.addParticleUpdater("color", (container) => new ColorUpdater(container));
|
|
2
|
+
export async function loadColorUpdater(tsParticles) {
|
|
3
|
+
await tsParticles.addParticleUpdater("color", (container) => new ColorUpdater(container));
|
|
4
4
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Main } from "../../main";
|
|
2
|
-
export declare function loadLifeUpdater(tsParticles: Main): void
|
|
2
|
+
export declare function loadLifeUpdater(tsParticles: Main): Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { LifeUpdater } from "./LifeUpdater";
|
|
2
|
-
export function loadLifeUpdater(tsParticles) {
|
|
3
|
-
tsParticles.addParticleUpdater("life", (container) => new LifeUpdater(container));
|
|
2
|
+
export async function loadLifeUpdater(tsParticles) {
|
|
3
|
+
await tsParticles.addParticleUpdater("life", (container) => new LifeUpdater(container));
|
|
4
4
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Main } from "../../main";
|
|
2
|
-
export declare function loadOpacityUpdater(tsParticles: Main): void
|
|
2
|
+
export declare function loadOpacityUpdater(tsParticles: Main): Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { OpacityUpdater } from "./OpacityUpdater";
|
|
2
|
-
export function loadOpacityUpdater(tsParticles) {
|
|
3
|
-
tsParticles.addParticleUpdater("opacity", (container) => new OpacityUpdater(container));
|
|
2
|
+
export async function loadOpacityUpdater(tsParticles) {
|
|
3
|
+
await tsParticles.addParticleUpdater("opacity", (container) => new OpacityUpdater(container));
|
|
4
4
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Main } from "../../main";
|
|
2
|
-
export declare function loadOutModesUpdater(tsParticles: Main): void
|
|
2
|
+
export declare function loadOutModesUpdater(tsParticles: Main): Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { OutOfCanvasUpdater } from "./OutOfCanvasUpdater";
|
|
2
|
-
export function loadOutModesUpdater(tsParticles) {
|
|
3
|
-
tsParticles.addParticleUpdater("outModes", (container) => new OutOfCanvasUpdater(container));
|
|
2
|
+
export async function loadOutModesUpdater(tsParticles) {
|
|
3
|
+
await tsParticles.addParticleUpdater("outModes", (container) => new OutOfCanvasUpdater(container));
|
|
4
4
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Main } from "../../main";
|
|
2
|
-
export declare function loadRollUpdater(tsParticles: Main): void
|
|
2
|
+
export declare function loadRollUpdater(tsParticles: Main): Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { RollUpdater } from "./RollUpdater";
|
|
2
|
-
export function loadRollUpdater(tsParticles) {
|
|
3
|
-
tsParticles.addParticleUpdater("roll", () => new RollUpdater());
|
|
2
|
+
export async function loadRollUpdater(tsParticles) {
|
|
3
|
+
await tsParticles.addParticleUpdater("roll", () => new RollUpdater());
|
|
4
4
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Main } from "../../main";
|
|
2
|
-
export declare function loadSizeUpdater(tsParticles: Main): void
|
|
2
|
+
export declare function loadSizeUpdater(tsParticles: Main): Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { SizeUpdater } from "./SizeUpdater";
|
|
2
|
-
export function loadSizeUpdater(tsParticles) {
|
|
3
|
-
tsParticles.addParticleUpdater("size", () => new SizeUpdater());
|
|
2
|
+
export async function loadSizeUpdater(tsParticles) {
|
|
3
|
+
await tsParticles.addParticleUpdater("size", () => new SizeUpdater());
|
|
4
4
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Main } from "../../main";
|
|
2
|
-
export declare function loadStrokeColorUpdater(tsParticles: Main): void
|
|
2
|
+
export declare function loadStrokeColorUpdater(tsParticles: Main): Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { StrokeColorUpdater } from "./StrokeColorUpdater";
|
|
2
|
-
export function loadStrokeColorUpdater(tsParticles) {
|
|
3
|
-
tsParticles.addParticleUpdater("strokeColor", (container) => new StrokeColorUpdater(container));
|
|
2
|
+
export async function loadStrokeColorUpdater(tsParticles) {
|
|
3
|
+
await tsParticles.addParticleUpdater("strokeColor", (container) => new StrokeColorUpdater(container));
|
|
4
4
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Main } from "../../main";
|
|
2
|
-
export declare function loadTiltUpdater(tsParticles: Main): void
|
|
2
|
+
export declare function loadTiltUpdater(tsParticles: Main): Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { TiltUpdater } from "./TiltUpdater";
|
|
2
|
-
export function loadTiltUpdater(tsParticles) {
|
|
3
|
-
tsParticles.addParticleUpdater("tilt", (container) => new TiltUpdater(container));
|
|
2
|
+
export async function loadTiltUpdater(tsParticles) {
|
|
3
|
+
await tsParticles.addParticleUpdater("tilt", (container) => new TiltUpdater(container));
|
|
4
4
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Main } from "../../main";
|
|
2
|
-
export declare function loadWobbleUpdater(tsParticles: Main): void
|
|
2
|
+
export declare function loadWobbleUpdater(tsParticles: Main): Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { WobbleUpdater } from "./WobbleUpdater";
|
|
2
|
-
export function loadWobbleUpdater(tsParticles) {
|
|
3
|
-
tsParticles.addParticleUpdater("wobble", (container) => new WobbleUpdater(container));
|
|
2
|
+
export async function loadWobbleUpdater(tsParticles) {
|
|
3
|
+
await tsParticles.addParticleUpdater("wobble", (container) => new WobbleUpdater(container));
|
|
4
4
|
}
|