-
Notifications
You must be signed in to change notification settings - Fork 0
/
HtmlMinta.html
236 lines (202 loc) · 6.2 KB
/
HtmlMinta.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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='UTF-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
<title>NodeMcu Webes Felület</title>
<script src="jquery-3.6.0.min.js"></script>
</head>
<style>
.top{
display: flex;
justify-content: space-evenly;
white-space: nowrap;
}
.top h3, h4{
display: inline-block;
}
.line-top{
border: 1px solid black;
border-radius: 5px;
margin-bottom: 4rem;
}
.line-bottom{
border: 1px solid black;
border-radius: 5px;
margin-top: 4rem;
margin-bottom: 3rem;
}
.arrowbuttons {
display: flex;
justify-content: center;
flex-wrap: wrap;
}
.container {
align-items: center;
display: flex;
justify-content: center;
padding: 30px 50px;
border-radius: 12px;
}
.container:hover{
background-color: rgb(200, 200, 200);
}
.container__triangle {
border-style: solid;
height: 0px;
width: 0px;
}
.container__triangle--up {
border-color: transparent transparent rgba(0, 0, 0, 1);
border-width: 0px 16px 16px;
}
.container__triangle--right {
border-color: transparent transparent transparent rgba(0, 0, 0, 1);
border-width: 16px 0px 16px 16px;
}
.container__triangle--down {
border-color: rgba(0, 0, 0, 1) transparent transparent;
border-width: 16px 16px 0px;
}
.container__triangle--left {
border-color: transparent rgba(0, 0, 0, 1) transparent transparent;
border-width: 16px 16px 16px 0px;
}
.uparrow {
display: flex;
justify-content: center;
margin-bottom: 1rem;
}
.centerarrows{
display: flex;
justify-content: center;
}
.downarrow{
display: flex;
justify-content: center;
margin-top: 1rem;
}
.bottom{
display: flex;
justify-content: center;
padding: 70px 0;
}
.bottombtn{
padding: 25px 50px;
border-radius: 12px;
font-size: 18px;
font-weight: 700;
margin: 0 35px;
}
.bottombtn:hover{
background-color: rgb(200, 200, 200);
}
</style>
<body>
<div class='top'>
<div>
<h3 style='margin-left: 10%; margin-right: 4px;'>Sensors:</h3>
<h4 id='sensors' style='margin-right: 10%;'>ON</h4>
</div>
<div>
<h3 style='margin-left: 10%; margin-right: 4px;'>Main Engine:</h3>
<h4 id='engineM' style='margin-right: 10%;'>OFF</h4>
</div>
<div>
<h3 style='margin-left: 10%; margin-right: 4px;'>Turning Engine:</h3>
<h4 id='engineT' style='margin-right: 10%;'>OFF</h4>
</div>
<div>
<h3 style='margin-right: 4px;'>Axis:</h3>
<h3 id='axis' style='margin-right: 4px;'>0</h3>
</div>
<div>
<h3 style='margin-right: 4px;'>Speed:</h3>
<h3 id='speed' style='margin-right: 4px;'>0</h3>
</div>
</div>
<hr class='line-top'>
<div class='uparrow'>
<button class='container' onclick='speedup()'>
<div class='container__triangle container__triangle--up'></div>
</button>
</div>
<div class='centerarrows'>
<button class='container' onclick='axisdown()' style="margin: 0 70px;">
<div class='container__triangle container__triangle--left'></div>
</button>
<button class='container' onclick='axisup()' style="margin: 0 70px;">
<div class='container__triangle container__triangle--right'></div>
</button>
</div>
<div class='downarrow'>
<button class='container' onclick='speeddown()'>
<div class='container__triangle container__triangle--down'></div>
</button>
</div>
<div class="bottom">
<button class='bottombtn' onclick='changeSensors()'>Sensors</button>
<button class='bottombtn' onclick='changeEngineM()'>Main Engine</button>
<button class='bottombtn' onclick='changeEngineT()'>Turning Engine</button>
</div>
</body>
<script>
function makeAjaxCall(url){$.ajax({"url": url})}
function axisup(){
makeAjaxCall("right");
var axis = document.getElementById('axis');
if(Number(axis.innerHTML) < 1000 ){
axis.innerHTML = Number(axis.innerHTML) + 100;
}
document.getElementById('axis').innerHTML = axis.innerHTML;
document.getElementById('engineT').innerHTML = 'ON';
}
function axisdown(){
makeAjaxCall("left");
var axis = document.getElementById('axis');
if(Number(axis.innerHTML) > -1000 ){
axis.innerHTML = Number(axis.innerHTML) - 100;
}
document.getElementById('axis').innerHTML = axis.innerHTML;
document.getElementById('engineT').innerHTML = 'ON';
}
function speedup(){
makeAjaxCall("forward");
var speed = document.getElementById('speed');
if(Number(speed.innerHTML) < 1000 ){
speed.innerHTML = Number(speed.innerHTML) + 100;
}
document.getElementById('speed').innerHTML = speed.innerHTML;
document.getElementById('engineM').innerHTML = 'ON';
}
function speeddown(){
makeAjaxCall("backward");
var speed = document.getElementById('speed');
if(Number(speed.innerHTML) > -1000 ){
speed.innerHTML = Number(speed.innerHTML) - 100;
}
document.getElementById('speed').innerHTML = speed.innerHTML;
document.getElementById('engineM').innerHTML = 'ON';
}
function changeSensors()
{
makeAjaxCall("sesnors");
var sensors = document.getElementById('sensors');
if (sensors.innerHTML == 'ON') sensors.innerHTML = 'OFF';
else sensors.innerHTML = 'ON';
}
function changeEngineM()
{
makeAjaxCall("stop");
document.getElementById('engineM').innerHTML = 'OFF';
document.getElementById('speed').innerHTML = 0;
}
function changeEngineT()
{
makeAjaxCall("turning-stop");
document.getElementById('engineT').innerHTML = 'OFF';
document.getElementById('axis').innerHTML = 0;
}
</script>
</html>