-
Notifications
You must be signed in to change notification settings - Fork 13
/
monBox.js
49 lines (42 loc) · 893 Bytes
/
monBox.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
43
44
45
46
47
48
49
//import blessed from 'blessed';
const blessed = require('blessed')
// Create a screen object.
var screen = blessed.screen({
smartCSR: true
});
screen.title = 'monBee';
// Quit on Escape, q, or Control-C.
screen.key(['escape', 'q', 'C-c'], function(ch, key) {
return process.exit(0);
});
// Create a box for the node
var box = blessed.box({
parent: screen,
mouse: true,
keys: true,
vi: true,
left: '25%',
top: '25%',
width: '50%',
height: '50%',
content: '{center}A very simple box\n\n\nq to quit{/center}',
tags: true,
border: {
type: 'line'
},
style: {
fg: 'brightwhite',
bg: 'black', // Was magenta
border: {
fg: '#f0f0f0'
},
hover: {
bg: 'green'
}
}
});
// Append our box to the screen.
screen.append(box);
// Focus our element.
box.focus();
screen.render()