25 lines
663 B
JavaScript
25 lines
663 B
JavaScript
import { TiltAnimation } from "./TiltAnimation";
|
|
import { ValueWithRandom } from "tsparticles-engine";
|
|
export class Tilt extends ValueWithRandom {
|
|
constructor() {
|
|
super();
|
|
this.animation = new TiltAnimation();
|
|
this.direction = "clockwise";
|
|
this.enable = false;
|
|
this.value = 0;
|
|
}
|
|
load(data) {
|
|
super.load(data);
|
|
if (!data) {
|
|
return;
|
|
}
|
|
this.animation.load(data.animation);
|
|
if (data.direction !== undefined) {
|
|
this.direction = data.direction;
|
|
}
|
|
if (data.enable !== undefined) {
|
|
this.enable = data.enable;
|
|
}
|
|
}
|
|
}
|