SmartHeal commited on
Commit
223dce1
·
verified ·
1 Parent(s): 9f48817

Update src/enhanced_ui_components.py

Browse files
Files changed (1) hide show
  1. src/enhanced_ui_components.py +214 -130
src/enhanced_ui_components.py CHANGED
@@ -38,136 +38,220 @@ class EnhancedUIComponents:
38
  def _load_custom_css(self):
39
  """Load custom CSS for the application"""
40
  return """
41
- /* Enhanced SmartHeal Application Styling */
42
- .main-header {
43
- text-align: center;
44
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
45
- color: white;
46
- padding: 2rem;
47
- border-radius: 10px;
48
- margin-bottom: 2rem;
49
- box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
50
- }
51
-
52
- .main-header h1 {
53
- margin: 0;
54
- font-size: 2.5rem;
55
- font-weight: bold;
56
- }
57
-
58
- .main-header p {
59
- margin: 0.5rem 0 0 0;
60
- font-size: 1.1rem;
61
- opacity: 0.9;
62
- }
63
-
64
- .integration-status {
65
- background-color: #e8f5e8;
66
- border: 1px solid #4caf50;
67
- border-radius: 8px;
68
- padding: 1rem;
69
- margin: 1rem 0;
70
- color: #2e7d32;
71
- }
72
-
73
- .analytics-info {
74
- background-color: #e3f2fd;
75
- border: 1px solid #2196f3;
76
- border-radius: 8px;
77
- padding: 1rem;
78
- margin: 1rem 0;
79
- color: #1565c0;
80
- }
81
-
82
- .session-info {
83
- background-color: #fff3e0;
84
- border: 1px solid #ff9800;
85
- border-radius: 8px;
86
- padding: 1rem;
87
- margin: 1rem 0;
88
- color: #ef6c00;
89
- }
90
-
91
- /* Section Headers */
92
- .section-header {
93
- background-color: #f8f9fa;
94
- padding: 1rem;
95
- border-radius: 8px;
96
- border-left: 4px solid #007bff;
97
- margin: 1rem 0;
98
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
99
- }
100
-
101
- .section-header h2 {
102
- margin: 0;
103
- color: #495057;
104
- font-size: 1.3rem;
105
- }
106
-
107
- .section-header h3 {
108
- margin: 0;
109
- color: #6c757d;
110
- font-size: 1.1rem;
111
- }
112
-
113
- /* Result Boxes */
114
- .result-box {
115
- background-color: #e7f3ff;
116
- border: 1px solid #b3d9ff;
117
- border-radius: 8px;
118
- padding: 1rem;
119
- margin: 1rem 0;
120
- }
121
-
122
- .success-box {
123
- background-color: #d4edda;
124
- border: 1px solid #c3e6cb;
125
- border-radius: 8px;
126
- padding: 1rem;
127
- margin: 1rem 0;
128
- color: #155724;
129
- }
130
-
131
- .warning-box {
132
- background-color: #fff3cd;
133
- border: 1px solid #ffeaa7;
134
- border-radius: 8px;
135
- padding: 1rem;
136
- margin: 1rem 0;
137
- color: #856404;
138
- }
139
-
140
- .error-box {
141
- background-color: #ffe7e7;
142
- border: 1px solid #ffb3b3;
143
- border-radius: 8px;
144
- padding: 1rem 0;
145
- margin: 1rem 0;
146
- color: #721c24;
147
- }
148
-
149
- /* Enhanced form styling */
150
- .form-group {
151
- margin-bottom: 1rem;
152
- }
153
-
154
- .metrics-display {
155
- background-color: #f8f9fa;
156
- border-radius: 8px;
157
- padding: 1rem;
158
- margin: 1rem 0;
159
- border: 1px solid #dee2e6;
160
- }
161
-
162
- .processing-indicator {
163
- background-color: #fff8e1;
164
- border: 1px solid #ffcc02;
165
- border-radius: 8px;
166
- padding: 1rem;
167
- margin: 1rem 0;
168
- color: #f57f17;
169
- text-align: center;
170
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
171
  """
172
 
173
  def create_interface(self):
 
38
  def _load_custom_css(self):
39
  """Load custom CSS for the application"""
40
  return """
41
+ /* =================== SMARTHEAL CSS =================== */
42
+ /* Global Styling */
43
+ body, html {
44
+ margin: 0 !important;
45
+ padding: 0 !important;
46
+ font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif !important;
47
+ background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%) !important;
48
+ color: #1A202C !important;
49
+ line-height: 1.6 !important;
50
+ }
51
+ /* Professional Header with Logo */
52
+ .medical-header {
53
+ background: linear-gradient(135deg, #3182ce 0%, #2c5aa0 100%) !important;
54
+ color: white !important;
55
+ padding: 32px 40px !important;
56
+ border-radius: 20px 20px 0 0 !important;
57
+ display: flex !important;
58
+ align-items: center !important;
59
+ justify-content: center !important;
60
+ margin-bottom: 0 !important;
61
+ box-shadow: 0 10px 40px rgba(49, 130, 206, 0.3) !important;
62
+ border: none !important;
63
+ position: relative !important;
64
+ overflow: hidden !important;
65
+ }
66
+ .logo {
67
+ width: 80px !important;
68
+ height: 80px !important;
69
+ border-radius: 50% !important;
70
+ margin-right: 24px !important;
71
+ border: 4px solid rgba(255, 255, 255, 0.3) !important;
72
+ box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2) !important;
73
+ background: white !important;
74
+ padding: 4px !important;
75
+ }
76
+ .medical-header h1 {
77
+ font-size: 3.5rem !important;
78
+ font-weight: 800 !important;
79
+ margin: 0 !important;
80
+ text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3) !important;
81
+ background: linear-gradient(45deg, #ffffff, #f8f9fa) !important;
82
+ -webkit-background-clip: text !important;
83
+ -webkit-text-fill-color: transparent !important;
84
+ background-clip: text !important;
85
+ filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3)) !important;
86
+ }
87
+ .medical-header p {
88
+ font-size: 1.3rem !important;
89
+ margin: 8px 0 0 0 !important;
90
+ opacity: 0.95 !important;
91
+ font-weight: 500 !important;
92
+ text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.2) !important;
93
+ }
94
+ /* Enhanced Form Styling */
95
+ .gr-form {
96
+ background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%) !important;
97
+ border-radius: 20px !important;
98
+ padding: 32px !important;
99
+ margin: 24px 0 !important;
100
+ box-shadow: 0 16px 48px rgba(0, 0, 0, 0.1) !important;
101
+ border: 1px solid rgba(229, 62, 62, 0.1) !important;
102
+ backdrop-filter: blur(10px) !important;
103
+ position: relative !important;
104
+ overflow: hidden !important;
105
+ }
106
+ /* Professional Input Fields */
107
+ .gr-textbox, .gr-number {
108
+ border-radius: 12px !important;
109
+ border: 2px solid #E2E8F0 !important;
110
+ background: #FFFFFF !important;
111
+ transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
112
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
113
+ font-size: 1rem !important;
114
+ color: #1A202C !important;
115
+ padding: 16px 20px !important;
116
+ }
117
+ .gr-textbox:focus, .gr-number:focus, .gr-textbox input:focus, .gr-number input:focus {
118
+ border-color: #E53E3E !important;
119
+ box-shadow: 0 0 0 4px rgba(229, 62, 62, 0.1) !important;
120
+ background: #FFFFFF !important;
121
+ outline: none !important;
122
+ transform: translateY(-1px) !important;
123
+ }
124
+ /* Enhanced Button Styling */
125
+ button.gr-button, button.gr-button-primary {
126
+ background: linear-gradient(135deg, #E53E3E 0%, #C53030 100%) !important;
127
+ color: #FFFFFF !important;
128
+ border: none !important;
129
+ border-radius: 12px !important;
130
+ font-weight: 700 !important;
131
+ padding: 16px 32px !important;
132
+ font-size: 1.1rem !important;
133
+ letter-spacing: 0.5px !important;
134
+ text-align: center !important;
135
+ transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
136
+ box-shadow: 0 4px 16px rgba(229, 62, 62, 0.3) !important;
137
+ position: relative !important;
138
+ overflow: hidden !important;
139
+ text-transform: uppercase !important;
140
+ cursor: pointer !important;
141
+ }
142
+ button.gr-button:hover, button.gr-button-primary:hover {
143
+ background: linear-gradient(135deg, #C53030 0%, #9C2A2A 100%) !important;
144
+ box-shadow: 0 8px 32px rgba(229, 62, 62, 0.4) !important;
145
+ transform: translateY(-3px) !important;
146
+ }
147
+ /* Professional Status Messages */
148
+ .status-success {
149
+ background: linear-gradient(135deg, #F0FFF4 0%, #E6FFFA 100%) !important;
150
+ border: 2px solid #38A169 !important;
151
+ color: #22543D !important;
152
+ padding: 20px 24px !important;
153
+ border-radius: 16px !important;
154
+ font-weight: 600 !important;
155
+ margin: 16px 0 !important;
156
+ box-shadow: 0 8px 24px rgba(56, 161, 105, 0.2) !important;
157
+ backdrop-filter: blur(10px) !important;
158
+ }
159
+ .status-error {
160
+ background: linear-gradient(135deg, #FFF5F5 0%, #FED7D7 100%) !important;
161
+ border: 2px solid #E53E3E !important;
162
+ color: #742A2A !important;
163
+ padding: 20px 24px !important;
164
+ border-radius: 16px !important;
165
+ font-weight: 600 !important;
166
+ margin: 16px 0 !important;
167
+ box-shadow: 0 8px 24px rgba(229, 62, 62, 0.2) !important;
168
+ backdrop-filter: blur(10px) !important;
169
+ }
170
+ .status-warning {
171
+ background: linear-gradient(135deg, #FFFAF0 0%, #FEEBC8 100%) !important;
172
+ border: 2px solid #DD6B20 !important;
173
+ color: #9C4221 !important;
174
+ padding: 20px 24px !important;
175
+ border-radius: 16px !important;
176
+ font-weight: 600 !important;
177
+ margin: 16px 0 !important;
178
+ box-shadow: 0 8px 24px rgba(221, 107, 32, 0.2) !important;
179
+ backdrop-filter: blur(10px) !important;
180
+ }
181
+ /* Image gallery styling for better visualization */
182
+ .image-gallery {
183
+ display: grid;
184
+ grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
185
+ gap: 20px;
186
+ margin: 20px 0;
187
+ }
188
+ .image-item {
189
+ background: #f8f9fa;
190
+ border-radius: 12px;
191
+ padding: 15px;
192
+ box-shadow: 0 4px 12px rgba(0,0,0,0.1);
193
+ text-align: center;
194
+ }
195
+ .image-item img {
196
+ max-width: 100%;
197
+ height: auto;
198
+ border-radius: 8px;
199
+ box-shadow: 0 2px 8px rgba(0,0,0,0.15);
200
+ }
201
+ .image-item h4 {
202
+ margin: 15px 0 5px 0;
203
+ color: #2d3748;
204
+ font-weight: 600;
205
+ }
206
+ .image-item p {
207
+ margin: 0;
208
+ color: #666;
209
+ font-size: 0.9em;
210
+ }
211
+ /* Analyze button special styling */
212
+ #analyze-btn {
213
+ background: linear-gradient(135deg, #1B5CF3 0%, #1E3A8A 100%) !important;
214
+ color: #FFFFFF !important;
215
+ border: none !important;
216
+ border-radius: 8px !important;
217
+ font-weight: 700 !important;
218
+ padding: 14px 28px !important;
219
+ font-size: 1.1rem !important;
220
+ letter-spacing: 0.5px !important;
221
+ text-align: center !important;
222
+ transition: all 0.2s ease-in-out !important;
223
+ }
224
+ #analyze-btn:hover {
225
+ background: linear-gradient(135deg, #174ea6 0%, #123b82 100%) !important;
226
+ box-shadow: 0 4px 14px rgba(27, 95, 193, 0.4) !important;
227
+ transform: translateY(-2px) !important;
228
+ }
229
+ /* Responsive design */
230
+ @media (max-width: 768px) {
231
+ .medical-header {
232
+ padding: 16px !important;
233
+ text-align: center !important;
234
+ }
235
+
236
+ .medical-header h1 {
237
+ font-size: 2rem !important;
238
+ }
239
+
240
+ .logo {
241
+ width: 48px !important;
242
+ height: 48px !important;
243
+ margin-right: 16px !important;
244
+ }
245
+
246
+ .gr-form {
247
+ padding: 16px !important;
248
+ margin: 8px 0 !important;
249
+ }
250
+
251
+ .image-gallery {
252
+ grid-template-columns: 1fr;
253
+ }
254
+ }
255
  """
256
 
257
  def create_interface(self):