From 9e77cf5b29a533faf1909327772359d189e527b1 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 15 Sep 2023 20:48:05 +0200 Subject: Links to user pages from in-game role display. --- public/common/play.css | 9 +++++++++ public/common/play.js | 5 ++++- 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'public') 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 = `${p.name}` + else + document.getElementById(roles[i].id).querySelector(".role_user").textContent = "NONE" } } -- cgit v1.2.3