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,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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue