JacksonMu commited on
Commit
3532995
β€’
1 Parent(s): 6c23dab

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -25
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 wide
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 to center the page title
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 🏁']