Update app.py
Browse files
app.py
CHANGED
@@ -43,25 +43,74 @@ audio_1= "sound_effect.mp3"
|
|
43 |
video_intro = "FIFA_World_Cup_2022_Soundtrack.mp4"
|
44 |
video_concu = "Argentina v France _ FIFA World Cup Qatar 2022.mp4"
|
45 |
|
46 |
-
import streamlit as st
|
47 |
-
|
48 |
-
|
49 |
|
50 |
# Set page configuration
|
51 |
st.set_page_config(
|
52 |
page_title="FIFA World Cup 2022 Data Analysis",
|
53 |
-
page_icon="β½"
|
|
|
|
|
|
|
|
|
54 |
)
|
55 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
# Title
|
57 |
st.title("FIFA World Cup 2022 Data Analysis")
|
|
|
58 |
# Initialize session state
|
59 |
if 'app_mode' not in st.session_state:
|
60 |
st.session_state.app_mode = 'Welcome'
|
61 |
|
62 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
|
64 |
-
|
|
|
65 |
|
66 |
st.sidebar.markdown("Navigate through below sections:")
|
67 |
# Page selection buttons
|
@@ -81,7 +130,6 @@ elif selected_button == 'Feature of Importance & Shap π':
|
|
81 |
st.session_state.app_mode = 'Feature of Importance & Shap'
|
82 |
elif selected_button == 'MLflow & Deployment π':
|
83 |
st.session_state.app_mode = 'MLflow & Deployment'
|
84 |
-
|
85 |
elif selected_button == 'Conclusion π':
|
86 |
st.session_state.app_mode = 'Conclusion'
|
87 |
|
|
|
43 |
video_intro = "FIFA_World_Cup_2022_Soundtrack.mp4"
|
44 |
video_concu = "Argentina v France _ FIFA World Cup Qatar 2022.mp4"
|
45 |
|
|
|
|
|
|
|
46 |
|
47 |
# Set page configuration
|
48 |
st.set_page_config(
|
49 |
page_title="FIFA World Cup 2022 Data Analysis",
|
50 |
+
page_icon="β½",
|
51 |
+
layout="centered", # Set layout to wide
|
52 |
+
initial_sidebar_state="expanded", # Keep sidebar expanded by default
|
53 |
+
|
54 |
+
|
55 |
)
|
56 |
|
57 |
+
# CSS styles for light and dark modes
|
58 |
+
universal_text_color_css = """
|
59 |
+
<style>
|
60 |
+
/* Set universal text color */
|
61 |
+
body, .sidebar .sidebar-content, .sidebar .sidebar-content .block-container {
|
62 |
+
color: #333; /* Set text color */
|
63 |
+
}
|
64 |
+
</style>
|
65 |
+
"""
|
66 |
+
st.markdown(universal_text_color_css, unsafe_allow_html=True) # Apply universal text color CSS styles
|
67 |
+
|
68 |
+
# CSS styles to center the page title
|
69 |
+
centered_title_css = """
|
70 |
+
<style>
|
71 |
+
.title-wrapper {
|
72 |
+
text-align: center !important;
|
73 |
+
margin-bottom: 0.5rem; /* Adjust margin bottom */
|
74 |
+
}
|
75 |
+
</style>
|
76 |
+
"""
|
77 |
+
|
78 |
+
# Apply the CSS styles to center the page title
|
79 |
+
st.markdown(centered_title_css, unsafe_allow_html=True)
|
80 |
+
|
81 |
# Title
|
82 |
st.title("FIFA World Cup 2022 Data Analysis")
|
83 |
+
|
84 |
# Initialize session state
|
85 |
if 'app_mode' not in st.session_state:
|
86 |
st.session_state.app_mode = 'Welcome'
|
87 |
|
88 |
+
# Set sidebar width and style for sidebar buttons
|
89 |
+
st.markdown(
|
90 |
+
"""
|
91 |
+
<style>
|
92 |
+
.sidebar .sidebar-content {
|
93 |
+
width: 300px;
|
94 |
+
}
|
95 |
+
.sidebar .sidebar-content .block-container {
|
96 |
+
color: #333; /* Set sidebar text color */
|
97 |
+
}
|
98 |
+
.sidebar .sidebar-content .block-container .stRadio {
|
99 |
+
font-weight: bold; /* Make sidebar buttons bold */
|
100 |
+
color: #007bff; /* Set sidebar button text color to blue */
|
101 |
+
}
|
102 |
+
.sidebar .sidebar-content .block-container .stRadio label {
|
103 |
+
font-weight: bold; /* Make sidebar button labels bold */
|
104 |
+
}
|
105 |
+
</style>
|
106 |
+
""",
|
107 |
+
unsafe_allow_html=True,
|
108 |
+
)
|
109 |
+
|
110 |
+
|
111 |
|
112 |
+
# Sidebar
|
113 |
+
st.sidebar.markdown("<h2 style='color: yellow; text-align: center; border-bottom: 2px solid yellow; font-weight: bold;'>Explore FIFA World Cup 2022 Data Analysis</h2>", unsafe_allow_html=True)
|
114 |
|
115 |
st.sidebar.markdown("Navigate through below sections:")
|
116 |
# Page selection buttons
|
|
|
130 |
st.session_state.app_mode = 'Feature of Importance & Shap'
|
131 |
elif selected_button == 'MLflow & Deployment π':
|
132 |
st.session_state.app_mode = 'MLflow & Deployment'
|
|
|
133 |
elif selected_button == 'Conclusion π':
|
134 |
st.session_state.app_mode = 'Conclusion'
|
135 |
|