This commit is contained in:
gltron
2022-04-17 18:31:02 +02:00
commit d04ac22128
82 changed files with 11308 additions and 0 deletions

23
src/scripts/router.js Normal file
View File

@@ -0,0 +1,23 @@
export class Router {
currentPage = "none"
mainMenu = document.getElementById("main-menu")
customLevel = document.getElementById("custom-level")
loading = document.getElementById("loading")
mainGame = document.getElementById("main-game")
gameOver = document.getElementById("game-over")
hideEverything() {
this.mainMenu.style.display = "none"
this.customLevel.style.display = "none"
this.loading.style.display = "none"
this.mainGame.style.display = "none"
this.gameOver.style.display = "none"
}
showPage(pageName) {
this.hideEverything()
this.currentPage = pageName
this[pageName].style.display = "flex"
}
}