From a8b39a97215f8da3df3a522fe5c2f1d6d93ccccf Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sun, 23 Apr 2017 23:51:46 -0400 Subject: fade based on octave --- client/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'client') 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 = `
${i}<\/div>
\/
${j}<\/div>` div.addEventListener('mouseenter', function(){ div.style.backgroundColor = color(i/j, add_on, mul_on) -- cgit v1.2.3-70-g09d2