Spaces:
Running
Running
Download sim.html from eatbackhackathon2026/eatback: direct link, hf CLI and curl.
- Browser
- Download file 14 kB
-
https://huggingface.co/spaces/eatbackhackathon2026/eatback/resolve/main/sim.html
- Command line
-
hf download hf://spaces/eatbackhackathon2026/eatback/sim.html
-
curl -L -o sim.html https://huggingface.co/spaces/eatbackhackathon2026/eatback/resolve/main/sim.html
14 kB
| <html lang="th"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <script src="/static-api.js"></script> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <title>EatBack · Simulator</title> | |
| <link rel="icon" href="/favicon.svg" type="image/svg+xml"> | |
| <link rel="stylesheet" href="/css/app.css"> | |
| <style> | |
| .sim-wrap { max-width: 1280px; margin: 0 auto; padding: 26px 24px 64px; } | |
| .sim-wrap .page-head { align-items: center; margin-bottom: 20px; } | |
| .sim-wrap .page-head h1 { margin: 3px 0 6px; } | |
| .sim-nav { display: flex; flex-wrap: wrap; gap: 8px; } | |
| .sim-guide { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; } | |
| .sim-guide-step { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); } | |
| .sim-guide-no, .sim-card-no { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 9px; background: var(--brand-wash); color: var(--brand-ink); font-size: 13px; font-weight: 700; } | |
| .sim-guide-step b { display: block; font-size: 14px; } | |
| .sim-guide-step span:last-child { display: block; color: var(--ink-2); font-size: 12.5px; } | |
| .sim-explain { display: flex; gap: 11px; align-items: flex-start; margin-bottom: 22px; padding: 13px 16px; border: 1px solid #d5e5d9; border-radius: 12px; background: var(--brand-wash); color: var(--brand-ink); font-size: 13px; } | |
| .sim-explain-icon { font-size: 18px; line-height: 1; font-weight: 700; } | |
| .sim-explain p { margin: 0; } | |
| .sim-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; } | |
| .sim-card { display: flex; flex-direction: column; min-width: 0; padding: 20px; border-top: 4px solid var(--sim-accent); } | |
| .sim-card[data-channel="kitchen"] { --sim-accent: var(--brand); --sim-wash: var(--brand-wash); } | |
| .sim-card[data-channel="rice"] { --sim-accent: #bc8121; --sim-wash: #fcf1df; } | |
| .sim-card[data-channel="dish"] { --sim-accent: #3b7995; --sim-wash: #e7f2f6; } | |
| .sim-card-head { display: flex; align-items: flex-start; gap: 11px; } | |
| .sim-card-no { background: var(--sim-wash); color: var(--sim-accent); width: 32px; height: 32px; font-family: var(--mono); } | |
| .sim-card-title { font-size: 18px; line-height: 1.25; } | |
| .sim-card-location { color: var(--ink-2); font-size: 12.5px; margin-top: 3px; } | |
| .sim-card-purpose { min-height: 40px; color: var(--ink-2); font-size: 13px; margin: 12px 0 14px; } | |
| .sim-reading { padding: 15px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); } | |
| .sim-reading-label { display: block; font-size: 12px; color: var(--ink-2); font-weight: 600; } | |
| .sim-reading .scale-val { display: block; margin: 2px 0 9px; font-size: clamp(30px, 3vw, 38px); } | |
| .sim-reading .scale-val .unit { font-size: 16px; } | |
| .sim-reading-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; } | |
| .sim-stability { font-size: 12px; color: var(--ink-2); } | |
| .sim-stability.warn { color: var(--warn-ink); } | |
| .sim-stability.crit { color: var(--crit-ink); } | |
| .sim-source-hint { min-height: 38px; margin: 8px 0 14px; color: var(--ink-2); font-size: 12px; } | |
| .sim-quick-section { padding-top: 13px; border-top: 1px solid var(--line); } | |
| .sim-section-title { margin: 0 0 3px; font-size: 13px; font-weight: 700; } | |
| .sim-section-hint { margin: 0 0 10px; color: var(--muted); font-size: 12px; } | |
| .sim-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; } | |
| .sim-actions .btn { justify-content: flex-start; min-height: 43px; padding: 8px 10px; text-align: left; line-height: 1.3; font-size: 12.5px; } | |
| .sim-actions .btn[data-kind="reset"] { color: var(--crit-ink); } | |
| .sim-extra { margin-top: 11px; } | |
| .sim-extra summary { color: var(--brand-ink); font-size: 12.5px; font-weight: 600; cursor: pointer; } | |
| .sim-extra .sim-actions { margin-top: 8px; } | |
| .sim-custom { margin-top: auto; padding-top: 16px; } | |
| .sim-custom form { padding-top: 14px; border-top: 1px solid var(--line); } | |
| .sim-custom label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 7px; } | |
| .sim-setrow { display: flex; gap: 8px; } | |
| .sim-setrow input { width: 100%; flex: 1; } | |
| .sim-setrow .btn { white-space: nowrap; } | |
| .sim-input-help { margin: 7px 0 0; font-size: 12px; color: var(--muted); } | |
| .sim-input-feedback { min-height: 19px; margin: 5px 0 0; font-size: 12px; color: var(--brand-ink); } | |
| .sim-input-feedback.error { color: var(--crit-ink); font-weight: 600; } | |
| .sim-input-feedback.pending { color: var(--ink-2); } | |
| .sim-scenarios { margin-top: 18px; } | |
| .sim-scenario-head { display: flex; align-items: flex-start; gap: 12px; } | |
| .sim-scenario-head h2 { font-size: 18px; } | |
| .sim-scenario-head p { margin: 4px 0 0; color: var(--ink-2); font-size: 13px; } | |
| .sim-scenario-note { margin: 14px 0 11px; font-size: 13px; color: var(--ink-2); } | |
| .sim-scenario-actions { display: flex; flex-wrap: wrap; gap: 8px; } | |
| .sim-scenario-actions .btn { text-align: left; } | |
| .sim-scenario-actions small { display: block; font-size: 11px; font-weight: 500; opacity: .8; } | |
| .sim-scenario-feedback { min-height: 20px; margin: 9px 0 0; color: var(--brand-ink); font-size: 12.5px; } | |
| .sim-scenario-feedback.error { color: var(--crit-ink); } | |
| .sim-voice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; } | |
| .sim-voice-grid .btn { min-height: 64px; font-size: 15px; } | |
| .sim-voice-grid .btn small { display: block; font-weight: 500; font-size: 12px; opacity: .75; } | |
| @media (max-width: 700px) { .sim-voice-grid { grid-template-columns: 1fr 1fr; } } | |
| @media (max-width: 1060px) { .sim-grid { grid-template-columns: 1fr 1fr; } .sim-card:first-child { grid-column: 1 / -1; } .sim-card-purpose, .sim-source-hint { min-height: 0; } } | |
| @media (max-width: 700px) { .sim-wrap { padding: 18px 16px 44px; } .sim-guide, .sim-grid { grid-template-columns: 1fr; } .sim-card:first-child { grid-column: auto; } .sim-guide { gap: 8px; } .sim-card { padding: 18px; } .sim-scenario-actions .btn { width: 100%; justify-content: flex-start; } } | |
| @media (max-width: 390px) { .sim-setrow { flex-direction: column; } .sim-actions { grid-template-columns: 1fr; } } | |
| </style> | |
| </head> | |
| <body> | |
| <main class="sim-wrap"> | |
| <header class="page-head"> | |
| <div> | |
| <div class="eyebrow" data-en="EatBack · demo tool">EatBack · เครื่องมือเดโม</div> | |
| <h1 data-en="Scale simulator">จำลองเครื่องชั่ง</h1> | |
| <div class="small ink2" data-en="Send weights to the dashboard and kitchen screen, one channel at a time.">ส่งน้ำหนักไปหน้าภาพรวมและหน้าครัวแบบสด ทีละช่อง</div> | |
| </div> | |
| <nav class="sim-nav" aria-label="Pages"> | |
| <span id="lang-slot"></span> | |
| <a class="btn sm" href="/" target="_blank" rel="noopener" data-en="Dashboard ↗">หน้าภาพรวม ↗</a> | |
| <a class="btn sm" href="/kitchen.html" target="_blank" rel="noopener" data-en="Kitchen ↗">หน้าครัว ↗</a> | |
| </nav> | |
| </header> | |
| <section class="sim-guide" aria-label="Steps"> | |
| <div class="sim-guide-step"><div class="sim-guide-no">1</div><div><b data-en="Pick a channel">เลือกเครื่อง</b><span data-en="Kitchen scale or one of the leftover bins">เครื่องชั่งในครัว หรือถังเศษ</span></div></div> | |
| <div class="sim-guide-step"><div class="sim-guide-no">2</div><div><b data-en="Tap a quick value or type grams">กดปุ่มลัด หรือพิมพ์กรัม</b><span data-en="Some buttons add to or subtract from the current value">บางปุ่มจะบวกหรือลบจากค่าปัจจุบัน</span></div></div> | |
| <div class="sim-guide-step"><div class="sim-guide-no">3</div><div><b data-en="Wait until it settles">รอให้นิ่ง</b><span data-en="Then save on the kitchen screen">แล้วกลับไปบันทึกในหน้าครัว</span></div></div> | |
| </section> | |
| <aside class="sim-explain" aria-label="Simulated vs ESP32"> | |
| <span class="sim-explain-icon" aria-hidden="true">ⓘ</span> | |
| <p data-en="Values from this page are marked <b>simulated</b>. When a real <b>ESP32</b> sends again, that channel switches back to the real scale. If a scale drops out, tap a value here to keep going.">ค่าที่ส่งจากหน้านี้จะขึ้นว่า<b>ค่าจำลอง</b> ถ้า <b>ESP32</b> ส่งค่ามาอีกครั้ง ช่องนั้นจะกลับไปใช้เครื่องจริงเอง ถ้าเครื่องจริงหลุด กดค่าจากหน้านี้เพื่อเดโมต่อได้</p> | |
| </aside> | |
| <div class="sim-grid" id="grid" aria-label="Channels"></div> | |
| <section class="card sim-scenarios" aria-labelledby="voice-title"> | |
| <div class="sim-scenario-head"> | |
| <div class="sim-guide-no" aria-hidden="true">04</div> | |
| <div><h2 id="voice-title" data-en="Kids’ opinions (instead of a teacher)">ข้อคิดเห็นจากเด็ก (กดแทนครู)</h2><p data-en="In real use a teacher asks each child and taps one of the six answers on the teacher page (/opinions.html) or the kitchen screen. Only for rounds the system asks for.">ใช้จริง ครูถามเด็กทีละคนแล้วกดข้อคิดเห็น 6 ข้อในหน้าครู (/opinions.html) หรือหน้าครัว เปิดเฉพาะรอบที่ระบบขอ</p></div> | |
| <span class="spacer"></span><span class="chip" id="voice-state">…</span> | |
| </div> | |
| <div class="sim-voice-grid" id="voice-buttons"></div> | |
| <p class="sim-section-hint" style="margin-top:12px" data-en="Add a whole class’s answers at once (saves demo time)">เพิ่มคำตอบของทั้งห้องในครั้งเดียว (ช่วยประหยัดเวลาเดโม)</p> | |
| <div class="sim-scenario-actions" id="voice-batches"></div> | |
| <p class="sim-scenario-feedback" id="voice-feedback" role="status" aria-live="polite"></p> | |
| </section> | |
| <section class="card sim-scenarios" aria-labelledby="scenario-title"> | |
| <div class="sim-scenario-head"> | |
| <div class="sim-guide-no" aria-hidden="true">★</div> | |
| <div><h2 id="scenario-title" data-en="Fill both leftover bins">เติมเศษลงถังทั้งสองใบ</h2><p data-en="Sets both bins as a share of what was served in the current meal.">ตั้งน้ำหนักถังเศษตามสัดส่วนของที่ตักไปในมื้อนี้</p></div> | |
| </div> | |
| <p class="sim-scenario-note" id="scenario-note">…</p> | |
| <div class="sim-scenario-actions" id="scenarios"></div> | |
| <p class="sim-scenario-feedback" id="scenario-feedback" role="status" aria-live="polite"></p> | |
| </section> | |
| </main> | |
| <script type="module" src="/js/sim.js"></script> | |
| </body> | |
| </html> | |