From 8e8fb7c45e8088843b71cb55fede723b2f9c7ff2 Mon Sep 17 00:00:00 2001 From: stale Date: Sun, 29 May 2022 05:34:16 -0300 Subject: *really* basic public lobby --- assets/client.js | 5 +++-- assets/index.html | 19 ++++++++++++++++--- assets/room.html | 2 +- assets/style.css | 8 +++++--- 4 files changed, 25 insertions(+), 9 deletions(-) (limited to 'assets') diff --git a/assets/client.js b/assets/client.js index f888104..b23222c 100644 --- a/assets/client.js +++ b/assets/client.js @@ -156,14 +156,15 @@ function createCursor(id, name, clr) { return cursor; } function movSelWin(win, x, y) { + let anch = board_elem.getBoundingClientRect(); let tpos = tilepos(x, y); if (tpos.x > (bwidth - 1) || tpos.x < 0 || tpos.y > (bheight - 1) || tpos.y < 0) { win.style.display = "none"; } else { win.style.display = ""; } - win.style.left = ((tpos.x + 0.5) * tile_w) + 'px'; - win.style.top = ((tpos.y + 0.5) * tile_h) + 'px'; + win.style.left = (anch.x + (tpos.x * tile_w)) + 'px'; + win.style.top = (anch.y + ((tpos.y + 0.35) * tile_h)) + 'px'; win.style.width = tile_w + 'px'; win.style.height = tile_h + 'px'; } diff --git a/assets/index.html b/assets/index.html index 4571428..6fc9c46 100644 --- a/assets/index.html +++ b/assets/index.html @@ -7,7 +7,20 @@ -
+
+ +
-={ Create a new room }=-
@@ -19,8 +32,8 @@ in every tiles are mines
-
-
+
+

diff --git a/assets/room.html b/assets/room.html index e3e6ff9..27f9ae1 100644 --- a/assets/room.html +++ b/assets/room.html @@ -7,7 +7,7 @@ -
+
diff --git a/assets/style.css b/assets/style.css index a8936e6..d217b8d 100644 --- a/assets/style.css +++ b/assets/style.css @@ -6,14 +6,16 @@ font-size: 36px; line-height: 22px; } +.cent { + width: 80vmin; + margin: 0 auto; +} + body { font-family: vt323, monospace; background-color: black; color: white; } -form { - margin: 0 auto; -} .unsel { -webkit-touch-callout: none; -webkit-user-select: none; -- cgit v1.2.3