-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathclock.html
More file actions
28 lines (24 loc) · 737 Bytes
/
clock.html
File metadata and controls
28 lines (24 loc) · 737 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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>HTML Clock</title>
</head>
<body>
<canvas id="canvas" width="150" height="150"></canvas>
<script type="text/javascript" src="clock.js"></script>
<script type="text/javascript">
function render(canvas) {
var ctx = canvas.getContext('2d');
renderClock(ctx);
}
var canvas = document.getElementById('canvas');
if(canvas.getContext) {
render(canvas);
setInterval(function() { render(canvas); }, 1000);
} else {
alert('This browser doesn\'t support the canvas element :(');
}
</script>
</body>
</html>