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

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