masoudc commited on
Commit
b1ea3a2
·
1 Parent(s): 7d59763

Add application file

Browse files
Files changed (1) hide show
  1. app.py +25 -5
app.py CHANGED
@@ -1,7 +1,28 @@
1
  import streamlit as st
2
 
3
- # Prompt the user to input a value rather than using a slider
4
- x = st.text_input("Enter a value, and I will guess your age!")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
- # Only attempt to calculate if input is provided
58
  if x:
59
  y = estimate_age_from_input(x)
60
- st.write(f'You entered: {x}, I think you are about {y} years old!')
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