forked from jc1arke/pietimer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
88 lines (67 loc) · 1.95 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>Pie Timer</title>
<style type="text/css">
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
<script type="text/javascript" src="./jquery.pietimer.js"></script>
<script type="text/javascript">
$(function(){
$('.boom').hide();
$('#demo').pietimer({
seconds: 10,
color: 'rgba(0, 0, 0, 0.8)',
height: 100,
width: 100
},
function(){
$('.boom').show('slow');
});
$('a#start').click(function(){
$('.boom').hide();
$('#demo').pietimer('start');
return false;
});
$('a#pause').click(function(){
$('#demo').pietimer('pause');
return false;
});
});
</script>
</head>
<body>
<h1>Pietimer</h1>
<p>Pietimer injects a canvas element into the page which has an ever reducing pie shaped timer. Once the timer is complete a callback function is performed.</p>
<p><a href="https://github.com/knorthfield/pietimer/">Download from GitHub</a></p>
<hr />
<h2>Demo</h2>
<p><a href="#" id="start" class="btn">Start Timer</a></p>
<p><a href="#" id="pause" class="btn">Pause Timer</a></p>
<p id="demo" style="height: 150px;"></p>
<h3 class="boom">Boom!</h3>
<p class="boom">The timer finished.</p>
<h2>Usage</h2>
<p>The pietimer canvas element will be injected *into* the specified element.</p>
<p>$('#element').pietimer(); // Will place pietimer inside #element</p>
<p>Don't forget to pass some options and a callback!</p>
<h2>Options</h2>
<code>
<pre>
$('#demo').pietimer({
seconds: 10,
color: 'rgba(0, 0, 0, 0.8)',
height: 100,
width: 100
},
function(){
//Do something
});
$('#demo').pietimer('start');
</pre>
</code>
<p>Height and width will be inherited from the parent element and so are optional.</p>
<p>Colour will accept any value that the canvas element accepts including hex values like #ffffff</p>
</body>
</html>