Spaces:
Build error
Build error
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
|
| 3 |
+
# Title of the app
|
| 4 |
+
st.title("🍽️ Mood-Based Recipe Generator")
|
| 5 |
+
st.write("Tell us how you're feeling, and we'll suggest a recipe to match your mood!")
|
| 6 |
+
|
| 7 |
+
# Mood selection
|
| 8 |
+
mood = st.selectbox(
|
| 9 |
+
"How are you feeling today?",
|
| 10 |
+
("Happy", "Sad", "Stressed", "Adventurous", "Lazy", "Romantic")
|
| 11 |
+
)
|
| 12 |
+
|
| 13 |
+
# Recipe suggestions based on mood
|
| 14 |
+
recipes = {
|
| 15 |
+
"Happy": {
|
| 16 |
+
"name": "Rainbow Smoothie Bowl",
|
| 17 |
+
"description": "Brighten your day with this colorful and healthy smoothie bowl!",
|
| 18 |
+
"ingredients": ["1 banana", "1 cup frozen mixed berries", "1/2 cup yogurt", "1/4 cup granola", "Assorted fresh fruits (kiwi, mango, berries)"],
|
| 19 |
+
"instructions": "Blend banana, berries, and yogurt until smooth. Pour into a bowl and top with granola and fresh fruits."
|
| 20 |
+
},
|
| 21 |
+
"Sad": {
|
| 22 |
+
"name": "Classic Mac and Cheese",
|
| 23 |
+
"description": "Comfort food at its finest to lift your spirits.",
|
| 24 |
+
"ingredients": ["2 cups elbow macaroni", "2 cups shredded cheddar cheese", "2 cups milk", "2 tbsp butter", "2 tbsp flour", "Salt and pepper to taste"],
|
| 25 |
+
"instructions": "Cook macaroni. In a saucepan, melt butter, add flour, and whisk in milk. Stir in cheese until melted. Combine with macaroni and serve."
|
| 26 |
+
},
|
| 27 |
+
"Stressed": {
|
| 28 |
+
"name": "Chamomile Tea with Honey",
|
| 29 |
+
"description": "A calming tea to help you relax and unwind.",
|
| 30 |
+
"ingredients": ["1 chamomile tea bag", "1 cup hot water", "1 tsp honey"],
|
| 31 |
+
"instructions": "Steep the tea bag in hot water for 5 minutes. Add honey and stir. Enjoy slowly."
|
| 32 |
+
},
|
| 33 |
+
"Adventurous": {
|
| 34 |
+
"name": "Spicy Thai Curry",
|
| 35 |
+
"description": "Take your taste buds on an adventure with this bold and flavorful curry!",
|
| 36 |
+
"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"],
|
| 37 |
+
"instructions": "Simmer curry paste in coconut milk. Add vegetables and protein. Season with fish sauce and sugar. Serve with rice."
|
| 38 |
+
},
|
| 39 |
+
"Lazy": {
|
| 40 |
+
"name": "3-Ingredient Peanut Butter Cookies",
|
| 41 |
+
"description": "Perfect for when you want something sweet with minimal effort.",
|
| 42 |
+
"ingredients": ["1 cup peanut butter", "1 cup sugar", "1 egg"],
|
| 43 |
+
"instructions": "Mix all ingredients. Form into small balls and flatten with a fork. Bake at 350°F (175°C) for 10-12 minutes."
|
| 44 |
+
},
|
| 45 |
+
"Romantic": {
|
| 46 |
+
"name": "Chocolate Fondue",
|
| 47 |
+
"description": "A decadent and romantic treat to share with someone special.",
|
| 48 |
+
"ingredients": ["1 cup dark chocolate", "1/2 cup heavy cream", "Assorted dippers (strawberries, marshmallows, banana slices)"],
|
| 49 |
+
"instructions": "Melt chocolate with cream in a double boiler. Serve warm with dippers."
|
| 50 |
+
}
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
# Display the recipe
|
| 54 |
+
st.subheader(f"Suggested Recipe for {mood}: {recipes[mood]['name']}")
|
| 55 |
+
st.write(recipes[mood]['description'])
|
| 56 |
+
|
| 57 |
+
st.write("**Ingredients:**")
|
| 58 |
+
for ingredient in recipes[mood]['ingredients']:
|
| 59 |
+
st.write(f"- {ingredient}")
|
| 60 |
+
|
| 61 |
+
st.write("**Instructions:**")
|
| 62 |
+
st.write(recipes[mood]['instructions'])
|
| 63 |
+
|
| 64 |
+
# Fun footer
|
| 65 |
+
st.markdown("---")
|
| 66 |
+
st.write("Made with ❤️ by the Mood-Based Recipe Generator Team")
|