CI / Generate TypeScript types (push) Successful in 10s
CI / Server unit tests (push) Successful in 26s
CI / Build server (push) Successful in 30s
CI / Build client (push) Successful in 46s
CI / Playwright E2E tests (push) Successful in 1m57s
CI / Build and push Docker image (push) Successful in 46s
CI / Notify (push) Successful in 2s
Nová skrytá minihra (kód "tanky") pro více hráčů, simulaci drží server: - jízda šipkami/WSAD, otočná věž míří za myší, střelba klikem nebo mezerníkem - režimy poslední přeživší (výchozí) a na čas, volitelně ve dvou týmech - volitelné odrážení střel od zdí (výchozí vypnuto) - hardcore režim: tma, vidět je jen světlo kolem tanku a reflektor ve směru věže - bonusy: štít, trojitá střela, rakety, turbo, neviditelnost, naváděné střely, miny, život - 7 map v pěti prostředích (město, les, poušť, zima, bažina) s vodou, zpomalujícím terénem a zničitelnými bednami - boti se třemi obtížnostmi (hledání cesty, rozstřelování beden, v hardcore vidí jen světlo) - efekty: záblesk výstřelu, výbuchy, hořící vraky Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
34 lines
2.1 KiB
TypeScript
34 lines
2.1 KiB
TypeScript
import { StyleTheme, useSettings } from "../context/settings";
|
|
|
|
export type GameId = 'reaction' | 'snake' | 'tetris' | 'pong' | 'drawing' | 'tanks';
|
|
|
|
/** Ikony miniher podle vizuálního stylu aplikace. */
|
|
const ICONS: Record<StyleTheme, Record<GameId, string>> = {
|
|
simple: { reaction: '⚡', snake: '🐍', tetris: '🧱', pong: '🏓', drawing: '🎨', tanks: '💥' },
|
|
// Dostihy: startovní vlajka, kůň místo hada, mrkve jako kostky, žokej, trofej, terč
|
|
umamusume: { reaction: '🏁', snake: '🐎', tetris: '🥕', pong: '🏇', drawing: '🏆', tanks: '🎯' },
|
|
// Duha, jednorožec, drahokamy, balónky, paleta a blesk Rainbow Dash
|
|
mlp: { reaction: '🌈', snake: '🦄', tetris: '💎', pong: '🎈', drawing: '🖌️', tanks: '⚡' },
|
|
// Pekelná korespondence: plamen, rudá nit, lampion, slaměná panenka, svitek, svíčka
|
|
hellgirl: { reaction: '🔥', snake: '🪢', tetris: '🏮', pong: '🪆', drawing: '📜', tanks: '🕯️' },
|
|
// Klub lehké hudby: bicí Ritsu, želva Ton-chan, dortíky k čaji, kytara Gitah, notový zápis a klávesy Mugi
|
|
kon: { reaction: '🥁', snake: '🐢', tetris: '🍰', pong: '🎸', drawing: '🎼', tanks: '🎹' },
|
|
// Kessoku Band: mikrofon Kity, kabel od kytary, krabice od manga, bicí Nijiky, sešit s texty Bocchi a její kytara
|
|
bocchi: { reaction: '🎤', snake: '🔌', tetris: '📦', pong: '🥁', drawing: '📝', tanks: '🎸' },
|
|
};
|
|
|
|
/** Styl z <html data-luncher-theme> — pro místa mimo React kontext nastavení. */
|
|
function currentTheme(): StyleTheme {
|
|
const theme = document.documentElement.getAttribute('data-luncher-theme') as StyleTheme | null;
|
|
return theme && theme in ICONS ? theme : 'simple';
|
|
}
|
|
|
|
/** Ikona hry pro aktuální styl (mimo React, např. výpis do konzole). */
|
|
export const gameIcon = (game: GameId, theme: StyleTheme = currentTheme()) => ICONS[theme]?.[game] ?? ICONS.simple[game];
|
|
|
|
/** Ikona hry pro aktuální styl; stránky bez nastavení (statistiky) použijí atribut na <html>. */
|
|
export function useGameIcon(game: GameId) {
|
|
const settings = useSettings();
|
|
return gameIcon(game, settings?.styleTheme ?? currentTheme());
|
|
}
|