Galaxy vault: black hole scene with flow/lock interaction
Stars per orbit, snapshot moons when locked, toggle on singularity.
This commit is contained in:
@@ -1,34 +1,55 @@
|
||||
import { motion } from "motion/react";
|
||||
import type { Snapshot } from "../../api";
|
||||
import { VaultRing } from "../vault/VaultRing";
|
||||
import type { Orbit, Snapshot } from "../../api";
|
||||
import { Starfield } from "./Starfield";
|
||||
import { BlackholeGalaxy } from "./BlackholeGalaxy";
|
||||
|
||||
export function VaultScene({
|
||||
orbits,
|
||||
snapshots,
|
||||
flowing,
|
||||
onToggleFlow,
|
||||
onSelect,
|
||||
onCapture,
|
||||
onSelectOrbit,
|
||||
selectedSnapshotId,
|
||||
capturing,
|
||||
}: {
|
||||
orbits: Orbit[];
|
||||
snapshots: Snapshot[];
|
||||
flowing: boolean;
|
||||
onToggleFlow: () => void;
|
||||
onSelect: (id: string) => void;
|
||||
onCapture?: () => void;
|
||||
onSelectOrbit: (id: string) => void;
|
||||
selectedSnapshotId?: string | null;
|
||||
capturing?: boolean;
|
||||
}) {
|
||||
return (
|
||||
<div className="absolute inset-0 overflow-hidden">
|
||||
<div className="absolute inset-0 bg-[radial-gradient(ellipse_at_center,rgba(30,38,71,0.45)_0%,rgba(4,5,12,0.95)_65%)]" />
|
||||
<div className="absolute inset-0 bg-[radial-gradient(ellipse_at_center,rgba(30,38,71,0.35)_0%,rgba(4,5,12,0.98)_70%)]" />
|
||||
<Starfield />
|
||||
<motion.div
|
||||
className="absolute top-1/4 left-1/2 -translate-x-1/2 w-[80vmin] h-[40vmin] rounded-full bg-wormhole-violet/5 blur-3xl"
|
||||
animate={{ opacity: [0.3, 0.55, 0.3], scale: [1, 1.05, 1] }}
|
||||
transition={{ duration: 8, repeat: Infinity }}
|
||||
className="absolute top-1/3 left-1/2 -translate-x-1/2 w-[90vmin] h-[50vmin] rounded-full bg-wormhole-violet/8 blur-3xl"
|
||||
animate={{
|
||||
opacity: capturing ? [0.5, 0.9, 0.5] : [0.25, 0.45, 0.25],
|
||||
scale: capturing ? [1, 1.08, 1] : [1, 1.03, 1],
|
||||
}}
|
||||
transition={{ duration: capturing ? 2 : 8, repeat: Infinity }}
|
||||
/>
|
||||
<div className="relative z-10 h-full w-full pb-28">
|
||||
<VaultRing
|
||||
<motion.p
|
||||
className="absolute top-20 left-1/2 -translate-x-1/2 z-20 text-[10px] font-mono tracking-widest uppercase pointer-events-none"
|
||||
initial={false}
|
||||
animate={{ color: flowing ? "#4ade9a" : "#f0c468" }}
|
||||
>
|
||||
{flowing ? "◉ vault flowing — click singularity to lock" : "◉ vault locked — select stars & moons"}
|
||||
</motion.p>
|
||||
<div className="relative z-10 h-full w-full">
|
||||
<BlackholeGalaxy
|
||||
orbits={orbits}
|
||||
snapshots={snapshots}
|
||||
onSelect={onSelect}
|
||||
onCapture={onCapture}
|
||||
capturing={capturing}
|
||||
flowing={flowing}
|
||||
onToggleFlow={onToggleFlow}
|
||||
onSelectSnapshot={onSelect}
|
||||
onSelectOrbit={onSelectOrbit}
|
||||
selectedSnapshotId={selectedSnapshotId}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user