-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.config.ts
More file actions
80 lines (70 loc) · 2.54 KB
/
app.config.ts
File metadata and controls
80 lines (70 loc) · 2.54 KB
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
import { displayName, version } from '~/package.json';
const appName = displayName;
const appVersion = version;
const appMetaDescription = 'Free Online Timer. Customize your alarm sound and background picture. Easily set hour, minute, and second intervals.';
// https://nuxt.com/docs/getting-started/configuration
const SECONDS_IN_A_MINUTE = 60;
const SECONDS_IN_AN_HOUR = SECONDS_IN_A_MINUTE * 60;
// === How long the alarm will play for (in ms) ===
const DURATION_SOUND = 3 * 60 * 1000;
// === Time between timer display blink (in ms) ===
const TIMER_BLINK_INTERVAL = 350;
// === SEO popular preset timers ===
const SUFFIX_APP_META_DESCRIPTION = 'FREE and easy to use. Option to choose different alarm sound and background picture.';
// Note: `?` indicates optional
interface UrlSegmentObject {
appTitle: string;
pageMetaDescription: string;
showInFooter?: boolean;
timer?: number;
}
interface UrlSegmentsObject {
[key: string]: UrlSegmentObject;
}
// Note: `: UrlSegmentsObject` indicates `SUPPORTED_URL_SEGMENTS` has type `UrlSegmentsObject`
// Note: Keys in SUPPORTED_URL_SEGMENTS should all end with trailing / to avoid redirect, e.g. /10-minute-timer/
const SUPPORTED_URL_SEGMENTS: UrlSegmentsObject = {
// Note: Only if timer attribute exists should the initial timer be changed
'/': {
appTitle: appName,
pageMetaDescription: appMetaDescription,
showInFooter: false,
},
'/classroom-timer/': {
appTitle: 'Classroom Timer',
pageMetaDescription: `Classroom timer online. ${SUFFIX_APP_META_DESCRIPTION}`,
},
'/timer-clock/': {
appTitle: 'Timer Clock',
pageMetaDescription: `Timer clock online. ${SUFFIX_APP_META_DESCRIPTION}`,
},
};
// Add 1 Minute Timer, 2 Minute Timer...
[1, 2, 5, 10, 15, 20, 25, 30, 45].forEach((noOfMinutes) => {
SUPPORTED_URL_SEGMENTS[`/${noOfMinutes}-minute-timer/` as string] = {
appTitle: `${noOfMinutes} Minute Timer`,
pageMetaDescription: `${noOfMinutes} minute timer online. ${SUFFIX_APP_META_DESCRIPTION}`,
showInFooter: true,
timer: SECONDS_IN_A_MINUTE * noOfMinutes,
};
});
// Add 1 Hour Timer
SUPPORTED_URL_SEGMENTS['/1-hour-timer/'] = {
appTitle: '1 Hour Timer',
pageMetaDescription: `1 hour timer online. ${SUFFIX_APP_META_DESCRIPTION}`,
timer: SECONDS_IN_A_MINUTE * 60,
showInFooter: true,
};
export default defineAppConfig({
// === App Info ===
appName,
appVersion,
appMetaDescription,
// === Constants ===
SECONDS_IN_A_MINUTE,
SECONDS_IN_AN_HOUR,
// === App Level Settings ===
DURATION_SOUND,
TIMER_BLINK_INTERVAL,
SUPPORTED_URL_SEGMENTS,
});