gvlktejaswi commited on
Commit
e107886
·
verified ·
1 Parent(s): b86041f

Update page_files/Home.py

Browse files
Files changed (1) hide show
  1. page_files/Home.py +21 -26
page_files/Home.py CHANGED
@@ -54,10 +54,13 @@ def img_to_b64(path):
54
  return ""
55
 
56
 
57
- home_img = img_to_b64("images/Home.png")
58
- logo_img = img_to_b64("logo.png")
59
- extract_card_img = img_to_b64("images/extract_card_img.png")
60
- search_card_img = img_to_b64("images/search_card_img.png")
 
 
 
61
 
62
  st.markdown("""
63
  <style>
@@ -674,32 +677,24 @@ with right_col:
674
  </style>
675
  """, unsafe_allow_html=True)
676
 
677
- with st.container():
678
- st.markdown('<div class="aim-showcase-card-wrap">', unsafe_allow_html=True)
679
- if extract_card_img:
680
- st.image("extract_card_img.png", use_container_width=True)
681
- st.markdown("""
682
- <div class="aim-card-footer">
683
- <div class="aim-card-footer-title">Extract Data</div>
684
- <div class="aim-card-footer-tag">Platform</div>
685
- </div>
686
- </div>
687
- """, unsafe_allow_html=True)
688
  if st.button("Go to Extract Data →", key="showcase_extract_btn"):
689
  st.switch_page("page_files/Upload_Data.py")
690
 
691
  # ── Search card ──
692
- with st.container():
693
- st.markdown('<div class="aim-showcase-card-wrap">', unsafe_allow_html=True)
694
- if search_card_img:
695
- st.image("search_card_img.png", use_container_width=True)
696
- st.markdown("""
697
- <div class="aim-card-footer">
698
- <div class="aim-card-footer-title">Search</div>
699
- <div class="aim-card-footer-tag">Data Page</div>
700
- </div>
701
- </div>
702
- """, unsafe_allow_html=True)
703
  if st.button("Go to Search →", key="showcase_search_btn"):
704
  st.switch_page("page_files/Categorized_Search.py")
705
 
 
54
  return ""
55
 
56
 
57
+ _HERE = Path(__file__).parent # page_files/
58
+ _ROOT = _HERE.parent # project root
59
+
60
+ home_img = img_to_b64(str(_HERE / "images" / "Home.png"))
61
+ logo_img = img_to_b64(str(_ROOT / "logo.png"))
62
+ extract_card_img = img_to_b64(str(_ROOT / "extract_card_img.png"))
63
+ search_card_img = img_to_b64(str(_ROOT / "search_card_img.png"))
64
 
65
  st.markdown("""
66
  <style>
 
677
  </style>
678
  """, unsafe_allow_html=True)
679
 
680
+ if extract_card_img:
681
+ st.markdown(
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
  if st.button("Go to Extract Data →", key="showcase_extract_btn"):
688
  st.switch_page("page_files/Upload_Data.py")
689
 
690
  # ── Search card ──
691
+ if search_card_img:
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
  if st.button("Go to Search →", key="showcase_search_btn"):
699
  st.switch_page("page_files/Categorized_Search.py")
700