summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2021-05-23 15:03:55 +0200
committerTor Andersson <tor@ccxvii.net>2021-05-23 15:06:20 +0200
commita66779335db0e2d3f295ec0db68b9e9db9d276f3 (patch)
tree8c58c3dc6977a5bc90cac69764dab3a9bdeed3bb
parent48a6712e480fe484157e753579a19d712a49f6ac (diff)
downloadserver-a66779335db0e2d3f295ec0db68b9e9db9d276f3.tar.gz
Add 'shift zoom' for blocks.
-rw-r--r--public/common/client.js17
-rw-r--r--views/about.ejs6
2 files changed, 21 insertions, 2 deletions
diff --git a/public/common/client.js b/public/common/client.js
index cee9ea5..26f953e 100644
--- a/public/common/client.js
+++ b/public/common/client.js
@@ -335,13 +335,26 @@ function zoom_map() {
}
}
-window.addEventListener('resize', zoom_map);
-
function toggle_zoom() {
document.querySelector(".mapwrap").classList.toggle('fit');
zoom_map();
}
+function init_map_zoom() {
+ window.addEventListener('resize', zoom_map);
+}
+
+function init_shift_zoom() {
+ window.addEventListener("keydown", (evt) => {
+ if (evt.key === "Shift")
+ document.querySelector("body").classList.add("shift");
+ });
+ window.addEventListener("keyup", (evt) => {
+ if (evt.key === "Shift")
+ document.querySelector("body").classList.remove("shift");
+ });
+}
+
function toggle_log() {
document.querySelector(".grid_window").classList.toggle("hide_log");
zoom_map();
diff --git a/views/about.ejs b/views/about.ejs
index 033aad8..8478301 100644
--- a/views/about.ejs
+++ b/views/about.ejs
@@ -22,6 +22,9 @@ Open a separate browser tab or window for each side when playing solo.
Use the middle mouse button to drag and scroll around the map.
<li>
+Hold down the Shift key when mousing over a block or counter in order to magnify it.
+
+<li>
The <i>Enter</i> and <i>Escape</i> keys open and close the chat box.
<li>
@@ -40,6 +43,9 @@ The <img src="/images/earth-africa-europe.svg"> button hides all counters and ma
if you need to check something on the map that is obscured.
<li>
+The <img src="/images/magnifying-glass.svg"> button shrinks the map to fit the screen width.
+
+<li>
The <img src="/images/scroll-quill.svg"> button hides the game log and player status displays, so you can
see more of the map.