From d9f1628cbc3e96c584279b8d58e2e2c2a0d75b56 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sat, 31 Mar 2018 13:12:41 +0200 Subject: mirror x/y --- index.html | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'index.html') diff --git a/index.html b/index.html index 298bde0..5ef9c5f 100644 --- a/index.html +++ b/index.html @@ -9,6 +9,9 @@ +
+
+
@@ -38,6 +41,8 @@ paint

+ _ mirror x
+ _ mirror y
square
@@ -142,6 +147,7 @@ + -- cgit v1.2.3-70-g09d2 From 5605ce481f6c5f67bce69ff31ffe0117485efc39 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sat, 31 Mar 2018 17:58:21 +0200 Subject: upload ascii when saving --- index.html | 2 +- js/app.js | 10 +++++++++- js/clipboard.js | 2 +- js/ui/controls.js | 14 +++++++------- js/upload.js | 3 ++- 5 files changed, 20 insertions(+), 11 deletions(-) (limited to 'index.html') diff --git a/index.html b/index.html index 5ef9c5f..1098f4c 100644 --- a/index.html +++ b/index.html @@ -63,7 +63,7 @@ _ grid
x vertical
- _ pixels
+
brush size: 5 x 5
canvas size: 100 x 30
diff --git a/js/app.js b/js/app.js index 0d91c84..5898f5c 100644 --- a/js/app.js +++ b/js/app.js @@ -82,7 +82,15 @@ function bind () { }) window.onbeforeunload = function() { - if (changed) return "You have edited this drawing." + if (changed && !in_iframe()) return "You have edited this drawing." + } + + function in_iframe () { + try { + return window.self !== window.top; + } catch (e) { + return true; + } } } diff --git a/js/clipboard.js b/js/clipboard.js index ecb200b..107f634 100644 --- a/js/clipboard.js +++ b/js/clipboard.js @@ -236,7 +236,7 @@ var clipboard = (function () { var blob = PNG.canvas_to_blob_with_colorcode(canvas_out, canvas.mirc()) var filename = clipboard.filename() var tag = 'ascii' - upload(blob, filename, tag) + upload(blob, filename, tag, canvas_out) } clipboard.export_canvas(upload_fn) } diff --git a/js/ui/controls.js b/js/ui/controls.js index 8ffdc64..8da4994 100644 --- a/js/ui/controls.js +++ b/js/ui/controls.js @@ -262,13 +262,13 @@ var controls = (function(){ // this.update(canvas.rotated) // } - controls.pixels = new BlurredCheckbox (pixels_checkbox) - controls.pixels.memorable = true - controls.pixels.use = function(state){ - canvas.pixels = typeof state == "boolean" ? state : ! canvas.pixels - document.body.classList.toggle("pixels", canvas.pixels) - this.update(canvas.pixels) - } + // controls.pixels = new BlurredCheckbox (pixels_checkbox) + // controls.pixels.memorable = true + // controls.pixels.use = function(state){ + // canvas.pixels = typeof state == "boolean" ? state : ! canvas.pixels + // document.body.classList.toggle("pixels", canvas.pixels) + // this.update(canvas.pixels) + // } controls.mirror_x = new BlurredCheckbox (mirror_x_checkbox) controls.mirror_x.use = function(state){ diff --git a/js/upload.js b/js/upload.js index c1ef7f7..0fa567c 100644 --- a/js/upload.js +++ b/js/upload.js @@ -3,7 +3,7 @@ var upload = (function(){ var button = document.getElementById("upload_button") var uploading = false - function upload(blob, filename, tag){ + function upload(blob, filename, tag, ascii){ if (uploading) return filename = filename || get_filename() tag = tag || "shader" @@ -15,6 +15,7 @@ var upload = (function(){ uploadImage({ blob: blob, + ascii: ascii, filename: filename, username: user.username, tag: tag, -- cgit v1.2.3-70-g09d2 From f291eaf0692c82724fab2423db01193869342328 Mon Sep 17 00:00:00 2001 From: Jules Date: Sat, 31 Mar 2018 11:59:49 -0400 Subject: title --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'index.html') diff --git a/index.html b/index.html index 298bde0..5d3071a 100644 --- a/index.html +++ b/index.html @@ -2,7 +2,7 @@ -asdf.us/ascii +asciiblaster -- cgit v1.2.3-70-g09d2 From 655c5293708300deaf11a8b6a924e7b817bf6288 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sat, 31 Mar 2018 19:46:22 +0200 Subject: pankeizing --- css/sally.css | 28 +++++++++++++++++++++++++++- index.html | 44 ++++++++++++++++++++++---------------------- js/app.js | 2 +- js/ui/controls.js | 8 ++++++++ 4 files changed, 58 insertions(+), 24 deletions(-) (limited to 'index.html') diff --git a/css/sally.css b/css/sally.css index 978a78d..3661d12 100644 --- a/css/sally.css +++ b/css/sally.css @@ -42,12 +42,16 @@ a:hover { text-decoration: underline } #gallery_rapper { display: inline } +#ui_rapper .block { + width: 100px; +} .block { padding:4px; } .block:nth-child(n+2) { padding-left: 30px; } +#textarea_mode { padding: 4px; } .tool { cursor: pointer; } @@ -122,7 +126,7 @@ textarea { font-size:12pt; width: 37vw; height: 300px; background: #333; color: .vertical #canvas_rapper div, .vertical #tools_rapper, .vertical #palette_rapper, -.vertical #brush_container { display: inline-block; float: left} +.vertical #brush_container { display: inline-block; float: left; } .vertical #workspace_rapper { width: auto; position: relative; float: left; } .vertical #palette_rapper { margin-right: 10px; } .vertical #tools_block { min-width: 100%; } @@ -160,6 +164,7 @@ textarea { font-size:12pt; width: 37vw; height: 300px; background: #333; color: border: 1px solid; display: inline-block; margin-bottom: 13px; + float: left; } #letters_rapper { display: inline-block; @@ -226,3 +231,24 @@ textarea { font-size:12pt; width: 37vw; height: 300px; background: #333; color: 66% { color: hsl(320,100%,50%) } 100% { color: hsl(360,100%,50%) } } + +.can_save { + color: white; + text-decoration: underline; +} +.panke #shader_el, +.panke #load_el, +.panke #gallery_el, +.panke #import_textarea, +.panke #doc_el, +.panke #gallery_el, +.panke #save_button, +.panke #upload_button, +.panke #export_button, +.panke #username_input, +.panke #upload_input, +.panke #grid_el, +.panke #save_el, +.panke #vertical_checkbox, +.panke #add_custom_el, +.panke #format_el { display: none !important; } diff --git a/index.html b/index.html index 997638d..8c272eb 100644 --- a/index.html +++ b/index.html @@ -7,7 +7,7 @@ - +
@@ -35,14 +35,11 @@ x char

+ add -
-
- no
- paint
-
-
_ mirror x
_ mirror y
+
+
+
square
@@ -56,29 +53,33 @@ scale
translate
slice
-
-
-
-
- _ grid
+ + _ grid - x vertical
+ x vertical -
- brush size: 5 x 5
- canvas size: 100 x 30
shader - webcam - load + new
save - new - doc - gallery + > send to IRC
+ load + webcam
+ doc + gallery +
+
+
+ no
+ paint
+
+

+ brush: 5 x 5
+ canvas: 100 x 30
@@ -104,7 +105,6 @@
-
x diff --git a/js/app.js b/js/app.js index 5898f5c..64f8bea 100644 --- a/js/app.js +++ b/js/app.js @@ -82,7 +82,7 @@ function bind () { }) window.onbeforeunload = function() { - if (changed && !in_iframe()) return "You have edited this drawing." + // if (changed && !in_iframe()) return "You have edited this drawing." } function in_iframe () { diff --git a/js/ui/controls.js b/js/ui/controls.js index 8da4994..32a329a 100644 --- a/js/ui/controls.js +++ b/js/ui/controls.js @@ -164,6 +164,14 @@ var controls = (function(){ clipboard.show() clipboard.export_mode() } + controls.send_to_irc = new ClipboardTool (send_to_irc_el) + controls.send_to_irc.use = function(){ + changed && clipboard.upload_png() + clipboard.show() + clipboard.export_mode() + alert('your ascii art is now on display on the IRC channel inside the panke.gallery!') + } + controls.load = new ClipboardTool (load_el) controls.load.use = function(){ // console.log("use") -- cgit v1.2.3-70-g09d2 From 165bb4883c59a8b529c09b08bb75c9b3407c9c69 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 2 Apr 2018 05:29:14 +0200 Subject: advanced toggle --- css/sally.css | 2 +- index.html | 16 ++++++++++------ js/ui/controls.js | 13 ++++++++++++- 3 files changed, 23 insertions(+), 8 deletions(-) (limited to 'index.html') diff --git a/css/sally.css b/css/sally.css index 3661d12..7f0c04e 100644 --- a/css/sally.css +++ b/css/sally.css @@ -232,7 +232,7 @@ textarea { font-size:12pt; width: 37vw; height: 300px; background: #333; color: 100% { color: hsl(360,100%,50%) } } -.can_save { +.panke #send_to_irc_el { color: white; text-decoration: underline; } diff --git a/index.html b/index.html index 8c272eb..c822bb2 100644 --- a/index.html +++ b/index.html @@ -62,14 +62,18 @@
- shader - new
+ new save - > send to IRC
load - webcam
- doc - gallery +
+ shader + webcam + doc + gallery +
+ _ advanced +
+ > send to IRC

diff --git a/js/ui/controls.js b/js/ui/controls.js index 32a329a..315395d 100644 --- a/js/ui/controls.js +++ b/js/ui/controls.js @@ -171,7 +171,6 @@ var controls = (function(){ clipboard.export_mode() alert('your ascii art is now on display on the IRC channel inside the panke.gallery!') } - controls.load = new ClipboardTool (load_el) controls.load.use = function(){ // console.log("use") @@ -230,6 +229,18 @@ var controls = (function(){ this.update(state) } + controls.advanced = new BlurredCheckbox (advanced_checkbox) + controls.advanced.memorable = true + controls.advanced.use = function(state){ + console.log(state) + state = document.body.classList.contains('panke') + if (state) + document.body.classList.remove('panke') + else + document.body.classList.add('panke') + this.update(state) + } + /* controls.nopaint = new HiddenCheckbox (nopaint_toggle) controls.nopaint.memorable = true -- cgit v1.2.3-70-g09d2