|
import streamlit as st |
|
|
|
|
|
|
|
|
|
st.set_page_config( |
|
page_title="SBS V2.0 mapper", |
|
page_icon=":material/keyboard:", |
|
layout="wide" |
|
) |
|
|
|
|
|
st.markdown(""" |
|
<style> |
|
/* Make the default Streamlit header fixed at the top */ |
|
header { |
|
position: fixed; /* Use fixed positioning for viewport-relative stickiness */ |
|
top: 0; /* Position from the top edge */ |
|
left: 0; /* Position from the left edge */ |
|
width: 100%; /* Span the full width of the viewport */ |
|
z-index: 100; /* Ensure the header is above other content */ |
|
background-color: rgb(240, 242, 246); /* Match Streamlit's default header background color */ |
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Optional: Add a subtle shadow */ |
|
/* You might need to adjust padding if the default header height changes */ |
|
} |
|
|
|
/* Add padding to the main content area to prevent it from being hidden behind the fixed header */ |
|
/* This targets the main container div below the header and sidebar */ |
|
/* You might need to inspect the Streamlit app's HTML structure in your browser |
|
(using developer tools) to find the precise data-testid or class for this div |
|
if "stAppViewContainer" or "stVerticalBlock" doesn't work reliably, |
|
but stAppViewContainer is a common target. */ |
|
[data-testid="stAppViewContainer"] { |
|
padding-top: 70px; /* Adjust this value to be slightly more than your header's height */ |
|
} |
|
|
|
/* Also add padding to the sidebar content */ |
|
[data-testid="stSidebar"] { |
|
padding-top: 70px; /* Use the same padding value as the main content */ |
|
} |
|
|
|
/* If the layout is 'wide', adjust the padding on the main container */ |
|
/* This helps keep content aligned if the header has internal padding/margins */ |
|
.main .block-container { |
|
padding-top: 1rem; /* Or match 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}") |
|
|