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> {

View File

@@ -1,3 +1,4 @@
import type { Trail } from "./trail";
class SummitLog {
id?: string;
@@ -5,10 +6,15 @@ class SummitLog {
text?: string;
gpx?: string;
_gpx: File | null;
distance?: number
elevation_gain?: number
elevation_loss?: number
duration?: number
author?: string;
expand: {
gpx_data?: string;
trails_via_summit_logs?: Trail[];
}
constructor(date: string, params?: { id?: string, text?: string }) {

View File

@@ -7,4 +7,5 @@ export type User = {
password: string,
avatar?: string;
language?: string;
created?: string;
}