Newer
Older
veriq / frontend / stats.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>VerIQ — live stats</title>
<link rel="icon" type="image/svg+xml" href="/assets/favicon.svg">
<link rel="stylesheet" href="/assets/style.css">
</head>
<body>
<div class="wrap">
  <header class="top">
    <a class="logo" href="/">Ver<span>IQ</span></a>
    <span class="tagline">live stats</span>
  </header>

  <section class="hero" style="padding-bottom:12px">
    <h1 style="font-size:clamp(24px,5vw,36px)">The test in numbers.</h1>
    <p class="lead">No third-party trackers — everything below comes from our own event log.</p>
  </section>

  <section class="grid3" id="cards">
    <div class="feat"><b id="cStarts">–</b><span>tests started</span></div>
    <div class="feat"><b id="cFinishes">–</b><span>signed results issued</span></div>
    <div class="feat"><b id="cAvg">–</b><span>average IQ so far</span></div>
  </section>

  <section class="panel">
    <h2>Integrity</h2>
    <p id="integrityLine">loading…</p>
  </section>

  <footer>
    VerIQ · <a href="/how">how verification works</a> ·
    <a href="/.well-known/veriq-pubkey.txt">service public key</a>
  </footer>
</div>
<script>
(function () {
  fetch("/api/stats").then(function (r) { return r.json(); }).then(function (d) {
    var ev = d.events || {};
    document.getElementById("cStarts").textContent = ev.start || 0;
    document.getElementById("cFinishes").textContent = d.results_total || 0;
    document.getElementById("cAvg").textContent =
      d.avg_iq === null ? "–" : d.avg_iq;
    var flagged = d.results_flagged || 0;
    var total = d.results_total || 0;
    var pct = total > 0 ? Math.round(100 * flagged / total) : 0;
    document.getElementById("integrityLine").textContent =
      total + " results issued, " + flagged + " flagged for implausible timing (" +
      pct + "%). Flagged results are marked on their verify pages.";
  }).catch(function () {
    document.getElementById("integrityLine").textContent = "stats unavailable";
  });
})();
</script>
</body>
</html>