File size: 1,943 Bytes
25eb2b4 53dcb25 122a897 1c7dd78 25eb2b4 1c7dd78 122a897 1c7dd78 122a897 1c7dd78 122a897 1c7dd78 122a897 1c7dd78 122a897 25eb2b4 dbb0d31 122a897 1c7dd78 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
import streamlit as st
# Remove any previous custom CSS styles
# Create a custom sticky header using Streamlit components
# Custom CSS only for basic styling, not position control
st.markdown("""
<style>
/* Basic styling for our custom header */
.custom-sticky-header {
background-color: #90EE90;
padding: 10px 15px;
border-bottom: 1px solid #ccc;
margin-bottom: 20px;
}
/* Hide the default Streamlit header */
[data-testid="stHeader"] {
visibility: hidden;
height: 0;
}
/* Ensure our custom header stays at the top */
[data-testid="stVerticalBlock"] > div:first-child {
position: sticky !important;
top: 0 !important;
background-color: white !important;
z-index: 999 !important;
}
</style>
""", unsafe_allow_html=True)
# Create a placeholder for the sticky header at the very top of the app
# This has to be the first element in your app
header_container = st.container()
# Use the container to create a custom header
with header_container:
st.markdown("""
<div class="custom-sticky-header">
<h1>Map descriptions to SBS codes with Sentence Transformer + Reasoning</h1>
<h3>Select specific Chapter for quicker results</h3>
</div>
""", unsafe_allow_html=True)
# Add the image directly in the header
try:
st.image("images/menu_book_60dp_75FBFD.png", width=100)
except:
# In case the image path doesn't work
st.write("Logo image")
# Add a small spacer
st.write("")
# Rest of your app works as normal
st.sidebar.header("SBS V2.0 mapper")
st.sidebar.write("(work in progress)")
st.sidebar.text("Demo by JA-RAD")
# Your page setup and navigation
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() |