diff options
| author | Jules Laplace <jules@okfoc.us> | 2014-11-22 15:17:16 -0500 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2014-11-22 15:17:16 -0500 |
| commit | 61ea379940152da18052a02185eb204fc7a9683d (patch) | |
| tree | 71e7f9c9b7ed52ce6651ba8339b371bce4b6da7c /js/app.js | |
| parent | b4d19e469b3de98778002ac97814c6b647cba113 (diff) | |
color functions and animate switch
Diffstat (limited to 'js/app.js')
| -rw-r--r-- | js/app.js | 17 |
1 files changed, 8 insertions, 9 deletions
@@ -9,14 +9,6 @@ var focused var canvas, tools, palette, brush, mode, current_tool -var color_names = ("white black dark-blue green red dark-red purple orange " + - "yellow lime dark-cyan cyan blue magenta dark-gray light-gray").split(" "); -var color_hue_order = ("black dark-blue purple dark-red red orange " + - "yellow lime green dark-cyan cyan blue magenta dark-gray light-gray white").split(" "); -var letters = "abcdefghijklmnop"; -var colors = {}, controls = {} -color_names.forEach(function(name, i){ colors[name] = i }) - function init () { build() bind() @@ -113,6 +105,13 @@ function build () { fn && shader.run(canvas) }) + controls.animate = new Tool (animate_checkbox) + controls.animate.use = function(){ + var state = shader.toggle() + if (state) animate_checkbox.innerHTML = "x animate" + else animate_checkbox.innerHTML = "_ animate" + } + controls.width = new Lex (width_el) controls.height = new Lex (height_el) controls.canvas_width = new Lex (canvas_width_el) @@ -175,7 +174,7 @@ function bind () { }) }); - [controls.square, controls.circle, controls.text, controls.clear, controls.grid, controls.shader].forEach(function(tool){ + [controls.square, controls.circle, controls.text, controls.clear, controls.grid, controls.shader, controls.animate].forEach(function(tool){ tool.span.addEventListener('mousedown', function(e){ tool.focus() }) |
