-
Notifications
You must be signed in to change notification settings - Fork 0
/
menu.html
138 lines (133 loc) · 3.8 KB
/
menu.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>MAIN MENU</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--
<link rel="stylesheet" href="/normalize.css" type="text/css">
<link rel="stylesheet" href="/style.css" type="text/css">
-->
<link href="./grid.css" rel="stylesheet" type="text/css" />
<link href="./screen.css" rel="stylesheet" type="text/css" />
<link href="./snis-basic.css" rel="stylesheet" type="text/css" />
<style>
table.details{ margin-top:2em;}
body { padding:.5em;}
/*
a.buttonize {
margin-bottom: .5em;
min-width: 12em;
width: 12em;
display: block;
text-align: left;
margin-left: 1em;
}
*/
ul.stack {
font-size:1.25em;
list-style-type:none;
padding-left:0em; margin-bottom:1em;
text-align:left;
}
ul.stack > li{
margin-bottom: .5em;
}
ul.stack > li > a.buttonize {
max-width:12em;
display:block;
text-align:left;
}
#qrcode_launch {
width:55%;
max-width:25em;
padding:.75em;
margin:.25em;
border-top: 1px solid #20ca20;
border-right: 1px solid #20ca20;
border-bottom: 1px solid #20ca20;
border-left: 1px solid #20ca20;
border-radius: .2em;
background-color:#20cc22;
}
</style>
</head>
<body>
<div id="main" >
<div>
<div class="panel">
<h1 onClick="toggleFullScreen();">MAIN MENU</h1>
</div>
<ul class="stack">
<li><a id="a_launch_nav" href="./navigation.html" class="buttonize">NAVIGATION</a></li>
<li><a id="a_launch_sci" href="./science.html" class="buttonize">SCIENCE</a></li>
<li><a id="a_launch_wep" href="./weapons.html" class="buttonize">WEAPONS</a></li>
<li><a id="a_launch_comm" href="./communications.html" class="buttonize">COMMUNICATIONS</a></li>
<li><a id="a_launch_comm" href="./utilities.html" class="buttonize">UTILIIES</a></li>
</ul>
<div class="panel">
<!-- perhaps this should be a partialpage/client-injection (ajax'd into dom), or SSI, "navigation.nonsense.html_fragment" file ...-->
<!-- BEGIN CHUNK -->
<table class="details">
<tr><th>STATION ID</th><th>OPSEC CODE</th></tr>
<tr><td>01</td><td>0307</td></tr>
<tr><td>02</td><td>2600</td></tr>
</table>
<div id="qrcode_launch"></div>
<!-- END CHUNK -->
</div>
</div>
</div>
</body>
<script>
function toggleFullScreen() {
if (!document.fullscreenElement) {
document.documentElement.requestFullscreen();
} else {
if (document.exitFullscreen) {
document.exitFullscreen();
}
}
}
function command(text) {
var data = { command: text };
//sanitize data?
console.info("Transmitting command: "+text);
//fetch('/SHIP/STATIONNAME/TARGETNOUN/VERB?parametername=value', {
fetch("/SHIP/NAVIGATION/" + text.toUpperCase().replace(" ","/"), {
method: 'POST', // or 'PUT'
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(data),
})
.then(response => response.json())
.then(data => {
console.log('Success:', data);
sound_ack.play();
})
.catch((error) => {
console.error('Error:', error);
sound_nack.play();
});
}
</script>
<script src="./howler.js"></script>
<script>
var sound_ack = new Howl({ src: ['./sounds/tactinput_acknowledge.ogg', './sounds/tactinput_acknowledge.m4a', './sounds/tactinput_acknowledge.webm'] });
var sound_nack = new Howl({ src: ['./sounds/tactinput_neg_acknowledge.ogg', './sounds/tactinput_neg_acknowledge.m4a', './sounds/tactinput_neg_acknowledge.webm'] });
try {
toggleFullScreen();
} catch (error) {
console.warn("just warning, kinda expected this..." + error);
}
</script>
<script src="./qrcode.js"></script>
<script>
new QRCode(document.getElementById("qrcode_launch"), {
text: document.URL,
colorDark: "#111111",
colorLight: "#20cc20",
output: "svg" });
</script>
</html>