Hold Button Fix
This commit is contained in:
@@ -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;
|
||||||
|
color: white;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
|
||||||
#mission {
|
|
||||||
color: white;
|
|
||||||
font-family: Consolas, monospace;
|
font-family: Consolas, monospace;
|
||||||
font-size: 4vw;
|
|
||||||
white-space: nowrap;
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
}
|
||||||
max-width: 90vw;
|
#mission {
|
||||||
|
font-size: 4vw;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
margin-bottom: 10px;
|
||||||
#timer {
|
}
|
||||||
color: white;
|
#timer {
|
||||||
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>
|
}
|
||||||
<script>
|
</style>
|
||||||
setTimeout(() => location.reload(), 1000);
|
<script>
|
||||||
</script>
|
// Auto-refresh every second to update the countdown and timeline if needed
|
||||||
</head>
|
setTimeout(() => location.reload(), 1000);
|
||||||
<body>
|
</script>
|
||||||
<div id="mission">Mission</div>
|
</head>
|
||||||
<div id="timer">T-00:00:00</div>
|
<body>
|
||||||
</body>
|
<div id="mission">Mission</div>
|
||||||
</html>
|
<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
|
# 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
|
||||||
|
|||||||
Reference in New Issue
Block a user