-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
72 lines (64 loc) · 1.78 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
68
69
70
71
72
<html>
<head>
<title>Canvas Clock Example</title>
<link href='http://fonts.googleapis.com/css?family=Nova%20Mono' rel='stylesheet' type='text/css'>
<style>
h1 {
text-align: center;
}
#main {
width: 400px;
margin-left: auto;
margin-right: auto;
font-family: arial, helvetica, sans-serif;
font-size: 13;
}
#clock {
display: block;
margin-left: auto;
margin-right: auto;
}
#time {
font-family: Nova Mono, Courier;
font-size: 30px;
margin: 10px;
text-align: center;
}
</style>
<script src='accessible_canvas_clock.js'></script>
</head>
<body onload="load()">
<div id="main">
<h1>
Accessible canvas clock
</h1>
<div id="unsupported" hidden style="margin: 10px">
drawFocusIfNeeded not available. Use a modern browser!
</div>
<canvas id="clock" width="150" height="150">
<input id="hour" type="range" min="1" max="12" aria-label="Hour hand">
<input id="minute" type="range" min="0" max="59" aria-label="Minute hand">
</canvas>
<div id="time">00:00</div>
<div>
<p>
This is a demo of the <tt>drawFocusIfNeeded</tt>
(<a href="https://html.spec.whatwg.org/multipage/scripting.html#dom-context-2d-drawfocusifneeded">whatwg</a>,
<a href="http://www.w3.org/html/wg/drafts/2dcontext/html5_canvas_CR/#dom-context-2d-drawfocusifneeded">w3c</a>) API for HTML Canvas elements.
</p>
<p>
Try moving the minute or hour hand with the mouse, or
tab to them with the keyboard and adjust them like sliders.
It's fully accessible using screen readers and
magnifiers.
</p>
<p>
Updated 2/23/2015 to support drawFocusIfNeeded.
</p>
<p>
Copyright 2013 by Dominic Mazzoni, Google Inc.
</p>
</div>
</div>
</body>
</html>