fix: radar can get out of 1/1 aspect ratio
- Fixed radar going out of its 1/1 AR. - Settings are now in a vertical layout
This commit is contained in:
parent
85ff61d902
commit
376c6205ed
webradar
@ -10,8 +10,14 @@
|
|||||||
<div id="canvasContainer">
|
<div id="canvasContainer">
|
||||||
<div id="settingsHolder">
|
<div id="settingsHolder">
|
||||||
<div class="settings">
|
<div class="settings">
|
||||||
<button onclick="toggleZoom()">Toggle Zoom</button>
|
<div>
|
||||||
<button onclick="toggleStats()">Toggle Stats</button>
|
<input type="checkbox" onclick="toggleZoom()" id="zoomCheck" name="zoom"/>
|
||||||
|
<label for="zoomCheck">Zoom</label>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<input type="checkbox" onclick="toggleStats()" id="statsCheck" name="stats"/>
|
||||||
|
<label for="statsCheck">Stats</label>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<canvas id="canvas"></canvas>
|
<canvas id="canvas"></canvas>
|
||||||
|
@ -7,7 +7,7 @@ const textColor = "#d1d1d1"
|
|||||||
|
|
||||||
// Settings
|
// Settings
|
||||||
shouldZoom = true
|
shouldZoom = true
|
||||||
drawStats = true
|
drawStats = false
|
||||||
|
|
||||||
// Common
|
// Common
|
||||||
canvas = null
|
canvas = null
|
||||||
@ -35,7 +35,7 @@ if (location.protocol == 'https:') {
|
|||||||
} else {
|
} else {
|
||||||
websocketAddr = `ws://${window.location.host}/ws`
|
websocketAddr = `ws://${window.location.host}/ws`
|
||||||
}
|
}
|
||||||
//websocketAddr = "ws://192.168.0.235:8000/ws"
|
websocketAddr = "ws://192.168.0.235:8000/ws"
|
||||||
|
|
||||||
// Util functions
|
// Util functions
|
||||||
const clamp = (num, min, max) => Math.min(Math.max(num, min), max);
|
const clamp = (num, min, max) => Math.min(Math.max(num, min), max);
|
||||||
@ -520,6 +520,9 @@ function connect() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
addEventListener("DOMContentLoaded", (e) => {
|
addEventListener("DOMContentLoaded", (e) => {
|
||||||
|
document.getElementById("zoomCheck").checked = true;
|
||||||
|
|
||||||
|
|
||||||
canvas = document.getElementById('canvas');
|
canvas = document.getElementById('canvas');
|
||||||
canvas.width = 1024;
|
canvas.width = 1024;
|
||||||
canvas.height = 1024;
|
canvas.height = 1024;
|
||||||
|
@ -9,11 +9,10 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#canvasContainer {
|
#canvasContainer {
|
||||||
aspect-ratio: 1 / 1;
|
width: 100vmin;
|
||||||
height: 100vh;
|
height: 100vmin;
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
transition: width 0.5s ease; /* Smooth transition */
|
|
||||||
float: left;
|
float: left;
|
||||||
object-fit: contain;
|
object-fit: contain;
|
||||||
}
|
}
|
||||||
@ -37,6 +36,11 @@ canvas {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.settings {
|
.settings {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
||||||
|
color: white;
|
||||||
visibility: visible;
|
visibility: visible;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user