summaryrefslogtreecommitdiff
path: root/assets/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'assets/index.html')
-rw-r--r--assets/index.html16
1 files changed, 9 insertions, 7 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'));
});
});