Spaces:
Paused
Paused
Aggressively remove all logo spacing to eliminate scrolling
Browse files- Remove unnecessary column structure around logo
- Add CSS to eliminate all margins and padding around logo
- Set main container padding-top to 1rem minimum
- Remove column gaps and image spacing
- Eliminate whitespace above and below logo
- Ensure content is visible without scrolling
- app/streamlit_app.py +58 -33
app/streamlit_app.py
CHANGED
|
@@ -621,7 +621,8 @@ def main():
|
|
| 621 |
color: #0B3B0B;
|
| 622 |
font-family: 'Georgia', serif;
|
| 623 |
font-weight: bold;
|
| 624 |
-
margin
|
|
|
|
| 625 |
}
|
| 626 |
|
| 627 |
/* Logo styling for better centering and responsiveness */
|
|
@@ -633,10 +634,46 @@ def main():
|
|
| 633 |
height: auto;
|
| 634 |
}
|
| 635 |
|
| 636 |
-
/* Ensure logo container is centered */
|
| 637 |
.stImage {
|
| 638 |
text-align: center;
|
| 639 |
width: 100%;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 640 |
}
|
| 641 |
|
| 642 |
|
|
@@ -716,38 +753,26 @@ def main():
|
|
| 716 |
</style>
|
| 717 |
""", unsafe_allow_html=True)
|
| 718 |
|
| 719 |
-
# Centered logo at the top
|
| 720 |
-
|
| 721 |
-
|
| 722 |
-
|
| 723 |
-
|
| 724 |
-
|
| 725 |
-
|
| 726 |
-
|
| 727 |
-
|
| 728 |
-
|
| 729 |
-
|
| 730 |
-
|
| 731 |
-
|
| 732 |
-
|
| 733 |
-
|
| 734 |
-
|
| 735 |
-
|
| 736 |
-
if os.path.exists(logo_path):
|
| 737 |
-
st.image(logo_path, width=600) # Reduced width for better mobile compatibility
|
| 738 |
-
logo_loaded = True
|
| 739 |
-
break
|
| 740 |
-
|
| 741 |
-
if not logo_loaded:
|
| 742 |
-
st.markdown('<div class="main-header"><h1>⛳ Par-ity Project</h1></div>', unsafe_allow_html=True)
|
| 743 |
-
except Exception as e:
|
| 744 |
st.markdown('<div class="main-header"><h1>⛳ Par-ity Project</h1></div>', unsafe_allow_html=True)
|
| 745 |
-
|
| 746 |
-
|
| 747 |
-
st.write("") # Empty space
|
| 748 |
-
|
| 749 |
-
# Reduce spacing after logo
|
| 750 |
-
st.markdown('<div style="margin-top: -1px;"></div>', unsafe_allow_html=True)
|
| 751 |
|
| 752 |
# Initialize session state for step-based flow
|
| 753 |
if 'current_step' not in st.session_state:
|
|
|
|
| 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 */
|
|
|
|
| 634 |
height: auto;
|
| 635 |
}
|
| 636 |
|
| 637 |
+
/* Ensure logo container is centered with minimal spacing */
|
| 638 |
.stImage {
|
| 639 |
text-align: center;
|
| 640 |
width: 100%;
|
| 641 |
+
margin: 0 !important;
|
| 642 |
+
padding: 0 !important;
|
| 643 |
+
}
|
| 644 |
+
|
| 645 |
+
/* Remove all default Streamlit spacing around logo */
|
| 646 |
+
.main .block-container {
|
| 647 |
+
padding-top: 1rem !important;
|
| 648 |
+
padding-bottom: 0rem !important;
|
| 649 |
+
}
|
| 650 |
+
|
| 651 |
+
/* Eliminate column spacing */
|
| 652 |
+
.stColumns {
|
| 653 |
+
gap: 0rem !important;
|
| 654 |
+
}
|
| 655 |
+
|
| 656 |
+
/* Remove spacing from logo image */
|
| 657 |
+
.stImage > img {
|
| 658 |
+
margin: 0 !important;
|
| 659 |
+
padding: 0 !important;
|
| 660 |
+
}
|
| 661 |
+
|
| 662 |
+
/* Aggressive spacing removal for logo area */
|
| 663 |
+
.element-container:has(.stImage) {
|
| 664 |
+
margin: 0 !important;
|
| 665 |
+
padding: 0 !important;
|
| 666 |
+
}
|
| 667 |
+
|
| 668 |
+
/* Remove top margin from first element */
|
| 669 |
+
.main .block-container > div:first-child {
|
| 670 |
+
margin-top: 0 !important;
|
| 671 |
+
padding-top: 0 !important;
|
| 672 |
+
}
|
| 673 |
+
|
| 674 |
+
/* Remove any extra spacing above content */
|
| 675 |
+
.stMarkdown:first-child, .stImage:first-child {
|
| 676 |
+
margin-top: 0 !important;
|
| 677 |
}
|
| 678 |
|
| 679 |
|
|
|
|
| 753 |
</style>
|
| 754 |
""", unsafe_allow_html=True)
|
| 755 |
|
| 756 |
+
# Centered logo at the top - minimal spacing
|
| 757 |
+
try:
|
| 758 |
+
# Try multiple possible paths for the logo file
|
| 759 |
+
logo_paths = [
|
| 760 |
+
"par-ity project horizontal logo.png", # Direct path in current directory
|
| 761 |
+
"app/par-ity project horizontal logo.png", # Original path for local development
|
| 762 |
+
"./par-ity project horizontal logo.png" # Explicit current directory
|
| 763 |
+
]
|
| 764 |
+
|
| 765 |
+
logo_loaded = False
|
| 766 |
+
for logo_path in logo_paths:
|
| 767 |
+
if os.path.exists(logo_path):
|
| 768 |
+
st.image(logo_path, width=600) # Reduced width for better mobile compatibility
|
| 769 |
+
logo_loaded = True
|
| 770 |
+
break
|
| 771 |
+
|
| 772 |
+
if not logo_loaded:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 773 |
st.markdown('<div class="main-header"><h1>⛳ Par-ity Project</h1></div>', unsafe_allow_html=True)
|
| 774 |
+
except Exception as e:
|
| 775 |
+
st.markdown('<div class="main-header"><h1>⛳ Par-ity Project</h1></div>', unsafe_allow_html=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 776 |
|
| 777 |
# Initialize session state for step-based flow
|
| 778 |
if 'current_step' not in st.session_state:
|