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,30 @@
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
import { CommonModule } from '@angular/common';
@Component({
selector: 'app-playing-card',
standalone: true,
imports: [CommonModule],
template: `
<div
class="w-24 h-36 rounded-lg p-2 relative flex flex-col justify-between shadow-lg"
[class]="hidden ? 'bg-red-800' : 'bg-white'"
>
<span *ngIf="!hidden" class="text-xl font-bold text-accent-red">{{ value }}</span>
<span
*ngIf="!hidden"
class="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 text-3xl text-accent-red"
>{{ suit }}</span
>
<span *ngIf="!hidden" class="text-xl font-bold text-accent-red self-end rotate-180">{{
value
}}</span>
</div>
`,
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class PlayingCardComponent {
@Input({ required: true }) value!: string;
@Input({ required: true }) suit!: string;
@Input({ required: true }) hidden!: boolean;
}