Skip to content

Commit bcbfd44

Browse files
Merge pull request steam-bell-92#1416 from jainiksha/feature/enhance-recently-opened-projects
feat: enhance recently opened projects section
2 parents 7303e3c + 4b96e20 commit bcbfd44

3 files changed

Lines changed: 213 additions & 32 deletions

File tree

web-app/css/styles.css

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7188,35 +7188,4 @@ body.sidebar-collapsed .sidebar-dock .sidebar-footer .sidebar-main-controls {
71887188
color:var(--text);
71897189
}
71907190

7191-
}
7192-
7193-
.newsletter-form{
7194-
display: flex;
7195-
justify-content: center;
7196-
align-items: center;
7197-
gap: 5px;
7198-
margin-top: 10px;
7199-
}
7200-
7201-
.footer-input {
7202-
font-size: larger;
7203-
border-radius: 10px;
7204-
outline: none;
7205-
border: none;
7206-
padding: 5px;
7207-
font-family: var(--font-sans);
7208-
}
7209-
7210-
.newsletter-form button{
7211-
padding: 8px 20px;
7212-
border-radius: 10px;
7213-
font-family: var(--font-sans);
7214-
font-size: 0.85rem;
7215-
font-weight: 600;
7216-
color: var(--text);
7217-
box-shadow: 0 12px 0 rgba(0, 0, 0, 0.06), 0 16px 32px rgba(34, 197, 94, 0.3);
7218-
background: linear-gradient(135deg, #22c55e, #14b8a6);
7219-
border: 1px solid var(--border);
7220-
transition: all var(--duration-fast) ease;
7221-
white-space: nowrap;
72227191
}

web-app/index.html

Lines changed: 180 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,52 @@ <h1 class="hero-title">
276276
</div>
277277
</div>
278278

279+
<section class="stats-dashboard-section">
280+
<div class="container">
281+
282+
<div class="section-header">
283+
<h2 class="section-heading">
284+
📊 Project Statistics Dashboard
285+
</h2>
286+
</div>
287+
288+
<div class="stats-dashboard">
289+
290+
<div class="stats-card" data-filter="all">
291+
<h3 id="statsTotal">0</h3>
292+
<p>Total Projects</p>
293+
</div>
294+
295+
<div class="stats-card" data-filter="games">
296+
<h3 id="statsGames">0</h3>
297+
<p>Games</p>
298+
</div>
299+
300+
<div class="stats-card" data-filter="math">
301+
<h3 id="statsMath">0</h3>
302+
<p>Math</p>
303+
</div>
304+
305+
<div class="stats-card" data-filter="utilities">
306+
<h3 id="statsUtilities">0</h3>
307+
<p>Utilities</p>
308+
</div>
309+
310+
<div class="stats-card" data-filter="favorites">
311+
<h3 id="statsFavorites">0</h3>
312+
<p>Favorites</p>
313+
</div>
314+
315+
<div class="stats-card">
316+
<h3 id="statsViewed">0</h3>
317+
<p>Recently Viewed</p>
318+
</div>
319+
320+
</div>
321+
322+
</div>
323+
</section>
324+
279325
<!-- Timeline Section -->
280326
<section class="hero-timeline-section" id="timelineSection">
281327
<div class="timeline-background" aria-hidden="true"></div>
@@ -388,8 +434,49 @@ <h3 class="timeline-title">Share</h3>
388434
</div>
389435
</section>
390436

437+
<!-- Bookmarked Projects Section -->
438+
<section class="projects-section" id="bookmarkedProjectsSection">
439+
<div class="container">
440+
<div class="section-header">
441+
<h2 class="section-heading">
442+
⭐ Bookmarked Projects
443+
<span id="bookmarkCountBadge"></span>
444+
</h2>
445+
</div>
446+
447+
<div class="projects-grid" id="bookmarkedProjectsGrid"></div>
448+
449+
<div id="noBookmarksMessage" class="empty-state">
450+
<p>No bookmarked projects yet.</p>
451+
<p class="empty-state-hint">
452+
Click the ⭐ icon on any project to bookmark it.
453+
</p>
454+
</div>
455+
</div>
456+
</section>
457+
391458
<!-- Recently Viewed Section -->
392-
<section class="projects-section" id="recentlyViewedSection">
459+
<div class="section-header">
460+
461+
<h2 class="section-heading">
462+
🕒 Recently Opened Projects
463+
<span id="historyCount"></span>
464+
</h2>
465+
466+
<div>
467+
468+
<input
469+
id="historySearch"
470+
type="text"
471+
placeholder="Search history...">
472+
473+
<button id="clearHistoryBtn">
474+
Clear History
475+
</button>
476+
477+
</div>
478+
479+
</div>
393480
<div class="container">
394481
<div class="section-header">
395482
<h2 class="section-heading">
@@ -674,6 +761,15 @@ <h3>Stay Updated</h3>
674761
const projectsGrid = document.getElementById("projectsGrid");
675762
if (!projectsGrid) return;
676763

764+
const bookmarkedGrid =
765+
document.getElementById("bookmarkedProjectsGrid");
766+
767+
const bookmarkBadge =
768+
document.getElementById("bookmarkCountBadge");
769+
770+
const noBookmarks =
771+
document.getElementById("noBookmarksMessage");
772+
677773
// ALL projects from your js/projects/ folder
678774
const projectsData = [
679775
// GAMES (20+)
@@ -1050,6 +1146,46 @@ <h3>Stay Updated</h3>
10501146
localStorage.setItem("favorites", JSON.stringify(favorites));
10511147
}
10521148

1149+
function renderBookmarkedProjects() {
1150+
1151+
if (!bookmarkedGrid) return;
1152+
1153+
bookmarkedGrid.innerHTML = "";
1154+
1155+
const favs =
1156+
JSON.parse(localStorage.getItem("favorites") || "[]");
1157+
1158+
bookmarkBadge.textContent =
1159+
"(" + favs.length + ")";
1160+
1161+
if (favs.length === 0) {
1162+
1163+
noBookmarks.style.display = "block";
1164+
1165+
return;
1166+
}
1167+
1168+
noBookmarks.style.display = "none";
1169+
1170+
favs.forEach(projectId => {
1171+
1172+
const card =
1173+
document.querySelector(
1174+
`.project-card[data-project="${projectId}"]`
1175+
);
1176+
1177+
if(card){
1178+
1179+
bookmarkedGrid.appendChild(
1180+
card.cloneNode(true)
1181+
);
1182+
1183+
}
1184+
1185+
});
1186+
1187+
}
1188+
10531189
projectsData.forEach((proj) => {
10541190
const card = document.createElement("div");
10551191
card.className = "project-card";
@@ -1077,6 +1213,27 @@ <h3>${proj.title}</h3>
10771213

10781214
// Update counts
10791215
const total = projectsData.length;
1216+
function animateCounter(id,value){
1217+
1218+
let start=0;
1219+
1220+
const element=document.getElementById(id);
1221+
1222+
const timer=setInterval(()=>{
1223+
1224+
start++;
1225+
1226+
element.textContent=start;
1227+
1228+
if(start>=value){
1229+
1230+
clearInterval(timer);
1231+
1232+
}
1233+
1234+
},25);
1235+
1236+
}
10801237
const games = projectsData.filter((p) => p.category === "games").length;
10811238
const math = projectsData.filter((p) => p.category === "math").length;
10821239
const utils = projectsData.filter(
@@ -1094,10 +1251,31 @@ <h3>${proj.title}</h3>
10941251
if (heroMath) heroMath.textContent = math;
10951252
if (heroUtils) heroUtils.textContent = utils;
10961253
if (projectBadge) projectBadge.textContent = total + " projects";
1254+
animateCounter("statsTotal",total);
1255+
1256+
animateCounter("statsGames",games);
1257+
1258+
animateCounter("statsMath",math);
1259+
1260+
animateCounter("statsUtilities",utils);
1261+
1262+
animateCounter(
1263+
"statsFavorites",
1264+
favorites.length
1265+
);
1266+
1267+
const viewed=
1268+
JSON.parse(localStorage.getItem("recentlyViewed")||"[]");
1269+
1270+
animateCounter(
1271+
"statsViewed",
1272+
viewed.length
1273+
);
10971274

10981275
console.log(
10991276
`✅ Loaded ${total} projects: ${games} games, ${math} math, ${utils} utilities`
11001277
);
1278+
renderBookmarkedProjects();
11011279

11021280
// Wire up buttons
11031281
setTimeout(() => {
@@ -1137,6 +1315,7 @@ <h3>${proj.title}</h3>
11371315
}
11381316

11391317
localStorage.setItem("favorites", JSON.stringify(favs));
1318+
renderBookmarkedProjects();
11401319

11411320
// If we're on favorites tab, refresh the view
11421321
const activeCategory = document

web-app/js/main.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1567,6 +1567,14 @@ document.addEventListener("DOMContentLoaded", function () {
15671567
var section = document.getElementById("recentlyViewedSection");
15681568
if (!grid || !section) return;
15691569
var recent = JSON.parse(localStorage.getItem("recentProjects") || "[]");
1570+
const historyBadge =
1571+
document.getElementById("historyCountBadge");
1572+
1573+
if(historyBadge){
1574+
1575+
historyBadge.textContent=`(${recent.length})`;
1576+
1577+
}
15701578
console.log("[DEBUG] recentProjects array:", recent); if (recent.length === 0) {
15711579
section.style.display = "none";
15721580
return;
@@ -1966,4 +1974,29 @@ document.addEventListener("DOMContentLoaded", function () {
19661974
// Initial card filtering state update
19671975
updateProjectVisibility(currentCategory, currentSearchQuery);
19681976
window.updateRecentlyViewed();
1977+
1978+
const clearBtn =
1979+
document.getElementById("clearHistoryBtn");
1980+
1981+
if(clearBtn){
1982+
1983+
clearBtn.addEventListener("click",()=>{
1984+
1985+
showConfirm(
1986+
"Clear recently viewed projects?",
1987+
()=>{
1988+
1989+
localStorage.removeItem("recentProjects");
1990+
1991+
window.updateRecentlyViewed();
1992+
1993+
showToast("History Cleared");
1994+
1995+
}
1996+
1997+
);
1998+
1999+
});
2000+
2001+
}
19692002
});

0 commit comments

Comments
 (0)