34 lines
854 B
JavaScript
34 lines
854 B
JavaScript
export class Attract {
|
|
constructor() {
|
|
this.distance = 200;
|
|
this.duration = 0.4;
|
|
this.easing = "ease-out-quad";
|
|
this.factor = 1;
|
|
this.maxSpeed = 50;
|
|
this.speed = 1;
|
|
}
|
|
load(data) {
|
|
if (!data) {
|
|
return;
|
|
}
|
|
if (data.distance !== undefined) {
|
|
this.distance = data.distance;
|
|
}
|
|
if (data.duration !== undefined) {
|
|
this.duration = data.duration;
|
|
}
|
|
if (data.easing !== undefined) {
|
|
this.easing = data.easing;
|
|
}
|
|
if (data.factor !== undefined) {
|
|
this.factor = data.factor;
|
|
}
|
|
if (data.maxSpeed !== undefined) {
|
|
this.maxSpeed = data.maxSpeed;
|
|
}
|
|
if (data.speed !== undefined) {
|
|
this.speed = data.speed;
|
|
}
|
|
}
|
|
}
|