ayaht commited on
Commit
e4552dd
·
verified ·
1 Parent(s): 149728f

Upload 2 files

Browse files
Files changed (2) hide show
  1. emotions.png +0 -0
  2. main.py +62 -0
emotions.png ADDED
main.py ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import os
3
+
4
+ # Placeholder data - replace with your own content
5
+
6
+ def get_recommended_option(level):
7
+ if 1 <= level <= 3:
8
+ return "Positive Quotes"
9
+ elif 4 <= level <= 6:
10
+ return "Music Recommendations"
11
+ elif 7 <= level <= 8:
12
+ return "Physical Activity"
13
+ else: # 9 to 10
14
+ return "Talk to a Friend"
15
+
16
+ def get_image_path(level):
17
+ image_folder = "emotions.png"
18
+ return os.path.join(image_folder)
19
+
20
+ def main():
21
+ st.title("Mood Support App")
22
+
23
+ # Mood level question
24
+ mood_level = st.slider("On a scale of 1-10, how would you rate your mood today?", 1, 10)
25
+
26
+ # Display image based on mood level
27
+ image_path = get_image_path(mood_level)
28
+ if os.path.exists(image_path):
29
+ # Create three columns to center the image
30
+ col1, col2, col3 = st.columns([1,2,1])
31
+ with col2:
32
+ st.image(image_path, caption=f"Mood Level: {mood_level}", use_column_width=True)
33
+ else:
34
+ st.error(f"Image not found: {image_path}")
35
+
36
+ # Get recommended option
37
+ recommended_option = get_recommended_option(mood_level)
38
+ st.write(f"Based on your current mood level, we recommend trying the '{recommended_option}' option.")
39
+
40
+ # Support options
41
+ st.header("Support Options")
42
+ col1, col2, col3, col4 = st.columns([2,3,2,2])
43
+
44
+ with col1:
45
+ if st.button("Positive Quotes"):
46
+ st.switch_page("positive_quotes.py")
47
+
48
+ with col2:
49
+ if st.button("Music Recommendations"):
50
+ st.switch_page("music_recommendations.py")
51
+
52
+ with col3:
53
+ if st.button("Physical Activity"):
54
+ st.switch_page("physical_activity.py")
55
+
56
+ with col4:
57
+ if st.button("Talk to a Friend"):
58
+ st.switch_page("talk_to_friend.py")
59
+ # Here you would implement the logic to connect with a friend or support person
60
+
61
+ if __name__ == "__main__":
62
+ main()