themes.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. 'use strict'
  2. var consoleControl = require('console-control-strings')
  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: consoleControl.color('inverse'),
  18. complete: ' ',
  19. postComplete: consoleControl.color('stopInverse'),
  20. preRemaining: consoleControl.color('brightBlack'),
  21. remaining: '.',
  22. postRemaining: consoleControl.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: consoleControl.color('inverse'),
  38. complete: ' ',
  39. postComplete: consoleControl.color('stopInverse'),
  40. preRemaining: consoleControl.color('brightBlack'),
  41. remaining: '░',
  42. postRemaining: consoleControl.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')