@tsparticles/engine
Version:
Easily create highly customizable particle, confetti and fireworks 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.
35 lines (34 loc) • 1.32 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Background = void 0;
const OptionLoader_js_1 = require("../../../Utils/OptionLoader.js");
const OptionsColor_js_1 = require("../OptionsColor.js");
const OptionsUtils_js_1 = require("../../../Utils/OptionsUtils.js");
class Background extends OptionLoader_js_1.OptionLoader {
color;
draw;
element;
image = "";
opacity = 1;
position = "";
repeat = "";
size = "";
constructor() {
super();
this.color = new OptionsColor_js_1.OptionsColor();
this.color.value = "";
}
doLoad(data) {
if (data.color !== undefined) {
this.color = OptionsColor_js_1.OptionsColor.create(this.color, data.color);
}
(0, OptionsUtils_js_1.loadProperty)(this, "element", data.element);
(0, OptionsUtils_js_1.loadProperty)(this, "draw", data.draw);
(0, OptionsUtils_js_1.loadProperty)(this, "image", data.image);
(0, OptionsUtils_js_1.loadProperty)(this, "position", data.position);
(0, OptionsUtils_js_1.loadProperty)(this, "repeat", data.repeat);
(0, OptionsUtils_js_1.loadProperty)(this, "size", data.size);
(0, OptionsUtils_js_1.loadProperty)(this, "opacity", data.opacity);
}
}
exports.Background = Background;