adds profile page

This commit is contained in:
Christian Beutel
2024-11-03 15:13:25 +01:00
parent 0d8ff5c83b
commit bab22301af
31 changed files with 882 additions and 133 deletions

View File

@@ -74,6 +74,7 @@ export default class GPX {
getTotals() {
let totalElevationGain = 0;
let totalElevationLoss = 0;
let totalDuration = 0;
let totalDistance = 0;
@@ -99,6 +100,8 @@ export default class GPX {
const elevationDiff = elevation - previousElevation;
if (elevationDiff > 0) {
totalElevationGain += elevationDiff;
} else {
totalElevationLoss += Math.abs(elevationDiff)
}
const distance = calculateDistance(
@@ -112,7 +115,7 @@ export default class GPX {
}
}
return { distance: totalDistance, elevationGain: totalElevationGain, duration: totalDuration }
return { distance: totalDistance, elevationGain: totalElevationGain, elevationLoss: totalElevationLoss, duration: totalDuration }
}
static parse(gpxString: string): Promise<GPX | Error> {