2023-02-17 11:06:01 +01:00

27 lines
718 B
JavaScript

import { RepulseBase } from "./RepulseBase";
import { executeOnSingleOrMultiple } from "tsparticles-engine";
export class RepulseDiv extends RepulseBase {
constructor() {
super();
this.selectors = [];
}
get ids() {
return executeOnSingleOrMultiple(this.selectors, (t) => t.replace("#", ""));
}
set ids(value) {
this.selectors = executeOnSingleOrMultiple(value, (t) => `#${t}`);
}
load(data) {
super.load(data);
if (!data) {
return;
}
if (data.ids !== undefined) {
this.ids = data.ids;
}
if (data.selectors !== undefined) {
this.selectors = data.selectors;
}
}
}