forked from jywarren/starsandcrafts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
100 lines (70 loc) · 2.31 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<!DOCTYPE html>
<html lang="en">
<head>
<title>Stars and Crafts</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<style>
body {
background-color: rgb(200,200,200);
margin: 0px;
overflow: hidden;
}
#info {
position: absolute;
top: 0px; width: 100%;
color: #ffffff;
padding: 5px;
font-family:Monospace;
font-size:13px;
font-weight: bold;
text-align:center;
}
a {
color: #ffffff;
}
</style>
<script src="bower_components/jquery/dist/jquery.min.js"></script>
<link href="bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="bower_components/fontawesome/css/font-awesome.min.css" rel="stylesheet">
</head>
<body>
<div id="container"></div>
<div id="info"><a href="https://github.com/jywarren/starsandcrafts" target="_blank">Stars & Crafts</a></div>
<hr />
<div id="controls" class="container" style="text-align:center;">
<p>To create a new environment, enter a unique key and press "Host". To connect to an existing server, enter the key listed at the top of the server's display, and select a role.</p>
<div class="form-group">
<label for="key">Enter a key:</label>
<input id="key" class="input-key form-control input-block" />
</div>
<p>
<a class="btn btn-default btn-server">Host</a>
</p>
<h4>Roles</h4>
<p>
<a class="btn btn-default btn-helm">Helm</a>
<a class="btn btn-default btn-sensors disabled">Sensors</a>
</p>
</div>
<script>
(function() {
$('.input-key').val(btoa(Math.random()).split('=')[0].substr(3, 4));
$('.btn-server').click(function(e) {
e.preventDefault();
window.location = "server/#key=" + $('.input-key').val();
});
var roles = [
"helm",
"sensors"
];
roles.forEach(function(role) {
$('.btn-' + role).click(function(e) {
e.preventDefault();
window.location = "roles/" + role + "/#key=" + $('.input-key').val();
});
});
})();
</script>
</body>
</html>