diff --git a/android/app/src/main/assets/capacitor.config.json b/android/app/src/main/assets/capacitor.config.json index dabb2ef..25fe93a 100644 --- a/android/app/src/main/assets/capacitor.config.json +++ b/android/app/src/main/assets/capacitor.config.json @@ -11,7 +11,7 @@ }, "cordova": {}, "server": { - "cleartext": true, - "url": "http://192.168.1.66:8100" + "url": "http://192.168.1.66:8100", + "cleartext": true } } diff --git a/capacitor.config.json b/capacitor.config.json index a76b7fd..25fe93a 100644 --- a/capacitor.config.json +++ b/capacitor.config.json @@ -9,5 +9,9 @@ "launchShowDuration": 0 } }, - "cordova": {} + "cordova": {}, + "server": { + "url": "http://192.168.1.66:8100", + "cleartext": true + } } diff --git a/src/app/home/home.page.html b/src/app/home/home.page.html index 17d50aa..1f561c5 100644 --- a/src/app/home/home.page.html +++ b/src/app/home/home.page.html @@ -7,44 +7,51 @@ -
- + + - -
- Time: -
-
+
+ + - Kcal - - - 00 + Time + + + - - Medium pace + + {{ calories }} - - 00 + + {{ avgrating }} + + + {{ distanceInMeters ? distanceInMeters : 00 }} km/h + - - Distance + + Kcal + - {{ distanceInMeters ? distanceInMeters : 00 }} + Avg. Resting + + + + Distance -
+
@@ -58,9 +65,5 @@ Stop Tracking -
- {{ user.uid}} -
-
diff --git a/src/app/home/home.page.scss b/src/app/home/home.page.scss index 626b1d9..9f136d9 100644 --- a/src/app/home/home.page.scss +++ b/src/app/home/home.page.scss @@ -2,3 +2,21 @@ width: 100%; height: 60%; } + +.time { + display: flex; + align-content: center; + justify-content: center; + font-size: 35; +} + +.dataHeader { + width: auto; + height: auto; + border-radius: 25; + background-color: red; +} + +.textCenter { + text-align: center; +} diff --git a/src/app/home/home.page.ts b/src/app/home/home.page.ts index b1b3e9d..53de9de 100644 --- a/src/app/home/home.page.ts +++ b/src/app/home/home.page.ts @@ -28,6 +28,8 @@ export class HomePage { markerA = null; markerB = null; distanceInMeters = null; + calories = 0; + avgrating = 0; constructor(private afAuth: AngularFireAuth, private afs: AngularFirestore) { this.anonLogin(); @@ -56,7 +58,7 @@ export class HomePage { // TODO: change this hardcoded value for: this.user.uid this.locationsCollection = this.afs.collection( - `locations/${this.user.uid}/track`, + `locations/UU46w8P8ASfvMtUkbR8fsPm0F0k2/track`, ref => ref.orderBy('timestamp') ); @@ -115,12 +117,12 @@ export class HomePage { title: 'Marker B' }); - let distanceInMeters = google.maps.geometry.spherical.computeDistanceBetween( + const distanceInMeters = google.maps.geometry.spherical.computeDistanceBetween( this.markerA.getPosition(), this.markerB.getPosition() ); - this.distanceInMeters = distanceInMeters; + this.distanceInMeters = distanceInMeters.toFixed() / 1000; } centerMap(locations) {