forked from tomjbradley/tomato-timer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
338 lines (333 loc) · 11.3 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Tomato Timer - Online Pomodoro Timer App</title>
<meta
name="description"
content="Tomato Timer is a flexible and easy-to-use online Pomodoro technique timer. Boost your productivity with Tomato Timer."
/>
<meta
name="keywords"
content="pomodoro technique, tomato timer, pomodoro timer, online pomodoro timer, software timer, pomodoro software timer, productivity tools, gtd, getting things done, productivity, digital timer, concentration techniques, pomodoro resources, pomodoro software"
/>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="style.css" />
<script defer src="main.js"></script>
</head>
<body>
<header class="site-header">
<div class="container">
<div class="site-header__inner">
<h1>TomatoTimer</h1>
<menu class="button-group">
<li>
<button
class="button button--dark"
data-toggle="modal"
data-target="log-modal"
>
Log
</button>
</li>
<li>
<button
class="button button--dark"
data-toggle="modal"
data-target="faq-modal"
>
FAQ
</button>
</li>
<li>
<button
class="button button--dark"
data-toggle="modal"
data-target="settings-modal"
>
Settings
</button>
</li>
</menu>
</div>
</div>
</header>
<main>
<div class="container">
<div id="timer-buttons" class="button-group | justify-center">
<button
id="pomodoro-button"
class="button button--primary"
data-value="pomodoro"
>
Pomodoro
</button>
<button
id="short-break-button"
class="button button--primary"
data-value="shortBreak"
>
Short Break
</button>
<button
id="long-break-button"
class="button button--primary"
data-value="longBreak"
>
Long Break
</button>
</div>
<span id="timer" class="timer">25:00</span>
<div class="button-group | justify-center">
<button
id="start-button"
class="button button--success button--large"
>
Start
</button>
<button id="stop-button" class="button button--danger button--large">
Stop
</button>
<button id="reset-button" class="button button-light button--large">
Reset
</button>
</div>
</div>
</main>
<footer class="site-footer">
<div class="container">
<div class="even-columns">
<div class="flow">
<h2>Keyboard Shortcuts</h2>
<ul>
<li><kbd>Space</kbd> Start or Stop the timer</li>
<li><kbd>Alt + P</kbd> Pomodoro</li>
<li><kbd>Alt + S</kbd> Short Break</li>
<li><kbd>Alt + L</kbd> Long Break</li>
<li><kbd>Alt + R</kbd> Reset Timer</li>
</ul>
</div>
<div class="flow">
<h2>Notifications</h2>
<p>You can change the audio tone and volume via Settings</p>
<p>
Desktop Notifications are currently supported in Chrome, Firefox
and Safari
</p>
<button
id="enable-notifications-button"
class="button button--primary"
>
Enable Notifications
</button>
</div>
<div class="flow">
<h2>About This Project</h2>
<p>
This is a clone of <del>tomato-timer.com</del>
<ins datetime="2022-04-06"
>(now toptal.com/project-managers/tomato-timer)</ins
>
which I made to practice developing a web application with Vanilla
JavaScript.
</p>
</div>
</div>
</div>
</footer>
<!-- Log Modal -->
<dialog id="log-modal" class="modal">
<div class="modal__header">
<h2>Log</h2>
<button data-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal__body | flow">
<div>
<span id="pomodoro-goal-label">Pomodoro goal tracker:</span>
<div
id="pomodoro-goal"
class="pomodoro-goal-indicators"
aria-labelledby="pomodoro-goal-label"
></div>
</div>
<button
id="clear-todays-sessions-button"
class="button button--primary"
>
Clear pomodoro's done today
</button>
<div class="table-container">
<table id="log-table">
<thead>
<tr>
<th>Session</th>
<th>Start time</th>
<th>End time</th>
<th>Description</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<button id="clear-log-button" class="button button--primary">
Clear timer log
</button>
</div>
</dialog>
<!-- FAQ Modal -->
<dialog id="faq-modal" class="modal">
<div class="modal__header">
<h2>Frequently Asked Questions (<abbr>FAQ</abbr>)</h2>
<button data-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal__body | flow">
<h3>What is Pomodoro Technique?</h3>
<p>
The time management technique created by Francesco Cirillo for a more
productive way to work and study. For more information,
<a href="https://www.pomodorotechnique.com/" target="_blank"
>click here</a
>.
</p>
<h3>Can you tell me the story without having to visit the website?</h3>
<p>Well, it comprises of the following basic steps:</p>
<ol>
<li>Decide on the task at hand</li>
<li>Set the <b>Pomodoro</b> (timer) to 25 minutes</li>
<li>Work on the task until the timer expires; Record with an X</li>
<li>Take a <b>Short Break</b> (5 minutes)</li>
<li>
Every four "<i>pomodoros</i>", take a <b>Long Break</b> (10 minutes)
</li>
</ol>
<h3>What is TomatoTimer?</h3>
<p>
It's an easy to use, flexible Pomodoro Technique timer. This project
is a clone of <del>tomato-timer.com</del>
<ins datetime="2022-04-06"
>(now toptal.com/project-managers/tomato-timer)</ins
>
and it uses Vanilla JavaScript and HTML5 features like Desktop
Notifications, Audio API and Local Storage instead of relying on Adobe
Flash and other such technologies.
</p>
<h3>Why use TomatoTimer?</h3>
<p>Here's why:</p>
<ul>
<li>Clean and Crisp interface with a Mobile friendly layout.</li>
<li>Ability to Pause or Reset the timer intervals.</li>
<li>Audio notifications at the end of a timer period.</li>
<li>Desktop notifications.</li>
<li>Keyboard shortcuts.</li>
<li>Ability to change the alert sound + volume via Settings</li>
<li>Custom Timer Intervals</li>
<li>A log of your activity.</li>
</ul>
</div>
</dialog>
<!-- Settings Modal -->
<dialog id="settings-modal" class="modal">
<div class="modal__header">
<h2>Settings</h2>
<button data-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal__body">
<form id="settings-form" class="flow" method="dialog">
<fieldset>
<legend class="heading-3">User Preferences</legend>
<label for="timer-in-title"
><input
id="timer-in-title"
type="checkbox"
name="showTimeInTitle"
/>
Timer indication in title?</label
>
<label for="browser-notifications"
><input
id="browser-notifications"
type="checkbox"
name="browserNotifications"
/>
Browser notifications?</label
>
<label for="auto-start"
><input id="auto-start" type="checkbox" name="autoStartTimers" />
Auto start pomodoros and breaks?</label
>
<label for="pomodoro-goal"
>Pomodoro goal for the day:
<input id="pomodoro-goal" type="number" name="pomodoroGoal"
/></label>
</fieldset>
<fieldset>
<legend class="heading-3">Select Sound</legend>
<select id="sound-select" name="alarmSoundFilename" size="5">
<option value="80sAlarm.mp3">80s Alarm</option>
<option value="alarmclock.mp3">Alarm Clock</option>
<option value="alarmwatch.mp3">Wristwatch Alarm</option>
<option value="ding.mp3">Elevator Ding</option>
<option value="doorbell.mp3">Door Bell</option>
</select>
</fieldset>
<fieldset>
<legend class="heading-3">Select Volume</legend>
<select
id="volume-select"
type="number"
name="alarmVolume"
size="5"
>
<option value="0">Mute</option>
<option value="0.25">25%</option>
<option value="0.5">50%</option>
<option value="0.75">75%</option>
<option value="1">100%</option>
</select>
</fieldset>
<fieldset>
<legend class="heading-3">
Set Custom Times <small>(in minutes)</small>
</legend>
<div class="even-columns">
<div>
<label for="pomodoro">Pomodoro:</label>
<input id="pomodoro" type="number" name="pomodoro" value="25" />
</div>
<div>
<label for="short-break">Short Break:</label>
<input
id="short-break"
type="number"
name="shortBreak"
value="5"
/>
</div>
<div>
<label for="long-breal">Long Break:</label>
<input
id="long-break"
type="number"
name="longBreak"
value="10"
/>
</div>
</div>
</fieldset>
<div class="button-group">
<button class="button button--primary" type="submit">Save</button>
<button class="button button--primary" type="reset">Reset</button>
<button
id="sound-test-button"
class="button button--primary"
type="button"
>
Sound Test
</button>
</div>
</form>
</div>
</dialog>
</body>
</html>