[JS] Help me find out the correct speed to sync up with the song 太陽いわく燃えよカオス (5)

1 Name: #!/usr/bin/anonymous : 2012-08-10 08:31 ID:2Uhzsz2B

Hi, so a friend made this for me after I linked them to the Nyaruko-san OP on YouTube. He said that using the + and - buttons, it ought to sync up with any beat.
My apologies if I mesed up the indentation in the following copypaste:

<html>
<head>
<title>(」・ω・)」うー!(/・ω・)/にゃー!</title>
<script type="text/javascript">var speed = 250;
var looper = setInterval(function(){ u.style.display="inline";
nya.style.display="none";
setTimeout(function(){ u.style.display="none";
nya.style.display="inline";
},speed);
},speed*2);
function unya(){
var u = document.getElementById("u");
var nya = document.getElementById("nya");
setTimeout(function(){ u.style.display="none";
nya.style.display="inline";
},speed);
};
function minus(){ speed+=50; celerate(); };
function plus(){ if (speed>50){ speed-=50; celerate(); }};
function celerate(){
clearInterval(looper);
looper = setInterval(function(){
u.style.display="inline";
nya.style.display="none";
setTimeout(function(){
u.style.display="none";
nya.style.display="inline";
},speed);
},speed*2);
};
window.onload=unya;
</script>
</head>
<body>
<p>
<div id="u">(」・ω・)」うー!</div>
<div id="nya" style="display:none;">(/・ω・)/にゃー!</div>
</p>
<input type="button" value="+" onclick="plus()" />
<input type="button" value="-" onclick="minus()" />
</body>
</html>
This thread has been closed. You cannot post in this thread any longer.