From ea35aa9b3fc71a844a4e88f9f161c0b46b2d7457 Mon Sep 17 00:00:00 2001 From: Will Baumbach Date: Wed, 22 Apr 2020 19:03:48 -0400 Subject: [PATCH 1/2] adding margin to bottom --- src/app/app.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/app.component.html b/src/app/app.component.html index 3f2d9d1..404ff85 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -16,4 +16,4 @@ -
\ No newline at end of file +
\ No newline at end of file From a87853ac8ea862a8287515639a471370c523b333 Mon Sep 17 00:00:00 2001 From: Will Baumbach Date: Mon, 27 Apr 2020 18:23:04 -0400 Subject: [PATCH 2/2] fixing problems with previous card and next card --- src/app/app.component.css | 4 +++ src/app/components/main/main.component.html | 8 ++++-- src/app/components/main/main.component.ts | 27 ++++++++++++++++++--- 3 files changed, 33 insertions(+), 6 deletions(-) diff --git a/src/app/app.component.css b/src/app/app.component.css index cca6f7d..ef6354a 100644 --- a/src/app/app.component.css +++ b/src/app/app.component.css @@ -20,4 +20,8 @@ img { .heading { margin-top: 12px; +} + +.alert { + margin-top: 24px; } \ No newline at end of file diff --git a/src/app/components/main/main.component.html b/src/app/components/main/main.component.html index 38e346d..c687baf 100644 --- a/src/app/components/main/main.component.html +++ b/src/app/components/main/main.component.html @@ -3,7 +3,7 @@
- Card Workout! + Card Workout
@@ -26,12 +26,16 @@ -
+
{{exercise}}

{{reps}} reps

+
+
Rest
+

2 minutes

+
diff --git a/src/app/components/main/main.component.ts b/src/app/components/main/main.component.ts index 6335c05..5ee3824 100644 --- a/src/app/components/main/main.component.ts +++ b/src/app/components/main/main.component.ts @@ -81,8 +81,7 @@ export class MainComponent implements OnInit { } public displayExercise() { - const currentCard = this.workoutDeck[this.currentCardNumber] - console.log(currentCard); + const currentCard = this.workoutDeck[this.currentCardNumber]; if (currentCard.value !== 1) { this.rest = undefined this.reps = Number(currentCard.value)+10; @@ -118,14 +117,34 @@ export class MainComponent implements OnInit { } public incrementCardCounter() { - this.displayExercise(); this.currentCardNumber += 1; this.previousCardNumber += 1; + this.displayExercise(); } public decrementCardCounter() { - this.displayExercise() this.currentCardNumber -= 1; this.previousCardNumber -= 1; + const currentCard = this.workoutDeck[this.currentCardNumber]; + const nextCard = this.workoutDeck[this.currentCardNumber+1]; + if (currentCard.suit === 'c') { + this.cCounter -= 1; + } else if (currentCard.suit === 'd') { + this.dCounter -= 1; + } else if (currentCard.suit === 'h') { + this.hCounter -= 1; + } else if (currentCard.suit === 's') { + this.sCounter -= 1; + } + if (nextCard.suit === 'c') { + this.cCounter -= 1; + } else if (nextCard.suit === 'd') { + this.dCounter -= 1; + } else if (nextCard.suit === 'h') { + this.hCounter -= 1; + } else if (nextCard.suit === 's') { + this.sCounter -= 1; + } + this.displayExercise() } }