Spaces:
Sleeping
Sleeping
import streamlit as st | |
# Title of the app | |
st.title("🍽️ Mood-Based Recipe Generator") | |
st.write("Tell us how you're feeling, and we'll suggest a recipe to match your mood!") | |
# Mood selection | |
mood = st.selectbox( | |
"How are you feeling today?", | |
("Happy", "Sad", "Stressed", "Adventurous", "Lazy", "Romantic") | |
) | |
# Recipe suggestions based on mood | |
recipes = { | |
"Happy": { | |
"name": "Rainbow Smoothie Bowl", | |
"description": "Brighten your day with this colorful and healthy smoothie bowl!", | |
"ingredients": ["1 banana", "1 cup frozen mixed berries", "1/2 cup yogurt", "1/4 cup granola", "Assorted fresh fruits (kiwi, mango, berries)"], | |
"instructions": "Blend banana, berries, and yogurt until smooth. Pour into a bowl and top with granola and fresh fruits." | |
}, | |
"Sad": { | |
"name": "Classic Mac and Cheese", | |
"description": "Comfort food at its finest to lift your spirits.", | |
"ingredients": ["2 cups elbow macaroni", "2 cups shredded cheddar cheese", "2 cups milk", "2 tbsp butter", "2 tbsp flour", "Salt and pepper to taste"], | |
"instructions": "Cook macaroni. In a saucepan, melt butter, add flour, and whisk in milk. Stir in cheese until melted. Combine with macaroni and serve." | |
}, | |
"Stressed": { | |
"name": "Chamomile Tea with Honey", | |
"description": "A calming tea to help you relax and unwind.", | |
"ingredients": ["1 chamomile tea bag", "1 cup hot water", "1 tsp honey"], | |
"instructions": "Steep the tea bag in hot water for 5 minutes. Add honey and stir. Enjoy slowly." | |
}, | |
"Adventurous": { | |
"name": "Spicy Thai Curry", | |
"description": "Take your taste buds on an adventure with this bold and flavorful curry!", | |
"ingredients": ["1 can coconut milk", "2 tbsp red curry paste", "1 cup mixed vegetables", "1 cup tofu or chicken", "1 tbsp fish sauce", "1 tbsp sugar"], | |
"instructions": "Simmer curry paste in coconut milk. Add vegetables and protein. Season with fish sauce and sugar. Serve with rice." | |
}, | |
"Lazy": { | |
"name": "3-Ingredient Peanut Butter Cookies", | |
"description": "Perfect for when you want something sweet with minimal effort.", | |
"ingredients": ["1 cup peanut butter", "1 cup sugar", "1 egg"], | |
"instructions": "Mix all ingredients. Form into small balls and flatten with a fork. Bake at 350°F (175°C) for 10-12 minutes." | |
}, | |
"Romantic": { | |
"name": "Chocolate Fondue", | |
"description": "A decadent and romantic treat to share with someone special.", | |
"ingredients": ["1 cup dark chocolate", "1/2 cup heavy cream", "Assorted dippers (strawberries, marshmallows, banana slices)"], | |
"instructions": "Melt chocolate with cream in a double boiler. Serve warm with dippers." | |
} | |
} | |
# Display the recipe | |
st.subheader(f"Suggested Recipe for {mood}: {recipes[mood]['name']}") | |
st.write(recipes[mood]['description']) | |
st.write("**Ingredients:**") | |
for ingredient in recipes[mood]['ingredients']: | |
st.write(f"- {ingredient}") | |
st.write("**Instructions:**") | |
st.write(recipes[mood]['instructions']) | |
# Fun footer | |
st.markdown("---") | |
st.write("Made with ❤️ by the Mood-Based Recipe Generator Team") |