diff --git a/index.html b/index.html index d35c463..a22c073 100644 --- a/index.html +++ b/index.html @@ -60,6 +60,7 @@ socket.on('init', function (msg) { $('#presets').empty(); $('#sliders').empty(); + $('#anim').empty(); setup = msg.setup devices = msg.devices @@ -73,7 +74,6 @@ socket.emit('update', universe, values[universe]); } };}(setup.presets[preset].values)); - console.log(html); } /* blackout button */ @@ -109,6 +109,26 @@ html += ""; $(html).hide().appendTo('#sliders').fadeIn(); } + + /* animations */ + for(var animation in setup.animPresets) { + var html = ''; + var e = $(html) + e.hide().appendTo('#anim').fadeIn(); + e.click(function(values) { return function() { + for(var universe in values) { + $.ajax({ + type: 'POST', + contentType: 'application/json', + data: JSON.stringify(values[universe]), + url: '/animation/'+universe, + processData: false, + dataType: 'json' + }); + } + };}(setup.animPresets[animation].anim)); + } + $("input").live("change", function(e) { var i = e.target.id.split('_'); var u = {}; @@ -131,6 +151,7 @@
@@ -144,6 +165,9 @@