From e851576ae94fd55e329e387735ae73c6cb2d4f72 Mon Sep 17 00:00:00 2001 From: gravel Date: Tue, 6 Jun 2023 12:47:42 +0000 Subject: [PATCH] Make tag display less intrusive --- output/index.css | 9 +++++++++ php/servers/tags.php | 11 ++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/output/index.css b/output/index.css index 75e94aca..dd502613 100644 --- a/output/index.css +++ b/output/index.css @@ -127,6 +127,10 @@ html:not(.js) .js-only { color: black; } +#tbl_communities .room-label { + opacity: 0.75; +} + .room-label-user { background-color: greenyellow; } @@ -139,6 +143,11 @@ html:not(.js) .js-only { background-color: pink; } +#tbl_communities .room-label:not(.room-label-highlighted) { + background-color: transparent; + color: var(--primary-color); +} + gap { flex-grow: 1000; } diff --git a/php/servers/tags.php b/php/servers/tags.php index 20187454..296fe56c 100644 --- a/php/servers/tags.php +++ b/php/servers/tags.php @@ -136,6 +136,9 @@ if (CommunityTag::is_showcased_tag($this->text)) { $classname .= " room-label-showcased"; } + if (CommunityTag::is_highlighted_tag($this->text)) { + $classname .= " room-label-highlighted"; + } return $classname; } @@ -161,7 +164,9 @@ "we're here" ]; - private const SHOWCASED_TAGS = ["official", "new", "we're here"]; + private const SHOWCASED_TAGS = ["official", "new", "we're here", "nsfw", "read-only"]; + + private const HIGHLIGHTED_TAGS = ["new", "we're here"]; private const REDUNDANT_TAGS = ["session"]; @@ -181,5 +186,9 @@ public static function is_showcased_tag(string $tag): bool { return in_array(strtolower($tag), CommunityTag::SHOWCASED_TAGS); } + + public static function is_highlighted_tag(string $tag): bool { + return in_array(strtolower($tag), CommunityTag::HIGHLIGHTED_TAGS); + } } ?>