Hold Button Fix
This commit is contained in:
@@ -1,41 +1,46 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<style>
|
||||
body {
|
||||
margin: 0;
|
||||
background-color: black;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
#mission {
|
||||
color: white;
|
||||
font-family: Consolas, monospace;
|
||||
font-size: 4vw;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
max-width: 90vw;
|
||||
text-align: center;
|
||||
}
|
||||
#timer {
|
||||
color: white;
|
||||
font-family: Consolas, monospace;
|
||||
font-size: 8vw;
|
||||
line-height: 1;
|
||||
white-space: nowrap;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
setTimeout(() => location.reload(), 1000);
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="mission">Mission</div>
|
||||
<div id="timer">T-00:00:00</div>
|
||||
</body>
|
||||
</html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<style>
|
||||
body {
|
||||
margin: 0;
|
||||
background-color: black;
|
||||
color: white;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-family: Consolas, monospace;
|
||||
overflow: hidden;
|
||||
}
|
||||
#mission {
|
||||
font-size: 4vw;
|
||||
text-align: center;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
#timer {
|
||||
font-size: 8vw;
|
||||
text-align: center;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
// Auto-refresh every second to update the countdown and timeline if needed
|
||||
setTimeout(() => location.reload(), 1000);
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="mission">Mission</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>
|
||||
</html>
|
||||
26
main.py
26
main.py
@@ -121,21 +121,24 @@ class CountdownApp:
|
||||
# Control buttons
|
||||
frame_buttons = tk.Frame(root, bg="black")
|
||||
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.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))
|
||||
# Hidden initially
|
||||
self.resume_btn.pack_forget()
|
||||
self.resume_btn.grid(row=0, column=1, padx=5)
|
||||
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.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.pack(side="left", padx=5)
|
||||
self.reset_btn.grid(row=0, column=3, padx=5)
|
||||
|
||||
|
||||
self.update_inputs()
|
||||
self.update_clock()
|
||||
@@ -203,12 +206,13 @@ class CountdownApp:
|
||||
self.show_hold_button()
|
||||
|
||||
def show_hold_button(self):
|
||||
self.resume_btn.pack_forget()
|
||||
self.hold_btn.pack(side="left", padx=5)
|
||||
self.resume_btn.grid_remove()
|
||||
self.hold_btn.grid()
|
||||
|
||||
def show_resume_button(self):
|
||||
self.hold_btn.pack_forget()
|
||||
self.resume_btn.pack(side="left", padx=5)
|
||||
self.hold_btn.grid_remove()
|
||||
self.resume_btn.grid()
|
||||
|
||||
|
||||
def scrub(self):
|
||||
self.scrubbed = True
|
||||
|
||||
Reference in New Issue
Block a user