From 609b04531555ab77ec8b911d9d8537589f35caed Mon Sep 17 00:00:00 2001 From: Xamora Date: Mon, 18 Dec 2023 21:26:18 +0100 Subject: [PATCH] better css, add debug --- frontend/static/css/accounts/register.css | 2 +- frontend/static/css/index.css | 4 +-- frontend/static/css/me.css | 2 +- frontend/static/css/search.css | 44 ++++++++++++----------- frontend/static/js/api/chat/channels.js | 5 ++- frontend/static/js/views/Search.js | 4 ++- 6 files changed, 35 insertions(+), 26 deletions(-) diff --git a/frontend/static/css/accounts/register.css b/frontend/static/css/accounts/register.css index ddcda9a..9c70d04 100644 --- a/frontend/static/css/accounts/register.css +++ b/frontend/static/css/accounts/register.css @@ -9,4 +9,4 @@ margin-right: auto; margin-top: 90px; border: 15px black solid; -} \ No newline at end of file +} diff --git a/frontend/static/css/index.css b/frontend/static/css/index.css index 83d16ec..b76a0f6 100644 --- a/frontend/static/css/index.css +++ b/frontend/static/css/index.css @@ -1,7 +1,7 @@ body { - margin: 1vh; + margin: 20px; font-family: 'Quicksand', sans-serif; - font-size: 3vh; + font-size: 60px; } a { diff --git a/frontend/static/css/me.css b/frontend/static/css/me.css index f7c2313..d243aa6 100644 --- a/frontend/static/css/me.css +++ b/frontend/static/css/me.css @@ -16,4 +16,4 @@ #app .profile { background-color: green; -} \ No newline at end of file +} diff --git a/frontend/static/css/search.css b/frontend/static/css/search.css index 28d5d90..3e88b85 100644 --- a/frontend/static/css/search.css +++ b/frontend/static/css/search.css @@ -1,13 +1,13 @@ #app img { - max-height: 10vh; - max-width: 10vh; + max-height: 3em; + max-width: 3em; } #app ul { - font-size: 2vh; - margin: 1vh 0 0 0; + font-size: 0.75em; + margin: 0.25em 0 0 0; padding: 0 0 0 0; list-style-type: none; max-height: 80vh; @@ -16,7 +16,7 @@ #app li { - margin: 1vh 1vh 0 0; + margin: 0.25em 0.25em 0 0; } #app #chats { @@ -25,37 +25,41 @@ text-align: left; } #app #users { - margin: 0vh 5vh 0vh 0.1vh; + margin: 0em 1.0em 0em 0.05em; } #app #chat { position: relative; - max-height: 80vh; - width: 80vh; + max-height: 86vh; + width: 100vh; /*border: 2px solid green;*/ overflow: hidden; } +#app #members { + font-size: 1em; +} + #app #add_chat_off { text-decoration: underline; } #app #messages { - max-height: 50vh; + max-height: 50em; overflow: scroll; overflow-y: scroll; overflow-x: hidden; - font-size: 2vh; + font-size: 0.6em; } #app #input_user{ color: green; - width: 20vh; - height: 2.5vh; - font-size: 2vh; + width: 8.5em; + height: 1.1em; + font-size: 0.75em; border: none; outline: none; - border-bottom: 0.25vh solid green; + border-bottom: 0.15em solid green; } #app #input_chat{ @@ -65,18 +69,18 @@ width: 100%; border: none; outline: none; - border-bottom: 0.25vh solid green; + border-bottom: 0.2em solid green; caret-color: green; color: green; - font-size: 2vh; + font-size: 0.65em; } #app #you { text-align: left; position: relative; max-width: 48%; - left: 2vh; - margin: 1vh 0 0 0; + left: 0.5em; + margin: 0.5em 0 0 0; color: green; word-wrap: break-word; @@ -86,8 +90,8 @@ text-align: right; position: relative; max-width: 48%; - margin: 1vh 0 0 auto; - right: 2vh; + margin: 0.5em 0 0 auto; + right: 0.5em; color: red; /* permet le retour à la ligne à la place de dépasser*/ diff --git a/frontend/static/js/api/chat/channels.js b/frontend/static/js/api/chat/channels.js index 527eb02..5fad6fc 100644 --- a/frontend/static/js/api/chat/channels.js +++ b/frontend/static/js/api/chat/channels.js @@ -8,10 +8,13 @@ class Channels { async createChannel(users_id, reload) { + let null_id = false; users_id.forEach(user_id => { if (user_id == null) - return console.log("createChannel error, null id;"); + null_id = true; }); + if (null_id) + return console.log(users_id, "createChannel error, null id;"); let response = await this.client._post("/api/chat/", { users_id:users_id diff --git a/frontend/static/js/views/Search.js b/frontend/static/js/views/Search.js index e22fbfc..2b3a011 100644 --- a/frontend/static/js/views/Search.js +++ b/frontend/static/js/views/Search.js @@ -185,6 +185,9 @@ export default class extends AbstractView { messages.appendChild(text); }); + // Scroll to the bottom of messages + messages.scrollTop = messages.scrollHeight; + } async hideChat() { @@ -212,7 +215,6 @@ export default class extends AbstractView { - `; } }