aboutsummaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rw-r--r--client/index.html51
-rw-r--r--client/style.css9
2 files changed, 9 insertions, 51 deletions
diff --git a/client/index.html b/client/index.html
deleted file mode 100644
index a03d777..0000000
--- a/client/index.html
+++ /dev/null
@@ -1,51 +0,0 @@
-<!DOCTYPE HTML>
-<html>
- <head>
- <meta charset="UTF-8">
- <title>Client</title>
- <link rel="stylesheet" type="text/css" href="$UPLCG_BASE/assets/style.css">
- <meta name="viewport" content="width=device-width">
- </head>
- <body>
- <div id="main"></div>
- <script type="text/JavaScript" src="$UPLCG_BASE/assets/client.js"></script>
- <script>
- var app = Elm.Client.init({node: document.querySelector("main")});
-
- function connect() {
- var protocol = "ws:";
- if(document.location.protocol == "https:") {
- protocol = "wss:"
- }
- var path = document.location.pathname;
- if(path.startsWith("$UPLCG_BASE")) {
- path = path.substr("$UPLCG_BASE".length);
- }
- var roomId = path.split("/")[2];
- var url = protocol + "//" + document.location.host +
- "$UPLCG_BASE/rooms/" + roomId + "/events";
-
- var socket = new WebSocket(url);
- var socketSend = function(message) {
- socket.send(message);
- };
- app.ports.webSocketOut.subscribe(socketSend);
- socket.onmessage = function(event) {
- app.ports.webSocketIn.send(event.data);
- };
- socket.onclose = function(event) {
- app.ports.webSocketOut.unsubscribe(socketSend);
- setTimeout(function() {
- connect();
- }, 1000);
- };
- socket.onerror = function(event) {
- socket.close();
- };
- }
-
- connect();
- </script>
- <footer>Untitled PL Card Game version $UPLCG_VERSION</footer>
- </body>
-</html>
diff --git a/client/style.css b/client/style.css
index 90e6a03..3da29f8 100644
--- a/client/style.css
+++ b/client/style.css
@@ -118,6 +118,15 @@ button, input {
margin-top: 6px;
}
+.rooms {
+ max-width: 800px;
+ margin: auto;
+}
+
+.rooms ul {
+ text-align: left;
+}
+
footer {
font-size: 12px;
margin: 60px auto 60px auto;