Spaces:
Running
Running
File size: 878 Bytes
1002edf fd6f526 1002edf fd6f526 787cc39 161a652 fd6f526 787cc39 fd6f526 48b0b31 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
import streamlit as st
import home
import prediction
import about
import contact
# Set page config
st.set_page_config(page_title="TransPolymer", layout="wide", page_icon="π§ͺ")
# Navigation menu
st.sidebar.title("π Navigation")
page = st.sidebar.radio("Select a Page", ["Home", "Predictions", "About", "Contact"])
# Handle URL query params (e.g., ?page=Contact)
query_params = st.query_params
if "page" in query_params:
page = query_params["page"][0].capitalize() # Capitalize to match the radio button options
# Page routing logic
def load_page(page_name):
if page_name == "Home":
home.show()
elif page_name == "Predictions":
prediction.show()
elif page_name == "About":
about.show()
elif page_name == "Contact":
contact.show()
else:
st.error("Page not found")
# Load the selected page
load_page(page)
|