26 lines
700 B
JavaScript
26 lines
700 B
JavaScript
import { OptionsColor, setRangeValue } from "tsparticles-engine";
|
|
export class TwinkleValues {
|
|
constructor() {
|
|
this.enable = false;
|
|
this.frequency = 0.05;
|
|
this.opacity = 1;
|
|
}
|
|
load(data) {
|
|
if (!data) {
|
|
return;
|
|
}
|
|
if (data.color !== undefined) {
|
|
this.color = OptionsColor.create(this.color, data.color);
|
|
}
|
|
if (data.enable !== undefined) {
|
|
this.enable = data.enable;
|
|
}
|
|
if (data.frequency !== undefined) {
|
|
this.frequency = data.frequency;
|
|
}
|
|
if (data.opacity !== undefined) {
|
|
this.opacity = setRangeValue(data.opacity);
|
|
}
|
|
}
|
|
}
|