Update app.py
Browse files
app.py
CHANGED
|
@@ -27,6 +27,42 @@ Keep a simple, approachable, and friendly tone otherwise."""
|
|
| 27 |
fade_js = """
|
| 28 |
<script>
|
| 29 |
document.addEventListener("DOMContentLoaded", () => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
// Add startup message
|
| 31 |
setTimeout(() => {
|
| 32 |
const chatContainer = document.querySelector(".chat-interface");
|
|
@@ -231,6 +267,36 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
| 231 |
});
|
| 232 |
}
|
| 233 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 234 |
// Startup message
|
| 235 |
const startupMsg = document.querySelector(".startup-message");
|
| 236 |
if (startupMsg && !startupMsg.hasAttribute("data-bounce-added")) {
|
|
@@ -306,6 +372,36 @@ body {
|
|
| 306 |
.gradio-container:active {
|
| 307 |
transform: scale(0.995);
|
| 308 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 309 |
.chat-message {
|
| 310 |
border-radius: 20px;
|
| 311 |
padding: 16px 20px;
|
|
|
|
| 27 |
fade_js = """
|
| 28 |
<script>
|
| 29 |
document.addEventListener("DOMContentLoaded", () => {
|
| 30 |
+
// Add title and subtitle
|
| 31 |
+
setTimeout(() => {
|
| 32 |
+
const chatContainer = document.querySelector(".chat-interface");
|
| 33 |
+
const gradioContainer = document.querySelector(".gradio-container");
|
| 34 |
+
|
| 35 |
+
if (gradioContainer && !document.querySelector(".chat-title")) {
|
| 36 |
+
const titleContainer = document.createElement("div");
|
| 37 |
+
titleContainer.className = "title-container";
|
| 38 |
+
|
| 39 |
+
const title = document.createElement("h1");
|
| 40 |
+
title.className = "chat-title";
|
| 41 |
+
title.textContent = "Talk with BitAI (W.I.P)";
|
| 42 |
+
|
| 43 |
+
const subtitle = document.createElement("p");
|
| 44 |
+
subtitle.className = "chat-subtitle";
|
| 45 |
+
subtitle.innerHTML = "Me, Sal is still updating this AI, he cannot search on internet, he might not know how to answer you, filter is a little broken";
|
| 46 |
+
|
| 47 |
+
titleContainer.appendChild(title);
|
| 48 |
+
titleContainer.appendChild(subtitle);
|
| 49 |
+
|
| 50 |
+
// Insert before the login button
|
| 51 |
+
const loginButton = document.querySelector(".gr-button.gr-login");
|
| 52 |
+
if (loginButton) {
|
| 53 |
+
gradioContainer.insertBefore(titleContainer, loginButton);
|
| 54 |
+
} else {
|
| 55 |
+
gradioContainer.insertBefore(titleContainer, gradioContainer.firstChild);
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
// Animate in
|
| 59 |
+
setTimeout(() => {
|
| 60 |
+
titleContainer.style.opacity = "1";
|
| 61 |
+
titleContainer.style.transform = "translateY(0)";
|
| 62 |
+
}, 100);
|
| 63 |
+
}
|
| 64 |
+
}, 100);
|
| 65 |
+
|
| 66 |
// Add startup message
|
| 67 |
setTimeout(() => {
|
| 68 |
const chatContainer = document.querySelector(".chat-interface");
|
|
|
|
| 267 |
});
|
| 268 |
}
|
| 269 |
|
| 270 |
+
// Title and subtitle
|
| 271 |
+
const title = document.querySelector(".chat-title");
|
| 272 |
+
const subtitle = document.querySelector(".chat-subtitle");
|
| 273 |
+
|
| 274 |
+
if (title && !title.hasAttribute("data-bounce-added")) {
|
| 275 |
+
title.setAttribute("data-bounce-added", "true");
|
| 276 |
+
|
| 277 |
+
title.addEventListener("click", function() {
|
| 278 |
+
this.style.transition = "transform 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55)";
|
| 279 |
+
this.style.transform = "scale(0.98)";
|
| 280 |
+
|
| 281 |
+
setTimeout(() => {
|
| 282 |
+
this.style.transform = "scale(1)";
|
| 283 |
+
}, 500);
|
| 284 |
+
});
|
| 285 |
+
}
|
| 286 |
+
|
| 287 |
+
if (subtitle && !subtitle.hasAttribute("data-bounce-added")) {
|
| 288 |
+
subtitle.setAttribute("data-bounce-added", "true");
|
| 289 |
+
|
| 290 |
+
subtitle.addEventListener("click", function() {
|
| 291 |
+
this.style.transition = "transform 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55)";
|
| 292 |
+
this.style.transform = "scale(0.98)";
|
| 293 |
+
|
| 294 |
+
setTimeout(() => {
|
| 295 |
+
this.style.transform = "scale(1)";
|
| 296 |
+
}, 500);
|
| 297 |
+
});
|
| 298 |
+
}
|
| 299 |
+
|
| 300 |
// Startup message
|
| 301 |
const startupMsg = document.querySelector(".startup-message");
|
| 302 |
if (startupMsg && !startupMsg.hasAttribute("data-bounce-added")) {
|
|
|
|
| 372 |
.gradio-container:active {
|
| 373 |
transform: scale(0.995);
|
| 374 |
}
|
| 375 |
+
/* Title container */
|
| 376 |
+
.title-container {
|
| 377 |
+
text-align: center;
|
| 378 |
+
margin-bottom: 25px;
|
| 379 |
+
opacity: 0;
|
| 380 |
+
transform: translateY(-20px);
|
| 381 |
+
transition: opacity 0.5s ease, transform 0.5s ease;
|
| 382 |
+
}
|
| 383 |
+
.chat-title {
|
| 384 |
+
font-family: 'Inter', 'Manrope', 'Outfit', sans-serif;
|
| 385 |
+
font-weight: 700;
|
| 386 |
+
font-size: 32px;
|
| 387 |
+
color: #fff;
|
| 388 |
+
margin-bottom: 10px;
|
| 389 |
+
letter-spacing: -0.02em;
|
| 390 |
+
text-shadow: 0 2px 10px rgba(0,0,0,0.3);
|
| 391 |
+
cursor: pointer;
|
| 392 |
+
transition: transform 0.3s ease;
|
| 393 |
+
}
|
| 394 |
+
.chat-subtitle {
|
| 395 |
+
font-family: 'Manrope', 'Outfit', 'Inter', sans-serif;
|
| 396 |
+
font-weight: 400;
|
| 397 |
+
font-size: 14px;
|
| 398 |
+
color: #aaa;
|
| 399 |
+
line-height: 1.5;
|
| 400 |
+
max-width: 600px;
|
| 401 |
+
margin: 0 auto;
|
| 402 |
+
cursor: pointer;
|
| 403 |
+
transition: transform 0.3s ease;
|
| 404 |
+
}
|
| 405 |
.chat-message {
|
| 406 |
border-radius: 20px;
|
| 407 |
padding: 16px 20px;
|