This commit is contained in:
Schmelczer András 2019-12-23 16:59:13 +01:00
parent c2dbf995cc
commit dbb48fbde6
29 changed files with 146 additions and 94 deletions

View file

@ -8,17 +8,12 @@ export class PageBackground extends PageElement {
count: number,
width: number,
probability: number,
color: string
color: string,
translateZ: number
) {
super();
this.setElement(createElement(generate(count, probability, width, color)));
}
public onAfterLoad(parent: HTMLElement) {
window.addEventListener("scroll", () => {
this.getElement().style.transform = `translateY(-${window.scrollY *
this.speed}px)`;
});
super.onAfterLoad(parent);
this.setElement(
createElement(generate(count, probability, width, color, translateZ))
);
}
}