Apply the eight galaxy visual refinements from the review

This commit is contained in:
Tessera Agent
2026-11-09 12:19:04 +00:00
parent 5b40536e37
commit 0ee32fcf8f
4 changed files with 172 additions and 96 deletions

View File

@@ -89,7 +89,7 @@ export function BlackholeGalaxy({
const lockLayout = useMemo(() => {
const n = starOrbits.length;
if (!n) {
return { stars: [] as { x: number; y: number }[], moons: [] as { x: number; y: number }[][], labels: [] as { x: number; y: number }[] };
return { stars: [] as { x: number; y: number }[], moons: [] as ({ x: number; y: number } | null)[][], labels: [] as { x: number; y: number }[] };
}
const stars = Array.from({ length: n }, (_, i) =>
lockedSlot(i, n),
@@ -163,9 +163,8 @@ export function BlackholeGalaxy({
d={arcs.back}
fill="none"
stroke="#6d84c4"
strokeOpacity={flowing ? 0.08 : 0.1}
strokeWidth={0.7}
strokeDasharray="2 10"
strokeOpacity={flowing ? 0.035 : 0.02}
strokeWidth={0.6}
/>
);
})}
@@ -195,9 +194,9 @@ export function BlackholeGalaxy({
d={arcs.front}
fill="none"
stroke="#9aafdf"
strokeOpacity={flowing ? 0.2 : 0.12}
strokeWidth={0.9}
strokeDasharray="2 8"
strokeOpacity={flowing ? 0.18 : 0.05}
strokeWidth={0.85}
strokeDasharray="3 14"
/>
);
})}
@@ -240,7 +239,7 @@ function StarLayer({
starOrbits: Orbit[];
snapsByOrbit: Map<string, Snapshot[]>;
lockLayout: {
moons: { x: number; y: number }[][];
moons: ({ x: number; y: number } | null)[][];
labels: { x: number; y: number }[];
};
selectedSnapshotId?: string | null;
@@ -266,20 +265,26 @@ function StarLayer({
const color = statusColor(orbit.last_status);
const depthScale = pose.scale * blend + (1 - blend);
const starR = (flowing ? STAR_R_FLOW : STAR_R_LOCK) * depthScale;
const dim = 0.55 + ((pose.z + 1) / 2) * 0.45;
const facing = (pose.z + 1) / 2;
const behind = pose.z < -0.08 ? 0.45 : 1;
const dim = (0.2 + facing * 0.8) * behind;
const opacity = dim * blend + (1 - blend);
const interactive = !flowing || blend < 0.15;
const label = lockLayout.labels[i];
const flowOff = flowMoonOffsets(moons.length, t, 32);
const flowOff = flowMoonOffsets(moons.length, t, 46);
const lockMoons = lockLayout.moons[i] ?? [];
const moonNodes = moons.map((moon, mi) => {
const nearMoon = flowOff.reduce(
(best, off, mi) => (off.z > best.z ? { z: off.z, mi } : best),
{ z: -Infinity, mi: 0 },
).mi;
const moonNodes = moons.flatMap((moon, mi) => {
const off = flowOff[mi];
const lockMp = lockMoons[mi];
if (!lockMp && blend < 0.4) return [];
const flowMp = { x: x + off.x * depthScale, y: y + off.y * depthScale };
const mp = lockMp ? lerpPos(flowMp, lockMp, blend) : flowMp;
const localZ = off.z;
return { moon, mp, localZ, off };
return [{ moon, mp, localZ: off.z, off, mi, showRing: blend < 0.45 || mi === nearMoon }];
});
const moonsBehind = moonNodes.filter((m) => m.localZ < 0 || blend < 0.5);
const moonsAhead = blend < 0.5 ? [] : moonNodes.filter((m) => m.localZ >= 0);
@@ -298,6 +303,8 @@ function StarLayer({
r={mr}
hitR={flowing ? mr : MOON_HIT_LOCK}
rim={color}
ring={node.mi * 37 - 20}
showRing={node.showRing || !flowing}
selected={sel}
locked={!flowing}
onClick={(e) => {
@@ -397,32 +404,17 @@ function StarBody({
cy={y}
r={r}
fill="none"
stroke="#eef1ff"
strokeOpacity={locked ? 0.55 : 0.25}
strokeWidth={locked ? 1.2 : 0.6}
stroke={color}
strokeOpacity={locked ? 0.7 : 0.28}
strokeWidth={locked ? 1.1 : 0.55}
/>
<circle
cx={x - r * 0.28}
cy={y - r * 0.32}
r={Math.max(1.1, r * 0.22)}
fill="#ffffff"
opacity={locked ? 0.7 : 0.4}
/>
{locked && (
<>
<line
x1={x - r * 1.4}
y1={y}
x2={x + r * 1.4}
y2={y}
stroke={color}
strokeOpacity={0.35}
strokeWidth={0.6}
/>
<line
x1={x}
y1={y - r * 1.4}
x2={x}
y2={y + r * 1.4}
stroke={color}
strokeOpacity={0.35}
strokeWidth={0.6}
/>
</>
)}
</g>
);
}
@@ -433,6 +425,8 @@ function MoonBody({
r,
hitR,
rim,
ring = -18,
showRing = true,
selected,
locked,
opacity = 1,
@@ -443,6 +437,8 @@ function MoonBody({
r: number;
hitR: number;
rim: string;
ring?: number;
showRing?: boolean;
selected: boolean;
locked: boolean;
opacity?: number;
@@ -457,17 +453,19 @@ function MoonBody({
{locked && (
<circle cx={x} cy={y} r={hitR} fill="transparent" />
)}
<ellipse
cx={x}
cy={y}
rx={r * 1.9}
ry={r * 0.38}
fill="none"
stroke={selected ? "#e8ecff" : rim}
strokeOpacity={locked ? 0.45 : 0.3}
strokeWidth={0.7}
transform={`rotate(-18 ${x} ${y})`}
/>
{showRing && (
<ellipse
cx={x}
cy={y}
rx={r * 1.9}
ry={r * 0.38}
fill="none"
stroke={selected ? "#e8ecff" : rim}
strokeOpacity={locked ? 0.45 : 0.35}
strokeWidth={0.7}
transform={`rotate(${ring} ${x} ${y})`}
/>
)}
<circle
cx={x}
cy={y}
@@ -534,16 +532,6 @@ function BlackHoleCore({
<g>
<circle cx="0" cy="0" r={148 * breathe} fill="url(#bhHalo)" opacity={0.5} />
<circle cx="0" cy="0" r="132" fill="url(#bhCore)" opacity={0.92} />
<ellipse
cx="0"
cy="0"
rx="124"
ry="124"
fill="none"
stroke="#e8b86a"
strokeOpacity={0.42}
strokeWidth="1.2"
/>
<ellipse
cx={wobble}
cy="0"
@@ -564,17 +552,13 @@ function BlackHoleCore({
opacity={0.38}
transform={`rotate(${-diskRot * 1.35 + 12})`}
/>
<ellipse
cx="0"
cy="0"
rx="76"
ry="76"
<path
d="M -86 12 A 108 34 0 0 0 86 12"
fill="none"
stroke="#f0c468"
strokeOpacity={0.22}
strokeWidth="0.8"
strokeDasharray="2 6"
transform={`rotate(${diskRot * 2})`}
stroke="#f4d48a"
strokeOpacity={0.7}
strokeWidth="1.35"
strokeLinecap="round"
/>
<g className="cursor-pointer" onClick={onToggle}>
<title>