Add cydweb HTML UI preview for catalog cards.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
45
firmware/cyd/media/preview.html
Normal file
45
firmware/cyd/media/preview.html
Normal file
@@ -0,0 +1,45 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Human IR</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:2px;text-align:center;font-size:26px;font-weight:700}
|
||||
.pin{position:absolute;left:0;right:0;top:34px;text-align:center}
|
||||
.cnt{position:absolute;left:0;right:0;top:56px;text-align:center;font-size:42px;font-weight:800;color:#4FC3F7}
|
||||
.hint{position:absolute;left:0;right:0;top:104px;text-align:center}
|
||||
.st{position:absolute;left:0;right:0;top:122px;text-align:center;font-size:16px;font-weight:700;color:#FF7043}
|
||||
.hold{position:absolute;left:0;right:0;top:144px;text-align:center;font-size:11px}
|
||||
.bar{position:absolute;left:24px;right:24px;top:162px;height:10px;background:#1A2430;border-radius:4px;overflow:hidden}
|
||||
.bar>i{display:block;height:100%;width:28%;background:#FF7043}
|
||||
.raw{position:absolute;left:0;right:0;top:176px;text-align:center;font-size:11px}
|
||||
.act{position:absolute;left:24px;right:24px;bottom:8px;height:40px}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="bezel"><div class="screen" id="s">
|
||||
|
||||
<div class="t">Human IR</div>
|
||||
<div class="pin muted">OUT->GPIO22 VCC 3.3V</div>
|
||||
<div class="cnt">3</div>
|
||||
<div class="hint muted">detects</div>
|
||||
<div class="st">MOTION</div>
|
||||
<div class="hold muted">hold 1250 ms</div>
|
||||
<div class="bar"><i></i></div>
|
||||
<div class="raw ok">OUT HIGH act=HIGH</div>
|
||||
<button class="btn act" type="button">Reset</button>
|
||||
|
||||
</div></div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,5 +3,17 @@
|
||||
"name": "CYD Human IR",
|
||||
"summary": "Small PIR (SR505/mini SR501) on GPIO22 @ 3.3V: motion-start count +1",
|
||||
"description": "SoftSPI touch + LVGL. VCC 3.3V / GND / OUT->GPIO22. Float INPUT, idle LOW active HIGH. Motion edge +1, hold bar, Reset clears.",
|
||||
"tags": ["pir", "sr505", "human-infrared", "gpio22", "3.3v", "touch", "lvgl", "counter"]
|
||||
"tags": [
|
||||
"pir",
|
||||
"sr505",
|
||||
"human-infrared",
|
||||
"gpio22",
|
||||
"3.3v",
|
||||
"touch",
|
||||
"lvgl",
|
||||
"counter"
|
||||
],
|
||||
"media": {
|
||||
"preview": "media/preview.html"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user