Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -253,25 +253,39 @@ def predict_disease(symptoms):
|
|
253 |
|
254 |
from gradio.components import HTML
|
255 |
|
|
|
256 |
# Custom CSS for styling
|
257 |
custom_css = """
|
|
|
|
|
|
|
|
|
258 |
body {
|
259 |
-
font-family: '
|
260 |
background-color: #f0f4f7; /* Light background for better contrast */
|
261 |
}
|
262 |
|
|
|
|
|
|
|
|
|
|
|
|
|
263 |
h1 {
|
|
|
264 |
background: linear-gradient(135deg, #3c6487, #355f7a); /* Gradient using your color */
|
265 |
color: #ffffff;
|
266 |
border-radius: 12px;
|
267 |
padding: 15px;
|
268 |
text-align: center;
|
269 |
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Shadow effect */
|
|
|
270 |
}
|
271 |
|
|
|
272 |
textarea, input {
|
273 |
-
background:
|
274 |
-
color:
|
275 |
border: 2px solid #3c6487; /* Matching border color */
|
276 |
padding: 10px;
|
277 |
font-size: 1rem;
|
@@ -279,6 +293,12 @@ textarea, input {
|
|
279 |
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Light shadow for inputs */
|
280 |
}
|
281 |
|
|
|
|
|
|
|
|
|
|
|
|
|
282 |
.gr-button {
|
283 |
background-color: #ae1c93; /* Button color */
|
284 |
color: white;
|
@@ -288,6 +308,7 @@ textarea, input {
|
|
288 |
border: none; /* No border */
|
289 |
cursor: pointer; /* Pointer on hover */
|
290 |
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2); /* Shadow on button */
|
|
|
291 |
}
|
292 |
|
293 |
.gr-button:hover {
|
@@ -298,10 +319,11 @@ textarea, input {
|
|
298 |
background-color: #7f156b; /* Even darker shade on active */
|
299 |
}
|
300 |
|
|
|
301 |
.df-container {
|
302 |
background: white; /* Background for data frames */
|
303 |
color: black; /* Text color */
|
304 |
-
border: 2px solid #3c6487; /* Matching border color */
|
305 |
border-radius: 10px;
|
306 |
padding: 10px;
|
307 |
font-size: 14px;
|
@@ -321,7 +343,7 @@ textarea, input {
|
|
321 |
|
322 |
@media (max-width: 768px) {
|
323 |
h1 {
|
324 |
-
font-size:
|
325 |
padding: 10px;
|
326 |
}
|
327 |
|
@@ -347,13 +369,13 @@ with gr.Blocks(css=custom_css) as app:
|
|
347 |
location = gr.Textbox(label="Please Enter Your Current Location Here", placeholder="E.g., Karachi", max_lines=1)
|
348 |
query = gr.Textbox(label="Please Enter Which Health Professional You Want To Search Nearby", placeholder="E.g., Doctors", max_lines=1)
|
349 |
|
350 |
-
submit_chatbot = gr.Button(value="Submit Your Message", variant="primary",
|
351 |
|
352 |
-
chatbot = gr.Chatbot(label="Chat History", show_label=False
|
353 |
sentiment = gr.Textbox(label="Detected Sentiment", show_label=False)
|
354 |
emotion = gr.Textbox(label="Detected Emotion", show_label=False)
|
355 |
|
356 |
-
suggestions_markdown = gr.Markdown(label="Suggestions")
|
357 |
professionals = gr.DataFrame(label="Nearby Health Professionals", headers=["Name", "Address"])
|
358 |
map_html = gr.HTML(label="Interactive Map")
|
359 |
|
|
|
253 |
|
254 |
from gradio.components import HTML
|
255 |
|
256 |
+
# Custom CSS for styling
|
257 |
# Custom CSS for styling
|
258 |
custom_css = """
|
259 |
+
/* Importing Google Fonts */
|
260 |
+
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');
|
261 |
+
|
262 |
+
/* General Body Styling */
|
263 |
body {
|
264 |
+
font-family: 'Roboto', sans-serif;
|
265 |
background-color: #f0f4f7; /* Light background for better contrast */
|
266 |
}
|
267 |
|
268 |
+
/* Header Styling */
|
269 |
+
h1, h2, h3, h4 {
|
270 |
+
font-weight: bold; /* Make all headings bold */
|
271 |
+
color: #3c6487; /* Theme color for headings */
|
272 |
+
}
|
273 |
+
|
274 |
h1 {
|
275 |
+
font-size: 2.5rem; /* Bigger header size */
|
276 |
background: linear-gradient(135deg, #3c6487, #355f7a); /* Gradient using your color */
|
277 |
color: #ffffff;
|
278 |
border-radius: 12px;
|
279 |
padding: 15px;
|
280 |
text-align: center;
|
281 |
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Shadow effect */
|
282 |
+
margin-bottom: 20px; /* Spacing below the header */
|
283 |
}
|
284 |
|
285 |
+
/* Input and Textarea Styling */
|
286 |
textarea, input {
|
287 |
+
background: white; /* Input background */
|
288 |
+
color: black;
|
289 |
border: 2px solid #3c6487; /* Matching border color */
|
290 |
padding: 10px;
|
291 |
font-size: 1rem;
|
|
|
293 |
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Light shadow for inputs */
|
294 |
}
|
295 |
|
296 |
+
textarea:focus, input:focus {
|
297 |
+
border-color: #ae1c93; /* Highlight border color on focus */
|
298 |
+
box-shadow: 0 0 5px rgba(174, 28, 147, 0.5); /* Shadow on focus */
|
299 |
+
}
|
300 |
+
|
301 |
+
/* Button Styling */
|
302 |
.gr-button {
|
303 |
background-color: #ae1c93; /* Button color */
|
304 |
color: white;
|
|
|
308 |
border: none; /* No border */
|
309 |
cursor: pointer; /* Pointer on hover */
|
310 |
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2); /* Shadow on button */
|
311 |
+
transition: background-color 0.3s ease, transform 0.2s ease; /* Smooth transition for hover effects */
|
312 |
}
|
313 |
|
314 |
.gr-button:hover {
|
|
|
319 |
background-color: #7f156b; /* Even darker shade on active */
|
320 |
}
|
321 |
|
322 |
+
/* DataFrame Container Styling */
|
323 |
.df-container {
|
324 |
background: white; /* Background for data frames */
|
325 |
color: black; /* Text color */
|
326 |
+
border: 2px solid #3c6487; /* Matching border color for data frames */
|
327 |
border-radius: 10px;
|
328 |
padding: 10px;
|
329 |
font-size: 14px;
|
|
|
343 |
|
344 |
@media (max-width: 768px) {
|
345 |
h1 {
|
346 |
+
font-size: 2rem; /* Smaller font size for smaller screens */
|
347 |
padding: 10px;
|
348 |
}
|
349 |
|
|
|
369 |
location = gr.Textbox(label="Please Enter Your Current Location Here", placeholder="E.g., Karachi", max_lines=1)
|
370 |
query = gr.Textbox(label="Please Enter Which Health Professional You Want To Search Nearby", placeholder="E.g., Doctors", max_lines=1)
|
371 |
|
372 |
+
submit_chatbot = gr.Button(value="Submit Your Message", variant="primary", icon="fa-paper-plane")
|
373 |
|
374 |
+
chatbot = gr.Chatbot(label="Chat History", show_label=False)
|
375 |
sentiment = gr.Textbox(label="Detected Sentiment", show_label=False)
|
376 |
emotion = gr.Textbox(label="Detected Emotion", show_label=False)
|
377 |
|
378 |
+
suggestions_markdown = gr.Markdown(label="Suggestions")
|
379 |
professionals = gr.DataFrame(label="Nearby Health Professionals", headers=["Name", "Address"])
|
380 |
map_html = gr.HTML(label="Interactive Map")
|
381 |
|