diff --git a/components/Breathing_Exercise.py b/components/Breathing_Exercise.py new file mode 100644 index 0000000..d9f9db6 --- /dev/null +++ b/components/Breathing_Exercise.py @@ -0,0 +1,60 @@ +import streamlit as st +import time + +def breathing_exercise(): + st.markdown("

🧘 Breathing Exercise

", unsafe_allow_html=True) + + st.markdown("### 👇 Follow the animation to breathe in and out") + st.write("Use this simple breathing exercise to relax. Follow the circle expanding and contracting.") + + circle_animation = """ + + +
+ """ + st.markdown(circle_animation, unsafe_allow_html=True) + + breath_text = st.empty() + + if st.button("🌀 Start Breathing"): + for _ in range(3): + breath_text.markdown("## 🌬️ Breathe In...") + time.sleep(4) + breath_text.markdown("## ✋ Hold...") + time.sleep(2) + breath_text.markdown("## 😮‍💨 Breathe Out...") + time.sleep(4) + breath_text.markdown("### ✅ Done! Feel better?") + + with st.expander("🕒 Need a Timer?"): + minutes = st.slider("How many minutes do you want to do this?", 1, 10, 2) + if st.button("Start Timer"): + st.success("Relax and follow the animation...") + timer_placeholder = st.empty() + for i in range(minutes * 60, 0, -1): + mins, secs = divmod(i, 60) + timer_text = f"{mins:02d}:{secs:02d}" + timer_placeholder.markdown(f"## ⏳ {timer_text}") + time.sleep(1) + timer_placeholder.markdown("### ✅ Timer complete!") + +if __name__ == "__main__": + breathing_exercise()