summaryrefslogtreecommitdiff
path: root/assets
diff options
context:
space:
mode:
authorstale <redkugelblitzin@gmail.com>2022-05-31 15:49:57 -0300
committerstale <redkugelblitzin@gmail.com>2022-05-31 15:49:57 -0300
commit47b2b1512484d66cd92ea38b27f94d4dd70cd0b6 (patch)
tree53dbaef77a9a97e188015731d9d397cd244161a7 /assets
parentd9eededb736e4ada13ee6e7fe517adcc6a606f88 (diff)
changed log style, implemented room player limits
Diffstat (limited to 'assets')
-rw-r--r--assets/index.html16
-rw-r--r--assets/style.css2
2 files changed, 10 insertions, 8 deletions
diff --git a/assets/index.html b/assets/index.html
index f85b733..69f1958 100644
--- a/assets/index.html
+++ b/assets/index.html
@@ -18,18 +18,20 @@
let pcounts = info[1];
Object.keys(rooms).forEach(x => {
let roominfo = JSON.parse(rooms[x]);
- let pc = Number(pcounts[x]);
+ let pc = Number(pcounts[x][0]);
+ let pcap = Number(pcounts[x][1]);
let bc = roominfo.board_conf;
- let a = document.createElement('a');
let h1 = document.createElement('h1');
- let ptxt = (pc > 0)? ((pc > 1)? `${pc} players`: `${pc} player`) : "no players";
+ let full = pc == pcap;
+ let ptxt = `${pc}/${pcap} players` + ((full)? " (full)" : "");
h1.appendChild(document.createTextNode(`> ${roominfo.name} — ${ptxt}`));
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);
+ let entry = (full)? document.createElement('span') : document.createElement('a');
+ entry.append(h1);
+ entry.append(h4);
+ entry.href = 'room/' + x;
+ rlist.append(entry);
rlist.append(document.createElement('br'));
});
});
diff --git a/assets/style.css b/assets/style.css
index cf9f8a6..66130eb 100644
--- a/assets/style.css
+++ b/assets/style.css
@@ -36,7 +36,7 @@ body {
padding: 0.1em 0.1em;
}
-#rlist a {
+#rlist a, span {
text-decoration: none;
line-height: 0.4;
color: #dfdfff;