/
index.html
49 lines (40 loc) · 1.23 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
<!doctype html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/css/styles.css"/>
<script src="/socket.io/socket.io.js"></script>
<script src="https://code.jquery.com/jquery-1.12.0.min.js"></script>
<script>
function changeImage(img, newurl) {
document.getElementById(img).src= newurl;
}
var socket = io();
socket.on('newpic', function(msg){
changeImage("img", msg)
});
document.addEventListener("keydown", keyDownTextField, false);
function keyDownTextField(e) {
var keyCode = e.keyCode;
socket.emit("kp", e.keyCode);
console.log(keyCode);
}
function getresult() {
socket.emit("idplease", "What is my id");
socket.on("yourid", function(id) {
$.get("http://ec2-52-11-118-34.us-west-2.compute.amazonaws.com:8000/district?userID=" + id, function(data) {
alert("IT'S A MATCH:" data[0]);
})
})
}
</script>
</head>
<body>
<div id = "screen">
<img id = "img" src="https://upload.wikimedia.org/wikipedia/commons/3/33/Nicolas_Cage_2011_CC.jpg" alt="Street View picture">
<p id = "overlay"></p>
</div>
<div id="timderpics">
<img class = "buttons" src = "images/no-inkscape.png" onclick="getresult()">
<img class = "buttons" src = "images/yes-inkscape.png">
</div>
</body>