Skip to content

Commit bbded65

Browse files
authored
better hourglass (#117)
1 parent 3de2e88 commit bbded65

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed

templates/index.css

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,18 @@ code {
314314
margin-top: 30px;
315315
}
316316

317-
#hourglass-form {
318-
margin-top: 10px;
319-
margin-bottom: 10px;
317+
.page-content.hourglass {
318+
align-content: center
319+
}
320+
321+
#hourglass-form {
322+
width: fit-content;
323+
margin: 10px auto;
324+
}
325+
326+
#hourglass-display {
327+
width: 500px;
328+
margin: 0 auto;
320329
}
321330

322331
#hourglass-display .table-column {
@@ -327,6 +336,7 @@ code {
327336
.timedisplay {
328337
min-width: 200px;
329338
font-size: 100px;
339+
margin-bottom: -20px;
330340
}
331341

332342
.hourglass-btn {

templates/template_hourglass.html

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@
33
{% endwith %}
44
<audio id="hourglass-beep" src="{{ static_url }}/sounds/timer-beep.mp3" preload="auto"></audio>
55
<audio id="hourglass-end" src="{{ static_url }}/sounds/timer-end.mp3" preload="auto"></audio>
6-
<div class="page-content">
7-
Type number of seconds needed, hit enter to start. Hit space to flip the hourglass. <a id="hg-appmode" href="javascript:enterAppMode();">Enter/exit app mode.</a>
8-
<form id="hourglass-form">
9-
<input inputmode="numeric" id="hourglass-timerequested">seconds
10-
</form>
6+
<div class="page-content hourglass">
117
<div id="hourglass-display" class="table no-borders">
128
<div class="table-row non-alternating">
139
<div class="table-column timedisplay" id="hourglass-timeleft"></div>
@@ -26,6 +22,9 @@
2622
<div class="table-column btn hourglass-btn" id="hg-flip">Flip</div>
2723
</div>
2824
</div>
25+
<form id="hourglass-form">
26+
<input inputmode="numeric" id="hourglass-timerequested">seconds
27+
</form>
2928
</div>
3029
{% include './footer.html' %}
3130

@@ -108,6 +107,10 @@
108107
e.preventDefault();
109108
primaryAction();
110109
}
110+
document.getElementsByClassName("page-content")[0].ondblclick = function(e) {
111+
e.preventDefault();
112+
enterAppMode();
113+
}
111114
document.getElementById("hourglass-form").onsubmit = function(e) {
112115
e.preventDefault();
113116
initiateTimer();

0 commit comments

Comments
 (0)