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"""
""", 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 ====================