Spaces:
Sleeping
Sleeping
| import streamlit as st | |
| import os | |
| from modules import intro, module1, module2, module3,module4, assignments, resources | |
| from config import CUSTOM_CSS | |
| # Set page configuration | |
| st.set_page_config( | |
| page_title="Course Website", | |
| page_icon="π", | |
| layout="wide" | |
| ) | |
| # Apply custom CSS | |
| st.markdown(CUSTOM_CSS, unsafe_allow_html=True) | |
| # Initialize session state for navigation if it doesn't exist | |
| if 'current_page' not in st.session_state: | |
| st.session_state.current_page = 'intro' | |
| # Define course sections with their corresponding module functions | |
| course_sections = { | |
| "Introduction": (intro.show, "intro"), | |
| "Module 1: Getting Started": (module1.show, "module1"), | |
| "Module 2: Learning from Examples": (module2.show, "module2"), | |
| "Module 3: Machine Learning Demo": (module3.show, "module3"), | |
| "Module 4: Custom Learning Path": (module4.show, "module4"), | |
| "Assignments": (assignments.show, "assignments"), | |
| "Resources": (resources.show, "resources") | |
| } | |
| # Create navigation buttons in sidebar | |
| for section_name, (_, section_id) in course_sections.items(): | |
| if st.sidebar.button(section_name, key=section_id): | |
| st.session_state.current_page = section_id | |
| # Display content based on current page | |
| current_module = next((module for module, section_id in course_sections.values() | |
| if section_id == st.session_state.current_page), intro.show) | |
| current_module() | |
| # Footer | |
| st.markdown(""" | |
| <div class="footer"> | |
| <div class="footer-content"> | |
| <div class="footer-text"> | |
| <p>Β© 2025 Cura Learning All rights reserved.</p> | |
| </div> | |
| </div> | |
| </div> | |
| """, unsafe_allow_html=True) |