This commit is contained in:
Devine Lu Linvega 2017-04-21 10:08:28 -10:00
parent a2ec49f3aa
commit d9677f0fea
8 changed files with 38 additions and 21 deletions

View File

@ -3,7 +3,20 @@
Ronin is my web based drawing tool it's under constant development. Ronin is my web based drawing tool it's under constant development.
The repository comes with a script that fires Ronin from within Localhost. The repository comes with a script that fires Ronin from within Localhost.
Enjoy ## Example file
```
surface.resize 300x300
layer.fill #AAAAAA
magnet.grid 15x15 4,4
path:line_width 2
path.stroke M60,60 A1,1 0 0,0 240,60 A1,1 0 0,0 240,240
path.stroke M240,240 A1,1 0 0,0 60,240 A1,1 0 0,0 60,60
```
## Load a preset
Where `http://localhost:8022` will load the /presets/default.rin file, `http://localhost:8022/blank` will load /presets/blank.rin.
## TODOs ## TODOs
General General

View File

@ -32,7 +32,7 @@ body { margin:0px; padding:0px; overflow:hidden; font-family:"input_mono_medium"
#terminal #widget li.inactive { color:#fff; } #terminal #widget li.inactive { color:#fff; }
#terminal #widget li.managed { color:#777; } #terminal #widget li.managed { color:#777; }
#terminal hint { display: block;position: fixed;top: 100px;width: calc(40vw - 45px);height: calc(100vh - 130px);padding: 0px 15px;line-height: 20px;font-size: 12px;background: none;color: #999;border-left:1px solid #333;margin-left:15px;} #terminal hint { display: none;position: fixed;top: 100px;width: calc(40vw - 45px);height: calc(100vh - 130px);padding: 0px 15px;line-height: 20px;font-size: 12px;background: none;color: #999;border-left:1px solid #333;margin-left:15px;white-space: pre;}
#terminal hint line { display: inline; width:calc(100% - 30px); } #terminal hint line { display: inline; width:calc(100% - 30px); }
#terminal hint line .input { opacity:1; } #terminal hint line .input { opacity:1; }
#terminal hint line .status { position: absolute;right:30px; } #terminal hint line .status { position: absolute;right:30px; }

View File

@ -1,4 +1,4 @@
~ Blank Setup ~ Setup
frame.resize 400x400 frame.resize 400x400
layer.fill #A1A1A1 layer.fill #A1A1A1

View File

@ -1,4 +1,4 @@
~ Default ~ Setup
frame.resize 300x300 frame.resize 300x300
frame.select main frame.select main

View File

@ -1,6 +1,8 @@
frame.resize 240x360 ; ~ Setup
frame.select background ;
layer.fill #A1A1A1 ; frame.resize 240x360
brush:color #ff0000 ; layer.fill #A1A1A1
magnet.grid 15x15 4,4 ; magnet.grid 15x15 4,4
frame.select main ;
~ Stroke

View File

@ -31,6 +31,9 @@ starting_canvas.height = window.innerHeight - 300;
starting_canvas.width = parseInt(starting_canvas.width/40) * 40; starting_canvas.width = parseInt(starting_canvas.width/40) * 40;
starting_canvas.height = parseInt(starting_canvas.height/40) * 40; starting_canvas.height = parseInt(starting_canvas.height/40) * 40;
// ronin.terminal.load("default.rin");
ronin.terminal.load("blank.rin"); var target_file = window.location.hash ? window.location.hash : "default";
target_file = target_file.substr(1,target_file.length-1);
ronin.terminal.load(window.location.hash ? target_file+".rin" : "default.rin");
ronin.widget.update(); ronin.widget.update();

View File

@ -63,7 +63,7 @@ function Terminal(rune)
this.hint_element.innerHTML = ""; this.hint_element.innerHTML = "";
var queue = ronin.terminal.textarea.value.split("\n") var queue = ronin.terminal.textarea.value.split("\n")
for(id in queue){ for(id in queue){
this.hint_element.innerHTML += "<line><text class='input'>"+this.syntax_highlight(queue[id])+"</text><text class='status'>"+this.run_line(queue.length - id,queue[id])+"</text></line><br />"; this.hint_element.innerHTML += "<line><text class='input'>"+this.syntax_highlight(queue[id])+"</text><text class='status'>"+this.run_line(queue.length - id,queue[id])+"</text></line>\n";
} }
} }
@ -120,8 +120,6 @@ function Terminal(rune)
{ {
var line = line; var line = line;
console.log(line[0])
// Comment // Comment
if(line[0] == "~"){ line = "<span class='comment'>"+line+"</span>"; } if(line[0] == "~"){ line = "<span class='comment'>"+line+"</span>"; }
@ -177,8 +175,11 @@ function Terminal(rune)
} }
this.filename = "default.rin";
this.load = function readTextFile(name) this.load = function readTextFile(name)
{ {
this.filename = name;
var file = "presets/"+name+'?'+new Date().getTime(); var file = "presets/"+name+'?'+new Date().getTime();
var rawFile = new XMLHttpRequest(); var rawFile = new XMLHttpRequest();
rawFile.open("GET", file, false); rawFile.open("GET", file, false);
@ -194,6 +195,7 @@ function Terminal(rune)
} }
} }
rawFile.send(null); rawFile.send(null);
ronin.widget.update();
} }
this.cmd = function() this.cmd = function()

View File

@ -13,12 +13,9 @@ function Widget(rune)
this.update = function() this.update = function()
{ {
var s = ""; var s = "";
s += ronin.terminal.file_name+" ";
s += ronin.cursor.widget(); s += "Cursor: "+ronin.cursor.widget();
// for (var key in ronin.modules){
// s += ronin.modules[key].widget() ? "<span class='"+key+"'><name>"+key+"</name>"+ronin.modules[key].widget()+"</span> " : "";
// }
this.element.innerHTML = s; this.element.innerHTML = s;
} }