30 lines
849 B
HTML
30 lines
849 B
HTML
<!doctype html>
|
||
<html lang="zh-CN">
|
||
<head>
|
||
<meta charset="UTF-8" />
|
||
<title>预览:一台 390 的屏</title>
|
||
<style>
|
||
body {
|
||
margin: 0;
|
||
background: #e9eaee;
|
||
}
|
||
iframe {
|
||
display: block;
|
||
border: 0;
|
||
width: var(--w, 390px);
|
||
height: var(--h, 844px);
|
||
}
|
||
</style>
|
||
</head>
|
||
<body>
|
||
<iframe id="f"></iframe>
|
||
<script>
|
||
const p = new URLSearchParams(location.search);
|
||
// 套一层 iframe 是因为 headless Chrome 把窗口宽度钳在 500,量不到真手机的 390
|
||
document.documentElement.style.setProperty('--w', (p.get('w') || 390) + 'px');
|
||
document.documentElement.style.setProperty('--h', (p.get('h') || 844) + 'px');
|
||
document.getElementById('f').src = p.get('src') || '/preview-mobile.html';
|
||
</script>
|
||
</body>
|
||
</html>
|