Actualizar index.html
This commit is contained in:
17
index.html
17
index.html
@@ -469,13 +469,16 @@
|
|||||||
const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
|
const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
|
||||||
const km = R * c;
|
const km = R * c;
|
||||||
|
|
||||||
const totalMins = Math.round((km/35)*60) + 5;
|
const totalMins = Math.round((km/35)*60) + 5;
|
||||||
|
|
||||||
const startedAt = new Date(data.location.updated_at).getTime();
|
// Simplemente asignamos el tiempo basado en la distancia real
|
||||||
const now = new Date().getTime();
|
let remainingMins = totalMins;
|
||||||
const diffMins = Math.floor((now - startedAt) / 60000);
|
|
||||||
|
// Calculamos el tiempo transcurrido solo para animar la barra de progreso
|
||||||
let remainingMins = totalMins - diffMins;
|
const startedAt = new Date(data.location.updated_at).getTime();
|
||||||
|
const diffMins = Math.floor((new Date().getTime() - startedAt) / 60000);
|
||||||
|
|
||||||
|
let progressPercent = (diffMins / totalMins) * 100;
|
||||||
if (remainingMins < 1) remainingMins = 1;
|
if (remainingMins < 1) remainingMins = 1;
|
||||||
|
|
||||||
let progressPercent = (diffMins / totalMins) * 100;
|
let progressPercent = (diffMins / totalMins) * 100;
|
||||||
|
|||||||
Reference in New Issue
Block a user