Mercurial > hg > nodescore
view www/m/js/metronome.js @ 5:9070b2a7ca65
nodescore magicsquare example web files commited
author | tzara <rc-web@kiben.net> |
---|---|
date | Wed, 04 Jul 2012 13:10:04 +0000 |
parents | |
children | 33e6dc370ef7 |
line wrap: on
line source
//var socket = io.connect(); //socket.on("metroPulse", metronomeTick); function metroCss(beat, beatcolor,text){ var color = beatcolor; $(".metrocase > div").each(function(){$(this).stop()}); $(".metrocase > div").each(function(){$(this).css('background-color', beatcolor)}); $(".metrocase > div").each(function(){$(this).text(" ")}); $(".metrocase > div").each(function(){$(this).animate({opacity: 0.5}, 50, function() { $(this).animate({opacity:0.0}); } ); }) } function metronomeTick(pulse, voice,metrobeat) { console.log( voice+ " metronome tick" + metrobeat) var color = "gray" metroCss(0, "red", "4") //if (metrobeat == 0) { // metroCss(0, "gray", "1") // } //if (metrobeat == 3) { // metroCss(0, "white", "4") // } // if (metrobeat == 1||metrobeat == 2){ // $("#metronome"+metrobeat).stop(); // $("#metronome"+metrobeat).css('background-color', color); // $("#metronome"+metrobeat).text(" "); //$("#metronome"+metrobeat).text(metrobeat+1); // $("#metronome"+metrobeat).animate({opacity: 1}, // 50, // function() { $(this).animate({opacity:0.0}); } // ); // } };