How to use the blessed.text function in blessed

To help you get started, we’ve selected a few blessed examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github astefanutti / kubebox / lib / ui / navbar.js View on Github external
constructor(screen) {

    const menu = blessed.text({
      parent  : screen,
      tags    : true,
      width   : '100%',
      height  : 1,
      top     : 0,
      padding : {
        left  : 1,
        right : 1,
      },
      style : {
        bg : 'white',
        fg : 'black',
      },
      // TODO: add click handler that display Kubebox about modal
      content : '{|}⎈ ❏',
    });
github keenwon / eazydict / src / cli / wordbook.js View on Github external
function createStatusBox(count) {
  return blessed.text({
    // eslint-disable-next-line max-len
    content: `  共: ${count} 条 | 退出: Esc、Ctrl-C、q {|} {cyan-fg}{bold} Made With Heart by Keenwon{/bold}  `,
    valign: 'middle',
    top: '95%',
    height: '5%',
    tags: true
  });
}
github mepholic / dsnview / main.js View on Github external
},
    },
  },
  selectedBg: 'blue',
  label: 'Targets',
  content: ' Select a Dish ',
  // Allow mouse support
  mouse: true,
  // Allow key support (arrow keys + enter)
  keys: true,
  // Use vi built-in keys
  vi: true,
});

// Create Target Info
var targetInfo = blessed.text({
  parent: screen,
  width: '49%',
  height: '45%',
  top: '52%',
  left: '50%',
  align: 'left',
  fg: 'cyan',
  border: {
    type: 'line',
  },
  label: 'Target Info',
  content: ' Select a Target ',
});

// Initially focus the site box
siteBox.focus();
github freeCodeCamp / freeCodeCamp / setup.js View on Github external
'» REMOVE AUTHENTICATION PROVIDER',
    '» CHANGE EMAIL SERVICE',
    '» ADD NODE.JS CLUSTER SUPPORT',
    '» EXIT'
  ]
});

var homeTitle = blessed.text({
  parent: screen,
  align: 'center',
  fg: 'blue',
  bg: 'white',
  content: 'Hackathon Starter (c) 2014'
});

var footer = blessed.text({
  parent: screen,
  bottom: 0,
  fg: 'white',
  bg: 'blue',
  tags: true,
  content: ' {cyan-fg}{/cyan-fg} moves |' +
    ' {cyan-fg}{/cyan-fg} selects | {cyan-fg}<q>{/cyan-fg} exits'
});

var inner = blessed.form({
  top: 'center',
  left: 'center',
  mouse: true,
  keys: true,
  width: 33,
  height: 10,</q>
github xxhomey19 / nba-go / src / utils / blessed.js View on Github external
align: 'left',
    style: {
      fg: 'white',
    },
  });

  const seasonText = blessed.text({
    top: 0,
    left: 'center',
    align: 'center',
    style: {
      fg: 'white',
    },
  });

  const timeText = blessed.text({
    top: 13,
    left: 'center',
    align: 'center',
    style: {
      fg: 'white',
    },
  });

  const dateText = blessed.text({
    top: 2,
    left: 'center',
    align: 'center',
    style: {
      fg: 'white',
    },
  });
github xxhomey19 / nba-go / src / utils / blessed.js View on Github external
});

  const homeTeamScoreText = blessed.bigtext({
    font: path.join(__dirname, './fonts/ter-u12n.json'),
    fontBold: path.join(__dirname, './fonts/ter-u12b.json'),
    top: 2,
    left: '33%-20',
    width: 15,
    align: 'right',
    vlign: 'center',
    style: {
      fg: 'white',
    },
  });

  const visitorTeamFullNameText = blessed.text({
    top: 7,
    left: '66%+28',
    width: 25,
    align: 'left',
    content: `${visitorTeam.getFullName({
      color: true,
    })}`,
    tags: true,
    style: {
      fg: 'white',
    },
  });

  const visitorTeamStandingsText = blessed.text({
    top: 8,
    left: '66%+28',
github chjj / termcoin / lib / ui.js View on Github external
top: 2,
    left: 9,
    right: 1,
    height: 1,
    style: {
      bg: 'black',
      focus: {
        bg: 'blue'
      },
      hover: {
        bg: 'blue'
      }
    }
  });

  tabs.send._.mtext = blessed.text({
    parent: tabs.send._.form,
    top: 4,
    left: 0,
    height: 1,
    content: 'A{ul}m{/ul}ount:',
    tags: true
  });

  tabs.send._.amount = blessed.textbox({
    parent: tabs.send._.form,
    name: 'amount',
    inputOnFocus: true,
    top: 4,
    left: 9,
    right: 1,
    height: 1,
github chjj / termcoin / lib / ui.js View on Github external
delete tabs.logs._.tail;
    }
  });

  /**
   * Explore
   */

  require('./explore/ui');

  /**
   * Debug
   */

  if (termcoin.config.debug) {
    tabs.debug._.data = blessed.text({
      parent: tabs.debug,
      top: 0,
      left: 3,
      height: 'shrink',
      width: 'shrink',
      content: '',
      tags: true
    });
  }

  /**
   * Global Widgets
   */

  screen._.prompt = blessed.prompt({
    parent: screen,
github xxhomey19 / nba-go / src / utils / blessed.js View on Github external
align: 'center',
    style: {
      fg: 'white',
    },
  });

  const arenaText = blessed.text({
    top: 3,
    left: 'center',
    align: 'center',
    style: {
      fg: 'white',
    },
  });

  const networkText = blessed.text({
    top: 4,
    left: 'center',
    align: 'center',
    style: {
      fg: 'white',
    },
  });

  const playByPlayBox = blessed.box({
    parent: screen,
    top: 15,
    left: 3,
    width: '70%-3',
    height: '100%-15',
    padding: {
      top: 0,
github SheetJS / wk / view.ts View on Github external
let colhdr = 3;
if(range.e.r >= 1000) colhdr = (1 + Math.log(range.e.r) * Math.LOG10E) | 0;
let ncol = ((screen.cols - colhdr)/colwidth)|0;
let nrow = screen.rows - 4;


const body = blessed.box({ height:'100%', width:'100%', bg:BG, fg:FG });

const H1 = blessed.box({ top:0, height:1, width:'100%', bg:FG, fg:BG, parent:body });
const H1r = blessed.text({ top:0, right:0, width:2, bg:FG, fg:BG, parent: H1 });
const H1l = blessed.text({ top:0, left:0, width:'100%-2', bg:FG, fg:BG, parent: H1 });

const H2 = blessed.box({ top:1, height:1, width:'100%', bg:FG, fg:BG, parent:body });
const H2r = blessed.text({ top:0, right:0, width:2, bg:BG, fg:FG, parent:H2 });
H2r.setContent('JS');
const H2l = blessed.text({ top:0, left:0, width:'100%-2', bg:FG, fg:BG, parent:H2 });

const H3 = blessed.box({ top:2, height:1, width:'100%', bg:BG, fg:FG, tags:true, parent:body });

const H4 = blessed.box({ top:3, height:1, width:'100%', bg:BG, fg:FG, parent:body });
const H4l = blessed.box({ top:0, height:1, width:'50%', bg:FG, fg:BG, parent:H4 });

const H5 = blessed.box({ top:4, height:'100%-4', width:colhdr, bg:FG, fg:BG, parent:body });

const D: blessed.box[] = [];
let DW = sprintf('100%%-%d', colhdr);


function center_str(s: string, w: number): string {
	if(s.length >= w) return s.substr(0,w);
	const pl = (w - s.length) >> 1;
	return new Array(pl+1).join(" ") + s + new Array(w - s.length - pl + 1).join(" ");