diff --git a/apps/web/src/arcade-games/know-your-world/components/DrillDownMapSelector.tsx b/apps/web/src/arcade-games/know-your-world/components/DrillDownMapSelector.tsx index 915ba488..04c9afb9 100644 --- a/apps/web/src/arcade-games/know-your-world/components/DrillDownMapSelector.tsx +++ b/apps/web/src/arcade-games/know-your-world/components/DrillDownMapSelector.tsx @@ -90,7 +90,13 @@ const PLANETS: PlanetData[] = [ { id: 'mercury', name: 'Mercury', color: '#b0b0b0', size: 0.38 }, { id: 'venus', name: 'Venus', color: '#e6c87a', size: 0.95 }, { id: 'mars', name: 'Mars', color: '#c1440e', size: 0.53 }, - { id: 'jupiter', name: 'Jupiter', color: '#d8ca9d', size: 2.0, hasStripes: true }, + { + id: 'jupiter', + name: 'Jupiter', + color: '#d8ca9d', + size: 2.0, + hasStripes: true, + }, { id: 'saturn', name: 'Saturn', color: '#ead6b8', size: 1.7, hasRings: true }, ] @@ -152,7 +158,10 @@ export function DrillDownMapSelector({ const [sizeRangePreview, setSizeRangePreview] = useState | null>( null ) - const [containerDimensions, setContainerDimensions] = useState({ width: 0, height: 0 }) + const [containerDimensions, setContainerDimensions] = useState({ + width: 0, + height: 0, + }) const containerRef = useRef(null) // Track which region name is being hovered in the popover (for zoom preview) const [previewRegionName, setPreviewRegionName] = useState(null) @@ -477,7 +486,10 @@ export function DrillDownMapSelector({ } } - return { previewAddRegions: addRegions, previewRemoveRegions: removeRegions } + return { + previewAddRegions: addRegions, + previewRemoveRegions: removeRegions, + } }, [sizeRangePreview, currentLevel, path, selectedContinent, includeSizes]) // Compute the label to display for the hovered region @@ -634,7 +646,12 @@ export function DrillDownMapSelector({ } : null }) - .filter(Boolean) as Array<{ id: string; label: string; emoji: string; path: SelectionPath }> + .filter(Boolean) as Array<{ + id: string + label: string + emoji: string + path: SelectionPath + }> } return [] @@ -761,205 +778,76 @@ export function DrillDownMapSelector({ > {/* Breadcrumb Navigation - different styles for fillContainer vs normal */} {fillContainer ? ( - /* Navigation breadcrumb - positioned well below nav bar */ + /* Breadcrumb navigation overlay for full-screen mode */
- {currentLevel > 0 ? ( - <> - {/* Back button with mini-map */} - {(() => { - const backToWorld = currentLevel === 1 - const backToContinentId = currentLevel === 2 ? path[0] : null - const backLabel = backToWorld - ? 'World' - : (CONTINENTS.find((c) => c.id === backToContinentId)?.name ?? 'Continent') - const backEmoji = backToWorld - ? '🌍' - : (CONTINENTS.find((c) => c.id === backToContinentId)?.emoji ?? '🗺️') - - // Get viewBox and regions for the mini-map preview - const backViewBox = backToWorld - ? WORLD_MAP.viewBox - : backToContinentId - ? calculateContinentViewBox( - WORLD_MAP.regions, - backToContinentId, - WORLD_MAP.viewBox, - 'world' - ) - : WORLD_MAP.viewBox - const backRegions = backToWorld - ? WORLD_MAP.regions - : backToContinentId - ? filterRegionsByContinent(WORLD_MAP.regions, backToContinentId) - : [] - - return ( - - ) - })()} - - {/* Current location badge */} -
- - {breadcrumbs[breadcrumbs.length - 1]?.emoji} - + {breadcrumbs.map((crumb, index) => ( + + {index > 0 && ( - {breadcrumbs[breadcrumbs.length - 1]?.label} + › -
- - ) : ( - /* World level - current location badge */ -
- 🌍 - - World - -
- )} + )} + {crumb.isClickable ? ( + + ) : ( + + {crumb.emoji} + {crumb.label} + + )} + + ))}
) : ( /* Normal breadcrumb for non-fillContainer mode */ @@ -977,7 +865,11 @@ export function DrillDownMapSelector({ {breadcrumbs.map((crumb, index) => ( {index > 0 && ( @@ -1153,20 +1045,15 @@ export function DrillDownMapSelector({ data-element="region-size-filters" className={css({ position: 'absolute', - top: fillContainer ? 'calc(var(--app-nav-height, 92px) + 72px)' : '3', - right: { base: '16px', sm: '24px' }, - padding: '12px', - bg: isDark - ? 'linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.95) 100%)' - : 'linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%)', - backdropFilter: 'blur(12px)', - border: '1px solid', - borderColor: isDark ? 'rgba(71, 85, 105, 0.5)' : 'rgba(203, 213, 225, 0.8)', + top: fillContainer ? '164px' : '3', + right: { base: '8px', sm: '24px' }, + padding: { base: '2', sm: '3' }, + bg: isDark ? 'gray.800' : 'gray.100', rounded: 'xl', - shadow: isDark - ? '0 4px 20px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05)' - : '0 4px 20px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.8)', + shadow: 'lg', zIndex: 10, + transform: { base: 'scale(0.75)', sm: 'scale(1)' }, + transformOrigin: 'top right', })} > setMode(value as 'cooperative' | 'race' | 'turn-based')} > - + {selectedMode?.emoji}
@@ -304,7 +309,10 @@ export function SetupPhase() { {selectedMode?.label} @@ -365,7 +373,12 @@ export function SetupPhase() { } > - + {selectedAssistance?.emoji || '💡'}
@@ -386,7 +399,10 @@ export function SetupPhase() { {selectedAssistance?.label} @@ -578,7 +594,12 @@ export function SetupPhase() { })} > {regionTheme.icons[0]} - + {regionTheme.icons[1]}