chenemii commited on
Commit
2aaca11
·
1 Parent(s): ddff4d5

Remove custom logo centering and reset to standard Streamlit layout

Browse files

- Remove all custom CSS for logo centering and positioning
- Reset margins and padding to Streamlit defaults
- Remove HTML wrapper around logo
- Simplify logo display to use standard st.image() without width constraint
- Reset main-header styling to standard values
- Use default Streamlit spacing and layout behavior

Files changed (1) hide show
  1. app/streamlit_app.py +3 -83
app/streamlit_app.py CHANGED
@@ -621,87 +621,9 @@ def main():
621
  color: #0B3B0B;
622
  font-family: 'Georgia', serif;
623
  font-weight: bold;
624
- margin: 0 !important;
625
- padding: 0 !important;
626
  }
627
 
628
- /* Logo styling for better centering and responsiveness */
629
- .stImage > img {
630
- display: block !important;
631
- margin: 0 auto !important;
632
- max-width: 100% !important;
633
- height: auto !important;
634
- text-align: center !important;
635
- }
636
-
637
- /* Ensure logo container is centered with minimal spacing */
638
- .stImage {
639
- text-align: center !important;
640
- width: 100% !important;
641
- margin: 0 auto !important;
642
- padding: 0 !important;
643
- display: flex !important;
644
- justify-content: center !important;
645
- align-items: center !important;
646
- }
647
-
648
- /* Remove all default Streamlit spacing around logo */
649
- .main .block-container {
650
- padding-top: 0.5rem !important;
651
- padding-bottom: 0rem !important;
652
- max-width: 100% !important;
653
- }
654
-
655
- /* Eliminate column spacing */
656
- .stColumns {
657
- gap: 0rem !important;
658
- }
659
-
660
- /* Remove spacing from logo image */
661
- .stImage > img {
662
- margin: 0 !important;
663
- padding: 0 !important;
664
- }
665
-
666
- /* Aggressive spacing removal for logo area */
667
- .element-container:has(.stImage) {
668
- margin: 0 !important;
669
- padding: 0 !important;
670
- }
671
-
672
- /* Remove top margin from first element */
673
- .main .block-container > div:first-child {
674
- margin-top: 0 !important;
675
- padding-top: 0 !important;
676
- }
677
-
678
- /* Remove any extra spacing above content */
679
- .stMarkdown:first-child, .stImage:first-child {
680
- margin-top: 0 !important;
681
- }
682
-
683
- /* Force center alignment for all containers */
684
- .element-container, .stVerticalBlock, .stHorizontalBlock {
685
- display: flex !important;
686
- justify-content: center !important;
687
- align-items: center !important;
688
- text-align: center !important;
689
- width: 100% !important;
690
- }
691
-
692
- /* Remove Streamlit's default top padding entirely */
693
- .appview-container .main .block-container {
694
- padding-top: 0 !important;
695
- margin-top: 0 !important;
696
- }
697
-
698
- /* Ensure the entire app container centers content */
699
- .main {
700
- display: flex !important;
701
- flex-direction: column !important;
702
- align-items: center !important;
703
- justify-content: flex-start !important;
704
- }
705
 
706
 
707
 
@@ -780,8 +702,7 @@ def main():
780
  </style>
781
  """, unsafe_allow_html=True)
782
 
783
- # Centered logo at the top - minimal spacing
784
- st.markdown('<div style="text-align: center; width: 100%; margin: 0; padding: 0; display: flex; justify-content: center; align-items: center;">', unsafe_allow_html=True)
785
  try:
786
  # Try multiple possible paths for the logo file
787
  logo_paths = [
@@ -795,7 +716,7 @@ def main():
795
  logo_loaded = False
796
  for logo_path in logo_paths:
797
  if os.path.exists(logo_path):
798
- st.image(logo_path, width=600) # Reduced width for better mobile compatibility
799
  logo_loaded = True
800
  break
801
 
@@ -803,7 +724,6 @@ def main():
803
  st.markdown('<div class="main-header"><h1>⛳ Par-ity Project</h1></div>', unsafe_allow_html=True)
804
  except Exception as e:
805
  st.markdown('<div class="main-header"><h1>⛳ Par-ity Project</h1></div>', unsafe_allow_html=True)
806
- st.markdown('</div>', unsafe_allow_html=True)
807
 
808
  # Initialize session state for step-based flow
809
  if 'current_step' not in st.session_state:
 
621
  color: #0B3B0B;
622
  font-family: 'Georgia', serif;
623
  font-weight: bold;
 
 
624
  }
625
 
626
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
627
 
628
 
629
 
 
702
  </style>
703
  """, unsafe_allow_html=True)
704
 
705
+ # Logo at the top
 
706
  try:
707
  # Try multiple possible paths for the logo file
708
  logo_paths = [
 
716
  logo_loaded = False
717
  for logo_path in logo_paths:
718
  if os.path.exists(logo_path):
719
+ st.image(logo_path)
720
  logo_loaded = True
721
  break
722
 
 
724
  st.markdown('<div class="main-header"><h1>⛳ Par-ity Project</h1></div>', unsafe_allow_html=True)
725
  except Exception as e:
726
  st.markdown('<div class="main-header"><h1>⛳ Par-ity Project</h1></div>', unsafe_allow_html=True)
 
727
 
728
  # Initialize session state for step-based flow
729
  if 'current_step' not in st.session_state: