Spaces:
Sleeping
Sleeping
File size: 1,253 Bytes
af4df71 |
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 |
import streamlit as st
import time
# Title
st.title("⏳ Productivity Timer (Pomodoro Technique)")
# Sidebar for Timer Settings
st.sidebar.header("Timer Settings")
# Timer Intervals
work_duration = st.sidebar.number_input("Work Duration (minutes)", min_value=1, max_value=60, value=25, step=1)
break_duration = st.sidebar.number_input("Break Duration (minutes)", min_value=1, max_value=30, value=5, step=1)
# Start Timer Button
if st.sidebar.button("Start Pomodoro Timer"):
st.write(f"### 🛠️ Work Time: {work_duration} minutes")
for i in range(work_duration * 60):
mins, secs = divmod(work_duration * 60 - i, 60)
timer = f"{mins:02d}:{secs:02d}"
st.write(timer)
time.sleep(1)
st.empty()
st.success("✅ Work time is over! Time for a break.")
st.write(f"### ☕ Break Time: {break_duration} minutes")
for i in range(break_duration * 60):
mins, secs = divmod(break_duration * 60 - i, 60)
timer = f"{mins:02d}:{secs:02d}"
st.write(timer)
time.sleep(1)
st.empty()
st.success("🎉 Break time is over! Ready for another session?")
st.markdown("---")
st.caption("Developed with ❤️ using Streamlit and deployed on Hugging Face Spaces.")
|