feat(blackjack): add action indicators and loading states

This commit is contained in:
Jan-Marlon Leibl 2025-03-27 15:44:38 +01:00
commit acdbea5a99
Signed by: jleibl
GPG key ID: 300B2F906DC6F1D5
7 changed files with 208 additions and 27 deletions

View file

@ -86,10 +86,15 @@ import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angula
</div>
<button
type="submit"
class="button-primary w-full py-2"
[disabled]="!betForm.valid || gameInProgress"
class="button-primary w-full py-2 relative"
[disabled]="!betForm.valid || gameInProgress || isActionInProgress"
>
Neues Spiel
<span [class.invisible]="isActionInProgress">Neues Spiel</span>
@if (isActionInProgress) {
<div class="absolute inset-0 flex items-center justify-center">
<div class="w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin"></div>
</div>
}
</button>
</form>
</div>
@ -101,6 +106,7 @@ export class GameInfoComponent implements OnChanges {
@Input() balance = 0;
@Input() currentBet = 0;
@Input() gameInProgress = false;
@Input() isActionInProgress = false;
@Output() newGame = new EventEmitter<number>();
betForm: FormGroup;