-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.ts
More file actions
45 lines (41 loc) · 941 Bytes
/
config.ts
File metadata and controls
45 lines (41 loc) · 941 Bytes
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
import type { DeepReadonly, PadConfig, PadId } from './types';
export const ENV =
window.location.hostname === 'simon.codenickycode.com'
? 'prod'
: window.location.hostname.includes('.pages.dev')
? 'stage'
: window.location.port === '4173'
? 'test'
: 'dev';
export const getServerUrl = () => {
switch (ENV) {
case 'stage':
return 'https://simon-stage.codenickycode.workers.dev';
case 'prod':
return 'https://simon.codenickycode.workers.dev';
case 'test':
return 'http://localhost:8788';
case 'dev':
default:
return 'http://localhost:8787';
}
};
export const ANIMATION_DURATION = 300;
export const PAD_SCHEMA: DeepReadonly<{ [key in PadId]: PadConfig }> = {
green: {
tone: 'E4',
key: 'q',
},
red: {
tone: 'C4',
key: 'w',
},
blue: {
tone: 'C5',
key: 's',
},
yellow: {
tone: 'G4',
key: 'a',
},
} as const;