Spaces:
Running
Running
Update static/application.js
Browse files- static/application.js +23 -2
static/application.js
CHANGED
@@ -87,7 +87,7 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
87 |
message.style.alignItems = "center";
|
88 |
|
89 |
const msgSpan = document.createElement("span");
|
90 |
-
msgSpan.
|
91 |
message.appendChild(msgSpan);
|
92 |
|
93 |
if (audioSrc) {
|
@@ -146,7 +146,8 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
146 |
createMessageBubble(question, "You", null, selectedFile.name);
|
147 |
|
148 |
// Thinking bubble
|
149 |
-
const thinkingBubble = createMessageBubble("Wait,
|
|
|
150 |
|
151 |
const formData = new FormData();
|
152 |
formData.append("question", question);
|
@@ -214,4 +215,24 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
214 |
sendMessage();
|
215 |
}
|
216 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
217 |
});
|
|
|
87 |
message.style.alignItems = "center";
|
88 |
|
89 |
const msgSpan = document.createElement("span");
|
90 |
+
msgSpan.innerHTML = text;
|
91 |
message.appendChild(msgSpan);
|
92 |
|
93 |
if (audioSrc) {
|
|
|
146 |
createMessageBubble(question, "You", null, selectedFile.name);
|
147 |
|
148 |
// Thinking bubble
|
149 |
+
const thinkingBubble = createMessageBubble("Wait, let me think 🤔... <div class='loader'></div>", "Aidan");
|
150 |
+
|
151 |
|
152 |
const formData = new FormData();
|
153 |
formData.append("question", question);
|
|
|
215 |
sendMessage();
|
216 |
}
|
217 |
});
|
218 |
+
|
219 |
+
const style = document.createElement('style');
|
220 |
+
style.textContent = `
|
221 |
+
.loader {
|
222 |
+
display: inline-block;
|
223 |
+
border: 2px solid #f3f3f3;
|
224 |
+
border-top: 2px solid #3b82f6;
|
225 |
+
border-radius: 50%;
|
226 |
+
width: 16px;
|
227 |
+
height: 16px;
|
228 |
+
animation: spin 1s linear infinite;
|
229 |
+
margin-left: 8px;
|
230 |
+
}
|
231 |
+
@keyframes spin {
|
232 |
+
0% { transform: rotate(0deg); }
|
233 |
+
100% { transform: rotate(360deg); }
|
234 |
+
}
|
235 |
+
`;
|
236 |
+
document.head.appendChild(style);
|
237 |
+
|
238 |
});
|