From 0ed045117c89a2db88ac340f9ec39329a304aa63 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Mon, 4 Aug 2025 23:47:23 +0500 Subject: upd: color the message if it starts with ACTION --- web/index.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'web/index.php') 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'; } } } -- cgit v1.2.3