Spaces:
Running
Running
Download stats.html from bllndebrahim/translet-test: direct link, hf CLI and curl.
- Browser
- Download file 3.72 kB
-
https://huggingface.co/spaces/bllndebrahim/translet-test/resolve/main/stats.html
- Command line
-
hf download hf://spaces/bllndebrahim/translet-test/stats.html
-
curl -L -o stats.html https://huggingface.co/spaces/bllndebrahim/translet-test/resolve/main/stats.html
3.72 kB
| <html lang="ckb" dir="rtl"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <meta name="robots" content="noindex, nofollow"> | |
| <title>ئاماری لالا</title> | |
| <link rel="icon" type="image/x-icon" href="lala-icon.ico"> | |
| <style> | |
| :root { --bg: #0b0b0f; --card: #16161d; --text: #e8e8ee; --muted: #9a9aa8; --green: #22c55e; } | |
| body { margin: 0; background: var(--bg); color: var(--text); font-family: Tahoma, "Segoe UI", sans-serif; } | |
| main { max-width: 640px; margin: 0 auto; padding: 24px 16px 48px; } | |
| h1 { font-size: 22px; margin: 0 0 4px; } | |
| .sub { color: var(--muted); font-size: 13px; margin: 0 0 16px; } | |
| .tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; } | |
| .tile { background: var(--card); border-radius: 14px; padding: 12px; text-align: center; } | |
| .tile b { display: block; font-size: 26px; color: var(--green); } | |
| .tile span { font-size: 12px; color: var(--muted); } | |
| table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 14px; overflow: hidden; font-size: 14px; } | |
| th, td { padding: 9px 10px; text-align: center; border-bottom: 1px solid rgba(255,255,255,.06); } | |
| th { color: var(--muted); font-weight: normal; font-size: 12px; } | |
| .msg { background: var(--card); border-radius: 14px; padding: 16px; color: var(--muted); } | |
| a { color: #93c5fd; } | |
| </style> | |
| </head> | |
| <body> | |
| <main> | |
| <a href="./" style="color:var(--text);text-decoration:none;opacity:.8">→ گەڕانەوە بۆ وەرگێڕ</a> | |
| <h1 style="margin-top:12px">ئاماری لالا 🔒</h1> | |
| <p class="sub">تەنها تۆ دەیبینیت. هیچ زانیارییەکی کەسی کۆ ناکرێتەوە، تەنها ژمارە.</p> | |
| <div id="out" class="msg">چاوەڕێ بکە...</div> | |
| </main> | |
| <script> | |
| (async () => { | |
| const out = document.getElementById('out'); | |
| let key = ''; | |
| try { | |
| const m = location.hash.match(/k=([A-Za-z0-9_-]+)/); | |
| if (m) { key = m[1]; localStorage.setItem('lala_stats_key', key); history.replaceState(null, '', location.pathname); } | |
| else key = localStorage.getItem('lala_stats_key') || ''; | |
| } catch (_) {} | |
| if (!key) { out.textContent = '🔒 ئەم لاپەڕەیە تایبەتە.'; return; } | |
| try { | |
| const r = await fetch('/api/stats', { headers: { 'x-stats-key': key }, cache: 'no-store' }); | |
| if (r.status === 403) { out.textContent = '🔒 ئەم لاپەڕەیە تایبەتە.'; return; } | |
| const d = await r.json(); | |
| const today = d.days[0] || { people: 0, translations: 0, voice: 0 }; | |
| const week = d.days.slice(0, 7); | |
| const sum = (k) => week.reduce((a, x) => a + x[k], 0); | |
| const rows = d.days.map((x) => `<tr><td>${x.day}</td><td>${x.people}</td><td>${x.translations}</td><td>${x.voice}</td></tr>`).join(''); | |
| out.outerHTML = ` | |
| <div class="tiles"> | |
| <div class="tile"><b>${today.people}</b><span>کەس ئەمڕۆ</span></div> | |
| <div class="tile"><b>${sum('translations') + sum('voice')}</b><span>وەرگێڕان لەم هەفتەیەدا</span></div> | |
| <div class="tile"><b>${d.allPhones}</b><span>مۆبایل هەتا ئێستا</span></div> | |
| </div> | |
| <table> | |
| <tr><th>ڕۆژ</th><th>کەس</th><th>وەرگێڕانی نووسین</th><th>گفتوگۆی دەنگی</th></tr> | |
| ${rows} | |
| </table> | |
| <p class="sub" style="margin-top:10px">«کەس» واتە مۆبایلی جیاواز. ژمارەکان هەر چەند خولەکێک نوێ دەبنەوە.</p>`; | |
| } catch (e) { | |
| out.textContent = '⚠️ نەتوانرا ئامارەکان بهێنرێن. ئینتەرنێتەکەت بپشکنە.'; | |
| } | |
| })(); | |
| </script> | |
| </body> | |
| </html> | |