From f07fd39e67df3618c97dd38480488e62ca91ef9e Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 5 May 2015 02:58:59 -0400 Subject: dropper icon --- css/sally.css | 3 +++ img/dropper.gif | Bin 0 -> 1170 bytes js/ui/canvas.js | 1 - js/ui/keys.js | 10 ++++++++++ 4 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 img/dropper.gif diff --git a/css/sally.css b/css/sally.css index 8b8db81..c015305 100644 --- a/css/sally.css +++ b/css/sally.css @@ -79,6 +79,9 @@ textarea { font-size:12pt; width: 37%; height: 300px; background: #333; color: # box-shadow: 0 0 2px rgba(255,255,255,0.3); margin: 3px; } +.dropper #canvas_rapper { + cursor: url(../img/dropper.gif) 0 15, auto; +} #cursor_input { position: fixed; top: 0; right: 0; width:30px; opacity: 0; } .selector_el { border: 1px dashed #fff !important; diff --git a/img/dropper.gif b/img/dropper.gif new file mode 100644 index 0000000..7d9eee1 Binary files /dev/null and b/img/dropper.gif differ diff --git a/js/ui/canvas.js b/js/ui/canvas.js index 539519d..cb0521f 100644 --- a/js/ui/canvas.js +++ b/js/ui/canvas.js @@ -23,7 +23,6 @@ var canvas = current_canvas = (function(){ e.preventDefault() dragging = true current_canvas = canvas - console.log(e) if (e.altKey) { brush.assign(lex) brush.generate() diff --git a/js/ui/keys.js b/js/ui/keys.js index fc9a47d..fc958b0 100644 --- a/js/ui/keys.js +++ b/js/ui/keys.js @@ -6,6 +6,9 @@ var keys = (function(){ cursor_input.addEventListener('keydown', function(e){ // console.log("keycode:", e.keyCode) + if (e.altKey) { + document.body.classList.add("dropper") + } switch (e.keyCode) { case 27: // esc @@ -80,6 +83,13 @@ var keys = (function(){ current_canvas.focusLex(y + direction[0], x + direction[1]) } }) + + cursor_input.addEventListener("keyup", function(e){ + if (! e.altKey) { + document.body.classList.remove("dropper") + } + }) + } return keys -- cgit v1.2.3-70-g09d2