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:22 +08:00
parent 5c40b7e633
commit c0f6301fd0
2 changed files with 58 additions and 1 deletions

View File

@@ -0,0 +1,47 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>KY-009</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:4px;text-align:center;font-size:20px;font-weight:700}
.pin{position:absolute;left:0;right:0;top:32px;text-align:center}
.st{position:absolute;left:0;right:0;top:52px;text-align:center;font-size:18px;font-weight:700;color:#E85D4C}
.rgb{position:absolute;left:24px;right:24px;top:78px;display:flex;gap:8px}
.rgb .btn{flex:1;height:40px}
.rgb .r{background:#E85D4C}.rgb .g{background:#243140}.rgb .b{background:#243140}
.br{position:absolute;left:16px;top:134px}
.slider{position:absolute;left:110px;right:16px;top:138px;height:12px;border-radius:4px;background:#243140;overflow:hidden}
.slider>i{display:block;height:100%;width:60%;background:#E85D4C}
.act{position:absolute;left:24px;right:24px;bottom:10px;height:44px}
</style>
</head>
<body>
<div class="bezel"><div class="screen" id="s">
<div class="t">KY-009</div>
<div class="pin muted">R22 G27 B4</div>
<div class="st">RED ON</div>
<div class="rgb">
<button class="btn r" type="button">R</button>
<button class="btn g" type="button">G</button>
<button class="btn b" type="button">B</button>
</div>
<div class="br muted">Brightness 60%</div>
<div class="slider"><i></i></div>
<button class="btn on act" type="button">Turn OFF</button>
</div></div>
</body>
</html>

View File

@@ -3,5 +3,15 @@
"name": "CYD KY-009",
"summary": "KY-009 RGB LED: R=GPIO22 G=GPIO27 B=GPIO4, color switch + PWM brightness",
"description": "SoftSPI touch + LVGL. One color at a time (R/G/B buttons) + brightness slider + on/off.",
"tags": ["ky009", "rgb", "led", "pwm", "touch", "lvgl"]
"tags": [
"ky009",
"rgb",
"led",
"pwm",
"touch",
"lvgl"
],
"media": {
"preview": "media/preview.html"
}
}