Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
dd6e1b6
1
Parent(s):
937cf33
update
Browse files
app.py
CHANGED
|
@@ -832,114 +832,17 @@ def basic_get_scores_and_sources(
|
|
| 832 |
)
|
| 833 |
|
| 834 |
def load_custom_css():
|
| 835 |
-
"""Load CSS
|
| 836 |
-
|
| 837 |
-
|
| 838 |
-
.
|
| 839 |
-
|
| 840 |
-
|
| 841 |
-
|
| 842 |
-
|
| 843 |
-
|
| 844 |
-
|
| 845 |
-
|
| 846 |
-
margin: 2rem 0 !important;
|
| 847 |
-
}
|
| 848 |
-
|
| 849 |
-
.app-title .brand {
|
| 850 |
-
color: #333333 !important;
|
| 851 |
-
font-weight: 700 !important;
|
| 852 |
-
font-size: 3rem !important;
|
| 853 |
-
margin-right: 12px !important;
|
| 854 |
-
}
|
| 855 |
-
|
| 856 |
-
.app-title .subtitle {
|
| 857 |
-
color: #666666 !important;
|
| 858 |
-
font-weight: 400 !important;
|
| 859 |
-
font-size: 1.6rem !important;
|
| 860 |
-
display: block !important;
|
| 861 |
-
margin-top: 12px !important;
|
| 862 |
-
}
|
| 863 |
-
|
| 864 |
-
/* App description styling */
|
| 865 |
-
.app-description p {
|
| 866 |
-
font-size: 1.25rem !important;
|
| 867 |
-
color: #555555 !important;
|
| 868 |
-
line-height: 1.6 !important;
|
| 869 |
-
}
|
| 870 |
-
|
| 871 |
-
/* Feature highlights */
|
| 872 |
-
.feature-highlights {
|
| 873 |
-
font-size: 1.1rem !important;
|
| 874 |
-
color: #444444 !important;
|
| 875 |
-
line-height: 1.5 !important;
|
| 876 |
-
}
|
| 877 |
-
|
| 878 |
-
/* Example title */
|
| 879 |
-
.example-title {
|
| 880 |
-
text-align: center !important;
|
| 881 |
-
margin: 2rem 0 1rem 0 !important;
|
| 882 |
-
font-size: 1.5rem !important;
|
| 883 |
-
font-weight: 600 !important;
|
| 884 |
-
color: #333333 !important;
|
| 885 |
-
}
|
| 886 |
-
|
| 887 |
-
/* Example button container */
|
| 888 |
-
.example-button-container {
|
| 889 |
-
display: flex !important;
|
| 890 |
-
justify-content: center !important;
|
| 891 |
-
align-items: center !important;
|
| 892 |
-
gap: 1rem !important;
|
| 893 |
-
margin: 1rem 0 !important;
|
| 894 |
-
flex-wrap: wrap !important;
|
| 895 |
-
}
|
| 896 |
-
|
| 897 |
-
/* Example buttons */
|
| 898 |
-
.example-button button {
|
| 899 |
-
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
|
| 900 |
-
color: white !important;
|
| 901 |
-
border: none !important;
|
| 902 |
-
border-radius: 10px !important;
|
| 903 |
-
padding: 12px 20px !important;
|
| 904 |
-
font-size: 0.9rem !important;
|
| 905 |
-
font-weight: 600 !important;
|
| 906 |
-
cursor: pointer !important;
|
| 907 |
-
transition: all 0.3s ease !important;
|
| 908 |
-
box-shadow: 0 4px 15px rgba(0,0,0,0.1) !important;
|
| 909 |
-
min-width: 200px !important;
|
| 910 |
-
text-align: center !important;
|
| 911 |
-
}
|
| 912 |
-
|
| 913 |
-
.example-button button:hover {
|
| 914 |
-
transform: translateY(-2px) !important;
|
| 915 |
-
box-shadow: 0 6px 20px rgba(0,0,0,0.15) !important;
|
| 916 |
-
}
|
| 917 |
-
|
| 918 |
-
/* Responsive design */
|
| 919 |
-
@media (max-width: 768px) {
|
| 920 |
-
.gradio-container {
|
| 921 |
-
padding-left: 1rem !important;
|
| 922 |
-
padding-right: 1rem !important;
|
| 923 |
-
}
|
| 924 |
-
|
| 925 |
-
.app-title .brand {
|
| 926 |
-
font-size: 2rem !important;
|
| 927 |
-
}
|
| 928 |
-
|
| 929 |
-
.app-title .subtitle {
|
| 930 |
-
font-size: 1.2rem !important;
|
| 931 |
-
}
|
| 932 |
-
|
| 933 |
-
.example-button-container {
|
| 934 |
-
flex-direction: column !important;
|
| 935 |
-
}
|
| 936 |
-
|
| 937 |
-
.example-button button {
|
| 938 |
-
min-width: 100% !important;
|
| 939 |
-
}
|
| 940 |
-
}
|
| 941 |
-
"""
|
| 942 |
-
return css_content
|
| 943 |
|
| 944 |
# Load CSS from external file
|
| 945 |
custom_css = load_custom_css()
|
|
@@ -947,7 +850,7 @@ theme = gr.themes.Citrus(
|
|
| 947 |
text_size="lg",
|
| 948 |
spacing_size="md",
|
| 949 |
)
|
| 950 |
-
with gr.Blocks(theme=theme
|
| 951 |
gr.Markdown(f"# {APP_TITLE}")
|
| 952 |
gr.Markdown(APP_DESCRIPTION, elem_classes="app-description")
|
| 953 |
# gr.Markdown(NEW_TEXT, elem_classes="app-description-2")
|
|
|
|
| 832 |
)
|
| 833 |
|
| 834 |
def load_custom_css():
|
| 835 |
+
"""Load CSS from external file"""
|
| 836 |
+
try:
|
| 837 |
+
with open("assets/app_styles.css", "r") as f:
|
| 838 |
+
css_content = f.read()
|
| 839 |
+
return css_content
|
| 840 |
+
except FileNotFoundError:
|
| 841 |
+
print("Warning: CSS file not found, using minimal CSS")
|
| 842 |
+
return ""
|
| 843 |
+
except Exception as e:
|
| 844 |
+
print(f"Error loading CSS: {e}")
|
| 845 |
+
return ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 846 |
|
| 847 |
# Load CSS from external file
|
| 848 |
custom_css = load_custom_css()
|
|
|
|
| 850 |
text_size="lg",
|
| 851 |
spacing_size="md",
|
| 852 |
)
|
| 853 |
+
with gr.Blocks(theme=theme) as demo:
|
| 854 |
gr.Markdown(f"# {APP_TITLE}")
|
| 855 |
gr.Markdown(APP_DESCRIPTION, elem_classes="app-description")
|
| 856 |
# gr.Markdown(NEW_TEXT, elem_classes="app-description-2")
|