style: run prettier
This commit is contained in:
parent
bc56b498ee
commit
efc2a8ecec
5 changed files with 49 additions and 44 deletions
|
@ -1,19 +1,19 @@
|
|||
import {ChangeDetectionStrategy, Component, inject, OnInit, signal} from '@angular/core';
|
||||
import {CommonModule} from '@angular/common';
|
||||
import {Router} from '@angular/router';
|
||||
import {DealerHandComponent} from './components/dealer-hand/dealer-hand.component';
|
||||
import {PlayerHandComponent} from './components/player-hand/player-hand.component';
|
||||
import {GameControlsComponent} from './components/game-controls/game-controls.component';
|
||||
import {GameInfoComponent} from './components/game-info/game-info.component';
|
||||
import {BlackjackGame, Card} from '@blackjack/models/blackjack.model';
|
||||
import {BlackjackService} from '@blackjack/services/blackjack.service';
|
||||
import {HttpErrorResponse} from '@angular/common/http';
|
||||
import {GameResultComponent} from '@blackjack/components/game-result/game-result.component';
|
||||
import {GameState} from '@blackjack/enum/gameState';
|
||||
import {NavbarComponent} from '@shared/components/navbar/navbar.component';
|
||||
import {UserService} from '@service/user.service';
|
||||
import {timer} from 'rxjs';
|
||||
import {DebtDialogComponent} from '@shared/components/debt-dialog/debt-dialog.component';
|
||||
import { ChangeDetectionStrategy, Component, inject, OnInit, signal } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { Router } from '@angular/router';
|
||||
import { DealerHandComponent } from './components/dealer-hand/dealer-hand.component';
|
||||
import { PlayerHandComponent } from './components/player-hand/player-hand.component';
|
||||
import { GameControlsComponent } from './components/game-controls/game-controls.component';
|
||||
import { GameInfoComponent } from './components/game-info/game-info.component';
|
||||
import { BlackjackGame, Card } from '@blackjack/models/blackjack.model';
|
||||
import { BlackjackService } from '@blackjack/services/blackjack.service';
|
||||
import { HttpErrorResponse } from '@angular/common/http';
|
||||
import { GameResultComponent } from '@blackjack/components/game-result/game-result.component';
|
||||
import { GameState } from '@blackjack/enum/gameState';
|
||||
import { NavbarComponent } from '@shared/components/navbar/navbar.component';
|
||||
import { UserService } from '@service/user.service';
|
||||
import { timer } from 'rxjs';
|
||||
import { DebtDialogComponent } from '@shared/components/debt-dialog/debt-dialog.component';
|
||||
|
||||
@Component({
|
||||
selector: 'app-blackjack',
|
||||
|
|
|
@ -8,8 +8,8 @@ import {
|
|||
SimpleChanges,
|
||||
ViewChild,
|
||||
} from '@angular/core';
|
||||
import {CommonModule} from '@angular/common';
|
||||
import {CountUp} from 'countup.js';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { CountUp } from 'countup.js';
|
||||
|
||||
@Component({
|
||||
selector: 'app-animated-number',
|
||||
|
|
|
@ -31,8 +31,12 @@
|
|||
</div>
|
||||
|
||||
<div [ngClass]="slotResult().status === 'win' ? 'text-green-500' : 'text-red-500'">
|
||||
<p>Game result: <strong>{{ slotResult().status | uppercase }}</strong></p>
|
||||
<p>Amount: <strong>{{ slotResult().amount }}</strong></p>
|
||||
<p>
|
||||
Game result: <strong>{{ slotResult().status | uppercase }}</strong>
|
||||
</p>
|
||||
<p>
|
||||
Amount: <strong>{{ slotResult().amount }}</strong>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import {ChangeDetectionStrategy, Component, inject, OnInit, signal} from "@angular/core";
|
||||
import {NavbarComponent} from "@shared/components/navbar/navbar.component";
|
||||
import {HttpClient} from "@angular/common/http";
|
||||
import {KeyValuePipe, NgClass, UpperCasePipe} from "@angular/common";
|
||||
import {FormsModule} from "@angular/forms";
|
||||
import { ChangeDetectionStrategy, Component, inject, OnInit, signal } from '@angular/core';
|
||||
import { NavbarComponent } from '@shared/components/navbar/navbar.component';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { KeyValuePipe, NgClass, UpperCasePipe } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
interface SlotResult {
|
||||
status: 'win' | 'lose';
|
||||
|
@ -13,13 +13,7 @@ interface SlotResult {
|
|||
@Component({
|
||||
selector: 'app-slots',
|
||||
standalone: true,
|
||||
imports: [
|
||||
NavbarComponent,
|
||||
KeyValuePipe,
|
||||
UpperCasePipe,
|
||||
NgClass,
|
||||
FormsModule
|
||||
],
|
||||
imports: [NavbarComponent, KeyValuePipe, UpperCasePipe, NgClass, FormsModule],
|
||||
templateUrl: './slots.component.html',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
|
@ -30,25 +24,25 @@ export default class SlotsComponent implements OnInit {
|
|||
status: 'lose',
|
||||
amount: 12,
|
||||
resultMatrix: [
|
||||
["BAR", "BAR", "BAR"],
|
||||
["SEVEN", "SEVEN", "SEVEN"],
|
||||
["BELL", "BELL", "BELL"]
|
||||
]
|
||||
['BAR', 'BAR', 'BAR'],
|
||||
['SEVEN', 'SEVEN', 'SEVEN'],
|
||||
['BELL', 'BELL', 'BELL'],
|
||||
],
|
||||
});
|
||||
betAmount = signal<number>(1);
|
||||
|
||||
ngOnInit(): void {
|
||||
this.httpClient.get<Record<string, number>>('/backend/slots/info').subscribe(data => {
|
||||
this.httpClient.get<Record<string, number>>('/backend/slots/info').subscribe((data) => {
|
||||
this.slotInfo.set(data);
|
||||
});
|
||||
}
|
||||
|
||||
spin(): void {
|
||||
const payload = {
|
||||
betAmount: this.betAmount()
|
||||
betAmount: this.betAmount(),
|
||||
};
|
||||
|
||||
this.httpClient.post<SlotResult>('/backend/slots/spin', payload).subscribe(result => {
|
||||
this.httpClient.post<SlotResult>('/backend/slots/spin', payload).subscribe((result) => {
|
||||
this.slotResult.set(result);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1,8 +1,15 @@
|
|||
import {ChangeDetectionStrategy, Component, EventEmitter, inject, Input, Output,} from '@angular/core';
|
||||
import {TransactionService} from '@service/transaction.service';
|
||||
import {Observable} from 'rxjs';
|
||||
import {AsyncPipe, CurrencyPipe, DatePipe, NgIf} from '@angular/common';
|
||||
import {TransactionData} from '../../model/TransactionData';
|
||||
import {
|
||||
ChangeDetectionStrategy,
|
||||
Component,
|
||||
EventEmitter,
|
||||
inject,
|
||||
Input,
|
||||
Output,
|
||||
} from '@angular/core';
|
||||
import { TransactionService } from '@service/transaction.service';
|
||||
import { Observable } from 'rxjs';
|
||||
import { AsyncPipe, CurrencyPipe, DatePipe, NgIf } from '@angular/common';
|
||||
import { TransactionData } from '../../model/TransactionData';
|
||||
|
||||
const PER_PAGE = 5;
|
||||
|
||||
|
|
Reference in a new issue