|
import streamlit as st |
|
|
|
|
|
|
|
st.logo("images/medical_information_24dp_1F1F1F_FILL0_wght400_GRAD0_opsz24.png") |
|
st.sidebar.text("Project by SPG") |
|
|
|
|
|
|
|
home_page = st.Page( |
|
page="pages/home.py", |
|
title="Home", |
|
icon=":material/home:", |
|
default=True,) |
|
|
|
type_text_page = st.Page( |
|
page="pages/type_text.py", |
|
title="type text", |
|
icon=":material/keyboard:", |
|
default=False,) |
|
|
|
upload_file_page = st.Page( |
|
page="pages/upload_file.py", |
|
title="upload file", |
|
icon=":material/file_upload:", |
|
default=False,) |
|
|
|
about_page = st.Page( |
|
page="pages/about.py", |
|
title="About the app", |
|
icon=":material/info:", |
|
default=False) |
|
|
|
|
|
|
|
auto_scroll = st.sidebar.checkbox("Auto-scroll to bottom", value=True) |
|
|
|
|
|
for i in range(100): |
|
st.write(f"This is scrollable content line {i}") |
|
|
|
|
|
if st.button("Scroll to Bottom") or auto_scroll: |
|
|
|
st.markdown(''' |
|
<a name="bottom"></a> |
|
''', unsafe_allow_html=True) |
|
|
|
|
|
st.components.v1.html(''' |
|
<script> |
|
// Use the iframe parent to scroll the main content area |
|
window.parent.document.querySelector('section.main').scrollTo({ |
|
top: window.parent.document.querySelector('section.main').scrollHeight, |
|
behavior: 'smooth' |
|
}); |
|
</script> |
|
''', height=0) |
|
|
|
|
|
st.write("You've reached the bottom!") |
|
|
|
|
|
|
|
|
|
pg = st.navigation({"Home": [home_page], "Demo": [type_text_page, upload_file_page], "About": [about_page]}) |
|
|
|
pg.run() |