import streamlit as st # Set up the Streamlit app # st.Page(page, *, title='Rainyday', default='True') # pg = st.navigation([st.Page("app.py", title="Bedstories"), st.Page("pages/response.py", title="Bedstory")]) # pg.run() def child_update(value): key = 'name' st.write('Value:', value) if key not in st.session_state: st.session_state[key] = value else: st.session_state[key] = value st.title("🧚‍♀️ Magic Story Buddy 📚") st.markdown("Let's create a magical story just for you!") # User input child_name = st.text_input("What's your name, young storyteller?", on_change=child_update) st.write('Your name is ', child_name) if 'name' in st.session_state: st.write('The state is ', st.session_state['name']) story_theme = st.selectbox("What would you like your story to be about?", ["Space Adventure", "Magical Forest", "Underwater World", "Dinosaur Discovery"]) # Additional options story_length = st.slider("How long should the story be?", 50, 200, 100) include_moral = st.checkbox("Include a moral lesson?") if st.button("Create My Story!"): # Generate the story story = "En la indústria editorial i en disseny gràfic, lorem ipsum és un text de farciment que s'usa habitualment per a mostrar els elements gràfics d'un document, com ara la tipografia o la composició" # Display the story st.markdown("## Your Magical Story") st.write(story) # Add a fun element st.balloons() # Go to response page st.switch_page("pages/response.py") else: st.warning("Please tell me your name and choose a story theme.") # Add some child-friendly decorations st.markdown("---") st.markdown("🌟 Remember, you're the star of every story! 🌟")