2023-02-17 11:06:01 +01:00

41 lines
1.1 KiB
JavaScript

import { AnimationOptions } from "../../AnimationOptions";
export class OpacityAnimation extends AnimationOptions {
constructor() {
super();
this.destroy = "none";
this.enable = false;
this.speed = 2;
this.startValue = "random";
this.sync = false;
}
get opacity_min() {
return this.minimumValue;
}
set opacity_min(value) {
this.minimumValue = value;
}
load(data) {
var _a;
if (!data) {
return;
}
super.load(data);
if (data.destroy !== undefined) {
this.destroy = data.destroy;
}
if (data.enable !== undefined) {
this.enable = data.enable;
}
this.minimumValue = (_a = data.minimumValue) !== null && _a !== void 0 ? _a : data.opacity_min;
if (data.speed !== undefined) {
this.speed = data.speed;
}
if (data.startValue !== undefined) {
this.startValue = data.startValue;
}
if (data.sync !== undefined) {
this.sync = data.sync;
}
}
}