Spaces:
Running
Running
File size: 10,024 Bytes
1d767c3 1db6477 cd66f1f 1db6477 cd66f1f 1db6477 cd66f1f 1db6477 cd66f1f 1db6477 cd66f1f 1db6477 cd66f1f 1db6477 cd66f1f 1db6477 cd66f1f 1db6477 cd66f1f 1db6477 cd66f1f 1db6477 cd66f1f 1db6477 cd66f1f 1db6477 1d767c3 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 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 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 |
import gradio as gr
# Custom CSS for enhanced UI
custom_title_css = """
/* Target the HTML component specifically */
.gradio-html .main-title {
font-size: 48px !important;
font-weight: 800 !important;
color: #0077B5 !important;
text-align: center !important;
margin: 20px 0 10px 0 !important;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
text-shadow: 2px 2px 4px rgba(0,0,0,0.1) !important;
}
.gradio-html .main-subtitle {
font-size: 18px !important;
color: #666666 !important;
text-align: center !important;
margin: 0 0 30px 0 !important;
font-weight: 400 !important;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}
.gradio-html .title-container {
background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
border-radius: 15px !important;
padding: 40px 20px !important;
margin: 20px 0 !important;
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1) !important;
border: 2px solid #e2e8f0 !important;
}
.gradio-html .emoji-icon {
font-size: 40px !important;
margin-right: 10px !important;
vertical-align: middle !important;
}
/* Alternative approach - target by element directly */
div[data-testid="HTML"] .main-title,
.gr-html .main-title {
font-size: 48px !important;
font-weight: 800 !important;
color: #0077B5 !important;
text-align: center !important;
margin: 20px 0 10px 0 !important;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}
div[data-testid="HTML"] .main-subtitle,
.gr-html .main-subtitle {
font-size: 18px !important;
color: #666666 !important;
text-align: center !important;
margin: 0 0 30px 0 !important;
font-weight: 400 !important;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}
div[data-testid="HTML"] .title-container,
.gr-html .title-container {
background: #f8fafc !important;
border-radius: 15px !important;
padding: 40px 20px !important;
margin: 20px 0 !important;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
border: 2px solid #e2e8f0 !important;
}
"""
# Create the interface
custom_css = """
/* Global App Styling */
.gradio-container {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
min-height: 100vh;
font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
}
/* Main content area */
.main > .wrap {
background: rgba(255, 255, 255, 0.05) !important;
backdrop-filter: blur(20px) !important;
border: 1px solid rgba(255, 255, 255, 0.1) !important;
border-radius: 20px !important;
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1) !important;
margin: 20px !important;
padding: 30px !important;
}
/* Title Styling */
.main-title {
background: linear-gradient(135deg, #667eea, #764ba2, #f093fb) !important;
-webkit-background-clip: text !important;
-webkit-text-fill-color: transparent !important;
background-clip: text !important;
font-size: 3rem !important;
font-weight: 800 !important;
text-align: center !important;
margin: 0 0 30px 0 !important;
text-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) !important;
letter-spacing: -0.02em !important;
}
/* Subtitle styling */
.main-subtitle {
color: rgba(255, 255, 255, 0.8) !important;
text-align: center !important;
font-size: 1.2rem !important;
font-weight: 400 !important;
margin-bottom: 40px !important;
opacity: 0.9 !important;
}
/* Tab container styling */
.tab-nav > .tab-nav-item {
background: rgba(255, 255, 255, 0.1) !important;
border: 1px solid rgba(255, 255, 255, 0.2) !important;
border-radius: 15px !important;
margin-right: 8px !important;
padding: 12px 24px !important;
color: rgba(255, 255, 255, 0.8) !important;
font-weight: 600 !important;
transition: all 0.3s ease !important;
backdrop-filter: blur(10px) !important;
font-size: 1rem !important;
}
.tab-nav > .tab-nav-item:hover {
background: rgba(255, 255, 255, 0.2) !important;
transform: translateY(-2px) !important;
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1) !important;
}
.tab-nav > .tab-nav-item.selected {
background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.2)) !important;
color: white !important;
border-color: rgba(255, 255, 255, 0.4) !important;
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15) !important;
transform: translateY(-2px) !important;
}
/* Tab content area */
.tabitem {
background: rgba(255, 255, 255, 0.02) !important;
border-radius: 20px !important;
padding: 30px !important;
margin-top: 20px !important;
border: 1px solid rgba(255, 255, 255, 0.1) !important;
backdrop-filter: blur(10px) !important;
}
/* Form elements styling */
.gradio-textbox, .gradio-dropdown, .gradio-slider {
background: rgba(255, 255, 255, 0.1) !important;
border: 1px solid rgba(255, 255, 255, 0.2) !important;
border-radius: 12px !important;
color: white !important;
backdrop-filter: blur(10px) !important;
}
.gradio-textbox input, .gradio-dropdown select {
background: transparent !important;
color: white !important;
border: none !important;
}
.gradio-textbox input::placeholder {
color: rgba(255, 255, 255, 0.5) !important;
}
/* Button styling */
button {
background: linear-gradient(135deg, #667eea, #764ba2) !important;
border: none !important;
border-radius: 12px !important;
color: white !important;
font-weight: 600 !important;
padding: 12px 24px !important;
transition: all 0.3s ease !important;
box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3) !important;
}
button:hover {
transform: translateY(-2px) !important;
box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4) !important;
}
/* Status box styling */
.gradio-textbox.status-box {
background: rgba(255, 107, 107, 0.1) !important;
border-color: rgba(255, 107, 107, 0.3) !important;
}
/* Plot containers */
.plot-container {
background: rgba(255, 255, 255, 0.05) !important;
border-radius: 15px !important;
padding: 20px !important;
margin: 15px 0 !important;
border: 1px solid rgba(255, 255, 255, 0.1) !important;
backdrop-filter: blur(10px) !important;
}
/* Card-like components */
.info-card {
background: rgba(255, 255, 255, 0.08) !important;
border-radius: 16px !important;
padding: 24px !important;
margin: 16px 0 !important;
border: 1px solid rgba(255, 255, 255, 0.12) !important;
backdrop-filter: blur(15px) !important;
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1) !important;
}
/* Markdown content styling */
.prose {
color: rgba(255, 255, 255, 0.9) !important;
}
.prose h1, .prose h2, .prose h3 {
color: white !important;
font-weight: 700 !important;
}
.prose p {
color: rgba(255, 255, 255, 0.8) !important;
line-height: 1.6 !important;
}
/* Loading states */
.loading {
background: linear-gradient(90deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.1) 100%) !important;
background-size: 200% 100% !important;
animation: loading 1.5s infinite !important;
}
@keyframes loading {
0% { background-position: 200% 0; }
100% { background-position: -200% 0; }
}
/* Responsive design */
@media (max-width: 768px) {
.main-title {
font-size: 2rem !important;
}
.tab-nav > .tab-nav-item {
padding: 8px 16px !important;
font-size: 0.9rem !important;
}
.main > .wrap {
margin: 10px !important;
padding: 20px !important;
}
}
/* Floating action elements */
.floating-element {
position: relative !important;
z-index: 10 !important;
}
.floating-element::before {
content: '' !important;
position: absolute !important;
top: -2px !important;
left: -2px !important;
right: -2px !important;
bottom: -2px !important;
background: linear-gradient(45deg, #667eea, #764ba2, #f093fb) !important;
border-radius: inherit !important;
z-index: -1 !important;
opacity: 0 !important;
transition: opacity 0.3s ease !important;
}
.floating-element:hover::before {
opacity: 1 !important;
}
/* Enhanced home tab cards */
.home-card {
background: rgba(255, 255, 255, 0.1) !important;
border: 1px solid rgba(255, 255, 255, 0.2) !important;
border-radius: 20px !important;
padding: 30px !important;
margin: 15px !important;
backdrop-filter: blur(15px) !important;
transition: all 0.3s ease !important;
cursor: pointer !important;
}
.home-card:hover {
transform: translateY(-5px) !important;
box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2) !important;
background: rgba(255, 255, 255, 0.15) !important;
}
.home-card-icon {
font-size: 3rem !important;
margin-bottom: 20px !important;
display: block !important;
text-align: center !important;
}
.home-card-title {
font-size: 1.5rem !important;
font-weight: 700 !important;
color: white !important;
margin-bottom: 10px !important;
text-align: center !important;
}
.home-card-description {
color: rgba(255, 255, 255, 0.7) !important;
text-align: center !important;
line-height: 1.5 !important;
}
"""
# Custom theme with enhanced colors
custom_theme = gr.themes.Soft(
primary_hue="blue",
secondary_hue="purple",
neutral_hue="slate"
).set(
body_background_fill="*primary_50",
body_background_fill_dark="*primary_900",
button_primary_background_fill="linear-gradient(135deg, *primary_500, *secondary_600)",
button_primary_background_fill_hover="linear-gradient(135deg, *primary_600, *secondary_700)",
block_background_fill="rgba(255, 255, 255, 0.05)",
block_border_color="rgba(255, 255, 255, 0.1)",
input_background_fill="rgba(255, 255, 255, 0.1)",
input_border_color="rgba(255, 255, 255, 0.2)"
) |