From 6c752618277802444581f63d53d38d6a7516859e Mon Sep 17 00:00:00 2001 From: Dylan Panganiban Date: Wed, 15 Oct 2025 13:01:24 -0400 Subject: [PATCH 1/2] Editing front end for welcome page --- app.py | 100 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) diff --git a/app.py b/app.py index e69de29..470040b 100644 --- a/app.py +++ b/app.py @@ -0,0 +1,100 @@ +import streamlit as st + +st.set_page_config(layout="wide", initial_sidebar_state="collapsed") + +# Session state +if "page" not in st.session_state: + st.session_state.page = "welcome" + +params = st.query_params +if "admin" in params: + st.session_state.page = "adminlogin" +if "user" in params: + st.session_state.page = "userlogin" + +if st.session_state.page == "welcome": + st.markdown( + """ + + +
+
Welcome to iVolunteer
+ +
+ """, + unsafe_allow_html=True, + ) From 5608213a01a579dc057143ef93774fc577a11929 Mon Sep 17 00:00:00 2001 From: Dylan Panganiban Date: Wed, 15 Oct 2025 14:24:08 -0400 Subject: [PATCH 2/2] Created user login page and front end design --- app.py | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/app.py b/app.py index 470040b..9b639a5 100644 --- a/app.py +++ b/app.py @@ -98,3 +98,68 @@ """, unsafe_allow_html=True, ) + +if st.session_state.page == "userlogin": + st.markdown(""" + + +
User Login / Sign-Up
+ """, unsafe_allow_html=True) + + st.set_page_config(layout="wide") + left, right = st.columns(2) + with left: + st.header("Login") + username = st.text_input("Username", key="login_username") + password = st.text_input("Password", type="password", key="login_password") + if st.button("Login"): + if username == "user" and password == "password": + st.success("Login successful!") + st.session_state.page = "userdashboard" + st.experimental_rerun() + else: + st.error("Invalid username or password") + + with right: + st.header("Signup") + name = st.text_input("Name", key="name") + username = st.text_input("Username", key="signup_username") + password = st.text_input("Password", type="password", key="signup_password") + if st.button("Sign Up"): + st.success("Sign Up successful! Please login.") + st.session_state.page = "userlogin" + + + + \ No newline at end of file