Spaces:
Sleeping
Sleeping
File size: 4,252 Bytes
aa1d0a5 51e5909 | 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 132 | import streamlit as st
# --- PAGE CONFIGURATION ---
st.set_page_config(
page_title="Fitness Plan AI",
page_icon="πͺ",
layout="wide",
initial_sidebar_state="expanded",
)
# --- CUSTOM CSS FOR MODERN LOOK ---
st.markdown("""
<style>
/* Main background and text */
.main {
background-color: #0e1117;
}
/* Header styling */
.stTitle {
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
color: #00FF88; /* Neon Green */
text-align: center;
padding-bottom: 20px;
}
/* Sidebar styling */
section[data-testid="stSidebar"] {
background-color: #161b22;
border-right: 1px solid #30363d;
}
/* Input box focus colors */
input:focus {
border-color: #00FF88 !important;
}
/* Custom button styling */
div.stButton > button:first-child {
background-color: #00FF88;
color: #000000;
font-weight: bold;
border-radius: 10px;
width: 100%;
height: 50px;
border: none;
transition: 0.3s;
}
div.stButton > button:hover {
background-color: #00CC6A;
transform: scale(1.02);
}
</style>
""", unsafe_allow_html=True)
# --- SIDEBAR: USER PROFILE ---
with st.sidebar:
st.image("https://cdn-icons-png.flaticon.com/512/2936/2936886.png", width=100)
st.title("User Profile")
st.write("Fill in your stats to get a precise plan.")
age = st.number_input("Age", min_value=10, max_value=100, value=25)
gender = st.radio("Gender", ["Male", "Female", "Other"], horizontal=True)
weight = st.number_input("Weight (kg)", min_value=30.0, max_value=250.0, value=70.0)
height = st.number_input("Height (cm)", min_value=100, max_value=250, value=175)
st.divider()
experience = st.select_slider(
"Fitness Level",
options=["Beginner", "Intermediate", "Advanced"]
)
# --- MAIN PAGE AREA ---
st.title("πͺ Fitness Plan AI")
st.markdown("### Personalized Fitness Plan Generator")
# Top row of inputs
col1, col2 = st.columns(2)
with col1:
goal = st.selectbox(
"What is your primary goal?",
['Weight Loss', 'Build Muscle', 'Strength Gaining', 'Flexibility', 'Abs Building'],
index=1
)
st.info(f"Targeting: **{goal}**")
with col2:
activity_level = st.selectbox(
"Current Activity Level",
["Sedentary", "Lightly Active", "Moderately Active", "Very Active"]
)
equipment = st.multiselect(
"Available Equipment",
["Full Gym", "Dumbbells", "Resistance Bands", "Bodyweight Only"],
default=["Bodyweight Only"]
)
# Generate Button
if st.button("Generate My AI Fitness Plan"):
with st.spinner("Analyzing your stats and crafting your plan..."):
# This is where your AI logic would go.
# For now, we show a professional placeholder layout.
st.success(f"Generated a {goal} plan for a {experience} level athlete!")
tab1, tab2, tab3 = st.tabs(["π
Weekly Schedule", "π₯ Nutrition Guide", "π‘ Pro Tips"])
with tab1:
st.markdown("#### Your 7-Day Workout Routine")
# Example layout for the generated plan
st.table({
"Day": ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
"Focus": ["Upper Body", "Lower Body", "Rest", "Cardio", "Full Body", "Active Recovery", "Rest"],
"Duration": ["45 min", "50 min", "-", "30 min", "60 min", "20 min", "-"]
})
with tab2:
st.markdown("#### Recommended Daily Macros")
m1, m2, m3 = st.columns(3)
m1.metric("Protein", "160g")
m2.metric("Carbs", "210g")
m3.metric("Fats", "65g")
st.info("Estimated Daily Calories: **2,150 kcal**")
with tab3:
st.write("1. **Stay Hydrated:** Drink at least 3L of water.")
st.write("2. **Sleep:** Aim for 7-9 hours for muscle recovery.")
st.write("3. **Consistency:** Stick to the plan for 4 weeks to see results.")
# --- FOOTER ---
st.markdown("---")
st.caption("Powered by AI β’ Optimized for your health.") |