transpolymer commited on
Commit
787cc39
·
verified ·
1 Parent(s): 48b0b31

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -27
app.py CHANGED
@@ -1,31 +1,21 @@
1
  import streamlit as st
2
- import home # Import home.py for the home page
3
- import prediction # Import predictions.py for the predictions page
4
- import about # Import about.py for the about page
5
- import contact # Import contact.py for the contact page
6
 
7
- # Set up navigation logic
8
- def load_page(page):
9
- if page == "Home":
10
- home.show() # Call home.py's show() function
11
- elif page == "Predictions":
12
- prediction.show() # Call predictions.py's show() function
13
- elif page == "About":
14
- about.show() # Call about.py's show() function
15
- elif page == "Contact":
16
- contact.show() # Call contact.py's show() function
17
- else:
18
- st.error("Page not found")
19
 
20
- # Navigation menu
21
- st.sidebar.title("Navigation")
22
- page = st.sidebar.radio("Select a Page", ["Home", "Predictions", "About", "Contact"])
23
 
24
- # Call the function to display the selected page
25
- load_page(page)
26
-
27
- # Handle page URL updates
28
- query_params = st.query_params
29
- if "page" in query_params:
30
- page = query_params["page"][0] # Get page value from URL parameters
31
-  load_page(page)
 
 
1
  import streamlit as st
2
+ from home import show_home
3
+ from prediction import show_prediction
4
+ from contact import show_contact
5
+ from about import show_about
6
 
7
+ st.set_page_config(page_title="TransPolymer", layout="wide", page_icon="🧪")
 
 
 
 
 
 
 
 
 
 
 
8
 
9
+ # Sidebar for navigation
10
+ st.sidebar.title("🔗 Navigation")
11
+ page = st.sidebar.radio("Go to", ["Home", "Prediction", "Contact Us", "About"])
12
 
13
+ # Routing logic
14
+ if page == "Home":
15
+ show_home()
16
+ elif page == "Prediction":
17
+ show_prediction()
18
+ elif page == "Contact Us":
19
+ show_contact()
20
+ elif page == "About":
21
+ show_about()