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(""" """, 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.")