feat: more ui, looping

This commit is contained in:
Daniel Ledda
2021-08-30 14:12:41 +02:00
parent 76b8a427bc
commit 7fa530f070
22 changed files with 529 additions and 166 deletions

View File

@@ -6,12 +6,10 @@ import "./Root.css";
export type RootUINodeOptions = UINodeOptions & {
title: string,
mainBeatGroup: BeatGroup,
parent: HTMLElement,
};
export default class RootView extends UINode {
private title: string;
protected parent: HTMLElement;
private beatGroupView: BeatGroupView;
private mainBeatGroup: BeatGroup;
@@ -20,8 +18,6 @@ export default class RootView extends UINode {
this.beatGroupView = new BeatGroupView({title: "THE BEAT", beatGroup: options.mainBeatGroup});
this.mainBeatGroup = options.mainBeatGroup;
this.title = options.title;
this.parent = options.parent;
this.rebuild();
}
rebuild(): HTMLDivElement {
@@ -29,7 +25,7 @@ export default class RootView extends UINode {
classes: ["root"],
subs: [
UINode.make("h1", {innerText: this.title, classes: ["title"]}),
this.beatGroupView.rebuild(),
this.beatGroupView.render(),
],
});
}