feat(game): add blackjack game component and routing
Some checks failed
CI / Get Changed Files (pull_request) Successful in 6s
CI / Checkstyle Main (pull_request) Has been skipped
CI / prettier (pull_request) Successful in 16s
CI / eslint (pull_request) Failing after 43s
CI / test-build (pull_request) Successful in 46s

This commit is contained in:
Jan-Marlon Leibl 2025-03-26 13:26:38 +01:00
parent 32aa753452
commit eb153f4459
Signed by: jleibl
GPG key ID: 300B2F906DC6F1D5
12 changed files with 273 additions and 2 deletions

View file

@ -0,0 +1,34 @@
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';
import { CommonModule, CurrencyPipe } from '@angular/common';
@Component({
selector: 'app-game-info',
standalone: true,
imports: [CommonModule, CurrencyPipe],
template: `
<div class="card p-4">
<h3 class="section-heading text-xl mb-4">Spiel Informationen</h3>
<div class="space-y-4">
<div class="flex justify-between items-center">
<span class="text-text-secondary">Guthaben:</span>
<span class="text-emerald">{{ balance | currency: 'EUR' }}</span>
</div>
<div class="flex justify-between items-center">
<span class="text-text-secondary">Aktuelle Wette:</span>
<span [class]="currentBet > 0 ? 'text-accent-red' : 'text-text-secondary'">
{{ currentBet | currency: 'EUR' }}
</span>
</div>
<button class="button-primary w-full py-2" (click)="onNewGameClick.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>();
}