Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding "Reveal" button #18

Closed
wants to merge 16 commits into from
Prev Previous commit
Next Next commit
styling
  • Loading branch information
tarrball committed Jun 25, 2023
commit 60ccc718c2d3fdc350555b2958d2b0c8b7f808f8
81 changes: 49 additions & 32 deletions src/app/1. features/game/game.component.html
Original file line number Diff line number Diff line change
@@ -1,37 +1,54 @@
<div class="container">
<div>Points: {{ earnedPoints$ | async }}</div>
<div>Total Points: {{ potentialPoints$ | async }}</div>
</div>
<header class="flex-center">
<h1 class="w-100">Palabritas</h1>
</header>

<div class="container answer-container">
<div class="word" *ngFor="let answer of answers$ | async" [id]="answer.word">
<span class="letter" *ngFor="let letter of answer.letters">
{{ answer.isFound ? letter : "_" }}
</span>
<main class="flex-grow-1">
<div class="flex-center-between">
<div>Points: {{ earnedPoints$ | async }}</div>
<div>Total Points: {{ potentialPoints$ | async }}</div>
</div>
</div>

<div class="container">
<button
mat-raised-button
*ngFor="let letter of clickedLetters$ | async"
(click)="clickLetter(letter)"
>
{{ letter.value }}
</button>
</div>
<div class="flex-center hori-scroll answers-container">
<div
class="flex-center word"
*ngFor="let answer of answers$ | async"
[id]="answer.word"
>
<span class="letter" *ngFor="let letter of answer.letters">
{{ answer.isFound ? letter : "_" }}
</span>
</div>
</div>

<div class="container">
<button
mat-raised-button
*ngFor="let letter of clickableLetters$ | async"
(click)="clickLetter(letter)"
>
{{ letter.value }}
</button>
</div>
<div class="flex-center-center letter-button-container">
<button
mat-raised-button
*ngFor="let letter of clickedLetters$ | async"
(click)="clickLetter(letter)"
>
{{ letter.value }}
</button>
</div>

<div class="container">
<button mat-raised-button (click)="clickNewGame()">New Game</button>
<button mat-raised-button (click)="clickEnter()">Enter</button>
</div>
<div class="flex-center-center letter-button-container">
<button
mat-raised-button
*ngFor="let letter of clickableLetters$ | async"
(click)="clickLetter(letter)"
>
{{ letter.value }}
</button>
</div>

<div class="flex-center-between">
<button mat-raised-button (click)="clickNewGame()">New Game</button>
<button mat-raised-button (click)="clickEnter()">Enter</button>
</div>
</main>

<footer class="flex-center-between">
<span>andrew@tarrball.com</span>
<a href="https://github.com/tarrball/palabritas" target="_blank"
>View on GitHub</a
>
</footer>
41 changes: 28 additions & 13 deletions src/app/1. features/game/game.component.sass
Original file line number Diff line number Diff line change
@@ -1,20 +1,35 @@
.container
:host
display: flex
align-items: center
justify-content: space-between
max-width: 500px
min-height: 100px
flex-direction: column
font-variant: small-caps
max-width: 496px

.answer-container
display: flex
align-items: center
justify-content: space-between
min-height: 300px
overflow-x: auto
header
h1
flex-grow: 1
text-align: center

main
.letter-buttons
button
margin: 0 4px

footer
margin-top: 64px

span
text-transform: uppercase

.answers-container
height: 160px

.letter-button-container
min-height: 96px

button
margin: 0 6px

.word
display: flex
align-items: center
font-size: 24px
padding: 0 8px

Expand Down
44 changes: 43 additions & 1 deletion src/styles.sass
Original file line number Diff line number Diff line change
@@ -1 +1,43 @@
/* You can add global styles to this file, and also import other style files */
/* Utilities */

.d-flex
display: flex !important

.align-items-center
align-items: center !important

.flex-grow-1
flex-grow: 1 !important

.justify-content-center
justify-content: center !important

.justify-content-between
justify-content: space-between !important

.h-100
height: 100% !important

.w-100
width: 100% !important

.flex-center
@extend .d-flex
@extend .align-items-center

.flex-center-center
@extend .flex-center
@extend .justify-content-center

.flex-center-between
@extend .flex-center
@extend .justify-content-between

.hori-scroll
overflow-x: auto

/* Material Overrides */

app-game
.mdc-button
min-width: 50px