-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
30 lines (28 loc) · 788 Bytes
/
index.html
File metadata and controls
30 lines (28 loc) · 788 Bytes
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
<!doctype html>
<html>
<head>
<title>GiniRate</title>
<style>
</style>
</head>
<body>
<h2>GiniRate - drinks imagined by machines</h2>
<button id="newDrink">New drink</button>
<p>New drink: <strong id="drinkName"></strong></p>
<script src="/socket.io/socket.io.js"></script>
<script src="http://code.jquery.com/jquery-1.11.1.js"></script>
<script>
//SOCKETS
var socket = io();
//Update UI on new drink
socket.on('NEW_DRINK', function(value) {
console.log("New drink: " + value.toString());
$("#drinkName").html(value.toString());
});
$('#newDrink').click(function() {
console.log("Getting a new drink:");
socket.emit('GET_NEW_DRINK');
});
</script>
</body>
</html>