2026-06-14 16:50:20 +08:00
|
|
|
---
|
|
|
|
|
function formatNumber(n: number): string {
|
|
|
|
|
if (n >= 1_000_000) return `${(n / 1_000_000).toFixed(1).replace(/\.0$/, "")}M`;
|
|
|
|
|
if (n >= 1_000) return `${(n / 1_000).toFixed(1).replace(/\.0$/, "")}k`;
|
|
|
|
|
return n.toString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let starCount = 0;
|
|
|
|
|
try {
|
|
|
|
|
const res = await fetch("https://api.github.com/repos/snapotter-hq/snapotter", {
|
|
|
|
|
headers: { Accept: "application/vnd.github.v3+json" },
|
|
|
|
|
});
|
|
|
|
|
if (res.ok) {
|
|
|
|
|
const data = await res.json();
|
|
|
|
|
starCount = data.stargazers_count ?? 0;
|
|
|
|
|
}
|
|
|
|
|
} catch {
|
|
|
|
|
starCount = 0;
|
|
|
|
|
}
|
|
|
|
|
|
2026-06-15 21:55:00 +08:00
|
|
|
// Docker Hub pull count (public API, refreshed at build time)
|
|
|
|
|
let dockerHubPulls = 0;
|
2026-06-14 16:50:20 +08:00
|
|
|
try {
|
|
|
|
|
const res = await fetch("https://hub.docker.com/v2/repositories/snapotter/snapotter/");
|
|
|
|
|
if (res.ok) {
|
|
|
|
|
const data = await res.json();
|
2026-06-15 21:55:00 +08:00
|
|
|
dockerHubPulls = data.pull_count ?? 0;
|
2026-06-14 16:50:20 +08:00
|
|
|
}
|
|
|
|
|
} catch {
|
2026-06-15 21:55:00 +08:00
|
|
|
dockerHubPulls = 0;
|
2026-06-14 16:50:20 +08:00
|
|
|
}
|
|
|
|
|
|
2026-06-15 21:55:00 +08:00
|
|
|
// GHCR (ghcr.io) has no public pull-count API, so this is a manual figure (update as it grows).
|
|
|
|
|
const GHCR_PULLS = 28_800;
|
|
|
|
|
const dockerForTotal = dockerHubPulls > 0 ? dockerHubPulls : 89_100;
|
|
|
|
|
const totalPulls = dockerForTotal + GHCR_PULLS;
|
|
|
|
|
const pullsDisplay =
|
|
|
|
|
totalPulls >= 1_000_000
|
|
|
|
|
? `${Math.floor(totalPulls / 100_000) / 10}M+`
|
|
|
|
|
: `${Math.floor(totalPulls / 100_000) * 100}K+`;
|
|
|
|
|
|
2026-06-14 16:50:20 +08:00
|
|
|
const stats = [
|
|
|
|
|
{
|
2026-06-16 18:04:52 +08:00
|
|
|
value: "157",
|
2026-06-14 16:50:20 +08:00
|
|
|
label: "Processing Tools",
|
|
|
|
|
sublabel: "Across 5 file modalities",
|
|
|
|
|
},
|
|
|
|
|
{
|
2026-06-15 21:55:00 +08:00
|
|
|
value: starCount > 0 ? formatNumber(starCount) : "1.6k",
|
2026-06-14 16:50:20 +08:00
|
|
|
label: "GitHub Stars",
|
|
|
|
|
sublabel: "Open-source & growing",
|
|
|
|
|
},
|
|
|
|
|
{
|
2026-06-15 21:55:00 +08:00
|
|
|
value: pullsDisplay,
|
|
|
|
|
label: "Image Pulls",
|
|
|
|
|
sublabel: "Deployed worldwide",
|
2026-06-14 16:50:20 +08:00
|
|
|
},
|
|
|
|
|
{
|
2026-06-15 21:55:00 +08:00
|
|
|
value: "20+",
|
2026-06-14 16:50:20 +08:00
|
|
|
label: "Languages",
|
2026-06-15 21:55:00 +08:00
|
|
|
sublabel: "Speaks your language",
|
2026-06-14 16:50:20 +08:00
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
---
|
|
|
|
|
|
2026-06-15 21:55:00 +08:00
|
|
|
<div class="relative mx-auto mt-10 max-w-5xl border-t border-border/70 pt-10">
|
2026-06-14 16:50:20 +08:00
|
|
|
|
|
|
|
|
<!-- Stats grid -->
|
|
|
|
|
<div class="reveal grid grid-cols-2 gap-10 sm:gap-12 lg:grid-cols-4">
|
|
|
|
|
{stats.map((stat) => {
|
|
|
|
|
const inner = (
|
|
|
|
|
<div class="text-center">
|
|
|
|
|
<p class="font-display text-5xl font-extrabold tracking-tight text-primary md:text-6xl">
|
|
|
|
|
{stat.value}
|
|
|
|
|
</p>
|
|
|
|
|
<p class="mt-2 text-sm font-semibold text-foreground">{stat.label}</p>
|
|
|
|
|
<p class="mt-0.5 text-xs text-muted">{stat.sublabel}</p>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
|
2026-06-15 21:55:00 +08:00
|
|
|
return <div class="p-3">{inner}</div>;
|
2026-06-14 16:50:20 +08:00
|
|
|
})}
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-06-15 21:55:00 +08:00
|
|
|
</div>
|