fixed button styling, dev server, added switches for event handling, global baking, global reset, three BeatUnit states with styles, and mobile long touch to change beatunit type

This commit is contained in:
Daniel Ledda
2022-03-20 21:21:43 +01:00
parent 3ba01eb86b
commit 9121706184
15 changed files with 222 additions and 113 deletions

View File

@@ -1,38 +1,21 @@
import BeatGroup from "@/BeatGroup";
import RootView from "@/ui/Root/RootView";
import "@/ui/global.css";
const defaultSettings = {
barCount: 2,
isLooping: false,
timeSigUp: 8,
};
const mainBeatGroup = new BeatGroup(defaultSettings);
mainBeatGroup.addBeat({
name: "LF"
});
mainBeatGroup.addBeat({
name: "LH"
});
mainBeatGroup.addBeat({
name: "RH"
});
mainBeatGroup.addBeat({
name: "RF"
});
const appNode = document.querySelector("#app");
if (appNode) {
const appRoot = new RootView({
title: "Drum Slayer",
mainBeatGroup: mainBeatGroup,
});
//@ts-ignore
window.appRoot = appRoot;
appNode.appendChild(appRoot.render());
console.log("OK!");
try {
const appRoot = new RootView({
title: "Drum Slayer",
});
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
window.appRoot = appRoot;
appNode.appendChild(appRoot.render());
console.log("OK!");
} catch (e) {
console.error("FUCK!", e);
}
} else {
console.error("FUCK!");
}