feat(game): add blackjack game component and routing
Some checks failed
Some checks failed
This commit is contained in:
parent
32aa753452
commit
eb153f4459
12 changed files with 273 additions and 2 deletions
|
@ -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>();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue