Compare commits

...

2 commits

Author SHA1 Message Date
03ce527087
refactor(blackjack): rename event emitters for clarity
All checks were successful
CI / Get Changed Files (pull_request) Successful in 6s
CI / Checkstyle Main (pull_request) Has been skipped
CI / prettier (pull_request) Successful in 37s
CI / eslint (pull_request) Successful in 39s
CI / test-build (pull_request) Successful in 46s
2025-03-26 13:35:07 +01:00
5e5fe603f9
style: update card background colors in templates 2025-03-26 13:35:07 +01:00
5 changed files with 17 additions and 19 deletions

View file

@ -6,9 +6,9 @@
<app-dealer-hand [cards]="dealerCards"></app-dealer-hand>
<app-player-hand [cards]="playerCards"></app-player-hand>
<app-game-controls
(onHit)="onHit()"
(onStand)="onStand()"
(onLeave)="leaveGame()"
(hit)="onHit()"
(stand)="onStand()"
(leave)="leaveGame()"
></app-game-controls>
</div>
@ -16,7 +16,7 @@
<app-game-info
[balance]="balance()"
[currentBet]="currentBet"
(onNewGameClick)="onNewGame()"
(newGame)="onNewGame()"
></app-game-info>
</div>
</div>

View file

@ -10,7 +10,7 @@ import { Card } from '../../models/card.model';
template: `
<div class="space-y-4">
<h3 class="section-heading text-2xl mb-4">Croupier's Karten</h3>
<div class="card p-6 !bg-red-500">
<div class="card p-6 !bg-accent-red">
<div class="flex justify-center gap-4 min-h-[160px] p-4 border-2 border-red-400 rounded-lg">
<app-playing-card
*ngFor="let card of cards"

View file

@ -8,19 +8,19 @@ import { CommonModule } from '@angular/common';
template: `
<div class="flex justify-center gap-4">
<button
(click)="onHit.emit()"
(click)="hit.emit()"
class="button-primary px-8 py-4 text-lg font-medium min-w-[120px]"
>
Ziehen
</button>
<button
(click)="onStand.emit()"
(click)="stand.emit()"
class="button-primary px-8 py-4 text-lg font-medium min-w-[120px]"
>
Halten
</button>
<button
(click)="onLeave.emit()"
(click)="leave.emit()"
class="bg-accent-red hover:bg-accent-red/80 px-8 py-4 rounded text-lg font-medium min-w-[120px] transition-all duration-300"
>
Abbrechen
@ -30,7 +30,7 @@ import { CommonModule } from '@angular/common';
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class GameControlsComponent {
@Output() onHit = new EventEmitter<void>();
@Output() onStand = new EventEmitter<void>();
@Output() onLeave = new EventEmitter<void>();
@Output() hit = new EventEmitter<void>();
@Output() stand = new EventEmitter<void>();
@Output() leave = new EventEmitter<void>();
}

View file

@ -19,16 +19,14 @@ import { CommonModule, CurrencyPipe } from '@angular/common';
{{ currentBet | currency: 'EUR' }}
</span>
</div>
<button class="button-primary w-full py-2" (click)="onNewGameClick.emit()">
Neues Spiel
</button>
<button class="button-primary w-full py-2" (click)="newGame.emit()">Neues Spiel</button>
</div>
</div>
`,
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class GameInfoComponent {
@Input() balance: number = 0;
@Input() currentBet: number = 0;
@Output() onNewGameClick = new EventEmitter<void>();
@Input() balance = 0;
@Input() currentBet = 0;
@Output() newGame = new EventEmitter<void>();
}

View file

@ -10,9 +10,9 @@ import { Card } from '../../models/card.model';
template: `
<div class="space-y-4">
<h3 class="section-heading text-2xl mb-4">Deine Karten</h3>
<div class="card p-6 !bg-green-500">
<div class="card p-6 !bg-emerald">
<div
class="flex justify-center gap-4 min-h-[160px] p-4 border-2 border-green-400 rounded-lg"
class="flex justify-center gap-4 min-h-[160px] p-4 border-2 border-emerald-400 rounded-lg"
>
<app-playing-card
*ngFor="let card of cards"