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.
30 lines (29 loc) • 992 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.BackgroundMask = void 0;
const BackgroundMaskCover_1 = require("./BackgroundMaskCover");
const Utils_1 = require("../../../Utils/Utils");
class BackgroundMask {
constructor() {
this.composite = "destination-out";
this.cover = new BackgroundMaskCover_1.BackgroundMaskCover();
this.enable = false;
}
load(data) {
if (!data) {
return;
}
if (data.composite !== undefined) {
this.composite = data.composite;
}
if (data.cover !== undefined) {
const cover = data.cover;
const color = ((0, Utils_1.isString)(data.cover) ? { color: data.cover } : data.cover);
this.cover.load(cover.color !== undefined ? cover : { color: color });
}
if (data.enable !== undefined) {
this.enable = data.enable;
}
}
}
exports.BackgroundMask = BackgroundMask;
;