diff --git a/src/khoj/interface/web/chat.html b/src/khoj/interface/web/chat.html index 2a813779..54dc9692 100644 --- a/src/khoj/interface/web/chat.html +++ b/src/khoj/interface/web/chat.html @@ -528,7 +528,7 @@ To get started, just start typing below. You can also type / to see a list of co const textarea = document.getElementById('chat-input'); const scrollTop = textarea.scrollTop; textarea.style.height = '0'; - const scrollHeight = textarea.scrollHeight; + const scrollHeight = textarea.scrollHeight + 8; // +8 accounts for padding textarea.style.height = Math.min(scrollHeight, 200) + 'px'; textarea.scrollTop = scrollTop; document.getElementById("chat-body").scrollTop = document.getElementById("chat-body").scrollHeight; @@ -642,6 +642,7 @@ To get started, just start typing below. You can also type / to see a list of co let mediaRecorder; function speechToText() { const speakButtonImg = document.getElementById('speak-button-img'); + const stopRecordButtonImg = document.getElementById('stop-record-button-img'); const chatInput = document.getElementById('chat-input'); const sendToServer = (audioBlob) => { @@ -679,8 +680,8 @@ To get started, just start typing below. You can also type / to see a list of co }); mediaRecorder.start(); - speakButtonImg.src = '/static/assets/icons/stop-solid.svg'; - speakButtonImg.alt = 'Stop Transcription'; + speakButtonImg.style.display = 'none'; + stopRecordButtonImg.style.display = 'initial'; }; // Toggle recording @@ -695,8 +696,8 @@ To get started, just start typing below. You can also type / to see a list of co mediaRecorder.stop(); mediaRecorder.stream.getTracks().forEach(track => track.stop()); mediaRecorder = null; - speakButtonImg.src = '/static/assets/icons/microphone-solid.svg'; - speakButtonImg.alt = 'Transcribe'; + speakButtonImg.style.display = 'initial'; + stopRecordButtonImg.style.display = 'none'; } } @@ -718,12 +719,31 @@ To get started, just start typing below. You can also type / to see a list of co @@ -963,7 +983,7 @@ To get started, just start typing below. You can also type / to see a list of co } #input-row { display: grid; - grid-template-columns: auto 32px 32px; + grid-template-columns: 32px auto 32px 40px; grid-column-gap: 10px; grid-row-gap: 10px; background: var(--background-color); @@ -974,12 +994,13 @@ To get started, just start typing below. You can also type / to see a list of co #chat-input { font-family: roboto, karma, segoe ui, sans-serif; font-size: medium; - height: 54px; + height: 36px; + border-radius: 16px; resize: none; overflow-y: hidden; max-height: 200px; box-sizing: border-box; - padding: 15px; + padding: 4px 0 0 12px; line-height: 1.5em; margin: 0; } @@ -988,15 +1009,18 @@ To get started, just start typing below. You can also type / to see a list of co } .input-row-button { background: var(--background-color); - border: 1px solid var(--main-text-color); - box-shadow: 0 0 11px #aaa; - border-radius: 5px; - padding: 0px; + border: none; + box-shadow: none; + border-radius: 50%; font-size: 14px; font-weight: 300; line-height: 1.5em; cursor: pointer; transition: background 0.3s ease-in-out; + width: 40px; + height: 40px; + margin-top: -2px; + margin-left: -5px; } .input-row-button:hover { background: var(--primary-hover); @@ -1006,6 +1030,17 @@ To get started, just start typing below. You can also type / to see a list of co } .input-row-button-img { width: 24px; + height: 24px; + } + #send-button { + padding-top: 0; + padding-right: 3px; + } + #send-button-img { + width: 28px; + height: 28px; + background: var(--primary-hover); + border-radius: 50%; } @@ -1083,6 +1118,9 @@ To get started, just start typing below. You can also type / to see a list of co img.text-to-image { max-width: 100%; } + #clear-chat-button { + margin-left: 0; + } } @media only screen and (min-width: 700px) { body {