From fae0fca7aabb81325a296a1d6202239c3db44b60 Mon Sep 17 00:00:00 2001 From: stale Date: Fri, 20 May 2022 06:39:58 -0300 Subject: wip room support --- assets/client.js | 10 ++++++---- assets/index.html | 28 ++++++++++++++++++++++++++++ assets/room.html | 6 +++--- assets/style.css | 5 ++++- 4 files changed, 41 insertions(+), 8 deletions(-) create mode 100644 assets/index.html (limited to 'assets') diff --git a/assets/client.js b/assets/client.js index 0e90d4b..f888104 100644 --- a/assets/client.js +++ b/assets/client.js @@ -3,9 +3,11 @@ window.name = "anon"; window.clr = "#f03333"; window.info_elem = document.getElementById("miscinfo"); window.info_elem.innerHTML =` - - - `; +
+ + + +
`; window.board_elem = document.getElementById("board"); window.bwidth = NaN; window.bheight = NaN; @@ -25,7 +27,7 @@ function register() { function connect() { let wsproto = (window.location.protocol == "https:")? "wss:": "ws:"; - let s = new WebSocket(`${wsproto}//${window.location.hostname}:${window.location.port}${window.location.pathname}ws`); + let s = new WebSocket(`${wsproto}//${location.hostname}:${location.port}${location.pathname}/ws`); s.onopen = function() { s.send(`register ${window.name} ${window.clr}`); } diff --git a/assets/index.html b/assets/index.html new file mode 100644 index 0000000..bb18d1c --- /dev/null +++ b/assets/index.html @@ -0,0 +1,28 @@ + + + + + websweeper + + + + +
+
+ -={ Create a new room }=- +
+
+
+
+ +
+ + + diff --git a/assets/room.html b/assets/room.html index f3f130d..e3e6ff9 100644 --- a/assets/room.html +++ b/assets/room.html @@ -4,15 +4,15 @@ websweeper - + -
+

Loading...

- + diff --git a/assets/style.css b/assets/style.css index acdd9c0..a8936e6 100644 --- a/assets/style.css +++ b/assets/style.css @@ -1,6 +1,6 @@ @font-face { font-family: vt323; - src: url("f.ttf"); + src: url("/f.ttf"); } #board-container { font-size: 36px; @@ -11,6 +11,9 @@ body { background-color: black; color: white; } +form { + margin: 0 auto; +} .unsel { -webkit-touch-callout: none; -webkit-user-select: none; -- cgit v1.2.3