From 3d81b6aae7b0c1f2175edafc49601bff229c1d03 Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 9 Feb 2026 21:40:34 +0000 Subject: [PATCH] clear search button --- frontend/css/style.css | 35 ++++++++++++++++++++++++++++++++++- frontend/index.html | 1 + frontend/js/ui.js | 22 ++++++++++++++++++++++ 3 files changed, 57 insertions(+), 1 deletion(-) diff --git a/frontend/css/style.css b/frontend/css/style.css index da472f3..c293b74 100644 --- a/frontend/css/style.css +++ b/frontend/css/style.css @@ -98,11 +98,12 @@ body.theme-light .top-bar { .search-container { flex: 1; max-width: 500px; + position: relative; } .search-container input { width: 100%; - padding: 10px 16px; + padding: 10px 44px 10px 16px; background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 999px; @@ -122,6 +123,38 @@ body.theme-light .top-bar { color: var(--text-secondary); } +.search-clear-btn { + position: absolute; + top: 50%; + right: 12px; + transform: translateY(-50%); + width: 26px; + height: 26px; + border: none; + border-radius: 50%; + background: var(--bg-secondary); + color: var(--text-secondary); + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; + font-size: 16px; + line-height: 1; + opacity: 0; + pointer-events: none; + transition: opacity 0.2s ease, background 0.2s ease, color 0.2s ease; +} + +.search-clear-btn.is-visible { + opacity: 1; + pointer-events: auto; +} + +.search-clear-btn:hover { + background: var(--bg-tertiary); + color: var(--text-primary); +} + .actions { display: flex; gap: 12px; diff --git a/frontend/index.html b/frontend/index.html index 98f1758..aa7e852 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -15,6 +15,7 @@
+