add current user styling

This commit is contained in:
Elijah R 2024-02-02 09:16:17 -05:00
parent 151ac909a1
commit fb1111f39f
2 changed files with 8 additions and 0 deletions

View File

@ -118,3 +118,7 @@ tr.user-waiting > td {
background-color: #ece1be !important;
--bs-table-bg-state: #ece1be !important;
}
.user-current {
font-style: italic;
}

View File

@ -159,6 +159,8 @@ function sortVMList() {
function sortUserList() {
users.sort((a, b) => {
if (a.user.username === w.username && (a.user.turn >= b.user.turn)) return -1;
if (b.user.username === w.username && (b.user.turn >= a.user.turn)) return 1;
if (a.user.turn === b.user.turn) return 0;
if (a.user.turn === -1) return 1;
if (b.user.turn === -1) return -1;
@ -229,6 +231,8 @@ function addUser(user : User) {
tr.classList.add("user-unregistered");
break;
}
if (user.username === w.username)
tr.classList.add("user-current");
tr.appendChild(td);
elements.userlist.appendChild(tr);
if (olduser !== undefined) olduser.element = tr;