From 612b626557ed68d5d9e756a66da52a2022d16e2a 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 687ad87..8b46887 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); }