From 2464f6e5d4d190631efbb738e56d9c2c810f7ced Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sat, 22 Nov 2014 10:43:51 -0500 Subject: toggle textarea --- index.html | 7 ++++++- js/app.js | 15 ++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 1c04d1a..c1c250a 100644 --- a/index.html +++ b/index.html @@ -8,10 +8,13 @@ body.grid div { border-top: 1px solid #444; border-left: 1px solid #444; } .ed { color: #fff; } .focused { text-shadow: 0 3px 3px #fff; border-color: #fff; } .tool.focused, .ed.focused { color: white; text-decoration: underline; } +body.loading { opacity: 0; } +body { transition: 0.1s linear; } body.grid .focused { box-shadow: inset 0 0 2px white, inset 0 0 2px white, inset 0 0 2px white; } +#shader_textarea { display: none; } - +
@@ -25,10 +28,12 @@ body.grid .focused { box-shadow: inset 0 0 2px white, inset 0 0 2px white, inset text clear grid + shader brush size: 5 x 5 canvas size: 80 x 24
+ diff --git a/js/app.js b/js/app.js index 54553de..84333e9 100644 --- a/js/app.js +++ b/js/app.js @@ -95,6 +95,15 @@ function build () { document.body.classList.toggle('grid') } + controls.shader = new Tool (shader_el) + controls.shader.use = function(){ + shader_textarea.style.display = "block" + } + controls.shader.blur = function(){ + Tool.prototype.blur.call(this) + shader_textarea.style.display = "none" + } + controls.width = new Lex (width_el) controls.height = new Lex (height_el) controls.canvas_width = new Lex (canvas_width_el) @@ -155,7 +164,7 @@ function bind () { }) }); - [controls.square, controls.circle, controls.text, controls.clear, controls.grid].forEach(function(tool){ + [controls.square, controls.circle, controls.text, controls.clear, controls.grid, controls.shader].forEach(function(tool){ tool.span.addEventListener('mousedown', function(e){ tool.focus() }) @@ -221,6 +230,10 @@ function bind () { break } }) + + document.addEventListener('DOMContentLoaded', function(){ + document.body.classList.remove('loading') + }) } -- cgit v1.2.3-70-g09d2