srbhavya01 commited on
Commit
7988dd2
ยท
verified ยท
1 Parent(s): 945264a

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +59 -14
src/streamlit_app.py CHANGED
@@ -1,16 +1,61 @@
1
  import streamlit as st
2
 
3
- st.title("FIT Plan AI โ€“ Personalized Fitness Plan Generator")
4
-
5
- goal = st.selectbox(
6
- "Goal",
7
- [
8
- "Flexibility",
9
- "Weight Loss",
10
- "Build Muscle",
11
- "Strength Gaining",
12
- "Abs Building"
13
- ]
14
- )
15
-
16
- st.write("You selected:", goal)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import streamlit as st
2
 
3
+ st.set_page_config(page_title="AI Fitness Plan Generator", page_icon="๐Ÿ’ช", layout="centered")
4
+
5
+ st.markdown("""
6
+ <style>
7
+ .main {
8
+ background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
9
+ }
10
+ label, .stTextInput label, .stSelectbox label {
11
+ color: white !important;
12
+ }
13
+ </style>
14
+ """, unsafe_allow_html=True)
15
+
16
+ st.title("๐Ÿ’ช AI Fitness Plan Generator")
17
+ st.write("Get a personalized fitness plan based on your details")
18
+
19
+ # User Inputs
20
+ age = st.number_input("Age", min_value=10, max_value=100, step=1)
21
+ gender = st.selectbox("Gender", ["Male", "Female", "Other"])
22
+ goal = st.selectbox("Fitness Goal", ["Weight Loss", "Muscle Gain", "General Fitness"])
23
+ activity = st.selectbox("Activity Level", ["Low", "Medium", "High"])
24
+
25
+ # Plan Logic
26
+
27
+ def generate_plan(age, goal, activity):
28
+ plan = ""
29
+
30
+ if goal == "Weight Loss":
31
+ plan = "๐Ÿƒ Cardio 4โ€“5 days/week, strength training 2โ€“3 days/week, calorie-controlled diet."
32
+ elif goal == "Muscle Gain":
33
+ plan = "๐Ÿ‹๏ธ Strength training 4โ€“5 days/week, high-protein diet, proper sleep and recovery."
34
+ else:
35
+ plan = "๐Ÿคธ Combination of cardio & strength training 3โ€“4 days/week, balanced nutrition."
36
+
37
+ if activity == "Low":
38
+ plan += " Start with light intensity and gradually increase."
39
+ elif activity == "Medium":
40
+ plan += " Maintain moderate intensity workouts."
41
+ else:
42
+ plan += " Include high-intensity workouts with proper rest days."
43
+
44
+ return plan
45
+
46
+ # Button
47
+ if st.button("Generate Fitness Plan"):
48
+ plan = generate_plan(age, goal, activity)
49
+ st.success("Your Personalized Fitness Plan")
50
+ st.markdown(f"""
51
+ **Age:** {age}
52
+ **Gender:** {gender}
53
+ **Goal:** {goal}
54
+ **Activity Level:** {activity}
55
+
56
+ ---
57
+ {plan}
58
+ """)
59
+
60
+ st.markdown("---")
61
+ st.caption("๐Ÿš€ Built with Streamlit | Ready for AI integration")