Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -45,6 +45,7 @@ resources = {
|
|
| 45 |
|
| 46 |
# Function to track mood
|
| 47 |
def track_mood():
|
|
|
|
| 48 |
mood = st.selectbox("How are you feeling today?", ["happy", "sad", "anxious", "angry", "calm"])
|
| 49 |
if st.button("Submit Mood"):
|
| 50 |
st.session_state.mood_history.append((datetime.now().strftime("%Y-%m-%d %H:%M:%S"), mood))
|
|
@@ -52,6 +53,7 @@ def track_mood():
|
|
| 52 |
|
| 53 |
# Function to provide personalized resources
|
| 54 |
def recommend_resources():
|
|
|
|
| 55 |
if not st.session_state.mood_history:
|
| 56 |
st.warning("No mood data available. Please track your mood first.")
|
| 57 |
return
|
|
@@ -133,21 +135,50 @@ def user_profile():
|
|
| 133 |
else:
|
| 134 |
st.write("No comments yet.")
|
| 135 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 136 |
# Main app layout
|
| 137 |
def main():
|
| 138 |
st.title("AfyaMind Space: Your Mental Health Companion")
|
| 139 |
-
|
| 140 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 141 |
|
| 142 |
-
|
| 143 |
-
st.header("Track Your Mood")
|
| 144 |
track_mood()
|
| 145 |
|
| 146 |
-
|
| 147 |
-
st.header("Personalized Resources")
|
| 148 |
recommend_resources()
|
| 149 |
|
| 150 |
-
|
| 151 |
user_profile()
|
| 152 |
|
| 153 |
# Run the app
|
|
|
|
| 45 |
|
| 46 |
# Function to track mood
|
| 47 |
def track_mood():
|
| 48 |
+
st.header("Track Your Mood")
|
| 49 |
mood = st.selectbox("How are you feeling today?", ["happy", "sad", "anxious", "angry", "calm"])
|
| 50 |
if st.button("Submit Mood"):
|
| 51 |
st.session_state.mood_history.append((datetime.now().strftime("%Y-%m-%d %H:%M:%S"), mood))
|
|
|
|
| 53 |
|
| 54 |
# Function to provide personalized resources
|
| 55 |
def recommend_resources():
|
| 56 |
+
st.header("Personalized Resources")
|
| 57 |
if not st.session_state.mood_history:
|
| 58 |
st.warning("No mood data available. Please track your mood first.")
|
| 59 |
return
|
|
|
|
| 135 |
else:
|
| 136 |
st.write("No comments yet.")
|
| 137 |
|
| 138 |
+
# About Us section in the sidebar
|
| 139 |
+
def about_us():
|
| 140 |
+
st.sidebar.header("About Us")
|
| 141 |
+
st.sidebar.write("""
|
| 142 |
+
**AfyaMind Space** is a technology-driven mental health platform designed to empower adolescents in low-resource settings.
|
| 143 |
+
Our mission is to provide accessible, culturally adaptive, and engaging mental health resources to help young people
|
| 144 |
+
manage their emotional well-being and build resilience.
|
| 145 |
+
""")
|
| 146 |
+
|
| 147 |
+
# FAQs section in the sidebar
|
| 148 |
+
def faqs():
|
| 149 |
+
st.sidebar.header("FAQs")
|
| 150 |
+
st.sidebar.write("""
|
| 151 |
+
**1. What is AfyaMind Space?**
|
| 152 |
+
AfyaMind Space is a digital platform offering AI-powered mental health resources, mood tracking, and peer support for adolescents.
|
| 153 |
+
|
| 154 |
+
**2. Is AfyaMind free to use?**
|
| 155 |
+
Yes, AfyaMind is completely free and accessible to all users.
|
| 156 |
+
|
| 157 |
+
**3. How does AfyaMind protect my data?**
|
| 158 |
+
We use strong encryption and comply with global data protection standards to ensure your privacy.
|
| 159 |
+
|
| 160 |
+
**4. Can I use AfyaMind offline?**
|
| 161 |
+
Yes, AfyaMind offers offline features like mood tracking and downloadable resources for users without internet access.
|
| 162 |
+
""")
|
| 163 |
+
|
| 164 |
# Main app layout
|
| 165 |
def main():
|
| 166 |
st.title("AfyaMind Space: Your Mental Health Companion")
|
| 167 |
+
|
| 168 |
+
# Sidebar with About Us and FAQs
|
| 169 |
+
about_us()
|
| 170 |
+
faqs()
|
| 171 |
+
|
| 172 |
+
# Tabs for different sections
|
| 173 |
+
tab1, tab2, tab3 = st.tabs(["Track Mood", "Personalized Resources", "User Profile"])
|
| 174 |
|
| 175 |
+
with tab1:
|
|
|
|
| 176 |
track_mood()
|
| 177 |
|
| 178 |
+
with tab2:
|
|
|
|
| 179 |
recommend_resources()
|
| 180 |
|
| 181 |
+
with tab3:
|
| 182 |
user_profile()
|
| 183 |
|
| 184 |
# Run the app
|