File size: 3,222 Bytes
9a5b4b7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
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")