High scores
diff --git a/src/main/js/Game.ts b/src/main/js/Game.ts
index a959519..dbdc0cf 100644
--- a/src/main/js/Game.ts
+++ b/src/main/js/Game.ts
@@ -71,7 +71,7 @@ export class Game {
this.field = null; // Placeholder until `initNewField`
this.display = new Display(this.canvas, this.field, preferences);
this.display.startDrawLoop();
- this.canvas.style.visibility = "unset";
+ this.canvas.classList.remove("invisible");
this.rng = alea("" + Date.now());
this.seed = "" + this.rng.uint32();
diff --git a/src/main/js/Main.ts b/src/main/js/Main.ts
index a1b42ed..4aa5e27 100644
--- a/src/main/js/Main.ts
+++ b/src/main/js/Main.ts
@@ -1,5 +1,5 @@
// @ts-ignore
-const {$, doAfterLoad, footer, header, nav, showPage} = window.fwdekker;
+const {$, doAfterLoad, footer, header, nav} = window.fwdekker;
import {waitForForkAwesome} from "./Common";
import {BasicIconFont, ForkAwesomeFont} from "./Display";
import {Game} from "./Game";
@@ -14,7 +14,7 @@ doAfterLoad(() => {
vcsURL: "https://git.fwdekker.com/FWDekker/minesweeper/",
version: "v%%VERSION_NUMBER%%"
}));
- showPage();
+ $("main").classList.remove("hidden");
// Start game
diff --git a/src/main/js/UI.ts b/src/main/js/UI.ts
index 690a8d7..ccb0079 100644
--- a/src/main/js/UI.ts
+++ b/src/main/js/UI.ts
@@ -67,14 +67,14 @@ export class Overlay {
* Shows the overlay.
*/
show(): void {
- this.overlay.style.visibility = "unset";
+ this.overlay.classList.remove("hidden");
}
/**
* Hides the overlay.
*/
hide(): void {
- this.overlay.style.visibility = "hidden";
+ this.overlay.classList.add("hidden");
blurActiveElement();
}
@@ -82,6 +82,6 @@ export class Overlay {
* Returns `true` if and only if this overlay is currently visible.
*/
isVisible(): boolean {
- return this.overlay.style.visibility !== "hidden";
+ return this.overlay.classList.contains("hidden");
}
}