diff options
| author | Jules Laplace <jules@okfoc.us> | 2017-04-25 13:12:22 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2017-04-25 13:12:29 -0400 |
| commit | 2761ba1231686407af2e11786e29e84c69b0183f (patch) | |
| tree | d3c0e85a610aa9801e00811317df2126d7263d26 /client/index.js | |
| parent | 0f9327b07d8a0b6608981e688b9a62a1ea0a5a5e (diff) | |
freq
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) } |
