-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
88 lines (88 loc) · 2.03 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
<!DOCTYPE html>
<html>
<head>
<title>Sprite Rover Control</title>
<style>
body {
background-color: black;
color: white;
font-family: sans-serif;
}
.navbar {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px;
}
.logo {
margin-right: 10px;
}
.active {
font-weight: bold;
color: green;
}
.content {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20px;
}
.map {
width: 50%;
height: auto;
}
.controls {
width: 50%;
display: flex;
flex-direction: column;
align-items: center;
}
.button {
margin: 10px;
padding: 10px 20px;
background-color: #333;
color: white;
border: none;
cursor: pointer;
}
</style>
</head>
<body>
<div class="navbar">
<div class="logo">
<img src="logo.png" alt="Logo" />
</div>
<div class="status">Sprite Rover: <span class="active">ACTIVE</span></div>
</div>
<div class="content">
<div class="map">
<img src="map_placeholder.png" alt="Map" />
</div>
<div class="controls">
<button class="button" accesskey="w" onclick="move('forward')">
Forward
</button>
<button class="button" accesskey="f" onclick="move('backward')">
Backward
</button>
<button class="button" accesskey="a" onclick="move('left')">
Left
</button>
<button class="button" accesskey="s" onclick="move('right')">
Right
</button>
</div>
</div>
<script>
function move(direction) {
fetch("/move", {
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
},
body: "direction=" + direction,
});
}
</script>
</body>
</html>