Files
Brain/brain-h5/src/mobile/geometry.ts
MingNian b0fce840a3 首次提交:脑晴测 H5 项目
包含前端源码、预构建产物(dist/)、零依赖 Node.js 服务器(server.mjs)、
Cloudflare Worker 版本(worker/)、部署文档(DEPLOY.md)和交接文档。

技术总监可直接 clone 后运行 node server.mjs 启动,无需安装 React 或 build。
DEEPSEEK_API_KEY 通过环境变量注入,未纳入仓库。
2026-07-28 10:24:47 +08:00

69 lines
1.2 KiB
TypeScript

export type MobileDeviceGeometry = {
device: {
width: number;
height: number;
};
screen: {
x: number;
y: number;
width: number;
height: number;
radius: number;
};
safeArea: {
top: number;
bottom: number;
};
keyboard: {
height: number;
};
};
export const iphoneGeometry = {
// CSS-space coordinates for the 3x iPhone assets. Keep source PNG dimensions
// divisible by 3 so the rendered phone frame lands on whole CSS pixels.
device: {
width: 511,
height: 968,
},
screen: {
x: 59,
y: 58,
width: 393,
height: 852,
radius: 42,
},
safeArea: {
top: 54,
bottom: 34,
},
keyboard: {
height: 338,
},
} as const satisfies MobileDeviceGeometry;
export const pixelGeometry = {
// Pixel10.png is a 2x asset. Its 854 x 1904 screen opening renders at
// exactly 427 x 952 CSS pixels inside the 566 x 1022 asset canvas.
device: {
width: 566,
height: 1022,
},
screen: {
x: 70,
y: 35,
width: 427,
height: 952,
radius: 58,
},
safeArea: {
top: 64,
bottom: 48,
},
keyboard: {
height: 316,
},
} as const satisfies MobileDeviceGeometry;
export type IPhoneGeometry = typeof iphoneGeometry;