From a525fbc3b4d7ff587fa9a6547c464f5d7730d5c7 Mon Sep 17 00:00:00 2001 From: Justin Ferrari <‘justinwesleyferrari@gmail.com’> Date: Fri, 4 Nov 2022 22:04:56 -0500 Subject: [PATCH] Added loader for messages + fixed message size UI --- .../plugins/core/components/ChatPage.js | 407 ++++++++++++------ 1 file changed, 268 insertions(+), 139 deletions(-) diff --git a/qortal-ui-plugins/plugins/core/components/ChatPage.js b/qortal-ui-plugins/plugins/core/components/ChatPage.js index d25b29f4..37d522b6 100644 --- a/qortal-ui-plugins/plugins/core/components/ChatPage.js +++ b/qortal-ui-plugins/plugins/core/components/ChatPage.js @@ -165,8 +165,9 @@ class ChatPage extends LitElement { } .chat-text-area .typing-area .chatbar { - width: auto; + position: relative; display: flex; + flex-direction: column; justify-content: center; align-items: center; height: auto; @@ -174,6 +175,13 @@ class ChatPage extends LitElement { overflow-y: hidden; } + .chatbar-container { + width: 100%; + display: flex; + height: auto; + overflow: hidden; + } + .chat-text-area .typing-area .emoji-button { width: 45px; height: 40px; @@ -186,6 +194,98 @@ class ChatPage extends LitElement { color: var(--black); } + .message-size-container { + display: flex; + justify-content: flex-end; + width: 100%; + } + + .message-size { + font-family: Roboto, sans-serif; + font-size: 12px; + color: black; + } + + .lds-grid { + width: 120px; + height: 120px; + position: absolute; + left: 50%; + top: 40%; + } + + .lds-grid div { + position: absolute; + width: 34px; + height: 34px; + border-radius: 50%; + background: #03a9f4; + animation: lds-grid 1.2s linear infinite; + } + + .lds-grid div:nth-child(1) { + top: 4px; + left: 4px; + animation-delay: 0s; + } + + .lds-grid div:nth-child(2) { + top: 4px; + left: 48px; + animation-delay: -0.4s; + } + + .lds-grid div:nth-child(3) { + top: 4px; + left: 90px; + animation-delay: -0.8s; + } + + .lds-grid div:nth-child(4) { + top: 50px; + left: 4px; + animation-delay: -0.4s; + } + + .lds-grid div:nth-child(5) { + top: 50px; + left: 48px; + animation-delay: -0.8s; + } + + .lds-grid div:nth-child(6) { + top: 50px; + left: 90px; + animation-delay: -1.2s; + } + + .lds-grid div:nth-child(7) { + top: 95px; + left: 4px; + animation-delay: -0.8s; + } + + .lds-grid div:nth-child(8) { + top: 95px; + left: 48px; + animation-delay: -1.2s; + } + + .lds-grid div:nth-child(9) { + top: 95px; + left: 90px; + animation-delay: -1.6s; + } + + @keyframes lds-grid { + 0%, 100% { + opacity: 1; + } + 50% { + opacity: 0.5; + } + } + .float-left { float: left; } @@ -207,16 +307,19 @@ class ChatPage extends LitElement { width: 30px; margin-left: 5px; transition: all 0.1s ease-in-out; + cursor: pointer; } .send-icon:hover { filter: brightness(1.1); } + .file-picker-container { position: relative; height: 25px; width: 25px; } + .file-picker-input-container { position: absolute; top: 0px; @@ -229,14 +332,15 @@ class ChatPage extends LitElement { } input[type=file]::-webkit-file-upload-button { - cursor: pointer; -} + cursor: pointer; + } ` } constructor() { super() + this.getMessageConfig = this.getMessageConfig.bind(this) this.getOldMessage = this.getOldMessage.bind(this) this._sendMessage = this._sendMessage.bind(this) this.insertImage = this.insertImage.bind(this) @@ -264,7 +368,7 @@ class ChatPage extends LitElement { this.repliedToMessageObj = null this.editedMessageObj = null this.iframeHeight = 40 - this.chatMessageSize = 5 + this.chatMessageSize = 0 this.imageFile = null this.uid = new ShortUniqueId() } @@ -273,44 +377,56 @@ class ChatPage extends LitElement { return html`