redesigne search buttons

This commit is contained in:
lelo 2026-01-18 17:47:03 +00:00
parent 09296f077f
commit 8008d68c8b
3 changed files with 92 additions and 10 deletions

View File

@ -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;
}

View File

@ -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

View File

@ -50,12 +50,18 @@
{% include 'calendar_section.html' %}
<search style="display: none;">
<button type="button" id="backBtn" class="btn-close search-close-btn" aria-label="beenden"></button>
<div class="container">
<form id="searchForm" method="post" class="mb-4">
<!-- Suchwörter -->
<div class="mb-3">
<div class="mb-3 search-query-wrap">
<label for="query" class="h5 form-label">Suchwörter:</label>
<div class="input-group">
<input type="text" id="query" name="query" class="form-control" required>
<button type="button" id="clearBtn" class="btn btn-outline-secondary input-clear-btn" aria-label="zurücksetzen">
<span aria-hidden="true">&times;</span>
</button>
</div>
</div>
<!-- Toggle für Suchoptionen -->
@ -144,8 +150,6 @@
<!-- Buttons -->
<div class="mb-3">
<button type="submit" class="btn btn-primary">Suchen</button>
<button type="button" id="clearBtn" class="btn btn-secondary ms-2">zurücksetzen</button>
<button type="button" id="backBtn" class="btn btn-secondary ms-2">beenden</button>
</div>
</form>