Fix preview.html to native 320x240 without internal scale.

Card host now scales the iframe; remove broken transform that clipped UI to the corner.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-19 22:14:21 +08:00
parent 23d1ce2ac6
commit 39081d2a2f

View File

@@ -6,12 +6,11 @@
<title>CLIMATE</title>
<style>
*{box-sizing:border-box;margin:0;padding:0}
html,body{width:100%;height:100%;overflow:hidden;background:#000}
.bezel{width:100%;height:100%;display:grid;place-items:center;background:#1a1408}
html,body{width:320px;height:240px;overflow:hidden;background:#000;margin:0}
.bezel{width:320px;height:240px;background:#1a1408}
.screen{
width:320px;height:240px;background:#0A1018;color:#F2F5FA;
font:12px/1.2 system-ui,sans-serif;position:relative;overflow:hidden;
transform-origin:center;transform:scale(var(--s,1));
}
.hdr{display:flex;align-items:center;gap:8px;padding:4px 8px;height:24px}
.hdr b{font-size:14px;font-weight:700}
@@ -70,10 +69,6 @@
</svg></div>
</div>
</div></div>
<script>
(function(){function fit(){var s=document.getElementById('s');var r=s.parentElement.getBoundingClientRect();
var k=Math.min(r.width/320,r.height/240);s.style.setProperty('--s',k);}
fit();addEventListener('resize',fit);})();
</script>
</body>
</html>