@tsparticles/interaction-external-trail
Version:
tsParticles trail external interaction
26 lines (25 loc) • 677 B
JavaScript
import { deepExtend, isNull, } from "@tsparticles/engine";
export class Trail {
constructor() {
this.delay = 1;
this.pauseOnStop = false;
this.quantity = 1;
}
load(data) {
if (isNull(data)) {
return;
}
if (data.delay !== undefined) {
this.delay = data.delay;
}
if (data.quantity !== undefined) {
this.quantity = data.quantity;
}
if (data.particles !== undefined) {
this.particles = deepExtend({}, data.particles);
}
if (data.pauseOnStop !== undefined) {
this.pauseOnStop = data.pauseOnStop;
}
}
}