Update app.py
Browse files
app.py
CHANGED
@@ -31,23 +31,24 @@ about_page = st.Page(
|
|
31 |
icon=":material/info:",
|
32 |
default=False)
|
33 |
|
34 |
-
# This is the key trick:
|
35 |
-
# 1. Define all content first
|
36 |
-
content = [f"This is scrollable content line {i}" for i in range(100)]
|
37 |
|
38 |
-
#
|
39 |
-
for i in range(
|
40 |
-
st.write(content
|
41 |
-
|
42 |
-
#
|
43 |
-
|
44 |
-
|
45 |
-
#
|
46 |
-
st.
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
|
|
|
|
|
|
|
|
51 |
|
52 |
|
53 |
# --- NAVIGATION SETUP ---
|
|
|
31 |
icon=":material/info:",
|
32 |
default=False)
|
33 |
|
|
|
|
|
|
|
34 |
|
35 |
+
# Create scrollable content
|
36 |
+
for i in range(100):
|
37 |
+
st.write(f"This is scrollable content line {i}")
|
38 |
+
|
39 |
+
# Create an anchor at the bottom
|
40 |
+
st.markdown('<div id="bottom"></div>', unsafe_allow_html=True)
|
41 |
+
|
42 |
+
# Add JavaScript to automatically scroll to the anchor
|
43 |
+
st.markdown("""
|
44 |
+
<script>
|
45 |
+
// Set a timeout to ensure the page has loaded
|
46 |
+
setTimeout(function() {
|
47 |
+
// Scroll to the bottom anchor
|
48 |
+
document.getElementById('bottom').scrollIntoView();
|
49 |
+
}, 500);
|
50 |
+
</script>
|
51 |
+
""", unsafe_allow_html=True)
|
52 |
|
53 |
|
54 |
# --- NAVIGATION SETUP ---
|