Spaces:
Running
Running
Download index.html from Ecolens-app/web: direct link, hf CLI and curl.
- Browser
- Download file 5.78 kB
-
https://huggingface.co/spaces/Ecolens-app/web/resolve/main/index.html
- Command line
-
hf download hf://spaces/Ecolens-app/web/index.html
-
curl -L -o index.html https://huggingface.co/spaces/Ecolens-app/web/resolve/main/index.html
5.78 kB
| <html lang="vi"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover"> | |
| <meta name="theme-color" content="#0e9f6e"> | |
| <title>EcoLens — Phân loại rác thông minh</title> | |
| <link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🌱</text></svg>"> | |
| <link rel="stylesheet" href="style.css"> | |
| </head> | |
| <body> | |
| <header class="topbar"> | |
| <div class="brand"> | |
| <span class="brand-logo">🌱</span> | |
| <div> | |
| <div class="brand-name">EcoLens</div> | |
| <div class="brand-sub">Chụp ảnh — biết ngay bỏ thùng nào</div> | |
| </div> | |
| </div> | |
| <a class="stats-link" href="stats.html" title="Thống kê">📊</a> | |
| </header> | |
| <main id="app"> | |
| <!-- Băng báo trạng thái tải AI --> | |
| <div id="ai-status" class="ai-status">⏳ Đang tải AI lần đầu… (chỉ lần đầu, sau sẽ nhanh)</div> | |
| <!-- ============ MÀN HÌNH CHÍNH ============ --> | |
| <section id="screen-home" class="screen"> | |
| <div class="hero card"> | |
| <div class="hero-emoji" aria-hidden="true">📷</div> | |
| <h1>Phân vân rác này<br>bỏ thùng nào?</h1> | |
| <p class="hero-sub">Chụp ảnh món rác, AI sẽ cho bạn biết ngay trong vài giây!</p> | |
| <button class="btn-capture" id="btn-camera"> | |
| <span class="btn-capture-icon">📸</span> | |
| Chụp ảnh rác | |
| </button> | |
| <label class="btn-gallery" for="gallery-input">🖼️ Hoặc chọn ảnh có sẵn</label> | |
| <input id="camera-input" type="file" accept="image/*" capture="environment" hidden> | |
| <input id="gallery-input" type="file" accept="image/*" hidden> | |
| </div> | |
| <div class="steps card"> | |
| <div class="step"><span class="step-n">1</span> Chụp gần, đủ sáng, 1–2 món rác</div> | |
| <div class="step"><span class="step-n">2</span> AI nhận diện món đồ</div> | |
| <div class="step"><span class="step-n">3</span> Bỏ đúng thùng theo màu hướng dẫn</div> | |
| </div> | |
| <div class="bins-legend card"> | |
| <h2>3 thùng rác của trường mình</h2> | |
| <div class="bin-row" style="--bin:#1E88E5"><span class="bin-dot"></span><b>♻️ TÁI CHẾ</b><span class="bin-eg">chai nhựa, lon, giấy</span></div> | |
| <div class="bin-row" style="--bin:#43A047"><span class="bin-dot"></span><b>🍂 HỮU CƠ</b><span class="bin-eg">vỏ trái cây, thức ăn thừa</span></div> | |
| <div class="bin-row" style="--bin:#757575"><span class="bin-dot"></span><b>🗑️ CÒN LẠI</b><span class="bin-eg">vỏ snack, túi nilon, khẩu trang</span></div> | |
| </div> | |
| </section> | |
| <!-- ============ CAMERA TRONG TRANG ============ --> | |
| <section id="screen-camera" class="screen" hidden> | |
| <div class="card camera-card"> | |
| <video id="cam-video" autoplay playsinline muted></video> | |
| <div class="cam-controls"> | |
| <button id="btn-cam-close" class="cam-close" aria-label="Đóng camera">✕</button> | |
| <button id="btn-shutter" class="shutter" aria-label="Chụp ảnh"></button> | |
| <label for="gallery-input" class="cam-gallery" aria-label="Chọn từ thư viện">🖼️</label> | |
| </div> | |
| <p class="cam-hint">Đưa món rác vào giữa khung, chụp gần và đủ sáng nhé</p> | |
| </div> | |
| </section> | |
| <!-- ============ ĐANG PHÂN TÍCH ============ --> | |
| <section id="screen-loading" class="screen" hidden> | |
| <div class="card loading-card"> | |
| <img id="preview-img" class="preview" alt="Ảnh vừa chụp"> | |
| <div class="scan-line"></div> | |
| <div class="loading-row"> | |
| <div class="spinner"></div> | |
| <p id="loading-text">AI đang phân tích ảnh…</p> | |
| </div> | |
| </div> | |
| </section> | |
| <!-- ============ KẾT QUẢ ============ --> | |
| <section id="screen-result" class="screen" hidden> | |
| <div class="card result-photo-card"> | |
| <img id="result-img" class="result-img" alt="Kết quả nhận diện"> | |
| <div id="result-time" class="result-time"></div> | |
| </div> | |
| <div id="result-cards"></div> | |
| <button id="btn-again" class="btn-capture btn-again">📸 Chụp món khác</button> | |
| </section> | |
| <!-- ============ LỖI / KHÔNG NHẬN RA ============ --> | |
| <section id="screen-empty" class="screen" hidden> | |
| <div class="card empty-card"> | |
| <div class="hero-emoji">😅</div> | |
| <h2 id="empty-title">Chưa nhận ra món này</h2> | |
| <p id="empty-text">Thử chụp <b>gần hơn</b>, <b>đủ sáng</b>, để món rác ở giữa khung hình nhé!</p> | |
| <button id="btn-retry" class="btn-capture">📸 Chụp lại</button> | |
| </div> | |
| <div class="card"> | |
| <h2 class="pick-title">Hoặc tự chọn thùng phù hợp:</h2> | |
| <div class="pick-bin" style="--bin:#1E88E5"><b>♻️ TÁI CHẾ</b> — đồ sạch, khô, tái chế được: chai nhựa, lon, giấy</div> | |
| <div class="pick-bin" style="--bin:#43A047"><b>🍂 HỮU CƠ</b> — đồ phân hủy được: vỏ trái cây, thức ăn thừa</div> | |
| <div class="pick-bin" style="--bin:#757575"><b>🗑️ CÒN LẠI</b> — vỏ snack, túi nilon, ống hút, khẩu trang</div> | |
| </div> | |
| </section> | |
| </main> | |
| <footer class="footer">EcoLens 🌱 AI chạy ngay trên máy bạn — không cần mạng sau khi tải</footer> | |
| <!-- onnxruntime-web (chạy AI trong trình duyệt) + dữ liệu class + logic --> | |
| <script src="https://cdn.jsdelivr.net/npm/onnxruntime-web@1.19.2/dist/ort.min.js"></script> | |
| <script src="data.js"></script> | |
| <script src="app.js"></script> | |
| </body> | |
| </html> | |