Spaces:
Configuration error
Configuration error
File size: 5,364 Bytes
7b8fc03 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
import streamlit as st
def switch_page(page_name):
st.session_state.current_page = page_name
st.rerun()
def show_main():
# Page config
st.set_page_config(
page_title="HerCorners",
page_icon="β¨",
layout="wide",
initial_sidebar_state="expanded"
)
# Hide streamlit default menu and footer
st.markdown("""
<style>
#MainMenu {visibility: hidden;}
footer {visibility: hidden;}
.stDeployButton {display:none;}
/* Style for sidebar buttons */
div.stButton > button {
width: 100%;
padding: 10px 10px;
border: none;
background-color: #FFE4E1;
color: black;
border-radius: 10px;
text-align: left;
margin: 5px 0;
}
div.stButton > button:hover {
background-color: #FFB6C1;
color: white;
}
/* Style for title box */
.title-box {
background: linear-gradient(45deg, #FF69B4, #FFB6C1);
padding: 20px;
border-radius: 10px;
margin-bottom: 20px;
text-align: center;
color: white;
cursor: pointer;
}
/* Style for home button */
.home-button {
background-color: #FFB6C1;
color: white;
padding: 10px;
border-radius: 10px;
text-align: center;
margin: 10px 0;
cursor: pointer;
}
</style>
""", unsafe_allow_html=True)
# Initialize session state
if 'current_page' not in st.session_state:
st.session_state.current_page = 'home'
# Sidebar navigation
with st.sidebar:
# Title box that works as home button
st.markdown("""
<div class="title-box" onclick="window.location.href='#'">
<h1>β¨ HerCorners β¨</h1>
<p>Your safe space to slay! π
</p>
</div>
""", unsafe_allow_html=True)
# Home button at the top of navigation
if st.button("π Home", use_container_width=True):
switch_page('home')
st.markdown("<hr>", unsafe_allow_html=True) # Divider
# Navigation buttons
if st.button("π She Legends", use_container_width=True):
switch_page('legends')
if st.button("π§ She Melted Mascara", use_container_width=True):
switch_page('mascara')
if st.button("β¨ She Glows", use_container_width=True):
switch_page('glows')
if st.button("π₯ She Fuels", use_container_width=True):
switch_page('fuels')
# Main content area
if st.session_state.current_page == 'home':
st.markdown("""
<div style='text-align: center; padding: 50px;'>
<h1>Welcome to HerCorners! β¨</h1>
<p style='font-size: 20px; margin: 20px 0;'>Choose from our spaces:</p>
</div>
""", unsafe_allow_html=True)
# Feature cards
col1, col2 = st.columns(2)
with col1:
st.markdown("""
<div style='background-color: #FFE4E1; padding: 20px; border-radius: 10px; margin: 10px 0;'>
<h3>π She Legends</h3>
<p>Chat with inspiring mentors for guidance and support!</p>
</div>
<div style='background-color: #E6E6FA; padding: 20px; border-radius: 10px; margin: 10px 0;'>
<h3>π§ She Melted Mascara</h3>
<p>Share your feelings in a safe, supportive space!</p>
</div>
""", unsafe_allow_html=True)
with col2:
st.markdown("""
<div style='background-color: #98FB98; padding: 20px; border-radius: 10px; margin: 10px 0;'>
<h3>β¨ She Glows</h3>
<p>Learn new skills and level up your life!</p>
</div>
<div style='background-color: #FFB6C1; padding: 20px; border-radius: 10px; margin: 10px 0;'>
<h3>π₯ She Fuels</h3>
<p>Share your wins and inspire others!</p>
</div>
""", unsafe_allow_html=True)
else:
# Add home button in main content area when not on home page
if st.button("π Back to Home", type="secondary"):
switch_page('home')
# Import and show the appropriate page
if st.session_state.current_page == 'legends':
from pages.she_legends import show_page
show_page()
elif st.session_state.current_page == 'mascara':
from pages.she_melted_mascara import show_page
show_page()
elif st.session_state.current_page == 'glows':
from pages.she_glows import show_page
show_page()
elif st.session_state.current_page == 'fuels':
from pages.she_fuels import show_page
show_page()
if __name__ == "__main__":
show_main() |