summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2021-02-11 12:30:32 -0500
committerKyle Gunger <kgunger12@gmail.com>2021-02-11 12:30:32 -0500
commit8f0c5a6077fd245cf74337e4fdb98445418f608c (patch)
tree5d0289c5d3bb1ace7750cd9d26a586a0b8ee4ddf
parent9afa0420b0d34d8484a71ae278e4dbd1630a035a (diff)
Index and min-content fix
-rw-r--r--client.html4
-rw-r--r--index.html42
-rw-r--r--scripts/gui/input.js2
-rw-r--r--styles/home/base.css4
4 files changed, 26 insertions, 26 deletions
diff --git a/client.html b/client.html
index 87963a3..0da27b6 100644
--- a/client.html
+++ b/client.html
@@ -79,7 +79,6 @@
<div class="content">
<div class="games">
- <div class="game">Hello</div>
</div>
<div class="info">
@@ -106,9 +105,6 @@
</div>
<div class="settings" >
- <div class="input-container" type="color" onclick="this.getElementsByTagName('input')[0].click()">
- <input type="color">
- </div>
</div>
</div>
</div>
diff --git a/index.html b/index.html
index 2f20bc5..d7d5255 100644
--- a/index.html
+++ b/index.html
@@ -33,17 +33,7 @@
<body>
<div class="content">
<p style="font-size: 30px; font-weight: normal;">Web<span style="color: #0084ff; font-weight: bold;">Cards</span></p>
- <div>
- <div class="input-container" tabindex="0" type="select">
- <div id="protocol" tabindex="0" selected="1" class="input-select">
- <div value="ws://" onmousedown="MakeInput.selOption(this)">ws</div>
- <div value="wss://" onmousedown="MakeInput.selOption(this)" selected="true">wss</div>
- </div>
- </div>
-
- <input id="addr" type="text" value="localhost">
-
- <input id="port" type="number" value="4040">
+ <div id="options">
</div>
<button id="conn" onclick="connect()">Connect</button>
@@ -113,17 +103,31 @@
</script>
<script>
- var proto = document.getElementById("protocol");
- var addr = document.getElementById("addr");
- var port = document.getElementById("port");
- var conn = document.getElementById("conn");
+ const Options = [
+ {
+ type: "select",
+ args: [["WSS", "WS"], ["wss://", "ws://"]],
+ title: "Protocol"
+ },
+ {
+ type: "text",
+ args: ["localhost"],
+ title: "Server URL"
+ },
+ {
+ type: "number",
+ args: [4040],
+ title: "Server Port"
+ }
+ ];
- //t.onchange = updateLink;
- //a.onchange = updateLink;
- //p.onchange = updateLink;
+ var optionsEL = document.getElementById("options");
+ var options = new Settings(Options);
+ options.putSettings(optionsEL);
function connect() {
- let concat = MakeInput.selValue(proto) + addr.value + ":" + port.value;
+ let serverParts = options.getSettings();
+ let concat = serverParts[0] + serverParts[1] + ":" + serverParts[2];
addAddr(concat);
//c.setAttribute("href", url);
window.location = "client.html?s=" + concat + "&g=-1";
diff --git a/scripts/gui/input.js b/scripts/gui/input.js
index 2925a1f..2ceb6f3 100644
--- a/scripts/gui/input.js
+++ b/scripts/gui/input.js
@@ -226,7 +226,7 @@ class MakeInput {
static titleWrap(el, title) {
var wrapper = document.createElement("div");
wrapper.className = "input-title-wrapper";
- wrapper.setAttribute("type", el.getAttribute(type));
+ wrapper.setAttribute("type", el.getAttribute("type"));
wrapper.setAttribute("data-title", title);
wrapper.appendChild(el);
diff --git a/styles/home/base.css b/styles/home/base.css
index a082ec2..13a1749 100644
--- a/styles/home/base.css
+++ b/styles/home/base.css
@@ -32,6 +32,8 @@ div.content {
flex-direction: column;
align-items: center;
+
+ width: min-content;
}
a, button {
@@ -59,8 +61,6 @@ div.content > div.prev {
width: 100%;
margin: 10px;
- border-radius: 5px;
-
display: block;
padding: 0;