import streamlit as st import os import random from generate_jokes import generate_inside_jokes, generate_motivation # Page Config st.set_page_config( page_title="Memory Forever", page_icon="💛", layout="wide" ) # Custom CSS st.markdown(""" """, unsafe_allow_html=True) # Header st.title("💛 Memory Forever 👩✈️") st.markdown("---") # Layout: 2 Columns col1, col2 = st.columns([1, 2]) with col1: st.header("📸 Past Gallery") # Load images from 'sarah' directory image_dir = "sarah" if os.path.exists(image_dir): images = [f for f in os.listdir(image_dir) if f.lower().endswith(('.png', '.jpg', '.jpeg', '.gif'))] if images: # Display a random image or a grid selected_image = random.choice(images) st.image(os.path.join(image_dir, selected_image), caption="Classic Sarah Moment", use_container_width=True) # Optional: Show more images in an expander with st.expander("See more photos"): for img in images: st.image(os.path.join(image_dir, img), use_container_width=True) else: st.info("No images found in 'sarah' folder. Add some photos to see them here!") else: st.warning("Folder 'sarah' not found. Please create it and add images.") st.markdown("---") st.subheader("⚙️ Settings") count = st.slider("How many jokes?", 1, 10, 3) st.markdown("---") st.subheader("💪 Daily Boost") if st.button("Need a quick motivation ✨"): with st.spinner("Finding the right words..."): motivation = generate_motivation() st.markdown(f'