Skip to content

Commit 704e26d

Browse files
Merge pull request steam-bell-92#390 from mrinmoyChakraborty-mrinox/feature-#377
Made project count badge dynamic
2 parents a93f118 + 0225dbe commit 704e26d

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

web-app/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ <h1>
628628
<h2 class="hero-title">Learn Python the Fun Way!</h2>
629629
<p class="hero-subtitle">Small browser experiments for games, math, utilities, and terminal-style practice.</p>
630630
<div class="hero-meta" aria-label="Project summary">
631-
<span>25+ projects</span>
631+
<span id="projectCountBadge">25+ projects</span>
632632
<span>zero setup</span>
633633
<span>beginner friendly</span>
634634
</div>

web-app/js/main.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,13 @@ document.addEventListener('DOMContentLoaded', function () {
8383
var removeTrap = null;
8484
var lastFocusedElement = null;
8585
var recentSearches = JSON.parse(localStorage.getItem('recentSearches') || '[]');
86+
//-----------------------project count badge------------------------------------
87+
const projectCountBadge = document.getElementById("projectCountBadge");
88+
const projectCount = document.querySelectorAll(".project-card").length;
8689

90+
if (projectCountBadge) {
91+
projectCountBadge.textContent = `${projectCount} projects`;
92+
}
8793
// ── Theme Toggle ────────────────────────────────────────────────
8894
function updateThemeToggleAria(isLightTheme) {
8995
if (!themeToggle) return;

0 commit comments

Comments
 (0)