The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import type { CSSProperties, ReactNode } from "react"; |
| 2 | import { AbsoluteFill } from "remotion"; |
| 3 | import { TITLE_BAR, WINDOW, type AppId } from "../../shared/types.ts"; |
| 4 | import { sans } from "../fonts.ts"; |
| 5 | import { brand } from "../theme.ts"; |
| 6 | |
| 7 | export const APP_NAMES: Record<AppId, string> = { |
| 8 | editor: "Code", |
| 9 | terminal: "Ghostty", |
| 10 | diagram: "Architecture", |
| 11 | browser: "Google Chrome", |
| 12 | slide: "", |
| 13 | }; |
| 14 | |
| 15 | /** Dark wallpaper with the brand's moss and ember glows. */ |
| 16 | export const Wallpaper = () => ( |
| 17 | <AbsoluteFill |
| 18 | style={{ |
| 19 | background: [ |
| 20 | `radial-gradient(1200px 800px at 12% 18%, ${brand.moss}33, transparent 60%)`, |
| 21 | `radial-gradient(1000px 700px at 88% 85%, ${brand.ember}2e, transparent 60%)`, |
| 22 | `linear-gradient(160deg, #1b1712, ${brand.bg} 55%, #0d0b08)`, |
| 23 | ].join(","), |
| 24 | }} |
| 25 | /> |
| 26 | ); |
| 27 | |
| 28 | export const MenuBar = ({ app }: { app: AppId }) => ( |
| 29 | <div |
| 30 | style={{ |
| 31 | position: "absolute", |
| 32 | inset: "0 0 auto 0", |
| 33 | height: 34, |
| 34 | display: "flex", |
| 35 | alignItems: "center", |
| 36 | gap: 26, |
| 37 | padding: "0 22px", |
| 38 | background: "rgba(20, 17, 13, 0.55)", |
| 39 | backdropFilter: "blur(20px)", |
| 40 | color: "#f2ede2", |
| 41 | fontFamily: sans, |
| 42 | fontSize: 15, |
| 43 | }} |
| 44 | > |
| 45 | <AlchemyMark size={18} /> |
| 46 | <span style={{ fontWeight: 700 }}>{APP_NAMES[app]}</span> |
| 47 | {["File", "Edit", "View", "Window", "Help"].map((item) => ( |
| 48 | <span key={item} style={{ opacity: 0.85 }}> |
| 49 | {item} |
| 50 | </span> |
| 51 | ))} |
| 52 | <span style={{ marginLeft: "auto", opacity: 0.85 }}>Tue 9:41 AM</span> |
| 53 | </div> |
| 54 | ); |
| 55 | |
| 56 | export const AlchemyMark = ({ size, style }: { size: number; style?: CSSProperties }) => ( |
| 57 | <svg |
| 58 | width={size} |
| 59 | height={size} |
| 60 | viewBox="0 0 24 24" |
| 61 | fill="none" |
| 62 | stroke={brand.moss} |
| 63 | strokeWidth={1.4} |
| 64 | strokeLinecap="round" |
| 65 | strokeLinejoin="round" |
| 66 | style={style} |
| 67 | > |
| 68 | <circle cx="12" cy="12" r="9.5" /> |
| 69 | <path d="M12 21.225 L4.0109 7.3875 L19.9891 7.3875 Z" /> |
| 70 | <circle cx="12" cy="12" r="1.3" fill={brand.ember} stroke="none" /> |
| 71 | </svg> |
| 72 | ); |
| 73 | |
| 74 | const TrafficLights = () => ( |
| 75 | <div style={{ display: "flex", gap: 9 }}> |
| 76 | {["#ff5f57", "#febc2e", "#28c840"].map((color) => ( |
| 77 | <div key={color} style={{ width: 13, height: 13, borderRadius: 7, background: color }} /> |
| 78 | ))} |
| 79 | </div> |
| 80 | ); |
| 81 | |
| 82 | /** A macOS window at the shared window frame. `bar` replaces the default title bar (browser tabs). */ |
| 83 | export const Window = ({ |
| 84 | title, |
| 85 | background, |
| 86 | bar, |
| 87 | style, |
| 88 | children, |
| 89 | }: { |
| 90 | title?: string; |
| 91 | background: string; |
| 92 | bar?: ReactNode; |
| 93 | style?: CSSProperties; |
| 94 | children: ReactNode; |
| 95 | }) => ( |
| 96 | <div |
| 97 | style={{ |
| 98 | position: "absolute", |
| 99 | left: WINDOW.x, |
| 100 | top: WINDOW.y, |
| 101 | width: WINDOW.width, |
| 102 | height: WINDOW.height, |
| 103 | borderRadius: 12, |
| 104 | overflow: "hidden", |
| 105 | background, |
| 106 | boxShadow: |
| 107 | "0 0 0 1px rgba(255,255,255,0.09), 0 30px 80px rgba(0,0,0,0.55), 0 8px 24px rgba(0,0,0,0.35)", |
| 108 | display: "flex", |
| 109 | flexDirection: "column", |
| 110 | ...style, |
| 111 | }} |
| 112 | > |
| 113 | {bar ?? ( |
| 114 | <div |
| 115 | style={{ |
| 116 | height: TITLE_BAR, |
| 117 | flex: "none", |
| 118 | display: "flex", |
| 119 | alignItems: "center", |
| 120 | padding: "0 18px", |
| 121 | position: "relative", |
| 122 | borderBottom: "1px solid rgba(255,255,255,0.06)", |
| 123 | }} |
| 124 | > |
| 125 | <TrafficLights /> |
| 126 | <div |
| 127 | style={{ |
| 128 | position: "absolute", |
| 129 | inset: 0, |
| 130 | display: "grid", |
| 131 | placeItems: "center", |
| 132 | color: "#a0a0a0", |
| 133 | fontFamily: sans, |
| 134 | fontSize: 14, |
| 135 | fontWeight: 500, |
| 136 | pointerEvents: "none", |
| 137 | }} |
| 138 | > |
| 139 | {title} |
| 140 | </div> |
| 141 | </div> |
| 142 | )} |
| 143 | <div style={{ flex: 1, position: "relative", overflow: "hidden" }}>{children}</div> |
| 144 | </div> |
| 145 | ); |
| 146 | |
| 147 | export { TrafficLights }; |