diff --git a/build/mother-brain-desktop-app-phase4-20260825/source/hololake-native-desktop/src/modules/first-planet-home/FirstPlanetHome.tsx b/build/mother-brain-desktop-app-phase4-20260825/source/hololake-native-desktop/src/modules/first-planet-home/FirstPlanetHome.tsx index 0f0b4a4b7..aa3fb13be 100644 --- a/build/mother-brain-desktop-app-phase4-20260825/source/hololake-native-desktop/src/modules/first-planet-home/FirstPlanetHome.tsx +++ b/build/mother-brain-desktop-app-phase4-20260825/source/hololake-native-desktop/src/modules/first-planet-home/FirstPlanetHome.tsx @@ -46,6 +46,39 @@ function seeded(index: number) { return value - Math.floor(value) } +// 球面星点:极坐标落在圆盘内(光的种子蔓延出的星群) +function usePlanetSpecks(count: number) { + return useMemo(() => Array.from({ length: count }, (_, i) => { + const angle = seeded(i + 7) * Math.PI * 2 + const radius = 12 + Math.pow(seeded(i + 107), 0.7) * 36 // 百分比半径,核心留出亮区 + return { + id: i, + x: 50 + Math.cos(angle) * radius, + y: 50 + Math.sin(angle) * radius * 0.92, + d: 2 + seeded(i + 207) * 4, + dl: -seeded(i + 307) * 6, + warm: seeded(i + 407) < 0.3, + s: 1 + seeded(i + 507) * 1.6, + } + }), [count]) +} + +// 大爆炸废墟:星球外圈的碎光微粒 +function useDebris(count: number) { + return useMemo(() => Array.from({ length: count }, (_, i) => { + const angle = seeded(i + 901) * Math.PI * 2 + const radius = 58 + seeded(i + 1101) * 26 + return { + id: i, + x: 50 + Math.cos(angle) * radius, + y: 50 + Math.sin(angle) * radius * 0.8, + d: 3 + seeded(i + 1301) * 5, + dl: -seeded(i + 1501) * 7, + s: 0.8 + seeded(i + 1701) * 1.4, + } + }), [count]) +} + // 星尘画布:130 颗星的呼吸,湖面的微光——canvas 而非 DOM 节点(旧病修正) function StarfieldCanvas({ awake }: { awake: boolean }) { const ref = useRef(null) @@ -105,6 +138,8 @@ export function FirstPlanetHome() { const [infinityLit, setInfinityLit] = useState(false) const [gateMessage, setGateMessage] = useState('') + const specks = usePlanetSpecks(42) + const debris = useDebris(12) const formatted = useMemo(() => (raw ? formatGateNumber(raw) : ''), [raw]) const fullNumber = formatted ? (infinityLit ? `${formatted}∞` : formatted) : '' const canEnter = Boolean(fullNumber) @@ -121,13 +156,24 @@ export function FirstPlanetHome() { return (
-