|
import streamlit as st |
|
|
|
|
|
|
|
st.set_page_config( |
|
page_title="SBS V2.0 mapper", |
|
|
|
|
|
layout="wide" |
|
) |
|
|
|
|
|
st.markdown(""" |
|
<style> |
|
/* Target the main app container and ensure its overflow is visible */ |
|
/* This is crucial for sticky positioning of elements inside it relative to the viewport */ |
|
[data-testid="stApp"] { |
|
overflow: visible !important; /* Force overflow to be visible */ |
|
} |
|
|
|
/* Target the default Streamlit header element */ |
|
/* This is typically the <header> tag containing the title, menu, and status */ |
|
header { |
|
position: sticky !important; /* Force sticky positioning */ |
|
top: 0px !important; /* Force sticking to the top edge */ |
|
z-index: 999 !important; /* Force a high z-index */ |
|
background-color: rgb(255, 255, 255) !important; /* Force background color (white or match Streamlit's default) */ |
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Add shadow */ |
|
height: auto !important; /* Force height to adjust */ |
|
/* overflow: visible !important; /* This might also be needed on the header itself */ |
|
} |
|
|
|
/* Add padding to the main content area to prevent it from starting behind the sticky header */ |
|
/* This targets the main container div where your app content and pages are rendered */ |
|
/* Adjust this value based on the header's actual height after inspecting the deployed app */ |
|
[data-testid="stAppViewContainer"] { |
|
padding-top: 60px; /* Estimate header height (~60px). Adjust if needed. */ |
|
} |
|
|
|
/* Adjust padding for the sidebar content as well */ |
|
[data-testid="stSidebar"] { |
|
padding-top: 60px; /* Use the same padding value as the main content */ |
|
} |
|
|
|
/* Ensure the main content block within the container also has correct top padding */ |
|
.main .block-container { |
|
padding-top: 1rem; /* Keep or adjust default Streamlit content padding */ |
|
} |
|
|
|
</style> |
|
""", unsafe_allow_html=True) |
|
|
|
|
|
|
|
|
|
|
|
|
|
st.logo(image="images/menu_book_60dp_75FBFD.png") |
|
|
|
|
|
st.sidebar.header("SBS V2.0 mapper") |
|
st.sidebar.write("(work in progress)") |
|
st.sidebar.text("Demo by JA-RAD") |
|
|
|
|
|
|
|
|
|
st.title("Map descriptions to SBS codes with Sentence Transformer + Reasoning") |
|
st.subheader("Select specific Chapter for quicker results") |
|
|
|
|
|
|
|
|
|
type_text_page = st.Page( |
|
page="pages/type_text.py", |
|
title="DEMO (work in progress)", |
|
icon=":material/keyboard:", |
|
default=True, |
|
) |
|
|
|
pg = st.navigation(pages=[type_text_page]) |
|
pg.run() |
|
|
|
|
|
|
|
for i in range(100): |
|
st.write(f"This is scrollable content line {i}") |
|
|