|
|
|
|
34
|
async function updateDistance() {
|
34
|
async function updateDistance() {
|
35
|
var dist = await getDistance();
|
35
|
var dist = await getDistance();
|
36
|
var bar = document.getElementById("distance-bar");
|
36
|
var bar = document.getElementById("distance-bar");
|
37
|
- var percentage = dist>2000 ? 100 : parseInt((100.0*dist)/MAX_DISTANCE);
|
|
|
|
|
37
|
+ var percentage = dist>MAX_DISTANCE ? 100 : parseInt((100.0*dist)/MAX_DISTANCE);
|
38
|
bar.style.width=`${percentage}%`;
|
38
|
bar.style.width=`${percentage}%`;
|
39
|
bar.textContent = dist;
|
39
|
bar.textContent = dist;
|
40
|
}
|
40
|
}
|