From bd8d7848b9cfbd3a0edbaab7cc4fa5791358de77 Mon Sep 17 00:00:00 2001 From: anhkha2003 Date: Sun, 24 Sep 2023 23:31:38 -0500 Subject: [PATCH] Update Chat --- resources/chatbox.scss | 15 +++++++++++---- templates/chat/chat.html | 2 +- templates/chat/chat_css.html | 18 ++++++++++++++---- templates/chat/chat_js.html | 18 ++++++++---------- templates/chat/online_status.html | 14 +++++++++----- templates/chat/user_online_status.html | 10 +++++++--- 6 files changed, 50 insertions(+), 27 deletions(-) diff --git a/resources/chatbox.scss b/resources/chatbox.scss index a38bdc9..bfbfd0a 100644 --- a/resources/chatbox.scss +++ b/resources/chatbox.scss @@ -59,6 +59,9 @@ color: black; border: 2px solid black; } +#chat-input::placeholder { + color: grey; +} #chat-online-content { padding: 0; width: 100%; @@ -136,6 +139,7 @@ position: relative; display: inline-flex; flex: 0 0 auto; + align-items: center; } .status-circle { position: absolute; @@ -194,13 +198,16 @@ } .unread-count { - float: right; color: white; background-color: darkcyan; - border-radius: 2px; - padding: 0 0.5em; - align-self: flex-end; border-radius: 50%; + align-self: center; + flex: 0 0 1.25rem; + height: 1.25rem; + font-size: smaller; + display: flex; + align-items: center; + justify-content: center; } #setting-content { display: none; diff --git a/templates/chat/chat.html b/templates/chat/chat.html index 1991402..5a4ed07 100644 --- a/templates/chat/chat.html +++ b/templates/chat/chat.html @@ -98,7 +98,7 @@
- +
- - {{user.unread_count if user.unread_count}} - + {% if user.unread_count and user.unread_count > 0 %} + + {{user.unread_count}} + + {% endif %} {% endfor %} diff --git a/templates/chat/user_online_status.html b/templates/chat/user_online_status.html index 06c6a2e..b391c54 100644 --- a/templates/chat/user_online_status.html +++ b/templates/chat/user_online_status.html @@ -1,11 +1,15 @@ {% if other_user %} -
+
+{% else %} +
+ +
{% endif %} {% if other_user %} @@ -21,9 +25,9 @@ {% if other_user %} - +