forked from ardaku/human
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathweb.html
34 lines (33 loc) · 947 Bytes
/
web.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
<html lang="en">
<head>
<meta charset="utf-8">
</head>
<body>
<input id="human_rust_crate__" type="text" size="1">
<script>
let human = document.getElementById("human_rust_crate__");
window.addEventListener("focus", function() {
setTimeout(function () { human.focus(); });
});
human.style.border = "0";
human.style.padding = "0";
human.style.margin = "0";
human.style.position = "fixed";
human.style.top = "0";
human.style.left = "0";
human.style.width = "0";
human.style.height = "0";
human.addEventListener("input", handle_input);
human.addEventListener("blur", function() {
setTimeout(function () { human.focus(); });
});
human.focus();
function handle_input(event) {
if(!event.isComposing) {
console.log(this.value);
this.value = "";
}
}
</script>
</body>
</html>