Spaces:
Runtime error
Runtime error
| import streamlit as st | |
| from pathlib import Path | |
| # Configure page settings | |
| st.set_page_config( | |
| page_title="Social Media Addiction Insights", | |
| page_icon="๐", | |
| layout="wide", | |
| initial_sidebar_state="expanded" | |
| ) | |
| logo_path = "download.jpg" # Replace with the path to your logo image | |
| st.sidebar.image(logo_path, use_container_width =True) | |
| # Sidebar navigation | |
| st.sidebar.title("Navigation") | |
| page = st.sidebar.radio("Go to", [ | |
| "HomePage", | |
| "User Demographics", | |
| "Platform Usage Patterns", | |
| "Video Consumption Insights", | |
| "Socioeconomic Analysis", | |
| "Addiction Level Distribution", | |
| "Activity and Connection Type", | |
| "Personalize Assistance" | |
| ]) | |
| st.markdown( | |
| """ | |
| <style> | |
| [data-testid="stSidebarNav"] { | |
| display: none; | |
| } | |
| </style> | |
| """, | |
| unsafe_allow_html=True, | |
| ) | |
| # Dynamically load pages | |
| pages_dir = Path("pages") | |
| page_files = { | |
| "HomePage": "HomePage.py", | |
| "User Demographics": "overview.py", | |
| "Platform Usage Patterns": "platform_usage.py", | |
| "Video Consumption Insights": "video_insights.py", | |
| "Socioeconomic Analysis": "socioeconomic.py", | |
| "Addiction Level Distribution": "addiction.py", | |
| "Activity and Connection Type": "activity.py", | |
| "Personalize Assistance": "chatbot.py" | |
| } | |
| if page in page_files: | |
| exec(open(pages_dir / page_files[page]).read()) | |
| else: | |
| st.error("Page not found!") | |