// Android.jsx — Simplified Android (Material 3) device frame // Status bar + top app bar + content + gesture nav + keyboard. // Based on Figma M3 spec. No dependencies, no image assets. const MD_C = { surface: '#f4fbf8', surfaceVariant: '#dae5e1', inverseOnSurface: '#ecf2ef', secondaryContainer: '#cde8e1', primaryFixedDim: '#83d5c6', onSurface: '#171d1b', onSurfaceVar: '#49454f', onPrimaryContainer: '#00201c', primary: '#006a60', frameBorder: 'rgba(116,119,117,0.5)', }; // ───────────────────────────────────────────────────────────── // Status bar (time left, wifi/cell/battery right) // ───────────────────────────────────────────────────────────── function AndroidStatusBar({ dark = false }) { const c = dark ? '#fff' : MD_C.onSurface; return (
{/* time left */}
9:30
{/* camera punch-hole (center) */}
{/* status icons right */}
); } // ───────────────────────────────────────────────────────────── // Top app bar (Material 3 small/medium) // ───────────────────────────────────────────────────────────── function AndroidAppBar({ title = 'Title', large = false }) { const iconDot = (
); return (
{iconDot} {!large && ( {title} )} {large &&
} {iconDot}
{large && (
{title}
)}
); } // ───────────────────────────────────────────────────────────── // List item (Material 3) // ───────────────────────────────────────────────────────────── function AndroidListItem({ headline, supporting, leading }) { return (
{leading && (
{leading}
)}
{headline}
{supporting && (
{supporting}
)}
); } // ───────────────────────────────────────────────────────────── // Gesture nav bar (pill) // ───────────────────────────────────────────────────────────── function AndroidNavBar({ dark = false }) { return (
); } // ───────────────────────────────────────────────────────────── // Device frame — wraps everything // ───────────────────────────────────────────────────────────── function AndroidDevice({ children, width = 412, height = 892, dark = false, title, large = false, keyboard = false, }) { return (
{title !== undefined && }
{children}
{keyboard && }
); } // ───────────────────────────────────────────────────────────── // Keyboard — Gboard (Material 3) // ───────────────────────────────────────────────────────────── function AndroidKeyboard() { let _k = 0; const key = (l, { flex = 1, bg = MD_C.surface, r = 6, minW, fs = 21 } = {}) => (
{l}
); const row = (keys, style = {}) => (
{keys.map(l => key(l))}
); return (
{/* navbar spacer (icons omitted) */}
{/* key rows */}
{row(['q','w','e','r','t','y','u','i','o','p'])} {row(['a','s','d','f','g','h','j','k','l'], { padding: '0 20px' })}
{key('', { bg: MD_C.surfaceVariant })}
{['z','x','c','v','b','n','m'].map(l => key(l))}
{key('', { bg: MD_C.surfaceVariant })}
{key('?123', { bg: MD_C.secondaryContainer, r: 100, minW: 58, fs: 14 })} {key(',', { bg: MD_C.surfaceVariant })} {key('', { flex: 3, minW: 154 })} {key('.', { bg: MD_C.surfaceVariant })} {key('', { bg: MD_C.primaryFixedDim, r: 100, minW: 58 })}
); } Object.assign(window, { AndroidDevice, AndroidStatusBar, AndroidAppBar, AndroidListItem, AndroidNavBar, AndroidKeyboard, });