import base64 from pathlib import Path import streamlit as st import os # Choose one of these: # A) Env var: APP_ENV=prod on your server / cloud APP_ENV = os.getenv("natsar", "local").lower() # B) Or secrets: put env="prod" in .streamlit/secrets.toml on your server # APP_ENV = st.secrets.get("env", "local").lower() IS_LOCAL = True # … later, where you currently render your Deploy controls … if IS_LOCAL: st.markdown(""" """, unsafe_allow_html=True) def local_image_to_data_url(path: str | Path) -> str: """Convert a local image into a base64 data URL for inlined CSS backgrounds.""" p = Path(path) if not p.is_absolute(): p = Path(__file__).parent / p mime = "image/png" if p.suffix.lower() == ".png" else "image/jpeg" b64 = base64.b64encode(p.read_bytes()).decode() return f"data:{mime};base64,{b64}" def main() -> None: st.set_page_config( page_title="Home", layout="wide", initial_sidebar_state="expanded", ) # --- Load logo --- logo_path = "resources/images/lucid_insights_logo.png" # update path as needed logo_data_url = local_image_to_data_url(logo_path) with st.sidebar: # --- Display left-aligned logo above Home menu --- st.markdown( f"""
Lucid Insights Logo
""", unsafe_allow_html=True, ) st.markdown("---") # --- Sidebar navigation --- st.markdown("") st.page_link("app.py", label="Home") # st.page_link("pages/lost_at_sea.py", label="Lost at Sea") st.page_link("pages/signal_watch.py", label="Signal Watch") st.page_link("pages/bushland_beacon.py", label="Bushland Beacon") st.page_link("pages/misc_find.py", label="Misc Finder") st.markdown("---") st.page_link("pages/task_drone.py", label="Task Drone") st.page_link("pages/task_satellite.py", label="Task Satellite") st.page_link("pages/information.py", label="Information") # --- Background setup --- bg_image = local_image_to_data_url("resources/images/rescue3.jpg") hide_default_css = """ """ st.markdown(hide_default_css, unsafe_allow_html=True) st.markdown( f""" """, unsafe_allow_html=True, ) # --- Main content --- st.markdown( """

SAR-Xai

Detection Hub

AI-powered person recognition
(fictional web app)
""", unsafe_allow_html=True, ) if __name__ == "__main__": main()