Hold Button Fix

This commit is contained in:
SpaceNerd0717
2025-10-14 15:57:20 -04:00
parent e632dbee8f
commit 3f30d9b5cb
2 changed files with 60 additions and 51 deletions

View File

@@ -1,41 +1,46 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<style> <style>
body { body {
margin: 0; margin: 0;
background-color: black; background-color: black;
display: flex; color: white;
flex-direction: column; display: flex;
justify-content: center; flex-direction: column;
align-items: center; justify-content: center;
} align-items: center;
#mission { font-family: Consolas, monospace;
color: white; overflow: hidden;
font-family: Consolas, monospace; }
font-size: 4vw; #mission {
white-space: nowrap; font-size: 4vw;
overflow: hidden; text-align: center;
text-overflow: ellipsis; margin-bottom: 10px;
max-width: 90vw; }
text-align: center; #timer {
} font-size: 8vw;
#timer { text-align: center;
color: white; margin-bottom: 20px;
font-family: Consolas, monospace; }
font-size: 8vw; </style>
line-height: 1; <script>
white-space: nowrap; // Auto-refresh every second to update the countdown and timeline if needed
text-align: center; setTimeout(() => location.reload(), 1000);
} </script>
</style> </head>
<script> <body>
setTimeout(() => location.reload(), 1000); <div id="mission">Mission</div>
</script> <div id="timer">T-00:00:00</div>
</head>
<body> <iframe
<div id="mission">Mission</div> id="timeline"
<div id="timer">T-00:00:00</div> src="https://docs.google.com/spreadsheets/d/e/2PACX-1vQssCeiHQwlh-2SKHyQnw_KEoYwU9UY9sP0MLNVvW30cEUFVgr8lJ33fAz0SMWmRGfsVBuUqxJ1a4Ba/pubhtml?gid=855477916&single=true"
</body> width="90%"
</html> height="400"
style="border:none; border-radius:10px; overflow:hidden;">
</iframe>
</body>
</html>

26
main.py
View File

@@ -121,21 +121,24 @@ class CountdownApp:
# Control buttons # Control buttons
frame_buttons = tk.Frame(root, bg="black") frame_buttons = tk.Frame(root, bg="black")
frame_buttons.pack(pady=10) frame_buttons.pack(pady=10)
self.start_btn = tk.Button(frame_buttons, text="▶ Start", command=self.start, font=("Arial", 14))
self.start_btn.pack(side="left", padx=5)
self.start_btn = tk.Button(frame_buttons, text="▶ Start", command=self.start, font=("Arial", 14))
self.start_btn.grid(row=0, column=0, padx=5)
# Hold and resume share the same position
self.hold_btn = tk.Button(frame_buttons, text="⏸ Hold", command=self.hold, font=("Arial", 14)) self.hold_btn = tk.Button(frame_buttons, text="⏸ Hold", command=self.hold, font=("Arial", 14))
self.hold_btn.pack(side="left", padx=5) self.hold_btn.grid(row=0, column=1, padx=5)
self.resume_btn = tk.Button(frame_buttons, text="⏵ Resume", command=self.resume, font=("Arial", 14)) self.resume_btn = tk.Button(frame_buttons, text="⏵ Resume", command=self.resume, font=("Arial", 14))
# Hidden initially self.resume_btn.grid(row=0, column=1, padx=5)
self.resume_btn.pack_forget() self.resume_btn.grid_remove() # hidden at start
self.scrub_btn = tk.Button(frame_buttons, text="🚫 Scrub", command=self.scrub, font=("Arial", 14), fg="red") self.scrub_btn = tk.Button(frame_buttons, text="🚫 Scrub", command=self.scrub, font=("Arial", 14), fg="red")
self.scrub_btn.pack(side="left", padx=5) self.scrub_btn.grid(row=0, column=2, padx=5)
self.reset_btn = tk.Button(frame_buttons, text="⟳ Reset", command=self.reset, font=("Arial", 14)) self.reset_btn = tk.Button(frame_buttons, text="⟳ Reset", command=self.reset, font=("Arial", 14))
self.reset_btn.pack(side="left", padx=5) self.reset_btn.grid(row=0, column=3, padx=5)
self.update_inputs() self.update_inputs()
self.update_clock() self.update_clock()
@@ -203,12 +206,13 @@ class CountdownApp:
self.show_hold_button() self.show_hold_button()
def show_hold_button(self): def show_hold_button(self):
self.resume_btn.pack_forget() self.resume_btn.grid_remove()
self.hold_btn.pack(side="left", padx=5) self.hold_btn.grid()
def show_resume_button(self): def show_resume_button(self):
self.hold_btn.pack_forget() self.hold_btn.grid_remove()
self.resume_btn.pack(side="left", padx=5) self.resume_btn.grid()
def scrub(self): def scrub(self):
self.scrubbed = True self.scrubbed = True