-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
67 lines (61 loc) · 1.99 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<html>
<head>
<script src="http://code.jquery.com/jquery.js"></script>
<script>
var strokes=0;
var gml=0;
$(function() {
var loadGML = function() {
var id = window.location.hash.substring(1);
if (!id) return;
$.getJSON('http://000000book.com/data/' + id + '.json?callback=?', function(data) {
gml = {
id: id,
data: data,
strokes: data.gml.tag.drawing.stroke
}
var holder = $('#canvasHolder').empty();
});
}
$('#btn').click(function() {
location.hash = $('#gmlId').val();
location.reload();
});
$('#gmlId').keydown(function(e) {
if (e.which == 13) $('#btn').click();
});
loadGML();
});
</script>
<style>
#toolbar {
margin:5px;
}
#toolbar span {
color:#444;
font-size:18px;
}
input {
background:white;
border:1px solid #444;
padding:3px;
font-size:18px;
}
input[type=button] {
font-size:17px;
}
input[type=text] { color:black; }
input[type=text].unfocused {
text:#999;
}
</style>
<script src="processing.js"></script>
</html>
<body>
<div id=toolbar>
GML Sketch ID: <input class="unfocused" type=text id=gmlId value=161 />
<input type=button id=btn value="Load GML">
</div>
<canvas data-processing-sources="gml.js"></canvas>
</body>
</html>