|
import streamlit as st |
|
import streamlit.components.v1 as components |
|
|
|
|
|
|
|
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) |
|
|
|
|
|
|
|
|
|
pg = st.navigation({"Home": [home_page], "Demo": [type_text_page, upload_file_page], "About": [about_page]}) |
|
|
|
pg.run() |
|
|
|
|
|
st.markdown('<div id="bottom"></div>', unsafe_allow_html=True) |
|
|
|
|
|
scroll_script = """ |
|
<script> |
|
document.addEventListener('DOMContentLoaded', function() { |
|
const bottomElement = window.parent.document.getElementById('bottom'); |
|
if (bottomElement) { |
|
bottomElement.scrollIntoView({ behavior: 'smooth', block: 'end' }); |
|
} |
|
}); |
|
</script> |
|
""" |
|
|
|
|
|
components.html(scroll_script, height=0, width=0) |