@tsparticles/interaction-external-push
Version:
tsParticles push external interaction
24 lines (23 loc) • 725 B
JavaScript
import { deepExtend, executeOnSingleOrMultiple, isNull, loadProperty, loadRangeProperty, } from "@tsparticles/engine";
export class Push {
default = true;
groups = [];
particles;
quantity = 4;
load(data) {
if (isNull(data)) {
return;
}
loadProperty(this, "default", data.default);
if (data.groups !== undefined) {
this.groups = data.groups.map(t => t);
}
if (!this.groups.length) {
this.default = true;
}
loadRangeProperty(this, "quantity", data.quantity);
this.particles = executeOnSingleOrMultiple(data.particles, particles => {
return deepExtend({}, particles);
});
}
}