Update app.py
Browse files
app.py
CHANGED
@@ -1,42 +1,40 @@
|
|
1 |
import streamlit as st
|
2 |
|
3 |
# Set page config
|
4 |
-
st.set_page_config(page_title="Fixed Status Widget", layout="wide")
|
5 |
|
6 |
-
# CSS
|
7 |
st.markdown("""
|
8 |
<style>
|
9 |
-
/*
|
10 |
-
[data-testid="stStatusWidget"]
|
|
|
11 |
position: fixed !important;
|
12 |
-
top:
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
border-bottom-left-radius: 4px;
|
19 |
-
box-shadow: 0 0 4px rgba(0,0,0,0.1);
|
20 |
}
|
21 |
|
22 |
-
/*
|
23 |
-
|
24 |
-
|
|
|
25 |
}
|
26 |
</style>
|
27 |
""", unsafe_allow_html=True)
|
28 |
|
29 |
# Your regular Streamlit app content
|
30 |
st.title("App with Fixed Status Widget")
|
|
|
31 |
|
32 |
-
#
|
33 |
-
st.write("Scroll down to see the status widget remain fixed at the top")
|
34 |
-
|
35 |
-
# Generate content to enable scrolling
|
36 |
for i in range(30):
|
37 |
-
st.write(f"
|
38 |
-
if i %
|
39 |
-
st.markdown("
|
40 |
|
41 |
|
42 |
# --- SHARED ON ALL PAGES ---
|
|
|
1 |
import streamlit as st
|
2 |
|
3 |
# Set page config
|
4 |
+
st.set_page_config(page_title="Fixed Status Widget Approach 2", layout="wide")
|
5 |
|
6 |
+
# More specific CSS targeting just the status widget
|
7 |
st.markdown("""
|
8 |
<style>
|
9 |
+
/* Very specific targeting of the status widget */
|
10 |
+
div[data-testid="stStatusWidget"],
|
11 |
+
div:has(> div[data-testid="stStatusWidget"]) {
|
12 |
position: fixed !important;
|
13 |
+
top: 5px !important;
|
14 |
+
right: 5px !important;
|
15 |
+
z-index: 1000000 !important;
|
16 |
+
background-color: white !important;
|
17 |
+
border-radius: 4px !important;
|
18 |
+
box-shadow: 0 0 10px rgba(0,0,0,0.15) !important;
|
|
|
|
|
19 |
}
|
20 |
|
21 |
+
/* Ensure the status button stays visible */
|
22 |
+
button[kind="formSubmit"] {
|
23 |
+
visibility: visible !important;
|
24 |
+
display: inline-flex !important;
|
25 |
}
|
26 |
</style>
|
27 |
""", unsafe_allow_html=True)
|
28 |
|
29 |
# Your regular Streamlit app content
|
30 |
st.title("App with Fixed Status Widget")
|
31 |
+
st.write("Scroll down to test if the status widget stays fixed")
|
32 |
|
33 |
+
# Generate content for scrolling
|
|
|
|
|
|
|
34 |
for i in range(30):
|
35 |
+
st.write(f"Testing content line {i}")
|
36 |
+
if i % 10 == 0:
|
37 |
+
st.markdown("### Section Break")
|
38 |
|
39 |
|
40 |
# --- SHARED ON ALL PAGES ---
|