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:
Redsandy
2026-08-12 15:27:27 +03:00
parent dfe445349b
commit f0733d6918
13 changed files with 1212 additions and 14 deletions

View File

@@ -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>