/**
* AndroidFrame — Android设备边框(参考Pixel 8系列)
*
* 含:punch-hole相机 + 状态栏 + 导航栏 + 圆角
*
* 用法:
*
*
*
*/
const androidFrameStyles = {
wrapper: {
display: 'inline-block',
padding: 10,
background: '#1a1a1a',
borderRadius: 44,
boxShadow: '0 0 0 2px #2a2a2a, 0 20px 60px rgba(0,0,0,0.3)',
position: 'relative',
},
screen: {
position: 'relative',
borderRadius: 36,
overflow: 'hidden',
background: '#fff',
},
statusBar: {
position: 'absolute',
top: 0,
left: 0,
right: 0,
height: 32,
display: 'flex',
alignItems: 'center',
justifyContent: 'space-between',
padding: '0 24px',
fontSize: 14,
fontWeight: 500,
fontFamily: 'Roboto, -apple-system, sans-serif',
zIndex: 20,
pointerEvents: 'none',
},
punchHole: {
position: 'absolute',
top: 10,
left: '50%',
transform: 'translateX(-50%)',
width: 14,
height: 14,
background: '#000',
borderRadius: '50%',
zIndex: 30,
},
statusIcons: {
display: 'flex',
alignItems: 'center',
gap: 6,
},
batteryText: {
fontSize: 11,
fontWeight: 600,
marginLeft: 2,
},
content: {
position: 'absolute',
top: 32,
left: 0,
right: 0,
bottom: 24,
overflow: 'auto',
},
navBar: {
position: 'absolute',
bottom: 0,
left: 0,
right: 0,
height: 24,
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
gap: 60,
zIndex: 10,
},
navButton: {
width: 36,
height: 4,
background: 'rgba(0,0,0,0.3)',
borderRadius: 999,
},
};
function AndroidFrame({
children,
width = 412,
height = 892,
time = '9:41',
battery = 100,
darkMode = false,
navStyle = 'gesture',
}) {
const textColor = darkMode ? '#fff' : '#1a1a1a';
return (
{children}
{navStyle === 'gesture' && (
)}
{navStyle === 'buttons' && (
◁
○
□
)}
);
}
if (typeof window !== 'undefined') {
window.AndroidFrame = AndroidFrame;
}