-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
executable file
·64 lines (62 loc) · 1.71 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
<html>
<head>
<title>Countdown Mobile</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script type="text/javascript" charset="utf-8">
if (window.location.hash == "")
{
$.getJSON('shortly/' + window.location.hash.substring(1), function(data) {
$.each(data ,function(i, element){
var dueIn = element[2];
var newElem = $('<div>' + element[0] + ' ' + element[1] + ' ' + element[2] + '</div>').css('background-color',
function(){
var minsStr = (dueIn.split(' ')[0]);
if (minsStr.toString() == 'due')
return '#FF431A'
var mins = parseInt(dueIn.split(' ')[0]);
if (mins <= 5)
return '#A3AD30'
if (mins > 5 && mins < 10)
return '#F6E27B'
if (mins >= 10)
return '#82ADA9'
});
$('body')
.append(newElem);
});
});
}
else
{
navigator.geolocation.getCurrentPosition(function(position) {
$.getJSON('shortly/'+ position.coords.latitude + '/' + position.coords.longitude + '/' + '10', function(data){
$.each(data ,function(i, element){
$('body')
.append('<a href=/#' + element.id + '>' + element.name + '</a><br />');
});
});
});
}</script>
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0" />
</head>
<style type="text/css">
@media screen and (max-device-width: 480px){
body{
-webkit-text-size-adjust:150%;
font-family:Helvetica, Arial, Verdana, sans-serif;
padding:2px;
}
div{
clear:both!important;
display:block!important;
width:100%!important;
float:none!important;
margin:2!important;
padding:0!important;
text-align:center;
}
}
</style>
<body>
</body>
</html>