@@ -62,11 +62,14 @@ backToTopButton.addEventListener('click', () => {
6262
6363// Category Filtering
6464const 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)
7073const searchInput = document . getElementById ( 'projectSearch' ) ;
7174const searchClear = document . getElementById ( 'searchClear' ) ;
7275const searchDropdown = document . getElementById ( 'searchDropdown' ) ;
@@ -171,10 +174,12 @@ function highlightMatch(text, query) {
171174
172175// Render recent searches
173176function 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