added google api

This commit is contained in:
2024-06-01 11:12:39 +02:00
parent 769b394dd7
commit 392e6b9957
9 changed files with 91 additions and 48 deletions
+18 -2
View File
@@ -27,7 +27,7 @@
</span>
</button-->
<button disabled type="submit" class="send-button button is-primary is-small"
hx-post="/generatePlaceholder" hx-swap="beforeend settle:200ms" hx-target="#chat-messages"
hx-post="/generatePlaceholder" hx-swap="beforeend" hx-target="#chat-messages"
id="chat-input-send-btn" class="chat-input" hx-include="[name='message']"
hx-vals="js:{selectedLLMIds: getSelectedModelsIDs()}" onclick="clearTextArea()">
<span class="icon">
@@ -43,7 +43,7 @@
<script>
var textareaControl = document.getElementById('textarea-control');
// Every 0.1s check if the text area have htmx-request class, if yes, add the class is-loading
// Every 0.01s check if the text area have htmx-request class, if yes, add the class is-loading
setInterval(function () {
if (textareaControl.classList.contains('htmx-request')) {
textareaControl.classList.add('is-loading');
@@ -52,6 +52,22 @@
}
}, 10);
setInterval(function () {
if (window.innerWidth < 450) {
var elements = document.getElementsByClassName('message-icon');
for (var i = 0; i < elements.length; i++) {
elements[i].classList.remove('is-48x48');
elements[i].classList.add('is-32x32');
}
} else {
var elements = document.getElementsByClassName('message-icon');
for (var i = 0; i < elements.length; i++) {
elements[i].classList.remove('is-32x32');
elements[i].classList.add('is-48x48');
}
}
}, 300);
document.getElementById('chat-input-textarea').addEventListener('focus', function () {
var buttons = document.getElementsByClassName('to-reduce-opacity');
for (var i = 0; i < buttons.length; i++) {