Spaces:
Sleeping
Sleeping
Update templates/chat.html
Browse files- templates/chat.html +21 -24
templates/chat.html
CHANGED
|
@@ -30,27 +30,24 @@
|
|
| 30 |
|
| 31 |
<body>
|
| 32 |
<div class="container-fluid h-100">
|
| 33 |
-
<div class="row
|
| 34 |
-
<div class="
|
| 35 |
<div class="card">
|
| 36 |
<div class="card-header msg_head">
|
| 37 |
<div class="d-flex bd-highlight">
|
| 38 |
<div class="img_cont">
|
| 39 |
-
<img src="/static/images/
|
| 40 |
<span class="online_icon"></span>
|
| 41 |
</div>
|
| 42 |
|
| 43 |
<div class="user_info">
|
| 44 |
<span>JUIT AI Assist</span>
|
| 45 |
-
<p>Explore College and Beyond: Ask Anything! 🎓</p>
|
| 46 |
-
<!-- Add this inside the card-header (after user_info div) -->
|
| 47 |
-
|
| 48 |
</div>
|
| 49 |
-
<div class="d-flex flex-
|
| 50 |
<button id="themeToggle" class="btn btn-sm btn-light" style="position: static;">Light Mode</button>
|
| 51 |
-
|
| 52 |
<button id="clearChat" class="btn btn-danger btn-sm mt-2">Clear Chat</button>
|
| 53 |
-
|
| 54 |
</div>
|
| 55 |
</div>
|
| 56 |
|
|
@@ -155,14 +152,14 @@
|
|
| 155 |
chatHistory.push(rawText); // Store the user's message in history
|
| 156 |
currentIndex = chatHistory.length - 1; // Update the current index
|
| 157 |
var userHtml = `
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
$("#text").val(""); // Clear the input field
|
| 167 |
$("#messageFormeight").append(userHtml); // Add the user message to the chat
|
| 168 |
$(document).ready(function () {
|
|
@@ -201,12 +198,12 @@
|
|
| 201 |
url: "/get",
|
| 202 |
}).done(function (response) {
|
| 203 |
let botHtml = `
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
$("#messageFormeight").append($.parseHTML(botHtml));
|
| 211 |
$("#messageFormeight").animate({ scrollTop: $("#messageFormeight")[0].scrollHeight }, 500);
|
| 212 |
});
|
|
@@ -235,7 +232,7 @@
|
|
| 235 |
|
| 236 |
// Create the container for the bot message
|
| 237 |
var botContainer = $('<div class="d-flex justify-content-start mb-4"></div>');
|
| 238 |
-
var imgDiv = $('<div class="img_cont_msg"><img src="/static/images/
|
| 239 |
var msgDiv = $('<div class="msg_container"></div>');
|
| 240 |
botContainer.append(imgDiv);
|
| 241 |
botContainer.append(msgDiv);
|
|
|
|
| 30 |
|
| 31 |
<body>
|
| 32 |
<div class="container-fluid h-100">
|
| 33 |
+
<div class="row no-gutters h-100">
|
| 34 |
+
<div class=" chat">
|
| 35 |
<div class="card">
|
| 36 |
<div class="card-header msg_head">
|
| 37 |
<div class="d-flex bd-highlight">
|
| 38 |
<div class="img_cont">
|
| 39 |
+
<img src="/static/images/juit.png" class="rounded-circle user_img">
|
| 40 |
<span class="online_icon"></span>
|
| 41 |
</div>
|
| 42 |
|
| 43 |
<div class="user_info">
|
| 44 |
<span>JUIT AI Assist</span>
|
| 45 |
+
<p font-size="200px">Explore College and Beyond: Ask Anything! 🎓</p>
|
|
|
|
|
|
|
| 46 |
</div>
|
| 47 |
+
<div class="d-flex flex-row align-items-baseline ml-auto">
|
| 48 |
<button id="themeToggle" class="btn btn-sm btn-light" style="position: static;">Light Mode</button>
|
|
|
|
| 49 |
<button id="clearChat" class="btn btn-danger btn-sm mt-2">Clear Chat</button>
|
| 50 |
+
</div>
|
| 51 |
</div>
|
| 52 |
</div>
|
| 53 |
|
|
|
|
| 152 |
chatHistory.push(rawText); // Store the user's message in history
|
| 153 |
currentIndex = chatHistory.length - 1; // Update the current index
|
| 154 |
var userHtml = `
|
| 155 |
+
<div class="d-flex justify-content-end mb-4">
|
| 156 |
+
<div class="msg_container_send">${rawText}
|
| 157 |
+
<span class="msg_time_send">${str_time}</span>
|
| 158 |
+
</div>
|
| 159 |
+
<div class="img_cont_msg">
|
| 160 |
+
<img src="/static/images/user.png" class="rounded-circle user_img_msg">
|
| 161 |
+
</div>
|
| 162 |
+
</div>`;
|
| 163 |
$("#text").val(""); // Clear the input field
|
| 164 |
$("#messageFormeight").append(userHtml); // Add the user message to the chat
|
| 165 |
$(document).ready(function () {
|
|
|
|
| 198 |
url: "/get",
|
| 199 |
}).done(function (response) {
|
| 200 |
let botHtml = `
|
| 201 |
+
<div class="d-flex justify-content-start mb-4">
|
| 202 |
+
<div class="img_cont_msg">
|
| 203 |
+
<img src="/static/images/juit.png" class="rounded-circle user_img_msg">
|
| 204 |
+
</div>
|
| 205 |
+
<div class="msg_container">${response}<span class="msg_time">${time}</span></div>
|
| 206 |
+
</div>`;
|
| 207 |
$("#messageFormeight").append($.parseHTML(botHtml));
|
| 208 |
$("#messageFormeight").animate({ scrollTop: $("#messageFormeight")[0].scrollHeight }, 500);
|
| 209 |
});
|
|
|
|
| 232 |
|
| 233 |
// Create the container for the bot message
|
| 234 |
var botContainer = $('<div class="d-flex justify-content-start mb-4"></div>');
|
| 235 |
+
var imgDiv = $('<div class="img_cont_msg"><img src="/static/images/juit.png" class="rounded-circle user_img_msg"></div>');
|
| 236 |
var msgDiv = $('<div class="msg_container"></div>');
|
| 237 |
botContainer.append(imgDiv);
|
| 238 |
botContainer.append(msgDiv);
|