-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
77 lines (65 loc) · 2.09 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=620" />
<title>Contextual Clock</title>
<link rel="stylesheet" type="text/css" href="css/main.css" />
<script src='js/jquery-1.6.2.min.js'></script>
<script src='js/jquery.contextualDate.js'></script>
<script src='js/jquery.contextualTime.js'></script>
<script src='js/jquery.contextualClock.js'></script>
<script src='js/SunriseSunset.js'></script>
<script>
(function($) {
var geo;
/** @brief When our location has been successfully established.
* @param position Our location.
*/
function geoSuccess(position)
{
var clock = $('#canvas').data('contextualClock');
clock.setCoords(position.coords.longitude,
position.coords.latitude);
$('#status').addClass('success')
.html( clock.geoStr() );
// http://maps.googleapis.com/maps/api/geocode/json?latlng=39.40,-76.94&sensor=true
}
/** @brief When our location has been successfully established.
* @param position Our location.
*/
function geoError(msg)
{
$('#status').addClass('error')
.html( ($.type(msg) === 'string' ? msg : 'failed') );
}
$(document).ready(function() {
if (navigator.geolocation)
{
navigator.geolocation.getCurrentPosition(geoSuccess, geoError);
}
else
{
geoError('not supported');
}
//$('#canvas').contextualClock({interval:10, test:true});
$('#canvas').contextualClock({interval:500});
});
}(jQuery));
</script>
</head>
<body>
<section id="wrapper">
<header><h1>Contextual Clock</h1></header>
<meta name="viewport" content="width=620" />
<article>
<p>Finding your location: <span id="status">checking...</span></p>
<canvas id='canvas'></canvas>
<div id="info">
<div class="Date"></div>
<div class="Time"></div>
</div>
</article>
</section>
</body>
</html>