Module1 / src /streamlit_app.py
js02vel's picture
Update src/streamlit_app.py
51f28ea verified
raw
history blame
2.53 kB
import streamlit as st
# Page configuration
st.set_page_config(
page_title="Fitness Plan AI Generator",
page_icon="πŸ’ͺ",
layout="centered"
)
# Custom CSS for better UI
st.markdown("""
<style>
.stButton>button {
width: 100%;
height: 50px;
font-size: 18px;
background: linear-gradient(to right, #1f4e79, #2fa4a9);
color: white;
border-radius: 10px;
}
</style>
""", unsafe_allow_html=True)
# Title
st.markdown("## 🧍 Your Fitness Profile")
# Fitness Goal
goal = st.selectbox(
"Fitness Goal",
["Build Muscle", "Lose Weight", "Improve Endurance", "General Fitness"]
)
# Equipment Selection
st.markdown("### Available Equipment")
col1, col2, col3 = st.columns(3)
with col1:
dumbbells = st.checkbox("Dumbbells")
with col2:
bands = st.checkbox("Resistance Bands")
with col3:
no_equipment = st.checkbox("No Equipment")
# Fitness Level
st.markdown("### Fitness Level")
level = st.radio(
"",
["Beginner", "Intermediate", "Advanced"],
horizontal=True
)
# Generate Plan Button
if st.button("Generate Personalised Plan"):
st.markdown("---")
st.markdown("## πŸ‹οΈ Your Personalised Fitness Plan")
equipment = []
if dumbbells:
equipment.append("Dumbbells")
if bands:
equipment.append("Resistance Bands")
if no_equipment or not equipment:
equipment.append("Bodyweight")
st.write(f"**Goal:** {goal}")
st.write(f"**Level:** {level}")
st.write(f"**Equipment:** {', '.join(equipment)}")
st.markdown("### πŸ“… Weekly Workout Plan")
if goal == "Build Muscle":
st.write("""
- **Day 1:** Chest & Triceps
- **Day 2:** Back & Biceps
- **Day 3:** Legs
- **Day 4:** Shoulders & Core
- **Day 5:** Full Body
- **Day 6:** Active Recovery
- **Day 7:** Rest
""")
elif goal == "Lose Weight":
st.write("""
- **Day 1:** Full Body HIIT
- **Day 2:** Cardio + Core
- **Day 3:** Strength Training
- **Day 4:** HIIT
- **Day 5:** Cardio
- **Day 6:** Yoga / Stretching
- **Day 7:** Rest
""")
else:
st.write("""
- **Day 1:** Full Body
- **Day 2:** Cardio
- **Day 3:** Strength
- **Day 4:** Mobility
- **Day 5:** Mixed Training
- **Day 6:** Light Cardio
- **Day 7:** Rest
""")
st.success("βœ… Plan generated successfully!")