Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1138,11 +1138,11 @@ custom_css = """
|
|
1138 |
.question-grid {
|
1139 |
display: grid;
|
1140 |
grid-template-columns: 2fr 1fr;
|
1141 |
-
gap:
|
1142 |
align-items: center;
|
1143 |
-
padding:
|
1144 |
-
border-bottom: 1px solid #
|
1145 |
-
margin-bottom:
|
1146 |
}
|
1147 |
|
1148 |
.question-grid:last-child {
|
@@ -1150,36 +1150,60 @@ custom_css = """
|
|
1150 |
margin-bottom: 0;
|
1151 |
}
|
1152 |
|
|
|
1153 |
.question-text {
|
1154 |
-
font-size:
|
1155 |
-
color: #
|
1156 |
-
line-height: 1.
|
1157 |
-
margin: 0;
|
1158 |
-
padding-right:
|
|
|
|
|
1159 |
}
|
1160 |
|
1161 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1162 |
.gr-dropdown {
|
1163 |
border-radius: 6px;
|
1164 |
-
border:
|
1165 |
transition: border-color 0.3s ease;
|
1166 |
-
font-size:
|
|
|
|
|
1167 |
}
|
1168 |
|
1169 |
.gr-dropdown:focus {
|
1170 |
border-color: #667eea;
|
1171 |
-
box-shadow: 0 0 0
|
1172 |
}
|
1173 |
|
1174 |
/* Compact spacing */
|
1175 |
.question-section {
|
1176 |
-
margin-bottom:
|
1177 |
}
|
1178 |
|
1179 |
.question-section:last-child {
|
1180 |
margin-bottom: 0;
|
1181 |
}
|
1182 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1183 |
/* Progress animation */
|
1184 |
@keyframes pulse {
|
1185 |
0% { opacity: 1; }
|
@@ -1192,7 +1216,7 @@ custom_css = """
|
|
1192 |
}
|
1193 |
"""
|
1194 |
|
1195 |
-
# Updated Gradio Interface with
|
1196 |
with gr.Blocks(
|
1197 |
title="🐶 Enhanced AI Dog Health Analyzer",
|
1198 |
theme=gr.themes.Soft(),
|
@@ -1278,30 +1302,30 @@ with gr.Blocks(
|
|
1278 |
maximum=25
|
1279 |
)
|
1280 |
|
1281 |
-
# Right Column -
|
1282 |
with gr.Column(scale=1):
|
1283 |
gr.HTML("""
|
1284 |
<div class="questionnaire-grid">
|
1285 |
-
<h2 style="color: #
|
1286 |
📋 HRQOL Assessment
|
1287 |
</h2>
|
1288 |
-
<p style="text-align: center; color: #
|
1289 |
Complete all questions for accurate healthspan analysis
|
1290 |
</p>
|
1291 |
""")
|
1292 |
|
1293 |
hrqol_inputs = []
|
1294 |
|
1295 |
-
# Create compact grid layout
|
1296 |
with gr.Group(elem_classes=["question-section"]):
|
1297 |
for domain_key, domain_data in HRQOL_QUESTIONNAIRE.items():
|
1298 |
for i, question in enumerate(domain_data["questions"]):
|
1299 |
with gr.Row():
|
1300 |
with gr.Column(scale=2):
|
1301 |
gr.HTML(f"""
|
1302 |
-
<
|
1303 |
<strong>Q{len(hrqol_inputs)+1}:</strong> {question["text"]}
|
1304 |
-
</
|
1305 |
""")
|
1306 |
with gr.Column(scale=1):
|
1307 |
dropdown = gr.Dropdown(
|
|
|
1138 |
.question-grid {
|
1139 |
display: grid;
|
1140 |
grid-template-columns: 2fr 1fr;
|
1141 |
+
gap: 20px;
|
1142 |
align-items: center;
|
1143 |
+
padding: 15px 0;
|
1144 |
+
border-bottom: 1px solid #e8ecef;
|
1145 |
+
margin-bottom: 10px;
|
1146 |
}
|
1147 |
|
1148 |
.question-grid:last-child {
|
|
|
1150 |
margin-bottom: 0;
|
1151 |
}
|
1152 |
|
1153 |
+
/* IMPROVED TEXT READABILITY */
|
1154 |
.question-text {
|
1155 |
+
font-size: 16px !important;
|
1156 |
+
color: #2c3e50 !important;
|
1157 |
+
line-height: 1.6 !important;
|
1158 |
+
margin: 0 !important;
|
1159 |
+
padding-right: 20px !important;
|
1160 |
+
font-weight: 500 !important;
|
1161 |
+
letter-spacing: 0.3px !important;
|
1162 |
}
|
1163 |
|
1164 |
+
.question-text strong {
|
1165 |
+
color: #667eea !important;
|
1166 |
+
font-weight: 600 !important;
|
1167 |
+
font-size: 16px !important;
|
1168 |
+
}
|
1169 |
+
|
1170 |
+
/* Dropdown styling with better readability */
|
1171 |
.gr-dropdown {
|
1172 |
border-radius: 6px;
|
1173 |
+
border: 2px solid #e0e6ed;
|
1174 |
transition: border-color 0.3s ease;
|
1175 |
+
font-size: 14px !important;
|
1176 |
+
font-weight: 500 !important;
|
1177 |
+
color: #2c3e50 !important;
|
1178 |
}
|
1179 |
|
1180 |
.gr-dropdown:focus {
|
1181 |
border-color: #667eea;
|
1182 |
+
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
|
1183 |
}
|
1184 |
|
1185 |
/* Compact spacing */
|
1186 |
.question-section {
|
1187 |
+
margin-bottom: 20px;
|
1188 |
}
|
1189 |
|
1190 |
.question-section:last-child {
|
1191 |
margin-bottom: 0;
|
1192 |
}
|
1193 |
|
1194 |
+
/* Better contrast for all text elements */
|
1195 |
+
.questionnaire-grid h2 {
|
1196 |
+
font-size: 24px !important;
|
1197 |
+
font-weight: 600 !important;
|
1198 |
+
color: #2c3e50 !important;
|
1199 |
+
}
|
1200 |
+
|
1201 |
+
.questionnaire-grid p {
|
1202 |
+
font-size: 16px !important;
|
1203 |
+
color: #5a6c7d !important;
|
1204 |
+
font-weight: 400 !important;
|
1205 |
+
}
|
1206 |
+
|
1207 |
/* Progress animation */
|
1208 |
@keyframes pulse {
|
1209 |
0% { opacity: 1; }
|
|
|
1216 |
}
|
1217 |
"""
|
1218 |
|
1219 |
+
# Updated Gradio Interface with Better Text Readability
|
1220 |
with gr.Blocks(
|
1221 |
title="🐶 Enhanced AI Dog Health Analyzer",
|
1222 |
theme=gr.themes.Soft(),
|
|
|
1302 |
maximum=25
|
1303 |
)
|
1304 |
|
1305 |
+
# Right Column - Enhanced Readable HRQOL Questionnaire
|
1306 |
with gr.Column(scale=1):
|
1307 |
gr.HTML("""
|
1308 |
<div class="questionnaire-grid">
|
1309 |
+
<h2 style="color: #2c3e50; margin: 0 0 15px 0; text-align: center; font-size: 24px; font-weight: 600;">
|
1310 |
📋 HRQOL Assessment
|
1311 |
</h2>
|
1312 |
+
<p style="text-align: center; color: #5a6c7d; font-style: italic; margin-bottom: 25px; font-size: 16px;">
|
1313 |
Complete all questions for accurate healthspan analysis
|
1314 |
</p>
|
1315 |
""")
|
1316 |
|
1317 |
hrqol_inputs = []
|
1318 |
|
1319 |
+
# Create compact grid layout with better text readability
|
1320 |
with gr.Group(elem_classes=["question-section"]):
|
1321 |
for domain_key, domain_data in HRQOL_QUESTIONNAIRE.items():
|
1322 |
for i, question in enumerate(domain_data["questions"]):
|
1323 |
with gr.Row():
|
1324 |
with gr.Column(scale=2):
|
1325 |
gr.HTML(f"""
|
1326 |
+
<div class="question-text">
|
1327 |
<strong>Q{len(hrqol_inputs)+1}:</strong> {question["text"]}
|
1328 |
+
</div>
|
1329 |
""")
|
1330 |
with gr.Column(scale=1):
|
1331 |
dropdown = gr.Dropdown(
|