feat: add debounced search dropdown with quick results

This commit is contained in:
2026-04-06 22:58:40 +02:00
parent da88c286f2
commit 6495bc733a
6 changed files with 226 additions and 5 deletions

View File

@@ -76,6 +76,11 @@ header {
text-decoration: underline;
}
.header-search-wrapper {
margin-left: auto;
position: relative;
}
.header-search {
margin-left: auto;
}
@@ -99,6 +104,108 @@ header {
color: var(--text-muted);
}
/* Search Dropdown */
.search-dropdown {
position: absolute;
top: 100%;
right: 0;
width: 320px;
background: var(--surface);
border: 1px solid var(--border);
border-top: none;
margin-top: -1px;
max-height: 480px;
overflow-y: auto;
z-index: 1000;
}
.search-results {
display: flex;
flex-direction: column;
}
.search-results-title {
padding: 8px 12px;
font-size: 11px;
font-weight: 600;
color: var(--text-muted);
text-transform: uppercase;
border-bottom: 1px solid var(--border);
}
.search-result-item {
display: flex;
gap: 10px;
padding: 8px 12px;
border-bottom: 1px solid var(--border);
text-decoration: none;
color: inherit;
transition: background 0.15s;
}
.search-result-item:hover {
background: var(--surface-hover);
}
.search-result-thumb {
width: 40px;
height: 60px;
object-fit: cover;
border: 1px solid var(--border);
flex-shrink: 0;
}
.search-result-no-image {
width: 40px;
height: 60px;
display: flex;
align-items: center;
justify-content: center;
background: var(--surface-hover);
border: 1px solid var(--border);
font-size: 10px;
color: var(--text-muted);
flex-shrink: 0;
}
.search-result-info {
display: flex;
flex-direction: column;
gap: 2px;
min-width: 0;
flex: 1;
}
.search-result-title {
font-size: 12px;
color: var(--text);
font-weight: 500;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
.search-result-type {
font-size: 11px;
color: var(--text-muted);
}
.search-result-view-all {
display: block;
padding: 10px 12px;
text-align: center;
color: var(--link);
font-size: 12px;
border-top: 1px solid var(--border);
text-decoration: none;
}
.search-result-view-all:hover {
background: var(--surface-hover);
text-decoration: underline;
}
/* Main */
main {
padding: 16px;