const blessed = require('blessed')
const css = require('blessed-css')
const style = css(`
#background {
bg: blue;
}
.dialog {
fg: black;
bg: white;
}
.dialog:border {
fg: magenta;
}
`)
const screen = blessed.screen({
smartCSR: true
})
const background = blessed.box({
parent: screen,
id: 'background'
})
style(background)
const box = blessed.box({
parent: screen,
className: 'dialog',
top: 'center',
left: 'center',
width: '60%',
height: '55%',
content: 'Hello world!',
border: 'line',
shadow: true
})
style(box)
screen.key(['escape', 'q', 'C-c'], (ch, key) => process.exit(0))
screen.render()