Add HTML on-device UI preview for flasher catalog.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
79
firmware/cyd_28r/media/preview.html
Normal file
79
firmware/cyd_28r/media/preview.html
Normal file
@@ -0,0 +1,79 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=320" />
|
||||
<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}
|
||||
.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}
|
||||
.hdr .up{color:#7E90A8}
|
||||
.hdr .sp{margin-left:auto;display:flex;align-items:center;gap:6px;color:#7E90A8}
|
||||
.led{width:9px;height:9px;border-radius:50%;background:#4CAF7A}
|
||||
.row{display:flex;gap:6px;padding:0 8px}
|
||||
.panel{
|
||||
flex:1;height:118px;background:#121C2A;border:1px solid #1E2C40;
|
||||
border-radius:6px;padding:6px 8px;position:relative;
|
||||
}
|
||||
.cap{color:#7E90A8;font-size:11px}
|
||||
.gauge{
|
||||
width:90px;height:90px;margin:4px auto 0;border-radius:50%;
|
||||
background:conic-gradient(#3DBF8C 0 70%, #243247 0);
|
||||
mask:radial-gradient(farthest-side,transparent 62%,#000 63%);
|
||||
-webkit-mask:radial-gradient(farthest-side,transparent 62%,#000 63%);
|
||||
}
|
||||
.panel.hum .gauge{background:conic-gradient(#3DB8A8 0 55%, #243247 0)}
|
||||
.val{position:absolute;left:0;right:0;top:48px;text-align:center;font-size:24px;font-weight:700}
|
||||
.panel.hum .val{color:#3DB8A8}
|
||||
.panel.temp .val{color:#3DBF8C}
|
||||
.unit{font-size:11px;color:#7E90A8;font-weight:500}
|
||||
.rng{position:absolute;left:0;right:0;bottom:6px;text-align:center;color:#7E90A8;font-size:11px}
|
||||
.bot{
|
||||
margin:6px 8px 0;height:78px;background:#121C2A;border:1px solid #1E2C40;
|
||||
border-radius:6px;display:flex;gap:8px;padding:8px;
|
||||
}
|
||||
.info{width:88px}
|
||||
.ok{color:#E6B84D;font-size:14px;font-weight:700}
|
||||
.bar{margin-top:8px;height:8px;background:#243247;border-radius:4px;overflow:hidden}
|
||||
.bar>i{display:block;height:100%;width:62%;background:#E6B84D}
|
||||
.meta{margin-top:10px;color:#7E90A8;font-size:11px}
|
||||
.chart{flex:1;background:#0E1622;border-radius:4px;position:relative;overflow:hidden}
|
||||
.chart svg{width:100%;height:100%}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="bezel"><div class="screen" id="s">
|
||||
<div class="hdr"><b>CLIMATE</b><span class="up">up 01:24</span>
|
||||
<span class="sp"><span>OK</span><span class="led"></span></span></div>
|
||||
<div class="row">
|
||||
<div class="panel temp"><div class="cap">TEMP</div><div class="gauge"></div>
|
||||
<div class="val">24.6<span class="unit">C</span></div><div class="rng">22.1 / 26.0</div></div>
|
||||
<div class="panel hum"><div class="cap">HUM</div><div class="gauge"></div>
|
||||
<div class="val">48<span class="unit">%</span></div><div class="rng">41 / 55</div></div>
|
||||
</div>
|
||||
<div class="bot">
|
||||
<div class="info"><div class="ok">COMFORT</div><div class="bar"><i></i></div>
|
||||
<div class="meta">DHT11 · GPIO22</div></div>
|
||||
<div class="chart"><svg viewBox="0 0 180 60" preserveAspectRatio="none">
|
||||
<polyline fill="none" stroke="#3DBF8C" stroke-width="2"
|
||||
points="0,40 20,35 40,38 60,28 80,30 100,22 120,26 140,18 160,24 180,20"/>
|
||||
<polyline fill="none" stroke="#3DB8A8" stroke-width="2"
|
||||
points="0,45 20,42 40,44 60,40 80,38 100,36 120,39 140,34 160,37 180,35"/>
|
||||
</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>
|
||||
10
firmware/cyd_28r/meta.json
Normal file
10
firmware/cyd_28r/meta.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"boardId": "esp32-2432s028",
|
||||
"name": "CYD climate dashboard",
|
||||
"summary": "Temperature & humidity gauges with comfort bar and chart",
|
||||
"description": "DHT11 on GPIO22. Dual arcs for TEMP/HUM, comfort status, live sparkline.",
|
||||
"tags": ["climate", "dht11", "gauge"],
|
||||
"media": {
|
||||
"preview": "media/preview.html"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user