39 lines
1.2 KiB
JavaScript
39 lines
1.2 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.BubbleBase = void 0;
|
|
const tsparticles_engine_1 = require("tsparticles-engine");
|
|
class BubbleBase {
|
|
constructor() {
|
|
this.distance = 200;
|
|
this.duration = 0.4;
|
|
this.mix = false;
|
|
}
|
|
load(data) {
|
|
if (!data) {
|
|
return;
|
|
}
|
|
if (data.distance !== undefined) {
|
|
this.distance = data.distance;
|
|
}
|
|
if (data.duration !== undefined) {
|
|
this.duration = data.duration;
|
|
}
|
|
if (data.mix !== undefined) {
|
|
this.mix = data.mix;
|
|
}
|
|
if (data.opacity !== undefined) {
|
|
this.opacity = data.opacity;
|
|
}
|
|
if (data.color !== undefined) {
|
|
const sourceColor = this.color instanceof Array ? undefined : this.color;
|
|
this.color = (0, tsparticles_engine_1.executeOnSingleOrMultiple)(data.color, (color) => {
|
|
return tsparticles_engine_1.OptionsColor.create(sourceColor, color);
|
|
});
|
|
}
|
|
if (data.size !== undefined) {
|
|
this.size = data.size;
|
|
}
|
|
}
|
|
}
|
|
exports.BubbleBase = BubbleBase;
|