Update page_files/Home.py
Browse files- page_files/Home.py +125 -143
page_files/Home.py
CHANGED
|
@@ -532,171 +532,153 @@ st.markdown("""
|
|
| 532 |
|
| 533 |
|
| 534 |
|
| 535 |
-
|
|
|
|
|
|
|
|
|
|
| 536 |
|
| 537 |
-
|
| 538 |
-
|
|
|
|
|
|
|
| 539 |
<style>
|
| 540 |
-
|
| 541 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 542 |
background: #fff;
|
| 543 |
-
|
| 544 |
-
|
| 545 |
-
/*
|
| 546 |
-
.showcase-
|
| 547 |
-
|
| 548 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 549 |
font-weight: 800;
|
| 550 |
color: #0f1f1a;
|
| 551 |
letter-spacing: -1px;
|
| 552 |
-
line-height: 1.
|
| 553 |
-
margin-bottom:
|
| 554 |
-
}
|
| 555 |
-
.showcase-sub {
|
| 556 |
-
font-family: 'DM Sans', sans-serif;
|
| 557 |
color: #5a6b65;
|
| 558 |
-
font-size: 0.
|
| 559 |
-
line-height: 1.
|
| 560 |
-
}
|
| 561 |
-
|
| 562 |
-
|
| 563 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 564 |
overflow: hidden;
|
| 565 |
-
|
| 566 |
-
|
| 567 |
-
|
| 568 |
-
|
|
|
|
|
|
|
|
|
|
| 569 |
cursor: pointer;
|
| 570 |
-
|
| 571 |
-
|
| 572 |
-
|
| 573 |
-
box-shadow: 0 6px 24px rgba(0,0,0,0.11);
|
| 574 |
border-color: #8ACAFF;
|
| 575 |
-
|
| 576 |
-
|
|
|
|
| 577 |
width: 100%;
|
| 578 |
-
|
| 579 |
object-fit: cover;
|
| 580 |
-
|
| 581 |
-
|
| 582 |
-
|
| 583 |
-
|
| 584 |
-
|
| 585 |
-
|
| 586 |
-
|
| 587 |
-
|
| 588 |
-
|
| 589 |
-
|
| 590 |
-
|
| 591 |
-
|
| 592 |
-
.aim-showcase-card-tag {
|
| 593 |
-
font-family: 'DM Sans', sans-serif;
|
| 594 |
-
font-size: 0.7rem;
|
| 595 |
font-weight: 700;
|
| 596 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 597 |
color: #8ACAFF;
|
| 598 |
-
text-
|
| 599 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 600 |
</style>
|
| 601 |
-
|
| 602 |
-
|
| 603 |
-
left_col, right_col = st.columns([1, 1.2], gap="large")
|
| 604 |
|
| 605 |
-
|
| 606 |
-
|
| 607 |
-
|
| 608 |
-
<div class="showcase-heading">Accelerate Your
|
| 609 |
<p class="showcase-sub">Access a centralized, open-source database for experimental composite
|
| 610 |
material properties. Polymer, fiber, and composite datasets, all in one place.</p>
|
| 611 |
</div>
|
| 612 |
-
""", unsafe_allow_html=True)
|
| 613 |
|
| 614 |
-
|
| 615 |
-
|
| 616 |
-
|
| 617 |
-
|
| 618 |
-
|
| 619 |
-
|
| 620 |
-
|
| 621 |
-
|
| 622 |
-
|
| 623 |
-
|
| 624 |
-
|
| 625 |
-
|
| 626 |
-
|
| 627 |
-
|
| 628 |
-
|
| 629 |
-
|
| 630 |
-
|
| 631 |
-
|
| 632 |
-
|
| 633 |
-
|
| 634 |
-
width: 100% !important;
|
| 635 |
-
object-fit: cover !important;
|
| 636 |
-
max-height: 190px !important;
|
| 637 |
-
display: block !important;
|
| 638 |
-
}
|
| 639 |
-
.aim-showcase-card-wrap [data-testid="stImage"] {
|
| 640 |
-
margin: 0 !important;
|
| 641 |
-
padding: 0 !important;
|
| 642 |
-
line-height: 0 !important;
|
| 643 |
-
}
|
| 644 |
-
.aim-card-footer {
|
| 645 |
-
padding: 14px 18px 16px;
|
| 646 |
-
background: #f7f8f9;
|
| 647 |
-
}
|
| 648 |
-
.aim-card-footer-title {
|
| 649 |
-
font-family: 'DM Sans', sans-serif;
|
| 650 |
-
font-size: 1rem;
|
| 651 |
-
font-weight: 700;
|
| 652 |
-
color: #0f1f1a;
|
| 653 |
-
margin-bottom: 3px;
|
| 654 |
-
}
|
| 655 |
-
.aim-card-footer-tag {
|
| 656 |
-
font-family: 'DM Sans', sans-serif;
|
| 657 |
-
font-size: 0.7rem;
|
| 658 |
-
font-weight: 700;
|
| 659 |
-
letter-spacing: 1.2px;
|
| 660 |
-
color: #8ACAFF;
|
| 661 |
-
text-transform: uppercase;
|
| 662 |
-
}
|
| 663 |
-
/* Nav buttons */
|
| 664 |
-
.st-key-showcase_extract_btn button,
|
| 665 |
-
.st-key-showcase_search_btn button {
|
| 666 |
-
background: transparent !important;
|
| 667 |
-
border: none !important;
|
| 668 |
-
color: #8ACAFF !important;
|
| 669 |
-
font-family: 'DM Sans', sans-serif !important;
|
| 670 |
-
font-size: 0.82rem !important;
|
| 671 |
-
font-weight: 600 !important;
|
| 672 |
-
padding: 0 0 18px 0 !important;
|
| 673 |
-
height: auto !important;
|
| 674 |
-
box-shadow: none !important;
|
| 675 |
-
text-align: left !important;
|
| 676 |
-
}
|
| 677 |
-
</style>
|
| 678 |
-
""", unsafe_allow_html=True)
|
| 679 |
|
| 680 |
-
|
| 681 |
-
|
| 682 |
-
'<div class="aim-showcase-card-wrap"><img src="' + extract_card_img + '" style="width:100%;max-height:190px;object-fit:cover;display:block;"/>'
|
| 683 |
-
'<div class="aim-card-footer"><div class="aim-card-footer-title">Extract Data</div>'
|
| 684 |
-
'<div class="aim-card-footer-tag">Platform</div></div></div>',
|
| 685 |
-
unsafe_allow_html=True
|
| 686 |
-
)
|
| 687 |
-
st.switch_page("page_files/Upload_Data.py")
|
| 688 |
-
|
| 689 |
|
| 690 |
-
# ── Search card ──
|
| 691 |
-
if st.button("Go to Search →", key="showcase_search_btn"):
|
| 692 |
-
st.markdown(
|
| 693 |
-
'<div class="aim-showcase-card-wrap"><img src="' + search_card_img + '" style="width:100%;max-height:190px;object-fit:cover;display:block;"/>'
|
| 694 |
-
'<div class="aim-card-footer"><div class="aim-card-footer-title">Search</div>'
|
| 695 |
-
'<div class="aim-card-footer-tag">Data Page</div></div></div>',
|
| 696 |
-
unsafe_allow_html=True
|
| 697 |
-
)
|
| 698 |
-
st.switch_page("page_files/Categorized_Search.py")
|
| 699 |
-
st.markdown("<div style='background:#fff; padding: 12px 0; border-bottom: 1px solid #e8e8e4;'></div>", unsafe_allow_html=True)
|
| 700 |
|
| 701 |
|
| 702 |
|
|
|
|
| 532 |
|
| 533 |
|
| 534 |
|
| 535 |
+
# Showcase section - Databricks style
|
| 536 |
+
# Cards rendered in components.html so image+text+click all live inside one card
|
| 537 |
+
_extract_img = extract_card_img
|
| 538 |
+
_search_img = search_card_img
|
| 539 |
|
| 540 |
+
components.html(f"""
|
| 541 |
+
<!DOCTYPE html><html lang="en"><head>
|
| 542 |
+
<meta charset="UTF-8"/>
|
| 543 |
+
<link href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&display=swap" rel="stylesheet">
|
| 544 |
<style>
|
| 545 |
+
*, *::before, *::after {{ box-sizing: border-box; margin: 0; padding: 0; }}
|
| 546 |
+
body {{ font-family: 'DM Sans', sans-serif; background: #fff; }}
|
| 547 |
+
|
| 548 |
+
.showcase-wrap {{
|
| 549 |
+
display: flex;
|
| 550 |
+
align-items: flex-start;
|
| 551 |
+
gap: 48px;
|
| 552 |
+
padding: 64px 60px 64px;
|
| 553 |
background: #fff;
|
| 554 |
+
}}
|
| 555 |
+
|
| 556 |
+
/* LEFT TEXT */
|
| 557 |
+
.showcase-left {{
|
| 558 |
+
flex: 0 0 320px;
|
| 559 |
+
padding-top: 16px;
|
| 560 |
+
}}
|
| 561 |
+
.showcase-label {{
|
| 562 |
+
font-size: 0.68rem;
|
| 563 |
+
font-weight: 700;
|
| 564 |
+
letter-spacing: 1.8px;
|
| 565 |
+
text-transform: uppercase;
|
| 566 |
+
color: #8ACAFF;
|
| 567 |
+
margin-bottom: 14px;
|
| 568 |
+
}}
|
| 569 |
+
.showcase-heading {{
|
| 570 |
+
font-size: clamp(1.8rem, 3vw, 2.4rem);
|
| 571 |
font-weight: 800;
|
| 572 |
color: #0f1f1a;
|
| 573 |
letter-spacing: -1px;
|
| 574 |
+
line-height: 1.15;
|
| 575 |
+
margin-bottom: 16px;
|
| 576 |
+
}}
|
| 577 |
+
.showcase-sub {{
|
|
|
|
| 578 |
color: #5a6b65;
|
| 579 |
+
font-size: 0.93rem;
|
| 580 |
+
line-height: 1.7;
|
| 581 |
+
}}
|
| 582 |
+
|
| 583 |
+
/* RIGHT CARDS */
|
| 584 |
+
.showcase-cards {{
|
| 585 |
+
flex: 1;
|
| 586 |
+
display: flex;
|
| 587 |
+
gap: 20px;
|
| 588 |
+
}}
|
| 589 |
+
.s-card {{
|
| 590 |
+
flex: 1;
|
| 591 |
+
border-radius: 16px;
|
| 592 |
overflow: hidden;
|
| 593 |
+
background: #0f1f1a;
|
| 594 |
+
border: 1.5px solid #1e3a30;
|
| 595 |
+
box-shadow: 0 4px 20px rgba(0,0,0,0.10);
|
| 596 |
+
text-decoration: none;
|
| 597 |
+
display: flex;
|
| 598 |
+
flex-direction: column;
|
| 599 |
+
transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
|
| 600 |
cursor: pointer;
|
| 601 |
+
}}
|
| 602 |
+
.s-card:hover {{
|
| 603 |
+
box-shadow: 0 8px 32px rgba(138,202,255,0.18);
|
|
|
|
| 604 |
border-color: #8ACAFF;
|
| 605 |
+
transform: translateY(-3px);
|
| 606 |
+
}}
|
| 607 |
+
.s-card-img {{
|
| 608 |
width: 100%;
|
| 609 |
+
height: 200px;
|
| 610 |
object-fit: cover;
|
| 611 |
+
object-position: top left;
|
| 612 |
+
display: block;
|
| 613 |
+
border-bottom: 1px solid #1e3a30;
|
| 614 |
+
}}
|
| 615 |
+
.s-card-body {{
|
| 616 |
+
padding: 22px 22px 26px;
|
| 617 |
+
flex: 1;
|
| 618 |
+
display: flex;
|
| 619 |
+
flex-direction: column;
|
| 620 |
+
}}
|
| 621 |
+
.s-card-title {{
|
| 622 |
+
font-size: 1.15rem;
|
|
|
|
|
|
|
|
|
|
| 623 |
font-weight: 700;
|
| 624 |
+
color: #fff;
|
| 625 |
+
margin-bottom: 8px;
|
| 626 |
+
letter-spacing: -0.3px;
|
| 627 |
+
}}
|
| 628 |
+
.s-card-desc {{
|
| 629 |
+
font-size: 0.85rem;
|
| 630 |
+
color: #7a9e8f;
|
| 631 |
+
line-height: 1.6;
|
| 632 |
+
flex: 1;
|
| 633 |
+
margin-bottom: 18px;
|
| 634 |
+
}}
|
| 635 |
+
.s-card-link {{
|
| 636 |
+
font-size: 0.85rem;
|
| 637 |
+
font-weight: 600;
|
| 638 |
color: #8ACAFF;
|
| 639 |
+
text-decoration: none;
|
| 640 |
+
display: inline-flex;
|
| 641 |
+
align-items: center;
|
| 642 |
+
gap: 6px;
|
| 643 |
+
}}
|
| 644 |
+
.s-card-link::after {{
|
| 645 |
+
content: "\2192";
|
| 646 |
+
}}
|
| 647 |
</style>
|
| 648 |
+
</head><body>
|
|
|
|
|
|
|
| 649 |
|
| 650 |
+
<div class="showcase-wrap">
|
| 651 |
+
<div class="showcase-left">
|
| 652 |
+
<div class="showcase-label">Platform Features</div>
|
| 653 |
+
<div class="showcase-heading">Accelerate Your Composites Research</div>
|
| 654 |
<p class="showcase-sub">Access a centralized, open-source database for experimental composite
|
| 655 |
material properties. Polymer, fiber, and composite datasets, all in one place.</p>
|
| 656 |
</div>
|
|
|
|
| 657 |
|
| 658 |
+
<div class="showcase-cards">
|
| 659 |
+
<a class="s-card" href="/Upload_Data" target="_self">
|
| 660 |
+
<img class="s-card-img" src="{_extract_img}" alt="Extract Data"/>
|
| 661 |
+
<div class="s-card-body">
|
| 662 |
+
<div class="s-card-title">Extract Data</div>
|
| 663 |
+
<p class="s-card-desc">Upload experimental datasets and extract structured material property data into the AIM database.</p>
|
| 664 |
+
<span class="s-card-link">Open platform</span>
|
| 665 |
+
</div>
|
| 666 |
+
</a>
|
| 667 |
+
|
| 668 |
+
<a class="s-card" href="/Categorized_Search" target="_self">
|
| 669 |
+
<img class="s-card-img" src="{_search_img}" alt="Search"/>
|
| 670 |
+
<div class="s-card-body">
|
| 671 |
+
<div class="s-card-title">Search</div>
|
| 672 |
+
<p class="s-card-desc">Browse and filter polymer, fiber, and composite material properties across the full database.</p>
|
| 673 |
+
<span class="s-card-link">Open search</span>
|
| 674 |
+
</div>
|
| 675 |
+
</a>
|
| 676 |
+
</div>
|
| 677 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 678 |
|
| 679 |
+
</body></html>
|
| 680 |
+
""", height=420, scrolling=False)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 681 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 682 |
|
| 683 |
|
| 684 |
|