File size: 3,732 Bytes
596041f
 
58271d8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
import streamlit as st

st.set_page_config(page_title="FitPlan AI", layout="centered")

# ---------------- SESSION STATE ----------------
if "step" not in st.session_state:
    st.session_state.step = 1

# ---------------- STEP 1: LANDING PAGE ----------------
if st.session_state.step == 1:
    st.title("πŸ’ͺ FitPlan AI")
    st.subheader("Your Personalized Fitness Plan Generator")

    st.markdown("""
    Welcome to **FitPlan AI** πŸš€  
    Get a customized workout plan based on:
    - Your fitness profile
    - Your goals
    - Available equipment
    """)

    if st.button("Generate My Plan"):
        st.session_state.step = 2

# ---------------- STEP 2: FITNESS PROFILE ----------------
elif st.session_state.step == 2:
    st.title("πŸ‘€ Your Fitness Profile")

    age = st.number_input("Age", min_value=10, max_value=80)
    gender = st.selectbox("Gender", ["Male", "Female", "Other"])
    weight = st.number_input("Weight (kg)")
    height = st.number_input("Height (cm)")
    experience = st.selectbox(
        "Fitness Level",
        ["Beginner", "Intermediate", "Advanced"]
    )

    if st.button("Next"):
        st.session_state.profile = {
            "age": age,
            "gender": gender,
            "weight": weight,
            "height": height,
            "experience": experience
        }
        st.session_state.step = 3

# ---------------- STEP 3: SELECT GOAL ----------------
elif st.session_state.step == 3:
    st.title("🎯 Select Your Goal")

    goal = st.radio(
        "Choose your fitness goal:",
        ["Increase Flexibility 🧘", 
         "Build Muscle πŸ’ͺ", 
         "Weight Loss / Get Lean πŸ”₯"]
    )

    if st.button("Next"):
        st.session_state.goal = goal
        st.session_state.step = 4

# ---------------- STEP 4: SELECT EQUIPMENT ----------------
elif st.session_state.step == 4:
    st.title("πŸ‹οΈ Select Available Equipment")

    equipment = st.multiselect(
        "Select equipment you have access to:",
        [
            "Dumbbells",
            "Barbell",
            "Resistance Bands",
            "Treadmill",
            "Stationary Bike",
            "Bench Press",
            "Pull-up Bar",
            "Kettlebells",
            "Leg Press Machine",
            "Cable Machine",
            "Smith Machine",
            "No Equipment (Bodyweight Only)"
        ]
    )

    if st.button("Generate Plan"):
        st.session_state.equipment = equipment
        st.session_state.step = 5

# ---------------- STEP 5: DISPLAY PLAN ----------------
elif st.session_state.step == 5:
    st.title("πŸ“„ Your Personalized Fitness Plan")

    st.subheader("Profile Summary")
    st.write(st.session_state.profile)
    st.write("Goal:", st.session_state.goal)
    st.write("Equipment:", st.session_state.equipment)

    st.divider()

    # Simple frontend demo output
    if "Build Muscle" in st.session_state.goal:
        st.success("πŸ’ͺ Suggested Plan: 4-Day Strength Split")
        st.markdown("""
        - Day 1: Chest + Triceps  
        - Day 2: Back + Biceps  
        - Day 3: Legs  
        - Day 4: Shoulders + Core  
        """)

    elif "Flexibility" in st.session_state.goal:
        st.success("🧘 Suggested Plan: 5-Day Mobility Routine")
        st.markdown("""
        - Dynamic Stretching  
        - Yoga Flow  
        - Hamstring & Hip Mobility  
        - Shoulder Mobility  
        - Core Stability  
        """)

    else:
        st.success("πŸ”₯ Suggested Plan: 4-Day Fat Loss Program")
        st.markdown("""
        - HIIT Training  
        - Strength + Cardio Mix  
        - Core Workouts  
        - 30 min Daily Cardio  
        """)

    if st.button("Start Over"):
        st.session_state.step = 1