feat: add global search bar, fix search cover blur, shelf title search + category tags

1. Fix hdCover() to also replace s_ prefix (search results use s_ not t6_)
2. Add persistent search bar below navbar, switches to discover tab on search
3. Shelf search now supports book title and author search (new keyword param)
4. Add category tag pills above book grid, click to filter by category
5. Update /api/shelf backend: keyword param for title/author, category for exact match
6. Mobile responsive styles for search bar and category tags
This commit is contained in:
admin committed 2026-07-17 12:12:23 +08:00
1 parent 7c918140b3
commit 4c916eceb7
4 files changed
+194 -9

No files matched your search

+13 -1
View File
@@ -51,6 +51,17 @@
</div>
</nav>
<!-- 顶部常驻搜索框 -->
<div class="global-search-bar">
<div class="container">
<div class="global-search-wrapper">
<span class="global-search-icon">🔍</span>
<input type="text" id="globalSearchInput" class="global-search-input" placeholder="搜索图书..." onkeydown="if(event.key==='Enter')globalSearch()">
<button class="global-search-btn" onclick="globalSearch()">搜索</button>
</div>
</div>
</div>
<!-- ===== 主视图(标签页切换) ===== -->
<main id="mainView">
@@ -110,13 +121,14 @@
<h2 class="section-title">📚 我的书架</h2>
<div class="shelf-controls">
<div class="shelf-filters">
<input type="text" id="shelfSearch" class="shelf-search" placeholder="搜索分类...">
<input type="text" id="shelfSearch" class="shelf-search" placeholder="搜索书名、作者...">
<label class="filter-checkbox">
<input type="checkbox" id="finishedOnly"> 仅看已读完
</label>
</div>
<div class="shelf-info" id="shelfInfo"></div>
</div>
<div class="shelf-categories" id="shelfCategories"></div>
<div class="book-grid" id="bookGrid"></div>
<div class="pagination" id="pagination"></div>
</div>