Update src/enhanced_ui_components.py
Browse files- 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 |
-
/*
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 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):
|