Nischal Subedi
commited on
Commit
·
82b0565
1
Parent(s):
8ebc2da
UI update
Browse files
app.py
CHANGED
@@ -455,12 +455,12 @@ Answer:"""
|
|
455 |
}
|
456 |
|
457 |
/* NEW: Class for the solid color title bar within each card */
|
458 |
-
.section-title-gradient-bar {
|
459 |
background-color: var(--background-secondary) !important; /* Solid warm peach/cream */
|
460 |
padding: 1.25rem 1.75rem !important; /* Inner padding for the title bar */
|
461 |
border-top-left-radius: 10px !important; /* Match parent's border radius */
|
462 |
border-top-right-radius: 10px !important;
|
463 |
-
margin-bottom: 1rem !important; /*
|
464 |
text-align: center !important; /* Ensure content inside this bar is centered */
|
465 |
box-sizing: border-box; /* Include padding in width */
|
466 |
width: 100%; /* Ensure it spans full width */
|
@@ -473,7 +473,7 @@ Answer:"""
|
|
473 |
font-weight: 700 !important; /* Bolder */
|
474 |
color: var(--text-primary) !important;
|
475 |
margin: 0 !important; /* No margin on h3 itself as parent handles spacing */
|
476 |
-
padding-bottom: 0.
|
477 |
border-bottom: 2px solid var(--border-color) !important; /* Underline effect */
|
478 |
line-height: 1.1 !important; /* Ensure line height does not add extra space */
|
479 |
display: inline-block !important; /* Allow centering within text-align: center of parent */
|
@@ -506,7 +506,7 @@ Answer:"""
|
|
506 |
/* Overrides for common Gradio internal elements that might have default backgrounds */
|
507 |
/* These ensure transparency or explicit primary background for common Gradio containers */
|
508 |
.gr-block, .gr-box, .gr-prose, .gr-form, .gr-panel, .gr-columns, .gr-column,
|
509 |
-
.gradio-html, .gradio-markdown {
|
510 |
background-color: transparent !important;
|
511 |
color: var(--text-primary) !important; /* Ensure text color is consistent */
|
512 |
/* Ensure text wrapping for markdown as well */
|
@@ -518,7 +518,6 @@ Answer:"""
|
|
518 |
|
519 |
/* Improved input styling with clear boundaries and focus */
|
520 |
.gradio-textbox {
|
521 |
-
background-color: transparent !important; /* Ensure parent container is transparent */
|
522 |
margin-bottom: 0.75rem !important;
|
523 |
}
|
524 |
/* Target the actual input elements for background color */
|
@@ -548,7 +547,6 @@ Answer:"""
|
|
548 |
|
549 |
/* Styling for the radio button group (state selection) */
|
550 |
.gradio-radio {
|
551 |
-
background-color: transparent !important; /* Ensure parent container is transparent */
|
552 |
padding: 0 !important; /* Remove any default padding */
|
553 |
margin-top: 1rem !important; /* Add a little space above */
|
554 |
}
|
@@ -845,11 +843,11 @@ Answer:"""
|
|
845 |
}
|
846 |
.app-footer a {
|
847 |
color: var(--primary-color) !important;
|
848 |
-
text-decoration:
|
849 |
font-weight: 600 !important;
|
850 |
}
|
851 |
.app-footer a:hover {
|
852 |
-
text-decoration:
|
853 |
}
|
854 |
|
855 |
/* Responsive design for smaller screens */
|
@@ -912,7 +910,7 @@ Answer:"""
|
|
912 |
|
913 |
# How This Assistant Works Box (formerly Welcome & Disclaimer)
|
914 |
with gr.Group(elem_classes="dashboard-card-section"):
|
915 |
-
# Title bar with
|
916 |
gr.Markdown("<h3 class='section-title'>How This Assistant Works</h3>", elem_classes="full-width-center section-title-gradient-bar")
|
917 |
# Content area with pure primary background
|
918 |
with gr.Column(elem_classes="dashboard-card-content-area"): # New wrapper for content area
|
@@ -924,7 +922,7 @@ Answer:"""
|
|
924 |
|
925 |
# OpenAI API Key Input Card
|
926 |
with gr.Group(elem_classes="dashboard-card-section"):
|
927 |
-
# Title bar with
|
928 |
gr.Markdown("<h3 class='section-title'>OpenAI API Key</h3>", elem_classes="full-width-center section-title-gradient-bar")
|
929 |
# Content area with pure primary background
|
930 |
with gr.Column(elem_classes="dashboard-card-content-area"): # New wrapper for content area
|
@@ -935,7 +933,7 @@ Answer:"""
|
|
935 |
lines=1,
|
936 |
elem_classes=["input-field-group"] # Custom class for input styling
|
937 |
)
|
938 |
-
# Separate Markdown for the clickable info link
|
939 |
gr.Markdown(
|
940 |
"Required to process your query. Get one from OpenAI: [platform.openai.com/api-keys](https://platform.openai.com/api-keys)",
|
941 |
elem_classes="gr-prose" # Reuse Gradio's info text class for styling
|
@@ -943,7 +941,7 @@ Answer:"""
|
|
943 |
|
944 |
# Query Input and State Selection Card
|
945 |
with gr.Group(elem_classes="dashboard-card-section"):
|
946 |
-
# Title bar with
|
947 |
gr.Markdown("<h3 class='section-title'>Ask Your Question</h3>", elem_classes="full-width-center section-title-gradient-bar")
|
948 |
# Content area with pure primary background
|
949 |
with gr.Column(elem_classes="dashboard-card-content-area"): # New wrapper for content area
|
@@ -971,7 +969,7 @@ Answer:"""
|
|
971 |
|
972 |
# Output Display Card - Using gr.HTML for better animation control
|
973 |
with gr.Group(elem_classes="dashboard-card-section"):
|
974 |
-
# Title bar with
|
975 |
gr.Markdown("<h3 class='section-title'>Legal Assistant's Response</h3>", elem_classes="full-width-center section-title-gradient-bar")
|
976 |
# Content area with pure primary background
|
977 |
with gr.Column(elem_classes="dashboard-card-content-area"): # New wrapper for content area
|
@@ -982,7 +980,7 @@ Answer:"""
|
|
982 |
|
983 |
# Example Questions Section
|
984 |
with gr.Group(elem_classes="dashboard-card-section examples-section"):
|
985 |
-
# Title bar with
|
986 |
gr.Markdown("<h3 class='section-title'>Example Questions</h3>", elem_classes="full-width-center section-title-gradient-bar")
|
987 |
# Content area with pure primary background
|
988 |
with gr.Column(elem_classes="dashboard-card-content-area"): # New wrapper for content area
|
@@ -998,7 +996,7 @@ Answer:"""
|
|
998 |
|
999 |
# Footer Section - contains disclaimer and developer info (now including the full disclaimer)
|
1000 |
with gr.Group(elem_classes="app-footer-wrapper"):
|
1001 |
-
#
|
1002 |
gr.Markdown(
|
1003 |
"""
|
1004 |
<p>**Disclaimer:** This tool is for informational purposes only and does not constitute legal advice. For specific legal guidance, always consult with a licensed attorney in your jurisdiction.</p>
|
|
|
455 |
}
|
456 |
|
457 |
/* NEW: Class for the solid color title bar within each card */
|
458 |
+
.section-title-gradient-bar {
|
459 |
background-color: var(--background-secondary) !important; /* Solid warm peach/cream */
|
460 |
padding: 1.25rem 1.75rem !important; /* Inner padding for the title bar */
|
461 |
border-top-left-radius: 10px !important; /* Match parent's border radius */
|
462 |
border-top-right-radius: 10px !important;
|
463 |
+
margin-bottom: 1rem !important; /* Space below the title bar */
|
464 |
text-align: center !important; /* Ensure content inside this bar is centered */
|
465 |
box-sizing: border-box; /* Include padding in width */
|
466 |
width: 100%; /* Ensure it spans full width */
|
|
|
473 |
font-weight: 700 !important; /* Bolder */
|
474 |
color: var(--text-primary) !important;
|
475 |
margin: 0 !important; /* No margin on h3 itself as parent handles spacing */
|
476 |
+
padding-bottom: 0.1rem !important; /* REDUCED further to bring text closer to border */
|
477 |
border-bottom: 2px solid var(--border-color) !important; /* Underline effect */
|
478 |
line-height: 1.1 !important; /* Ensure line height does not add extra space */
|
479 |
display: inline-block !important; /* Allow centering within text-align: center of parent */
|
|
|
506 |
/* Overrides for common Gradio internal elements that might have default backgrounds */
|
507 |
/* These ensure transparency or explicit primary background for common Gradio containers */
|
508 |
.gr-block, .gr-box, .gr-prose, .gr-form, .gr-panel, .gr-columns, .gr-column,
|
509 |
+
.gradio-html, .gradio-markdown, .gradio-textbox, .gradio-radio, .gradio-button {
|
510 |
background-color: transparent !important;
|
511 |
color: var(--text-primary) !important; /* Ensure text color is consistent */
|
512 |
/* Ensure text wrapping for markdown as well */
|
|
|
518 |
|
519 |
/* Improved input styling with clear boundaries and focus */
|
520 |
.gradio-textbox {
|
|
|
521 |
margin-bottom: 0.75rem !important;
|
522 |
}
|
523 |
/* Target the actual input elements for background color */
|
|
|
547 |
|
548 |
/* Styling for the radio button group (state selection) */
|
549 |
.gradio-radio {
|
|
|
550 |
padding: 0 !important; /* Remove any default padding */
|
551 |
margin-top: 1rem !important; /* Add a little space above */
|
552 |
}
|
|
|
843 |
}
|
844 |
.app-footer a {
|
845 |
color: var(--primary-color) !important;
|
846 |
+
text-decoration: underline !important; /* Ensure links are underlined */
|
847 |
font-weight: 600 !important;
|
848 |
}
|
849 |
.app-footer a:hover {
|
850 |
+
text-decoration: none !important; /* Remove underline on hover for subtle effect */
|
851 |
}
|
852 |
|
853 |
/* Responsive design for smaller screens */
|
|
|
910 |
|
911 |
# How This Assistant Works Box (formerly Welcome & Disclaimer)
|
912 |
with gr.Group(elem_classes="dashboard-card-section"):
|
913 |
+
# Title bar with solid warm peach/cream background
|
914 |
gr.Markdown("<h3 class='section-title'>How This Assistant Works</h3>", elem_classes="full-width-center section-title-gradient-bar")
|
915 |
# Content area with pure primary background
|
916 |
with gr.Column(elem_classes="dashboard-card-content-area"): # New wrapper for content area
|
|
|
922 |
|
923 |
# OpenAI API Key Input Card
|
924 |
with gr.Group(elem_classes="dashboard-card-section"):
|
925 |
+
# Title bar with solid warm peach/cream background
|
926 |
gr.Markdown("<h3 class='section-title'>OpenAI API Key</h3>", elem_classes="full-width-center section-title-gradient-bar")
|
927 |
# Content area with pure primary background
|
928 |
with gr.Column(elem_classes="dashboard-card-content-area"): # New wrapper for content area
|
|
|
933 |
lines=1,
|
934 |
elem_classes=["input-field-group"] # Custom class for input styling
|
935 |
)
|
936 |
+
# Separate Markdown for the clickable info link, using standard Markdown link syntax
|
937 |
gr.Markdown(
|
938 |
"Required to process your query. Get one from OpenAI: [platform.openai.com/api-keys](https://platform.openai.com/api-keys)",
|
939 |
elem_classes="gr-prose" # Reuse Gradio's info text class for styling
|
|
|
941 |
|
942 |
# Query Input and State Selection Card
|
943 |
with gr.Group(elem_classes="dashboard-card-section"):
|
944 |
+
# Title bar with solid warm peach/cream background
|
945 |
gr.Markdown("<h3 class='section-title'>Ask Your Question</h3>", elem_classes="full-width-center section-title-gradient-bar")
|
946 |
# Content area with pure primary background
|
947 |
with gr.Column(elem_classes="dashboard-card-content-area"): # New wrapper for content area
|
|
|
969 |
|
970 |
# Output Display Card - Using gr.HTML for better animation control
|
971 |
with gr.Group(elem_classes="dashboard-card-section"):
|
972 |
+
# Title bar with solid warm peach/cream background
|
973 |
gr.Markdown("<h3 class='section-title'>Legal Assistant's Response</h3>", elem_classes="full-width-center section-title-gradient-bar")
|
974 |
# Content area with pure primary background
|
975 |
with gr.Column(elem_classes="dashboard-card-content-area"): # New wrapper for content area
|
|
|
980 |
|
981 |
# Example Questions Section
|
982 |
with gr.Group(elem_classes="dashboard-card-section examples-section"):
|
983 |
+
# Title bar with solid warm peach/cream background
|
984 |
gr.Markdown("<h3 class='section-title'>Example Questions</h3>", elem_classes="full-width-center section-title-gradient-bar")
|
985 |
# Content area with pure primary background
|
986 |
with gr.Column(elem_classes="dashboard-card-content-area"): # New wrapper for content area
|
|
|
996 |
|
997 |
# Footer Section - contains disclaimer and developer info (now including the full disclaimer)
|
998 |
with gr.Group(elem_classes="app-footer-wrapper"):
|
999 |
+
# Using paragraph tags for proper text wrapping and bolding in Markdown
|
1000 |
gr.Markdown(
|
1001 |
"""
|
1002 |
<p>**Disclaimer:** This tool is for informational purposes only and does not constitute legal advice. For specific legal guidance, always consult with a licensed attorney in your jurisdiction.</p>
|