File size: 3,715 Bytes
a93af78
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<!doctype html>
<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>