Skip to content

Commit 87134f0

Browse files
* round numbers displayed on Chase Car view, issue rossengeorgiev#7 * hide overflow of the vehicle name (when they are long), issue rossengeorgiev#5 * start up the app with a line saying 'no vehicles', which disapperas as soon as anything appears on the list, issue rossengeorgiev#8 * updated TODO
1 parent 6005448 commit 87134f0

File tree

7 files changed

+25
-19
lines changed

7 files changed

+25
-19
lines changed

TODO

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,6 @@
1010

1111
* in the field tracking view, distance to target vehicle
1212

13-
Optimizations
14-
-----------------------
15-
16-
* minimize footprint
17-
18-
* combine+minify JS into a single file
19-
(Google Closure? Requires rewritting)
20-
2113
known bugs
2214
------------------------
2315

css/main.css

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,20 @@ header > div {
9494
font-weight: normal;
9595
float: right;
9696
color: #aaa;
97+
}
98+
#main .header span {
99+
overflow: hidden;
100+
display: block;
101+
width: 90%;
102+
float: left;
103+
}
104+
#main .header span.center {
105+
text-align: center;
97106
}
98107
.row .header .arrow:after { content: "▲"; }
99108
.row.active .header .arrow:after { content: "▼"; }
100109

101-
#main .row { margin: 0; padding: 0; position: relative; }
110+
#main .row { background-color: #f4f4f4; margin: 0; padding: 0; position: relative; }
102111
#main .row .header {
103112
position: relative;
104113
z-index: 4;
@@ -264,9 +273,8 @@ header > div {
264273
border-bottom: 2px solid #33b5e5;
265274
}
266275
#main .data {
267-
background-color: #f4f4f4;
268276
height: 100%;
269-
padding-bottom: 10px;
277+
padding-bottom: 5px;
270278
}
271279
#main .data .left {
272280
float: left;
@@ -314,7 +322,6 @@ header > div {
314322
border-bottom: 2px solid #33b5e5;
315323
}
316324
#main .data {
317-
background-color: #f4f4f4;
318325
height: 140px;
319326
}
320327
#main .data .left {

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.

index.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,12 @@ <h2>Chase car mode</h2>
8787
<div id="map" style="dispaly: none"></div>
8888
<div id="main" style="dispaly: none">
8989
<div class="scrollwrapper">
90-
<div class="portrait"></div>
91-
<div class="landscape"></div>
90+
<div class="portrait">
91+
<div class="row active vehicle0"><div class="header"><span class="center">No vehicles :(</span></div></div>
92+
</div>
93+
<div class="landscape">
94+
<div class="row active vehicle0"><div class="header"><span class="center">No vehicles :(</span></div></div>
95+
</div>
9296
</div>
9397
</div>
9498
<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=false&amp;key=AIzaSyCOqkcNey4CCyG4X0X5qxHAhCgD8g5DwXg" type="text/javascript"></script>

js/app.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,11 @@ $(window).ready(function() {
238238
updateCurrentPosition(lat, lon);
239239

240240
// round the coordinates
241-
lat = parseInt(lat * 1000000)/1000000;
242-
lon = parseInt(lon * 1000000)/1000000;
241+
lat = parseInt(lat * 1000000)/1000000; // 6 decimal places
242+
lon = parseInt(lon * 1000000)/1000000; // 6 decimal places
243+
speed = parseInt(speed * 10)/10; // 1 decimal place
244+
accuracy = parseInt(accuracy);
245+
alt = parseInt(alt);
243246

244247
// dispaly them in the top right corner
245248
$('#app_name b').html(lat + '<br/>' + lon);

js/mobile.js

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

js/tracker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ function updateVehicleInfo(index, position) {
503503

504504
ascent_text = position.gps_alt != 0 ? vehicles[index].ascent_rate.toFixed(1) + ' m/s' : '';
505505
// start
506-
var a = '<div class="header">' + vehicle_names[index] + '<i class="arrow"></i></div>'
506+
var a = '<div class="header"><span>' + vehicle_names[index] + '</span><i class="arrow"></i></div>'
507507
+ '<div class="data">'
508508
+ '<img src="'+image+'" />'
509509
+ '<div class="left">'

0 commit comments

Comments
 (0)