Update app.py
Browse files
app.py
CHANGED
@@ -1,34 +1,35 @@
|
|
1 |
import streamlit as st
|
2 |
|
3 |
-
# Custom CSS
|
4 |
st.markdown("""
|
5 |
<style>
|
6 |
-
|
|
|
|
|
7 |
position: fixed;
|
8 |
top: 0;
|
9 |
left: 0;
|
10 |
right: 0;
|
11 |
-
|
|
|
12 |
background-color: white;
|
13 |
-
|
14 |
-
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
|
15 |
}
|
16 |
-
|
17 |
-
/*
|
18 |
-
.main
|
19 |
-
padding-top:
|
20 |
}
|
21 |
-
</style>
|
22 |
-
""", unsafe_allow_html=True)
|
23 |
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
# Other header elements
|
29 |
-
st.markdown('</div>', unsafe_allow_html=True)
|
30 |
|
31 |
-
|
|
|
|
|
|
|
32 |
|
33 |
# --- PAGE SETUP ---
|
34 |
type_text_page = st.Page(
|
|
|
1 |
import streamlit as st
|
2 |
|
3 |
+
# Custom CSS to ensure sticky header in both Streamlit and Hugging Face environments
|
4 |
st.markdown("""
|
5 |
<style>
|
6 |
+
/* Target both Streamlit native and Hugging Face iframe embedding */
|
7 |
+
/* Make the header sticky */
|
8 |
+
header[data-testid="stHeader"] {
|
9 |
position: fixed;
|
10 |
top: 0;
|
11 |
left: 0;
|
12 |
right: 0;
|
13 |
+
height: auto;
|
14 |
+
z-index: 999990;
|
15 |
background-color: white;
|
16 |
+
box-shadow: 0 1px 5px rgba(0,0,0,0.1);
|
|
|
17 |
}
|
18 |
+
|
19 |
+
/* For Hugging Face specific iframe handling */
|
20 |
+
section.main {
|
21 |
+
padding-top: 70px;
|
22 |
}
|
|
|
|
|
23 |
|
24 |
+
/* Ensure content doesn't get hidden under the header */
|
25 |
+
.block-container {
|
26 |
+
padding-top: 1rem;
|
27 |
+
}
|
|
|
|
|
28 |
|
29 |
+
/* Fix for Hugging Face iframe specific issues */
|
30 |
+
iframe body .stApp {
|
31 |
+
padding-top: 3rem;
|
32 |
+
}
|
33 |
|
34 |
# --- PAGE SETUP ---
|
35 |
type_text_page = st.Page(
|