-
Notifications
You must be signed in to change notification settings - Fork 6
/
front_end.html
156 lines (151 loc) · 4.62 KB
/
front_end.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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta name='viewport'
content='width=device-width, initial-scale=1.0, maximum-scale=1.0,
user-scalable=0' >
<script type="text/javascript" charset="utf-8">
function init() {
var touchzone = document.getElementById("zone");
touchzone.addEventListener("touchend", clicke, false);
touchzone.addEventListener("touchmove", handle, false);
touchzone.addEventListener("touchstart", tostart, false);
var scrollzone = document.getElementById("scroll");
scrollzone.addEventListener("touchmove", scrollmove, false);
scrollzone.addEventListener("touchstart", tostart, false);
}
function scrollmove(event){
var a = event.touches[0].pageX;
var b = event.touches[0].pageY;
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
};
xhttp.open("POST", "scroller", true);
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhttp.send("a="+a+"&b="+b);
}
function tostart(event){
var a = event.touches[0].pageX;
var b = event.touches[0].pageY;
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
};
xhttp.open("POST", "tstart", true);
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhttp.send("a="+a+"&b="+b);
}
function clicke(event) {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
};
var a = event.changedTouches[0].pageY;
xhttp.open("POST", "click", true);
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhttp.send("a="+a);
}
function dragm() {
var btn = document.getElementById("drag");
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
};
xhttp.open("POST", "dradhandler", true);
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhttp.send();
if (btn.innerHTML == "Drag mouse"){
btn.innerHTML = "Move mouse";
}
else{
btn.innerHTML = "Drag mouse";
}
}
function sendData(a,b,g) {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
};
xhttp.open("POST", "handler", true);
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhttp.send("a="+a+"&b="+b);
}
function handle(event) {
var alpha = event.touches[0].pageX;
var beta = event.touches[0].pageY;
sendData(alpha,beta);
}
function on_input(){
var data = document.getElementById("inpfield").value;
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
};
xhttp.open("POST", "typed", true);
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhttp.send("data="+data);
}
function enter_but(){
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
};
xhttp.open("POST", "enter", true);
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhttp.send("data="+"data");
}
</script>
<meta name="" content="">
<title></title>
<style>
.center{
position: fixed;
background-color: rgb(230,230,230);
width:80%;
height:400px;
top:300px;
left:46%;
color:rgb(200,200,200);
font-weight:bold;
transform: translate(-50%,-50%);
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
html{
touch-action:pan-down
}
.scrollarea{
position: fixed;
background-color: rgb(230,230,230);
width:30px;
height:400px;
top:300px;
left:92.05%;
color:rgb(200,200,200);
font-weight:bold;
transform: translate(-50%,-50%);
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
text-align:center;
}
</style>
</head>
<body onload="init()">
<p style="text-align:center;">Type on PC
<input id="inpfield"type="text" oninput=on_input()></input>
<button type="button" onclick="enter_but()">Enter</button></p>
<div style="text-align:center;">
<button id="drag" type="button" onclick="dragm()">Drag mouse</button>
</div>
<div class="center" id="zone">
<p align="center"><br><br><br><br><br><br>Left click area<br><br><br><br><br><br><hr></p>
<p align="center"><br>Right click area</p>
</div>
<div class="scrollarea" id="scroll">
<p><br><br><br><br><br>S<br>C<br>R<br>O<br>L<br>L</p>
</div>
</body>
</html>