fix: remove duplicate inline chapter nav, upgrade player prev/next to SVG chevrons with chapter number
This commit is contained in:
@@ -2245,31 +2245,12 @@ const chapterTmpl = `
|
|||||||
<p class="text-xs font-medium text-amber-500/80 uppercase tracking-widest mb-1.5">Chapter {{.ChapterN}}</p>
|
<p class="text-xs font-medium text-amber-500/80 uppercase tracking-widest mb-1.5">Chapter {{.ChapterN}}</p>
|
||||||
<h1 class="text-xl font-bold text-zinc-100 leading-snug">{{.Title}}</h1>
|
<h1 class="text-xl font-bold text-zinc-100 leading-snug">{{.Title}}</h1>
|
||||||
{{if .ChapterDate}}<p class="text-xs text-zinc-600 mt-1">{{.ChapterDate}}</p>{{end}}
|
{{if .ChapterDate}}<p class="text-xs text-zinc-600 mt-1">{{.ChapterDate}}</p>{{end}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<article id="chapter-article" id="reader-body">
|
<article id="chapter-article" id="reader-body">
|
||||||
{{.HTML}}
|
{{.HTML}}
|
||||||
</article>
|
</article>
|
||||||
|
|
||||||
<!-- Bottom chapter nav (inline, below content) -->
|
|
||||||
<div class="flex items-center justify-between gap-4 mt-10 pt-6 border-t border-zinc-800/50">
|
|
||||||
{{if .PrevN}}
|
|
||||||
<a href="/books/{{.Slug}}/chapters/{{.PrevN}}"
|
|
||||||
hx-get="/books/{{.Slug}}/chapters/{{.PrevN}}"
|
|
||||||
hx-target="#main-content" hx-push-url="true" hx-swap="innerHTML"
|
|
||||||
class="flex items-center gap-1.5 text-sm text-zinc-400 hover:text-amber-400 no-underline transition-colors">
|
|
||||||
← Prev
|
|
||||||
</a>
|
|
||||||
{{else}}<span></span>{{end}}
|
|
||||||
{{if .NextN}}
|
|
||||||
<a href="/books/{{.Slug}}/chapters/{{.NextN}}"
|
|
||||||
hx-get="/books/{{.Slug}}/chapters/{{.NextN}}"
|
|
||||||
hx-target="#main-content" hx-push-url="true" hx-swap="innerHTML"
|
|
||||||
class="flex items-center gap-1.5 text-sm text-zinc-400 hover:text-amber-400 no-underline transition-colors">
|
|
||||||
Next →
|
|
||||||
</a>
|
|
||||||
{{else}}<span></span>{{end}}
|
|
||||||
</div>
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<!-- ─── Fixed bottom player ───────────────────────────────────────────────── -->
|
<!-- ─── Fixed bottom player ───────────────────────────────────────────────── -->
|
||||||
@@ -2301,10 +2282,11 @@ const chapterTmpl = `
|
|||||||
hx-get="/books/{{.Slug}}/chapters/{{.PrevN}}"
|
hx-get="/books/{{.Slug}}/chapters/{{.PrevN}}"
|
||||||
hx-target="#main-content" hx-push-url="true" hx-swap="innerHTML"
|
hx-target="#main-content" hx-push-url="true" hx-swap="innerHTML"
|
||||||
title="Previous chapter" aria-label="Previous chapter"
|
title="Previous chapter" aria-label="Previous chapter"
|
||||||
class="flex-shrink-0 w-8 h-8 flex items-center justify-center rounded-lg text-zinc-600 hover:text-zinc-300 hover:bg-zinc-800 transition-colors no-underline text-sm">
|
class="flex-shrink-0 flex flex-col items-center justify-center w-10 h-10 rounded-xl text-zinc-400 hover:text-zinc-100 hover:bg-zinc-800 transition-colors no-underline gap-0.5">
|
||||||
←
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" width="18" height="18"><polyline points="15 18 9 12 15 6"/></svg>
|
||||||
|
<span class="text-[0.55rem] tabular-nums leading-none text-zinc-600">{{.PrevN}}</span>
|
||||||
</a>
|
</a>
|
||||||
{{else}}<span class="flex-shrink-0 w-8"></span>{{end}}
|
{{else}}<span class="flex-shrink-0 w-10"></span>{{end}}
|
||||||
|
|
||||||
<!-- Play / Pause -->
|
<!-- Play / Pause -->
|
||||||
<button id="player-play-btn" type="button" onclick="ttsToggle()"
|
<button id="player-play-btn" type="button" onclick="ttsToggle()"
|
||||||
@@ -2336,10 +2318,11 @@ const chapterTmpl = `
|
|||||||
hx-get="/books/{{.Slug}}/chapters/{{.NextN}}"
|
hx-get="/books/{{.Slug}}/chapters/{{.NextN}}"
|
||||||
hx-target="#main-content" hx-push-url="true" hx-swap="innerHTML"
|
hx-target="#main-content" hx-push-url="true" hx-swap="innerHTML"
|
||||||
title="Next chapter" aria-label="Next chapter"
|
title="Next chapter" aria-label="Next chapter"
|
||||||
class="flex-shrink-0 w-8 h-8 flex items-center justify-center rounded-lg text-zinc-600 hover:text-zinc-300 hover:bg-zinc-800 transition-colors no-underline text-sm">
|
class="flex-shrink-0 flex flex-col items-center justify-center w-10 h-10 rounded-xl text-zinc-400 hover:text-zinc-100 hover:bg-zinc-800 transition-colors no-underline gap-0.5">
|
||||||
→
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" width="18" height="18"><polyline points="9 18 15 12 9 6"/></svg>
|
||||||
|
<span class="text-[0.55rem] tabular-nums leading-none text-zinc-600">{{.NextN}}</span>
|
||||||
</a>
|
</a>
|
||||||
{{else}}<span class="flex-shrink-0 w-8"></span>{{end}}
|
{{else}}<span class="flex-shrink-0 w-10"></span>{{end}}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user