From f47491b3a89ba769760bb555ea72f1416cb0cb08 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Sun, 8 Nov 2020 08:04:49 +0100 Subject: Added flash message remove on new game, moving info bar to the top --- utils/minesweeper/index.html | 44 ++++++++++++++++++++++++-------------------- utils/minesweeper/script.js | 5 +++-- utils/minesweeper/style.css | 3 +++ 3 files changed, 30 insertions(+), 22 deletions(-) diff --git a/utils/minesweeper/index.html b/utils/minesweeper/index.html index a5ece6b..8945dbd 100644 --- a/utils/minesweeper/index.html +++ b/utils/minesweeper/index.html @@ -7,6 +7,7 @@ +
@@ -14,31 +15,34 @@ - -
- -
-
- - -
-
- - -
-
- - +
+ -
- diff --git a/utils/minesweeper/script.js b/utils/minesweeper/script.js index 3bc23f4..d05a9af 100644 --- a/utils/minesweeper/script.js +++ b/utils/minesweeper/script.js @@ -114,8 +114,8 @@ function initGrid() { return } if (mines[i][j] === -1) { - endFlashMessage(false) toggleRunning() + endFlashMessage(false) } else { floodFill(i, j) @@ -127,8 +127,8 @@ function initGrid() { } } if (won) { - endFlashMessage(true) toggleRunning() + endFlashMessage(true) } } }) @@ -156,6 +156,7 @@ for (input of document.querySelectorAll("#minesweeper-settings input")) { } function toggleRunning() { + flash_message_node.hidden = true; if (running) { clearInterval(interval) initGrid() diff --git a/utils/minesweeper/style.css b/utils/minesweeper/style.css index 7d2a0b1..066650c 100644 --- a/utils/minesweeper/style.css +++ b/utils/minesweeper/style.css @@ -117,3 +117,6 @@ input { border-color: #b71c1c; } +.info-bar { + height: 120px; +} -- cgit