Actualizar index.html
This commit is contained in:
11
index.html
11
index.html
@@ -471,11 +471,14 @@
|
||||
|
||||
const totalMins = Math.round((km/35)*60) + 5;
|
||||
|
||||
const startedAt = new Date(data.location.updated_at).getTime();
|
||||
const now = new Date().getTime();
|
||||
const diffMins = Math.floor((now - startedAt) / 60000);
|
||||
// Simplemente asignamos el tiempo basado en la distancia real
|
||||
let remainingMins = totalMins;
|
||||
|
||||
let remainingMins = totalMins - diffMins;
|
||||
// Calculamos el tiempo transcurrido solo para animar la barra de progreso
|
||||
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;
|
||||
|
||||
let progressPercent = (diffMins / totalMins) * 100;
|
||||
|
||||
Reference in New Issue
Block a user