Small front-end improvements + made screen clearing apply cursor color to cleared area
This commit is contained in:
@@ -700,8 +700,6 @@ input[type="number"], input[type="password"], input[type="text"], textarea, sele
|
||||
@media screen and (max-width: 544px) {
|
||||
.page-term #screen span:hover {
|
||||
outline: 0 none; } }
|
||||
.page-term #screen .fg8, .page-term #screen .fg9, .page-term #screen .fg10, .page-term #screen .fg11, .page-term #screen .fg12, .page-term #screen .fg13, .page-term #screen .fg14, .page-term #screen .fg15 {
|
||||
font-weight: bold; }
|
||||
.page-term #buttons {
|
||||
margin-top: 10px;
|
||||
white-space: nowrap; }
|
||||
@@ -750,7 +748,7 @@ input[type="number"], input[type="password"], input[type="text"], textarea, sele
|
||||
.ansiref.w100 {
|
||||
width: 100%; }
|
||||
.ansiref.w100 td:nth-child(1) {
|
||||
width: 6em; }
|
||||
width: 7em; }
|
||||
.ansiref.w100 td:nth-child(2) {
|
||||
width: 8em; }
|
||||
|
||||
@@ -850,6 +848,12 @@ input[type="number"], input[type="password"], input[type="text"], textarea, sele
|
||||
.bg15 {
|
||||
background-color: #EEEEEC; }
|
||||
|
||||
.fg8, .fg9, .fg10, .fg11, .fg12, .fg13, .fg14, .fg15 {
|
||||
font-weight: bold; }
|
||||
|
||||
.nb {
|
||||
font-weight: normal !important; }
|
||||
|
||||
@media screen and (min-width: 545px) {
|
||||
.mq-phone {
|
||||
display: none; } }
|
||||
|
||||
+9
-9
@@ -44,7 +44,7 @@
|
||||
<b>Foreground</b>
|
||||
|
||||
<div class="colorprev">
|
||||
<span class="fg0" style="background:#333">30</span>
|
||||
<span class="bg7 fg0">30</span>
|
||||
<span class="bg0 fg1">31</span>
|
||||
<span class="bg0 fg2">32</span>
|
||||
<span class="bg0 fg3">33</span>
|
||||
@@ -55,7 +55,7 @@
|
||||
</div>
|
||||
|
||||
<div class="colorprev">
|
||||
<span class="bg0 fg8">90</span>
|
||||
<span class="bg7 fg8">90</span>
|
||||
<span class="bg0 fg9">91</span>
|
||||
<span class="bg0 fg10">92</span>
|
||||
<span class="bg0 fg11">93</span>
|
||||
@@ -68,18 +68,18 @@
|
||||
<b>Background</b>
|
||||
|
||||
<div class="colorprev">
|
||||
<span class="bg0 fg15">40</span>
|
||||
<span class="bg1 fg15">41</span>
|
||||
<span class="bg2 fg15">42</span>
|
||||
<span class="bg0 fg15 nb">40</span>
|
||||
<span class="bg1 fg15 nb">41</span>
|
||||
<span class="bg2 fg15 nb">42</span>
|
||||
<span class="bg3 fg0">43</span>
|
||||
<span class="bg4 fg15">44</span>
|
||||
<span class="bg5 fg15">45</span>
|
||||
<span class="bg6 fg15">46</span>
|
||||
<span class="bg4 fg15 nb">44</span>
|
||||
<span class="bg5 fg15 nb">45</span>
|
||||
<span class="bg6 fg15 nb">46</span>
|
||||
<span class="bg7 fg0">47</span>
|
||||
</div>
|
||||
|
||||
<div class="colorprev">
|
||||
<span class="bg8 fg15">100</span>
|
||||
<span class="bg8 fg15 nb">100</span>
|
||||
<span class="bg9 fg0">101</span>
|
||||
<span class="bg10 fg0">102</span>
|
||||
<span class="bg11 fg0">103</span>
|
||||
|
||||
+1
-23
@@ -896,19 +896,6 @@ $._loader = function(vis) {
|
||||
var screen = [];
|
||||
var blinkIval;
|
||||
|
||||
/** Colors table */
|
||||
var CLR = [// dark gray #2E3436
|
||||
// 0 black, 1 red, 2 green, 3 yellow
|
||||
// 4 blue, 5 mag, 6 cyan, 7 white
|
||||
'#111213','#CC0000','#4E9A06','#C4A000',
|
||||
'#3465A4','#75507B','#06989A','#D3D7CF',
|
||||
// BRIGHT
|
||||
// 8 black, 9 red, 10 green, 11 yellow
|
||||
// 12 blue, 13 mag, 14 cyan, 15 white
|
||||
'#555753','#EF2929','#8AE234','#FCE94F',
|
||||
'#729FCF','#AD7FA8','#34E2E2','#EEEEEC'
|
||||
];
|
||||
|
||||
/** Clear screen */
|
||||
function cls() {
|
||||
screen.forEach(function(cell, i) {
|
||||
@@ -958,9 +945,7 @@ $._loader = function(vis) {
|
||||
bg = inv ? cell.fg : cell.bg;
|
||||
// Update
|
||||
e.innerText = (cell.t+' ')[0];
|
||||
e.style.color = colorHex(fg);
|
||||
e.style.backgroundColor = colorHex(bg);
|
||||
e.style.fontWeight = fg > 7 ? 'bold' : 'normal';
|
||||
e.className = 'fg'+fg+' bg'+bg;
|
||||
}
|
||||
|
||||
/** Show entire screen */
|
||||
@@ -1028,13 +1013,6 @@ $._loader = function(vis) {
|
||||
blitAll();
|
||||
}
|
||||
|
||||
/** Parse color */
|
||||
function colorHex(c) {
|
||||
c = parseInt(c);
|
||||
if (c < 0 || c > 15) c = 0;
|
||||
return CLR[c];
|
||||
}
|
||||
|
||||
/** Init the terminal */
|
||||
function init(obj) {
|
||||
W = obj.w;
|
||||
|
||||
+8
-27
@@ -8,20 +8,8 @@
|
||||
var screen = [];
|
||||
var blinkIval;
|
||||
|
||||
/** Colors table */
|
||||
var CLR = [// dark gray #2E3436
|
||||
// 0 black, 1 red, 2 green, 3 yellow
|
||||
// 4 blue, 5 mag, 6 cyan, 7 white
|
||||
'#111213','#CC0000','#4E9A06','#C4A000',
|
||||
'#3465A4','#75507B','#06989A','#D3D7CF',
|
||||
// BRIGHT
|
||||
// 8 black, 9 red, 10 green, 11 yellow
|
||||
// 12 blue, 13 mag, 14 cyan, 15 white
|
||||
'#555753','#EF2929','#8AE234','#FCE94F',
|
||||
'#729FCF','#AD7FA8','#34E2E2','#EEEEEC'
|
||||
];
|
||||
|
||||
/** Clear screen */
|
||||
/*
|
||||
/!** Clear screen *!/
|
||||
function cls() {
|
||||
screen.forEach(function(cell, i) {
|
||||
cell.t = ' ';
|
||||
@@ -30,6 +18,7 @@
|
||||
blit(cell);
|
||||
});
|
||||
}
|
||||
*/
|
||||
|
||||
/** Set text and color at XY */
|
||||
function cellAt(y, x) {
|
||||
@@ -41,14 +30,15 @@
|
||||
return cellAt(cursor.y, cursor.x);
|
||||
}
|
||||
|
||||
/** Enable or disable cursor visibility */
|
||||
/*
|
||||
/!** Enable or disable cursor visibility *!/
|
||||
function cursorEnable(enable) {
|
||||
cursor.hidden = !enable;
|
||||
cursor.a &= enable;
|
||||
blit(cursorCell(), cursor.a);
|
||||
}
|
||||
|
||||
/** Safely move cursor */
|
||||
/!** Safely move cursor *!/
|
||||
function cursorSet(y, x) {
|
||||
// Hide and prevent from showing up during the move
|
||||
cursor.suppress = true;
|
||||
@@ -61,6 +51,7 @@
|
||||
cursor.suppress = false;
|
||||
blit(cursorCell(), cursor.a);
|
||||
}
|
||||
*/
|
||||
|
||||
/** Update cell on display. inv = invert (for cursor) */
|
||||
function blit(cell, inv) {
|
||||
@@ -70,10 +61,7 @@
|
||||
bg = inv ? cell.fg : cell.bg;
|
||||
// Update
|
||||
e.innerText = (cell.t+' ')[0];
|
||||
e.classList.className = 'fg'+fg+' bg'+bg;
|
||||
// e.style.color = colorHex(fg);
|
||||
// e.style.backgroundColor = colorHex(bg);
|
||||
// e.style.fontWeight = fg > 7 ? 'bold' : 'normal';
|
||||
e.className = 'fg'+fg+' bg'+bg;
|
||||
}
|
||||
|
||||
/** Show entire screen */
|
||||
@@ -141,13 +129,6 @@
|
||||
blitAll();
|
||||
}
|
||||
|
||||
/** Parse color */
|
||||
function colorHex(c) {
|
||||
c = parseInt(c);
|
||||
if (c < 0 || c > 15) c = 0;
|
||||
return CLR[c];
|
||||
}
|
||||
|
||||
/** Init the terminal */
|
||||
function init(obj) {
|
||||
W = obj.w;
|
||||
|
||||
@@ -14,3 +14,11 @@ $term-colors:
|
||||
.fg#{$i - 1} { color: $c; }
|
||||
.bg#{$i - 1} { background-color: $c; }
|
||||
}
|
||||
|
||||
.fg8, .fg9, .fg10, .fg11, .fg12, .fg13, .fg14, .fg15 {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.nb {
|
||||
font-weight: normal !important;
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
width: 100%;
|
||||
|
||||
td:nth-child(1) {
|
||||
width: 6em;
|
||||
width: 7em;
|
||||
}
|
||||
|
||||
td:nth-child(2) {
|
||||
|
||||
@@ -26,10 +26,6 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.fg8, .fg9, .fg10, .fg11, .fg12, .fg13, .fg14, .fg15 {
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
#buttons {
|
||||
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
xterm -e "php -S localhost:2000"
|
||||
@@ -10,6 +10,6 @@ $f = str_replace('%screenData%',
|
||||
"screen": "70 t259"
|
||||
}', $f);
|
||||
|
||||
$f = str_replace('window.location.host', '"192.168.0.15"', $f);
|
||||
$f = str_replace('window.location.host', '"192.168.0.18"', $f);
|
||||
|
||||
echo $f;
|
||||
|
||||
Reference in New Issue
Block a user