From 8008d68c8bd1d36f3e78f765eedde6e39e4e9056 Mon Sep 17 00:00:00 2001 From: lelo Date: Sun, 18 Jan 2026 17:47:03 +0000 Subject: [PATCH] redesigne search buttons --- static/app.css | 74 ++++++++++++++++++++++++++++++++++++++++++---- static/search.js | 16 +++++++++- templates/app.html | 12 +++++--- 3 files changed, 92 insertions(+), 10 deletions(-) diff --git a/static/app.css b/static/app.css index 5b8e5aa..734a47a 100644 --- a/static/app.css +++ b/static/app.css @@ -29,10 +29,8 @@ body { z-index: 2000; display: flex; align-items: center; - gap: 16px; + gap: 10px; padding: 10px 20px; - - border-bottom: 1px solid rgba(255, 255, 255, 0.05); } .site-header img.logo { @@ -42,7 +40,7 @@ body { } .site-header h1 { - font-size: 1.4rem; + font-size: 1.3rem; margin: 0; letter-spacing: 0.08em; text-transform: uppercase; @@ -103,7 +101,30 @@ search { border-radius: 0 0 16px 16px; box-shadow: none; margin-top: -1px; - padding: 16px 0 10px; + padding: 16px 12px 10px; + position: relative; +} + +/* Search view controls */ +.search-close-btn { + position: absolute; + top: 12px; + right: 14px; + opacity: 0.85; +} + +.input-clear-btn { + border-top-left-radius: 0; + border-bottom-left-radius: 0; + opacity: 0.85; +} + +.input-clear-btn:hover { + opacity: 1; +} + +.search-close-btn:hover { + opacity: 1; } /* Breadcrumb Styles */ @@ -1064,3 +1085,46 @@ footer { margin-bottom: 10px; color: var(--brand-ink); } +/* Buttons - harmonize with brand palette */ +.btn-primary { + background: linear-gradient(135deg, var(--brand-sky), #3b82f6); + border: 1px solid var(--brand-sky); + color: #fff; + font-weight: 700; + letter-spacing: 0.01em; + box-shadow: 0 8px 18px rgba(59, 130, 246, 0.18); +} + +.btn-primary:hover { + background: linear-gradient(135deg, #2563eb, var(--brand-sky)); + border-color: #2563eb; + box-shadow: 0 12px 28px rgba(59, 130, 246, 0.22); +} + +.btn-primary:active, +.btn-primary:focus { + background: linear-gradient(135deg, #1d4ed8, #2563eb); + border-color: #1d4ed8; + box-shadow: 0 6px 16px rgba(37, 99, 235, 0.26) inset; +} + +.btn-outline-secondary { + border-color: var(--border-color); + color: var(--brand-ink); + background: #fff; +} + +.btn-outline-secondary:hover, +.btn-outline-secondary:focus { + background: linear-gradient(135deg, #fff, #f4f7fb); + color: var(--brand-ink); + border-color: var(--border-color); + box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08); +} + +.btn-outline-secondary:active { + background: #eef2f7; + color: var(--brand-ink); + border-color: var(--border-color); + box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08) inset; +} diff --git a/static/search.js b/static/search.js index 0ee23bf..4299780 100644 --- a/static/search.js +++ b/static/search.js @@ -66,6 +66,9 @@ document.addEventListener('DOMContentLoaded', function() { e.preventDefault(); const query = document.getElementById('query').value.trim(); const includeTranscript = document.getElementById('includeTranscript').checked; + const spinnerTimer = setTimeout(() => { + if (typeof showSpinner === 'function') showSpinner(); + }, 200); // Get the selected category radio button, if any const categoryRadio = document.querySelector('input[name="category"]:checked'); @@ -96,7 +99,12 @@ document.addEventListener('DOMContentLoaded', function() { formData.append('dateto', document.getElementById('dateto').value); formData.append('includeTranscript', includeTranscript); - fetch('/searchcommand', { + const settleSpinner = () => { + clearTimeout(spinnerTimer); + if (typeof hideSpinner === 'function') hideSpinner(); + }; + + const fetchPromise = fetch('/searchcommand', { method: 'POST', body: formData }) @@ -118,6 +126,12 @@ document.addEventListener('DOMContentLoaded', function() { .catch(error => { console.error('Error:', error); }); + // Always clear/hide spinner once the request settles + if (typeof fetchPromise.finally === 'function') { + fetchPromise.finally(settleSpinner); + } else { + fetchPromise.then(settleSpinner, settleSpinner); + } }); // Clear button event handler diff --git a/templates/app.html b/templates/app.html index 1728a6f..1144e79 100644 --- a/templates/app.html +++ b/templates/app.html @@ -50,12 +50,18 @@ {% include 'calendar_section.html' %} +
-
+
- +
+ + +
@@ -144,8 +150,6 @@
- -