Skip to content

Commit b7293a0

Browse files
committed
fixed repo count display
1 parent 43410fd commit b7293a0

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ <h1 class="hero-name">
8787
/>
8888
</div>
8989
<div class="hero-stat hero-stat-1">
90-
<strong id="stat-repos">17</strong>repositories
90+
<strong class="stat-repos">17</strong>repositories
9191
</div>
9292
<div class="hero-stat hero-stat-2">
9393
<strong id="stat-contributions">269</strong>Contributions
@@ -162,7 +162,7 @@ <h4>// spoken languages</h4>
162162

163163
<div class="about-detail">
164164
<span class="about-detail-label">Repositories</span>
165-
<span class="about-detail-value">17 public</span>
165+
<span class="about-detail-value"><span class="stat-repos">17</span> public</span>
166166
</div>
167167
<div class="about-detail">
168168
<span class="about-detail-label">Achievement</span>

script.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,12 +316,16 @@ async function handleFormSubmit() {
316316
const res = await fetch('https://api.github.com/users/NVitschDEV');
317317
if (res.ok) {
318318
const data = await res.json();
319-
const el = document.getElementById('stat-repos');
320-
if (el && data.public_repos) el.textContent = data.public_repos;
319+
// Use querySelectorAll to find every instance of the class
320+
const repoEls = document.querySelectorAll('.stat-repos');
321+
repoEls.forEach(el => {
322+
if (data.public_repos) {
323+
el.textContent = data.public_repos;
324+
}
325+
});
321326
}
322327
} catch (_) { /* silently fail — static fallback shown */ }
323328
})();
324-
325329
/* ── Smooth active nav highlight ─────────────────────────────────────── */
326330
const sections = document.querySelectorAll('section[id]');
327331
const navAnchors = document.querySelectorAll('.nav-links a[href^="#"]');

0 commit comments

Comments
 (0)