summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2017-05-11 01:37:28 +0200
committerJules Laplace <jules@okfoc.us>2017-05-11 01:37:28 +0200
commit1ddb0f40f00131ce8c35f19655566c248226f532 (patch)
tree93ee07fd9322545d4cda09f5eb97a8d926eaec5f /client
parentab4b2c65fc9c7deb41c62105f2523f949c07de7b (diff)
mouse stuff is harder to get right than you think
Diffstat (limited to 'client')
-rw-r--r--client/index.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/client/index.js b/client/index.js
index 0bce22c..a1e0828 100644
--- a/client/index.js
+++ b/client/index.js
@@ -54,6 +54,10 @@ function add (x, y) {
div.style.backgroundColor = color(frac, add_off + add, mul_off)
if (browser.isDesktop) {
+ div.addEventListener('mousedown', function(){
+ div.style.backgroundColor = color(frac, add + add_on, mul_on)
+ kalimba.play( freq )
+ })
div.addEventListener('mouseenter', function(){
div.style.backgroundColor = color(frac, add + add_on, mul_on)
if (dragging) {
@@ -63,9 +67,6 @@ function add (x, y) {
div.addEventListener('mouseleave', function(){
div.style.backgroundColor = color(frac, add + add_off, mul_off)
})
- div.addEventListener('click', function(){
- kalimba.play( freq )
- })
}
else {
div.addEventListener('touchstart', function(e){