-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.js
44 lines (35 loc) · 1018 Bytes
/
main.js
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
var WIDTH = 320;
var HEIGHT = 320;
var x = WIDTH / 2;
var y = HEIGHT / 2;
var offset = 0;
window.onload = function () {
// Create our canvas to draw on
var canvas = document.getElementById('canvas');
var ctx = canvas.getContext("2d");
clock(ctx);
setInterval(function () {
clock(ctx);
}, 1000);
window.Mojo = {
screenOrientationChanged: function screenOrientationChanged(orientation) {
switch (orientation) {
case "up": offset = 0; break;
case "left": offset = Math.PI / 2; break;
case "down": offset = Math.PI; break;
case "right": offset = Math.PI * 1.5; break;
}
clock(ctx);
PalmSystem.playSoundNotification("vibrate");
}
};
// Start the palm system
if (typeof PalmSystem !== 'undefined') {
PalmSystem.stageReady();
if (PalmSystem.enableFullScreenMode) {
console.log("About to set FullScreenMode");
PalmSystem.enableFullScreenMode(true);
console.log("Just set FullScreenMode");
}
}
}