diff options
Diffstat (limited to 'client/index.js')
| -rw-r--r-- | client/index.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/client/index.js b/client/index.js index 728fd60..0a0eed1 100644 --- a/client/index.js +++ b/client/index.js @@ -25,6 +25,7 @@ function add (x, y) { const i = x + 1 const j = y + 1 const div = document.createElement('div') + const freq = root * i/j let add = 0 let frac = Math.log2(i/j) % 1 div.style.left = (x * s) + 'px' @@ -49,14 +50,14 @@ function add (x, y) { div.addEventListener('mouseenter', function(){ div.style.backgroundColor = color(frac, add + add_on, mul_on) if (dragging) { - kalimba.play( root * i/j ) + kalimba.play( freq ) } }) div.addEventListener('mouseleave', function(){ div.style.backgroundColor = color(frac, add + add_off, mul_off) }) div.addEventListener('click', function(){ - kalimba.play( root * i/j ) + kalimba.play( freq ) }) document.body.appendChild(div) } |
