diff --git a/AGENTS.md b/AGENTS.md index d4b620c..76270a7 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,7 +1,7 @@ # GitNexus — Code Intelligence -This project is indexed by GitNexus as **36-character-flower** (2505 symbols, 4694 relationships, 215 execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely. +This project is indexed by GitNexus as **36-character-flower** (2527 symbols, 4819 relationships, 217 execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely. > If any GitNexus tool warns the index is stale, run `npx gitnexus analyze` in terminal first. diff --git a/CLAUDE.md b/CLAUDE.md index d4b620c..76270a7 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,7 +1,7 @@ # GitNexus — Code Intelligence -This project is indexed by GitNexus as **36-character-flower** (2505 symbols, 4694 relationships, 215 execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely. +This project is indexed by GitNexus as **36-character-flower** (2527 symbols, 4819 relationships, 217 execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely. > If any GitNexus tool warns the index is stale, run `npx gitnexus analyze` in terminal first. diff --git a/src/assets/reward/1.webp b/src/assets/reward/1.webp new file mode 100644 index 0000000..9fbcb51 Binary files /dev/null and b/src/assets/reward/1.webp differ diff --git a/src/assets/reward/10.webp b/src/assets/reward/10.webp new file mode 100644 index 0000000..552156e Binary files /dev/null and b/src/assets/reward/10.webp differ diff --git a/src/assets/reward/11.webp b/src/assets/reward/11.webp new file mode 100644 index 0000000..286123a Binary files /dev/null and b/src/assets/reward/11.webp differ diff --git a/src/assets/reward/12.webp b/src/assets/reward/12.webp new file mode 100644 index 0000000..ce7b6c2 Binary files /dev/null and b/src/assets/reward/12.webp differ diff --git a/src/assets/reward/13.webp b/src/assets/reward/13.webp new file mode 100644 index 0000000..1a843ba Binary files /dev/null and b/src/assets/reward/13.webp differ diff --git a/src/assets/reward/14.webp b/src/assets/reward/14.webp new file mode 100644 index 0000000..d02f7b9 Binary files /dev/null and b/src/assets/reward/14.webp differ diff --git a/src/assets/reward/15.webp b/src/assets/reward/15.webp new file mode 100644 index 0000000..95e56ee Binary files /dev/null and b/src/assets/reward/15.webp differ diff --git a/src/assets/reward/16.webp b/src/assets/reward/16.webp new file mode 100644 index 0000000..a6c68b8 Binary files /dev/null and b/src/assets/reward/16.webp differ diff --git a/src/assets/reward/17.webp b/src/assets/reward/17.webp new file mode 100644 index 0000000..a131d66 Binary files /dev/null and b/src/assets/reward/17.webp differ diff --git a/src/assets/reward/18.webp b/src/assets/reward/18.webp new file mode 100644 index 0000000..d2d67ee Binary files /dev/null and b/src/assets/reward/18.webp differ diff --git a/src/assets/reward/19.webp b/src/assets/reward/19.webp new file mode 100644 index 0000000..7699d2d Binary files /dev/null and b/src/assets/reward/19.webp differ diff --git a/src/assets/reward/2.webp b/src/assets/reward/2.webp new file mode 100644 index 0000000..eb0ebe4 Binary files /dev/null and b/src/assets/reward/2.webp differ diff --git a/src/assets/reward/20.webp b/src/assets/reward/20.webp new file mode 100644 index 0000000..66068fc Binary files /dev/null and b/src/assets/reward/20.webp differ diff --git a/src/assets/reward/21.webp b/src/assets/reward/21.webp new file mode 100644 index 0000000..c991371 Binary files /dev/null and b/src/assets/reward/21.webp differ diff --git a/src/assets/reward/22.webp b/src/assets/reward/22.webp new file mode 100644 index 0000000..9826810 Binary files /dev/null and b/src/assets/reward/22.webp differ diff --git a/src/assets/reward/23.webp b/src/assets/reward/23.webp new file mode 100644 index 0000000..5240127 Binary files /dev/null and b/src/assets/reward/23.webp differ diff --git a/src/assets/reward/24.webp b/src/assets/reward/24.webp new file mode 100644 index 0000000..12ead6f Binary files /dev/null and b/src/assets/reward/24.webp differ diff --git a/src/assets/reward/25.webp b/src/assets/reward/25.webp new file mode 100644 index 0000000..bf7d637 Binary files /dev/null and b/src/assets/reward/25.webp differ diff --git a/src/assets/reward/26.webp b/src/assets/reward/26.webp new file mode 100644 index 0000000..9122933 Binary files /dev/null and b/src/assets/reward/26.webp differ diff --git a/src/assets/reward/27.webp b/src/assets/reward/27.webp new file mode 100644 index 0000000..40fc6b9 Binary files /dev/null and b/src/assets/reward/27.webp differ diff --git a/src/assets/reward/28.webp b/src/assets/reward/28.webp new file mode 100644 index 0000000..89fc939 Binary files /dev/null and b/src/assets/reward/28.webp differ diff --git a/src/assets/reward/29.webp b/src/assets/reward/29.webp new file mode 100644 index 0000000..26b4b91 Binary files /dev/null and b/src/assets/reward/29.webp differ diff --git a/src/assets/reward/3.webp b/src/assets/reward/3.webp new file mode 100644 index 0000000..3318df3 Binary files /dev/null and b/src/assets/reward/3.webp differ diff --git a/src/assets/reward/30.webp b/src/assets/reward/30.webp new file mode 100644 index 0000000..61d0193 Binary files /dev/null and b/src/assets/reward/30.webp differ diff --git a/src/assets/reward/31.webp b/src/assets/reward/31.webp new file mode 100644 index 0000000..bc0c479 Binary files /dev/null and b/src/assets/reward/31.webp differ diff --git a/src/assets/reward/32.webp b/src/assets/reward/32.webp new file mode 100644 index 0000000..1fb8928 Binary files /dev/null and b/src/assets/reward/32.webp differ diff --git a/src/assets/reward/33.webp b/src/assets/reward/33.webp new file mode 100644 index 0000000..951c451 Binary files /dev/null and b/src/assets/reward/33.webp differ diff --git a/src/assets/reward/34.webp b/src/assets/reward/34.webp new file mode 100644 index 0000000..6c52a1f Binary files /dev/null and b/src/assets/reward/34.webp differ diff --git a/src/assets/reward/35.webp b/src/assets/reward/35.webp new file mode 100644 index 0000000..3ed3dff Binary files /dev/null and b/src/assets/reward/35.webp differ diff --git a/src/assets/reward/36.webp b/src/assets/reward/36.webp new file mode 100644 index 0000000..134fa39 Binary files /dev/null and b/src/assets/reward/36.webp differ diff --git a/src/assets/reward/4.webp b/src/assets/reward/4.webp new file mode 100644 index 0000000..381f1f5 Binary files /dev/null and b/src/assets/reward/4.webp differ diff --git a/src/assets/reward/5.webp b/src/assets/reward/5.webp new file mode 100644 index 0000000..e0dc2b7 Binary files /dev/null and b/src/assets/reward/5.webp differ diff --git a/src/assets/reward/6.webp b/src/assets/reward/6.webp new file mode 100644 index 0000000..db91172 Binary files /dev/null and b/src/assets/reward/6.webp differ diff --git a/src/assets/reward/7.webp b/src/assets/reward/7.webp new file mode 100644 index 0000000..644341c Binary files /dev/null and b/src/assets/reward/7.webp differ diff --git a/src/assets/reward/8.webp b/src/assets/reward/8.webp new file mode 100644 index 0000000..36e51b3 Binary files /dev/null and b/src/assets/reward/8.webp differ diff --git a/src/assets/reward/9.webp b/src/assets/reward/9.webp new file mode 100644 index 0000000..05d9513 Binary files /dev/null and b/src/assets/reward/9.webp differ diff --git a/src/features/game/components/desktop/desktop-animal.tsx b/src/features/game/components/desktop/desktop-animal.tsx index 22d55c4..5b84316 100644 --- a/src/features/game/components/desktop/desktop-animal.tsx +++ b/src/features/game/components/desktop/desktop-animal.tsx @@ -12,27 +12,11 @@ import refreshIcon from '@/assets/system/refresh.webp' import { SmartBackground } from '@/components/smart-background.tsx' import { SmartImage } from '@/components/smart-image' import { useAnimalVm } from '@/features/game/hooks/use-animal-vm' +import { FLOWER_IMAGE_LIST } from '@/features/game/shared' import { cn } from '@/lib/utils' import { useAuthStore } from '@/store/auth' import { useGameAutoHostingStore, useGameRoundStore } from '@/store/game' -const animalModules = import.meta.glob('../../../../assets/animal/*.webp', { - eager: true, - import: 'default', -}) as Record - -const animalImageList = Object.entries(animalModules) - .map(([path, url]) => { - const match = path.match(/\/(\d+)\.webp$/) - - return { - id: Number(match?.[1] ?? 0), - url, - } - }) - .filter((item) => item.id > 0) - .sort((left, right) => left.id - right.id) - const SETTLEMENT_REVEAL_RANDOM_DURATION_MS = 4_000 const SETTLEMENT_REVEAL_RESULT_HOLD_MS = 1_000 const SETTLEMENT_REVEAL_MIN_STEP_MS = 90 @@ -82,7 +66,7 @@ export function DesktopAnimal({ }: DesktopAnimalProps) { const { i18n, t } = useTranslation() const prefersReducedMotion = useReducedMotion() - const animalIds = useMemo(() => animalImageList.map((item) => item.id), []) + const animalIds = useMemo(() => FLOWER_IMAGE_LIST.map((item) => item.id), []) const containerRef = useRef(null) const cellRefs = useRef(new Map()) const [revealCellId, setRevealCellId] = useState(null) @@ -241,7 +225,7 @@ export function DesktopAnimal({ className, )} > - {animalImageList.map((item) => { + {FLOWER_IMAGE_LIST.map((item) => { const selectionMeta = selectionByCell[item.id] const hasPlacedSelection = Boolean(selectionMeta) const isMarqueeActive = showStandbyState && item.id === marqueeId @@ -355,7 +339,7 @@ export function DesktopAnimal({ /> ) : null} {label} + } + + return ( + + + + ) +} export function DesktopGameHistory() { const { t } = useTranslation() @@ -126,7 +158,18 @@ export function DesktopGameHistory() { {t('gameDesktop.history.numbers')}:{' '} - {item.numbersLabel} + {item.numbers.length === 0 ? ( + {item.numbersLabel} + ) : ( + + {item.numbers.map((number) => ( + + ))} + + )}
@@ -140,9 +183,16 @@ export function DesktopGameHistory() { {t('gameDesktop.history.winningResult')}:{' '} - - {item.resultNumberLabel} - + {item.resultNumber === null ? ( + + {item.resultNumberLabel} + + ) : ( + + )}
diff --git a/src/features/game/hooks/use-game-history-vm.ts b/src/features/game/hooks/use-game-history-vm.ts index a6058bc..2b72f8b 100644 --- a/src/features/game/hooks/use-game-history-vm.ts +++ b/src/features/game/hooks/use-game-history-vm.ts @@ -89,6 +89,7 @@ export function useGameHistoryVm() { numbers: entry.numbers, orderNo: entry.order_no, periodNo: entry.period_no, + resultNumber, resultNumberLabel: resultNumber === null ? '--' diff --git a/src/features/game/shared/flower-assets.ts b/src/features/game/shared/flower-assets.ts new file mode 100644 index 0000000..1338a2d --- /dev/null +++ b/src/features/game/shared/flower-assets.ts @@ -0,0 +1,35 @@ +const animalModules = import.meta.glob('../../../assets/animal/*.webp', { + eager: true, + import: 'default', +}) as Record + +const rewardModules = import.meta.glob('../../../assets/reward/*.webp', { + eager: true, + import: 'default', +}) as Record + +export interface FlowerImageAsset { + animalUrl: string + id: number + rewardUrl: string +} + +export const FLOWER_IMAGE_LIST: FlowerImageAsset[] = Array.from( + { length: 36 }, + (_, index) => { + const id = index + 1 + + return { + animalUrl: animalModules[`../../../assets/animal/${id}.webp`] ?? '', + id, + rewardUrl: rewardModules[`../../../assets/reward/${id}.webp`] ?? '', + } + }, +).filter((item) => item.animalUrl && item.rewardUrl) + +export const FLOWER_IMAGE_BY_ID = FLOWER_IMAGE_LIST.reduce< + Record +>((map, item) => { + map[item.id] = item + return map +}, {}) diff --git a/src/features/game/shared/index.ts b/src/features/game/shared/index.ts index 9ae7bc7..c62886e 100644 --- a/src/features/game/shared/index.ts +++ b/src/features/game/shared/index.ts @@ -1,4 +1,5 @@ export * from './constants' +export * from './flower-assets' export * from './initial-state' export * from './selectors' export * from './types'