« get me outta code hell

Easter egg??? :) - mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
path: root/ui.js
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2019-05-28 21:40:56 -0300
committerFlorrie <towerofnix@gmail.com>2019-05-28 21:40:56 -0300
commit565c984e563be3bc37c9ab5674ee088f2ea718c0 (patch)
tree68c661c2ba3e7db5f14b0e6b75abc9392a9d6fba /ui.js
parentdd32eb4fa279e4417cd4136d23e9646fb967a1e5 (diff)
Easter egg??? :)
Diffstat (limited to 'ui.js')
-rw-r--r--ui.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/ui.js b/ui.js
index 3d2bbee..e1eb528 100644
--- a/ui.js
+++ b/ui.js
@@ -2763,6 +2763,8 @@ class Menubar extends ListScrollForm {
     super('horizontal')
 
     this.contextMenu = contextMenu
+    this.color = 4 // blue
+    this.attribute = 2 // dim
   }
 
   select() {
@@ -2791,6 +2793,16 @@ class Menubar extends ListScrollForm {
     if (telc.isSpace(keyBuf)) {
       return false
     }
+
+    // For fun :)
+    if (telc.isCaselessLetter(keyBuf, 'c')) {
+      this.color = (this.color % 8) + 1
+      return false
+    }
+    if (telc.isCaselessLetter(keyBuf, 'a')) {
+      this.attribute = (this.attribute % 3) + 1
+      return false
+    }
   }
 
   restoreSelection() {
@@ -2832,7 +2844,7 @@ class Menubar extends ListScrollForm {
 
   drawTo(writable) {
     writable.write(ansi.moveCursor(this.absTop, this.absLeft))
-    writable.write(ansi.setAttributes([ansi.C_BLUE, ansi.A_DIM, ansi.A_INVERT, ansi.C_WHITE + 10]))
+    writable.write(ansi.setAttributes([this.attribute, 30 + this.color, ansi.A_INVERT, ansi.C_WHITE + 10]))
     writable.write(' '.repeat(this.w))
     writable.write(ansi.resetAttributes())
   }