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 /web/index.php | |
| parent | af7be5b590d1057fe4a4f79a0c4b2d68fdff5fa8 (diff) | |
upd: color the message if it starts with ACTION
Diffstat (limited to 'web/index.php')
| -rw-r--r-- | web/index.php | 15 |
1 files changed, 14 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'; } } } |
