diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-09-15 20:48:05 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-09-18 21:16:47 +0200 |
commit | 9e77cf5b29a533faf1909327772359d189e527b1 (patch) | |
tree | faccd4ffcb85766d75152da8ccb8b5dd42f16c56 /public | |
parent | f5ea88328ef1b4dabd5f58b4c78ad4e175c96765 (diff) | |
download | server-9e77cf5b29a533faf1909327772359d189e527b1.tar.gz |
Links to user pages from in-game role display.
Diffstat (limited to 'public')
-rw-r--r-- | public/common/play.css | 9 | ||||
-rw-r--r-- | public/common/play.js | 5 |
2 files changed, 13 insertions, 1 deletions
diff --git a/public/common/play.css b/public/common/play.css index 8fe084e..fd99175 100644 --- a/public/common/play.css +++ b/public/common/play.css @@ -326,6 +326,15 @@ header .viewpoint_button.selected:active:hover { white-space: nowrap; } +.role_user a { + text-decoration: none; + color: black; +} + +.role_user a:hover { + text-decoration: underline; +} + .role_name::before { content: "\25cb "; opacity: 0.6; diff --git a/public/common/play.js b/public/common/play.js index e34f42c..73566bd 100644 --- a/public/common/play.js +++ b/public/common/play.js @@ -381,7 +381,10 @@ function on_game_over() { function init_player_names(players) { for (let i = 0; i < roles.length; ++i) { let p = players.find(p => p.role === roles[i].role) - document.getElementById(roles[i].id).querySelector(".role_user").textContent = p ? p.name : "NONE" + if (p) + document.getElementById(roles[i].id).querySelector(".role_user").innerHTML = `<a href="/user/${p.name}" target="_blank">${p.name}</a>` + else + document.getElementById(roles[i].id).querySelector(".role_user").textContent = "NONE" } } |