diff --git a/smart_pantry_manager/assets/image1.png b/smart_pantry_manager/assets/image1.png new file mode 100644 index 0000000..77d91ef Binary files /dev/null and b/smart_pantry_manager/assets/image1.png differ diff --git a/smart_pantry_manager/assets/image2.png b/smart_pantry_manager/assets/image2.png new file mode 100644 index 0000000..7233c53 Binary files /dev/null and b/smart_pantry_manager/assets/image2.png differ diff --git a/smart_pantry_manager/smart_pantry.py b/smart_pantry_manager/smart_pantry.py index 31304a1..25f2ba9 100644 --- a/smart_pantry_manager/smart_pantry.py +++ b/smart_pantry_manager/smart_pantry.py @@ -43,17 +43,58 @@ def style_expiring_soon(expiring_products_df): # ---------- Page Setup ---------- st.set_page_config(page_title="Smart Pantry Manager", page_icon="๐Ÿงบ", layout="centered") -st.title("๐Ÿ“ฑ Smart Pantry Manager ๐Ÿ“Š") -st.subheader("Track your pantry items and discover what you can cook ๐Ÿ‘‡") +st.markdown( + """ +

+ ๐Ÿงบ Smart Pantry Manager +

+

+ Smart tracking, elegant design, and a pantry that always works for you โœจ +

+ """, + unsafe_allow_html=True, +) + +# ---------- Auto-Switching Images on Home Page ---------- + +img1 = "smart_pantry_manager/assets/image1.png" +img2 = "smart_pantry_manager/assets/image2.png" +# Make sure the folder exists +os.makedirs("smart_pantry_manager/assets", exist_ok=True) + +# Create a spot on the page where the image will update +placeholder = st.empty() + +# Alternate images every 3 seconds +if "show_img1" not in st.session_state: + st.session_state["show_img1"] = True + +if st.session_state["show_img1"]: + placeholder.image(img1, use_container_width=True) + st.session_state["show_img1"] = False +else: + placeholder.image(img2, use_container_width=True) + st.session_state["show_img1"] = True + +time.sleep(3) + # ---------- Sidebar: User Profile ---------- st.sidebar.header("๐Ÿ‘ค User Profile") username = st.sidebar.text_input("Enter your name or email:") +# If user has NOT entered anything โ†’ show info and stop the app if not username: - st.warning("Please enter your name to start using the app.") + st.info( + "๐Ÿ‘ˆ Please click 'User Profile' on the left to enter your name or email to start." + ) st.stop() +# If user HAS entered an email โ†’ show success message +else: + st.sidebar.success("You entered successfully! โœ…") + + st.session_state["username"] = username # Create user-specific file path