import streamlit as st def apply_modern_styles(): """Apply modern styles by loading the CSS file""" # Styles are now loaded from style.css in app.py pass def page_header(title, subtitle=None): """Render a consistent page header with gradient background""" st.markdown( f''' ''', unsafe_allow_html=True ) def hero_section(title, subtitle=None, description=None): """Render a modern hero section with gradient background and animations""" # If description is provided but subtitle is not, use description as subtitle if description and not subtitle: subtitle = description description = None st.markdown( f''' ''', unsafe_allow_html=True ) def feature_card(icon, title, description): """Render a modern feature card with hover effects""" st.markdown(f"""

{title}

{description}

""", unsafe_allow_html=True) def about_section(content, image_path=None, social_links=None): """Render a modern about section with profile image and social links""" st.markdown("""
""", unsafe_allow_html=True) # Profile Image if image_path: st.image(image_path, use_column_width=False, width=200) # Image Upload uploaded_file = st.file_uploader("Upload profile picture", type=['png', 'jpg', 'jpeg']) if uploaded_file is not None: st.image(uploaded_file, use_column_width=False, width=200) # Social Links if social_links: st.markdown('', unsafe_allow_html=True) # About Content st.markdown(f"""
{content}
""", unsafe_allow_html=True) def metric_card(label, value, delta=None, icon=None): """Render a modern metric card with animations""" icon_html = f'' if icon else '' delta_html = f'
{delta}
' if delta else '' st.markdown(f"""
{icon_html}
{label}
{value}
{delta_html}
""", unsafe_allow_html=True) def template_card(title, description, image_url=None): """Render a modern template card with glassmorphism effect""" image_html = f'' if image_url else '' st.markdown(f"""
{image_html}

{title}

{description}

""", unsafe_allow_html=True) def feedback_card(name, feedback, rating): """Render a modern feedback card with rating stars""" stars = "⭐" * int(rating) st.markdown(f"""

{feedback}

""", unsafe_allow_html=True) def loading_spinner(message="Loading..."): """Show a modern loading spinner with message""" st.markdown(f"""

{message}

""", unsafe_allow_html=True) def progress_bar(value, max_value, label=None): """Render a modern animated progress bar""" percentage = (value / max_value) * 100 label_html = f'
{label}
' if label else '' st.markdown(f"""
{label_html}
{percentage:.1f}%
""", unsafe_allow_html=True) def tooltip(content, tooltip_text): """Render content with a modern tooltip""" st.markdown(f"""
{content}
""", unsafe_allow_html=True) def data_table(data, headers): """Render a modern data table with hover effects""" header_row = "".join([f"{header}" for header in headers]) rows = "" for row in data: cells = "".join([f"{cell}" for cell in row]) rows += f"{cells}" st.markdown(f"""
{header_row} {rows}
""", unsafe_allow_html=True) def grid_layout(*elements): """Create a responsive grid layout""" st.markdown("""
{}
""".format("".join(elements)), unsafe_allow_html=True) def alert(message, type="info"): """Display a modern alert message""" alert_types = { "info": ("ℹ️", "var(--accent-color)"), "success": ("✅", "var(--success-color)"), "warning": ("⚠️", "var(--warning-color)"), "error": ("❌", "var(--error-color)") } icon, color = alert_types.get(type, alert_types["info"]) st.markdown(f"""
{icon} {message}
""", unsafe_allow_html=True) def about_section(title, description, team_members=None): st.markdown(f"""

{title}

{description}

{generate_team_section(team_members) if team_members else ''}
""", unsafe_allow_html=True) def generate_team_section(team_members): if not team_members: return "" team_html = '
' for member in team_members: team_html += f"""
{member['name']}

{member['name']}

{member['role']}

""" team_html += '
' return team_html def render_feedback(feedback_data): """Render feedback with modern styling""" if not feedback_data: return feedback_html = """

Resume Analysis Feedback

""" for category, items in feedback_data.items(): if items: # Only show categories with feedback for item in items: feedback_html += f""" """ feedback_html += """
""" st.markdown(feedback_html, unsafe_allow_html=True) def render_analytics_section(resume_uploaded=False, metrics=None): """Render the analytics section of the dashboard""" if not metrics: metrics = { 'views': 0, 'downloads': 0, 'score': 'N/A' } # Views Card st.markdown("""

Resume Views

{}

""".format(metrics['views']), unsafe_allow_html=True) # Downloads Card st.markdown("""

Downloads

{}

""".format(metrics['downloads']), unsafe_allow_html=True) # Profile Score Card st.markdown("""

Profile Score

{}

""".format(metrics['score']), unsafe_allow_html=True) def render_activity_section(resume_uploaded=False): """Render the recent activity section""" st.markdown("""

Recent Activity

""", unsafe_allow_html=True) if resume_uploaded: st.markdown("""

• Resume uploaded and analyzed

• Generated optimization suggestions

• Updated profile score

""", unsafe_allow_html=True) else: st.markdown("""

Upload your resume to see activity

""", unsafe_allow_html=True) st.markdown("
", unsafe_allow_html=True) def render_suggestions_section(resume_uploaded=False): """Render the suggestions section""" st.markdown("""

Suggestions

""", unsafe_allow_html=True) if resume_uploaded: st.markdown("""

• Add more quantifiable achievements

• Include relevant keywords

• Optimize formatting

""", unsafe_allow_html=True) else: st.markdown("""

Upload your resume to get suggestions

""", unsafe_allow_html=True) st.markdown("
", unsafe_allow_html=True)