diff --git a/src/app/quiz/quiz.page.html b/src/app/quiz/quiz.page.html index 1c93e22..0614040 100644 --- a/src/app/quiz/quiz.page.html +++ b/src/app/quiz/quiz.page.html @@ -1,41 +1,60 @@ - -
-

{{ secondsPerQuestion }}

- - -
-
- -
-
-

Question {{ selectedQuestion + 1 }}/{{ questions.length }}

-
- - + +
+

{{ secondsPerQuestion }}

+ + +
+
+ +
+
+

Question {{ selectedQuestion + 1 }}/{{ questions.length }}

+
+ +
    + + +
  • + +
  • -
- - - +
  • + +
  • +
    + + + +
    + + + + + + +
    +
    +

    Yay!

    +

    + You've completed all the fan Quiz questions! +

    +
    +
    + + + +
    diff --git a/src/app/quiz/quiz.page.scss b/src/app/quiz/quiz.page.scss index af7afca..b085fd3 100644 --- a/src/app/quiz/quiz.page.scss +++ b/src/app/quiz/quiz.page.scss @@ -145,4 +145,32 @@ display: block; transform: scale(0.3); } +} + +.report-card { + background-color: white; + padding: 20px; + height: 250px; + display: flex; + align-items: center; + justify-content: center; + width: 80%; + margin: 20vh auto; + border-radius: 10px; + text-align: center; + background-color: lighten($blue-grey, 35%); + box-shadow: 0px 3px 5px $dark-blue; + + h2 { + color: $green; + font-size: 1.5rem; + margin: 10px 0; + } + + p { + margin: 10px 0; + color: darken($blue-grey, 20%); + font-size: 1.2rem; + line-height: 1.5; + } } \ No newline at end of file diff --git a/src/app/quiz/quiz.page.ts b/src/app/quiz/quiz.page.ts index fd288bf..736a1e2 100644 --- a/src/app/quiz/quiz.page.ts +++ b/src/app/quiz/quiz.page.ts @@ -22,10 +22,18 @@ export class QuizPage implements OnInit { correctAnswer?: string, secondsAllotted: number }>; + showReport: boolean = true; constructor() { } ngOnInit() { + this.startQuiz(); + } + + + startQuiz() { + this.selectedQuestion = 0; + this.showReport = false; let timer = setInterval(() => { if (this.secondsPerQuestion === 0) { @@ -75,6 +83,16 @@ export class QuizPage implements OnInit { this.selectedQuestion += 1; this.secondsPerQuestion = this.questions[this.selectedQuestion].secondsAllotted; this.questionType = this.questions[this.selectedQuestion].type; + } else { + this.showReport = true; + } + } + + getCardEvent(data) { + if (data) { + if (data.end) { + this.nextQuestion(); + } } } diff --git a/src/app/quiz/swipe-cards/swipe-cards.component.html b/src/app/quiz/swipe-cards/swipe-cards.component.html index 668f97f..206e817 100644 --- a/src/app/quiz/swipe-cards/swipe-cards.component.html +++ b/src/app/quiz/swipe-cards/swipe-cards.component.html @@ -2,14 +2,14 @@
    +

    {{ question.text }}

    -
    - +
    \ No newline at end of file diff --git a/src/app/quiz/swipe-cards/swipe-cards.component.scss b/src/app/quiz/swipe-cards/swipe-cards.component.scss index e545831..52fedf4 100644 --- a/src/app/quiz/swipe-cards/swipe-cards.component.scss +++ b/src/app/quiz/swipe-cards/swipe-cards.component.scss @@ -13,10 +13,8 @@ .card { margin: 0; padding: 15px; - display: inline-block; width: 100%; - height: 300px; background: #FFFFFF; border-radius: 20px; box-shadow: 0px 0px 15px -2px $dark-blue; @@ -27,6 +25,24 @@ cursor: -webkit-grab; cursor: -moz-grab; cursor: grab; + + + img { + width: 100%; + object-fit: cover; + display: block; + border-radius: 10px; + margin-bottom: 10px; + height: 230px; + } + + p { + text-align: center; + margin: 0; + font-size: 1.2rem; + color: darken($blue-grey, 20%); + font-weight: 500; + } } @@ -35,8 +51,8 @@ position: fixed; z-index: 1; bottom: 10vh; - width: 120px; - left: calc(50% - 60px); + width: 100px; + left: calc(50% - 50px); overflow: visible; align-items: center; justify-content: space-between; @@ -54,6 +70,7 @@ display: flex; align-items: center; justify-content: center; + margin: 0; &:first-child { margin-left: -30px; diff --git a/src/app/quiz/swipe-cards/swipe-cards.component.ts b/src/app/quiz/swipe-cards/swipe-cards.component.ts index 9ea3f27..15e8a9f 100644 --- a/src/app/quiz/swipe-cards/swipe-cards.component.ts +++ b/src/app/quiz/swipe-cards/swipe-cards.component.ts @@ -31,6 +31,11 @@ export class SwipeCardsComponent implements OnInit { this.tinderCardsArray = this.tinderCards.toArray(); this.tinderCards.changes.subscribe(()=>{ this.tinderCardsArray = this.tinderCards.toArray(); + if(this.tinderCardsArray.length === 0) { + this.cardEvent.emit({ end: true }); + } else { + this.cardEvent.emit({ end: false }); + } }); }