Update app.py
Browse files
app.py
CHANGED
@@ -1,46 +1,59 @@
|
|
1 |
import streamlit as st
|
2 |
|
3 |
-
#
|
4 |
st.set_page_config(page_title="My App", layout="wide")
|
5 |
|
6 |
-
#
|
7 |
-
st.title("My App Title")
|
8 |
-
|
9 |
-
# Create a custom header with container
|
10 |
-
header = st.container()
|
11 |
-
with header:
|
12 |
-
col1, col2 = st.columns([3, 1])
|
13 |
-
with col1:
|
14 |
-
st.subheader("Custom Sticky Navigation")
|
15 |
-
with col2:
|
16 |
-
st.button("Button 1")
|
17 |
-
|
18 |
-
# Add minimal CSS that won't interfere with status toolbar
|
19 |
st.markdown("""
|
20 |
<style>
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
background-color: #f0f5f5;
|
27 |
-
padding:
|
28 |
-
z-index:
|
29 |
border-bottom: 1px solid #ddd;
|
|
|
|
|
|
|
30 |
}
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
|
|
|
|
|
|
35 |
}
|
36 |
</style>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
""", unsafe_allow_html=True)
|
38 |
|
39 |
-
# Main content
|
40 |
-
st.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
|
42 |
-
|
43 |
-
for i in range(30):
|
44 |
st.write(f"Content line {i}")
|
45 |
|
46 |
|
|
|
1 |
import streamlit as st
|
2 |
|
3 |
+
# Set page config
|
4 |
st.set_page_config(page_title="My App", layout="wide")
|
5 |
|
6 |
+
# Minimal CSS that shouldn't interfere with status toolbar
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
st.markdown("""
|
8 |
<style>
|
9 |
+
.fixed-nav {
|
10 |
+
position: fixed;
|
11 |
+
top: 0;
|
12 |
+
left: 0;
|
13 |
+
width: 100%;
|
14 |
background-color: #f0f5f5;
|
15 |
+
padding: 10px;
|
16 |
+
z-index: 999;
|
17 |
border-bottom: 1px solid #ddd;
|
18 |
+
display: flex;
|
19 |
+
justify-content: space-between;
|
20 |
+
align-items: center;
|
21 |
}
|
22 |
+
.main-content {
|
23 |
+
margin-top: 60px;
|
24 |
+
}
|
25 |
+
/* Don't hide status toolbar */
|
26 |
+
[data-testid="stStatusWidget"] {
|
27 |
+
visibility: visible !important;
|
28 |
+
z-index: 1000;
|
29 |
}
|
30 |
</style>
|
31 |
+
|
32 |
+
<div class="fixed-nav">
|
33 |
+
<h2>App Navigation</h2>
|
34 |
+
<div>
|
35 |
+
<button onclick="window.location.href='#section1'">Section 1</button>
|
36 |
+
<button onclick="window.location.href='#section2'">Section 2</button>
|
37 |
+
</div>
|
38 |
+
</div>
|
39 |
+
<div class="main-content">
|
40 |
+
</div>
|
41 |
""", unsafe_allow_html=True)
|
42 |
|
43 |
+
# Main app title and content
|
44 |
+
st.title("My App with Navigation")
|
45 |
+
|
46 |
+
# Add sample content
|
47 |
+
st.header("Section 1", anchor="section1")
|
48 |
+
st.write("This is section 1 content")
|
49 |
+
|
50 |
+
for i in range(10):
|
51 |
+
st.write(f"Content line {i}")
|
52 |
+
|
53 |
+
st.header("Section 2", anchor="section2")
|
54 |
+
st.write("This is section 2 content")
|
55 |
|
56 |
+
for i in range(10):
|
|
|
57 |
st.write(f"Content line {i}")
|
58 |
|
59 |
|