WIP
This commit is contained in:
parent
c2dbf995cc
commit
dbb48fbde6
29 changed files with 146 additions and 94 deletions
|
|
@ -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))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue