22 lines
472 B
JavaScript
22 lines
472 B
JavaScript
export class Parallax {
|
|
constructor() {
|
|
this.enable = false;
|
|
this.force = 2;
|
|
this.smooth = 10;
|
|
}
|
|
load(data) {
|
|
if (!data) {
|
|
return;
|
|
}
|
|
if (data.enable !== undefined) {
|
|
this.enable = data.enable;
|
|
}
|
|
if (data.force !== undefined) {
|
|
this.force = data.force;
|
|
}
|
|
if (data.smooth !== undefined) {
|
|
this.smooth = data.smooth;
|
|
}
|
|
}
|
|
}
|