From 7406efc2fa4c8566f1b1e877d4da51c927d958e2 Mon Sep 17 00:00:00 2001 From: Shy Date: Tue, 7 May 2024 15:00:04 +0200 Subject: [PATCH] Indicate failed searches by background color. --- static/c4.css | 5 +++++ static/index.js | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/static/c4.css b/static/c4.css index 7d5a573..3c2e3eb 100644 --- a/static/c4.css +++ b/static/c4.css @@ -7,6 +7,11 @@ h1, h1 a { color: #dfaa37; /* C4 Yellow */ } +#search.failed { + color: #200; + background-color: #ec6d5f; +} + #itemcount { display: inline-block; margin-right: 1ch; diff --git a/static/index.js b/static/index.js index a79b6dd..3be7022 100644 --- a/static/index.js +++ b/static/index.js @@ -95,6 +95,14 @@ function search(e) { elem.classList.add('filtered'); } } + + // Indicate failed search. + if (count) { + e.target.classList.remove('failed'); + } else { + e.target.classList.add('failed'); + } + updateCounter(count); }