Improved design a bit

This commit is contained in:
Devine Lu Linvega 2017-03-09 23:29:48 -07:00
parent 7e7de89212
commit 2530538e21
6 changed files with 35 additions and 13 deletions

View File

@ -13,7 +13,7 @@ canvas:hover { cursor: none;}
#cursor { width:10px; height:10px; position:fixed;border:1px solid red; border-radius:10px; z-index:8000; pointer-events: none}
#terminal { position: fixed; bottom:0px; left:0px; background:#000; width:100vw; height: 120px;overflow: hidden;}
#terminal input { display: block; position:absolute; bottom:0px; width:100vw; padding:0px 5px; font-size:10px; line-height: 20px; background:none; z-index:900; color: #ff680a;}
#terminal input { display: block; position:absolute; bottom:0px; width:100vw; padding:0px 5px; font-size:10px; line-height: 20px; background:none; z-index:900; color:white;}
#terminal hint { background:#000; position:absolute; bottom:0px; line-height: 20px; padding:0px 5px; width:100vw; color:#777; font-size:10px; white-space: pre;}
#terminal hint .name { font-family: "input_mono_regular"; color:#999; }
#terminal logs { display: block;position: absolute;bottom:20px;width:100vw;color:white}

View File

@ -37,7 +37,7 @@ ronin.terminal.query("@ layer=Main");
ronin.terminal.query("- 0,0");
ronin.terminal.query("- 1,1");
ronin.terminal.query("- 2,2");
ronin.terminal.query("- #ff0000");
ronin.terminal.query("- #ff00ff");
ronin.terminal.query("~ Ready.");
ronin.terminal.input_element.focus();

View File

@ -13,6 +13,7 @@ function Keyboard()
}
ronin.cursor.update(event);
ronin.surface.update_widget();
ronin.terminal.update_hint();
}
this.listen_onkeyup = function(event)
@ -45,6 +46,7 @@ function Keyboard()
// Passive
ronin.terminal.passive(ronin.terminal.input_element.value);
ronin.surface.update_widget();
ronin.terminal.update_hint();
};
this.key_tab = function()

View File

@ -6,13 +6,6 @@ function Overlay(rune)
this.color = new Color("#ffffff");
this.install = function()
{
this.layer = new Layer("Overlay.Guide",this);
this.layer.element.setAttribute("style","z-index:9000");
ronin.surface.add_layer(this.layer);
}
this.passive = function(cmd)
{
this.draw(cmd.position(),cmd.rect());

View File

@ -126,8 +126,13 @@ function Surface(rune)
var keys = Object.keys(ronin.surface.layers);
var loc = keys.indexOf(this.active_layer.name);
s += "<span class='layer'>"+ronin.surface.active_layer.widget()+"("+(loc+1)+"/"+keys.length+")</span>";
if(keys.length > 1){
s += "<span class='layer'>"+ronin.surface.active_layer.widget()+"("+(loc+1)+"/"+keys.length+")</span>";
}
else{
s += "<span class='layer'>"+ronin.surface.active_layer.widget()+"</span>";
}
this.widget_element.innerHTML = s;
}

View File

@ -15,6 +15,8 @@ function Terminal(rune)
this.element.appendChild(this.logs_element);
this.hint_element.innerHTML = "_";
this.update_log();
}
this.active = function(cmd)
@ -92,9 +94,21 @@ function Terminal(rune)
//
this.logs = [];
this.log = function(log)
{
this.logs_element.appendChild(log.element);
this.logs.push(log);
}
this.update_log = function()
{
if(ronin.terminal.logs[0]){
ronin.terminal.logs_element.appendChild(ronin.terminal.logs[0].element);
ronin.terminal.logs.shift();
}
setTimeout(function(){ ronin.terminal.update_log(); }, 200);
}
// Hint
@ -109,15 +123,23 @@ function Terminal(rune)
if(content.indexOf(";") > -1){
var h = padding+" "+content.split(";").length+" commands";
}
else{
else if(ronin.module){
var h = padding+" <span class='name'>"+ronin.module.constructor.name+"</span> ";
for(param in ronin.module.parameters){
var name = new ronin.module.parameters[param]().constructor.name;
h += name+" ";
}
for(variable in ronin.module.variables){
h += variable+"="+ronin.module.variables[variable]+" ";
}
}
else{
var h = padding+" ";
}
this.hint_element.innerHTML = h;
ronin.terminal.input_element.setAttribute("style","color:"+ronin.brush.color.hex);
}