themes.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. 'use strict'
  2. var color = require('console-control-strings').color
  3. var ThemeSet = require('./theme-set.js')
  4. var themes = module.exports = new ThemeSet()
  5. themes.addTheme('ASCII', {
  6. preProgressbar: '[',
  7. postProgressbar: ']',
  8. progressbarTheme: {
  9. complete: '#',
  10. remaining: '.'
  11. },
  12. activityIndicatorTheme: '-\\|/',
  13. preSubsection: '>'
  14. })
  15. themes.addTheme('colorASCII', themes.getTheme('ASCII'), {
  16. progressbarTheme: {
  17. preComplete: color('bgBrightWhite', 'brightWhite'),
  18. complete: '#',
  19. postComplete: color('reset'),
  20. preRemaining: color('bgBrightBlack', 'brightBlack'),
  21. remaining: '.',
  22. postRemaining: color('reset')
  23. }
  24. })
  25. themes.addTheme('brailleSpinner', {
  26. preProgressbar: '⸨',
  27. postProgressbar: '⸩',
  28. progressbarTheme: {
  29. complete: '#',
  30. remaining: '⠂'
  31. },
  32. activityIndicatorTheme: '⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏',
  33. preSubsection: '>'
  34. })
  35. themes.addTheme('colorBrailleSpinner', themes.getTheme('brailleSpinner'), {
  36. progressbarTheme: {
  37. preComplete: color('bgBrightWhite', 'brightWhite'),
  38. complete: '#',
  39. postComplete: color('reset'),
  40. preRemaining: color('bgBrightBlack', 'brightBlack'),
  41. remaining: '⠂',
  42. postRemaining: color('reset')
  43. }
  44. })
  45. themes.setDefault({}, 'ASCII')
  46. themes.setDefault({hasColor: true}, 'colorASCII')
  47. themes.setDefault({platform: 'darwin', hasUnicode: true}, 'brailleSpinner')
  48. themes.setDefault({platform: 'darwin', hasUnicode: true, hasColor: true}, 'colorBrailleSpinner')
  49. themes.setDefault({platform: 'linux', hasUnicode: true}, 'brailleSpinner')
  50. themes.setDefault({platform: 'linux', hasUnicode: true, hasColor: true}, 'colorBrailleSpinner')