Indicate failed searches by background color.
All checks were successful
deployment-on-pull-request / deployment (pull_request) Successful in 1m15s

This commit is contained in:
Shy 2024-05-07 15:00:04 +02:00 committed by snoopy
parent 0dcace1bab
commit 7406efc2fa
2 changed files with 13 additions and 0 deletions

View file

@ -7,6 +7,11 @@ h1, h1 a {
color: #dfaa37; /* C4 Yellow */ color: #dfaa37; /* C4 Yellow */
} }
#search.failed {
color: #200;
background-color: #ec6d5f;
}
#itemcount { #itemcount {
display: inline-block; display: inline-block;
margin-right: 1ch; margin-right: 1ch;

View file

@ -95,6 +95,14 @@ function search(e) {
elem.classList.add('filtered'); elem.classList.add('filtered');
} }
} }
// Indicate failed search.
if (count) {
e.target.classList.remove('failed');
} else {
e.target.classList.add('failed');
}
updateCounter(count); updateCounter(count);
} }