diff options
| author | ilotterytea <iltsu@alright.party> | 2025-08-04 23:47:23 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-08-04 23:47:23 +0500 |
| commit | 0ed045117c89a2db88ac340f9ec39329a304aa63 (patch) | |
| tree | 3279d6106ada582752d2024be2b91a269c01cfac | |
| parent | af7be5b590d1057fe4a4f79a0c4b2d68fdff5fa8 (diff) | |
upd: color the message if it starts with ACTION
| -rw-r--r-- | web/index.php | 15 | ||||
| -rw-r--r-- | web/static/style.css | 1 |
2 files changed, 15 insertions, 1 deletions
diff --git a/web/index.php b/web/index.php index cc4be55..b722095 100644 --- a/web/index.php +++ b/web/index.php @@ -203,11 +203,24 @@ if (isset($room)) { let tags = m.getAttribute("data-irc-tags"); const nickElement = m.querySelector(".nick"); + const contentElement = m.querySelector(".content"); + let color = null; for (const tag of tags.split(";")) { const p = tag.split("="); if (p[0] == "color") { - nickElement.style.color = p[1]; + color = p[1]; + break; + } + } + + if (color) { + nickElement.style.color = color; + + if (contentElement.textContent.startsWith("ACTION")) { + contentElement.textContent = contentElement.textContent.substring(7); + contentElement.style.color = color; + contentElement.style.fontStyle = 'italic'; } } } diff --git a/web/static/style.css b/web/static/style.css index a84bdc6..b85f9f5 100644 --- a/web/static/style.css +++ b/web/static/style.css @@ -64,4 +64,5 @@ table tr:last-child td { .message .nick { text-align: right; + text-shadow: 1px 1px 1px black; }
\ No newline at end of file |
