From dab697bfd64cc46f36e43f7e654355258031d979 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Fri, 21 Jul 2017 07:51:07 +0200 Subject: [PATCH 1/2] ADD storybook logo for inside terminal for future CLI or easteregg --- scripts/logo.js | 63 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 scripts/logo.js diff --git a/scripts/logo.js b/scripts/logo.js new file mode 100644 index 000000000000..d842a0e7afe2 --- /dev/null +++ b/scripts/logo.js @@ -0,0 +1,63 @@ +const coloured = ` +⢀⢀⣀⣀⣠⣤⣤⣤⣤⣤⣶⣶⣶⣶⣶⣶⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⢸⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⣿⠸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⣤⣤⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣶⡆⠀⠀⠀⠀⠀ +⢸⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⢀⣿⣿⣇⡀⠀⠀⢀⣀⣀⣀⠀⠀⠀⣀⣀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣀⠀⠀⣿⣿⡇⣀⣀⠀⠀⠀⠀⠀⣀⣀⣀⠀⠀⠀⠀⠀⣀⣀⣀⠀⠀⠀⢸⣿⣿⠀⠀⢀⠀⠀⠀ +⠈⡆⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠸⠿⣿⣿⠟⠛⢀⣿⣿⡿⢿⣿⣿⠀⠀⣿⣿⣿⣿⡟⢠⢿⢿⠀⠀⢿⢿⠀⠀⣿⣿⣿⠿⣿⣿⡆⠀⣾⣿⢿⠿⢿⣿⣆⠀⣴⣿⣿⠿⣿⣿⣷⠀⢸⣿⣿⢀⣾⣿⡟⠁⠀ +⠀⡇⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⣿⣿⠀⠀⢸⣿⣿⠀⠀⣿⣿⡇⠀⣿⣿⠁⠀⠀⢸⢿⢿⠀⠀⢿⢿⠀⠀⣿⣿⠀⠀⣿⣿⣿⢰⢿⢿⠀⠀⢸⢿⢿⠀⣿⣿⠃⠀⢸⣿⣿⠀⢸⣿⣿⣿⣿⣍⠀⠀⠀ +⠀⣷⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⣿⣿⠀⠀⠘⣿⣿⣦⣾⣿⣿⠀⠀⣿⣿⠀⠀⠀⠈⢿⢿⣷⣾⢿⢿⠀⠀⣿⣿⣷⣶⣿⣿⠁⠀⣿⢿⣷⡶⣿⢿⠃⠀⢿⣿⣷⣶⣿⣿⠏⠀⢸⣿⣿⠈⢿⣿⣷⣀⠀ +⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠉⠉⠀⠀⠀⠀⠉⠉⠉⠁⠀⠀⠀⠉⠉⠀⠀⠀⠀⢠⣀⠀⣠⢿⢿⠀⠀⠉⠉⠀⠉⠉⠀⠀⠀⠀⠈⠉⠉⠉⠀⠀⠀⠀⠈⠉⠉⠉⠀⠀⠀⠈⠉⠉⠀⠀⠈⠉⠉⠀ +⠀⣿⢹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⠿⢿⡿⠟⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠉⠈⠛⠛⠛⠛⠛⠛⠛⠛⠛⠿⠿⠿⠿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +`; + +const mono = ` +⢀⢀⣀⣀⣠⣤⣤⣤⣤⣤⣶⣶⣶⠀⠀⣶⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⢸⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣶⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⣿⠸⣿⣿⣿⡿⠉⠀⠀⠀⠀⠀⠙⣿⣿⣿⣿⠀⠀⠀⣤⣤⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣶⡆⠀⠀⠀⠀⠀ +⢸⠀⣿⣿⣿⠀⠀⠀⢰⣿⡀⠀⠀⢸⣿⣿⣿⠀⠀⢀⣿⣿⣇⡀⠀⠀⢀⣀⣀⣀⠀⠀⠀⣀⣀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣀⠀⠀⣿⣿⡇⣀⣀⠀⠀⠀⠀⠀⣀⣀⣀⠀⠀⠀⠀⠀⣀⣀⣀⠀⠀⠀⢸⣿⣿⠀⠀⢀⠀⠀⠀ +⠈⡆⣿⣿⣿⣧⠀⠀⠀⠈⠙⢿⣿⣿⣿⣿⣿⠀⠸⠿⣿⣿⠟⠛⢀⣿⣿⡿⢿⣿⣿⠀⠀⣿⣿⣿⣿⡟⢠⢿⢿⠀⠀⢿⢿⠀⠀⣿⣿⣿⠿⣿⣿⡆⠀⣾⣿⢿⠿⢿⣿⣆⠀⣴⣿⣿⠿⣿⣿⣷⠀⢸⣿⣿⢀⣾⣿⡟⠁⠀ +⠀⡇⣿⣿⣿⣿⣿⣶⣤⠀⠀⠀⠀⢿⣿⣿⣿⠀⠀⠀⣿⣿⠀⠀⢸⣿⣿⠀⠀⣿⣿⡇⠀⣿⣿⠁⠀⠀⢸⢿⢿⠀⠀⢿⢿⠀⠀⣿⣿⠀⠀⣿⣿⣿⢰⢿⢿⠀⠀⢸⢿⢿⠀⣿⣿⠃⠀⢸⣿⣿⠀⢸⣿⣿⣿⣿⣍⠀⠀⠀ +⠀⣷⣿⣿⣿⠀⠀⠀⠸⣿⠀⠀⠀⢸⣿⣿⣿⠀⠀⠀⣿⣿⠀⠀⠘⣿⣿⣦⣾⣿⣿⠀⠀⣿⣿⠀⠀⠀⠈⢿⢿⣷⣾⢿⢿⠀⠀⣿⣿⣷⣶⣿⣿⠁⠀⣿⢿⣷⡶⣿⢿⠃⠀⢿⣿⣷⣶⣿⣿⠏⠀⢸⣿⣿⠈⢿⣿⣷⣀⠀ +⠀⣿⣿⣿⣿⣷⣀⠀⠀⠀⠀⠀⣠⣿⣿⣿⣿⠀⠀⠀⠉⠉⠀⠀⠀⠀⠉⠉⠉⠁⠀⠀⠀⠉⠉⠀⠀⠀⠀⢠⣀⠀⣠⢿⢿⠀⠀⠉⠉⠀⠉⠉⠀⠀⠀⠀⠈⠉⠉⠉⠀⠀⠀⠀⠈⠉⠉⠉⠀⠀⠀⠈⠉⠉⠀⠀⠈⠉⠉⠀ +⠀⣿⢹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⠿⢿⡿⠟⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠉⠈⠛⠛⠛⠛⠛⠛⠛⠛⠛⠿⠿⠿⠿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +`; + +const chalkMap = { + P: '\\033[38;5;176m', + M: '\\033[38;5;211m', + W: '\\033[38;5;231m', + B: '\\033[38;5;111m', + G: '\\033[38;5;150m', + R: '\\033[38;5;210m', + m: '\\033[38;5;211m', + l: '\\033[38;5;225m', + O: '\\033[38;5;215m', + ' ': '', +}; + +const colourmap = ` +PPMMMMMMMMMMMWWMM +PPMMMMMMMMMMMllMM +PPMMMMlWWWWWmMMMM OOO RRR PPP +PPMMMlWWWMmWWmMMM OOOOO GGGG PP BB RRRRR BBB GGG PPP P +PPMMMMWWWlmMMMMMM OOOOOOGGGGGGG PPPPPBBB BB RRRRRRR BBBBBBB GGGGGGG PPPPPPPP +⠀PMMMMMmlWWWWMMMM OO GGG GGG PPP BBB BB RR RRRBBB BBB GGG GGG PPPPPP + PMMMWWWmMlWWWMMM OO GGGGGGG PP BBBBBBB RRRRRRR BBBBBBB GGGGGGG PPPPPPPP + PMMMMlWWWWWlMMMM OO GGGG PP BB BBB RR RR BBBB GGGG PPP PPP + PMMMMMMMMMMMMMMM BBBBBB + PMMMMMMMMMMMMMMM +`.split(''); + +const result = coloured.split('').map((char, index) => { + const colorKey = colourmap[index]; + const colorPrefix = chalkMap[colorKey] || ''; + return colorPrefix + char; +}); + +const exec = require('child_process').exec; + +exec(`printf "%b" "${result.join('')}\\033[0m"`, {}).stdout.pipe(process.stdout); + +exec(`printf "%b" "${mono}"`, {}).stdout.pipe(process.stdout); From 273d6f78a92e95b4c30cfcfefd990374acf3c6a8 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Fri, 21 Jul 2017 10:36:15 +0200 Subject: [PATCH 2/2] Improved colourmap visibility --- scripts/logo.js | 47 +++++++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/scripts/logo.js b/scripts/logo.js index d842a0e7afe2..5bfd53c8e330 100644 --- a/scripts/logo.js +++ b/scripts/logo.js @@ -25,35 +25,38 @@ const mono = ` `; const chalkMap = { - P: '\\033[38;5;176m', - M: '\\033[38;5;211m', - W: '\\033[38;5;231m', - B: '\\033[38;5;111m', - G: '\\033[38;5;150m', - R: '\\033[38;5;210m', - m: '\\033[38;5;211m', - l: '\\033[38;5;225m', - O: '\\033[38;5;215m', - ' ': '', + '▓': () => '\\033[38;5;176m', + '▒': () => '\\033[38;5;211m', + '.': () => '\\033[38;5;231m', + B: () => '\\033[38;5;111m', + '₯': () => '\\033[38;5;150m', + R: () => '\\033[38;5;210m', + m: () => '\\033[38;5;211m', + l: () => '\\033[38;5;225m', + O: () => '\\033[38;5;215m', + Z: () => '\\033[38;5;232m', + ' ': () => '\\033[38;5;16m', + '?': () => `\\033[38;5;${Math.floor(Math.random() * 255) + 1}m`, }; const colourmap = ` -PPMMMMMMMMMMMWWMM -PPMMMMMMMMMMMllMM -PPMMMMlWWWWWmMMMM OOO RRR PPP -PPMMMlWWWMmWWmMMM OOOOO GGGG PP BB RRRRR BBB GGG PPP P -PPMMMMWWWlmMMMMMM OOOOOOGGGGGGG PPPPPBBB BB RRRRRRR BBBBBBB GGGGGGG PPPPPPPP -⠀PMMMMMmlWWWWMMMM OO GGG GGG PPP BBB BB RR RRRBBB BBB GGG GGG PPPPPP - PMMMWWWmMlWWWMMM OO GGGGGGG PP BBBBBBB RRRRRRR BBBBBBB GGGGGGG PPPPPPPP - PMMMMlWWWWWlMMMM OO GGGG PP BB BBB RR RR BBBB GGGG PPP PPP - PMMMMMMMMMMMMMMM BBBBBB - PMMMMMMMMMMMMMMM +▓▓▒▒▒▒▒▒▒▒▒▒▒..▒▒ +▓▓▒▒▒▒▒▒▒▒▒▒▒ll▒▒ +▓▓▒▒▒▒l.....▒▒▒▒▒ OOO RRR ▓▓▓ +▓▓▒▒▒l...▒▒..▒▒▒▒ OOOOO ₯₯₯₯ ▓▓ BB RRRRR BBB ₯₯₯ ▓▓▓ ▓ +▓▓▒▒▒▒...l▒▒▒▒▒▒▒ OOOOOO₯₯₯₯₯₯₯ ▓▓▓▓▓BBB BB RRRRRRR BBBBBBB ₯₯₯₯₯₯₯ ▓▓▓▓▓▓▓▓ + ▓▒▒▒▒▒▒l....▒▒▒▒ OO ₯₯₯ ₯₯₯ ▓▓▓ BBB BB RR RRRBBB BBB ₯₯₯ ₯₯₯ ▓▓▓▓▓▓ + ▓▒▒▒...▒▒l...▒▒▒ OO ₯₯₯₯₯₯₯ ▓▓ BBBBBBB RRRRRRR BBBBBBB ₯₯₯₯₯₯₯ ▓▓▓▓▓▓▓▓ + ▓▒▒▒▒l.....l▒▒▒▒ OO ₯₯₯₯ ▓▓ BB BBB RR RR BBBB ₯₯₯₯ ▓▓▓ ▓▓▓ + ▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ BBBBBB + ▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ `.split(''); const result = coloured.split('').map((char, index) => { const colorKey = colourmap[index]; - const colorPrefix = chalkMap[colorKey] || ''; - return colorPrefix + char; + const colorPrefix = chalkMap[colorKey] ? chalkMap[colorKey]() : ''; + const isSpace = colorKey === ' '; + return colorPrefix + (isSpace ? '⠀' : char); }); const exec = require('child_process').exec;