From 2ed35c9f93355345fc03721fb9138e8e2076fa6f Mon Sep 17 00:00:00 2001 From: chee Date: Mon, 21 May 2018 18:02:54 +0100 Subject: [PATCH] grab me --- client/index.js | 5 +++++ client/index.sass | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/client/index.js b/client/index.js index 5c7c592..392d292 100644 --- a/client/index.js +++ b/client/index.js @@ -104,6 +104,7 @@ const starting = {} const handleDown = event => { if (!event.target.classList.contains(pieceClass)) return + document.body.classList.add('grabbing') element = event.target dragging = true @@ -143,6 +144,8 @@ function getDistance ({x: x1, y: y1}, {x: x2, y: y2}) { const handleUp = event => { if (held) return + document.body.classList.remove('add') + const {id} = element const {x, y, z} = positions[id] @@ -176,6 +179,7 @@ const handleClick = event => { element.classList.remove('held') element = null held = false + document.body.classList.remove('grabbing') return } @@ -185,6 +189,7 @@ const handleClick = event => { dragging = false held = true + document.body.classList.add('grabbing') element = event.target diff --git a/client/index.sass b/client/index.sass index 24781a0..6499f49 100644 --- a/client/index.sass +++ b/client/index.sass @@ -91,6 +91,10 @@ html, body color: white height: 100% width: 100% + cursor: grab + +.grabbing + cursor: grabbing .gay background: repeating-linear-gradient(45deg, #ff2a50, #ffaa20 10px, #eeee33 10px, #33cc99 20px, #3399ff 20px, #cc55cc 30px)