Add 'Moxie in numbers' stats section: active users, req/s, avg tks/s, 7-day downloads (placeholder until stats feed approved)

This commit is contained in:
Z User 2026-11-09 21:00:16 +00:00
parent 6e411f9535
commit ba5f444636

View File

@ -1652,6 +1652,104 @@
</div> </div>
</section> </section>
<!-- PLATFORM STATS -->
<section id="stats" class="py-20 border-t border-slate-800 scroll-animate">
<div class="max-w-screen-2xl mx-auto px-8">
<div class="max-w-2xl mx-auto text-center mb-12">
<h2 class="text-5xl font-semibold tracking-[-2px] mb-4" style="font-family: 'Space Grotesk', sans-serif;">
Moxie in numbers.</h2>
<p class="text-slate-400 text-xl">Live platform telemetry — what the Moxiegen network is doing right
now.</p>
</div>
<div class="grid grid-cols-2 lg:grid-cols-4 gap-6 max-w-6xl mx-auto">
<div class="bg-slate-950 border border-slate-800 rounded-3xl p-7 hover:border-emerald-400/30 transition-colors">
<div class="h-12 w-12 bg-emerald-400/10 text-emerald-400 rounded-2xl flex items-center justify-center mb-5">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z">
</path>
</svg>
</div>
<div class="min-h-[64px] flex items-center mb-3">
<span class="inline-flex items-center gap-2 px-4 py-2 rounded-3xl border border-dashed border-slate-600 text-slate-400 text-sm font-medium">
<svg class="w-4 h-4 animate-pulse" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"></path>
</svg>
Awaiting GitHub approval
</span>
<span class="stat-value hidden text-5xl font-semibold tracking-[-1px] text-white"
data-stat-value="activeUsers" style="font-family: 'Space Grotesk', sans-serif;"></span>
</div>
<h3 class="text-xl font-semibold">Active users</h3>
<p class="text-slate-500 text-sm mt-1">Running Moxie right now</p>
</div>
<div class="bg-slate-950 border border-slate-800 rounded-3xl p-7 hover:border-emerald-400/30 transition-colors">
<div class="h-12 w-12 bg-emerald-400/10 text-emerald-400 rounded-2xl flex items-center justify-center mb-5">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M3 12h4l3 8 4-16 3 8h4"></path>
</svg>
</div>
<div class="min-h-[64px] flex items-center mb-3">
<span class="inline-flex items-center gap-2 px-4 py-2 rounded-3xl border border-dashed border-slate-600 text-slate-400 text-sm font-medium">
<svg class="w-4 h-4 animate-pulse" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"></path>
</svg>
Awaiting GitHub approval
</span>
<span class="stat-value hidden text-5xl font-semibold tracking-[-1px] text-white"
data-stat-value="requestsPerSec" style="font-family: 'Space Grotesk', sans-serif;"></span>
</div>
<h3 class="text-xl font-semibold">Requests / second</h3>
<p class="text-slate-500 text-sm mt-1">Across all Moxie-Server nodes</p>
</div>
<div class="bg-slate-950 border border-slate-800 rounded-3xl p-7 hover:border-emerald-400/30 transition-colors">
<div class="h-12 w-12 bg-emerald-400/10 text-emerald-400 rounded-2xl flex items-center justify-center mb-5">
<svg class="w-6 h-6" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true">
<path d="M13 10V3L4 14h7v7l9-11h-7z"></path>
</svg>
</div>
<div class="min-h-[64px] flex items-center mb-3">
<span class="inline-flex items-center gap-2 px-4 py-2 rounded-3xl border border-dashed border-slate-600 text-slate-400 text-sm font-medium">
<svg class="w-4 h-4 animate-pulse" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"></path>
</svg>
Awaiting GitHub approval
</span>
<span class="stat-value hidden text-5xl font-semibold tracking-[-1px] text-white"
data-stat-value="avgTokensPerSec" style="font-family: 'Space Grotesk', sans-serif;"></span>
</div>
<h3 class="text-xl font-semibold">Avg tokens / sec</h3>
<p class="text-slate-500 text-sm mt-1">On-device and cloud inference</p>
</div>
<div class="bg-slate-950 border border-slate-800 rounded-3xl p-7 hover:border-emerald-400/30 transition-colors">
<div class="h-12 w-12 bg-emerald-400/10 text-emerald-400 rounded-2xl flex items-center justify-center mb-5">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"></path>
</svg>
</div>
<div class="min-h-[64px] flex items-center mb-3">
<span class="inline-flex items-center gap-2 px-4 py-2 rounded-3xl border border-dashed border-slate-600 text-slate-400 text-sm font-medium">
<svg class="w-4 h-4 animate-pulse" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"></path>
</svg>
Awaiting GitHub approval
</span>
<span class="stat-value hidden text-5xl font-semibold tracking-[-1px] text-white"
data-stat-value="downloads7d" style="font-family: 'Space Grotesk', sans-serif;"></span>
</div>
<h3 class="text-xl font-semibold">Downloads · 7 days</h3>
<p class="text-slate-500 text-sm mt-1">All platforms combined</p>
</div>
</div>
</div>
</section>
<!-- SOCIAL --> <!-- SOCIAL -->
<section id="social" class="py-20 scroll-animate"> <section id="social" class="py-20 scroll-animate">
<div class="max-w-screen-2xl mx-auto px-8"> <div class="max-w-screen-2xl mx-auto px-8">
@ -3281,6 +3379,41 @@
}); });
} }
// PLATFORM STATS: placeholder cards show "Awaiting GitHub approval" until the
// stats feed is approved. Set STATS_API_URL to a JSON endpoint returning
// { success:true, data:{ activeUsers, requestsPerSec, avgTokensPerSec, downloads7d } }
// and the numbers replace the pills automatically (no HTML changes needed).
const STATS_API_URL = '';
function fmtStat(n) {
if (n >= 1e6) return (n / 1e6).toFixed(n % 1e6 ? 1 : 0) + 'M';
if (n >= 1e3) return (n / 1e3).toFixed(n % 1e3 ? 1 : 0) + 'k';
return String(n);
}
async function initPlatformStats() {
if (!STATS_API_URL) return; // placeholders stay until the feed ships
try {
const res = await fetch(STATS_API_URL, { headers: { 'Accept': 'application/json' } });
const json = await res.json();
if (!res.ok || !json || !json.success || !json.data) return;
const map = {
activeUsers: json.data.activeUsers,
requestsPerSec: json.data.requestsPerSec,
avgTokensPerSec: json.data.avgTokensPerSec,
downloads7d: json.data.downloads7d
};
for (const [key, val] of Object.entries(map)) {
if (typeof val !== 'number' || !isFinite(val)) continue;
const slot = document.querySelector('[data-stat-value="' + key + '"]');
if (!slot) continue;
slot.textContent = fmtStat(val);
slot.classList.remove('hidden');
const card = slot.closest('.min-h-\\[64px\\]');
const pill = card ? card.querySelector('.inline-flex') : null;
if (pill) pill.remove();
}
} catch (err) { /* stats feed unreachable — keep placeholders */ }
}
window.addEventListener('load', () => { window.addEventListener('load', () => {
initScrollAnimations(); initScrollAnimations();
initBalloon(); initBalloon();
@ -3289,6 +3422,7 @@
initCopyButtons(); initCopyButtons();
renderHowtoVideos(); renderHowtoVideos();
initYtVideos(); initYtVideos();
initPlatformStats();
}); });
</script> </script>
<script src="js/config.js"></script> <script src="js/config.js"></script>