Add application file
Browse files
app.py
CHANGED
@@ -1,7 +1,28 @@
|
|
1 |
import streamlit as st
|
2 |
|
3 |
-
#
|
4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
def estimate_age_from_input(x):
|
7 |
try:
|
@@ -54,9 +75,8 @@ def estimate_age_from_input(x):
|
|
54 |
# Non-numeric input - assume young user testing system
|
55 |
return 19
|
56 |
|
57 |
-
#
|
58 |
if x:
|
59 |
y = estimate_age_from_input(x)
|
60 |
-
st.write(f'
|
61 |
-
|
62 |
|
|
|
1 |
import streamlit as st
|
2 |
|
3 |
+
# Custom CSS to increase font size for input and output
|
4 |
+
st.markdown(
|
5 |
+
"""
|
6 |
+
<style>
|
7 |
+
.stSlider label {
|
8 |
+
font-size: 24px; /* Increase the font size of the slider label */
|
9 |
+
}
|
10 |
+
.stTextInput label {
|
11 |
+
font-size: 24px; /* Increase the font size for text inputs if needed */
|
12 |
+
}
|
13 |
+
.stMarkdown {
|
14 |
+
font-size: 24px; /* Increase the font size of text outputs */
|
15 |
+
}
|
16 |
+
.css-1d391kg p {
|
17 |
+
font-size: 24px; /* General output text font size */
|
18 |
+
}
|
19 |
+
</style>
|
20 |
+
""",
|
21 |
+
unsafe_allow_html=True
|
22 |
+
)
|
23 |
+
|
24 |
+
# Use text input instead of slider
|
25 |
+
x = st.text_input('Select a value, and I\'ll guess your age!', '')
|
26 |
|
27 |
def estimate_age_from_input(x):
|
28 |
try:
|
|
|
75 |
# Non-numeric input - assume young user testing system
|
76 |
return 19
|
77 |
|
78 |
+
# Display the age estimation result
|
79 |
if x:
|
80 |
y = estimate_age_from_input(x)
|
81 |
+
st.write(f'I think you\'re about {y} years old.')
|
|
|
82 |
|