Skip to content

Commit

Permalink
thanky ou girlies
Browse files Browse the repository at this point in the history
  • Loading branch information
chee committed May 15, 2018
1 parent ee34614 commit c10f2e2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion client/index.html
@@ -1,4 +1,4 @@
<!doctype quirks>
<!doctype html>
<meta charset="utf-8">
<title>🐝🕷🕷🐞🐞🦗🦗🦗🐜🐜🐜</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
Expand Down
18 changes: 8 additions & 10 deletions client/index.js
Expand Up @@ -54,21 +54,21 @@ function upload (positions) {
ws.send(JSON.stringify(['position', ...positions]))
}

function getCoordsFromEvent ({clientX, clientY, touches}) {
function getCoordsFromEvent ({pageX, pageY, touches}) {
if (touches) {
const {
clientX,
clientY
pageX,
pageY
} = touches[0]

return {
x: clientX - radius,
y: clientY - radius
x: pageX - radius,
y: pageY - radius
}
}
return {
x: clientX - radius,
y: clientY - radius
x: pageX - radius,
y: pageY - radius
}
}

Expand Down Expand Up @@ -101,8 +101,6 @@ function update ([id, x, y, z]) {
const handleDown = event => {
if (!event.target.classList.contains(pieceClass)) return

document.body.style.overflow = 'hidden'

element = event.target
dragging = true
element.style.position = 'absolute'
Expand All @@ -120,7 +118,7 @@ const handleMove = event => {
const handleUp = event => {
const {id} = element
const {x, y, z} = positions[id]
document.body.style.overflow = 'initial'

dragging = false
element = null
upload([id, x, y, z])
Expand Down
2 changes: 1 addition & 1 deletion client/index.sass
Expand Up @@ -86,7 +86,7 @@
bottom: -($size * 0.353)
border-bottom: $border
border-left: $border
body
html, body
background-color: #226699
color: white
height: 100%
Expand Down

0 comments on commit c10f2e2

Please sign in to comment.