Skip to content

Commit 9ed749b

Browse files
Add: spot the difference game in web app
1 parent 09d2796 commit 9ed749b

3 files changed

Lines changed: 845 additions & 5 deletions

File tree

web-app/index.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,13 @@ <h3>Simon Says</h3>
134134
<button class="btn-play">Play Now</button>
135135
</div>
136136

137+
<div class="project-card" data-category="games" data-project="spot-the-difference" data-tags="games">
138+
<div class="card-icon">🔍</div>
139+
<h3>Spot the Difference</h3>
140+
<p>Find all the hidden differences between two scenes!</p>
141+
<button class="btn-play">Play Now</button>
142+
</div>
143+
137144
<!-- Math Tools -->
138145
<div class="project-card" data-category="math" data-project="fibonacci" data-tags="math,sequence,series,loops,recursion">
139146
<div class="card-icon"></div>

web-app/js/main.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,14 @@ backToTopButton.addEventListener('click', () => {
6262

6363
// Category Filtering
6464
const tabs = document.querySelectorAll('.tab');
65+
const projectCards = document.querySelectorAll('.project-card');
6566

66-
// Category Filtering (tabs)
67+
let recentSearches = JSON.parse(localStorage.getItem('recentSearches') || '[]');
68+
let currentSearchQuery = '';
69+
let selectedSuggestionIndex = -1;
70+
let currentCategory = 'all';
6771

68-
const projectCards = document.querySelectorAll('.project-card');
69-
const tabs = document.querySelectorAll('.tab');
72+
// Category Filtering (tabs)
7073
const searchInput = document.getElementById('projectSearch');
7174
const searchClear = document.getElementById('searchClear');
7275
const searchDropdown = document.getElementById('searchDropdown');
@@ -171,10 +174,12 @@ function highlightMatch(text, query) {
171174

172175
// Render recent searches
173176
function renderRecentSearches() {
177+
if (!recentSearchesSection) return;
178+
174179
if (recentSearches.length === 0) {
175180
recentSearchesSection.style.display = 'none';
176-
tipsSection.style.display = 'block';
177-
resultsSection.style.display = 'none';
181+
if (tipsSection) tipsSection.style.display = 'block';
182+
if (resultsSection) resultsSection.style.display = 'none';
178183
return;
179184
}
180185

0 commit comments

Comments
 (0)