@tsparticles/particles
Version:
Minimal tsParticles particles bundle — lightweight particle engine without confetti or fireworks extras. Perfect for pure particle backgrounds. Ready to use components available for React, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Riot.js, In
26 lines (25 loc) • 538 B
JavaScript
import { deleteParticlesInstance } from "./utils.js";
export class ParticlesInstance {
#container;
#id;
constructor(container, id) {
this.#container = container;
this.#id = id;
}
get destroyed() {
return this.#container.destroyed;
}
destroy() {
this.#container.destroy();
deleteParticlesInstance(this.#id);
}
pause() {
this.#container.pause();
}
play() {
this.#container.play();
}
stop() {
this.#container.stop();
}
}