File tree 2 files changed +18
-0
lines changed
2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,15 @@ function getProjectContent(project) {
67
67
68
68
function renderProjectList ( projects ) {
69
69
projectsArea . innerHTML = ""
70
+
71
+ if ( projects . length === 0 ) {
72
+ const noResultsMessage = document . createElement ( "p" ) ;
73
+ noResultsMessage . className = "no-results" ;
74
+ noResultsMessage . innerText = "No results found" ;
75
+ projectsArea . appendChild ( noResultsMessage ) ;
76
+ return ;
77
+ }
78
+
70
79
projects . forEach ( ( project ) => {
71
80
const projectCard = document . createElement ( "div" ) ;
72
81
projectCard . className = "project-card" ;
@@ -93,6 +102,7 @@ function filterProjects(query) {
93
102
project . name . toLowerCase ( ) . includes ( query . toLowerCase ( ) ) ||
94
103
project . description . toLowerCase ( ) . includes ( query . toLowerCase ( ) )
95
104
) ;
105
+
96
106
renderProjectList ( filteredProjects ) ;
97
107
}
98
108
Original file line number Diff line number Diff line change @@ -182,6 +182,14 @@ section.hero {
182
182
color : black;
183
183
font-size : 13px ;
184
184
}
185
+ .no-results {
186
+ font-size : 1.5rem ;
187
+ color : black;
188
+ text-align : center;
189
+ padding : 20px ;
190
+ font-weight : bold;
191
+ }
192
+
185
193
.project-card {
186
194
border : 1px solid black;
187
195
border-radius : 6px ;
You can’t perform that action at this time.
0 commit comments