diff --git a/docs/v1/stars.js b/docs/v1/stars.js index f29b4f06..8117f42e 100644 --- a/docs/v1/stars.js +++ b/docs/v1/stars.js @@ -1,13 +1,19 @@ -window.addEventListener('load', function() { +function updateStars() { fetch("https://api.github.com/repos/AgentOps-AI/agentops") .then((response) => response.json()) .then((data) => { const stars = Math.ceil(data.stargazers_count / 100) * 100 + 100; const dataContainer = document.getElementById("stars-text"); dataContainer.innerHTML = `${stars.toLocaleString()}th`; - }) .catch((error) => { - console.error("Error:", error); + // console.error("Github Stars pull error:", error); }); -}) \ No newline at end of file +} + +window.addEventListener('load', function() { + updateStars(); + document.querySelectorAll('li, a').forEach(item => { + item.addEventListener('click', updateStars); + }); +}); \ No newline at end of file