-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.js
42 lines (36 loc) · 927 Bytes
/
settings.js
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
// How many milliseconds takes one second?
// While testing, it may be helpful to give it a small value (e.g. 10).
const second = 1000;
const lowestMinute = 0;
const lowestSecond = 0;
const highestSecond = 59;
const times = {
zero: {minutes: lowestMinute, seconds: lowestSecond},
pomidor: {minutes: 25, seconds: lowestSecond},
longBreak: {minutes: 10, seconds: lowestSecond},
shortBreak: {minutes: 5, seconds: lowestSecond},
};
const timeUnitWidth = 2;
const timeUnitFill = '0';
const elementIds = {
time: 'time',
alarm: 'alarm',
pomidor: 'pomidor',
longBreak: 'longBreak',
shortBreak: 'shortBreak',
stop: 'stop'
};
const elements = Object.keys(elementIds).reduce((result, key) => (
{...result, [key]: document.getElementById(elementIds[key])}
), {});
module.exports = {
second,
lowestSecond,
lowestMinute,
highestSecond,
times,
timeUnitWidth,
timeUnitFill,
elementIds,
elements
};