From bcd5764aa03e128e06c355272b7b81eac8d4501d Mon Sep 17 00:00:00 2001
From: stale <redkugelblitzin@gmail.com>
Date: Sun, 29 May 2022 20:45:03 -0300
Subject: improved pubs listing, many minor fixes

---
 assets/client.js  |  4 ++--
 assets/index.html | 13 ++++++++++---
 assets/room.html  |  2 +-
 assets/style.css  | 10 ++++++++++
 4 files changed, 23 insertions(+), 6 deletions(-)

(limited to 'assets')

diff --git a/assets/client.js b/assets/client.js
index b23222c..a6a2a73 100644
--- a/assets/client.js
+++ b/assets/client.js
@@ -163,8 +163,8 @@ function movSelWin(win, x, y) {
   } else {
     win.style.display = "";
   }
-  win.style.left = (anch.x + (tpos.x * tile_w)) + 'px';
-  win.style.top  = (anch.y + ((tpos.y + 0.35) * tile_h)) + 'px';
+  win.style.left = (window.scrollX + anch.x + (tpos.x * tile_w)) + 'px';
+  win.style.top  = (window.scrollY + anch.y + ((tpos.y + 0.35) * tile_h)) + 'px';
   win.style.width = tile_w + 'px';
   win.style.height = tile_h + 'px';
 }
diff --git a/assets/index.html b/assets/index.html
index 6fc9c46..763b9ef 100644
--- a/assets/index.html
+++ b/assets/index.html
@@ -11,9 +11,16 @@
     <script>
       let rlist = document.getElementById('rlist');
       fetch('rlist').then(r => r.json()).then(rooms => {
-        rooms.forEach(x => {
+        Object.keys(rooms).forEach(x => {
+          let roominfo = JSON.parse(rooms[x]);
+          let bc = roominfo.board_conf;
           let a = document.createElement('a');
-          a.appendChild(document.createTextNode(x));
+          let h1 = document.createElement('h1');
+                h1.appendChild(document.createTextNode(`> ${roominfo.name}`));
+          let h4 = document.createElement('h4');
+          h4.appendChild(document.createTextNode(`${bc.w} by ${bc.h} with ${bc.mine_ratio[0]} in every ${bc.mine_ratio[1]} tiles mined`));
+          a.append(h1);
+          a.append(h4);
           a.href = 'room/' + x;
           rlist.append(a);
           rlist.append(document.createElement('br'));
@@ -33,7 +40,7 @@
           tiles are mines
         </label><br>
         <label>public, ie. shown in the lobby <input name="raccess" type="checkbox" checked></label><br>
-        <label>always safe first move <input name="ralwayssafe1move" type="checkbox" checked></label><br>
+        <label>safe first move (if possible)<input name="ralwayssafe1move" type="checkbox" checked></label><br>
         <label>player limit<input name="rlimit" type="number" value="32"></label><br>
         <button>create</button>
       </fieldset>
diff --git a/assets/room.html b/assets/room.html
index 27f9ae1..e3e6ff9 100644
--- a/assets/room.html
+++ b/assets/room.html
@@ -7,7 +7,7 @@
     <link rel="stylesheet" type="text/css" href="/s.css">
   </head>
   <body>
-    <div class="cent">
+    <div>
       <div id="board-container">
       <span id="board"></span>
       </div>
diff --git a/assets/style.css b/assets/style.css
index d217b8d..52a2021 100644
--- a/assets/style.css
+++ b/assets/style.css
@@ -36,3 +36,13 @@ body {
   padding: 0.1em 0.1em;
 }
 
+#rlist a {
+  text-decoration: none;
+  line-height: 0.4;
+  color: #dfdfff;
+  background-color: #3c3c3c;
+}
+
+a :visited {
+  color: inherit;
+}
-- 
cgit v1.2.3