Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,17 +3,20 @@ from datetime import datetime, timedelta
|
|
| 3 |
import pytz
|
| 4 |
import time
|
| 5 |
|
| 6 |
-
#
|
| 7 |
-
|
| 8 |
-
|
|
|
|
| 9 |
|
| 10 |
-
#
|
| 11 |
-
st.markdown("""
|
| 12 |
<style>
|
| 13 |
-
.big-font {
|
| 14 |
-
font-size:
|
| 15 |
font-weight: bold;
|
| 16 |
-
}
|
|
|
|
|
|
|
| 17 |
</style>
|
| 18 |
""", unsafe_allow_html=True)
|
| 19 |
|
|
@@ -49,6 +52,10 @@ if st.session_state.timer_active:
|
|
| 49 |
st.balloons()
|
| 50 |
# Suggestion: Use Streamlit's st.audio to play a sound notification here
|
| 51 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
# World Clock
|
| 53 |
st.header("World Clock")
|
| 54 |
selected_timezone = st.selectbox("Select Timezone", pytz.all_timezones, index=pytz.all_timezones.index('UTC'))
|
|
|
|
| 3 |
import pytz
|
| 4 |
import time
|
| 5 |
|
| 6 |
+
# Sidebar for user inputs
|
| 7 |
+
font_size = st.sidebar.slider('Select font size for the timer:', min_value=20, max_value=100, value=60)
|
| 8 |
+
background_color = st.sidebar.color_picker('Select background color:', '#FFFFFF')
|
| 9 |
+
text_color = st.sidebar.color_picker('Select text color:', '#000000')
|
| 10 |
|
| 11 |
+
# Apply user-selected styles
|
| 12 |
+
st.markdown(f"""
|
| 13 |
<style>
|
| 14 |
+
.big-font {{
|
| 15 |
+
font-size: {font_size}px !important;
|
| 16 |
font-weight: bold;
|
| 17 |
+
color: {text_color} !important;
|
| 18 |
+
background-color: {background_color} !important;
|
| 19 |
+
}}
|
| 20 |
</style>
|
| 21 |
""", unsafe_allow_html=True)
|
| 22 |
|
|
|
|
| 52 |
st.balloons()
|
| 53 |
# Suggestion: Use Streamlit's st.audio to play a sound notification here
|
| 54 |
|
| 55 |
+
# Function to convert seconds to minutes:seconds format
|
| 56 |
+
def format_time(seconds):
|
| 57 |
+
return f"{seconds // 60:02d}:{seconds % 60:02d}"
|
| 58 |
+
|
| 59 |
# World Clock
|
| 60 |
st.header("World Clock")
|
| 61 |
selected_timezone = st.selectbox("Select Timezone", pytz.all_timezones, index=pytz.all_timezones.index('UTC'))
|