gvlktejaswi commited on
Commit
2fecef7
Β·
verified Β·
1 Parent(s): 2c3edd9

Update page_files/Home.py

Browse files
Files changed (1) hide show
  1. page_files/Home.py +30 -77
page_files/Home.py CHANGED
@@ -189,14 +189,6 @@ st.markdown("""
189
 
190
 
191
 
192
- # Card click navigation handler
193
- _nav = st.query_params.get("nav", None)
194
- if _nav == "upload":
195
- st.query_params.clear()
196
- st.switch_page("page_files/Upload_Data.py")
197
- elif _nav == "search":
198
- st.query_params.clear()
199
- st.switch_page("page_files/Categorized_Search.py")
200
 
201
 
202
 
@@ -513,76 +505,36 @@ st.markdown("""
513
 
514
 
515
  # Showcase section - Databricks style
516
- def _build_showcase_html(extract_b64, search_b64):
517
- left = (
518
- "<div class=\"showcase-left\">"
519
- "<div class=\"showcase-label\">Platform Features</div>"
520
- "<div class=\"showcase-heading\">Accelerate Your Composites Research</div>"
521
- "<p class=\"showcase-sub\">Access a centralized, open-source database for experimental "
522
- "composite material properties. Polymer, fiber, and composite datasets, all in one place.</p>"
523
- "</div>"
524
- )
525
- extract_card = (
526
- "<div class=\"s-card\">"
527
- "<img class=\"s-card-img\" src=\"" + extract_b64 + "\" alt=\"Extract Data\"/>"
528
- "<div class=\"s-card-body\">"
529
- "<div class=\"s-card-title\">Extract Data</div>"
530
- "<p class=\"s-card-desc\">Upload experimental datasets and extract structured material property data into the AIM database.</p>"
531
- "<span class=\"s-card-link\">Open platform &#x2192;</span>"
532
- "</div></div>"
533
- )
534
- search_card = (
535
- "<div class=\"s-card\">"
536
- "<img class=\"s-card-img\" src=\"" + search_b64 + "\" alt=\"Search\"/>"
537
- "<div class=\"s-card-body\">"
538
- "<div class=\"s-card-title\">Search</div>"
539
- "<p class=\"s-card-desc\">Browse and filter polymer, fiber, and composite material properties across the full database.</p>"
540
- "<span class=\"s-card-link\">Open search &#x2192;</span>"
541
- "</div></div>"
542
- )
543
- css = (
544
- "<style>"
545
- "*,*::before,*::after{box-sizing:border-box;margin:0;padding:0;}"
546
- "body{font-family:'DM Sans',sans-serif;background:#fff;}"
547
- ".showcase-wrap{display:flex;align-items:flex-start;gap:48px;padding:64px 60px;background:#fff;}"
548
- ".showcase-left{flex:0 0 280px;padding-top:16px;}"
549
- ".showcase-label{font-size:.68rem;font-weight:700;letter-spacing:1.8px;text-transform:uppercase;color:#8ACAFF;margin-bottom:14px;}"
550
- ".showcase-heading{font-size:2rem;font-weight:800;color:#0f1f1a;letter-spacing:-1px;line-height:1.15;margin-bottom:16px;}"
551
- ".showcase-sub{color:#5a6b65;font-size:.93rem;line-height:1.7;}"
552
- ".showcase-cards{flex:1;display:flex;gap:20px;}"
553
- ".s-card{flex:1;border-radius:16px;overflow:hidden;background:#0f1f1a;border:1.5px solid #1e3a30;"
554
- "box-shadow:0 4px 20px rgba(0,0,0,.10);display:flex;flex-direction:column;"
555
- "cursor:pointer;transition:box-shadow .2s,border-color .2s,transform .2s;}"
556
- ".s-card:hover{box-shadow:0 8px 32px rgba(138,202,255,.18);border-color:#8ACAFF;transform:translateY(-3px);}"
557
- ".s-card-img{width:100%;height:220px;object-fit:contain;object-position:top center;"
558
- "display:block;background:#fff;border-bottom:1px solid #1e3a30;}"
559
- ".s-card-body{padding:20px 22px 24px;flex:1;display:flex;flex-direction:column;}"
560
- ".s-card-title{font-size:1.1rem;font-weight:700;color:#fff;margin-bottom:8px;}"
561
- ".s-card-desc{font-size:.83rem;color:#7a9e8f;line-height:1.6;flex:1;margin-bottom:16px;}"
562
- ".s-card-link{font-size:.83rem;font-weight:600;color:#8ACAFF;}"
563
- "</style>"
564
- )
565
- return (
566
- "<!DOCTYPE html><html lang=\"en\"><head><meta charset=\"UTF-8\"/>"
567
- "<link href=\"https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&display=swap\" rel=\"stylesheet\">"
568
- + css +
569
- "</head><body>"
570
- "<div class=\"showcase-wrap\">"
571
- + left +
572
- "<div class=\"showcase-cards\">"
573
- + extract_card + search_card +
574
- "</div></div>"
575
- "</body></html>"
576
- )
577
-
578
-
579
- components.html(_build_showcase_html(extract_card_img, search_card_img), height=480, scrolling=False)
580
 
581
- _left_gap, _col1, _col2 = st.columns([0.85, 1, 1])
582
- with _col1:
 
 
 
 
 
 
583
  if st.button("Open Extract Data β†’", key="_nav_upload", use_container_width=True):
584
  st.switch_page("page_files/Upload_Data.py")
585
- with _col2:
 
 
 
 
 
 
 
 
586
  if st.button("Open Search β†’", key="_nav_search", use_container_width=True):
587
  st.switch_page("page_files/Categorized_Search.py")
588
 
@@ -592,13 +544,13 @@ st.markdown("""
592
  background: #0f1f1a !important;
593
  color: #8ACAFF !important;
594
  border: 1.5px solid #1e3a30 !important;
595
- border-radius: 10px !important;
596
  font-family: 'DM Sans', sans-serif !important;
597
  font-weight: 600 !important;
598
  font-size: 0.88rem !important;
599
  height: 44px !important;
600
  box-shadow: none !important;
601
- margin-top: -24px !important;
602
  margin-bottom: 40px !important;
603
  }
604
  .st-key-_nav_upload button:hover, .st-key-_nav_search button:hover {
@@ -610,6 +562,7 @@ st.markdown("""
610
  """, unsafe_allow_html=True)
611
 
612
 
 
613
  # ══════════════════════════════════════════════════════════════════════════════
614
  # 6. ABOUT + FOOTER (static HTML)
615
  # ══════════════════════════════════════════════════════════════════════════════
 
189
 
190
 
191
 
 
 
 
 
 
 
 
 
192
 
193
 
194
 
 
505
 
506
 
507
  # Showcase section - Databricks style
508
+ _left, _card1, _card2 = st.columns([0.85, 1, 1])
509
+
510
+ with _left:
511
+ st.markdown("""
512
+ <div style="padding-top:32px;">
513
+ <div style="font-size:.68rem;font-weight:700;letter-spacing:1.8px;text-transform:uppercase;color:#8ACAFF;margin-bottom:14px;font-family:'DM Sans',sans-serif;">Platform Features</div>
514
+ <div style="font-size:2rem;font-weight:800;color:#0f1f1a;letter-spacing:-1px;line-height:1.15;margin-bottom:16px;font-family:'DM Sans',sans-serif;">Accelerate Your Composites Research</div>
515
+ <p style="color:#5a6b65;font-size:.93rem;line-height:1.7;font-family:'DM Sans',sans-serif;">Access a centralized, open-source database for experimental composite material properties. Polymer, fiber, and composite datasets, all in one place.</p>
516
+ </div>
517
+ """, unsafe_allow_html=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
518
 
519
+ with _card1:
520
+ st.image(str(_ROOT / "extract_card_img.png"), use_container_width=True)
521
+ st.markdown("""
522
+ <div style="background:#0f1f1a;padding:16px 20px 8px;border:1.5px solid #1e3a30;border-top:none;border-bottom:none;">
523
+ <div style="font-size:1.05rem;font-weight:700;color:#fff;font-family:'DM Sans',sans-serif;">Extract Data</div>
524
+ <p style="font-size:.82rem;color:#7a9e8f;margin:6px 0 0;font-family:'DM Sans',sans-serif;">Upload experimental datasets and extract structured material property data into the AIM database.</p>
525
+ </div>
526
+ """, unsafe_allow_html=True)
527
  if st.button("Open Extract Data β†’", key="_nav_upload", use_container_width=True):
528
  st.switch_page("page_files/Upload_Data.py")
529
+
530
+ with _card2:
531
+ st.image(str(_ROOT / "search_card_img.png"), use_container_width=True)
532
+ st.markdown("""
533
+ <div style="background:#0f1f1a;padding:16px 20px 8px;border:1.5px solid #1e3a30;border-top:none;border-bottom:none;">
534
+ <div style="font-size:1.05rem;font-weight:700;color:#fff;font-family:'DM Sans',sans-serif;">Search</div>
535
+ <p style="font-size:.82rem;color:#7a9e8f;margin:6px 0 0;font-family:'DM Sans',sans-serif;">Browse and filter polymer, fiber, and composite material properties across the full database.</p>
536
+ </div>
537
+ """, unsafe_allow_html=True)
538
  if st.button("Open Search β†’", key="_nav_search", use_container_width=True):
539
  st.switch_page("page_files/Categorized_Search.py")
540
 
 
544
  background: #0f1f1a !important;
545
  color: #8ACAFF !important;
546
  border: 1.5px solid #1e3a30 !important;
547
+ border-radius: 0 0 10px 10px !important;
548
  font-family: 'DM Sans', sans-serif !important;
549
  font-weight: 600 !important;
550
  font-size: 0.88rem !important;
551
  height: 44px !important;
552
  box-shadow: none !important;
553
+ margin-top: -8px !important;
554
  margin-bottom: 40px !important;
555
  }
556
  .st-key-_nav_upload button:hover, .st-key-_nav_search button:hover {
 
562
  """, unsafe_allow_html=True)
563
 
564
 
565
+
566
  # ══════════════════════════════════════════════════════════════════════════════
567
  # 6. ABOUT + FOOTER (static HTML)
568
  # ══════════════════════════════════════════════════════════════════════════════