summaryrefslogtreecommitdiff
path: root/client/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'client/index.js')
-rw-r--r--client/index.js11
1 files changed, 3 insertions, 8 deletions
diff --git a/client/index.js b/client/index.js
index 17115ff..73ace90 100644
--- a/client/index.js
+++ b/client/index.js
@@ -22,18 +22,13 @@ for (var i = 0; i < ws; i++) {
}
function add (x, y) {
- const i = Math.max(x, y) + 1
- const j = Math.min(x, y) + 1
+ const i = x + 1
+ const j = y + 1
const div = document.createElement('div')
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
- }
- else {
- div.style.opacity = Math.min(j/i * Math.sqrt(3), 1)
- }
+ div.style.opacity = Math.min(j/i * Math.sqrt(3), 1)
div.innerHTML = `<div>${i}<\/div><div>\/</div><div>${j}<\/div>`
div.addEventListener('mouseenter', function(){
div.style.backgroundColor = color(i/j, add_on, mul_on)