Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions site/src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,7 @@ const endpoints = [
<div class="foot-links">
<a href={ghUrl} target="_blank" rel="noopener">GitHub</a>
<a href={`${base}docs`}>API reference</a>
<a href="#playground">Playground</a>
<a href="https://gettechapi.github.io/cpu-engineering-samples/" target="_blank" rel="noopener">CPU engineering samples</a>
</div>
<a href="#playground">Playground</a> </div>
</div>
<p class="foot-warn">⚠ Curated, growing dataset — not yet an exhaustive catalog of every device.</p>
<p class="foot-engine">Validated, scored &amp; served by <a href={engineUrl} target="_blank" rel="noopener"><span class="mark">T</span>TechEngine</a> — the open data + scoring engine.</p>
Expand Down
9 changes: 9 additions & 0 deletions site/src/scripts/techapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,15 @@ async function loadList(resource) {
// The hero is already in view at first paint. Animate immediately so the
// counters do not remain at zero when IntersectionObserver is delayed.
el.querySelectorAll(".num").forEach((n) => countUp(n, +n.dataset.n));
// Satellite data repos publish their own catalog; count them alongside.
fetch("https://gettechapi.github.io/cpu-engineering-samples/catalog.json")
.then((r) => (r.ok ? r.json() : Promise.reject()))
.then((list) => {
el.insertAdjacentHTML("beforeend",
`<div class="stat"><div class="n"><span class="num">0</span></div><div class="l">cpu eng. samples</div></div>`);
countUp(el.lastElementChild.querySelector(".num"), list.length);
})
.catch(() => {});
}).catch(() => {
el.innerHTML = '<div class="stat"><div class="n">—</div><div class="l">build data first</div></div>';
});
Expand Down
Loading