mirror of
https://github.com/sigmasternchen/combinationLockPG
synced 2025-03-15 19:48:54 +00:00
test
This commit is contained in:
parent
a683144414
commit
7c33835b8a
3 changed files with 26 additions and 4 deletions
10
index.html
Normal file
10
index.html
Normal file
|
@ -0,0 +1,10 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<script src="lock.js"></script>
|
||||
<script src="main.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<canvas id="canvas" width="200px" height="200px" style="background-color: #fff;"></canvas>
|
||||
</body>
|
||||
</html>
|
6
lock.js
6
lock.js
|
@ -1,5 +1,5 @@
|
|||
var context;
|
||||
var main = function () {
|
||||
var lockinit = function () {
|
||||
var canvas = document.getElementById("canvas");
|
||||
context = canvas.getContext('2d');
|
||||
drawLock();
|
||||
|
@ -47,6 +47,4 @@ var drawDial = function(rot) {
|
|||
context.fill();
|
||||
}
|
||||
context.restore();
|
||||
}
|
||||
|
||||
window.onload = main;
|
||||
}
|
14
main.js
Normal file
14
main.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
var onSucess = function(heading) {
|
||||
var element = document.getElementById('heading');
|
||||
element.innerHTML = 'Heading: ' + heading;
|
||||
};
|
||||
|
||||
var onErrors = function() {
|
||||
alert('onError!');
|
||||
};
|
||||
|
||||
var startup = function(){
|
||||
var watchID = navigator.compass.watchHeading(onSuccess, onErrors);
|
||||
lockinit();
|
||||
}
|
||||
window.onload = startup;
|
Loading…
Reference in a new issue