Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,7 +13,6 @@ import os
|
|
| 13 |
# ============================================
|
| 14 |
# CLEAN RESPONSIVE CSS - UPDATED WITH DARKER GRAY BACKGROUND
|
| 15 |
# ============================================
|
| 16 |
-
|
| 17 |
custom_css = """
|
| 18 |
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
|
| 19 |
|
|
@@ -25,6 +24,10 @@ custom_css = """
|
|
| 25 |
--text-main: #111827;
|
| 26 |
}
|
| 27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
body, .gradio-container {
|
| 29 |
font-family: 'Inter', sans-serif !important;
|
| 30 |
background-color: #e5e7eb !important;
|
|
@@ -50,42 +53,42 @@ h1 span {
|
|
| 50 |
-webkit-text-fill-color: transparent;
|
| 51 |
}
|
| 52 |
|
| 53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
.metric-value {
|
| 55 |
font-size: 2rem !important;
|
| 56 |
font-weight: 700 !important;
|
| 57 |
color: var(--primary) !important;
|
| 58 |
}
|
| 59 |
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
|
| 64 |
-
|
| 65 |
-
color:
|
|
|
|
| 66 |
}
|
| 67 |
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
color: #2563eb !important;
|
| 71 |
-
font-weight: 500 !important;
|
| 72 |
}
|
| 73 |
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
color: #ffffff !important;
|
| 77 |
-
font-size: 0.9rem !important;
|
| 78 |
-
margin-top: 8px !important;
|
| 79 |
-
margin-bottom: 8px !important;
|
| 80 |
-
font-style: italic !important;
|
| 81 |
-
background: #1f2937 !important;
|
| 82 |
-
padding: 8px 12px !important;
|
| 83 |
-
border-radius: 6px !important;
|
| 84 |
-
border-left: 4px solid var(--primary) !important;
|
| 85 |
-
font-weight: 500 !important;
|
| 86 |
}
|
| 87 |
|
| 88 |
-
/*
|
|
|
|
|
|
|
|
|
|
| 89 |
.tab-nav {
|
| 90 |
background-color: #f3f4f6 !important;
|
| 91 |
border-radius: 8px !important;
|
|
@@ -105,40 +108,27 @@ div:has(.metric-value) strong {
|
|
| 105 |
color: white !important;
|
| 106 |
}
|
| 107 |
|
| 108 |
-
/*
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
}
|
| 112 |
-
|
| 113 |
-
.white-card label {
|
| 114 |
-
color: var(--primary) !important;
|
| 115 |
-
font-weight: 500 !important;
|
| 116 |
-
}
|
| 117 |
-
|
| 118 |
-
/* Button text color - PURE WHITE for all buttons */
|
| 119 |
-
button, .gr-button, .lg.primary, button.variant-primary, .gr-button-primary,
|
| 120 |
-
button.variant-secondary, .gr-button-secondary, button.secondary {
|
| 121 |
-
color: #ffffff !important;
|
| 122 |
-
font-weight: 600 !important;
|
| 123 |
-
}
|
| 124 |
|
| 125 |
-
|
| 126 |
-
button:hover, .gr-button:hover, button:focus, .gr-button:focus {
|
| 127 |
color: #ffffff !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 128 |
}
|
| 129 |
|
| 130 |
-
/*
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
}
|
| 134 |
-
|
| 135 |
-
/* Secondary button background - unified */
|
| 136 |
-
button.variant-secondary, .gr-button-secondary, button.secondary {
|
| 137 |
-
background-color: #6b7280 !important;
|
| 138 |
-
}
|
| 139 |
|
| 140 |
-
/* ===== DROPDOWN STYLING ===== */
|
| 141 |
-
/* Main dropdown button - keep dark with white text */
|
| 142 |
.gr-dropdown, .gr-dropdown select, select {
|
| 143 |
background-color: #374151 !important;
|
| 144 |
color: #ffffff !important;
|
|
@@ -146,74 +136,81 @@ button.variant-secondary, .gr-button-secondary, button.secondary {
|
|
| 146 |
border-radius: 6px !important;
|
| 147 |
}
|
| 148 |
|
| 149 |
-
/* =====
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 150 |
|
| 151 |
-
/*
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
body .gradio-container div[role="listbox"],
|
| 155 |
-
body .gradio-container div[role="menu"] {
|
| 156 |
-
background-color: #f3f4f6 !important; /* LIGHT GRAY */
|
| 157 |
border: 1px solid #d1d5db !important;
|
| 158 |
-
box-shadow: 0
|
|
|
|
|
|
|
| 159 |
}
|
| 160 |
|
| 161 |
-
/*
|
| 162 |
-
|
| 163 |
background-color: #f3f4f6 !important;
|
| 164 |
color: #111827 !important;
|
|
|
|
| 165 |
}
|
| 166 |
|
| 167 |
/* Hover state */
|
| 168 |
-
|
| 169 |
background-color: #e5e7eb !important;
|
| 170 |
color: #111827 !important;
|
| 171 |
}
|
| 172 |
|
| 173 |
-
/* Selected option */
|
| 174 |
-
|
|
|
|
|
|
|
| 175 |
background-color: #2563eb !important;
|
| 176 |
color: #ffffff !important;
|
| 177 |
}
|
| 178 |
|
| 179 |
-
/*
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
select option:hover,
|
| 184 |
-
div[role="option"]:hover {
|
| 185 |
-
background-color: #f3f4f6 !important; /* Light gray on hover */
|
| 186 |
-
color: #111827 !important;
|
| 187 |
}
|
| 188 |
-
|
| 189 |
-
/*
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
background-color:
|
| 195 |
-
color:
|
|
|
|
|
|
|
|
|
|
| 196 |
}
|
| 197 |
|
| 198 |
-
/* ===== DROPDOWN POPUP - LIGHT GRAY + DARK TEXT ===== */
|
| 199 |
|
| 200 |
-
body div[role="listbox"] {
|
| 201 |
-
background: #f3f4f6 !important;
|
| 202 |
-
border: 1px solid #d1d5db !important;
|
| 203 |
-
}
|
| 204 |
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
}
|
| 209 |
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
color: #111827 !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 213 |
}
|
| 214 |
|
| 215 |
-
|
| 216 |
-
|
|
|
|
| 217 |
color: #ffffff !important;
|
| 218 |
}
|
| 219 |
"""
|
|
@@ -587,7 +584,7 @@ def create_interface():
|
|
| 587 |
with gr.Blocks(
|
| 588 |
title="PaperSearchPro",
|
| 589 |
css=custom_css,
|
| 590 |
-
theme=gr.themes.
|
| 591 |
primary_hue="blue",
|
| 592 |
neutral_hue="gray"
|
| 593 |
)) as demo:
|
|
|
|
| 13 |
# ============================================
|
| 14 |
# CLEAN RESPONSIVE CSS - UPDATED WITH DARKER GRAY BACKGROUND
|
| 15 |
# ============================================
|
|
|
|
| 16 |
custom_css = """
|
| 17 |
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
|
| 18 |
|
|
|
|
| 24 |
--text-main: #111827;
|
| 25 |
}
|
| 26 |
|
| 27 |
+
/* ================================================= */
|
| 28 |
+
/* GENERAL LAYOUT */
|
| 29 |
+
/* ================================================= */
|
| 30 |
+
|
| 31 |
body, .gradio-container {
|
| 32 |
font-family: 'Inter', sans-serif !important;
|
| 33 |
background-color: #e5e7eb !important;
|
|
|
|
| 53 |
-webkit-text-fill-color: transparent;
|
| 54 |
}
|
| 55 |
|
| 56 |
+
.subtitle-text {
|
| 57 |
+
color: #2563eb !important;
|
| 58 |
+
font-weight: 500 !important;
|
| 59 |
+
}
|
| 60 |
+
|
| 61 |
+
/* ================================================= */
|
| 62 |
+
/* METRICS */
|
| 63 |
+
/* ================================================= */
|
| 64 |
+
|
| 65 |
.metric-value {
|
| 66 |
font-size: 2rem !important;
|
| 67 |
font-weight: 700 !important;
|
| 68 |
color: var(--primary) !important;
|
| 69 |
}
|
| 70 |
|
| 71 |
+
/* ================================================= */
|
| 72 |
+
/* BUTTONS */
|
| 73 |
+
/* ================================================= */
|
| 74 |
|
| 75 |
+
button, .gr-button {
|
| 76 |
+
color: #ffffff !important;
|
| 77 |
+
font-weight: 600 !important;
|
| 78 |
}
|
| 79 |
|
| 80 |
+
button.variant-primary {
|
| 81 |
+
background-color: var(--primary) !important;
|
|
|
|
|
|
|
| 82 |
}
|
| 83 |
|
| 84 |
+
button.variant-secondary {
|
| 85 |
+
background-color: #6b7280 !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
}
|
| 87 |
|
| 88 |
+
/* ================================================= */
|
| 89 |
+
/* TABS */
|
| 90 |
+
/* ================================================= */
|
| 91 |
+
|
| 92 |
.tab-nav {
|
| 93 |
background-color: #f3f4f6 !important;
|
| 94 |
border-radius: 8px !important;
|
|
|
|
| 108 |
color: white !important;
|
| 109 |
}
|
| 110 |
|
| 111 |
+
/* ================================================= */
|
| 112 |
+
/* SLIDER COMMENT */
|
| 113 |
+
/* ================================================= */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 114 |
|
| 115 |
+
.slider-comment {
|
|
|
|
| 116 |
color: #ffffff !important;
|
| 117 |
+
font-size: 0.9rem !important;
|
| 118 |
+
margin-top: 8px !important;
|
| 119 |
+
margin-bottom: 8px !important;
|
| 120 |
+
font-style: italic !important;
|
| 121 |
+
background: #1f2937 !important;
|
| 122 |
+
padding: 8px 12px !important;
|
| 123 |
+
border-radius: 6px !important;
|
| 124 |
+
border-left: 4px solid var(--primary) !important;
|
| 125 |
+
font-weight: 500 !important;
|
| 126 |
}
|
| 127 |
|
| 128 |
+
/* ================================================= */
|
| 129 |
+
/* DROPDOWN BUTTON (Closed State) */
|
| 130 |
+
/* ================================================= */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 131 |
|
|
|
|
|
|
|
| 132 |
.gr-dropdown, .gr-dropdown select, select {
|
| 133 |
background-color: #374151 !important;
|
| 134 |
color: #ffffff !important;
|
|
|
|
| 136 |
border-radius: 6px !important;
|
| 137 |
}
|
| 138 |
|
| 139 |
+
/* ================================================= */
|
| 140 |
+
/* PERFECT DROPDOWN POPUP FIX (NO BLACK / NO WHITE) */
|
| 141 |
+
/* ================================================= */
|
| 142 |
+
|
| 143 |
+
/* Target HeadlessUI portal */
|
| 144 |
+
div[id^="headlessui-portal"] {
|
| 145 |
+
background: transparent !important;
|
| 146 |
+
}
|
| 147 |
|
| 148 |
+
/* Dropdown container */
|
| 149 |
+
div[id^="headlessui-portal"] div[role="listbox"] {
|
| 150 |
+
background-color: #f3f4f6 !important;
|
|
|
|
|
|
|
|
|
|
| 151 |
border: 1px solid #d1d5db !important;
|
| 152 |
+
box-shadow: 0 8px 24px rgba(0,0,0,0.15) !important;
|
| 153 |
+
border-radius: 8px !important;
|
| 154 |
+
overflow: hidden !important;
|
| 155 |
}
|
| 156 |
|
| 157 |
+
/* All options */
|
| 158 |
+
div[id^="headlessui-portal"] div[role="option"] {
|
| 159 |
background-color: #f3f4f6 !important;
|
| 160 |
color: #111827 !important;
|
| 161 |
+
padding: 10px 14px !important;
|
| 162 |
}
|
| 163 |
|
| 164 |
/* Hover state */
|
| 165 |
+
div[id^="headlessui-portal"] div[role="option"]:hover {
|
| 166 |
background-color: #e5e7eb !important;
|
| 167 |
color: #111827 !important;
|
| 168 |
}
|
| 169 |
|
| 170 |
+
/* Selected option (strong override) */
|
| 171 |
+
div[id^="headlessui-portal"] div[role="option"][aria-selected="true"],
|
| 172 |
+
div[id^="headlessui-portal"] div[role="option"].selected,
|
| 173 |
+
div[id^="headlessui-portal"] div[role="option"][data-headlessui-state~="selected"] {
|
| 174 |
background-color: #2563eb !important;
|
| 175 |
color: #ffffff !important;
|
| 176 |
}
|
| 177 |
|
| 178 |
+
/* Fix checkmark icon color */
|
| 179 |
+
div[id^="headlessui-portal"] svg {
|
| 180 |
+
color: #ffffff !important;
|
| 181 |
+
fill: #ffffff !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 182 |
}
|
| 183 |
+
/* ================================================= */
|
| 184 |
+
/* METRIC LABEL BLACK BACKGROUND */
|
| 185 |
+
/* ================================================= */
|
| 186 |
+
|
| 187 |
+
.metric-label {
|
| 188 |
+
display: inline-block !important;
|
| 189 |
+
background-color: #111827 !important; /* Black */
|
| 190 |
+
color: #ffffff !important; /* White text */
|
| 191 |
+
padding: 6px 12px !important;
|
| 192 |
+
border-radius: 6px !important;
|
| 193 |
+
font-weight: 600 !important;
|
| 194 |
}
|
| 195 |
|
|
|
|
| 196 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 197 |
|
| 198 |
+
/* ================================================= */
|
| 199 |
+
/* METRIC VALUE BLACK BACKGROUND FIX */
|
| 200 |
+
/* ================================================= */
|
|
|
|
| 201 |
|
| 202 |
+
.metric-value {
|
| 203 |
+
display: inline-block !important;
|
| 204 |
+
background-color: #111827 !important; /* Black */
|
| 205 |
+
color: #ffffff !important; /* White text */
|
| 206 |
+
padding: 6px 12px !important;
|
| 207 |
+
border-radius: 6px !important;
|
| 208 |
+
font-weight: 700 !important;
|
| 209 |
}
|
| 210 |
|
| 211 |
+
/* Remove default white background from strong */
|
| 212 |
+
.metric-value strong {
|
| 213 |
+
background: transparent !important;
|
| 214 |
color: #ffffff !important;
|
| 215 |
}
|
| 216 |
"""
|
|
|
|
| 584 |
with gr.Blocks(
|
| 585 |
title="PaperSearchPro",
|
| 586 |
css=custom_css,
|
| 587 |
+
theme=gr.themes.Default(
|
| 588 |
primary_hue="blue",
|
| 589 |
neutral_hue="gray"
|
| 590 |
)) as demo:
|