Update app.py
Browse files
app.py
CHANGED
@@ -51,7 +51,7 @@ import streamlit as st
|
|
51 |
st.set_page_config(
|
52 |
page_title="FIFA World Cup 2022 Data Analysis",
|
53 |
page_icon="β½",
|
54 |
-
layout="centered", # Set layout to
|
55 |
initial_sidebar_state="expanded" # Keep sidebar expanded by default
|
56 |
)
|
57 |
|
@@ -66,17 +66,24 @@ body, .sidebar .sidebar-content, .sidebar .sidebar-content .block-container {
|
|
66 |
"""
|
67 |
st.markdown(universal_text_color_css, unsafe_allow_html=True) # Apply universal text color CSS styles
|
68 |
|
69 |
-
# CSS styles to center the page title
|
70 |
centered_title_css = """
|
71 |
<style>
|
72 |
.title-wrapper {
|
73 |
text-align: center !important;
|
74 |
margin-bottom: 0.5rem; /* Adjust margin bottom */
|
75 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
</style>
|
77 |
"""
|
78 |
|
79 |
-
# Apply the CSS styles
|
80 |
st.markdown(centered_title_css, unsafe_allow_html=True)
|
81 |
|
82 |
# Title
|
@@ -86,28 +93,6 @@ st.title("FIFA World Cup 2022 Data Analysis")
|
|
86 |
if 'app_mode' not in st.session_state:
|
87 |
st.session_state.app_mode = 'Welcome'
|
88 |
|
89 |
-
|
90 |
-
|
91 |
-
# Set sidebar width
|
92 |
-
st.markdown(
|
93 |
-
"""
|
94 |
-
<style>
|
95 |
-
.sidebar .sidebar-content {
|
96 |
-
width: 300px;
|
97 |
-
}
|
98 |
-
.sidebar .sidebar-content .block-container {
|
99 |
-
color: #333; /* Set sidebar text color */
|
100 |
-
}
|
101 |
-
.sidebar .sidebar-content .block-container .stRadio {
|
102 |
-
font-weight: bold; /* Make sidebar buttons bold */
|
103 |
-
color: #333; /* Set sidebar button text color */
|
104 |
-
}
|
105 |
-
</style>
|
106 |
-
""",
|
107 |
-
unsafe_allow_html=True,
|
108 |
-
)
|
109 |
-
|
110 |
-
|
111 |
st.sidebar.markdown("Navigate through below sections:")
|
112 |
# Page selection buttons
|
113 |
button_labels = ['Welcome π ', 'Introduction π', 'Visualization π', 'Prediction π', 'Feature of Importance & Shap π', 'MLflow & Deployment π', 'Conclusion π']
|
|
|
51 |
st.set_page_config(
|
52 |
page_title="FIFA World Cup 2022 Data Analysis",
|
53 |
page_icon="β½",
|
54 |
+
layout="centered", # Set layout to centered
|
55 |
initial_sidebar_state="expanded" # Keep sidebar expanded by default
|
56 |
)
|
57 |
|
|
|
66 |
"""
|
67 |
st.markdown(universal_text_color_css, unsafe_allow_html=True) # Apply universal text color CSS styles
|
68 |
|
69 |
+
# CSS styles to center the page title and fix sidebar
|
70 |
centered_title_css = """
|
71 |
<style>
|
72 |
.title-wrapper {
|
73 |
text-align: center !important;
|
74 |
margin-bottom: 0.5rem; /* Adjust margin bottom */
|
75 |
}
|
76 |
+
/* Fix sidebar while allowing scrolling within */
|
77 |
+
.sidebar .sidebar-content {
|
78 |
+
position: fixed !important;
|
79 |
+
overflow-y: auto;
|
80 |
+
height: 100%;
|
81 |
+
width: 300px;
|
82 |
+
}
|
83 |
</style>
|
84 |
"""
|
85 |
|
86 |
+
# Apply the CSS styles
|
87 |
st.markdown(centered_title_css, unsafe_allow_html=True)
|
88 |
|
89 |
# Title
|
|
|
93 |
if 'app_mode' not in st.session_state:
|
94 |
st.session_state.app_mode = 'Welcome'
|
95 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
st.sidebar.markdown("Navigate through below sections:")
|
97 |
# Page selection buttons
|
98 |
button_labels = ['Welcome π ', 'Introduction π', 'Visualization π', 'Prediction π', 'Feature of Importance & Shap π', 'MLflow & Deployment π', 'Conclusion π']
|