From f35e9675bbd853fe542879d906319bc50f8a1e01 Mon Sep 17 00:00:00 2001 From: Atharva Sawant Date: Sun, 1 Dec 2024 11:18:45 +0530 Subject: [PATCH] Modified the UI layout --- src/App.vue | 110 +++++++++++++++++----------------- src/components/FileUpload.vue | 52 +++------------- src/components/MapView.vue | 2 +- src/components/TrackList.vue | 12 +++- 4 files changed, 73 insertions(+), 103 deletions(-) diff --git a/src/App.vue b/src/App.vue index 39f9a1f..d90e612 100644 --- a/src/App.vue +++ b/src/App.vue @@ -2,7 +2,6 @@

TrackMap

-

Analyze your cycling tracks

@@ -11,70 +10,69 @@ :tracks="tracks" :selectedTrackIndex="selectedTrackIndex" @track-selected="handleTrackSelected" + @files-uploaded="handleFilesUploaded" />
- -
+ +
- -
- -
- - -
-

{{ selectedTrack.name }}

-
-
-
{{ formatDistance(selectedTrack.stats?.distance || 0) }}
-
Distance
-
-
-
{{ formatDuration(selectedTrack.stats?.duration || 0) }}
-
Duration
-
-
-
{{ selectedTrack.stats?.avgSpeed || 0 }} km/h
-
Avg Speed
-
-
-
{{ selectedTrack.stats?.elevationGain || 0 }}m
-
Elevation Gain
-
-
-
{{ formatDate(selectedTrack.stats?.startTime) }}
-
Date
+ +
+ +
+

{{ selectedTrack.name }}

+
+
+
{{ formatDistance(selectedTrack.stats?.distance || 0) }}
+
Distance
+
+
+
{{ formatDuration(selectedTrack.stats?.duration || 0) }}
+
Duration
+
+
+
{{ selectedTrack.stats?.avgSpeed || 0 }} km/h
+
Avg Speed
+
+
+
{{ selectedTrack.stats?.elevationGain || 0 }}m
+
Elevation Gain
+
+
+
{{ formatDate(selectedTrack.stats?.startTime) }}
+
Date
+
-
- - -
-

Total Statistics

-
-
-
{{ totalStats.totalTracks }}
-
Total Tracks
-
-
-
{{ totalStats.totalDistance }}
-
Total Distance (km)
-
-
-
{{ totalStats.totalDuration }}
-
Total Hours
-
-
-
{{ totalStats.avgSpeed }}
-
Avg Speed (km/h)
-
-
-
{{ totalStats.totalElevationGain }}
-
Elevation Gain (m)
+ + +
+

Total Statistics

+
+
+
{{ totalStats.totalTracks }}
+
Total Tracks
+
+
+
{{ totalStats.totalDistance }}
+
Total Distance (km)
+
+
+
{{ totalStats.totalDuration }}
+
Total Hours
+
+
+
{{ totalStats.avgSpeed }}
+
Avg Speed (km/h)
+
+
+
{{ totalStats.totalElevationGain }}
+
Elevation Gain (m)
+
diff --git a/src/components/FileUpload.vue b/src/components/FileUpload.vue index e017c51..87ea2dc 100644 --- a/src/components/FileUpload.vue +++ b/src/components/FileUpload.vue @@ -1,24 +1,11 @@ @@ -62,13 +32,6 @@ export default { setup(props, { emit }) { const uploadedFiles = ref([]) - const handleDrop = (event) => { - const files = Array.from(event.dataTransfer.files).filter(file => - file.name.toLowerCase().endsWith('.gpx') - ) - processFiles(files) - } - const handleFileSelect = (event) => { const files = Array.from(event.target.files) processFiles(files) @@ -83,7 +46,6 @@ export default { return { uploadedFiles, - handleDrop, handleFileSelect } } diff --git a/src/components/MapView.vue b/src/components/MapView.vue index 578d894..bd319f0 100644 --- a/src/components/MapView.vue +++ b/src/components/MapView.vue @@ -1,5 +1,5 @@