import streamlit as st from pathlib import Path import sys import random # Add project root to path sys.path.append(str(Path(__file__).parent)) from utils.css_loader import load_css from components.cards import feature_card, stat_card from config.settings import APP_CONFIG, IMPACT_METRICS # Page configuration - MUST BE FIRST st.set_page_config( page_title=APP_CONFIG["app_name"], page_icon="πŸ’œ", layout="wide", initial_sidebar_state="expanded", menu_items={ 'About': '# Women Empowerment Hub\nEmpowering women through technology, education, and community.' } ) # Load custom CSS load_css() # ==================== SIDEBAR ==================== st.sidebar.markdown("""
πŸ’œ

Women Empowerment Hub

Empowering women, transforming lives

""", unsafe_allow_html=True) st.sidebar.markdown("### πŸ“Š Live Impact") metrics = [ ("Women Helped", f"{IMPACT_METRICS['women_helped']:,}+"), ("Jobs Posted", f"{IMPACT_METRICS['jobs_posted']:,}+"), ("Free Courses", f"{IMPACT_METRICS['courses_available']}+"), ("Active Mentors", f"{IMPACT_METRICS['mentors_active']}+") ] for label, value in metrics: st.sidebar.markdown(f"""
{value}
{label}
""", unsafe_allow_html=True) # ==================== HERO SECTION ==================== st.markdown("""

πŸ’œ Women Empowerment Hub

Empowering women through safety, education, careers, health & community

Your one-stop platform for resources, support, and opportunities

""", unsafe_allow_html=True) # ==================== DAILY INSPIRATION (NEW) ==================== quotes = [ "β€œThere is no limit to what we, as women, can accomplish.” – Michelle Obama", "β€œI am not free while any woman is unfree, even when her shackles are very different from my own.” – Audre Lorde", "β€œA woman with a voice is, by definition, a strong woman.” – Melinda Gates", "β€œThink like a queen. A queen is not afraid to fail.” – Oprah Winfrey" ] daily_quote = random.choice(quotes) st.markdown(f"""

✨ Daily Inspiration

{daily_quote}

""", unsafe_allow_html=True) # ==================== IMPACT METRICS ==================== st.markdown("## πŸ“Š Our Impact") col1, col2, col3, col4 = st.columns(4) with col1: stat_card("πŸ‘©", f"{IMPACT_METRICS['women_helped']:,}+", "Women Helped") with col2: stat_card("πŸ’Ό", f"{IMPACT_METRICS['jobs_posted']:,}+", "Jobs Posted", "#10b981") with col3: stat_card("πŸ“š", f"{IMPACT_METRICS['courses_available']:,}+", "Courses Available", "#f59e0b") with col4: stat_card("πŸ‘₯", f"{IMPACT_METRICS['mentors_active']:,}+", "Active Mentors", "#ef4444") st.markdown("
", unsafe_allow_html=True) # ==================== FEATURES OVERVIEW ==================== st.markdown("## ✨ Explore Our Features") col1, col2, col3 = st.columns(3) with col1: feature_card("πŸ›‘οΈ", "Women Safety", "Emergency contacts, legal resources, and safety tips to keep you protected 24/7") st.markdown("
", unsafe_allow_html=True) feature_card("❀️", "Health & Wellness", "Track your health, access medical resources, and learn about women's healthcare") with col2: feature_card("πŸ’Ό", "Career Opportunities", "Discover jobs from companies committed to diversity and women empowerment") st.markdown("
", unsafe_allow_html=True) feature_card("βš–οΈ", "Legal Rights", "Know your rights! Access information about laws protecting women") with col3: feature_card("πŸ“š", "Education & Skills", "Free courses, certifications, and resources to boost your career") st.markdown("
", unsafe_allow_html=True) feature_card("⭐", "Success Stories", "Be inspired by amazing stories of women who overcame challenges") st.markdown("
", unsafe_allow_html=True) # ==================== INTERACTIVE POLL (EQUAL HEIGHT FIX) ==================== st.markdown("## πŸ—³οΈ What's your focus today?") col_poll, col_news = st.columns([2, 1]) # --- LEFT COLUMN (POLL) --- with col_poll: with st.container(border=True): goal = st.radio( "Select your main goal:", ["Finding a Job πŸ’Ό", "Learning a New Skill πŸ“š", " Improving Health ❀️", "Finding a Mentor πŸ‘₯"], horizontal=True ) # Added spacers to match the height of the right column st.markdown("
" * 2, unsafe_allow_html=True) if st.button("πŸš€ Let's Go!", use_container_width=True): if "Job" in goal: st.switch_page("pages/jobs.py") elif "Skill" in goal: st.switch_page("pages/education.py") elif "Health" in goal: st.switch_page("pages/health.py") elif "Mentor" in goal: st.switch_page("pages/mentorship.py") # --- RIGHT COLUMN (NEWSLETTER) --- with col_news: with st.container(border=True): # Reduced padding from 25px to 15px to save vertical space st.markdown("""

πŸ’Œ Join Newsletter

Weekly updates & jobs.

""", unsafe_allow_html=True) email = st.text_input("Enter Email", placeholder="you@example.com", label_visibility="collapsed") if st.button("Subscribe", use_container_width=True): if email: st.success("Subscribed!") st.balloons() else: st.warning("Enter valid email") # ==================== QUICK ACTIONS ==================== st.markdown("## πŸš€ Quick Actions") col1, col2, col3, col4 = st.columns(4) with col1: if st.button("πŸ†˜ Emergency Help", use_container_width=True): st.switch_page("pages/safety.py") with col2: if st.button("πŸ” Find Jobs", use_container_width=True): st.switch_page("pages/jobs.py") with col3: if st.button("πŸ“– Browse Courses", use_container_width=True): st.switch_page("pages/education.py") with col4: if st.button("πŸ‘₯ Find Mentor", use_container_width=True): st.switch_page("pages/mentorship.py") st.markdown("
", unsafe_allow_html=True) # ==================== TESTIMONIALS ==================== st.markdown("## πŸ’¬ What Women Are Saying") col1, col2, col3 = st.columns(3) with col1: st.markdown("""

"This platform helped me find my dream job and connected me with an amazing mentor. Forever grateful!"

- Priya S., Software Engineer

""", unsafe_allow_html=True) with col2: st.markdown("""

"The free courses here helped me transition from housewife to freelance designer. Now I support my family!"

- Anita M., Graphic Designer

""", unsafe_allow_html=True) with col3: st.markdown("""

"The emergency resources and legal information gave me the courage to stand up for my rights."

- Rekha T., Legal Advocate

""", unsafe_allow_html=True) st.markdown("
", unsafe_allow_html=True) # ==================== FOOTER CALL TO ACTION (REDESIGNED) ==================== st.markdown("
", unsafe_allow_html=True) # Container for the banner with st.container(): st.markdown("""

πŸš€ Ready to Start Your Journey?

Join thousands of women who are transforming their lives today.

""", unsafe_allow_html=True) # Centering the button using columns c1, c2, c3 = st.columns([1.5, 1, 1.5]) with c2: # Negative margin pulls the button up into the banner visually st.markdown('
', unsafe_allow_html=True) if st.button("✨ Get Started Now", type="primary", use_container_width=True): st.balloons() st.toast("Welcome aboard! Use the sidebar to navigate πŸ‘ˆ") # ==================== END OF HOME PAGE ====================