mediNER / app.py
georad's picture
Update app.py
2e58075 verified
raw
history blame
1.34 kB
import streamlit as st
import streamlit.components.v1 as components
# --- SHARED ON ALL PAGES ---
#st.logo(image=":material/medical_information:")
st.logo("images/medical_information_24dp_1F1F1F_FILL0_wght400_GRAD0_opsz24.png")
st.sidebar.text("Project by SPG")
# --- PAGE SETUP ---
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)
# --- NAVIGATION SETUP ---
#pg = st.navigation(pages=[home_page, type_text_page, upload_file_page, about_page]) # WITHOUT SECTIONS
pg = st.navigation({"Home": [home_page], "Demo": [type_text_page, upload_file_page], "About": [about_page]}) # WITH SECTIONS
pg.run()
# JavaScript to scroll to the bottom
scroll_script = """
<script>
var body = window.parent.document.querySelector(".main");
if (body) {
body.scrollTop = body.scrollHeight;
}
</script>
"""
# Inject the script
components.html(scroll_script, height=0, width=0)