Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -5,38 +5,80 @@ def convert_alexandre_time(minutes):
|
|
5 |
multiplier = random.uniform(2.5, 4)
|
6 |
return int(minutes * multiplier)
|
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
st.set_page_config(page_title="Alexandre's Time Converter", page_icon="⏰")
|
9 |
|
10 |
st.title("🕰️ Alexandre's Time Converter 🕰️")
|
11 |
-
st.subheader("Convert Alexandre's optimistic estimates into reality!")
|
12 |
|
13 |
st.write("""
|
14 |
-
|
15 |
-
|
|
|
16 |
""")
|
17 |
|
18 |
alexandre_time = st.number_input("Enter Alexandre's estimated time (in minutes):", min_value=1, value=5, step=1)
|
19 |
|
20 |
-
if st.button("
|
21 |
real_time = convert_alexandre_time(alexandre_time)
|
22 |
|
23 |
-
st.success(f"Alexandre
|
24 |
-
st.error(f"Reality
|
25 |
|
26 |
if real_time > 60:
|
27 |
hours = real_time // 60
|
28 |
minutes = real_time % 60
|
29 |
-
st.warning(f"That's {hours} hour{'s' if hours > 1 else ''} and {minutes} minute{'s' if minutes != 1 else ''}!
|
30 |
|
31 |
-
|
32 |
"I got caught in a time vortex!",
|
33 |
-
"My watch must be running on Alexandre Standard Time.",
|
34 |
-
"I had to help an old lady cross the street... five times.",
|
35 |
-
"I was abducted by aliens who wanted to learn about punctuality.",
|
36 |
-
"I found a shortcut that turned out to be a
|
37 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
|
39 |
-
st.
|
|
|
|
|
40 |
|
41 |
st.markdown("---")
|
42 |
-
st.write("Remember,
|
|
|
5 |
multiplier = random.uniform(2.5, 4)
|
6 |
return int(minutes * multiplier)
|
7 |
|
8 |
+
def generate_activity(minutes):
|
9 |
+
activities = [
|
10 |
+
f"Learn {minutes // 5} new words in a foreign language",
|
11 |
+
f"Do {minutes * 2} push-ups",
|
12 |
+
f"Write a {minutes}-word short story",
|
13 |
+
f"Meditate for {minutes} minutes",
|
14 |
+
f"Learn to juggle {min(3, minutes // 10)} balls",
|
15 |
+
f"Try to solve a Rubik's cube {minutes // 5} times",
|
16 |
+
f"Practice your moonwalk for {minutes} minutes",
|
17 |
+
f"Memorize {minutes // 2} digits of pi",
|
18 |
+
f"Try to balance a spoon on your nose for {minutes} seconds",
|
19 |
+
f"Come up with {minutes // 2} new nicknames for Alexandre"
|
20 |
+
]
|
21 |
+
return random.choice(activities)
|
22 |
+
|
23 |
st.set_page_config(page_title="Alexandre's Time Converter", page_icon="⏰")
|
24 |
|
25 |
st.title("🕰️ Alexandre's Time Converter 🕰️")
|
26 |
+
st.subheader("Convert Alexandre's 'optimistic' estimates into reality!")
|
27 |
|
28 |
st.write("""
|
29 |
+
Welcome to the ultimate tool for decoding Alexandre's unique perception of time!
|
30 |
+
Ever wondered how long "I'll be there in 5 minutes" actually means in Alexandre's world?
|
31 |
+
Wonder no more! Use this state-of-the-art converter to translate Alexandre's time estimates into what the rest of us call "reality."
|
32 |
""")
|
33 |
|
34 |
alexandre_time = st.number_input("Enter Alexandre's estimated time (in minutes):", min_value=1, value=5, step=1)
|
35 |
|
36 |
+
if st.button("Unveil the Truth"):
|
37 |
real_time = convert_alexandre_time(alexandre_time)
|
38 |
|
39 |
+
st.success(f"Alexandre's Fantasy: {alexandre_time} minutes")
|
40 |
+
st.error(f"Harsh Reality: {real_time} minutes")
|
41 |
|
42 |
if real_time > 60:
|
43 |
hours = real_time // 60
|
44 |
minutes = real_time % 60
|
45 |
+
st.warning(f"Brace yourself! That's {hours} hour{'s' if hours > 1 else ''} and {minutes} minute{'s' if minutes != 1 else ''}! You could have watched {real_time // 45} episodes of Friends by then!")
|
46 |
|
47 |
+
excuses = [
|
48 |
"I got caught in a time vortex!",
|
49 |
+
"My watch must be running on Alexandre Standard Time (AST).",
|
50 |
+
"I had to help an old lady cross the street... five times... in different neighborhoods.",
|
51 |
+
"I was abducted by aliens who wanted to learn about punctuality. Ironic, right?",
|
52 |
+
"I found a shortcut that turned out to be a scenic route through three different countries.",
|
53 |
+
"My pet snail escaped, and I had to chase it down.",
|
54 |
+
"I was busy inventing a new unit of time measurement: the 'Alexandre minute'.",
|
55 |
+
"I got stuck in quicksand... made of molasses... uphill... both ways.",
|
56 |
+
"I had to attend an emergency meeting of the Procrastinators Anonymous... but we kept postponing it.",
|
57 |
+
"I was chosen as a test subject for a new teleportation device. Turns out, it only slows down time.",
|
58 |
+
"I was busy writing a thesis on 'The Relativity of Time: An Alexandre's Perspective'.",
|
59 |
+
"I had to rescue a cat from a tree... then rescue the firefighter who got stuck rescuing the cat.",
|
60 |
+
]
|
61 |
+
|
62 |
+
excuse = random.choice(excuses)
|
63 |
+
|
64 |
+
st.info(f"Alexandre's excuse generator says: '{excuse}'")
|
65 |
+
|
66 |
+
roasts = [
|
67 |
+
f"If Alexandre was a superhero, his power would be the ability to bend time... but only in his mind.",
|
68 |
+
f"Alexandre's punctuality is so bad, even his calendar gave up and filed for divorce.",
|
69 |
+
f"They say time flies when you're having fun. Alexandre must be having the time of his life... all the time.",
|
70 |
+
f"Alexandre doesn't wear a watch. He uses sundials, which explains a lot about his timekeeping skills.",
|
71 |
+
f"Einstein said time is relative. He must have been thinking about Alexandre when he came up with that theory.",
|
72 |
+
]
|
73 |
+
|
74 |
+
st.markdown("---")
|
75 |
+
st.subheader("While you're waiting for Alexandre...")
|
76 |
+
activity = generate_activity(real_time)
|
77 |
+
st.write(f"Why not {activity}? You've got time!")
|
78 |
|
79 |
+
st.markdown("---")
|
80 |
+
st.subheader("Alexandre's Punctuality Roast Corner")
|
81 |
+
st.write(random.choice(roasts))
|
82 |
|
83 |
st.markdown("---")
|
84 |
+
st.write("Remember, in Alexandre's world, '5 minutes' is more of a concept than an actual measurement of time!")
|