Hasnain-Ali commited on
Commit
abe3a69
Β·
verified Β·
1 Parent(s): 25d264d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +57 -18
app.py CHANGED
@@ -110,26 +110,64 @@ def create_medical_report(symptoms):
110
  st.set_page_config(page_title="MedExpert AI", layout="wide")
111
 
112
  # Apply Tailwind CSS & Custom Styles
113
- st.markdown(
114
- """
115
  <style>
116
- body {background: linear-gradient(to right, #ff7e5f, #feb47b);}
117
- .sidebar .sidebar-content {background: #2C3E50;}
118
- .sidebar .sidebar-content a {color: #ffffff !important; font-size: 18px;}
119
- .stButton>button {background-color: #16A085; color: white; padding: 10px 20px; border-radius: 8px;}
120
- .stButton>button:hover {background-color: #1ABC9C;}
121
- .stMarkdown {font-size: 18px; color: #2C3E50;}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
122
  </style>
123
- """,
124
- unsafe_allow_html=True
125
- )
126
 
127
  # Sidebar UI
128
  with st.sidebar:
129
- st.markdown("## πŸ” Navigation")
130
  page = st.radio("", ["🏠 Home", "πŸ“„ Diagnosis", "πŸ“’ About"])
131
  st.markdown("---")
132
- st.markdown("**πŸ“Œ Built by AI & Healthcare Experts**")
 
133
 
134
  # Main Page
135
  st.title("🩺 MedExpert: AI-Powered Clinical Analysis System")
@@ -149,11 +187,12 @@ elif page == "πŸ“„ Diagnosis":
149
  st.subheader("πŸ“ Describe Your Symptoms")
150
  symptoms = st.text_area("Enter symptoms in any language", placeholder="e.g., Mujhay sar main dard hai")
151
 
152
- if st.button("πŸ§‘β€βš•οΈ Get Diagnosis"):
153
- if symptoms.strip():
154
- with st.spinner("πŸ” Analyzing Symptoms..."):
155
- time.sleep(2) # Simulate processing
156
- report_text, pdf_file = create_medical_report(symptoms)
 
157
 
158
  if pdf_file:
159
  st.subheader("πŸ“‹ Medical Report")
 
110
  st.set_page_config(page_title="MedExpert AI", layout="wide")
111
 
112
  # Apply Tailwind CSS & Custom Styles
113
+ st.markdown("""
 
114
  <style>
115
+ /* Background Gradient */
116
+ body {
117
+ background: linear-gradient(to right, #ff7e5f, #feb47b);
118
+ color: white;
119
+ }
120
+
121
+ /* Sidebar Design */
122
+ [data-testid="stSidebar"] {
123
+ background-color: #2C3E50 !important;
124
+ color: white !important;
125
+ }
126
+
127
+ [data-testid="stSidebar"] a {
128
+ color: white !important;
129
+ font-size: 18px !important;
130
+ }
131
+
132
+ /* Custom Buttons */
133
+ .stButton>button {
134
+ background-color: #16A085;
135
+ color: white;
136
+ padding: 10px 20px;
137
+ border-radius: 8px;
138
+ font-size: 16px;
139
+ }
140
+
141
+ .stButton>button:hover {
142
+ background-color: #1ABC9C;
143
+ }
144
+
145
+ /* Custom Input Box */
146
+ .stTextInput>div>div>input {
147
+ background-color: white !important;
148
+ border-radius: 10px !important;
149
+ border: 2px solid #16A085 !important;
150
+ padding: 8px !important;
151
+ }
152
+
153
+ /* Title Styling */
154
+ .stApp h1 {
155
+ text-align: center;
156
+ font-size: 36px;
157
+ color: #2C3E50;
158
+ }
159
+
160
  </style>
161
+ """, unsafe_allow_html=True)
162
+
 
163
 
164
  # Sidebar UI
165
  with st.sidebar:
166
+ st.markdown("## πŸ” **Navigation**", unsafe_allow_html=True)
167
  page = st.radio("", ["🏠 Home", "πŸ“„ Diagnosis", "πŸ“’ About"])
168
  st.markdown("---")
169
+ st.markdown("### πŸ“Œ **Built with AI & Healthcare Experts**")
170
+
171
 
172
  # Main Page
173
  st.title("🩺 MedExpert: AI-Powered Clinical Analysis System")
 
187
  st.subheader("πŸ“ Describe Your Symptoms")
188
  symptoms = st.text_area("Enter symptoms in any language", placeholder="e.g., Mujhay sar main dard hai")
189
 
190
+ if st.button("πŸ§‘β€βš•οΈ Get Diagnosis"):
191
+ if symptoms.strip():
192
+ with st.spinner("πŸ” **Analyzing Symptoms... Please wait...**"):
193
+ time.sleep(2) # Simulate processing
194
+ report_text, pdf_file = create_medical_report(symptoms)
195
+
196
 
197
  if pdf_file:
198
  st.subheader("πŸ“‹ Medical Report")