UNPKG

@tsparticles/interaction-external-grab

Version:

tsParticles grab external interaction

18 lines (17 loc) 419 B
import { isNull } from "@tsparticles/engine"; import { GrabLinks } from "./GrabLinks.js"; export class Grab { constructor() { this.distance = 100; this.links = new GrabLinks(); } load(data) { if (isNull(data)) { return; } if (data.distance !== undefined) { this.distance = data.distance; } this.links.load(data.links); } }