mirror of
https://github.com/lalbornoz/roar.git
synced 2024-11-22 07:16:38 +00:00
assets/*, index.html: remove {trailing,leading} SP.
This commit is contained in:
parent
06fa555306
commit
baacc19a67
@ -86,7 +86,7 @@
|
|||||||
.c64 .fn{color:rgb(207,138,101)}
|
.c64 .fn{color:rgb(207,138,101)}
|
||||||
.c64 .fo{color:rgb(69,69,69)}
|
.c64 .fo{color:rgb(69,69,69)}
|
||||||
.c64 .fp{color:rgb(170,170,170)}
|
.c64 .fp{color:rgb(170,170,170)}
|
||||||
|
|
||||||
.c64 .ba{background-color:rgb(255,255,255)}
|
.c64 .ba{background-color:rgb(255,255,255)}
|
||||||
.c64 .bb{background-color:rgb(0,0,0)}
|
.c64 .bb{background-color:rgb(0,0,0)}
|
||||||
.c64 .bc{background-color:rgb(69,32,170)}
|
.c64 .bc{background-color:rgb(69,32,170)}
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
.h6 { font-size: 10.72px }
|
.h6 { font-size: 10.72px }
|
||||||
|
|
||||||
[class^=h] {
|
[class^=h] {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
display:block;
|
display:block;
|
||||||
margin-top:8px;
|
margin-top:8px;
|
||||||
margin-bottom:8px;
|
margin-bottom:8px;
|
||||||
@ -39,10 +39,10 @@ color:#fff;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
.code {
|
.code {
|
||||||
white-space:pre-wrap;
|
white-space:pre-wrap;
|
||||||
background: rgba(128,0,128,.3);
|
background: rgba(128,0,128,.3);
|
||||||
color: rgb(255,0,255);
|
color: rgb(255,0,255);
|
||||||
font-size: 16pt;
|
font-size: 16pt;
|
||||||
font-family: Consolas, Menlo, Courier, monospace;
|
font-family: Consolas, Menlo, Courier, monospace;
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,7 @@ a:hover { text-decoration: underline }
|
|||||||
background-size: 8px 8px;
|
background-size: 8px 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (-webkit-min-device-pixel-ratio: 2) {
|
@media (-webkit-min-device-pixel-ratio: 2) {
|
||||||
.transparent {
|
.transparent {
|
||||||
background-size: 4px 4px;
|
background-size: 4px 4px;
|
||||||
}
|
}
|
||||||
@ -99,7 +99,7 @@ body.grid .tool { border: 1px solid #444; }
|
|||||||
.tool.focused, .ed.focused { color: white; text-decoration: underline; }
|
.tool.focused, .ed.focused { color: white; text-decoration: underline; }
|
||||||
.focused { box-shadow: inset 1px 0 2px white, inset -1px 0 2px white, inset 0 1px 2px white, inset 0 -1px 2px white; }
|
.focused { box-shadow: inset 1px 0 2px white, inset -1px 0 2px white, inset 0 1px 2px white, inset 0 -1px 2px white; }
|
||||||
.faba.focused, .fbba.focused, .fcba.focused, .fdba.focused, .feba.focused, .ffba.focused, .fgba.focused, .fhba.focused,
|
.faba.focused, .fbba.focused, .fcba.focused, .fdba.focused, .feba.focused, .ffba.focused, .fgba.focused, .fhba.focused,
|
||||||
.fiba.focused, .fjba.focused, .fkba.focused, .flba.focused, .fmba.focused, .fnba.focused, .foba.focused, .fpba.focused
|
.fiba.focused, .fjba.focused, .fkba.focused, .flba.focused, .fmba.focused, .fnba.focused, .foba.focused, .fpba.focused
|
||||||
{ box-shadow: inset 1px 0 2px #888, inset -1px 0 2px #888, inset 0 1px 2px #888, inset 0 -1px 2px #888; }
|
{ box-shadow: inset 1px 0 2px #888, inset -1px 0 2px #888, inset 0 1px 2px #888, inset 0 -1px 2px #888; }
|
||||||
body.loading { opacity: 0; }
|
body.loading { opacity: 0; }
|
||||||
body { transition: 0.1s linear; }
|
body { transition: 0.1s linear; }
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
__________________________________________________________________________
|
__________________________________________________________________________
|
||||||
____ ____ _____ ____ ___ ___ ____
|
____ ____ _____ ____ ___ ___ ____
|
||||||
/_____ _____/ / ___ \ / ____/ / ____/ /_____ _____/
|
/_____ _____/ / ___ \ / ____/ / ____/ /_____ _____/
|
||||||
/ / / / \ \ / / / / / /
|
/ / / / \ \ / / / / / /
|
||||||
/ / / /____/ / \ \__ \ \__ / /
|
/ / / /____/ / \ \__ \ \__ / /
|
||||||
/ / / ___ __/ \__ \ \__ \ / /
|
/ / / ___ __/ \__ \ \__ \ / /
|
||||||
/ / / / \ \ \ \ \ \ / /
|
/ / / / \ \ \ \ \ \ / /
|
||||||
_____/ /_____ / / \ \ ____/ / ____/ /____/ /_____
|
_____/ /_____ / / \ \ ____/ / ____/ /____/ /_____
|
||||||
___/ /__/ /_______\ \__/ /___/ // /____
|
___/ /__/ /_______\ \__/ /___/ // /____
|
||||||
__________________________________________________________________________
|
__________________________________________________________________________
|
||||||
|
|
||||||
|
|
||||||
OPTIMIZE YOUR TERMINAL FOR COLOR CODES ON OSX
|
OPTIMIZE YOUR TERMINAL FOR COLOR CODES ON OSX
|
||||||
|
@ -6003,4 +6003,4 @@
|
|||||||
<glyph unicode="" horiz-adv-x="3072" d="M256 1152h2688v-1152h-2688v1152zM1536 768h128v-128h-128v128zM1536 512h128v-128h-128v128zM896 384h-128v384h128v-384zM2432 384h-128v128h-256v-128h128v-128h384v128h128v512h-256v-512zM512 384h128v-128h384v128h128v384h-128v128h-384v-128h-128v-384zM1280 256 h512v128h128v128h-128v128h128v128h-128v128h-512v-640z" />
|
<glyph unicode="" horiz-adv-x="3072" d="M256 1152h2688v-1152h-2688v1152zM1536 768h128v-128h-128v128zM1536 512h128v-128h-128v128zM896 384h-128v384h128v-384zM2432 384h-128v128h-256v-128h128v-128h384v128h128v512h-256v-512zM512 384h128v-128h384v128h128v384h-128v128h-384v-128h-128v-384zM1280 256 h512v128h128v128h-128v128h128v128h-128v128h-512v-640z" />
|
||||||
<glyph unicode="�" d="M896 1024h-128v128h-512v-128h-128v-256h256v256h256v-256h-128v-128h-128v-256h256v256h128v128h128v256zM640 256h-256v-256h256v256zM0 1280h1024v-1408h-1024v1408z" />
|
<glyph unicode="�" d="M896 1024h-128v128h-512v-128h-128v-256h256v256h256v-256h-128v-128h-128v-256h256v256h128v128h128v256zM640 256h-256v-256h256v256zM0 1280h1024v-1408h-1024v1408z" />
|
||||||
</font>
|
</font>
|
||||||
</defs></svg>
|
</defs></svg>
|
||||||
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 1.1 MiB |
Binary file not shown.
@ -10,7 +10,7 @@ var mirror_x = false
|
|||||||
var mirror_y = false
|
var mirror_y = false
|
||||||
var focused
|
var focused
|
||||||
|
|
||||||
var canvas, tools, palette, controls, brush, mode
|
var canvas, tools, palette, controls, brush, mode
|
||||||
var current_tool, current_filetool, current_canvas
|
var current_tool, current_filetool, current_canvas
|
||||||
var mouse = { x: 0, y: 0 }
|
var mouse = { x: 0, y: 0 }
|
||||||
|
|
||||||
@ -24,7 +24,7 @@ function build () {
|
|||||||
palette.append(palette_rapper)
|
palette.append(palette_rapper)
|
||||||
letters.append(letters_rapper)
|
letters.append(letters_rapper)
|
||||||
letters.repaint("Basic Latin")
|
letters.repaint("Basic Latin")
|
||||||
|
|
||||||
controls.circle.focus()
|
controls.circle.focus()
|
||||||
|
|
||||||
brush.bg = colors.red
|
brush.bg = colors.red
|
||||||
@ -42,10 +42,10 @@ function bind () {
|
|||||||
controls.bind()
|
controls.bind()
|
||||||
keys.bind()
|
keys.bind()
|
||||||
clipboard.bind()
|
clipboard.bind()
|
||||||
|
|
||||||
window.addEventListener('mouseup', function(e){
|
window.addEventListener('mouseup', function(e){
|
||||||
dragging = erasing = false
|
dragging = erasing = false
|
||||||
|
|
||||||
var ae = document.activeElement
|
var ae = document.activeElement
|
||||||
|
|
||||||
if (ae !== import_textarea) {
|
if (ae !== import_textarea) {
|
||||||
@ -65,16 +65,16 @@ function bind () {
|
|||||||
}
|
}
|
||||||
dragging = false
|
dragging = false
|
||||||
})
|
})
|
||||||
|
|
||||||
window.addEventListener('mousedown', function(e){
|
window.addEventListener('mousedown', function(e){
|
||||||
// cursor_input.focus()
|
// cursor_input.focus()
|
||||||
})
|
})
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', function(){
|
document.addEventListener('DOMContentLoaded', function(){
|
||||||
cursor_input.focus()
|
cursor_input.focus()
|
||||||
document.body.classList.remove('loading')
|
document.body.classList.remove('loading')
|
||||||
})
|
})
|
||||||
|
|
||||||
window.onbeforeunload = function() {
|
window.onbeforeunload = function() {
|
||||||
// if (changed && !in_iframe()) return "You have edited this drawing."
|
// if (changed && !in_iframe()) return "You have edited this drawing."
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ var clipboard = (function () {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
import_colorcode: function (data, no_undo) {
|
import_colorcode: function (data, no_undo) {
|
||||||
if (data && data.preventDefault) {
|
if (data && data.preventDefault) {
|
||||||
data = import_textarea.value
|
data = import_textarea.value
|
||||||
@ -72,7 +72,7 @@ var clipboard = (function () {
|
|||||||
else {
|
else {
|
||||||
data = data || import_textarea.value
|
data = data || import_textarea.value
|
||||||
}
|
}
|
||||||
|
|
||||||
var irssi_style_regex = /^\s*\/exec -out printf ("%b" )?"/;
|
var irssi_style_regex = /^\s*\/exec -out printf ("%b" )?"/;
|
||||||
|
|
||||||
// turn irssi style into mirc style
|
// turn irssi style into mirc style
|
||||||
@ -173,9 +173,9 @@ var clipboard = (function () {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
current_filetool && current_filetool.blur()
|
current_filetool && current_filetool.blur()
|
||||||
},
|
},
|
||||||
|
|
||||||
export_data: function () {
|
export_data: function () {
|
||||||
var output
|
var output
|
||||||
// switch (clipboard.format) {
|
// switch (clipboard.format) {
|
||||||
@ -204,9 +204,9 @@ var clipboard = (function () {
|
|||||||
},
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return exports
|
return exports
|
||||||
|
|
||||||
})()
|
})()
|
||||||
|
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ var blit = (function(){
|
|||||||
blit.circle = function(A, lex){
|
blit.circle = function(A, lex){
|
||||||
var hw = brush.w/2, hh = brush.h/2
|
var hw = brush.w/2, hh = brush.h/2
|
||||||
var ratio, distance
|
var ratio, distance
|
||||||
|
|
||||||
if (brush.w === brush.h){
|
if (brush.w === brush.h){
|
||||||
distance = distance_square
|
distance = distance_square
|
||||||
ratio = hw / hh * (brush.w === 3 || brush.w === 5 ? 1.2 : 1.05)
|
ratio = hw / hh * (brush.w === 3 || brush.w === 5 ? 1.2 : 1.05)
|
||||||
@ -108,7 +108,7 @@ var blit = (function(){
|
|||||||
var draw = (function(){
|
var draw = (function(){
|
||||||
|
|
||||||
var last_point = [0,0]
|
var last_point = [0,0]
|
||||||
|
|
||||||
function down (e, lex, point) {
|
function down (e, lex, point) {
|
||||||
var w = canvas.w, h = canvas.h
|
var w = canvas.w, h = canvas.h
|
||||||
erasing = (e.which == "3" || e.ctrlKey)
|
erasing = (e.which == "3" || e.ctrlKey)
|
||||||
@ -140,12 +140,12 @@ var draw = (function(){
|
|||||||
last_point[0] = point[0]
|
last_point[0] = point[0]
|
||||||
last_point[1] = point[1]
|
last_point[1] = point[1]
|
||||||
}
|
}
|
||||||
|
|
||||||
function set_last_point (e, point) {
|
function set_last_point (e, point) {
|
||||||
last_point[0] = point[0]
|
last_point[0] = point[0]
|
||||||
last_point[1] = point[1]
|
last_point[1] = point[1]
|
||||||
}
|
}
|
||||||
|
|
||||||
function move (e, lex, point) {
|
function move (e, lex, point) {
|
||||||
var w = canvas.w, h = canvas.h
|
var w = canvas.w, h = canvas.h
|
||||||
line(lex, last_point, point, erasing)
|
line(lex, last_point, point, erasing)
|
||||||
@ -162,7 +162,7 @@ var draw = (function(){
|
|||||||
last_point[0] = point[0]
|
last_point[0] = point[0]
|
||||||
last_point[1] = point[1]
|
last_point[1] = point[1]
|
||||||
}
|
}
|
||||||
|
|
||||||
function move_toroidal (e, lex, point) {
|
function move_toroidal (e, lex, point) {
|
||||||
var w = canvas.w, h = canvas.h
|
var w = canvas.w, h = canvas.h
|
||||||
var src_x_quantile = quantile( last_point[0], w )
|
var src_x_quantile = quantile( last_point[0], w )
|
||||||
@ -234,7 +234,7 @@ var draw = (function(){
|
|||||||
last_point[1] = point[1]
|
last_point[1] = point[1]
|
||||||
// y = point.y
|
// y = point.y
|
||||||
}
|
}
|
||||||
|
|
||||||
function point (lex, x, y, erasing) {
|
function point (lex, x, y, erasing) {
|
||||||
stamp (canvas, brush, x, y, erasing)
|
stamp (canvas, brush, x, y, erasing)
|
||||||
}
|
}
|
||||||
@ -268,7 +268,7 @@ var draw = (function(){
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function fill (lex, x, y) {
|
function fill (lex, x, y) {
|
||||||
var q = [ [x,y] ]
|
var q = [ [x,y] ]
|
||||||
var aa = canvas.aa
|
var aa = canvas.aa
|
||||||
|
@ -87,7 +87,7 @@ Matrix.prototype.focus = function(x, y){
|
|||||||
y = mod(y, this.h)
|
y = mod(y, this.h)
|
||||||
this.focus_x = x
|
this.focus_x = x
|
||||||
this.focus_y = y
|
this.focus_y = y
|
||||||
|
|
||||||
//focused_input = this
|
//focused_input = this
|
||||||
this.aa[y][x].focus()
|
this.aa[y][x].focus()
|
||||||
}
|
}
|
||||||
@ -188,7 +188,7 @@ Matrix.prototype.resize = function(w,h){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (w < old_w) {
|
if (w < old_w) {
|
||||||
this.aa.forEach(function(row, y){
|
this.aa.forEach(function(row, y){
|
||||||
while (row.length > w) {
|
while (row.length > w) {
|
||||||
@ -206,7 +206,7 @@ Matrix.prototype.resize = function(w,h){
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
this.w = w
|
this.w = w
|
||||||
this.h = h
|
this.h = h
|
||||||
this.bind && this.bind()
|
this.bind && this.bind()
|
||||||
@ -233,7 +233,7 @@ Matrix.prototype.resize_rapper = function(){
|
|||||||
else {
|
else {
|
||||||
this.rapper.parentNode.classList.remove("rotated")
|
this.rapper.parentNode.classList.remove("rotated")
|
||||||
this.rapper.parentNode.style.height = ""
|
this.rapper.parentNode.style.height = ""
|
||||||
this.rapper.style.width =
|
this.rapper.style.width =
|
||||||
this.rapper.parentNode.style.width = (width) + "px"
|
this.rapper.parentNode.style.width = (width) + "px"
|
||||||
this.rapper.style.top = ""
|
this.rapper.style.top = ""
|
||||||
// canvas_rapper.style.left = "auto"
|
// canvas_rapper.style.left = "auto"
|
||||||
@ -256,7 +256,7 @@ Matrix.prototype.ansi = function (opts) {
|
|||||||
row.forEach(function(lex, x) {
|
row.forEach(function(lex, x) {
|
||||||
if (lex.eqColor(last)) {
|
if (lex.eqColor(last)) {
|
||||||
line += lex.sanitize()
|
line += lex.sanitize()
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
line += lex.ansi()
|
line += lex.ansi()
|
||||||
last = lex
|
last = lex
|
||||||
@ -275,7 +275,7 @@ Matrix.prototype.mirc = function (opts) {
|
|||||||
var bg_ = -1, fg_ = 15
|
var bg_ = -1, fg_ = 15
|
||||||
if (lex.eqColor(last)) {
|
if (lex.eqColor(last)) {
|
||||||
line += lex.sanitize()
|
line += lex.sanitize()
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
[bg_, fg_, line_] = lex.mirc(bg_, fg_)
|
[bg_, fg_, line_] = lex.mirc(bg_, fg_)
|
||||||
line += line_; last = lex;
|
line += line_; last = lex;
|
||||||
@ -286,9 +286,9 @@ Matrix.prototype.mirc = function (opts) {
|
|||||||
}
|
}
|
||||||
return line
|
return line
|
||||||
})
|
})
|
||||||
|
|
||||||
var txt = lines.filter(function(line){ return line.length > 0 }).join('\n')
|
var txt = lines.filter(function(line){ return line.length > 0 }).join('\n')
|
||||||
|
|
||||||
if (cutoff) {
|
if (cutoff) {
|
||||||
txt = new String(txt)
|
txt = new String(txt)
|
||||||
txt.cutoff = true
|
txt.cutoff = true
|
||||||
@ -297,7 +297,7 @@ Matrix.prototype.mirc = function (opts) {
|
|||||||
}
|
}
|
||||||
Matrix.prototype.irssi = function(opts){
|
Matrix.prototype.irssi = function(opts){
|
||||||
var mirc = this.mirc(opts)
|
var mirc = this.mirc(opts)
|
||||||
var txt = mirc
|
var txt = mirc
|
||||||
// .replace(/\%/g, '%%')
|
// .replace(/\%/g, '%%')
|
||||||
.replace(/\\/g, '\\x5C')
|
.replace(/\\/g, '\\x5C')
|
||||||
.replace(/\"/g, '\\\"')
|
.replace(/\"/g, '\\\"')
|
||||||
@ -310,7 +310,7 @@ Matrix.prototype.irssi = function(opts){
|
|||||||
.replace(/\n/g, '\\n')
|
.replace(/\n/g, '\\n')
|
||||||
.replace(/\x02/g, '\\x02')
|
.replace(/\x02/g, '\\x02')
|
||||||
.replace(/\x03/g, '\\x03')
|
.replace(/\x03/g, '\\x03')
|
||||||
|
|
||||||
txt = unicode.escapeToEscapedBytes(txt)
|
txt = unicode.escapeToEscapedBytes(txt)
|
||||||
txt = '/exec -out printf "%b" "' + txt + '"\n'
|
txt = '/exec -out printf "%b" "' + txt + '"\n'
|
||||||
if (mirc.cutoff){
|
if (mirc.cutoff){
|
||||||
@ -388,8 +388,8 @@ var save_size = function(w, h, state){
|
|||||||
}
|
}
|
||||||
// the reason for stringifying the x y coords is so that each
|
// the reason for stringifying the x y coords is so that each
|
||||||
// coordinate is saved only once in an undo state.
|
// coordinate is saved only once in an undo state.
|
||||||
// otherwise there would be problems with, eg, a brush stroke
|
// otherwise there would be problems with, eg, a brush stroke
|
||||||
// that passed over the same grid cell twice.
|
// that passed over the same grid cell twice.
|
||||||
var save_lex = function(x, y, lex, state){
|
var save_lex = function(x, y, lex, state){
|
||||||
// var start = Date.now()
|
// var start = Date.now()
|
||||||
state = state || current_undo
|
state = state || current_undo
|
||||||
@ -509,7 +509,7 @@ var undo = function(){
|
|||||||
if (!state) return;
|
if (!state) return;
|
||||||
|
|
||||||
restore_state(state)
|
restore_state(state)
|
||||||
|
|
||||||
// now take the applied undo state and store it on the redo state
|
// now take the applied undo state and store it on the redo state
|
||||||
// and push the redo state to the redo stack
|
// and push the redo state to the redo stack
|
||||||
state.redo.undo = state
|
state.redo.undo = state
|
||||||
@ -522,7 +522,7 @@ var undo = function(){
|
|||||||
var redo = function(){
|
var redo = function(){
|
||||||
var state = stack.redo.pop();
|
var state = stack.redo.pop();
|
||||||
if (!state) return;
|
if (!state) return;
|
||||||
|
|
||||||
restore_state(state)
|
restore_state(state)
|
||||||
|
|
||||||
state.undo.redo = state
|
state.undo.redo = state
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
var brush = (function(){
|
var brush = (function(){
|
||||||
|
|
||||||
var brush = new Matrix (5, 5, function(x,y){
|
var brush = new Matrix (5, 5, function(x,y){
|
||||||
var lex = new Lex (x,y)
|
var lex = new Lex (x,y)
|
||||||
lex.build()
|
lex.build()
|
||||||
@ -7,9 +7,9 @@ var brush = (function(){
|
|||||||
})
|
})
|
||||||
|
|
||||||
brush.modified = false
|
brush.modified = false
|
||||||
|
|
||||||
brush.mask = blit.circle
|
brush.mask = blit.circle
|
||||||
|
|
||||||
brush.generate = function(){
|
brush.generate = function(){
|
||||||
brush.fill(brush)
|
brush.fill(brush)
|
||||||
brush.mask(brush)
|
brush.mask(brush)
|
||||||
@ -25,7 +25,7 @@ var brush = (function(){
|
|||||||
|
|
||||||
if (lex.bound) return
|
if (lex.bound) return
|
||||||
lex.bound = true
|
lex.bound = true
|
||||||
|
|
||||||
var point = [x,y]
|
var point = [x,y]
|
||||||
lex.span.addEventListener('contextmenu', function(e){
|
lex.span.addEventListener('contextmenu', function(e){
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
@ -83,7 +83,7 @@ var brush = (function(){
|
|||||||
brush.contract = function(i){
|
brush.contract = function(i){
|
||||||
brush.size_add(-i, -i)
|
brush.size_add(-i, -i)
|
||||||
}
|
}
|
||||||
|
|
||||||
brush.load = function(lex){
|
brush.load = function(lex){
|
||||||
brush.char = lex.char
|
brush.char = lex.char
|
||||||
brush.fg = lex.fg
|
brush.fg = lex.fg
|
||||||
@ -98,11 +98,11 @@ var brush = (function(){
|
|||||||
brush.fg = 0
|
brush.fg = 0
|
||||||
brush.bg = 1
|
brush.bg = 1
|
||||||
brush.opacity = 1
|
brush.opacity = 1
|
||||||
|
|
||||||
brush.draw_fg = true
|
brush.draw_fg = true
|
||||||
brush.draw_bg = true
|
brush.draw_bg = true
|
||||||
brush.draw_char = true
|
brush.draw_char = true
|
||||||
|
|
||||||
return brush
|
return brush
|
||||||
|
|
||||||
})()
|
})()
|
||||||
@ -110,7 +110,7 @@ var brush = (function(){
|
|||||||
var custom = (function(){
|
var custom = (function(){
|
||||||
|
|
||||||
var exports = {}
|
var exports = {}
|
||||||
|
|
||||||
exports.clone = function (){
|
exports.clone = function (){
|
||||||
var new_brush = brush.clone()
|
var new_brush = brush.clone()
|
||||||
var rapper = document.createElement("div")
|
var rapper = document.createElement("div")
|
||||||
@ -128,11 +128,11 @@ var custom = (function(){
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.load = function(new_brush){
|
exports.load = function(new_brush){
|
||||||
brush.assign( new_brush )
|
brush.assign( new_brush )
|
||||||
}
|
}
|
||||||
|
|
||||||
return exports
|
return exports
|
||||||
|
|
||||||
})()
|
})()
|
||||||
|
@ -85,7 +85,7 @@ var canvas = current_canvas = (function(){
|
|||||||
if (!no_undo){
|
if (!no_undo){
|
||||||
undo.new()
|
undo.new()
|
||||||
undo.save_resize(w, h, old_w, old_h)
|
undo.save_resize(w, h, old_w, old_h)
|
||||||
}
|
}
|
||||||
|
|
||||||
canvas.__proto__.resize.call(canvas, w, h)
|
canvas.__proto__.resize.call(canvas, w, h)
|
||||||
controls.canvas_w.char = "" + w
|
controls.canvas_w.char = "" + w
|
||||||
|
26
assets/js/ui/controls.js
vendored
26
assets/js/ui/controls.js
vendored
@ -31,7 +31,7 @@ var controls = (function(){
|
|||||||
controls.circle.done = function(){
|
controls.circle.done = function(){
|
||||||
drawing = false
|
drawing = false
|
||||||
}
|
}
|
||||||
|
|
||||||
controls.square = new Tool (square_el)
|
controls.square = new Tool (square_el)
|
||||||
controls.square.use = function(){
|
controls.square.use = function(){
|
||||||
brush.mask = blit.square
|
brush.mask = blit.square
|
||||||
@ -42,7 +42,7 @@ var controls = (function(){
|
|||||||
controls.square.done = function(){
|
controls.square.done = function(){
|
||||||
drawing = false
|
drawing = false
|
||||||
}
|
}
|
||||||
|
|
||||||
controls.text = new Tool (text_el)
|
controls.text = new Tool (text_el)
|
||||||
controls.text.use = function(){
|
controls.text.use = function(){
|
||||||
current_filetool && current_filetool.blur()
|
current_filetool && current_filetool.blur()
|
||||||
@ -97,7 +97,7 @@ var controls = (function(){
|
|||||||
filling = false
|
filling = false
|
||||||
document.body.classList.remove("bucket")
|
document.body.classList.remove("bucket")
|
||||||
}
|
}
|
||||||
|
|
||||||
controls.undo = new BlurredTool (undo_el)
|
controls.undo = new BlurredTool (undo_el)
|
||||||
controls.undo.use = function(){
|
controls.undo.use = function(){
|
||||||
undo.undo()
|
undo.undo()
|
||||||
@ -145,7 +145,7 @@ var controls = (function(){
|
|||||||
clipboard.show()
|
clipboard.show()
|
||||||
clipboard.import_mode()
|
clipboard.import_mode()
|
||||||
}
|
}
|
||||||
|
|
||||||
controls.save_format = new RadioGroup(format_el)
|
controls.save_format = new RadioGroup(format_el)
|
||||||
controls.save_format.name = 'save_format'
|
controls.save_format.name = 'save_format'
|
||||||
controls.save_format.memorable = true
|
controls.save_format.memorable = true
|
||||||
@ -175,7 +175,7 @@ var controls = (function(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
controls.fg = new BlurredCheckbox (fg_checkbox)
|
controls.fg = new BlurredCheckbox (fg_checkbox)
|
||||||
controls.fg.use = function(state){
|
controls.fg.use = function(state){
|
||||||
brush.draw_fg = state || ! brush.draw_fg
|
brush.draw_fg = state || ! brush.draw_fg
|
||||||
@ -193,7 +193,7 @@ var controls = (function(){
|
|||||||
brush.draw_char = state || ! brush.draw_char
|
brush.draw_char = state || ! brush.draw_char
|
||||||
this.update(brush.draw_char)
|
this.update(brush.draw_char)
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
// controls.turn = new BlurredCheckbox (turn_checkbox)
|
// controls.turn = new BlurredCheckbox (turn_checkbox)
|
||||||
@ -211,7 +211,7 @@ var controls = (function(){
|
|||||||
// document.body.classList.toggle("pixels", canvas.pixels)
|
// document.body.classList.toggle("pixels", canvas.pixels)
|
||||||
// this.update(canvas.pixels)
|
// this.update(canvas.pixels)
|
||||||
// }
|
// }
|
||||||
|
|
||||||
controls.mirror_x = new BlurredCheckbox (mirror_x_checkbox)
|
controls.mirror_x = new BlurredCheckbox (mirror_x_checkbox)
|
||||||
controls.mirror_x.use = function(state){
|
controls.mirror_x.use = function(state){
|
||||||
window.mirror_x = typeof state == "boolean" ? state : ! window.mirror_x
|
window.mirror_x = typeof state == "boolean" ? state : ! window.mirror_x
|
||||||
@ -224,7 +224,7 @@ var controls = (function(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
controls.vertical = new BlurredCheckbox (vertical_checkbox)
|
controls.vertical = new BlurredCheckbox (vertical_checkbox)
|
||||||
controls.vertical.memorable = true
|
controls.vertical.memorable = true
|
||||||
controls.vertical.use = function(state){
|
controls.vertical.use = function(state){
|
||||||
@ -244,14 +244,14 @@ var controls = (function(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
controls.brush_w = new Lex (brush_w_el)
|
controls.brush_w = new Lex (brush_w_el)
|
||||||
controls.brush_h = new Lex (brush_h_el)
|
controls.brush_h = new Lex (brush_h_el)
|
||||||
controls.canvas_w = new Lex (canvas_w_el)
|
controls.canvas_w = new Lex (canvas_w_el)
|
||||||
controls.canvas_h = new Lex (canvas_h_el)
|
controls.canvas_h = new Lex (canvas_h_el)
|
||||||
|
|
||||||
// bind
|
// bind
|
||||||
|
|
||||||
controls.bind = function(){
|
controls.bind = function(){
|
||||||
|
|
||||||
for (var n in controls){
|
for (var n in controls){
|
||||||
@ -277,7 +277,7 @@ var controls = (function(){
|
|||||||
|
|
||||||
controls.brush_h.key = keys.single_numeral_key(controls.brush_h, function(h){ brush.resize(brush.w, h) })
|
controls.brush_h.key = keys.single_numeral_key(controls.brush_h, function(h){ brush.resize(brush.w, h) })
|
||||||
controls.brush_h.raw_key = keys.arrow_key(function(h){ brush.size_add(0, h) })
|
controls.brush_h.raw_key = keys.arrow_key(function(h){ brush.size_add(0, h) })
|
||||||
|
|
||||||
controls.canvas_w.key = keys.multi_numeral_key(controls.canvas_w, 3)
|
controls.canvas_w.key = keys.multi_numeral_key(controls.canvas_w, 3)
|
||||||
controls.canvas_w.onBlur = keys.multi_numeral_blur(controls.canvas_w, function(w){ canvas.resize(w, canvas.h) })
|
controls.canvas_w.onBlur = keys.multi_numeral_blur(controls.canvas_w, function(w){ canvas.resize(w, canvas.h) })
|
||||||
controls.canvas_w.raw_key = keys.arrow_key(function(w){ canvas.size_add(w, 0) })
|
controls.canvas_w.raw_key = keys.arrow_key(function(w){ canvas.size_add(w, 0) })
|
||||||
@ -285,7 +285,7 @@ var controls = (function(){
|
|||||||
controls.canvas_h.key = keys.multi_numeral_key(controls.canvas_h, 3)
|
controls.canvas_h.key = keys.multi_numeral_key(controls.canvas_h, 3)
|
||||||
controls.canvas_h.onBlur = keys.multi_numeral_blur(controls.canvas_h, function(h){ canvas.resize(canvas.w, h) })
|
controls.canvas_h.onBlur = keys.multi_numeral_blur(controls.canvas_h, function(h){ canvas.resize(canvas.w, h) })
|
||||||
controls.canvas_h.raw_key = keys.arrow_key(function(h){ canvas.size_add(0, h) })
|
controls.canvas_h.raw_key = keys.arrow_key(function(h){ canvas.size_add(0, h) })
|
||||||
|
|
||||||
add_custom_el.addEventListener("click", function(){
|
add_custom_el.addEventListener("click", function(){
|
||||||
custom.clone()
|
custom.clone()
|
||||||
})
|
})
|
||||||
|
@ -85,7 +85,7 @@ var keys = (function(){
|
|||||||
if (e.shiftKey)
|
if (e.shiftKey)
|
||||||
undo.redo();
|
undo.redo();
|
||||||
else
|
else
|
||||||
undo.undo();
|
undo.undo();
|
||||||
break
|
break
|
||||||
// default:
|
// default:
|
||||||
// if (focused) { focused.key(undefined, e.keyCode) }
|
// if (focused) { focused.key(undefined, e.keyCode) }
|
||||||
@ -102,7 +102,7 @@ var keys = (function(){
|
|||||||
cursor_input.value = ""
|
cursor_input.value = ""
|
||||||
|
|
||||||
// console.log("input:", char)
|
// console.log("input:", char)
|
||||||
|
|
||||||
if (current_tool.name != "text" && ! brush.modified) {
|
if (current_tool.name != "text" && ! brush.modified) {
|
||||||
brush.char = char
|
brush.char = char
|
||||||
if (char == " ") {
|
if (char == " ") {
|
||||||
@ -126,14 +126,14 @@ var keys = (function(){
|
|||||||
current_canvas.focus_add(1, 0)
|
current_canvas.focus_add(1, 0)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
cursor_input.addEventListener("keyup", function(e){
|
cursor_input.addEventListener("keyup", function(e){
|
||||||
if (! e.altKey) {
|
if (! e.altKey) {
|
||||||
document.body.classList.remove("dropper")
|
document.body.classList.remove("dropper")
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
keys.int_key = function (f) {
|
keys.int_key = function (f) {
|
||||||
return function (key, keyCode) {
|
return function (key, keyCode) {
|
||||||
var n = parseInt(key)
|
var n = parseInt(key)
|
||||||
|
@ -8,12 +8,12 @@ var letters = (function(){
|
|||||||
'Box Drawing',
|
'Box Drawing',
|
||||||
'Block Elements',
|
'Block Elements',
|
||||||
]
|
]
|
||||||
|
|
||||||
var letters = new Matrix (1, 1, function(x,y){
|
var letters = new Matrix (1, 1, function(x,y){
|
||||||
var lex = new Lex (x,y)
|
var lex = new Lex (x,y)
|
||||||
return lex
|
return lex
|
||||||
})
|
})
|
||||||
|
|
||||||
letters.charset = ""
|
letters.charset = ""
|
||||||
|
|
||||||
letters.repaint = function(charset){
|
letters.repaint = function(charset){
|
||||||
@ -46,7 +46,7 @@ var letters = (function(){
|
|||||||
lex.build()
|
lex.build()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
letters.bind = function(){
|
letters.bind = function(){
|
||||||
letters.forEach(function(lex,x,y){
|
letters.forEach(function(lex,x,y){
|
||||||
if (lex.bound) return
|
if (lex.bound) return
|
||||||
@ -84,7 +84,7 @@ var letters = (function(){
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
return letters
|
return letters
|
||||||
})()
|
})()
|
||||||
|
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
var selection = (function(){
|
var selection = (function(){
|
||||||
|
|
||||||
var creating = false, moving = false, copying = false
|
var creating = false, moving = false, copying = false
|
||||||
|
|
||||||
var selection_canvas = new Matrix (1, 1, function(x,y){
|
var selection_canvas = new Matrix (1, 1, function(x,y){
|
||||||
var lex = new Lex (x,y)
|
var lex = new Lex (x,y)
|
||||||
lex.build()
|
lex.build()
|
||||||
return lex
|
return lex
|
||||||
})
|
})
|
||||||
|
|
||||||
var selector_el = document.createElement("div")
|
var selector_el = document.createElement("div")
|
||||||
selector_el.className = "selector_el"
|
selector_el.className = "selector_el"
|
||||||
selection_canvas.append(selector_el)
|
selection_canvas.append(selector_el)
|
||||||
@ -21,12 +21,12 @@ var selection = (function(){
|
|||||||
// - on mouseup, the selection is locked. then..
|
// - on mouseup, the selection is locked. then..
|
||||||
// - drag the selection to move it -- this "cuts" it and leaves a blank space on the canvas.
|
// - drag the selection to move it -- this "cuts" it and leaves a blank space on the canvas.
|
||||||
// - shift-drag the selection to copy it
|
// - shift-drag the selection to copy it
|
||||||
|
|
||||||
var a = [0, 0]
|
var a = [0, 0]
|
||||||
var b = [0, 0]
|
var b = [0, 0]
|
||||||
var c = [0, 0]
|
var c = [0, 0]
|
||||||
var d = [0, 0]
|
var d = [0, 0]
|
||||||
|
|
||||||
function reset () {
|
function reset () {
|
||||||
a[0] = a[1] = b[0] = b[1] = 0
|
a[0] = a[1] = b[0] = b[1] = 0
|
||||||
}
|
}
|
||||||
@ -42,7 +42,7 @@ var selection = (function(){
|
|||||||
var l = left(a,b), m = top(a,b), n = right(a,b), o = bottom(a,b)
|
var l = left(a,b), m = top(a,b), n = right(a,b), o = bottom(a,b)
|
||||||
a[0] = l ; a[1] = m ; b[0] = n ; b[1] = o
|
a[0] = l ; a[1] = m ; b[0] = n ; b[1] = o
|
||||||
}
|
}
|
||||||
|
|
||||||
function contains (a,b,point) {
|
function contains (a,b,point) {
|
||||||
var contains_x = a[0] <= point[0] && point[0] <= b[0]
|
var contains_x = a[0] <= point[0] && point[0] <= b[0]
|
||||||
var contains_y = a[1] <= point[1] && point[1] <= b[1]
|
var contains_y = a[1] <= point[1] && point[1] <= b[1]
|
||||||
@ -130,7 +130,7 @@ var selection = (function(){
|
|||||||
creating = moving = copying = false
|
creating = moving = copying = false
|
||||||
selector_el.classList.remove("dragging")
|
selector_el.classList.remove("dragging")
|
||||||
}
|
}
|
||||||
|
|
||||||
function show () {
|
function show () {
|
||||||
selecting = true
|
selecting = true
|
||||||
}
|
}
|
||||||
@ -144,7 +144,7 @@ var selection = (function(){
|
|||||||
selection.hidden = true
|
selection.hidden = true
|
||||||
selecting = false
|
selecting = false
|
||||||
}
|
}
|
||||||
|
|
||||||
var selection = {}
|
var selection = {}
|
||||||
selection.reposition = reposition
|
selection.reposition = reposition
|
||||||
selection.down = down
|
selection.down = down
|
||||||
|
@ -104,7 +104,7 @@ var RadioGroup = Tool.extend({
|
|||||||
control.use()
|
control.use()
|
||||||
if (this.memorable){
|
if (this.memorable){
|
||||||
localStorage.setItem("ascii.tools." + this.name, this.value)
|
localStorage.setItem("ascii.tools." + this.name, this.value)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
bind: function(){
|
bind: function(){
|
||||||
var tool = this
|
var tool = this
|
||||||
|
@ -33,7 +33,7 @@ var transform = (function(){
|
|||||||
}
|
}
|
||||||
function up (e){
|
function up (e){
|
||||||
}
|
}
|
||||||
|
|
||||||
var modes = {
|
var modes = {
|
||||||
|
|
||||||
rotate: {
|
rotate: {
|
||||||
@ -59,7 +59,7 @@ var transform = (function(){
|
|||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
scale: {
|
scale: {
|
||||||
init: function(e){
|
init: function(e){
|
||||||
mode.independent = e.shiftKey || e.altKey || e.metaKey
|
mode.independent = e.shiftKey || e.altKey || e.metaKey
|
||||||
@ -86,7 +86,7 @@ var transform = (function(){
|
|||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
translate: {
|
translate: {
|
||||||
init: function(e){
|
init: function(e){
|
||||||
mode.dx = mode.dy = 0
|
mode.dx = mode.dy = 0
|
||||||
@ -113,7 +113,7 @@ var transform = (function(){
|
|||||||
before: function(dx, dy, pdx, pdy, point){
|
before: function(dx, dy, pdx, pdy, point){
|
||||||
var new_position = mode.is_y ? point[1] : point[0]
|
var new_position = mode.is_y ? point[1] : point[0]
|
||||||
var dd = mode.is_y ? pdx : pdy
|
var dd = mode.is_y ? pdx : pdy
|
||||||
|
|
||||||
if (mode.position !== new_position) {
|
if (mode.position !== new_position) {
|
||||||
mode.position = new_position
|
mode.position = new_position
|
||||||
mode.direction = 0
|
mode.direction = 0
|
||||||
@ -151,19 +151,19 @@ var transform = (function(){
|
|||||||
},
|
},
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
function set_mode(m){
|
function set_mode(m){
|
||||||
if (m in modes) {
|
if (m in modes) {
|
||||||
mode = modes[m]
|
mode = modes[m]
|
||||||
transforming = true
|
transforming = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function done(){
|
function done(){
|
||||||
transforming = false
|
transforming = false
|
||||||
copy && copy.demolish()
|
copy && copy.demolish()
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
down: down,
|
down: down,
|
||||||
move: move,
|
move: move,
|
||||||
|
@ -77,7 +77,7 @@ function rgbpixel(d,x,y){
|
|||||||
function fit(d,x,y){ rgbpixel(d,x*actual_w/w,y*actual_h/h) }
|
function fit(d,x,y){ rgbpixel(d,x*actual_w/w,y*actual_h/h) }
|
||||||
|
|
||||||
function step(a, b){
|
function step(a, b){
|
||||||
return (b >= a) + 0
|
return (b >= a) + 0
|
||||||
// ^^ bool -> int
|
// ^^ bool -> int
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,29 +1,28 @@
|
|||||||
Jollo LNT license
|
Jollo LNT license
|
||||||
Version 1 - February 2015
|
Version 1 - February 2015
|
||||||
|
|
||||||
Copyright, 2015. JOLLO NET NA.
|
Copyright, 2015. JOLLO NET NA.
|
||||||
The Jollo IRC Network. <//jollo.org/>
|
The Jollo IRC Network. <//jollo.org/>
|
||||||
|
|
||||||
Vu, fare wanderer, confronted with raw, programmatic instruction
|
Vu, fare wanderer, confronted with raw, programmatic instruction
|
||||||
dans la forme la plus pure. A hesitation, troubled to the terms
|
dans la forme la plus pure. A hesitation, troubled to the terms
|
||||||
qui ce license affirme. Par un voyage du explorer le mechanisme
|
qui ce license affirme. Par un voyage du explorer le mechanisme
|
||||||
et ponder la fabrication. Voila! La remide: egress sans risque.
|
et ponder la fabrication. Voila! La remide: egress sans risque.
|
||||||
|
|
||||||
Sans trace (Leave No Trace) via sept principales:
|
Sans trace (Leave No Trace) via sept principales:
|
||||||
|
|
||||||
0. Modifique language en advance. L'Apposer Jollo LNT license
|
0. Modifique language en advance. L'Apposer Jollo LNT license
|
||||||
with copies en distribuer.
|
with copies en distribuer.
|
||||||
|
|
||||||
1. Non responsible pour neglige programme du problematique.
|
1. Non responsible pour neglige programme du problematique.
|
||||||
|
|
||||||
2. Non sympathie pour neglige programme du problematique.
|
2. Non sympathie pour neglige programme du problematique.
|
||||||
|
|
||||||
3. Non permission l'modifique under any circumstance.
|
3. Non permission l'modifique under any circumstance.
|
||||||
|
|
||||||
4. Non permission distribution under any circumstance.
|
4. Non permission distribution under any circumstance.
|
||||||
|
|
||||||
5. Respect les programmatic instructions.
|
5. Respect les programmatic instructions.
|
||||||
|
|
||||||
6. Non interfere avec l'harmonie d'une amitie.
|
6. Non interfere avec l'harmonie d'une amitie.
|
||||||
|
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@
|
|||||||
<span id="vertical_checkbox" class="tool">x vertical</span>
|
<span id="vertical_checkbox" class="tool">x vertical</span>
|
||||||
<!-- <span id="pixels_checkbox" class="tool">_ pixels</span><br> -->
|
<!-- <span id="pixels_checkbox" class="tool">_ pixels</span><br> -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="textarea_mode" style="float: left">
|
<div id="textarea_mode" style="float: left">
|
||||||
<div>
|
<div>
|
||||||
<span id="clear_el" class="tool">new</span>
|
<span id="clear_el" class="tool">new</span>
|
||||||
@ -71,7 +71,7 @@
|
|||||||
brush: <span id="brush_w_el" class="ed">5</span> x <span id="brush_h_el" class="ed">5</span><br>
|
brush: <span id="brush_w_el" class="ed">5</span> x <span id="brush_h_el" class="ed">5</span><br>
|
||||||
canvas: <span id="canvas_w_el" class="ed">100</span> x <span id="canvas_h_el" class="ed">30</span><br>
|
canvas: <span id="canvas_w_el" class="ed">100</span> x <span id="canvas_h_el" class="ed">30</span><br>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="import_rapper">
|
<div id="import_rapper">
|
||||||
<span id="format_el">ascii *irssi mirc ansi</span>
|
<span id="format_el">ascii *irssi mirc ansi</span>
|
||||||
<span id="import_buttons">
|
<span id="import_buttons">
|
||||||
@ -108,3 +108,6 @@
|
|||||||
<script src="assets/js/app.js"></script>
|
<script src="assets/js/app.js"></script>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
vim:ts=2 sw=2 expandtab fenc=utf-8 foldmethod=marker nowrap tw=0
|
||||||
|
-->
|
||||||
|
Loading…
Reference in New Issue
Block a user