59 lines
1.8 KiB
JavaScript
59 lines
1.8 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.Links = void 0;
|
|
const LinksShadow_1 = require("./LinksShadow");
|
|
const LinksTriangle_1 = require("./LinksTriangle");
|
|
const tsparticles_engine_1 = require("tsparticles-engine");
|
|
class Links {
|
|
constructor() {
|
|
this.blink = false;
|
|
this.color = new tsparticles_engine_1.OptionsColor();
|
|
this.color.value = "#fff";
|
|
this.consent = false;
|
|
this.distance = 100;
|
|
this.enable = false;
|
|
this.frequency = 1;
|
|
this.opacity = 1;
|
|
this.shadow = new LinksShadow_1.LinksShadow();
|
|
this.triangles = new LinksTriangle_1.LinksTriangle();
|
|
this.width = 1;
|
|
this.warp = false;
|
|
}
|
|
load(data) {
|
|
if (!data) {
|
|
return;
|
|
}
|
|
if (data.id !== undefined) {
|
|
this.id = data.id;
|
|
}
|
|
if (data.blink !== undefined) {
|
|
this.blink = data.blink;
|
|
}
|
|
this.color = tsparticles_engine_1.OptionsColor.create(this.color, data.color);
|
|
if (data.consent !== undefined) {
|
|
this.consent = data.consent;
|
|
}
|
|
if (data.distance !== undefined) {
|
|
this.distance = data.distance;
|
|
}
|
|
if (data.enable !== undefined) {
|
|
this.enable = data.enable;
|
|
}
|
|
if (data.frequency !== undefined) {
|
|
this.frequency = data.frequency;
|
|
}
|
|
if (data.opacity !== undefined) {
|
|
this.opacity = data.opacity;
|
|
}
|
|
this.shadow.load(data.shadow);
|
|
this.triangles.load(data.triangles);
|
|
if (data.width !== undefined) {
|
|
this.width = data.width;
|
|
}
|
|
if (data.warp !== undefined) {
|
|
this.warp = data.warp;
|
|
}
|
|
}
|
|
}
|
|
exports.Links = Links;
|