Skip to content

Commit 3a2d284

Browse files
committed
#64 adjusting template
1 parent 8be0b60 commit 3a2d284

File tree

10 files changed

+23
-11
lines changed

10 files changed

+23
-11
lines changed

src/app/about-window/about-window.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div class="window">
22
<app-window-title-bar iconPath="about.png" title="About XPQuiz"></app-window-title-bar>
33
<div class="window-body">
4-
<label><b>XPQuiz</b>&nbsp;- Version 1.4.2</label>
4+
<label><b>XPQuiz</b>&nbsp;- Version 1.5.0</label>
55
<label class="main">Created by&nbsp;<b><a href="https://isahann.github.io">Isahann Hanacleto</a></b></label>
66

77
<label>Source code at&nbsp;<b><a href="https://github.com/xpquiz/xpquiz.github.io">GitHub</a></b></label>

src/app/common/icon-text-button/icon-text-button.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<button (click)="this.onClick()">
1+
<button (click)="this.onClick()" [disabled]="this.disabled">
22
<img
33
[ngSrc]="'assets/icons/30x30/' + this.iconPath"
44
alt="" [height]="this.iconSize" [width]="this.iconSize"/>

src/app/common/icon-text-button/icon-text-button.component.sass

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ button
33
flex-direction: column
44
align-items: center
55
justify-content: center
6-
min-height: 100px
6+
height: 130px
77
width: 170px
88

99
img

src/app/common/icon-text-button/icon-text-button.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ export class IconTextButtonComponent {
1313
public title: string = '';
1414
@Input()
1515
public description: string = '';
16+
@Input()
17+
public disabled: boolean = false;
1618
@Output()
1719
public onButtonClick: EventEmitter<void> = new EventEmitter<void>();
1820

src/app/game-mode-window/game-mode-window.component.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
<ng-container *ngFor="let mode of this.gameModes">
88
<app-icon-text-button
99
[iconPath]="mode.title + '.png'"
10-
[title]="mode.title.toUpperCase()"
10+
[title]="mode.title.toUpperCase().replace('-', ' ')"
1111
[description]="mode.description"
1212
(onButtonClick)="this.router.navigateByUrl('quiz-' + mode.title)"
13+
[disabled]="mode.questions < 0"
1314
></app-icon-text-button>
1415
</ng-container>
1516
</div>

src/app/game-mode-window/game-mode-window.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ export class GameModeWindowComponent {
1414

1515
protected readonly gameModes: GameMode[] = [
1616
GameMode.NORMAL,
17-
GameMode.TRIFECTA
17+
GameMode.TRIFECTA,
18+
GameMode.TIME_RUSH,
1819
];
1920

2021
constructor(

src/app/question-trifecta-window/question-trifecta-window.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ export class QuestionTrifectaWindowComponent {
147147
return {
148148
icon: correctAnswer ? '🟩' : '🟥',
149149
answer: answer!,
150-
points: correctAnswer ? `(${question.points} * 3) = ${question.points * 3} points` : '0'
150+
points: correctAnswer ? `(${question.points} * 3) = ${question.points * 3}` : '0'
151151
}
152152
}),
153153
questionPoints: correctAnswers ? totalPoints : 0,
8.06 KB
Loading
Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
11
{{#questions}}
2-
👉 {{{.}}} 👈
2+
👉 {{{.}}}
33
{{/questions}}
44

55
The answers were...
66

77
{{#correctAnswers}}
8-
🟥 {{{.}}}
8+
🟩 {{{.}}}
99
{{/correctAnswers}}
1010

1111
I picked...
1212

1313
{{#selectedAnswers}}
14-
{{{icon}}} {{{answer}}} {{{points}}}
14+
{{{icon}}} {{{answer}}} - {{{points}}} points
1515
{{/selectedAnswers}}
1616

17-
{{totalPoints}}
17+
{{#questionPoints}}
18+
Earned {{questionPoints}} points in total!
19+
{{/questionPoints}}
20+
{{^questionPoints}}
21+
Need some luck next time...
22+
{{/questionPoints}}
1823

1924
🤔 XPQuiz - xpquiz.github.io ❔

src/model/enums/GameModesEnum.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import {TemplateEnum} from "../Template";
22

33
export class GameMode {
44
static readonly NORMAL = new GameMode('normal', 'Standard mode. Answer a question, wait 3 hours to play again. Simple as that.', 1, TemplateEnum.QUESTION_RESULT);
5-
static readonly TRIFECTA = new GameMode('trifecta', 'Three questions for three times the score! At the risk of waiting 24 hours to play again.', 3, TemplateEnum.QUESTION_RESULT);
5+
static readonly TRIFECTA = new GameMode('trifecta', 'Three questions for three times the score! At the risk of waiting 24 hours to play again.', 3, TemplateEnum.QUESTION_RESULT_TRIFECTA);
6+
static readonly TIME_RUSH = new GameMode('time-rush', 'Coming soon...', -1, TemplateEnum.QUESTION_RESULT);
67

78
private constructor(public readonly title: string,
89
public readonly description: string,
@@ -16,6 +17,8 @@ export class GameMode {
1617
return GameMode.NORMAL;
1718
case 'trifecta':
1819
return GameMode.TRIFECTA;
20+
case 'time-rush':
21+
return GameMode.TIME_RUSH;
1922
default:
2023
return GameMode.NORMAL;
2124
}

0 commit comments

Comments
 (0)