-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.js
27 lines (23 loc) · 1.24 KB
/
config.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
export const configBuilder = array => {
let config = {
frameWidth: document.body.clientWidth * 0.70,
backgroundColor: '#90A4AE',
arrayColor: '#4DD0E1',
mappedArrayColor: '#81C784',
filteredOutColor: '#E57373',
};
config.bezelWidth = config.frameWidth / 48,
config.elementSize = config.frameWidth / 8,
config.elementSpacing = config.frameWidth / 100,
config.infoBoxHeight = config.frameWidth / 24,
config.elementFontSize = config.frameWidth / 50,
config.arrayFrameHeight = (config.bezelWidth * 2) + (array.length * config.elementSize) + ((array.length - 1) * config.elementSpacing);
config.endPosition = config.frameWidth - config.elementSize - (config.bezelWidth * 2);
config.halfwayPosition = ((config.endPosition - config.bezelWidth) / 2);
config.totalFrameHeight = config.arrayFrameHeight + config.infoBoxHeight + (2 * config.bezelWidth);
config.arrayPanelWidth = config.bezelWidth * 2 + config.elementSize;
config.middleSectionWidth = config.frameWidth - (config.arrayPanelWidth * 2);
config.infoBoxWidth = config.middleSectionWidth - (2 * config.bezelWidth);
config.infoFrameHeight = config.infoBoxHeight + (2 * config.bezelWidth);
return config;
};