chapter page: show book title in nav header, simplify back button and heading

This commit is contained in:
Admin
2026-03-06 20:40:43 +05:00
parent 669fd765ee
commit 8096827c78
2 changed files with 8 additions and 3 deletions

View File

@@ -211,10 +211,16 @@
{/if}
<header class="border-b border-zinc-700 bg-zinc-900 sticky top-0 z-50">
<nav class="max-w-6xl mx-auto px-4 h-14 flex items-center gap-6">
<a href="/" class="text-amber-400 font-bold text-lg tracking-tight hover:text-amber-300">
<a href="/" class="text-amber-400 font-bold text-lg tracking-tight hover:text-amber-300 shrink-0">
libnovel
</a>
{#if page.data.book?.title && /\/books\/[^/]+\/chapters\//.test(page.url.pathname)}
<span class="text-zinc-400 text-sm truncate min-w-0 flex-1 sm:flex-none sm:max-w-xs">
{page.data.book.title}
</span>
{/if}
{#if data.user}
<!-- Desktop nav links (hidden on mobile) -->
<a

View File

@@ -68,7 +68,7 @@
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7" />
</svg>
{data.book.title}
Chapters
</a>
<div class="flex gap-2">
@@ -93,7 +93,6 @@
<!-- Chapter heading -->
<div class="mb-6">
<p class="text-zinc-500 text-sm mb-1">Chapter {data.chapter.number}</p>
<h1 class="text-xl font-bold text-zinc-100">
{data.chapter.title || `Chapter ${data.chapter.number}`}
</h1>