From 5b527919f62598cc8a7653a7f0d831ab97786a63 Mon Sep 17 00:00:00 2001 From: Admin Date: Sun, 1 Mar 2026 20:11:39 +0500 Subject: [PATCH] feat: sticky chapter reader toolbar with settings menu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the separate top nav bar and TTS player bar with a single compact sticky header that stays visible while scrolling. Navigation (← back, Prev, Next) and the Listen/Pause button are always accessible. Voice, speed and auto-next settings are moved into a ⚙ dropdown that opens from the header, keeping the reading area clean. A thin status strip below the toolbar shows Buffering/Playing/Error states only when active. --- scraper/internal/server/ui.go | 210 ++++++++++++++++++++++------------ 1 file changed, 137 insertions(+), 73 deletions(-) diff --git a/scraper/internal/server/ui.go b/scraper/internal/server/ui.go index 0980c92..f69142f 100644 --- a/scraper/internal/server/ui.go +++ b/scraper/internal/server/ui.go @@ -1018,84 +1018,119 @@ func (s *Server) handleBookChaptersPage(w http.ResponseWriter, r *http.Request) // ─── GET /books/{slug}/chapters/{n} — chapter reader ───────────────────────── const chapterTmpl = ` -
- -
-

{{.Title}}

-
+ + {{if .PrevN}} + + ← Prev + + {{else}} + ← Prev + {{end}} - -
-
+ + {{.Title}} - - + + {{if .NextN}} + + Next → + + {{else}} + Next → + {{end}} - + + + + + +
+ + + + + + - + + + + +
+ + + + +
+ +
+

{{.Title}}

+
+
{{.HTML}} @@ -1142,6 +1177,8 @@ const chapterTmpl = ` border-left: 2px solid #f59e0b; padding-left: calc(0.5rem - 2px); } + /* Prevent sticky header from covering anchor targets */ + #main-content { scroll-padding-top: 3.5rem; }