From 7ef0f2018962f227ef6561aac2ab4b6c98dc3c7b Mon Sep 17 00:00:00 2001 From: Elijah R Date: Fri, 2 Feb 2024 09:16:17 -0500 Subject: [PATCH] add current user styling --- src/css/style.css | 4 ++++ src/ts/main.ts | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/css/style.css b/src/css/style.css index 77fa0d3..a75cb64 100644 --- a/src/css/style.css +++ b/src/css/style.css @@ -117,4 +117,8 @@ tr.user-waiting > td { .tr.user-waiting:hover, tr.user-waiting > td:hover { background-color: #ece1be !important; --bs-table-bg-state: #ece1be !important; +} + +.user-current { + font-style: italic; } \ No newline at end of file diff --git a/src/ts/main.ts b/src/ts/main.ts index 1b4c7eb..8875086 100644 --- a/src/ts/main.ts +++ b/src/ts/main.ts @@ -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;