UNPKG

@tsparticles/interaction-external-pause

Version:

tsParticles pause external interaction

31 lines (30 loc) 669 B
import { ExternalInteractorBase } from "@tsparticles/engine"; const pauseMode = "pause"; export class Pauser extends ExternalInteractorBase { constructor(container) { super(container); this.handleClickMode = (mode) => { if (mode !== pauseMode) { return; } const container = this.container; if (container.animationStatus) { container.pause(); } else { container.play(); } }; } clear() { } init() { } interact() { } isEnabled() { return true; } reset() { } }