import { motion, useReducedMotion } from 'motion/react' import { useMemo, useState } from 'react' import { useTranslation } from 'react-i18next' import streakBg from '@/assets/game/pc-streak.webp' import down5Animation from '@/assets/lottie/down5.json' import diamond from '@/assets/system/diamond.webp' import fire from '@/assets/system/fire.webp' import lock from '@/assets/system/lock.webp' import statusCenter from '@/assets/system/status-center.webp' import statusLine from '@/assets/system/status-line.webp' import { LottiePlayer } from '@/components/lottie-player.tsx' import { SmartBackground } from '@/components/smart-background.tsx' import { SmartImage } from '@/components/smart-image.tsx' import { DesktopCountdown } from '@/features/game/components/desktop/desktop-countdown.tsx' import { DesktopTitle } from '@/features/game/components/desktop/desktop-title.tsx' import { useGameStatusVm } from '@/hooks/use-game-status-vm.ts' import { cn } from '@/lib/utils.ts' export function DesktopStatusLine() { const { t } = useTranslation() const prefersReducedMotion = useReducedMotion() const { countdownMs, limitLabel, oddsLabel, phaseLabel, phaseToneClassName, roundId, streakLabel, streakValue, } = useGameStatusVm() const [remainingMs, setRemainingMs] = useState(countdownMs) const showWarningCountdown = remainingMs <= 5000 && remainingMs > 0 const showStreakLimitOnly = typeof streakValue === 'number' && streakValue > 1 const countdownClassName = useMemo( () => showWarningCountdown ? 'text-design-64 scale-[1.2] text-[#FF5A5A] [text-shadow:0_0_calc(var(--design-unit)*10)_rgba(255,90,90,0.85),0_0_calc(var(--design-unit)*22)_rgba(255,90,90,0.32)]' : 'text-design-64 scale-[1.2] text-[#4BFFFE] [text-shadow:0_0_calc(var(--design-unit)*10)_rgba(75,255,254,0.85),0_0_calc(var(--design-unit)*22)_rgba(75,255,254,0.32)]', [showWarningCountdown], ) return (
{/**/} {/* */} {/*
*/}
{/* 状态栏左侧 */}
{showStreakLimitOnly && (
)} {!showStreakLimitOnly && ( <>
{t('gameDesktop.status.odds')}:{' '} {oddsLabel}
{t('gameDesktop.status.streak')}:{' '} {streakLabel}
)}
{t('gameDesktop.status.limit')}:
{limitLabel}
{phaseLabel}
{t('gameDesktop.status.roundId')}: {roundId}
) }