diff --git a/apps/web/src/arcade-games/know-your-world/components/GameInfoPanel.tsx b/apps/web/src/arcade-games/know-your-world/components/GameInfoPanel.tsx index 35677e12..e2f5e92f 100644 --- a/apps/web/src/arcade-games/know-your-world/components/GameInfoPanel.tsx +++ b/apps/web/src/arcade-games/know-your-world/components/GameInfoPanel.tsx @@ -170,31 +170,48 @@ export function GameInfoPanel({ className={css({ flex: 1, textAlign: 'center', - padding: '2', + padding: '3', bg: isDark ? 'blue.900' : 'blue.50', - rounded: 'md', - border: '2px solid', + rounded: 'xl', + border: '3px solid', borderColor: 'blue.500', minWidth: 0, // Allow shrinking display: 'flex', flexDirection: 'column', gap: '1', })} + style={{ + animation: 'glowPulse 2s ease-in-out infinite', + }} > +
- Find: + 🎯 Find
- {flagEmoji && {flagEmoji}} + {flagEmoji && {flagEmoji}} {currentRegionName || '...'}
diff --git a/apps/web/src/arcade-games/know-your-world/components/MapRenderer.tsx b/apps/web/src/arcade-games/know-your-world/components/MapRenderer.tsx index 9386f91d..ddcf8d23 100644 --- a/apps/web/src/arcade-games/know-your-world/components/MapRenderer.tsx +++ b/apps/web/src/arcade-games/know-your-world/components/MapRenderer.tsx @@ -494,6 +494,20 @@ export function MapRenderer({ const hintText = useRegionHint(hintMapKey, currentPrompt) const hasHint = useHasRegionHint(hintMapKey, currentPrompt) + // Get the current region name for audio hints + const currentRegionName = useMemo(() => { + if (!currentPrompt) return null + const region = mapData.regions.find((r) => r.id === currentPrompt) + return region?.name ?? null + }, [currentPrompt, mapData.regions]) + + // Create full hint text with region name prefix for speech + const fullHintText = useMemo(() => { + if (!hintText) return null + if (!currentRegionName) return hintText + return `${currentRegionName}. ${hintText}` + }, [currentRegionName, hintText]) + // Speech synthesis for reading hints aloud const { speak: speakHint, @@ -585,10 +599,10 @@ export function MapRenderer({ const handleSpeakClick = useCallback(() => { if (isSpeaking) { stopSpeaking() - } else if (hintText) { - speakHint(hintText, withAccent) + } else if (fullHintText) { + speakHint(fullHintText, withAccent) } - }, [isSpeaking, stopSpeaking, hintText, speakHint, withAccent]) + }, [isSpeaking, stopSpeaking, fullHintText, speakHint, withAccent]) const speakButton = usePointerLockButton({ id: 'speak-hint', @@ -712,10 +726,10 @@ export function MapRenderer({ const justOpened = showHintBubble && !prevShowHintBubbleRef.current prevShowHintBubbleRef.current = showHintBubble - if (justOpened && autoSpeak && hintText && isSpeechSupported) { - speakHint(hintText, withAccent) + if (justOpened && autoSpeak && fullHintText && isSpeechSupported) { + speakHint(fullHintText, withAccent) } - }, [showHintBubble, autoSpeak, hintText, isSpeechSupported, speakHint, withAccent]) + }, [showHintBubble, autoSpeak, fullHintText, isSpeechSupported, speakHint, withAccent]) // Track previous prompt to detect region changes const prevPromptRef = useRef(null) @@ -741,13 +755,13 @@ export function MapRenderer({ setShowHintBubble(true) // If region changed and both auto-hint and auto-speak are enabled, speak immediately // This handles the case where the bubble was already open - if (isNewRegion && autoSpeakRef.current && hintText && isSpeechSupported) { - speakHint(hintText, withAccentRef.current) + if (isNewRegion && autoSpeakRef.current && fullHintText && isSpeechSupported) { + speakHint(fullHintText, withAccentRef.current) } } else { setShowHintBubble(false) } - }, [currentPrompt, hasHint, hintText, isSpeechSupported, speakHint]) + }, [currentPrompt, hasHint, fullHintText, isSpeechSupported, speakHint]) // Hot/cold audio feedback hook // Only enabled if: 1) assistance level allows it, 2) user toggle is on, 3) not touch device