Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -2455,15 +2455,21 @@ bot = gr.Chatbot(placeholder=placeholder_text)
|
|
| 2455 |
|
| 2456 |
js_func = """
|
| 2457 |
function refresh() {
|
|
|
|
| 2458 |
const url = new URL(window.location);
|
| 2459 |
if (url.searchParams.get('__theme') !== 'light') {
|
| 2460 |
url.searchParams.set('__theme', 'light');
|
| 2461 |
window.location.href = url.href;
|
|
|
|
| 2462 |
}
|
|
|
|
|
|
|
| 2463 |
const btn1 = document.querySelector("#vw_customers_btn");
|
| 2464 |
const btn2 = document.querySelector("#vw_prospects_btn");
|
| 2465 |
|
| 2466 |
if (btn1 && btn2) {
|
|
|
|
|
|
|
| 2467 |
btn1.addEventListener("click", () => {
|
| 2468 |
btn1.classList.add("active-btn");
|
| 2469 |
btn2.classList.remove("active-btn");
|
|
@@ -2476,32 +2482,35 @@ function refresh() {
|
|
| 2476 |
}
|
| 2477 |
}
|
| 2478 |
"""
|
|
|
|
| 2479 |
css = """
|
| 2480 |
#vw_customers_btn, #vw_prospects_btn {
|
| 2481 |
-
border: 2px solid
|
| 2482 |
-
padding: 10px
|
| 2483 |
font-size: 16px;
|
| 2484 |
font-weight: 500;
|
| 2485 |
-
line-height: 1.2;
|
| 2486 |
-
text-align: center;
|
| 2487 |
border-radius: 6px;
|
| 2488 |
-
margin: 0 5px;
|
| 2489 |
-
background-color: white;
|
| 2490 |
color: #333;
|
| 2491 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2492 |
}
|
| 2493 |
|
| 2494 |
-
/*
|
| 2495 |
.active-btn {
|
| 2496 |
-
background-color: #
|
| 2497 |
-
color:
|
| 2498 |
-
border-color:
|
|
|
|
| 2499 |
}
|
| 2500 |
|
| 2501 |
-
/* Optional hover */
|
| 2502 |
#vw_customers_btn:hover, #vw_prospects_btn:hover {
|
| 2503 |
-
background-color: #
|
| 2504 |
}
|
|
|
|
| 2505 |
.gr-button:has(svg) {
|
| 2506 |
display: none !important;
|
| 2507 |
}
|
|
|
|
| 2455 |
|
| 2456 |
js_func = """
|
| 2457 |
function refresh() {
|
| 2458 |
+
// Force theme to light
|
| 2459 |
const url = new URL(window.location);
|
| 2460 |
if (url.searchParams.get('__theme') !== 'light') {
|
| 2461 |
url.searchParams.set('__theme', 'light');
|
| 2462 |
window.location.href = url.href;
|
| 2463 |
+
return; // Prevent duplicate logic from executing during redirect
|
| 2464 |
}
|
| 2465 |
+
|
| 2466 |
+
// Button toggle logic
|
| 2467 |
const btn1 = document.querySelector("#vw_customers_btn");
|
| 2468 |
const btn2 = document.querySelector("#vw_prospects_btn");
|
| 2469 |
|
| 2470 |
if (btn1 && btn2) {
|
| 2471 |
+
btn1.classList.add("active-btn");
|
| 2472 |
+
|
| 2473 |
btn1.addEventListener("click", () => {
|
| 2474 |
btn1.classList.add("active-btn");
|
| 2475 |
btn2.classList.remove("active-btn");
|
|
|
|
| 2482 |
}
|
| 2483 |
}
|
| 2484 |
"""
|
| 2485 |
+
|
| 2486 |
css = """
|
| 2487 |
#vw_customers_btn, #vw_prospects_btn {
|
| 2488 |
+
border: 2px solid #ccc;
|
| 2489 |
+
padding: 10px 20px;
|
| 2490 |
font-size: 16px;
|
| 2491 |
font-weight: 500;
|
|
|
|
|
|
|
| 2492 |
border-radius: 6px;
|
|
|
|
|
|
|
| 2493 |
color: #333;
|
| 2494 |
+
background-color: #fff;
|
| 2495 |
+
margin: 0 5px;
|
| 2496 |
+
transition: all 0.25s ease;
|
| 2497 |
+
min-width: 140px;
|
| 2498 |
+
text-align: center;
|
| 2499 |
}
|
| 2500 |
|
| 2501 |
+
/* Highlighted (clicked) button — with teal text */
|
| 2502 |
.active-btn {
|
| 2503 |
+
background-color: #e0f7f5 !important; /* Light teal background */
|
| 2504 |
+
color: teal !important; /* Teal text */
|
| 2505 |
+
border-color: teal !important;
|
| 2506 |
+
box-shadow: 0 0 6px rgba(0, 128, 128, 0.3);
|
| 2507 |
}
|
| 2508 |
|
| 2509 |
+
/* Optional hover effect */
|
| 2510 |
#vw_customers_btn:hover, #vw_prospects_btn:hover {
|
| 2511 |
+
background-color: #f9f9f9;
|
| 2512 |
}
|
| 2513 |
+
|
| 2514 |
.gr-button:has(svg) {
|
| 2515 |
display: none !important;
|
| 2516 |
}
|