wikifit / src /streamlit_app.py
PhanindraVarma's picture
Update src/streamlit_app.py
e6e44e5 verified
import streamlit as st
import sys
import os
# Add the project directory to the path to make imports work
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
from pages import home, search, quiz, workout_plans, remedies
# Set page configuration
st.set_page_config(
page_title="WikiFit",
page_icon="💪",
layout="wide",
initial_sidebar_state="expanded"
)
# Custom CSS
st.markdown("""
<style>
.main {
padding: 2rem;
}
.stApp {
background-color: black;
}
footer {
visibility: hidden;
}
#MainMenu {
visibility: visible;
}
.fitness-element {
display: none; /* Hide animated elements as they're not easily recreated in Streamlit */
}
.header {
background-color: #4CAF50;
padding: 1rem;
color: white;
text-align: center;
border-radius: 10px;
margin-bottom: 2rem;
}
.footer {
margin-top: 2rem;
text-align: center;
padding: 1rem;
background-color: #f1f1f1;
border-radius: 10px;
}
</style>
""", unsafe_allow_html=True)
# Header
st.markdown('<div class="header"><h1>WikiFit</h1><p>Your AI Fitness Wiki</p></div>', unsafe_allow_html=True)
# Navigation
pages = {
"Home": home,
"Search": search,
"Quiz": quiz,
"Workout Plans": workout_plans,
"Remedies": remedies
}
# Sidebar for navigation
st.sidebar.title("Navigation")
selection = st.sidebar.radio("Go to", list(pages.keys()))
# Render the selected page
pages[selection].app()
# Footer
st.markdown('<div class="footer">© 2025 WikiFit - Your AI Fitness Wiki</div>', unsafe_allow_html=True)