Refactor game API and introduce Forest Fortune game
- Updated API types to replace `GameStub` with `GameInfo` and added `SessionSpinResult` and `SpinOutcome` types. - Modified API requests in `api.ts` to use the new game types. - Implemented the `ForestFortuneGame` component with game logic, including spinning mechanics and win animations. - Created supporting components: `CoinFlight`, `ReelColumn`, `WinCounter`, and `WinLinesOverlay` for game UI. - Added CSS styles for the Forest Fortune game layout and animations. - Updated `GamePage` and `HomePage` to integrate the new game and reflect its status correctly.
This commit is contained in:
@@ -2,14 +2,14 @@ import { useEffect, useState } from 'react'
|
||||
import { Link, Navigate } from 'react-router-dom'
|
||||
import { api } from '../api'
|
||||
import { useAuth } from '../auth'
|
||||
import type { GameStub } from '../types'
|
||||
import type { GameInfo } from '../types'
|
||||
import { GATE_FROM_KEY } from '../vfx/gateCaps'
|
||||
|
||||
const DEPOSIT_AMOUNTS = [100, 500, 1000]
|
||||
|
||||
export function HomePage() {
|
||||
const { user, loading, setUser } = useAuth()
|
||||
const [games, setGames] = useState<GameStub[]>([])
|
||||
const [games, setGames] = useState<GameInfo[]>([])
|
||||
const [depositOpen, setDepositOpen] = useState(false)
|
||||
const [busy, setBusy] = useState(false)
|
||||
const [message, setMessage] = useState<string | null>(null)
|
||||
@@ -75,13 +75,15 @@ export function HomePage() {
|
||||
|
||||
<section className="games" aria-labelledby="games-title">
|
||||
<h2 id="games-title">Слоты</h2>
|
||||
<p className="section-lead">Врата ещё закрыты — пока только предвестники.</p>
|
||||
<p className="section-lead">Лесная Удача уже открыта — остальные ждут своего часа.</p>
|
||||
<ul className="games__list">
|
||||
{games.map((game) => (
|
||||
<li key={game.slug}>
|
||||
<Link to={`/games/${game.slug}`} className="game-link">
|
||||
<span className="game-link__title">{game.title}</span>
|
||||
<span className="game-link__status">Скоро</span>
|
||||
<span className="game-link__status">
|
||||
{game.status === 'available' ? 'Открыто' : 'Скоро'}
|
||||
</span>
|
||||
<span className="game-link__desc">{game.description}</span>
|
||||
</Link>
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user