From 37fe405f4f4ceb3a605b3d73bee21e9eae594d72 Mon Sep 17 00:00:00 2001 From: Jonghyeon Ko Date: Mon, 23 Nov 2026 04:05:33 +0900 Subject: [PATCH 1/2] Start the mobile homepage globe one zoom step closer --- src/components/MaintainersMap.tsx | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/components/MaintainersMap.tsx b/src/components/MaintainersMap.tsx index 933543bfa..ce0e2b6f0 100644 --- a/src/components/MaintainersMap.tsx +++ b/src/components/MaintainersMap.tsx @@ -29,8 +29,8 @@ import { createChartsGlobe, globeHaloScale } from './maintainersChartsGlobe' import { initialMaintainersView, initialView } from './maintainersGlobeView' const zoomStep = 1.5 -const initialScale = initialView.scale * zoomStep -const mobileMaxZoom = initialScale * 1.2 +const desktopInitialScale = initialView.scale * zoomStep +const mobileMaxZoom = desktopInitialScale * 1.2 const mobileViewport = '(width < 40rem)' // Allow for rounding in rAF timestamps at 60 Hz and cap redraws on faster displays. const frameInterval = 1000 / 60 - 1 @@ -42,9 +42,15 @@ const globeRadius = 0.4 const globeAtmosphereDiameter = 2 * globeRadius * globeHaloScale const desktopProjectionDiameter = 0.9 const desktopMaxZoom = - (initialScale * desktopProjectionDiameter) / globeAtmosphereDiameter + (desktopInitialScale * desktopProjectionDiameter) / globeAtmosphereDiameter const zoomControls = { width: 46, height: 171 } +function getInitialScale() { + return window.matchMedia(mobileViewport).matches + ? mobileMaxZoom + : desktopInitialScale +} + type View = typeof initialView type Anchor = { x: number; y: number; visible: boolean } @@ -781,7 +787,7 @@ export function MaintainersMap({ maintainers }: MaintainersMapProps) { const projectionHeight = mobile.matches ? (Math.min(paintWidth, paintHeight) - 2 * viewportGutter) / (globeAtmosphereDiameter * mobileMaxZoom) - : paintHeight / (initialScale * desktopProjectionDiameter) + : paintHeight / (desktopInitialScale * desktopProjectionDiameter) hostSize.current = { width, height, @@ -1102,6 +1108,7 @@ export function MaintainersMap({ maintainers }: MaintainersMapProps) { wakeGlobe.current?.() }) selection.call(behavior) + const initialScale = getInitialScale() selection.call(behavior.transform, zoomIdentity.scale(initialScale)) view.current.scale = initialScale return () => { @@ -1311,7 +1318,7 @@ export function MaintainersMap({ maintainers }: MaintainersMapProps) { aria-label="Reset zoom and tilt" onClick={() => { if (!host) return - select(host).call(behavior.scaleTo, initialScale) + select(host).call(behavior.scaleTo, getInitialScale()) target.current.theta = startingView.theta wakeGlobe.current?.() }} From 80853294c0baed18c4b1797b7098a4d2644aabd9 Mon Sep 17 00:00:00 2001 From: Jonghyeon Ko Date: Mon, 23 Nov 2026 04:11:40 +0900 Subject: [PATCH 2/2] Crop the sides of the homepage globe on mobile --- src/components/MaintainersMap.tsx | 7 +++---- src/components/home/HomeCommunitySection.tsx | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/components/MaintainersMap.tsx b/src/components/MaintainersMap.tsx index ce0e2b6f0..5cea9f332 100644 --- a/src/components/MaintainersMap.tsx +++ b/src/components/MaintainersMap.tsx @@ -783,10 +783,9 @@ export function MaintainersMap({ maintainers }: MaintainersMapProps) { const height = host.clientHeight const paintHeight = surface.clientHeight const limit = mobile.matches ? mobileMaxZoom : desktopMaxZoom - // Keep the desktop starting diameter. On mobile, fit to the smaller edge. + // At the mobile default, crop 3% of the viewport width from each side. const projectionHeight = mobile.matches - ? (Math.min(paintWidth, paintHeight) - 2 * viewportGutter) / - (globeAtmosphereDiameter * mobileMaxZoom) + ? (paintWidth * 1.06) / (2 * globeRadius * mobileMaxZoom) : paintHeight / (desktopInitialScale * desktopProjectionDiameter) hostSize.current = { width, @@ -1177,7 +1176,7 @@ export function MaintainersMap({ maintainers }: MaintainersMapProps) { ) invalidate() }} - className="absolute inset-y-0 left-1/2 w-(--globe-width) -translate-x-1/2 outline-offset-4" + className="absolute inset-y-0 left-1/2 w-(--globe-width) -translate-x-1/2 outline-offset-4 max-sm:overflow-x-clip" >