forked from Anagrr/Fuse.NeuCalculator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKeyboard.js
More file actions
71 lines (65 loc) · 2.04 KB
/
Keyboard.js
File metadata and controls
71 lines (65 loc) · 2.04 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
function ButtonsRow (opts) {
return { buttons : opts.buttons || [] };
}
function Button(opts) {
return {
title : opts.title || '',
color : opts.color || '#666',
size : opts.size || "70",
};
};
var colors = {
DarkShadow: "#A3B1C6",
LightRed: "#ef958c",
Black: "#000"
};
var generateKeyboard = function() {
let board = {
colors,
rows : [
new ButtonsRow({
buttons:[
new Button({title: "AC", color: colors.DarkShadow}),
new Button({title: "+/-", color: colors.DarkShadow}),
new Button({title: "%", color: colors.DarkShadow}),
new Button({title: "/", color: colors.LightRed})
]
}),
new ButtonsRow({
buttons:[
new Button({title: "7"}),
new Button({title: "8"}),
new Button({title: "9"}),
new Button({title: "x", color: colors.LightRed})
]
}),
new ButtonsRow({
buttons:[
new Button({title: "4"}),
new Button({title: "5"}),
new Button({title: "6"}),
new Button({title: "-", color: colors.LightRed})
]
}),
new ButtonsRow({
buttons:[
new Button({title: "1"}),
new Button({title: "2"}),
new Button({title: "3"}),
new Button({title: "+", color: colors.LightRed})
]
}),
new ButtonsRow({
buttons:[
new Button({title: "0", size: "160,70"}),
new Button({title: "."}),
new Button({title: "=", color: colors.LightRed})
]
}),
],
spacing : 20
}
board.rowsCount = board.rows.length;
return board;
};
module.exports.Keyboard = generateKeyboard();