うなずきインターフェイス
説明
EnterKeyを押すと画面がうなずきます
このことで気持ちよくタイピングできるかなーって思った
うなずきの効果->
マルチモーダル音声対話コーパスの収録とうなずきの分析
var nod = { direction : 3, increment : 3, down_rate : 30, down_max : 0, speed : 10, timer : null, init : function() { var t = nod.extract_px(document.body.style.marginTop); nod.down_max = t + nod.down_rate; document.onkeydown = nod.bind_enterkey }, bind_enterkey : function(e) { if (!e) e = event; if (e.keyCode == 13) { nod.direction = nod.increment; clearTimeout(nod.timer); nod.start(); } }, extract_px : function(px) { var t = document.body.style.marginTop.match(/^\d+/); t = t ? parseInt(t[0], 10) : 0; return t; }, start : function() { var t = nod.extract_px(document.body.style.marginTop); document.body.style.marginTop = (t + nod.direction) + "px"; t += nod.direction; if (t == (nod.down_max - nod.down_rate)) return nod.direction = nod.increment; if (t >= nod.down_max) nod.direction = -nod.increment; nod.timer = setTimeout(arguments.callee, nod.speed); } }; nod.init();