import streamlit as st import streamlit.components.v1 as components # --- Page Configuration (Optional but good practice) --- st.set_page_config( page_title="newMATTER", page_icon=":computer:", layout="wide", #initial_sidebar_state="collapsed" ) st.markdown(""" """, unsafe_allow_html=True) if 'logged_in' not in st.session_state: st.session_state.logged_in = False if 'username' not in st.session_state: st.session_state.username = "" if 'projectname' not in st.session_state: st.session_state.projectname = "" hardcodedlogin_user={ "usernames":["admin"], "passwords":["123"] } def authenticate_user(username,password): if username in hardcodedlogin_user["usernames"] and password in hardcodedlogin_user["passwords"]: return True else: return False def LOGIN(): st.text("Authentication System") st.subheader("Login to the application") with st.form("login_form"): username = st.text_input("Username") password = st.text_input("Password", type="password") login_button = st.form_submit_button("Login") if login_button: if username and password: status = authenticate_user(username, password) if status==True: st.session_state.logged_in = True st.session_state.username = username st.rerun() else: st.error(message) else: st.warning("Please enter both username and password") def APP(): st.title("newMATTER") st.markdown("> Engineering Programmable Biology") tab1, tab2, tab3 = st.tabs(["PROTEIN ENGINEERING LAB", "EXECUTED OPERATIONS", "LAB OUTPUT"]) def SHOW_PROJECT_NAME(): st.header(f"setup your project @ {st.session_state.username}") project_name=st.text_input("enter project name ") st.session_state.projectname=project_name st.rerun() def SHOWTABS(): st.markdown(""" """, unsafe_allow_html=True) st.markdown('