Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +86 -17
src/streamlit_app.py
CHANGED
|
@@ -1,23 +1,92 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
|
| 3 |
-
st.
|
| 4 |
|
| 5 |
-
|
| 6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
st.subheader("Available Equipment")
|
| 8 |
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
st.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
|
| 3 |
+
st.set_page_config(page_title="FitPlan AI", layout="centered")
|
| 4 |
|
| 5 |
+
st.title("🏋️ Your Fitness Profile")
|
| 6 |
|
| 7 |
+
# --------------------------
|
| 8 |
+
# GOALS
|
| 9 |
+
# --------------------------
|
| 10 |
+
goal = st.selectbox(
|
| 11 |
+
"Fitness Goal",
|
| 12 |
+
[
|
| 13 |
+
"Flexible",
|
| 14 |
+
"Weight Loss",
|
| 15 |
+
"Build Muscle",
|
| 16 |
+
"Strength Gaining",
|
| 17 |
+
"Abs Building"
|
| 18 |
+
]
|
| 19 |
+
)
|
| 20 |
+
|
| 21 |
+
# --------------------------
|
| 22 |
+
# EQUIPMENT
|
| 23 |
+
# --------------------------
|
| 24 |
st.subheader("Available Equipment")
|
| 25 |
|
| 26 |
+
col1, col2 = st.columns(2)
|
| 27 |
+
|
| 28 |
+
with col1:
|
| 29 |
+
dumbbells = st.checkbox("Dumbbells")
|
| 30 |
+
resistance_band = st.checkbox("Resistance Band")
|
| 31 |
+
yoga_mat = st.checkbox("Yoga Mat")
|
| 32 |
+
no_equipment = st.checkbox("No Equipment")
|
| 33 |
+
inclined_bench = st.checkbox("Inclined Bench")
|
| 34 |
+
treadmill = st.checkbox("Treadmill")
|
| 35 |
+
cycle = st.checkbox("Cycle")
|
| 36 |
+
|
| 37 |
+
with col2:
|
| 38 |
+
skipping_rope = st.checkbox("Skipping Rope")
|
| 39 |
+
hand_gripper = st.checkbox("Hand Gripper")
|
| 40 |
+
pullups_bar = st.checkbox("Pullups Bar")
|
| 41 |
+
weight_plates = st.checkbox("Weight Plates")
|
| 42 |
+
hula_hoop = st.checkbox("Hula Hoop Ring")
|
| 43 |
+
bosu_ball = st.checkbox("Bosu Ball")
|
| 44 |
+
|
| 45 |
+
# Collect equipment into list
|
| 46 |
+
equipment = []
|
| 47 |
+
|
| 48 |
+
equipment_map = {
|
| 49 |
+
"Dumbbells": dumbbells,
|
| 50 |
+
"Resistance Band": resistance_band,
|
| 51 |
+
"Yoga Mat": yoga_mat,
|
| 52 |
+
"No Equipment": no_equipment,
|
| 53 |
+
"Inclined Bench": inclined_bench,
|
| 54 |
+
"Treadmill": treadmill,
|
| 55 |
+
"Cycle": cycle,
|
| 56 |
+
"Skipping Rope": skipping_rope,
|
| 57 |
+
"Hand Gripper": hand_gripper,
|
| 58 |
+
"Pullups Bar": pullups_bar,
|
| 59 |
+
"Weight Plates": weight_plates,
|
| 60 |
+
"Hula Hoop Ring": hula_hoop,
|
| 61 |
+
"Bosu Ball": bosu_ball,
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
for item, selected in equipment_map.items():
|
| 65 |
+
if selected:
|
| 66 |
+
equipment.append(item)
|
| 67 |
+
|
| 68 |
+
# --------------------------
|
| 69 |
+
# FITNESS LEVEL
|
| 70 |
+
# --------------------------
|
| 71 |
+
st.subheader("Fitness Level")
|
| 72 |
+
|
| 73 |
+
fitness_level = st.radio(
|
| 74 |
+
"",
|
| 75 |
+
["Beginner", "Intermediate", "Advanced"],
|
| 76 |
+
horizontal=True
|
| 77 |
+
)
|
| 78 |
+
|
| 79 |
+
# --------------------------
|
| 80 |
+
# SUBMIT BUTTON
|
| 81 |
+
# --------------------------
|
| 82 |
+
if st.button("Generate Personalised Plan"):
|
| 83 |
+
|
| 84 |
+
if not equipment:
|
| 85 |
+
st.error("Please select at least one equipment option.")
|
| 86 |
+
else:
|
| 87 |
+
st.success("Profile Submitted ✅")
|
| 88 |
+
st.json({
|
| 89 |
+
"goal": goal,
|
| 90 |
+
"fitness_level": fitness_level,
|
| 91 |
+
"equipment": equipment
|
| 92 |
+
})
|