Add cydweb HTML UI preview for catalog cards.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-23 15:55:23 +08:00
parent 0ac35871dc
commit dcd1c2052b
2 changed files with 53 additions and 1 deletions

View File

@@ -0,0 +1,41 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Whistle / Sound</title>
<style>
*{box-sizing:border-box;margin:0;padding:0}
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:#0A1016;color:#EAF0F6;font:12px/1.2 system-ui,sans-serif;position:relative;overflow:hidden}
.muted{color:#7A8B9C}.ok{color:#3DDC97}.bad{color:#E85D4C}.acc{color:#4FC3F7}.amber{color:#FFB74D}
.btn{border:0;border-radius:8px;background:#243140;color:#EAF0F6;font-weight:600}
.btn.acc{background:#1A4A6E}.btn.on{background:#1B5E4A}.btn.warn{background:#6B3A1E}
.t{position:absolute;left:0;right:0;top:8px;text-align:center;font-size:18px;font-weight:700}
.pin{position:absolute;left:0;right:0;top:36px;text-align:center}
.st{position:absolute;left:0;right:0;top:64px;text-align:center;font-size:32px;font-weight:800}
.lvl{position:absolute;left:0;right:0;top:108px;text-align:center;font-size:11px}
.bar{position:absolute;left:24px;right:24px;top:130px;height:16px;background:#2A3340;border-radius:4px;overflow:hidden}
.bar>i{display:block;height:100%;width:18%;background:#3DDC97}
.hits{position:absolute;left:0;right:0;top:158px;text-align:center}
.act{position:absolute;left:90px;width:140px;bottom:12px;height:44px}
</style>
</head>
<body>
<div class="bezel"><div class="screen" id="s">
<div class="t">Whistle / Sound</div>
<div class="pin muted">OUT -&gt; GPIO22 (H/L)</div>
<div class="st">QUIET</div>
<div class="lvl muted">pin: LOW -&gt; idle</div>
<div class="bar"><i></i></div>
<div class="hits muted">hits: 7</div>
<button class="btn act" type="button">Reset</button>
</div></div>
</body>
</html>

View File

@@ -3,5 +3,16 @@
"name": "CYD Whistle Sound Sensor",
"summary": "3-pin whistle module on GPIO22: digital H/L detect, hit count, Reset",
"description": "SoftSPI touch + LVGL 320x240. OUT->GPIO22 high/low (default active HIGH). QUIET/SOUND UI, debounced hits, no dB (digital only).",
"tags": ["sound", "whistle", "digital", "gpio22", "touch", "lvgl", "cyd"]
"tags": [
"sound",
"whistle",
"digital",
"gpio22",
"touch",
"lvgl",
"cyd"
],
"media": {
"preview": "media/preview.html"
}
}