Module_2 / src /streamlit_app.py
Springboardmen's picture
Update src/streamlit_app.py
9cadb82 verified
raw
history blame
2.28 kB
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
})