|
import streamlit as st |
|
import time |
|
|
|
|
|
st.markdown(""" |
|
<style> |
|
/* Make the custom header container sticky */ |
|
.sticky-header { |
|
position: sticky; |
|
top: 0; |
|
background-color: white; /* Or your preferred header background color */ |
|
padding: 10px 0; /* Adjust padding as needed */ |
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Optional: Add a subtle shadow */ |
|
z-index: 999; /* Ensure the header stays on top */ |
|
} |
|
|
|
/* Style for the status indicator */ |
|
.status-indicator { |
|
margin-left: 20px; /* Adjust spacing */ |
|
font-weight: bold; |
|
} |
|
|
|
.status-running { |
|
color: orange; |
|
} |
|
|
|
.status-complete { |
|
color: green; |
|
} |
|
|
|
.status-error { |
|
color: red; |
|
} |
|
</style> |
|
""", unsafe_allow_html=True) |
|
|
|
|
|
|
|
header_container = st.container() |
|
|
|
with header_container: |
|
col1, col2 = st.columns([1, 5]) |
|
with col1: |
|
st.logo(image="images/menu_book_60dp_75FBFD.png") |
|
with col2: |
|
st.title("Map descriptions to SBS codes") |
|
|
|
status_placeholder = st.empty() |
|
|
|
|
|
st.markdown("""<div style="height: 120px;"></div>""", unsafe_allow_html=True) |
|
|
|
|
|
st.sidebar.header("SBS V2.0 mapper") |
|
st.sidebar.write("(work in progress)") |
|
st.sidebar.text("Demo by JA-RAD") |
|
|
|
st.subheader("Select specific Chapter for quicker results") |
|
|
|
|
|
|
|
|
|
|
|
def run_mapping_process(): |
|
status_placeholder.markdown('<span class="status-indicator status-running">Running...</span>', unsafe_allow_html=True) |
|
|
|
time.sleep(3) |
|
|
|
status_placeholder.markdown('<span class="status-indicator status-complete">Complete</span>', unsafe_allow_html=True) |
|
|
|
|
|
if st.button("Start Mapping"): |
|
run_mapping_process() |
|
|
|
|
|
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() |
|
|
|
|