Skip to content

Commit

Permalink
Adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidNHill committed Jul 1, 2024
1 parent d09134a commit e849f87
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 24 deletions.
Binary file modified .vs/slnx.sqlite
Binary file not shown.
11 changes: 8 additions & 3 deletions Minesweeper/client/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ nav {
top: 75px;
bottom: 50px;
background: #ccc;
padding: 5px;
padding-left: 5px;
padding-top: 5px;
border-style: outset;
border-width: 5px;
}
Expand All @@ -66,6 +67,10 @@ div.raised {
border-width: 5px;
}

div.hidden {
display: none;
}

/* the section holding the board and display canvas */
section {
padding: 0px;
Expand Down Expand Up @@ -115,8 +120,8 @@ button {
}

button.small {
width: 36px;
height: 36px;
width: 40px;
height: 40px;
}

button:hover {
Expand Down
13 changes: 12 additions & 1 deletion Minesweeper/client/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ const gameTypeSafe = document.getElementById("gameTypeSafe");
const gameTypeZero = document.getElementById("gameTypeZero");
const switchButton = document.getElementById("switchButton");
const analysisButton = document.getElementById("AnalysisButton");
const messageBar = document.getElementById("messageBar");
const messageLine = document.getElementById("messageLine");
const messageBarBottom = document.getElementById("messageBarBottom");
const messageLineBottom = document.getElementById("messageLineBottom");
const downloadBar = document.getElementById("downloadBar");
const title = document.getElementById("title");
const lockMineCount = document.getElementById("lockMineCount");
const buildMode = document.getElementById("buildMode");
Expand Down Expand Up @@ -1396,6 +1400,9 @@ function doToggleScreen() {
isExpanded = false;

document.getElementById("toggleScreen").innerHTML = "+";
messageBarBottom.className = "";
messageBar.className = "hidden";
downloadBar.className = "";

isExpanded = false;
} else {
Expand All @@ -1410,6 +1417,10 @@ function doToggleScreen() {
document.getElementById("headerPanel").style.display = "none";

document.getElementById("toggleScreen").innerHTML = "-";

messageBarBottom.className = "hidden";
downloadBar.className = "hidden";
messageBar.className = "";
isExpanded = true;
}

Expand Down Expand Up @@ -3077,8 +3088,8 @@ function setURLParms(parm, value) {
}

function showMessage(text) {
//messageLine.innerText = text;
messageLine.innerHTML = text;
messageLineBottom.innerHTML = text;
}

function prefixMessage(text) {
Expand Down
50 changes: 30 additions & 20 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
<!DOCTYPE html>
<meta name="viewport" content="width=device-width">
<html>
<head>
<meta charset="ISO-8859-1">
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, shrink-to-fit=no">
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, shrink-to-fit=yes">
<link rel="stylesheet" href="Minesweeper/client/main.css">
<link rel="icon" type="image/png" href="resources/images/flagged.png" />
<title>Minesweeper solver</title>
</head>
<!-- -->
<body style="position: absolute; left:0px; right:0px; top:0px; bottom:0px; zoom: 1.0;" onresize="browserResized()" onload="load_images()">

<!-- Title at the top -->
<h1 id="headerPanel" style="position: relative; left: 0px; top: 0px; height: 50px; right: 0px; overflow-y: auto;">
<h1 id="headerPanel" style="position: absolute; left: 0px; top: 0px; height: 50px; right: 0px; overflow-y: auto;">
<button type="button" style="zoom: 0.9;" id="switchButton" onclick="setAnalysis()">Switch to Analyser</button>
<label id="title" style="font-size: 36px; vertical-align: middle;">Minesweeper player</label>
<label style="float: right; padding-right: 10px;">
Expand Down Expand Up @@ -128,21 +130,22 @@ <h1 id="headerPanel" style="position: relative; left: 0px; top: 0px; height: 50p

<!-- where the board goes -->
<!--
<div id="wholeboard" style="position: absolute; left: 180px; right: 10px; top: 65px; bottom: 60px;">
style="display: block; position: absolute; left: 170px; right: 0px; top: 60px; bottom: 60px;"
-->
<div id="wholeboard" style="display: block; position: absolute; left: 185px; right: 0px; top: 60px; bottom: 60px;">
<section class="tooltip" id="canvas" style="position: absolute; left: 0px; top: 0px; bottom: 0px; right: 0px;">
<div id="wholeboard" style="display: flex; flex-direction: column; position: absolute; left: 170px; right: 0px; top: 60px; bottom: 60px;">
<div class="tooltip" id="canvas" style="position: absolute; left: 0px; top: 0px; bottom: 0px; right: 0px;">

<!-- the board header with mine count and some buttons -->
<div id="display" style="display: inline-flex; height: 50px;">
<div id="display" style="display: flex; flex-direction: row; height: 50px;">
<div>
<canvas class="led" id="myMinesLeft" style="position: relative; left: 0px; top:0px; width: 60px; height: 32px" oncontextmenu="return false"></canvas>
<canvas class="led" id="myMinesLeft" style="position: relative; left: 3px; top:3px; width: 60px; height: 36px" oncontextmenu="return false"></canvas>
<input type="image" src='resources/images/flaggedWrong_thin.png' id="leftClickFlag" onclick="doToggleFlag()" style="position: relative; left: 20px; top: 2px; width: 40px; height: 40px;"/>
</div>
<div style="width: 100px">
<input type="image" src='resources/images/flaggedWrong_thin.png' id="leftClickFlag" onclick="doToggleFlag()" style="position: relative; left: 20px; top:8px; width:36px; height: 36px" />
<div class="hidden" style="flex: 0">
<input type="image" src='resources/images/flaggedWrong_thin.png' id="newGameSmiley" onclick="doToggleFlag()" style="position: relative; top:6px; width:40px; height: 40px" />
</div>
<div style="flex-grow: 1;">
<button class="small" type="button" style="position: relative; float: inline-end; font-size: 22px;" id="toggleScreen" onclick="doToggleScreen()">+</button>
<div style="flex-grow: 1;">
<button class="small" type="button" style="position: relative; font-size: 22px; float: right; top: 6px; right: 6px; " id="toggleScreen" onclick="doToggleScreen()">+</button>
</div>
</div>

Expand All @@ -153,9 +156,16 @@ <h1 id="headerPanel" style="position: relative; left: 0px; top: 0px; height: 50p
</div>

<span id="tooltip" class="tooltiptext" style="pointer-events: none;"></span>


<!-- message line at the bottom -->
<div id="messageBar" class="hidden">
<div style="display:flex; flex-direction: column; justify-content: flex-end; position: relative; bottom: 0px; left: 0px; right: 0px; height: 28px;">
<label id="messageLine" style="font-size: 18px; overflow-y: auto; padding-left: 0px"></label>
</div>
</div>

<!-- A hyperlink to download the board -->
<div style="position: relative; left: 0px; top: 0px; right: 0px;">
<div id="downloadBar" style="position: relative; left: 0px; top: 0px; right: 0px; height: 20px;">
<a id="saveposition" style="float: left; width: 140px; margin-right: 30px;" download="" href="">Save position</a>
<!-- <a id="downloadmbf" style="float: left; width: 130px" onclick="downloadAsMBF(event)" download="" href="">Download as MBF</a> -->
<a id="savembf" style="float: left; width: 120px; margin-right: 30px;" download="" href="">Save as MBF</a>
Expand All @@ -166,15 +176,15 @@ <h1 id="headerPanel" style="position: relative; left: 0px; top: 0px; height: 50p
</div>
-->

</section>
</div>
</div>



<!-- message line at the bottom -->
<div id="messageBar" class="raised" style="display:inline-flex; flex-direction: column; justify-content: flex-end; position: absolute; bottom: 0px; left: 185px; right: 0px; height: 28px;">
<label id="messageLine" style="font-size: 18px; overflow-y: auto; padding-left: 5px"></label>
<div id="messageBarBottom">
<div class="raised" style="display:flex; flex-direction: column; justify-content: flex-end; position: absolute; bottom: 0px; left: 170px; right: 0px; height: 28px;">
<label id="messageLineBottom" style="font-size: 18px; overflow-y: auto; padding-left: 0px"></label>
</div>
</div>


<!-- Local storage popup -->
<div id="localStorage" class="modal">
Expand Down

0 comments on commit e849f87

Please sign in to comment.