Skip to content

Commit 5c47fe2

Browse files
Offline mode is online
* removed the daylight icon * added settings icon * updated HabitatFont with 1 new glyph * the daylight option was moved to the settings page * the app will now store the latest position data and use it when network is not available. * added loading bar at starta (indicating applicationCache progress) * added option to force refresh applicationCache * added option to have station placed on the map as well as a chase car * updated README
1 parent fea421a commit 5c47fe2

File tree

13 files changed

+303
-113
lines changed

13 files changed

+303
-113
lines changed

README.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,29 @@ Also, works great on desktops, laptops or netbooks. It is build upon
66

77
[Live version](http://habhub.org/mt/)
88

9-
## Geo position
9+
## Features
10+
11+
* HAB tracking with Habitat
12+
* Map tracker with Google Maps API 3
13+
* Chase Car functionality
14+
* Daylight cycle overlay, for long flights
15+
16+
### Geo position
1017

1118
The app will ask for permission to use your location.
12-
This is requird for some of the features. It is **important** to note that
19+
This is required for some of the features. It is **important** to note that
1320
your location will not be made available or send to anyone. Unless you enable
1421
the `chase car mode`, which will periodically upload it to habitat. _The app
1522
will always start with `chase car mode` disabled._
1623

24+
### Offline storage
25+
26+
The app will ask to use offline storage. You will need to accept in order to
27+
use the offline capabilities. The app will cache all files making it available
28+
even when there is no network coverage. Latest position data will also be stored
29+
and used when you start up with no network. When you get back online, the app
30+
will fetch the latest position data.
31+
1732
## Design
1833

1934
Author: Daniel Saul [@danielsaul](https://github.com/danielsaul)
@@ -24,11 +39,11 @@ Author: Daniel Saul [@danielsaul](https://github.com/danielsaul)
2439

2540
## Currently Supported Devices
2641

27-
### iOS, Anroid, Deskstops
42+
### iOS, Android, Deskstops
2843

2944
* Modern browser required (IE not supported)
3045
* Browsers supporting _Geolocation API_ will have `Chase car mode` available
31-
* For best expirence on _iOS devices_, add the webapp to your home screen.
46+
* For best experience on _iOS devices_, add the webapp to your home screen.
3247
This will hide Safari's UI and make it look like a native app. I think it also allows it to run in the background.
3348

3449

cache.manifest

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
CACHE MANIFEST
2-
# version 3
2+
# version 11
33

4+
# gogole maps files
5+
http://maps.google.com/maps/api/js?v=3.10&sensor=false&key=AIzaSyCOqkcNey4CCyG4X0X5qxHAhCgD8g5DwXg
6+
http://maps.gstatic.com/intl/en_us/mapfiles/api-3/10/20/main.js
7+
http://maps.gstatic.com/cat_js/intl/en_us/mapfiles/api-3/10/20/%7Bcommon,map,util,geometry,poly,overlay%7D.js
8+
http://maps.gstatic.com/cat_js/intl/en_us/mapfiles/api-3/10/20/%7Bstats%7D.js
9+
http://maps.gstatic.com/cat_js/intl/en_us/mapfiles/api-3/10/20/%7Bonion%7D.js
10+
http://maps.gstatic.com/mapfiles/openhand_8_8.cur
11+
http://maps.gstatic.com/mapfiles/transparent.png
12+
13+
# app files
414
img/logo.png
515
img/marker-you.png
616
img/markers/antenna-green.png

css/habitat-font.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,5 @@
7575
.icon-target:before { content: "\f006"; }
7676
.icon-earth:before { content: "\f007"; }
7777
.icon-daylight:before { content: "\f008"; }
78+
.icon-settings:before { content: "\f010"; }
7879

css/main.css

Lines changed: 42 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,29 @@ html, body {
2020
z-index: 99;
2121
width: 100%;
2222
height: 100%;
23-
background: #00A3D3 url('../img/logo.png') no-repeat center center;
23+
background: #00A3D3;
24+
}
25+
#loading > div {
26+
position: absolute;
27+
top: 50%;
28+
left: 50%;
29+
width: 198px;
30+
height: 200px;
31+
margin-top: -100px;
32+
margin-left: -99px;
33+
}
34+
#loading .bar {
35+
position: relative;
36+
width: 200px;
37+
height: 5px;
38+
border-radius: 3px;
39+
background: #005C76;
40+
}
41+
#loading .complete {
42+
width: 0px;
43+
height: 5px;
44+
border-radius: 3px;
45+
background: #fff;
2446
}
2547

2648
header {
@@ -115,8 +137,13 @@ header > div {
115137
.row .header .arrow:after { content: "▲"; }
116138
.row.active .header .arrow:after { content: "▼"; }
117139

118-
#main .row { background-color: #f4f4f4; margin: 0; padding: 0; position: relative; }
119-
#main .row .header {
140+
#main .row {
141+
background-color: #f4f4f4;
142+
margin: 0;
143+
padding: 0;
144+
position: relative;
145+
}
146+
#main .row .header {
120147
position: relative;
121148
z-index: 4;
122149
cursor: pointer;
@@ -160,6 +187,7 @@ header > div {
160187
#cc_callsign {
161188
text-align: right;
162189
padding: 4px 10px;
190+
margin: 0;
163191
}
164192
.slimContainer {
165193
margin: 20px auto;
@@ -173,15 +201,21 @@ header > div {
173201
width: 100%;
174202
display: block;
175203
margin: 5px;
204+
vertical-align: middle;
205+
}
206+
.slimContainer .row.info {
207+
margin-top: 10px;
176208
}
177209
.slimContainer .row > span {
178210
float: left;
179211
}
212+
.slimContainer .row.option > span {
213+
line-height: 30px;
214+
}
180215
.slimContainer .row > span.r {
181216
float: right;
182217
}
183218

184-
185219
/* iOS styled switch buttons
186220
*/
187221
.switch {
@@ -190,7 +224,6 @@ header > div {
190224
width: 77px;
191225
border: 1px solid #979797;
192226
border-radius: 20px;
193-
margin-top: -5px;
194227
box-shadow: inset 0 1px 3px #BABABA, inset 0 12px 3px 2px rgba(232, 232, 232, 0.5);
195228
cursor: pointer;
196229
overflow: hidden;
@@ -310,11 +343,11 @@ header > div {
310343
line-height: 11px;
311344
font-size: 11px;
312345
}
313-
#main .data dl > dt.recievers {
346+
#main .data dl > dt.receivers {
314347
font-size: 10px;
315348
font-weight: normal;
316349
}
317-
#main .data dl > dd.recievers {
350+
#main .data dl > dd.receivers {
318351
font-size: 10px;
319352
}
320353
#main .row .data img {
@@ -364,11 +397,11 @@ header > div {
364397
line-height: 11px;
365398
font-size: 11px;
366399
}
367-
#main .data dl > dt.recievers {
400+
#main .data dl > dt.receivers {
368401
font-size: 10px;
369402
font-weight: normal;
370403
}
371-
#main .data dl > dd.recievers {
404+
#main .data dl > dd.receivers {
372405
font-size: 10px;
373406
}
374407
}

css/mobile.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

font/HabitatFont.eot

617 Bytes
Binary file not shown.

font/HabitatFont.svg

Lines changed: 1 addition & 0 deletions
Loading

font/HabitatFont.ttf

880 Bytes
Binary file not shown.

font/HabitatFont.woff

524 Bytes
Binary file not shown.

index.html

Lines changed: 57 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,19 @@
1515
</head>
1616
<body>
1717

18-
<div id="loading"></div>
18+
<div id="loading">
19+
<div>
20+
<img src="img/logo.png" />
21+
<div class="bar" style="display: none"><div class="complete"></div></div>
22+
</div>
23+
</div>
1924

2025
<header style="display: none">
2126
<div class="container">
2227
<ol class="nav">
2328
<li class="home"><i class="icon-habhub"></i></li>
2429
<li class="chasecar" style="display: none"><i class="icon-car"></i></li>
25-
<li class="daylight"><i class="icon-daylight"></i></li>
30+
<li class="settings"><i class="icon-settings"></i></li>
2631
<li class="about last"><i class="icon-question"></i></li>
2732
</ol>
2833
<span id="locate-me" style="display: none"><i class="icon-target"></i></span>
@@ -47,18 +52,64 @@ <h2>Contribute</h2>
4752
</span>
4853
</div>
4954
</div>
55+
<div id="settingsbox" style="display: none">
56+
<div class="slimContainer">
57+
<h2>Settings</h2>
58+
<hr>
59+
<div class="row option">
60+
<span><b>Daylight overlay</b></span>
61+
<div class="switch off" id="sw_daylight">
62+
<span class="thumb"></span>
63+
<input type="checkbox" id="opt_daylight">
64+
</div>
65+
</div>
66+
<div class="row option">
67+
<span><b>Availability offline</b></span>
68+
<div class="switch off" id="sw_offline">
69+
<span class="thumb"></span>
70+
<input type="checkbox" id="opt_offline">
71+
</div>
72+
</div>
73+
<div class="row option">
74+
<span><b>Mobile station</b></span>
75+
<div class="switch off" id="sw_station">
76+
<span class="thumb"></span>
77+
<input type="checkbox" id="opt_station">
78+
</div>
79+
</div>
80+
<div class="row info">
81+
<span>
82+
In Chase Car mode, a station will appear together with the chase car on the map.
83+
</span>
84+
</div>
85+
<div class="row option">
86+
<span><b>Force refresh cache</b></span>
87+
<div class="switch off" id="sw_cache">
88+
<span class="thumb"></span>
89+
<input type="checkbox" id="opt_cache">
90+
</div>
91+
</div>
92+
<div class="row info">
93+
<span>
94+
Make sure you have a stable internet connection.
95+
The size of cache files is around 600 KB.
96+
</span>
97+
</div>
98+
<span>&nbsp;</span>
99+
</div>
100+
</div>
50101
<div id="chasecarbox" style="display: none">
51102
<div class="slimContainer">
52103
<h2>Chase car mode</h2>
53104
<hr>
54-
<div class="row">
105+
<div class="row option">
55106
<span>Enable</span>
56-
<div class="switch off">
107+
<div class="switch off" id="sw_chasecar">
57108
<span class="thumb"></span>
58109
<input type="checkbox" id="chasecar_on">
59110
</div>
60111
</div>
61-
<div class="row">
112+
<div class="row option">
62113
<span>Callsign</span>
63114
<span class="r"><input type="text" id="cc_callsign" style="width: 140px;"/></span>
64115
</div>
@@ -103,7 +154,7 @@ <h2>Chase car mode</h2>
103154
</div>
104155
</div>
105156
</div>
106-
<script src="http://maps.google.com/maps/api/js?sensor=false&key=AIzaSyCOqkcNey4CCyG4X0X5qxHAhCgD8g5DwXg" type="text/javascript"></script>
157+
<script src="http://maps.google.com/maps/api/js?v=3.10&sensor=false&key=AIzaSyCOqkcNey4CCyG4X0X5qxHAhCgD8g5DwXg" type="text/javascript"></script>
107158
<script type="text/javascript" language="javascript" src="js/mobile.js"></script>
108159
<!--
109160
<script type="text/javascript" language="javascript" src="js/jquery-1.8.3-min.js"></script>

0 commit comments

Comments
 (0)