Update chat

This commit is contained in:
anhkha2003 2023-09-23 17:41:36 -05:00
parent db37cb4c40
commit 10f3390f3a
4 changed files with 33 additions and 12 deletions

View file

@ -52,11 +52,12 @@
border-bottom-left-radius: 0; border-bottom-left-radius: 0;
border-bottom-right-radius: 0; border-bottom-right-radius: 0;
flex-grow: 1; flex-grow: 1;
padding-left: 0.5em;
} }
#chat-input { #chat-input {
color: black; color: black;
border: 2px solid #e4a81c; border: 2px solid black;
} }
#chat-online-content { #chat-online-content {
padding: 0; padding: 0;
@ -81,7 +82,7 @@
} }
#chat-online { #chat-online {
margin: 0; margin: 0;
width: 35%; width: 30%;
} }
#chat-area { #chat-area {
flex-grow: 1; flex-grow: 1;
@ -91,12 +92,12 @@
font-family: "Noto Sans", Arial, "Lucida Grande", sans-serif; font-family: "Noto Sans", Arial, "Lucida Grande", sans-serif;
} }
.info-pic { .info-pic {
height: 100%; height: 95%;
} }
.info-name { .info-name {
margin-left: 10px; margin-left: 10px;
font-size: 2em; font-size: 1.8em;
font-weight: bold !important; font-weight: bold !important;
display: flex; display: flex;
align-items: center; align-items: center;
@ -166,11 +167,11 @@
} }
.message-text { .message-text {
padding: 0.4em 0.6em 0.5em; padding: 0.4em 0.6em 0.5em;
border-radius: 15px; border-radius: 20px;
max-width: 70%; max-width: 70%;
width: fit-content; width: fit-content;
font-size: 1.05rem; font-size: 1rem;
line-height: 1.3; line-height: 1.2;
} }
.message-text-other { .message-text-other {
background: #eeeeee; background: #eeeeee;
@ -199,6 +200,7 @@
border-radius: 2px; border-radius: 2px;
padding: 0 0.5em; padding: 0 0.5em;
align-self: flex-end; align-self: flex-end;
border-radius: 50%;
} }
#setting-content { #setting-content {
display: none; display: none;

View file

@ -57,7 +57,7 @@
.profile-pic { .profile-pic {
height: 2.6em; height: 2.6em;
width: 2.6em; width: 2.6em;
border-radius: 0.3em; border-radius: 50%;
margin-top: 0.1em; margin-top: 0.1em;
float: left; float: left;
} }
@ -122,6 +122,9 @@
align-items: center; align-items: center;
gap: 1em; gap: 1em;
} }
::placeholder { /* Chrome, Firefox, Opera, Safari 10.1+ */
text-align: left;
}
#chat-input { #chat-input {
padding: 10px 20px; padding: 10px 20px;
font-size: 16px; font-size: 16px;
@ -130,7 +133,9 @@
transition: box-shadow 0.3s ease-in-out; transition: box-shadow 0.3s ease-in-out;
width: 80%; width: 80%;
resize: none; resize: none;
height: 100%; height: 80%;
max-height: 200px;
overflow-y: auto;
} }
#chat-input:focus { #chat-input:focus {
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
@ -162,11 +167,13 @@
stroke-width: 1; stroke-width: 1;
} }
.info-pic { .info-pic {
border-radius: 5px; border-radius: 50%;
margin-left: 1em; margin-left: 1em;
margin-top: 3px;
} }
#chat-info { #chat-info {
height: 3em; height: 3em;
padding-bottom: 0.25em;
} }
@media (min-width: 800px) { @media (min-width: 800px) {
@ -175,7 +182,7 @@
overflow:hidden; overflow:hidden;
} }
#chat-input-container { #chat-input-container {
padding-left: 5%; padding-left: 3%;
} }
#chat-area { #chat-area {
padding-bottom: 1.5em; padding-bottom: 1.5em;

View file

@ -558,5 +558,17 @@
} }
register_setting(); register_setting();
color_selected_room(); color_selected_room();
// Adjust textarea height to fit the content
$(document).ready(function() {
$('#chat-input').on('input', function() {
if (this.scrollHeight > this.clientHeight) {
this.style.height = 'auto';
this.style.height = (this.scrollHeight) + 'px';
} else {
$(this).css('height', '80%');
}
});
});
}); });
</script> </script>

View file

@ -21,7 +21,7 @@
{% if other_user %} {% if other_user %}
<span style="margin-right: 0.3em" id="setting"> <span style="margin-right: 0.3em" id="setting">
<button class="control-button small" style="height:100%;" id="setting-button"> <button class="control-button small" style="height:100%; border-radius: 99px;" id="setting-button">
<i class="fa fa-ellipsis-h"></i> <i class="fa fa-ellipsis-h"></i>
</button> </button>
<div id="setting-content"> <div id="setting-content">