Benedikt Droste Claude Opus 4.5 commited on
Commit ·
a136b37
1
Parent(s): 5741599
Redesign UI with modern gradient style
Browse files- Subtle gradient background with floating glass-like cards
- Output-focused layout (larger summary panel)
- Purple gradient button with hover lift effect
- Improved shadows and depth throughout
- Better typography with Inter font
- Refined section headers with purple accent
- Polished reasoning and sources sections
- Custom scrollbar styling
- Better mobile responsiveness
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
app.py
CHANGED
|
@@ -429,46 +429,34 @@ def summarize(
|
|
| 429 |
|
| 430 |
THEME = gr.themes.Soft(
|
| 431 |
primary_hue=gr.themes.Color(
|
| 432 |
-
c50="#
|
| 433 |
-
c100="#
|
| 434 |
-
c200="#
|
| 435 |
-
c300="#
|
| 436 |
-
c400="#
|
| 437 |
-
c500="#
|
| 438 |
-
c600="#
|
| 439 |
-
c700="#
|
| 440 |
-
c800="#
|
| 441 |
-
c900="#
|
| 442 |
-
c950="#
|
| 443 |
-
),
|
| 444 |
-
secondary_hue=gr.themes.Color(
|
| 445 |
-
c50="#fdfcfa",
|
| 446 |
-
c100="#f9f7f2",
|
| 447 |
-
c200="#f5f0e5",
|
| 448 |
-
c300="#ebe4d4",
|
| 449 |
-
c400="#ddd4c0",
|
| 450 |
-
c500="#c9bda6",
|
| 451 |
-
c600="#b5a78c",
|
| 452 |
-
c700="#9a8e73",
|
| 453 |
-
c800="#7f755f",
|
| 454 |
-
c900="#665e4d",
|
| 455 |
-
c950="#4d4639",
|
| 456 |
),
|
|
|
|
| 457 |
neutral_hue="slate",
|
| 458 |
-
font=gr.themes.GoogleFont("
|
| 459 |
).set(
|
| 460 |
-
body_background_fill="#
|
| 461 |
-
body_background_fill_dark="#
|
| 462 |
-
block_background_fill="
|
| 463 |
-
block_background_fill_dark="
|
| 464 |
-
block_radius="
|
| 465 |
-
block_shadow="0
|
| 466 |
block_border_width="1px",
|
| 467 |
-
block_border_color="
|
| 468 |
-
button_primary_background_fill="#
|
| 469 |
-
button_primary_background_fill_hover="#
|
| 470 |
button_primary_text_color="#ffffff",
|
| 471 |
-
input_background_fill="
|
| 472 |
input_border_color="#e2e8f0",
|
| 473 |
input_border_width="1px",
|
| 474 |
)
|
|
@@ -478,76 +466,120 @@ CSS = """
|
|
| 478 |
.gradio-container {
|
| 479 |
max-width: 1400px !important;
|
| 480 |
margin: 0 auto !important;
|
| 481 |
-
padding: 2rem !important;
|
|
|
|
| 482 |
}
|
| 483 |
|
| 484 |
/* Header styling */
|
| 485 |
.main-header {
|
| 486 |
text-align: center;
|
| 487 |
-
padding:
|
| 488 |
-
background:
|
| 489 |
-
|
| 490 |
-
|
| 491 |
-
|
| 492 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 493 |
}
|
| 494 |
|
| 495 |
.main-header h1 {
|
| 496 |
-
font-size:
|
| 497 |
-
font-weight:
|
| 498 |
-
|
|
|
|
|
|
|
|
|
|
| 499 |
margin-bottom: 0.5rem;
|
|
|
|
| 500 |
}
|
| 501 |
|
| 502 |
.main-header p {
|
| 503 |
color: #64748b;
|
| 504 |
-
font-size:
|
| 505 |
margin: 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 506 |
}
|
| 507 |
|
| 508 |
/* Section headers */
|
| 509 |
.section-title {
|
| 510 |
-
|
| 511 |
-
font-size: 1rem !important;
|
| 512 |
font-weight: 600 !important;
|
| 513 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 514 |
}
|
| 515 |
|
| 516 |
.section-title h3 {
|
| 517 |
-
color: #
|
|
|
|
|
|
|
|
|
|
|
|
|
| 518 |
margin: 0 !important;
|
| 519 |
}
|
| 520 |
|
| 521 |
/* Summary output */
|
| 522 |
.summary-text {
|
| 523 |
-
font-size:
|
| 524 |
-
line-height: 1.
|
| 525 |
-
color: #
|
| 526 |
background: transparent !important;
|
| 527 |
}
|
| 528 |
|
| 529 |
-
/* Thinking section */
|
| 530 |
.thinking-section {
|
| 531 |
-
background: #
|
| 532 |
-
border-left:
|
| 533 |
-
border-radius: 0
|
| 534 |
-
padding:
|
| 535 |
margin-bottom: 0;
|
|
|
|
| 536 |
}
|
| 537 |
|
| 538 |
.thinking-section p {
|
| 539 |
-
color: #
|
| 540 |
-
font-size: 0.
|
| 541 |
-
line-height: 1.
|
| 542 |
margin: 0 !important;
|
| 543 |
-
opacity: 0.85;
|
| 544 |
}
|
| 545 |
|
| 546 |
/* Summary divider */
|
| 547 |
.summary-divider {
|
| 548 |
-
height:
|
| 549 |
-
background: linear-gradient(90deg, transparent,
|
| 550 |
-
margin: 1.
|
|
|
|
| 551 |
}
|
| 552 |
|
| 553 |
/* Summary section */
|
|
@@ -557,21 +589,22 @@ CSS = """
|
|
| 557 |
|
| 558 |
/* Sources panel */
|
| 559 |
.sources-panel {
|
| 560 |
-
background: #
|
| 561 |
-
border-radius:
|
| 562 |
-
padding:
|
| 563 |
-
font-size: 0.
|
| 564 |
-
max-height:
|
| 565 |
overflow-y: auto !important;
|
| 566 |
-
color: #
|
| 567 |
-
border: 1px solid #
|
| 568 |
}
|
| 569 |
|
| 570 |
.sources-panel p {
|
| 571 |
-
color: #
|
| 572 |
-
margin-bottom: 0.
|
| 573 |
-
padding: 0.
|
| 574 |
-
border-bottom: 1px solid #
|
|
|
|
| 575 |
}
|
| 576 |
|
| 577 |
.sources-panel p:last-child {
|
|
@@ -580,92 +613,119 @@ CSS = """
|
|
| 580 |
}
|
| 581 |
|
| 582 |
.sources-panel strong {
|
| 583 |
-
color: #
|
|
|
|
| 584 |
}
|
| 585 |
|
| 586 |
/* Accordion styling */
|
| 587 |
.accordion {
|
| 588 |
background: transparent !important;
|
| 589 |
-
border: 1px solid #
|
| 590 |
-
border-radius:
|
|
|
|
| 591 |
}
|
| 592 |
|
| 593 |
.accordion > .label-wrap {
|
| 594 |
-
background: #
|
| 595 |
-
|
| 596 |
-
|
|
|
|
| 597 |
}
|
| 598 |
|
| 599 |
/* Generate button */
|
| 600 |
.generate-btn {
|
| 601 |
-
background: #
|
| 602 |
border: none !important;
|
| 603 |
-
font-weight:
|
| 604 |
font-size: 1rem !important;
|
| 605 |
-
padding:
|
| 606 |
-
border-radius: 0.
|
| 607 |
-
transition: all 0.
|
| 608 |
color: #ffffff !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 609 |
}
|
| 610 |
|
| 611 |
.generate-btn:hover {
|
| 612 |
-
background: #
|
| 613 |
-
transform: translateY(-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 614 |
}
|
| 615 |
|
| 616 |
.generate-btn:disabled {
|
| 617 |
-
background: #9ca3af !important;
|
|
|
|
|
|
|
| 618 |
}
|
| 619 |
|
| 620 |
/* Input fields */
|
| 621 |
-
input, textarea {
|
| 622 |
-
background:
|
| 623 |
border: 1px solid #e2e8f0 !important;
|
| 624 |
-
color: #
|
| 625 |
-
border-radius: 0.
|
|
|
|
| 626 |
}
|
| 627 |
|
| 628 |
-
input:focus, textarea:focus {
|
| 629 |
-
border-color: #
|
| 630 |
-
box-shadow: 0 0 0
|
| 631 |
outline: none !important;
|
| 632 |
}
|
| 633 |
|
| 634 |
-
/* File upload */
|
| 635 |
-
.upload-button {
|
| 636 |
-
background:
|
| 637 |
-
border: 2px dashed #
|
| 638 |
-
border-radius:
|
| 639 |
-
transition: all 0.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 640 |
}
|
| 641 |
|
| 642 |
-
|
| 643 |
-
|
| 644 |
-
|
|
|
|
|
|
|
| 645 |
}
|
| 646 |
|
| 647 |
/* Footer */
|
| 648 |
.footer {
|
| 649 |
text-align: center;
|
| 650 |
-
padding:
|
| 651 |
-
margin-top:
|
| 652 |
-
color: #
|
| 653 |
font-size: 0.875rem;
|
| 654 |
}
|
| 655 |
|
| 656 |
.footer a {
|
| 657 |
-
color: #
|
| 658 |
text-decoration: none;
|
| 659 |
-
|
|
|
|
| 660 |
}
|
| 661 |
|
| 662 |
.footer a:hover {
|
| 663 |
-
|
| 664 |
}
|
| 665 |
|
| 666 |
.footer-divider {
|
| 667 |
color: #cbd5e1;
|
| 668 |
-
margin: 0 0.
|
| 669 |
}
|
| 670 |
|
| 671 |
/* Hide default footer */
|
|
@@ -679,19 +739,38 @@ footer {
|
|
| 679 |
padding: 1rem !important;
|
| 680 |
}
|
| 681 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 682 |
.main-header h1 {
|
| 683 |
-
font-size: 1.
|
| 684 |
}
|
| 685 |
|
| 686 |
-
.
|
| 687 |
-
|
|
|
|
| 688 |
}
|
| 689 |
}
|
| 690 |
|
| 691 |
-
/*
|
| 692 |
-
.
|
| 693 |
-
|
| 694 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 695 |
}
|
| 696 |
"""
|
| 697 |
|
|
@@ -713,22 +792,22 @@ def create_app() -> gr.Blocks:
|
|
| 713 |
""")
|
| 714 |
|
| 715 |
with gr.Row(equal_height=False):
|
| 716 |
-
# Left column: Inputs
|
| 717 |
-
with gr.Column(scale=
|
| 718 |
-
gr.Markdown("###
|
| 719 |
|
| 720 |
pdf_input = gr.File(
|
| 721 |
-
label="
|
| 722 |
file_types=[".pdf"],
|
| 723 |
type="filepath",
|
| 724 |
)
|
| 725 |
|
| 726 |
-
gr.Markdown("###
|
| 727 |
|
| 728 |
language = gr.Dropdown(
|
| 729 |
choices=list(LANGUAGES.keys()),
|
| 730 |
value="German",
|
| 731 |
-
label="
|
| 732 |
)
|
| 733 |
|
| 734 |
words = gr.Slider(
|
|
@@ -736,13 +815,13 @@ def create_app() -> gr.Blocks:
|
|
| 736 |
maximum=800,
|
| 737 |
value=250,
|
| 738 |
step=50,
|
| 739 |
-
label="
|
| 740 |
-
info="
|
| 741 |
)
|
| 742 |
|
| 743 |
custom_instruction = gr.Textbox(
|
| 744 |
-
label="
|
| 745 |
-
placeholder="
|
| 746 |
lines=2,
|
| 747 |
)
|
| 748 |
|
|
@@ -753,17 +832,17 @@ def create_app() -> gr.Blocks:
|
|
| 753 |
elem_classes=["generate-btn"],
|
| 754 |
)
|
| 755 |
|
| 756 |
-
# Right column: Output
|
| 757 |
-
with gr.Column(scale=
|
| 758 |
gr.Markdown("### Summary", elem_classes=["section-title"])
|
| 759 |
|
| 760 |
summary_output = gr.Markdown(
|
| 761 |
-
value="*
|
| 762 |
elem_classes=["summary-text"],
|
| 763 |
)
|
| 764 |
|
| 765 |
with gr.Accordion(
|
| 766 |
-
"Source Citations",
|
| 767 |
open=False,
|
| 768 |
visible=False,
|
| 769 |
) as sources_accordion:
|
|
|
|
| 429 |
|
| 430 |
THEME = gr.themes.Soft(
|
| 431 |
primary_hue=gr.themes.Color(
|
| 432 |
+
c50="#faf5ff",
|
| 433 |
+
c100="#f3e8ff",
|
| 434 |
+
c200="#e9d5ff",
|
| 435 |
+
c300="#d8b4fe",
|
| 436 |
+
c400="#c084fc",
|
| 437 |
+
c500="#a855f7",
|
| 438 |
+
c600="#9333ea",
|
| 439 |
+
c700="#7c3aed",
|
| 440 |
+
c800="#6b21a8",
|
| 441 |
+
c900="#581c87",
|
| 442 |
+
c950="#3b0764",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 443 |
),
|
| 444 |
+
secondary_hue="slate",
|
| 445 |
neutral_hue="slate",
|
| 446 |
+
font=gr.themes.GoogleFont("Inter"),
|
| 447 |
).set(
|
| 448 |
+
body_background_fill="linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%)",
|
| 449 |
+
body_background_fill_dark="linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%)",
|
| 450 |
+
block_background_fill="rgba(255, 255, 255, 0.8)",
|
| 451 |
+
block_background_fill_dark="rgba(255, 255, 255, 0.8)",
|
| 452 |
+
block_radius="1rem",
|
| 453 |
+
block_shadow="0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",
|
| 454 |
block_border_width="1px",
|
| 455 |
+
block_border_color="rgba(255, 255, 255, 0.8)",
|
| 456 |
+
button_primary_background_fill="linear-gradient(135deg, #7c3aed 0%, #9333ea 100%)",
|
| 457 |
+
button_primary_background_fill_hover="linear-gradient(135deg, #6d28d9 0%, #7c3aed 100%)",
|
| 458 |
button_primary_text_color="#ffffff",
|
| 459 |
+
input_background_fill="rgba(255, 255, 255, 0.9)",
|
| 460 |
input_border_color="#e2e8f0",
|
| 461 |
input_border_width="1px",
|
| 462 |
)
|
|
|
|
| 466 |
.gradio-container {
|
| 467 |
max-width: 1400px !important;
|
| 468 |
margin: 0 auto !important;
|
| 469 |
+
padding: 2rem 2.5rem !important;
|
| 470 |
+
min-height: 100vh;
|
| 471 |
}
|
| 472 |
|
| 473 |
/* Header styling */
|
| 474 |
.main-header {
|
| 475 |
text-align: center;
|
| 476 |
+
padding: 2.5rem 2rem;
|
| 477 |
+
background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.85) 100%);
|
| 478 |
+
backdrop-filter: blur(10px);
|
| 479 |
+
border-radius: 1.5rem;
|
| 480 |
+
margin-bottom: 2rem;
|
| 481 |
+
border: 1px solid rgba(255, 255, 255, 0.9);
|
| 482 |
+
box-shadow:
|
| 483 |
+
0 4px 6px -1px rgba(0, 0, 0, 0.05),
|
| 484 |
+
0 10px 15px -3px rgba(0, 0, 0, 0.05),
|
| 485 |
+
0 20px 25px -5px rgba(124, 58, 237, 0.05);
|
| 486 |
}
|
| 487 |
|
| 488 |
.main-header h1 {
|
| 489 |
+
font-size: 2.25rem;
|
| 490 |
+
font-weight: 700;
|
| 491 |
+
background: linear-gradient(135deg, #7c3aed 0%, #9333ea 50%, #a855f7 100%);
|
| 492 |
+
-webkit-background-clip: text;
|
| 493 |
+
-webkit-text-fill-color: transparent;
|
| 494 |
+
background-clip: text;
|
| 495 |
margin-bottom: 0.5rem;
|
| 496 |
+
letter-spacing: -0.02em;
|
| 497 |
}
|
| 498 |
|
| 499 |
.main-header p {
|
| 500 |
color: #64748b;
|
| 501 |
+
font-size: 1.05rem;
|
| 502 |
margin: 0;
|
| 503 |
+
font-weight: 400;
|
| 504 |
+
}
|
| 505 |
+
|
| 506 |
+
/* Card styling for columns */
|
| 507 |
+
.input-panel {
|
| 508 |
+
background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.8) 100%) !important;
|
| 509 |
+
backdrop-filter: blur(10px);
|
| 510 |
+
border-radius: 1.25rem !important;
|
| 511 |
+
border: 1px solid rgba(255, 255, 255, 0.8) !important;
|
| 512 |
+
box-shadow:
|
| 513 |
+
0 4px 6px -1px rgba(0, 0, 0, 0.05),
|
| 514 |
+
0 10px 15px -3px rgba(0, 0, 0, 0.05) !important;
|
| 515 |
+
padding: 1.5rem !important;
|
| 516 |
+
}
|
| 517 |
+
|
| 518 |
+
.output-panel {
|
| 519 |
+
background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.9) 100%) !important;
|
| 520 |
+
backdrop-filter: blur(10px);
|
| 521 |
+
border-radius: 1.25rem !important;
|
| 522 |
+
border: 1px solid rgba(255, 255, 255, 0.9) !important;
|
| 523 |
+
box-shadow:
|
| 524 |
+
0 4px 6px -1px rgba(0, 0, 0, 0.05),
|
| 525 |
+
0 10px 15px -3px rgba(0, 0, 0, 0.08),
|
| 526 |
+
0 20px 25px -5px rgba(124, 58, 237, 0.08) !important;
|
| 527 |
+
padding: 1.75rem !important;
|
| 528 |
+
min-height: 400px;
|
| 529 |
}
|
| 530 |
|
| 531 |
/* Section headers */
|
| 532 |
.section-title {
|
| 533 |
+
font-size: 0.875rem !important;
|
|
|
|
| 534 |
font-weight: 600 !important;
|
| 535 |
+
text-transform: uppercase !important;
|
| 536 |
+
letter-spacing: 0.05em !important;
|
| 537 |
+
color: #7c3aed !important;
|
| 538 |
+
margin-bottom: 1rem !important;
|
| 539 |
+
padding-bottom: 0.5rem !important;
|
| 540 |
+
border-bottom: 2px solid rgba(124, 58, 237, 0.1) !important;
|
| 541 |
}
|
| 542 |
|
| 543 |
.section-title h3 {
|
| 544 |
+
color: #7c3aed !important;
|
| 545 |
+
font-size: 0.875rem !important;
|
| 546 |
+
font-weight: 600 !important;
|
| 547 |
+
text-transform: uppercase !important;
|
| 548 |
+
letter-spacing: 0.05em !important;
|
| 549 |
margin: 0 !important;
|
| 550 |
}
|
| 551 |
|
| 552 |
/* Summary output */
|
| 553 |
.summary-text {
|
| 554 |
+
font-size: 1.05rem !important;
|
| 555 |
+
line-height: 1.8 !important;
|
| 556 |
+
color: #1e293b !important;
|
| 557 |
background: transparent !important;
|
| 558 |
}
|
| 559 |
|
| 560 |
+
/* Thinking/Reasoning section */
|
| 561 |
.thinking-section {
|
| 562 |
+
background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
|
| 563 |
+
border-left: 4px solid #9333ea;
|
| 564 |
+
border-radius: 0 1rem 1rem 0;
|
| 565 |
+
padding: 1.25rem 1.5rem;
|
| 566 |
margin-bottom: 0;
|
| 567 |
+
box-shadow: inset 0 2px 4px rgba(147, 51, 234, 0.05);
|
| 568 |
}
|
| 569 |
|
| 570 |
.thinking-section p {
|
| 571 |
+
color: #6b21a8 !important;
|
| 572 |
+
font-size: 0.95rem !important;
|
| 573 |
+
line-height: 1.7 !important;
|
| 574 |
margin: 0 !important;
|
|
|
|
| 575 |
}
|
| 576 |
|
| 577 |
/* Summary divider */
|
| 578 |
.summary-divider {
|
| 579 |
+
height: 2px;
|
| 580 |
+
background: linear-gradient(90deg, transparent, rgba(147, 51, 234, 0.2), transparent);
|
| 581 |
+
margin: 1.5rem 0;
|
| 582 |
+
border-radius: 1px;
|
| 583 |
}
|
| 584 |
|
| 585 |
/* Summary section */
|
|
|
|
| 589 |
|
| 590 |
/* Sources panel */
|
| 591 |
.sources-panel {
|
| 592 |
+
background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%) !important;
|
| 593 |
+
border-radius: 1rem !important;
|
| 594 |
+
padding: 1.25rem !important;
|
| 595 |
+
font-size: 0.925rem !important;
|
| 596 |
+
max-height: 350px !important;
|
| 597 |
overflow-y: auto !important;
|
| 598 |
+
color: #374151 !important;
|
| 599 |
+
border: 1px solid #e5e7eb !important;
|
| 600 |
}
|
| 601 |
|
| 602 |
.sources-panel p {
|
| 603 |
+
color: #374151 !important;
|
| 604 |
+
margin-bottom: 0.75rem !important;
|
| 605 |
+
padding: 0.75rem 0 !important;
|
| 606 |
+
border-bottom: 1px solid #e5e7eb !important;
|
| 607 |
+
line-height: 1.6 !important;
|
| 608 |
}
|
| 609 |
|
| 610 |
.sources-panel p:last-child {
|
|
|
|
| 613 |
}
|
| 614 |
|
| 615 |
.sources-panel strong {
|
| 616 |
+
color: #7c3aed !important;
|
| 617 |
+
font-weight: 600 !important;
|
| 618 |
}
|
| 619 |
|
| 620 |
/* Accordion styling */
|
| 621 |
.accordion {
|
| 622 |
background: transparent !important;
|
| 623 |
+
border: 1px solid #e5e7eb !important;
|
| 624 |
+
border-radius: 1rem !important;
|
| 625 |
+
overflow: hidden !important;
|
| 626 |
}
|
| 627 |
|
| 628 |
.accordion > .label-wrap {
|
| 629 |
+
background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%) !important;
|
| 630 |
+
padding: 1rem 1.25rem !important;
|
| 631 |
+
font-weight: 500 !important;
|
| 632 |
+
color: #374151 !important;
|
| 633 |
}
|
| 634 |
|
| 635 |
/* Generate button */
|
| 636 |
.generate-btn {
|
| 637 |
+
background: linear-gradient(135deg, #7c3aed 0%, #9333ea 100%) !important;
|
| 638 |
border: none !important;
|
| 639 |
+
font-weight: 600 !important;
|
| 640 |
font-size: 1rem !important;
|
| 641 |
+
padding: 1rem 2rem !important;
|
| 642 |
+
border-radius: 0.875rem !important;
|
| 643 |
+
transition: all 0.2s ease !important;
|
| 644 |
color: #ffffff !important;
|
| 645 |
+
box-shadow:
|
| 646 |
+
0 4px 6px -1px rgba(124, 58, 237, 0.3),
|
| 647 |
+
0 2px 4px -2px rgba(124, 58, 237, 0.2) !important;
|
| 648 |
+
width: 100% !important;
|
| 649 |
+
margin-top: 0.5rem !important;
|
| 650 |
}
|
| 651 |
|
| 652 |
.generate-btn:hover {
|
| 653 |
+
background: linear-gradient(135deg, #6d28d9 0%, #7c3aed 100%) !important;
|
| 654 |
+
transform: translateY(-2px) !important;
|
| 655 |
+
box-shadow:
|
| 656 |
+
0 8px 12px -2px rgba(124, 58, 237, 0.35),
|
| 657 |
+
0 4px 6px -2px rgba(124, 58, 237, 0.25) !important;
|
| 658 |
+
}
|
| 659 |
+
|
| 660 |
+
.generate-btn:active {
|
| 661 |
+
transform: translateY(0) !important;
|
| 662 |
}
|
| 663 |
|
| 664 |
.generate-btn:disabled {
|
| 665 |
+
background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%) !important;
|
| 666 |
+
box-shadow: none !important;
|
| 667 |
+
transform: none !important;
|
| 668 |
}
|
| 669 |
|
| 670 |
/* Input fields */
|
| 671 |
+
input, textarea, select {
|
| 672 |
+
background: rgba(255, 255, 255, 0.9) !important;
|
| 673 |
border: 1px solid #e2e8f0 !important;
|
| 674 |
+
color: #1e293b !important;
|
| 675 |
+
border-radius: 0.75rem !important;
|
| 676 |
+
transition: all 0.2s ease !important;
|
| 677 |
}
|
| 678 |
|
| 679 |
+
input:focus, textarea:focus, select:focus {
|
| 680 |
+
border-color: #9333ea !important;
|
| 681 |
+
box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.1) !important;
|
| 682 |
outline: none !important;
|
| 683 |
}
|
| 684 |
|
| 685 |
+
/* File upload area */
|
| 686 |
+
.upload-button, [data-testid="file"] {
|
| 687 |
+
background: rgba(255, 255, 255, 0.8) !important;
|
| 688 |
+
border: 2px dashed #d8b4fe !important;
|
| 689 |
+
border-radius: 1rem !important;
|
| 690 |
+
transition: all 0.2s ease !important;
|
| 691 |
+
padding: 1.5rem !important;
|
| 692 |
+
}
|
| 693 |
+
|
| 694 |
+
.upload-button:hover, [data-testid="file"]:hover {
|
| 695 |
+
border-color: #9333ea !important;
|
| 696 |
+
background: rgba(250, 245, 255, 0.8) !important;
|
| 697 |
}
|
| 698 |
|
| 699 |
+
/* Labels */
|
| 700 |
+
label {
|
| 701 |
+
color: #475569 !important;
|
| 702 |
+
font-weight: 500 !important;
|
| 703 |
+
font-size: 0.9rem !important;
|
| 704 |
}
|
| 705 |
|
| 706 |
/* Footer */
|
| 707 |
.footer {
|
| 708 |
text-align: center;
|
| 709 |
+
padding: 2rem;
|
| 710 |
+
margin-top: 2rem;
|
| 711 |
+
color: #94a3b8;
|
| 712 |
font-size: 0.875rem;
|
| 713 |
}
|
| 714 |
|
| 715 |
.footer a {
|
| 716 |
+
color: #7c3aed;
|
| 717 |
text-decoration: none;
|
| 718 |
+
font-weight: 500;
|
| 719 |
+
transition: all 0.2s ease;
|
| 720 |
}
|
| 721 |
|
| 722 |
.footer a:hover {
|
| 723 |
+
color: #9333ea;
|
| 724 |
}
|
| 725 |
|
| 726 |
.footer-divider {
|
| 727 |
color: #cbd5e1;
|
| 728 |
+
margin: 0 0.75rem;
|
| 729 |
}
|
| 730 |
|
| 731 |
/* Hide default footer */
|
|
|
|
| 739 |
padding: 1rem !important;
|
| 740 |
}
|
| 741 |
|
| 742 |
+
.main-header {
|
| 743 |
+
padding: 1.75rem 1.25rem;
|
| 744 |
+
border-radius: 1rem;
|
| 745 |
+
}
|
| 746 |
+
|
| 747 |
.main-header h1 {
|
| 748 |
+
font-size: 1.75rem;
|
| 749 |
}
|
| 750 |
|
| 751 |
+
.input-panel, .output-panel {
|
| 752 |
+
border-radius: 1rem !important;
|
| 753 |
+
padding: 1.25rem !important;
|
| 754 |
}
|
| 755 |
}
|
| 756 |
|
| 757 |
+
/* Smooth scrollbar for sources */
|
| 758 |
+
.sources-panel::-webkit-scrollbar {
|
| 759 |
+
width: 6px;
|
| 760 |
+
}
|
| 761 |
+
|
| 762 |
+
.sources-panel::-webkit-scrollbar-track {
|
| 763 |
+
background: #f1f5f9;
|
| 764 |
+
border-radius: 3px;
|
| 765 |
+
}
|
| 766 |
+
|
| 767 |
+
.sources-panel::-webkit-scrollbar-thumb {
|
| 768 |
+
background: #cbd5e1;
|
| 769 |
+
border-radius: 3px;
|
| 770 |
+
}
|
| 771 |
+
|
| 772 |
+
.sources-panel::-webkit-scrollbar-thumb:hover {
|
| 773 |
+
background: #94a3b8;
|
| 774 |
}
|
| 775 |
"""
|
| 776 |
|
|
|
|
| 792 |
""")
|
| 793 |
|
| 794 |
with gr.Row(equal_height=False):
|
| 795 |
+
# Left column: Inputs (compact)
|
| 796 |
+
with gr.Column(scale=2, elem_classes=["input-panel"]):
|
| 797 |
+
gr.Markdown("### Document", elem_classes=["section-title"])
|
| 798 |
|
| 799 |
pdf_input = gr.File(
|
| 800 |
+
label="Upload PDF",
|
| 801 |
file_types=[".pdf"],
|
| 802 |
type="filepath",
|
| 803 |
)
|
| 804 |
|
| 805 |
+
gr.Markdown("### Options", elem_classes=["section-title"])
|
| 806 |
|
| 807 |
language = gr.Dropdown(
|
| 808 |
choices=list(LANGUAGES.keys()),
|
| 809 |
value="German",
|
| 810 |
+
label="Language",
|
| 811 |
)
|
| 812 |
|
| 813 |
words = gr.Slider(
|
|
|
|
| 815 |
maximum=800,
|
| 816 |
value=250,
|
| 817 |
step=50,
|
| 818 |
+
label="Summary Length",
|
| 819 |
+
info="Word count target",
|
| 820 |
)
|
| 821 |
|
| 822 |
custom_instruction = gr.Textbox(
|
| 823 |
+
label="Instructions (Optional)",
|
| 824 |
+
placeholder="Focus on key findings...",
|
| 825 |
lines=2,
|
| 826 |
)
|
| 827 |
|
|
|
|
| 832 |
elem_classes=["generate-btn"],
|
| 833 |
)
|
| 834 |
|
| 835 |
+
# Right column: Output (larger, prominent)
|
| 836 |
+
with gr.Column(scale=3, elem_classes=["output-panel"]):
|
| 837 |
gr.Markdown("### Summary", elem_classes=["section-title"])
|
| 838 |
|
| 839 |
summary_output = gr.Markdown(
|
| 840 |
+
value="*Upload a PDF and click Generate to create a grounded summary with citations.*",
|
| 841 |
elem_classes=["summary-text"],
|
| 842 |
)
|
| 843 |
|
| 844 |
with gr.Accordion(
|
| 845 |
+
"View Source Citations",
|
| 846 |
open=False,
|
| 847 |
visible=False,
|
| 848 |
) as sources_accordion:
|