import { interpolate, useCurrentFrame } from "remotion";
// ─── Design tokens (dark mode) ───
const C = {
bg: "#09090B",
surface: "#18181B",
border: "#27272A",
text: "#FAFAFA",
dim: "#71717A",
secondary: "#A1A1AA",
accent: "#22D3EE",
accentSoft: "rgba(34, 211, 238, 0.1)",
success: "#22C55E",
successSoft: "rgba(34, 197, 94, 0.1)",
successBorder: "rgba(34, 197, 94, 0.3)",
warning: "#EAB308",
error: "#EF4444",
} as const;
const FONT = "'Geist', system-ui, sans-serif";
const MONO = "'Geist Mono', 'SF Mono', monospace";
// ─── Web page states ───
export type PageState = "machines-empty" | "machines-choose" | "machines-waiting" | "machines-connected";
interface WebPageProps {
page: PageState;
}
export function WebPage({ page }: WebPageProps) {
return (
{page === "machines-empty" && }
{page === "machines-choose" && } />}
{page === "machines-waiting" && } />}
{page === "machines-connected" && } />}
);
}
// ─── Browser chrome (minimal) ───
function BrowserChrome() {
return (
vtit-agent-coding.dev/machines
);
}
// ─── App nav bar ───
function NavBar() {
return (
VTIT Agent Coding
Boards
Machines
Agents
);
}
// ─── Machines page header ───
function MachinesHeader() {
return (
);
}
// ─── Empty state ───
function MachinesEmpty() {
const frame = useCurrentFrame();
const showCursor = frame > 15;
// Cursor moves toward "Add Machine" button quickly
const cursorX = interpolate(frame, [15, 30], [500, 680], { extrapolateLeft: "clamp", extrapolateRight: "clamp" });
const cursorY = interpolate(frame, [15, 30], [300, 28], { extrapolateLeft: "clamp", extrapolateRight: "clamp" });
const arrived = frame > 30;
// Click effect: cursor briefly scales down
const clicked = frame > 40;
const clickScale = frame >= 35 && frame <= 42 ? 0.8 : 1;
return (
No machines registered.
Click Add Machine to get started.
{/* Cursor */}
{showCursor && (
)}
);
}
// ─── Machines page with dialog overlay ───
function MachinesWithDialog({ dialogContent }: { dialogContent: React.ReactNode }) {
return (
{/* Dimmed background */}
{/* Dialog overlay */}
Add Machine
{dialogContent}
);
}
// ─── Dialog: command + waiting for connection ───
function CommandContent() {
const frame = useCurrentFrame();
return (
Run this command in your terminal:
{/* Terminal snippet */}
{/* Mini title bar */}
{/* Command */}
$
npx vtit-agent-coding start \
--api-url https://vtit-agent-coding.viettelsoftware.com \
--api-key ak_live_xxxxxxxx
{/* Copy button */}
Copy to clipboard
{/* Waiting indicator */}
Waiting for connection...
);
}
// ─── Dialog: choose type ───
function ChooseTypeContent() {
const frame = useCurrentFrame();
// Cursor moves to "Your Computer" and clicks
const showCursor = frame > 10;
const cursorX = interpolate(frame, [10, 25], [200, 120], { extrapolateLeft: "clamp", extrapolateRight: "clamp" });
const cursorY = interpolate(frame, [10, 25], [10, 72], { extrapolateLeft: "clamp", extrapolateRight: "clamp" });
const arrived = frame > 25;
const clicked = frame > 35;
const clickScale = frame >= 32 && frame <= 38 ? 0.8 : 1;
return (
Where will this machine run?
{/* Your Computer option */}
Your Computer
Run the daemon on this machine
{/* Cloud Sandbox option */}
Cloud Sandbox
Coming soon
{/* Cursor */}
{showCursor && (
)}
);
}
// ─── Connected content ───
function ConnectedContent() {
return (
{/* Success banner */}
{/* Machine info */}
{/* Done button */}
Done
);
}
// ─── Small helpers ───
function InfoRow({ label, value, valueColor, dot, mono }: { label: string; value: string; valueColor?: string; dot?: string; mono?: boolean }) {
return (
);
}
function RuntimeBadge({ name }: { name: string }) {
return (
{name}
);
}
// ─── SVG Icons ───
function MonitorIcon({ color }: { color: string }) {
return (
);
}
function CloudIcon({ color }: { color: string }) {
return (
);
}