tsparticles
Version:
Easily create highly customizable particle animations and use them as animated backgrounds for your website. Ready to use components available also for React, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Riot.js, Inferno.
56 lines (55 loc) • 1.53 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.DivEvent = void 0;
const Enums_1 = require("../../../../Enums");
class DivEvent {
constructor() {
this.selectors = [];
this.enable = false;
this.mode = [];
this.type = Enums_1.DivType.circle;
}
get elementId() {
return this.ids;
}
set elementId(value) {
this.ids = value;
}
get el() {
return this.elementId;
}
set el(value) {
this.elementId = value;
}
get ids() {
return this.selectors instanceof Array
? this.selectors.map((t) => t.replace("#", ""))
: this.selectors.replace("#", "");
}
set ids(value) {
this.selectors = value instanceof Array ? value.map((t) => `#${t}`) : `#${value}`;
}
load(data) {
var _a, _b;
if (data === undefined) {
return;
}
const ids = (_b = (_a = data.ids) !== null && _a !== void 0 ? _a : data.elementId) !== null && _b !== void 0 ? _b : data.el;
if (ids !== undefined) {
this.ids = ids;
}
if (data.selectors !== undefined) {
this.selectors = data.selectors;
}
if (data.enable !== undefined) {
this.enable = data.enable;
}
if (data.mode !== undefined) {
this.mode = data.mode;
}
if (data.type !== undefined) {
this.type = data.type;
}
}
}
exports.DivEvent = DivEvent;