Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First Commit(Animations added) #136

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 108 additions & 9 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import streamlit.components.v1 as components
import os
from dotenv import load_dotenv

#AI Integration
import anthropic
import datetime
Expand Down Expand Up @@ -241,7 +240,7 @@ def show_main_page():
**Engage with Us:**
- Share your favorite relaxation techniques or feedback on how our platform helps you.

Your path to a serene and fulfilling life starts here. Lets embark on this journey together—take the first step today!
Your path to a serene and fulfilling life starts here. Let's embark on this journey together—take the first step today!
""")

# Interactive Widgets
Expand All @@ -253,18 +252,45 @@ def show_main_page():
st.write("---")

# Survey for Personalized Tips
st.markdown(
"""
<style>
.emoji {
font-size: 50px;
display: inline-block;
animation: bounce 1s infinite;
}

@keyframes bounce {
0%, 20%, 50%, 80%, 100% {
transform: translateY(0);
}
40% {
transform: translateY(-20px);
}
60% {
transform: translateY(-10px);
}
}
</style>
""",
unsafe_allow_html=True
)
st.subheader("Personalized Tips for You")
with st.form(key='personalized_tips_form'):
mood = st.radio("What's your current anxiety level?", ["Low", "Moderate", "High", "Overwhelmed"])
submit_button = st.form_submit_button("Get Tips")
if submit_button:
st.markdown('<span class="emoji">💡</span>', unsafe_allow_html=True)
submit_button = st.form_submit_button("Get Tip")
if submit_button:
tips = {
"Low": "Keep up the great work! Stay consistent with mindfulness techniques.",
"Moderate": "Take a moment to practice deep breathing.",
"High": "Pause and try a guided meditation.",
"Overwhelmed": "It's important to step away and take a break."
}
st.write(f"**Tip:** {tips[mood]}")
with st.spinner("wait for it..."):
time.sleep(3)
st.write(f"**Tip:** {tips[mood]}")


st.write("---")
Expand Down Expand Up @@ -305,7 +331,6 @@ def show_main_page():


# Tip for improving mental health

#|------MongoDb for Quick Tips For Mental Health Section for inserting and retreiving the tips------|
#Setting MongoDb connection
mongodb_uri = os.getenv("MONGODB_URI")
Expand All @@ -314,8 +339,8 @@ def show_main_page():
tips_collection = db['mental_health_tips']

# Uncomment the following line to populate the database with tips in the format below:
# tips = []
# tips_collection.insert_one({"tip": "Take deep breaths to relax."})
tips = []
tips_collection.insert_one({"tip": "Take deep breaths to relax."})


st.subheader("Quick Tip for Mental Health")
Expand Down Expand Up @@ -789,7 +814,31 @@ def show_calm_space():
feeling_description = st.text_area("What exactly are you feeling?", placeholder="Describe your feelings here...")
current_stress_level = st.slider("Current Stress Level (1 to 10)", 1, 10, value=5)
recent_events = st.text_area("Recent Events", placeholder="Describe any recent events that may have contributed to your anxiety or stress...")

st.markdown(
"""
<style>
.emoji {
font-size: 50px;
display: inline-block;
animation: bounce 1s infinite;
}

@keyframes bounce {
0%, 20%, 50%, 80%, 100% {
transform: translateY(0);
}
40% {
transform: translateY(-20px);
}
60% {
transform: translateY(-10px);
}
}
</style>
""",
unsafe_allow_html=True
)
st.markdown('<span class="emoji">✔️</span>', unsafe_allow_html=True)
if st.button("Submit"):
st.write("Thank you for sharing. Let’s find some exercises to help you.")
guidance = anxiety_management_guide(mood, feeling_description, current_stress_level, recent_events)
Expand Down Expand Up @@ -858,6 +907,31 @@ def show_about_and_feedback():
""")

feedback_activity = st.text_area("How have the activities helped you? Share your experience here:")
st.markdown(
"""
<style>
.emoji {
font-size: 50px;
display: inline-block;
animation: bounce 1s infinite;
}

@keyframes bounce {
0%, 20%, 50%, 80%, 100% {
transform: translateY(0);
}
40% {
transform: translateY(-20px);
}
60% {
transform: translateY(-10px);
}
}
</style>
""",
unsafe_allow_html=True
)
st.markdown('<span class="emoji">📈</span>', unsafe_allow_html=True)
if st.button("Submit Feedback"):
if feedback_activity:
st.success("Thank you for sharing your experience! Your feedback is valuable and appreciated.")
Expand Down Expand Up @@ -897,6 +971,31 @@ def show_about_and_feedback():
st.subheader("Subscribe for Updates")
st.write("Stay updated with our latest features, activities, and wellness tips.")
email = st.text_input("Enter your email address:")
st.markdown(
"""
<style>
.emoji {
font-size: 50px;
display: inline-block;
animation: bounce 1s infinite;
}

@keyframes bounce {
0%, 20%, 50%, 80%, 100% {
transform: translateY(0);
}
40% {
transform: translateY(-20px);
}
60% {
transform: translateY(-10px);
}
}
</style>
""",
unsafe_allow_html=True
)
st.markdown('<span class="emoji">🔔</span>', unsafe_allow_html=True)
if st.button("Subscribe"):
if email:
st.success("Thank you for subscribing! You'll receive updates and tips directly to your inbox.")
Expand Down
Loading