Spaces:
Running
Running
Arush kumar commited on
Commit ·
2491980
1
Parent(s): c8485c9
Update app.py
Browse files
app.py
CHANGED
|
@@ -228,36 +228,33 @@ def generate_stream(
|
|
| 228 |
yield f"⚠ Error: {str(e)}"
|
| 229 |
|
| 230 |
# ============================================================
|
| 231 |
-
# Styling —
|
| 232 |
# ============================================================
|
| 233 |
|
| 234 |
CUSTOM_CSS = """
|
| 235 |
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');
|
| 236 |
|
| 237 |
:root {
|
| 238 |
-
/*
|
| 239 |
-
--bg-
|
| 240 |
-
--bg-
|
| 241 |
-
--
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 242 |
--glass-border: rgba(255, 255, 255, 0.06);
|
| 243 |
-
--glass-border-hover: rgba(255, 255, 255, 0.12);
|
| 244 |
|
| 245 |
-
/* Accents */
|
| 246 |
-
--
|
| 247 |
-
--
|
| 248 |
-
--
|
| 249 |
-
--accent-glow: rgba(56, 189, 248, 0.15);
|
| 250 |
|
| 251 |
/* Text */
|
| 252 |
-
--text-primary: #
|
| 253 |
--text-secondary: #94a3b8;
|
| 254 |
-
--text-muted: #
|
| 255 |
-
|
| 256 |
-
/* Chat */
|
| 257 |
-
--user-bubble: linear-gradient(135deg, rgba(56, 189, 248, 0.12) 0%, rgba(129, 140, 248, 0.12) 100%);
|
| 258 |
-
--user-bubble-border: rgba(56, 189, 248, 0.2);
|
| 259 |
-
--bot-bubble: rgba(255, 255, 255, 0.03);
|
| 260 |
-
--bot-bubble-border: rgba(255, 255, 255, 0.05);
|
| 261 |
}
|
| 262 |
|
| 263 |
* {
|
|
@@ -265,37 +262,45 @@ CUSTOM_CSS = """
|
|
| 265 |
box-sizing: border-box;
|
| 266 |
}
|
| 267 |
|
| 268 |
-
/*
|
| 269 |
.message, .prose, textarea, input, .token-counter, code, pre {
|
| 270 |
font-family: 'JetBrains Mono', ui-monospace, monospace !important;
|
| 271 |
}
|
| 272 |
|
|
|
|
| 273 |
body, .gradio-container {
|
| 274 |
-
background: var(--bg-
|
| 275 |
color: var(--text-primary) !important;
|
| 276 |
background-image:
|
| 277 |
-
|
| 278 |
-
radial-gradient(at
|
| 279 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 280 |
min-height: 100vh;
|
| 281 |
}
|
| 282 |
|
| 283 |
/* Header */
|
| 284 |
#veylon-header {
|
| 285 |
text-align: center;
|
| 286 |
-
padding:
|
| 287 |
-
animation: fadeInDown 0.8s ease-out;
|
| 288 |
}
|
| 289 |
|
| 290 |
#veylon-header h1 {
|
| 291 |
-
font-size: 2.
|
| 292 |
font-weight: 700;
|
| 293 |
letter-spacing: -0.5px;
|
| 294 |
-
|
|
|
|
| 295 |
-webkit-background-clip: text;
|
| 296 |
-webkit-text-fill-color: transparent;
|
| 297 |
-
|
| 298 |
-
|
| 299 |
}
|
| 300 |
|
| 301 |
#veylon-header p {
|
|
@@ -303,69 +308,60 @@ body, .gradio-container {
|
|
| 303 |
font-size: 0.85rem;
|
| 304 |
margin: 0;
|
| 305 |
font-weight: 400;
|
| 306 |
-
letter-spacing: 0.
|
|
|
|
| 307 |
}
|
| 308 |
|
| 309 |
-
/* Panels
|
| 310 |
.gr-panel, .block, .form, .gap, .wrap {
|
| 311 |
background: var(--glass-bg) !important;
|
| 312 |
border: 1px solid var(--glass-border) !important;
|
|
|
|
|
|
|
|
|
|
| 313 |
border-radius: 16px !important;
|
| 314 |
-
backdrop-filter: blur(
|
| 315 |
-
-webkit-backdrop-filter: blur(
|
| 316 |
-
box-shadow:
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
|
| 321 |
-
border-color: var(--glass-border-hover) !important;
|
| 322 |
}
|
| 323 |
|
| 324 |
-
/* Chatbot
|
| 325 |
#chatbot {
|
| 326 |
border-radius: 20px !important;
|
| 327 |
-
|
| 328 |
-
|
| 329 |
-
box-shadow:
|
|
|
|
|
|
|
| 330 |
overflow: hidden;
|
| 331 |
}
|
| 332 |
|
| 333 |
-
/* Chat input area inside chatbot */
|
| 334 |
#chatbot .form {
|
| 335 |
background: transparent !important;
|
| 336 |
border: none !important;
|
| 337 |
box-shadow: none !important;
|
| 338 |
-
padding:
|
| 339 |
-
}
|
| 340 |
-
|
| 341 |
-
#chatbot textarea {
|
| 342 |
-
background: rgba(255, 255, 255, 0.04) !important;
|
| 343 |
-
border: 1px solid var(--glass-border) !important;
|
| 344 |
-
border-radius: 14px !important;
|
| 345 |
-
resize: none !important;
|
| 346 |
-
min-height: 46px !important;
|
| 347 |
-
max-height: 120px !important;
|
| 348 |
-
transition: all 0.3s ease !important;
|
| 349 |
-
}
|
| 350 |
-
|
| 351 |
-
#chatbot textarea:focus {
|
| 352 |
-
background: rgba(255, 255, 255, 0.06) !important;
|
| 353 |
-
border-color: var(--accent-primary) !important;
|
| 354 |
-
box-shadow: 0 0 0 3px var(--accent-glow) !important;
|
| 355 |
}
|
| 356 |
|
| 357 |
/* Chat Bubbles */
|
| 358 |
.message.user {
|
| 359 |
-
|
| 360 |
-
|
|
|
|
|
|
|
| 361 |
border-radius: 18px 18px 4px 18px !important;
|
| 362 |
color: var(--text-primary) !important;
|
| 363 |
-
box-shadow: 0
|
| 364 |
}
|
| 365 |
|
| 366 |
.message.bot {
|
| 367 |
-
|
| 368 |
-
|
|
|
|
| 369 |
border-radius: 18px 18px 18px 4px !important;
|
| 370 |
color: var(--text-primary) !important;
|
| 371 |
}
|
|
@@ -376,113 +372,128 @@ body, .gradio-container {
|
|
| 376 |
font-size: 0.9rem !important;
|
| 377 |
}
|
| 378 |
|
| 379 |
-
/* Inputs
|
| 380 |
-
input:not([type="range"]), .gr-box, .gr-text-input {
|
| 381 |
-
background: rgba(
|
| 382 |
color: var(--text-primary) !important;
|
| 383 |
-
border: 1px solid
|
| 384 |
border-radius: 12px !important;
|
|
|
|
|
|
|
| 385 |
transition: all 0.3s ease !important;
|
| 386 |
font-size: 0.9rem !important;
|
| 387 |
}
|
| 388 |
|
| 389 |
-
input:not([type="range"]):focus, .gr-box:focus-within {
|
| 390 |
-
background: rgba(
|
| 391 |
-
border-color:
|
| 392 |
-
box-shadow: 0 0 0
|
| 393 |
outline: none !important;
|
| 394 |
}
|
| 395 |
|
| 396 |
/* Labels */
|
| 397 |
label span, .form label span {
|
| 398 |
color: var(--text-muted) !important;
|
| 399 |
-
font-size: 0.
|
| 400 |
text-transform: uppercase !important;
|
| 401 |
-
letter-spacing: 0.
|
| 402 |
font-weight: 600 !important;
|
| 403 |
-
margin-bottom:
|
| 404 |
}
|
| 405 |
|
| 406 |
-
/* Sliders */
|
| 407 |
input[type="range"] {
|
| 408 |
-webkit-appearance: none;
|
| 409 |
background: transparent;
|
| 410 |
}
|
| 411 |
|
| 412 |
input[type="range"]::-webkit-slider-runnable-track {
|
| 413 |
-
height:
|
| 414 |
-
background: rgba(255,
|
| 415 |
-
border-radius:
|
|
|
|
| 416 |
}
|
| 417 |
|
| 418 |
input[type="range"]::-webkit-slider-thumb {
|
| 419 |
-webkit-appearance: none;
|
| 420 |
-
height:
|
| 421 |
-
width:
|
| 422 |
border-radius: 50%;
|
| 423 |
-
|
| 424 |
-
|
| 425 |
-
|
|
|
|
| 426 |
cursor: pointer;
|
| 427 |
transition: transform 0.2s ease;
|
| 428 |
}
|
| 429 |
|
| 430 |
input[type="range"]::-webkit-slider-thumb:hover {
|
| 431 |
-
transform: scale(1.
|
| 432 |
}
|
| 433 |
|
| 434 |
-
/* Buttons */
|
| 435 |
button.primary, .gr-button-primary, button[type="submit"] {
|
| 436 |
-
background:
|
| 437 |
color: #0f172a !important;
|
| 438 |
-
border:
|
|
|
|
| 439 |
border-radius: 12px !important;
|
| 440 |
-
font-weight:
|
| 441 |
-
font-size: 0.
|
| 442 |
-
letter-spacing: 0.
|
| 443 |
-
|
| 444 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 445 |
padding: 10px 24px !important;
|
| 446 |
}
|
| 447 |
|
| 448 |
button.primary:hover, .gr-button-primary:hover, button[type="submit"]:hover {
|
| 449 |
-
|
| 450 |
-
|
|
|
|
|
|
|
|
|
|
| 451 |
}
|
| 452 |
|
| 453 |
button.primary:active, .gr-button-primary:active {
|
| 454 |
-
transform: translateY(
|
|
|
|
| 455 |
}
|
| 456 |
|
| 457 |
-
/* Secondary
|
| 458 |
button.secondary, .gr-button-secondary, button:not(.primary):not([type="submit"]) {
|
| 459 |
-
background: rgba(
|
| 460 |
color: var(--text-secondary) !important;
|
| 461 |
-
border: 1px solid
|
|
|
|
| 462 |
border-radius: 12px !important;
|
| 463 |
-
|
|
|
|
| 464 |
}
|
| 465 |
|
| 466 |
button.secondary:hover, .gr-button-secondary:hover {
|
| 467 |
-
background: rgba(
|
| 468 |
color: var(--text-primary) !important;
|
| 469 |
-
border-color: var(--glass-border-hover) !important;
|
| 470 |
}
|
| 471 |
|
| 472 |
/* Stats badge */
|
| 473 |
#stats-badge {
|
| 474 |
text-align: center;
|
| 475 |
color: var(--text-muted);
|
| 476 |
-
font-size: 0.
|
| 477 |
-
padding:
|
| 478 |
-
font-weight:
|
| 479 |
-
letter-spacing: 0.
|
|
|
|
| 480 |
}
|
| 481 |
|
| 482 |
/* Scrollbars */
|
| 483 |
::-webkit-scrollbar {
|
| 484 |
-
width:
|
| 485 |
-
height:
|
| 486 |
}
|
| 487 |
|
| 488 |
::-webkit-scrollbar-track {
|
|
@@ -491,45 +502,19 @@ button.secondary:hover, .gr-button-secondary:hover {
|
|
| 491 |
|
| 492 |
::-webkit-scrollbar-thumb {
|
| 493 |
background: rgba(255, 255, 255, 0.1);
|
| 494 |
-
border-radius:
|
| 495 |
}
|
| 496 |
|
| 497 |
::-webkit-scrollbar-thumb:hover {
|
| 498 |
background: rgba(255, 255, 255, 0.2);
|
| 499 |
}
|
| 500 |
|
| 501 |
-
/* Animations */
|
| 502 |
-
@keyframes fadeInDown {
|
| 503 |
-
from { opacity: 0; transform: translateY(-12px); }
|
| 504 |
-
to { opacity: 1; transform: translateY(0); }
|
| 505 |
-
}
|
| 506 |
-
|
| 507 |
-
@keyframes fadeIn {
|
| 508 |
-
from { opacity: 0; }
|
| 509 |
-
to { opacity: 1; }
|
| 510 |
-
}
|
| 511 |
-
|
| 512 |
-
.gradio-container > * {
|
| 513 |
-
animation: fadeIn 0.6s ease-out forwards;
|
| 514 |
-
}
|
| 515 |
-
|
| 516 |
/* Hide default Gradio footer */
|
| 517 |
footer { display: none !important; }
|
| 518 |
|
| 519 |
-
/* Links */
|
| 520 |
-
a {
|
| 521 |
-
color: var(--accent-primary) !important;
|
| 522 |
-
text-decoration: none !important;
|
| 523 |
-
transition: color 0.2s ease;
|
| 524 |
-
}
|
| 525 |
-
|
| 526 |
-
a:hover {
|
| 527 |
-
color: var(--accent-secondary) !important;
|
| 528 |
-
}
|
| 529 |
-
|
| 530 |
/* Markdown inside chat */
|
| 531 |
.message .prose h1, .message .prose h2, .message .prose h3 {
|
| 532 |
-
color: var(--
|
| 533 |
margin-top: 1em !important;
|
| 534 |
}
|
| 535 |
|
|
@@ -538,32 +523,34 @@ a:hover {
|
|
| 538 |
}
|
| 539 |
|
| 540 |
.message .prose code {
|
| 541 |
-
background: rgba(0, 0, 0, 0.
|
| 542 |
padding: 2px 6px !important;
|
| 543 |
border-radius: 6px !important;
|
| 544 |
font-size: 0.85em !important;
|
| 545 |
-
color: var(--
|
| 546 |
border: 1px solid rgba(255, 255, 255, 0.05) !important;
|
| 547 |
}
|
| 548 |
|
| 549 |
.message .prose pre {
|
| 550 |
-
background: rgba(0, 0, 0, 0.
|
| 551 |
-
border: 1px solid
|
| 552 |
border-radius: 12px !important;
|
| 553 |
padding: 16px !important;
|
|
|
|
| 554 |
}
|
| 555 |
"""
|
| 556 |
|
| 557 |
THEME = gr.themes.Base(
|
| 558 |
-
primary_hue="
|
| 559 |
-
secondary_hue="
|
| 560 |
-
neutral_hue="
|
| 561 |
font=[gr.themes.GoogleFont("Inter"), "ui-sans-serif", "system-ui", "sans-serif"],
|
| 562 |
).set(
|
| 563 |
-
body_background_fill="#
|
| 564 |
-
block_background_fill="rgba(
|
| 565 |
border_color_primary="rgba(255, 255, 255, 0.06)",
|
| 566 |
shadow_spread="0",
|
|
|
|
| 567 |
)
|
| 568 |
|
| 569 |
# ============================================================
|
|
@@ -571,7 +558,6 @@ THEME = gr.themes.Base(
|
|
| 571 |
# ============================================================
|
| 572 |
|
| 573 |
def build_demo() -> gr.Blocks:
|
| 574 |
-
# Pass css and theme directly to Blocks for proper rendering
|
| 575 |
with gr.Blocks(title=MODEL_NAME, css=CUSTOM_CSS, theme=THEME) as demo:
|
| 576 |
gr.HTML(f"""
|
| 577 |
<div id="veylon-header">
|
|
|
|
| 228 |
yield f"⚠ Error: {str(e)}"
|
| 229 |
|
| 230 |
# ============================================================
|
| 231 |
+
# Styling — Black Glass & Brushed Metal Aesthetic
|
| 232 |
# ============================================================
|
| 233 |
|
| 234 |
CUSTOM_CSS = """
|
| 235 |
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');
|
| 236 |
|
| 237 |
:root {
|
| 238 |
+
/* Obsidian & Titanium Palette */
|
| 239 |
+
--bg-obsidian: #050507;
|
| 240 |
+
--bg-metal-dark: #0a0a0c;
|
| 241 |
+
--bg-metal-light: #141418;
|
| 242 |
+
|
| 243 |
+
/* Glass & Edges */
|
| 244 |
+
--glass-bg: rgba(12, 12, 15, 0.65);
|
| 245 |
+
--glass-edge-top: rgba(255, 255, 255, 0.12); /* Specular highlight */
|
| 246 |
+
--glass-edge-bottom: rgba(0, 0, 0, 0.4);
|
| 247 |
--glass-border: rgba(255, 255, 255, 0.06);
|
|
|
|
| 248 |
|
| 249 |
+
/* Chrome & Silver Accents */
|
| 250 |
+
--chrome-light: #f8fafc;
|
| 251 |
+
--chrome-mid: #cbd5e1;
|
| 252 |
+
--chrome-dark: #64748b;
|
|
|
|
| 253 |
|
| 254 |
/* Text */
|
| 255 |
+
--text-primary: #e2e8f0;
|
| 256 |
--text-secondary: #94a3b8;
|
| 257 |
+
--text-muted: #475569;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 258 |
}
|
| 259 |
|
| 260 |
* {
|
|
|
|
| 262 |
box-sizing: border-box;
|
| 263 |
}
|
| 264 |
|
| 265 |
+
/* Monospace for chat/code/inputs */
|
| 266 |
.message, .prose, textarea, input, .token-counter, code, pre {
|
| 267 |
font-family: 'JetBrains Mono', ui-monospace, monospace !important;
|
| 268 |
}
|
| 269 |
|
| 270 |
+
/* Main Background: Brushed Metal / Anodized Black */
|
| 271 |
body, .gradio-container {
|
| 272 |
+
background-color: var(--bg-obsidian) !important;
|
| 273 |
color: var(--text-primary) !important;
|
| 274 |
background-image:
|
| 275 |
+
/* Subtle top-down lighting */
|
| 276 |
+
radial-gradient(ellipse at 50% 0%, rgba(30, 30, 35, 0.4) 0%, transparent 60%),
|
| 277 |
+
/* Diagonal brushed metal sheen */
|
| 278 |
+
linear-gradient(135deg,
|
| 279 |
+
#08080a 0%,
|
| 280 |
+
#111115 20%,
|
| 281 |
+
#0a0a0c 40%,
|
| 282 |
+
#141418 60%,
|
| 283 |
+
#08080a 80%,
|
| 284 |
+
#111115 100%) !important;
|
| 285 |
min-height: 100vh;
|
| 286 |
}
|
| 287 |
|
| 288 |
/* Header */
|
| 289 |
#veylon-header {
|
| 290 |
text-align: center;
|
| 291 |
+
padding: 32px 12px 20px 12px;
|
|
|
|
| 292 |
}
|
| 293 |
|
| 294 |
#veylon-header h1 {
|
| 295 |
+
font-size: 2.4rem;
|
| 296 |
font-weight: 700;
|
| 297 |
letter-spacing: -0.5px;
|
| 298 |
+
/* Polished silver text */
|
| 299 |
+
background: linear-gradient(180deg, #ffffff 0%, #94a3b8 60%, #475569 100%);
|
| 300 |
-webkit-background-clip: text;
|
| 301 |
-webkit-text-fill-color: transparent;
|
| 302 |
+
filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8));
|
| 303 |
+
margin-bottom: 8px;
|
| 304 |
}
|
| 305 |
|
| 306 |
#veylon-header p {
|
|
|
|
| 308 |
font-size: 0.85rem;
|
| 309 |
margin: 0;
|
| 310 |
font-weight: 400;
|
| 311 |
+
letter-spacing: 0.05em;
|
| 312 |
+
text-transform: uppercase;
|
| 313 |
}
|
| 314 |
|
| 315 |
+
/* Glass Panels with Physical Thickness */
|
| 316 |
.gr-panel, .block, .form, .gap, .wrap {
|
| 317 |
background: var(--glass-bg) !important;
|
| 318 |
border: 1px solid var(--glass-border) !important;
|
| 319 |
+
/* The magic: top light edge, bottom dark edge for 3D glass effect */
|
| 320 |
+
border-top-color: var(--glass-edge-top) !important;
|
| 321 |
+
border-bottom-color: var(--glass-edge-bottom) !important;
|
| 322 |
border-radius: 16px !important;
|
| 323 |
+
backdrop-filter: blur(24px) saturate(1.2);
|
| 324 |
+
-webkit-backdrop-filter: blur(24px) saturate(1.2);
|
| 325 |
+
box-shadow:
|
| 326 |
+
0 12px 40px rgba(0, 0, 0, 0.6),
|
| 327 |
+
inset 0 1px 0 rgba(255, 255, 255, 0.05),
|
| 328 |
+
inset 0 -1px 0 rgba(0, 0, 0, 0.2);
|
| 329 |
+
transition: all 0.3s ease;
|
|
|
|
| 330 |
}
|
| 331 |
|
| 332 |
+
/* Chatbot Container (OLED Screen Vibe) */
|
| 333 |
#chatbot {
|
| 334 |
border-radius: 20px !important;
|
| 335 |
+
background: rgba(5, 5, 8, 0.85) !important;
|
| 336 |
+
border: 1px solid rgba(255, 255, 255, 0.04) !important;
|
| 337 |
+
box-shadow:
|
| 338 |
+
inset 0 2px 15px rgba(0, 0, 0, 0.8),
|
| 339 |
+
0 8px 32px rgba(0, 0, 0, 0.4) !important;
|
| 340 |
overflow: hidden;
|
| 341 |
}
|
| 342 |
|
|
|
|
| 343 |
#chatbot .form {
|
| 344 |
background: transparent !important;
|
| 345 |
border: none !important;
|
| 346 |
box-shadow: none !important;
|
| 347 |
+
padding: 10px !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 348 |
}
|
| 349 |
|
| 350 |
/* Chat Bubbles */
|
| 351 |
.message.user {
|
| 352 |
+
/* Brushed dark metal for user */
|
| 353 |
+
background: linear-gradient(135deg, rgba(35, 35, 40, 0.9) 0%, rgba(20, 20, 25, 0.9) 100%) !important;
|
| 354 |
+
border: 1px solid rgba(255, 255, 255, 0.08) !important;
|
| 355 |
+
border-top-color: rgba(255, 255, 255, 0.15) !important;
|
| 356 |
border-radius: 18px 18px 4px 18px !important;
|
| 357 |
color: var(--text-primary) !important;
|
| 358 |
+
box-shadow: 0 4px 12px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.05);
|
| 359 |
}
|
| 360 |
|
| 361 |
.message.bot {
|
| 362 |
+
/* Smoky glass for bot */
|
| 363 |
+
background: rgba(15, 15, 20, 0.6) !important;
|
| 364 |
+
border: 1px solid rgba(255, 255, 255, 0.04) !important;
|
| 365 |
border-radius: 18px 18px 18px 4px !important;
|
| 366 |
color: var(--text-primary) !important;
|
| 367 |
}
|
|
|
|
| 372 |
font-size: 0.9rem !important;
|
| 373 |
}
|
| 374 |
|
| 375 |
+
/* Recessed Inputs (Carved Metal Look) */
|
| 376 |
+
input:not([type="range"]), textarea, .gr-box, .gr-text-input {
|
| 377 |
+
background: rgba(0, 0, 0, 0.5) !important;
|
| 378 |
color: var(--text-primary) !important;
|
| 379 |
+
border: 1px solid rgba(255, 255, 255, 0.06) !important;
|
| 380 |
border-radius: 12px !important;
|
| 381 |
+
/* Inset shadow makes it look physically recessed */
|
| 382 |
+
box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.6), inset 0 1px 2px rgba(0,0,0,0.4) !important;
|
| 383 |
transition: all 0.3s ease !important;
|
| 384 |
font-size: 0.9rem !important;
|
| 385 |
}
|
| 386 |
|
| 387 |
+
input:not([type="range"]):focus, textarea:focus, .gr-box:focus-within {
|
| 388 |
+
background: rgba(0, 0, 0, 0.6) !important;
|
| 389 |
+
border-color: rgba(255, 255, 255, 0.15) !important;
|
| 390 |
+
box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.6), 0 0 0 2px rgba(255, 255, 255, 0.05) !important;
|
| 391 |
outline: none !important;
|
| 392 |
}
|
| 393 |
|
| 394 |
/* Labels */
|
| 395 |
label span, .form label span {
|
| 396 |
color: var(--text-muted) !important;
|
| 397 |
+
font-size: 0.7rem !important;
|
| 398 |
text-transform: uppercase !important;
|
| 399 |
+
letter-spacing: 0.1em !important;
|
| 400 |
font-weight: 600 !important;
|
| 401 |
+
margin-bottom: 8px !important;
|
| 402 |
}
|
| 403 |
|
| 404 |
+
/* Metallic Sliders */
|
| 405 |
input[type="range"] {
|
| 406 |
-webkit-appearance: none;
|
| 407 |
background: transparent;
|
| 408 |
}
|
| 409 |
|
| 410 |
input[type="range"]::-webkit-slider-runnable-track {
|
| 411 |
+
height: 4px;
|
| 412 |
+
background: linear-gradient(90deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
|
| 413 |
+
border-radius: 2px;
|
| 414 |
+
box-shadow: inset 0 1px 2px rgba(0,0,0,0.5);
|
| 415 |
}
|
| 416 |
|
| 417 |
input[type="range"]::-webkit-slider-thumb {
|
| 418 |
-webkit-appearance: none;
|
| 419 |
+
height: 18px;
|
| 420 |
+
width: 18px;
|
| 421 |
border-radius: 50%;
|
| 422 |
+
/* Chrome sphere */
|
| 423 |
+
background: linear-gradient(145deg, #f8fafc 0%, #94a3b8 50%, #475569 100%);
|
| 424 |
+
margin-top: -7px;
|
| 425 |
+
box-shadow: 0 2px 6px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.8);
|
| 426 |
cursor: pointer;
|
| 427 |
transition: transform 0.2s ease;
|
| 428 |
}
|
| 429 |
|
| 430 |
input[type="range"]::-webkit-slider-thumb:hover {
|
| 431 |
+
transform: scale(1.15);
|
| 432 |
}
|
| 433 |
|
| 434 |
+
/* Polished Chrome Primary Buttons */
|
| 435 |
button.primary, .gr-button-primary, button[type="submit"] {
|
| 436 |
+
background: linear-gradient(180deg, #f1f5f9 0%, #94a3b8 40%, #cbd5e1 100%) !important;
|
| 437 |
color: #0f172a !important;
|
| 438 |
+
border: 1px solid rgba(255, 255, 255, 0.4) !important;
|
| 439 |
+
border-bottom-color: rgba(0, 0, 0, 0.3) !important;
|
| 440 |
border-radius: 12px !important;
|
| 441 |
+
font-weight: 700 !important;
|
| 442 |
+
font-size: 0.85rem !important;
|
| 443 |
+
letter-spacing: 0.05em;
|
| 444 |
+
text-transform: uppercase;
|
| 445 |
+
box-shadow:
|
| 446 |
+
0 4px 12px rgba(0, 0, 0, 0.5),
|
| 447 |
+
inset 0 1px 0 rgba(255, 255, 255, 0.9);
|
| 448 |
+
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
|
| 449 |
+
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
| 450 |
padding: 10px 24px !important;
|
| 451 |
}
|
| 452 |
|
| 453 |
button.primary:hover, .gr-button-primary:hover, button[type="submit"]:hover {
|
| 454 |
+
background: linear-gradient(180deg, #ffffff 0%, #cbd5e1 40%, #e2e8f0 100%) !important;
|
| 455 |
+
transform: translateY(-1px);
|
| 456 |
+
box-shadow:
|
| 457 |
+
0 6px 16px rgba(0, 0, 0, 0.6),
|
| 458 |
+
inset 0 1px 0 rgba(255, 255, 255, 1);
|
| 459 |
}
|
| 460 |
|
| 461 |
button.primary:active, .gr-button-primary:active {
|
| 462 |
+
transform: translateY(1px);
|
| 463 |
+
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.5);
|
| 464 |
}
|
| 465 |
|
| 466 |
+
/* Secondary Buttons (Dark Metal) */
|
| 467 |
button.secondary, .gr-button-secondary, button:not(.primary):not([type="submit"]) {
|
| 468 |
+
background: linear-gradient(180deg, rgba(30, 30, 35, 0.8) 0%, rgba(15, 15, 20, 0.8) 100%) !important;
|
| 469 |
color: var(--text-secondary) !important;
|
| 470 |
+
border: 1px solid rgba(255, 255, 255, 0.08) !important;
|
| 471 |
+
border-top-color: rgba(255, 255, 255, 0.12) !important;
|
| 472 |
border-radius: 12px !important;
|
| 473 |
+
box-shadow: 0 2px 8px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.05);
|
| 474 |
+
transition: all 0.2s ease;
|
| 475 |
}
|
| 476 |
|
| 477 |
button.secondary:hover, .gr-button-secondary:hover {
|
| 478 |
+
background: linear-gradient(180deg, rgba(40, 40, 45, 0.9) 0%, rgba(20, 20, 25, 0.9) 100%) !important;
|
| 479 |
color: var(--text-primary) !important;
|
|
|
|
| 480 |
}
|
| 481 |
|
| 482 |
/* Stats badge */
|
| 483 |
#stats-badge {
|
| 484 |
text-align: center;
|
| 485 |
color: var(--text-muted);
|
| 486 |
+
font-size: 0.7rem;
|
| 487 |
+
padding: 20px 0 4px 0;
|
| 488 |
+
font-weight: 500;
|
| 489 |
+
letter-spacing: 0.05em;
|
| 490 |
+
text-transform: uppercase;
|
| 491 |
}
|
| 492 |
|
| 493 |
/* Scrollbars */
|
| 494 |
::-webkit-scrollbar {
|
| 495 |
+
width: 6px;
|
| 496 |
+
height: 6px;
|
| 497 |
}
|
| 498 |
|
| 499 |
::-webkit-scrollbar-track {
|
|
|
|
| 502 |
|
| 503 |
::-webkit-scrollbar-thumb {
|
| 504 |
background: rgba(255, 255, 255, 0.1);
|
| 505 |
+
border-radius: 3px;
|
| 506 |
}
|
| 507 |
|
| 508 |
::-webkit-scrollbar-thumb:hover {
|
| 509 |
background: rgba(255, 255, 255, 0.2);
|
| 510 |
}
|
| 511 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 512 |
/* Hide default Gradio footer */
|
| 513 |
footer { display: none !important; }
|
| 514 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 515 |
/* Markdown inside chat */
|
| 516 |
.message .prose h1, .message .prose h2, .message .prose h3 {
|
| 517 |
+
color: var(--chrome-light) !important;
|
| 518 |
margin-top: 1em !important;
|
| 519 |
}
|
| 520 |
|
|
|
|
| 523 |
}
|
| 524 |
|
| 525 |
.message .prose code {
|
| 526 |
+
background: rgba(0, 0, 0, 0.5) !important;
|
| 527 |
padding: 2px 6px !important;
|
| 528 |
border-radius: 6px !important;
|
| 529 |
font-size: 0.85em !important;
|
| 530 |
+
color: var(--chrome-mid) !important;
|
| 531 |
border: 1px solid rgba(255, 255, 255, 0.05) !important;
|
| 532 |
}
|
| 533 |
|
| 534 |
.message .prose pre {
|
| 535 |
+
background: rgba(0, 0, 0, 0.6) !important;
|
| 536 |
+
border: 1px solid rgba(255, 255, 255, 0.05) !important;
|
| 537 |
border-radius: 12px !important;
|
| 538 |
padding: 16px !important;
|
| 539 |
+
box-shadow: inset 0 2px 8px rgba(0,0,0,0.4);
|
| 540 |
}
|
| 541 |
"""
|
| 542 |
|
| 543 |
THEME = gr.themes.Base(
|
| 544 |
+
primary_hue="slate",
|
| 545 |
+
secondary_hue="zinc",
|
| 546 |
+
neutral_hue="zinc",
|
| 547 |
font=[gr.themes.GoogleFont("Inter"), "ui-sans-serif", "system-ui", "sans-serif"],
|
| 548 |
).set(
|
| 549 |
+
body_background_fill="#050507",
|
| 550 |
+
block_background_fill="rgba(12, 12, 15, 0.65)",
|
| 551 |
border_color_primary="rgba(255, 255, 255, 0.06)",
|
| 552 |
shadow_spread="0",
|
| 553 |
+
shadow_color="rgba(0,0,0,0.5)",
|
| 554 |
)
|
| 555 |
|
| 556 |
# ============================================================
|
|
|
|
| 558 |
# ============================================================
|
| 559 |
|
| 560 |
def build_demo() -> gr.Blocks:
|
|
|
|
| 561 |
with gr.Blocks(title=MODEL_NAME, css=CUSTOM_CSS, theme=THEME) as demo:
|
| 562 |
gr.HTML(f"""
|
| 563 |
<div id="veylon-header">
|