Update src/streamlit_app.py
Browse files- src/streamlit_app.py +101 -35
src/streamlit_app.py
CHANGED
|
@@ -1,36 +1,102 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
"
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
st.
|
| 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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
|
| 3 |
+
# Page configuration
|
| 4 |
+
st.set_page_config(
|
| 5 |
+
page_title="Fitness Plan AI Generator",
|
| 6 |
+
page_icon="💪",
|
| 7 |
+
layout="centered"
|
| 8 |
+
)
|
| 9 |
+
|
| 10 |
+
# Custom CSS for better UI
|
| 11 |
+
st.markdown("""
|
| 12 |
+
<style>
|
| 13 |
+
.stButton>button {
|
| 14 |
+
width: 100%;
|
| 15 |
+
height: 50px;
|
| 16 |
+
font-size: 18px;
|
| 17 |
+
background: linear-gradient(to right, #1f4e79, #2fa4a9);
|
| 18 |
+
color: white;
|
| 19 |
+
border-radius: 10px;
|
| 20 |
+
}
|
| 21 |
+
</style>
|
| 22 |
+
""", unsafe_allow_html=True)
|
| 23 |
+
|
| 24 |
+
# Title
|
| 25 |
+
st.markdown("## 🧍 Your Fitness Profile")
|
| 26 |
+
|
| 27 |
+
# Fitness Goal
|
| 28 |
+
goal = st.selectbox(
|
| 29 |
+
"Fitness Goal",
|
| 30 |
+
["Build Muscle", "Lose Weight", "Improve Endurance", "General Fitness"]
|
| 31 |
+
)
|
| 32 |
+
|
| 33 |
+
# Equipment Selection
|
| 34 |
+
st.markdown("### Available Equipment")
|
| 35 |
+
col1, col2, col3 = st.columns(3)
|
| 36 |
+
|
| 37 |
+
with col1:
|
| 38 |
+
dumbbells = st.checkbox("Dumbbells")
|
| 39 |
+
with col2:
|
| 40 |
+
bands = st.checkbox("Resistance Bands")
|
| 41 |
+
with col3:
|
| 42 |
+
no_equipment = st.checkbox("No Equipment")
|
| 43 |
+
|
| 44 |
+
# Fitness Level
|
| 45 |
+
st.markdown("### Fitness Level")
|
| 46 |
+
level = st.radio(
|
| 47 |
+
"",
|
| 48 |
+
["Beginner", "Intermediate", "Advanced"],
|
| 49 |
+
horizontal=True
|
| 50 |
+
)
|
| 51 |
+
|
| 52 |
+
# Generate Plan Button
|
| 53 |
+
if st.button("Generate Personalised Plan"):
|
| 54 |
+
st.markdown("---")
|
| 55 |
+
st.markdown("## 🏋️ Your Personalised Fitness Plan")
|
| 56 |
+
|
| 57 |
+
equipment = []
|
| 58 |
+
if dumbbells:
|
| 59 |
+
equipment.append("Dumbbells")
|
| 60 |
+
if bands:
|
| 61 |
+
equipment.append("Resistance Bands")
|
| 62 |
+
if no_equipment or not equipment:
|
| 63 |
+
equipment.append("Bodyweight")
|
| 64 |
+
|
| 65 |
+
st.write(f"**Goal:** {goal}")
|
| 66 |
+
st.write(f"**Level:** {level}")
|
| 67 |
+
st.write(f"**Equipment:** {', '.join(equipment)}")
|
| 68 |
+
|
| 69 |
+
st.markdown("### 📅 Weekly Workout Plan")
|
| 70 |
+
|
| 71 |
+
if goal == "Build Muscle":
|
| 72 |
+
st.write("""
|
| 73 |
+
- **Day 1:** Chest & Triceps
|
| 74 |
+
- **Day 2:** Back & Biceps
|
| 75 |
+
- **Day 3:** Legs
|
| 76 |
+
- **Day 4:** Shoulders & Core
|
| 77 |
+
- **Day 5:** Full Body
|
| 78 |
+
- **Day 6:** Active Recovery
|
| 79 |
+
- **Day 7:** Rest
|
| 80 |
+
""")
|
| 81 |
+
elif goal == "Lose Weight":
|
| 82 |
+
st.write("""
|
| 83 |
+
- **Day 1:** Full Body HIIT
|
| 84 |
+
- **Day 2:** Cardio + Core
|
| 85 |
+
- **Day 3:** Strength Training
|
| 86 |
+
- **Day 4:** HIIT
|
| 87 |
+
- **Day 5:** Cardio
|
| 88 |
+
- **Day 6:** Yoga / Stretching
|
| 89 |
+
- **Day 7:** Rest
|
| 90 |
+
""")
|
| 91 |
+
else:
|
| 92 |
+
st.write("""
|
| 93 |
+
- **Day 1:** Full Body
|
| 94 |
+
- **Day 2:** Cardio
|
| 95 |
+
- **Day 3:** Strength
|
| 96 |
+
- **Day 4:** Mobility
|
| 97 |
+
- **Day 5:** Mixed Training
|
| 98 |
+
- **Day 6:** Light Cardio
|
| 99 |
+
- **Day 7:** Rest
|
| 100 |
+
""")
|
| 101 |
+
|
| 102 |
+
st.success("✅ Plan generated successfully!")
|