Springboardmen commited on
Commit
8d6f3e2
·
verified ·
1 Parent(s): c704836

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +86 -17
src/streamlit_app.py CHANGED
@@ -1,23 +1,92 @@
1
  import streamlit as st
2
 
3
- st.title("FIT Plan AI – Personalized Fitness Plan Generator")
4
 
5
- goal = st.selectbox("Goal",["Flexibility","Weight Loss", "Build Muscle","Strength Gaining","ABs Building" ])
6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  st.subheader("Available Equipment")
8
 
9
- dumbbells = st.checkbox("Dumbbells")
10
- bands = st.checkbox("Resistance Bands")
11
- Yoga = st.checkbox("Yoga mat")
12
- Inclined bench = st.checkbox("Inclined bench")
13
- Thread mill = st.checkbox("Thread mill")
14
- Cycle = st.checkbox("Cycle")
15
- Skipping rope = st.checkbox("Skipping rope")
16
- Hand gripper = st.checkbox("Hand gripper")
17
- PullUps = st.checkbox("Pullups bar")
18
- Weight = st.checkbox("Weight Plates")
19
- Hula = st.checkbox("Hula hoop ring")
20
- bosu = st.checkbox("Bosu ball")
21
- no_equipment = st.checkbox("No Equipment")
22
-
23
- st.write("You selected:", goal)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ })