-
Notifications
You must be signed in to change notification settings - Fork 0
/
ctrl.html
112 lines (100 loc) · 2.49 KB
/
ctrl.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
<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="screen-orientation" content="landscape">
<meta name="full-screen" content="yes">
<title>任务结束</title>
<style type="text/css">
html {
background-color: #1E1E1E;
color: white;
height: 100vh;
width: 100vw;
font-family: Arial, Helvetica, sans-serif;
-webkit-tap-highlight-color: transparent;
}
body {
margin: 10vh auto;
padding: 0;
}
div.container {
height: 80vh;
width: 80vw;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
margin: auto;
padding: auto;
}
div.button {
margin: 0 auto;
}
div.button:hover {
cursor: pointer;
transform: scale(1.1);
}
div.button:active {
transform: scale(1.2);
}
div#title {
font-size: xx-large;
line-height: 300%;
}
img {
width: 56px;
height: 56px;
vertical-align: middle;
}
span {
font-size: x-large;
line-height: 200%;
vertical-align: middle;
}
</style>
<script type="text/javascript">
async function control(command, url) {
data = {
'control': command,
}
let response = await fetch('/', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify(data)
});
if (response.ok) {
setTimeout(function () {
location.href = url
}, 500)
}
}
</script>
</head>
<body>
<div class="container">
<div>
<div id="title">本轮任务结束</div>
<div class="button" onclick="control('replay', '/resp.html')">
<img src="res/replay.png" alt="再来" />
<span>再来一遍</span>
</div>
<div class="button" onclick="control('restart', '/')">
<img src="res/home.png" alt="重开" />
<span>重新开始</span>
</div>
<div class="button" onclick="control('finish', '/end.html')">
<img src="res/end.png" alt="结束" />
<span>结束任务</span>
</div>
</div>
</div>
<!-- <footer>Copyright (C) 2023 LiTuX, all wrongs reserved.</footer> -->
</body>
</html>