Fix Globe: remove auto-spin, brighten dark mode, reduce jitter

This commit is contained in:
Usman Baig
2026-03-09 15:51:01 +01:00
parent efd647d856
commit 9dba2cf2e2

View File

@@ -39,8 +39,8 @@ export default function Globe({ data, className }: GlobeProps) {
const r = useMotionValue(0) const r = useMotionValue(0)
const rs = useSpring(r, { const rs = useSpring(r, {
mass: 1, mass: 1,
damping: 30, damping: 50,
stiffness: 100, stiffness: 80,
}) })
const updatePointerInteraction = (value: number | null) => { const updatePointerInteraction = (value: number | null) => {
@@ -78,12 +78,12 @@ export default function Globe({ data, className }: GlobeProps) {
phi: 0, phi: 0,
theta: 0.3, theta: 0.3,
dark: isDark ? 1 : 0, dark: isDark ? 1 : 0,
diffuse: 0.4, diffuse: isDark ? 1.2 : 0.4,
mapSamples: 16000, mapSamples: 16000,
mapBrightness: isDark ? 1.8 : 1.2, mapBrightness: isDark ? 6 : 1.2,
baseColor: isDark ? [0.15, 0.15, 0.15] : [1, 1, 1], baseColor: isDark ? [0.3, 0.3, 0.3] : [1, 1, 1],
markerColor: [253 / 255, 94 / 255, 15 / 255], markerColor: [253 / 255, 94 / 255, 15 / 255],
glowColor: isDark ? [0.15, 0.15, 0.15] : [1, 1, 1], glowColor: isDark ? [0.08, 0.08, 0.08] : [1, 1, 1],
markers, markers,
} }
@@ -92,7 +92,6 @@ export default function Globe({ data, className }: GlobeProps) {
width: widthRef.current * 2, width: widthRef.current * 2,
height: widthRef.current * 2, height: widthRef.current * 2,
onRender: (state) => { onRender: (state) => {
if (!pointerInteracting.current) phiRef.current += 0.005
state.phi = phiRef.current + rs.get() state.phi = phiRef.current + rs.get()
state.width = widthRef.current * 2 state.width = widthRef.current * 2
state.height = widthRef.current * 2 state.height = widthRef.current * 2