Spaces:
Sleeping
Sleeping
Update Home.py
Browse files
Home.py
CHANGED
@@ -1,12 +1,20 @@
|
|
1 |
import streamlit as st
|
2 |
from streamlit_extras.switch_page_button import switch_page
|
3 |
|
4 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
st.markdown(
|
6 |
f"""
|
7 |
<style>
|
8 |
.stApp {{
|
9 |
-
background-image: url("
|
10 |
background-size: cover;
|
11 |
background-repeat: no-repeat;
|
12 |
background-attachment: fixed;
|
@@ -57,9 +65,12 @@ st.markdown(
|
|
57 |
}}
|
58 |
</style>
|
59 |
""",
|
60 |
-
unsafe_allow_html=True
|
61 |
)
|
62 |
|
|
|
|
|
|
|
63 |
# Header with Logo
|
64 |
st.markdown(
|
65 |
"""
|
|
|
1 |
import streamlit as st
|
2 |
from streamlit_extras.switch_page_button import switch_page
|
3 |
|
4 |
+
# Load background image
|
5 |
+
def get_base64_bg(image_path):
|
6 |
+
with open(image_path, "rb") as img_file:
|
7 |
+
encoded = base64.b64encode(img_file.read()).decode()
|
8 |
+
return f"data:image/jpg;base64,{encoded}"
|
9 |
+
|
10 |
+
background_img = get_base64_bg("background.jpg")
|
11 |
+
|
12 |
+
# Set the background using encoded image
|
13 |
st.markdown(
|
14 |
f"""
|
15 |
<style>
|
16 |
.stApp {{
|
17 |
+
background-image: url("{background_img}");
|
18 |
background-size: cover;
|
19 |
background-repeat: no-repeat;
|
20 |
background-attachment: fixed;
|
|
|
65 |
}}
|
66 |
</style>
|
67 |
""",
|
68 |
+
unsafe_allow_html=True
|
69 |
)
|
70 |
|
71 |
+
# 👇 Rest of your app (header, content, buttons) remains unchanged from the previous message.
|
72 |
+
|
73 |
+
|
74 |
# Header with Logo
|
75 |
st.markdown(
|
76 |
"""
|