-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsample.html
executable file
·67 lines (56 loc) · 1.63 KB
/
sample.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
<!doctype html>
<html>
<head>
<title>Test NGX Client</title>
</head>
<body id="ngx_area">
<canvas id="testGame" width="800" height="600"></canvas>
</body>
<script src="http://code.jquery.com/jquery-1.11.1.js"></script>
<script src="bower_components/jquery-qrcode/dist/jquery.qrcode.min.js"></script>
<script src="jquery.qrctl.js"></script>
<script>
$( "#ngx_area" ).ngxQrCtl({
'position':'top',
'width':10,
'height':10,
'debug':true
});
$('#ngx_area').bind('swipeleft',function(event) {
alert("!!");
});
$('#ngx_area').bind('btnDown',function(event,key){
console.log(key);
});
$('#ngx_area').bind('move',function(event,x,y){
$.moveCircle(x,y);
});
// Test
var canvas = document.getElementById('testGame');
var context = canvas.getContext('2d');
var centerX = canvas.width / 2;
var centerY = canvas.height / 2;
var radius = 70;
$.init = function() {
context.beginPath();
context.arc(centerX, centerY, radius, 0, 2 * Math.PI, false);
context.fillStyle = 'green';
context.fill();
context.lineWidth = 5;
context.strokeStyle = '#003300';
context.stroke();
}
$.moveCircle = function(x,y) {
// Clear Canvas
context.clearRect(0, 0, canvas.width, canvas.height);
context.beginPath();
context.arc(x, y, radius, 0, 2 * Math.PI, false);
context.fillStyle = 'green';
context.fill();
context.lineWidth = 5;
context.strokeStyle = '#003300';
context.stroke();
}
$.init();
</script>
</html>