Nischal Subedi
commited on
Commit
·
766e7a1
1
Parent(s):
aad2854
UI v32
Browse files
app.py
CHANGED
|
@@ -303,14 +303,14 @@ Answer:"""
|
|
| 303 |
|
| 304 |
/* Root variables for consistent theming - adjusted for an inviting orange palette */
|
| 305 |
:root {
|
| 306 |
-
--primary-color: #
|
| 307 |
-
--primary-hover: #
|
| 308 |
-
--background-primary: #
|
| 309 |
-
--background-secondary: #
|
| 310 |
--text-primary: #4A3C32; /* Dark warm brown/charcoal for main text */
|
| 311 |
--text-secondary: #8C7B6F; /* Muted warm gray/brown for secondary text */
|
| 312 |
--border-color: #DDC6AF; /* Light, desaturated orange-brown for borders */
|
| 313 |
-
--border-focus: #
|
| 314 |
--shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
|
| 315 |
--shadow-md: 0 4px 10px rgba(0,0,0,0.1);
|
| 316 |
--shadow-lg: 0 10px 20px rgba(0,0,0,0.15);
|
|
@@ -367,8 +367,8 @@ Answer:"""
|
|
| 367 |
left: 0;
|
| 368 |
width: 100%;
|
| 369 |
height: 100%;
|
| 370 |
-
background: radial-gradient(circle at top left, rgba(255,
|
| 371 |
-
radial-gradient(circle at bottom right, rgba(255,
|
| 372 |
z-index: 0;
|
| 373 |
opacity: 0.8;
|
| 374 |
pointer-events: none;
|
|
@@ -422,7 +422,7 @@ Answer:"""
|
|
| 422 |
}
|
| 423 |
/* Card sections with clear boundaries (boundeyes) and subtle dynamic effects */
|
| 424 |
.dashboard-card-section {
|
| 425 |
-
background: var(--background-primary) !important;
|
| 426 |
border: 2px solid var(--border-color) !important; /* Distinct border */
|
| 427 |
border-radius: 12px !important;
|
| 428 |
padding: 1.75rem !important; /* Consistent padding */
|
|
@@ -454,6 +454,7 @@ Answer:"""
|
|
| 454 |
line-height: 1.7 !important;
|
| 455 |
color: var(--text-primary) !important;
|
| 456 |
font-size: 1rem !important;
|
|
|
|
| 457 |
}
|
| 458 |
.dashboard-card-section strong {
|
| 459 |
color: var(--primary-color) !important; /* Highlight strong text with primary color */
|
|
@@ -469,13 +470,13 @@ Answer:"""
|
|
| 469 |
.gradio-dropdown .primary-wrap, /* Target dropdown wrapper */
|
| 470 |
.gradio-dropdown .scroll-hide /* Target dropdown list container for consistency */
|
| 471 |
{
|
| 472 |
-
background: var(--background-primary) !important;
|
| 473 |
border: 2px solid var(--border-color) !important; /* Clear border */
|
| 474 |
border-radius: 8px !important;
|
| 475 |
padding: 0.85rem 1rem !important; /* Slightly more padding */
|
| 476 |
font-size: 0.98rem !important;
|
| 477 |
font-family: 'Inter', sans-serif !important;
|
| 478 |
-
color: var(--text-primary) !important;
|
| 479 |
transition: border-color 0.2s ease, box-shadow 0.2s ease !important; /* Smooth transitions */
|
| 480 |
box-shadow: var(--shadow-sm) !important;
|
| 481 |
}
|
|
@@ -485,7 +486,7 @@ Answer:"""
|
|
| 485 |
.gradio-dropdown .primary-wrap.focused { /* Apply focus style to dropdown wrap */
|
| 486 |
outline: none !important;
|
| 487 |
border-color: var(--border-focus) !important; /* Distinct border on focus */
|
| 488 |
-
box-shadow: 0 0 0 4px rgba(255,
|
| 489 |
}
|
| 490 |
|
| 491 |
/* Label styling for better readability */
|
|
@@ -532,12 +533,12 @@ Answer:"""
|
|
| 532 |
text-align: center !important; /* Ensure button text is centered */
|
| 533 |
}
|
| 534 |
.gr-button-primary {
|
| 535 |
-
background: var(--primary-color) !important;
|
| 536 |
color: white !important;
|
| 537 |
box-shadow: var(--shadow-sm) !important;
|
| 538 |
}
|
| 539 |
.gr-button-primary:hover {
|
| 540 |
-
background: var(--primary-hover) !important;
|
| 541 |
box-shadow: var(--shadow-md) !important;
|
| 542 |
transform: translateY(-2px) !important; /* Subtle lift effect on hover */
|
| 543 |
}
|
|
@@ -546,12 +547,12 @@ Answer:"""
|
|
| 546 |
box-shadow: none !important;
|
| 547 |
}
|
| 548 |
.gr-button-secondary {
|
| 549 |
-
background: transparent !important;
|
| 550 |
color: var(--text-primary) !important;
|
| 551 |
border-color: var(--border-color) !important;
|
| 552 |
}
|
| 553 |
.gr-button-secondary:hover {
|
| 554 |
-
background: var(--background-secondary) !important;
|
| 555 |
border-color: var(--primary-color) !important;
|
| 556 |
transform: translateY(-2px) !important;
|
| 557 |
}
|
|
@@ -562,7 +563,7 @@ Answer:"""
|
|
| 562 |
|
| 563 |
/* Output styling with clear boundaries (boundeyes are clear) and dynamic fade-in */
|
| 564 |
.output-content-wrapper {
|
| 565 |
-
background: var(--background-primary) !important;
|
| 566 |
border: 2px solid var(--border-color) !important; /* Clear border */
|
| 567 |
border-radius: 8px !important;
|
| 568 |
padding: 1.5rem !important;
|
|
@@ -598,6 +599,9 @@ Answer:"""
|
|
| 598 |
display: flex !important;
|
| 599 |
align-items: center !important;
|
| 600 |
gap: 0.6rem !important;
|
|
|
|
|
|
|
|
|
|
| 601 |
}
|
| 602 |
.response-icon {
|
| 603 |
font-size: 1.5rem !important;
|
|
@@ -610,7 +614,7 @@ Answer:"""
|
|
| 610 |
}
|
| 611 |
/* Error message styling */
|
| 612 |
.error-message {
|
| 613 |
-
background: var(--error-bg) !important;
|
| 614 |
border: 2px solid var(--error-border) !important;
|
| 615 |
color: var(--error-text) !important;
|
| 616 |
padding: 1.25rem !important;
|
|
@@ -642,11 +646,11 @@ Answer:"""
|
|
| 642 |
}
|
| 643 |
/* Placeholder styling for empty output */
|
| 644 |
.placeholder {
|
| 645 |
-
background: var(--background-secondary) !important;
|
| 646 |
border: 2px dashed var(--border-color) !important;
|
| 647 |
border-radius: 8px !important;
|
| 648 |
padding: 2.5rem 1.5rem !important;
|
| 649 |
-
text-align: center !important;
|
| 650 |
color: var(--text-secondary) !important;
|
| 651 |
font-style: italic !important;
|
| 652 |
font-size: 1.1rem !important;
|
|
@@ -669,19 +673,19 @@ Answer:"""
|
|
| 669 |
text-align: left !important; /* Ensure example text is left-aligned */
|
| 670 |
}
|
| 671 |
.examples-section .gr-samples-table th {
|
| 672 |
-
background: var(--background-secondary) !important;
|
| 673 |
font-weight: 700 !important;
|
| 674 |
color: var(--text-primary) !important;
|
| 675 |
}
|
| 676 |
.examples-section .gr-samples-table td {
|
| 677 |
-
background: var(--background-primary) !important;
|
| 678 |
color: var(--text-primary) !important;
|
| 679 |
border-top: 1px solid var(--border-color) !important;
|
| 680 |
cursor: pointer !important;
|
| 681 |
transition: background 0.2s ease, transform 0.1s ease !important; /* Smooth transitions */
|
| 682 |
}
|
| 683 |
.examples-section .gr-samples-table tr:hover td {
|
| 684 |
-
background: var(--background-secondary) !important;
|
| 685 |
transform: translateX(5px); /* Subtle slide on hover */
|
| 686 |
}
|
| 687 |
/* Hide Gradio default elements for examples for cleaner look */
|
|
@@ -693,11 +697,12 @@ Answer:"""
|
|
| 693 |
|
| 694 |
/* Footer styling - centered text */
|
| 695 |
.app-footer-wrapper {
|
| 696 |
-
background: var(--background-secondary) !important;
|
| 697 |
border: 2px solid var(--border-color) !important;
|
| 698 |
border-radius: 12px !important;
|
| 699 |
padding: 1.75rem !important;
|
| 700 |
margin-top: 1.5rem !important;
|
|
|
|
| 701 |
text-align: center !important; /* Centered footer text */
|
| 702 |
}
|
| 703 |
.app-footer p {
|
|
@@ -752,6 +757,8 @@ Answer:"""
|
|
| 752 |
"""
|
| 753 |
|
| 754 |
# Using gr.Blocks with the specified theme and custom CSS
|
|
|
|
|
|
|
| 755 |
with gr.Blocks(theme="shivi/calm_seafoam", css=custom_css, title="Landlord-Tenant Rights Assistant") as demo:
|
| 756 |
# Header Section - uses gr.Group for distinct card-like styling
|
| 757 |
with gr.Group(elem_classes="app-header-wrapper"):
|
|
|
|
| 303 |
|
| 304 |
/* Root variables for consistent theming - adjusted for an inviting orange palette */
|
| 305 |
:root {
|
| 306 |
+
--primary-color: #FF8C00; /* Darker Orange for buttons/accents */
|
| 307 |
+
--primary-hover: #E07B00; /* Slightly darker orange for hover */
|
| 308 |
+
--background-primary: #FFF8F0; /* Very light cream/off-white for main cards, inputs, output area */
|
| 309 |
+
--background-secondary: #FDEBD9; /* Slightly darker cream for overall app background, table headers, placeholder */
|
| 310 |
--text-primary: #4A3C32; /* Dark warm brown/charcoal for main text */
|
| 311 |
--text-secondary: #8C7B6F; /* Muted warm gray/brown for secondary text */
|
| 312 |
--border-color: #DDC6AF; /* Light, desaturated orange-brown for borders */
|
| 313 |
+
--border-focus: #FF8C00; /* Focus color matches primary */
|
| 314 |
--shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
|
| 315 |
--shadow-md: 0 4px 10px rgba(0,0,0,0.1);
|
| 316 |
--shadow-lg: 0 10px 20px rgba(0,0,0,0.15);
|
|
|
|
| 367 |
left: 0;
|
| 368 |
width: 100%;
|
| 369 |
height: 100%;
|
| 370 |
+
background: radial-gradient(circle at top left, rgba(255,140,0,0.05) 0%, transparent 40%),
|
| 371 |
+
radial-gradient(circle at bottom right, rgba(255,140,0,0.05) 0%, transparent 40%);
|
| 372 |
z-index: 0;
|
| 373 |
opacity: 0.8;
|
| 374 |
pointer-events: none;
|
|
|
|
| 422 |
}
|
| 423 |
/* Card sections with clear boundaries (boundeyes) and subtle dynamic effects */
|
| 424 |
.dashboard-card-section {
|
| 425 |
+
background-color: var(--background-primary) !important; /* Explicitly set background */
|
| 426 |
border: 2px solid var(--border-color) !important; /* Distinct border */
|
| 427 |
border-radius: 12px !important;
|
| 428 |
padding: 1.75rem !important; /* Consistent padding */
|
|
|
|
| 454 |
line-height: 1.7 !important;
|
| 455 |
color: var(--text-primary) !important;
|
| 456 |
font-size: 1rem !important;
|
| 457 |
+
text-align: left !important; /* Ensure content text is left-aligned */
|
| 458 |
}
|
| 459 |
.dashboard-card-section strong {
|
| 460 |
color: var(--primary-color) !important; /* Highlight strong text with primary color */
|
|
|
|
| 470 |
.gradio-dropdown .primary-wrap, /* Target dropdown wrapper */
|
| 471 |
.gradio-dropdown .scroll-hide /* Target dropdown list container for consistency */
|
| 472 |
{
|
| 473 |
+
background-color: var(--background-primary) !important; /* Explicitly set background to primary cream */
|
| 474 |
border: 2px solid var(--border-color) !important; /* Clear border */
|
| 475 |
border-radius: 8px !important;
|
| 476 |
padding: 0.85rem 1rem !important; /* Slightly more padding */
|
| 477 |
font-size: 0.98rem !important;
|
| 478 |
font-family: 'Inter', sans-serif !important;
|
| 479 |
+
color: var(--text-primary) !important; /* Text color inside inputs */
|
| 480 |
transition: border-color 0.2s ease, box-shadow 0.2s ease !important; /* Smooth transitions */
|
| 481 |
box-shadow: var(--shadow-sm) !important;
|
| 482 |
}
|
|
|
|
| 486 |
.gradio-dropdown .primary-wrap.focused { /* Apply focus style to dropdown wrap */
|
| 487 |
outline: none !important;
|
| 488 |
border-color: var(--border-focus) !important; /* Distinct border on focus */
|
| 489 |
+
box-shadow: 0 0 0 4px rgba(255, 140, 0, 0.2) !important; /* Broader, softer glow on focus */
|
| 490 |
}
|
| 491 |
|
| 492 |
/* Label styling for better readability */
|
|
|
|
| 533 |
text-align: center !important; /* Ensure button text is centered */
|
| 534 |
}
|
| 535 |
.gr-button-primary {
|
| 536 |
+
background-color: var(--primary-color) !important; /* Explicitly set background */
|
| 537 |
color: white !important;
|
| 538 |
box-shadow: var(--shadow-sm) !important;
|
| 539 |
}
|
| 540 |
.gr-button-primary:hover {
|
| 541 |
+
background-color: var(--primary-hover) !important; /* Explicitly set background */
|
| 542 |
box-shadow: var(--shadow-md) !important;
|
| 543 |
transform: translateY(-2px) !important; /* Subtle lift effect on hover */
|
| 544 |
}
|
|
|
|
| 547 |
box-shadow: none !important;
|
| 548 |
}
|
| 549 |
.gr-button-secondary {
|
| 550 |
+
background-color: transparent !important; /* Explicitly set background */
|
| 551 |
color: var(--text-primary) !important;
|
| 552 |
border-color: var(--border-color) !important;
|
| 553 |
}
|
| 554 |
.gr-button-secondary:hover {
|
| 555 |
+
background-color: var(--background-secondary) !important; /* Explicitly set background */
|
| 556 |
border-color: var(--primary-color) !important;
|
| 557 |
transform: translateY(-2px) !important;
|
| 558 |
}
|
|
|
|
| 563 |
|
| 564 |
/* Output styling with clear boundaries (boundeyes are clear) and dynamic fade-in */
|
| 565 |
.output-content-wrapper {
|
| 566 |
+
background-color: var(--background-primary) !important; /* Explicitly set background */
|
| 567 |
border: 2px solid var(--border-color) !important; /* Clear border */
|
| 568 |
border-radius: 8px !important;
|
| 569 |
padding: 1.5rem !important;
|
|
|
|
| 599 |
display: flex !important;
|
| 600 |
align-items: center !important;
|
| 601 |
gap: 0.6rem !important;
|
| 602 |
+
text-align: left !important; /* Ensure header itself is not affected by parent centering */
|
| 603 |
+
width: 100%; /* Take full width */
|
| 604 |
+
justify-content: flex-start; /* Align content to the start */
|
| 605 |
}
|
| 606 |
.response-icon {
|
| 607 |
font-size: 1.5rem !important;
|
|
|
|
| 614 |
}
|
| 615 |
/* Error message styling */
|
| 616 |
.error-message {
|
| 617 |
+
background-color: var(--error-bg) !important; /* Explicitly set background */
|
| 618 |
border: 2px solid var(--error-border) !important;
|
| 619 |
color: var(--error-text) !important;
|
| 620 |
padding: 1.25rem !important;
|
|
|
|
| 646 |
}
|
| 647 |
/* Placeholder styling for empty output */
|
| 648 |
.placeholder {
|
| 649 |
+
background-color: var(--background-secondary) !important; /* Explicitly set background */
|
| 650 |
border: 2px dashed var(--border-color) !important;
|
| 651 |
border-radius: 8px !important;
|
| 652 |
padding: 2.5rem 1.5rem !important;
|
| 653 |
+
text-align: center !important; /* Ensure placeholder text is centered */
|
| 654 |
color: var(--text-secondary) !important;
|
| 655 |
font-style: italic !important;
|
| 656 |
font-size: 1.1rem !important;
|
|
|
|
| 673 |
text-align: left !important; /* Ensure example text is left-aligned */
|
| 674 |
}
|
| 675 |
.examples-section .gr-samples-table th {
|
| 676 |
+
background-color: var(--background-secondary) !important; /* Explicitly set background */
|
| 677 |
font-weight: 700 !important;
|
| 678 |
color: var(--text-primary) !important;
|
| 679 |
}
|
| 680 |
.examples-section .gr-samples-table td {
|
| 681 |
+
background-color: var(--background-primary) !important; /* Explicitly set background */
|
| 682 |
color: var(--text-primary) !important;
|
| 683 |
border-top: 1px solid var(--border-color) !important;
|
| 684 |
cursor: pointer !important;
|
| 685 |
transition: background 0.2s ease, transform 0.1s ease !important; /* Smooth transitions */
|
| 686 |
}
|
| 687 |
.examples-section .gr-samples-table tr:hover td {
|
| 688 |
+
background-color: var(--background-secondary) !important; /* Explicitly set background */
|
| 689 |
transform: translateX(5px); /* Subtle slide on hover */
|
| 690 |
}
|
| 691 |
/* Hide Gradio default elements for examples for cleaner look */
|
|
|
|
| 697 |
|
| 698 |
/* Footer styling - centered text */
|
| 699 |
.app-footer-wrapper {
|
| 700 |
+
background-color: var(--background-secondary) !important; /* Explicitly set background */
|
| 701 |
border: 2px solid var(--border-color) !important;
|
| 702 |
border-radius: 12px !important;
|
| 703 |
padding: 1.75rem !important;
|
| 704 |
margin-top: 1.5rem !important;
|
| 705 |
+
margin-bottom: 1.5rem !important; /* Ensures space at the very bottom before the container padding */
|
| 706 |
text-align: center !important; /* Centered footer text */
|
| 707 |
}
|
| 708 |
.app-footer p {
|
|
|
|
| 757 |
"""
|
| 758 |
|
| 759 |
# Using gr.Blocks with the specified theme and custom CSS
|
| 760 |
+
# Note: While a theme is specified, most stylistic aspects are overridden by custom_css.
|
| 761 |
+
# This keeps the underlying Gradio structure but allows full visual control.
|
| 762 |
with gr.Blocks(theme="shivi/calm_seafoam", css=custom_css, title="Landlord-Tenant Rights Assistant") as demo:
|
| 763 |
# Header Section - uses gr.Group for distinct card-like styling
|
| 764 |
with gr.Group(elem_classes="app-header-wrapper"):
|