diff options
| author | Jules Laplace <jules@okfoc.us> | 2017-04-23 23:51:46 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2017-04-23 23:51:46 -0400 |
| commit | a8b39a97215f8da3df3a522fe5c2f1d6d93ccccf (patch) | |
| tree | bb092bc1f15482da499f1a20654be74dfa4613ec /client | |
| parent | e67b1f243539b2317c9396d61643a2a557f7c2d0 (diff) | |
fade based on octave
Diffstat (limited to 'client')
| -rw-r--r-- | client/index.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/client/index.js b/client/index.js index 62f7e53..868a395 100644 --- a/client/index.js +++ b/client/index.js @@ -28,7 +28,13 @@ function add (x, y) { div.style.left = (x * s) + 'px' div.style.top = (y * s) + 'px' div.style.backgroundColor = color(i/j, add_off, mul_off) - if (x < y) div.style.opacity = 0.5 + if (x < y) { + div.style.opacity = 0.5 + } + else { + div.style.opacity = Math.min(j/i * Math.sqrt(3), 1) + } + console.log(j/i) div.innerHTML = `<div>${i}<\/div><div>\/</div><div>${j}<\/div>` div.addEventListener('mouseenter', function(){ div.style.backgroundColor = color(i/j, add_on, mul_on) |
