Spaces:
Sleeping
Sleeping
File size: 2,284 Bytes
1f6d7ba 8d6f3e2 1f6d7ba 9cadb82 c704836 8d6f3e2 c704836 8d6f3e2 | 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 | import streamlit as st
st.set_page_config(page_title="FitPlan AI", layout="centered")
st.title(" Your Fitness Profile")
# --------------------------
# GOALS
# --------------------------
goal = st.selectbox(
"Fitness Goal",
[
"Flexible",
"Weight Loss",
"Build Muscle",
"Strength Gaining",
"Abs Building"
]
)
# --------------------------
# EQUIPMENT
# --------------------------
st.subheader("Available Equipment")
col1, col2 = st.columns(2)
with col1:
dumbbells = st.checkbox("Dumbbells")
resistance_band = st.checkbox("Resistance Band")
yoga_mat = st.checkbox("Yoga Mat")
no_equipment = st.checkbox("No Equipment")
inclined_bench = st.checkbox("Inclined Bench")
treadmill = st.checkbox("Treadmill")
cycle = st.checkbox("Cycle")
with col2:
skipping_rope = st.checkbox("Skipping Rope")
hand_gripper = st.checkbox("Hand Gripper")
pullups_bar = st.checkbox("Pullups Bar")
weight_plates = st.checkbox("Weight Plates")
hula_hoop = st.checkbox("Hula Hoop Ring")
bosu_ball = st.checkbox("Bosu Ball")
# Collect equipment into list
equipment = []
equipment_map = {
"Dumbbells": dumbbells,
"Resistance Band": resistance_band,
"Yoga Mat": yoga_mat,
"No Equipment": no_equipment,
"Inclined Bench": inclined_bench,
"Treadmill": treadmill,
"Cycle": cycle,
"Skipping Rope": skipping_rope,
"Hand Gripper": hand_gripper,
"Pullups Bar": pullups_bar,
"Weight Plates": weight_plates,
"Hula Hoop Ring": hula_hoop,
"Bosu Ball": bosu_ball,
}
for item, selected in equipment_map.items():
if selected:
equipment.append(item)
# --------------------------
# FITNESS LEVEL
# --------------------------
st.subheader("Fitness Level")
fitness_level = st.radio(
"",
["Beginner", "Intermediate", "Advanced"],
horizontal=True
)
# --------------------------
# SUBMIT BUTTON
# --------------------------
if st.button("Generate Personalised Plan"):
if not equipment:
st.error("Please select at least one equipment option.")
else:
st.success("Profile Submitted ✅")
st.json({
"goal": goal,
"fitness_level": fitness_level,
"equipment": equipment
})
|