penguin/narou-android

Simple 縦書き reader for narou

commit 88eeb6c72f71472c048a5e9e25efbbe509715a65

author斟酌 鵬兄 <tgckpg@gmail.com>
date2026-10-14T06:02:47Z
subjectPut chapter into footer
commit 88eeb6c72f71472c048a5e9e25efbbe509715a65
Author: 斟酌 鵬兄 <tgckpg@gmail.com>
Date:   2026-10-14T06:02:47Z

    Put chapter into footer
---
 app/src/main/assets/reader/content.js | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/app/src/main/assets/reader/content.js b/app/src/main/assets/reader/content.js
index e0faca4..36bd7a0 100644
--- a/app/src/main/assets/reader/content.js
+++ b/app/src/main/assets/reader/content.js
@@ -85,6 +85,7 @@
     article a { color: inherit; text-decoration: underline; }
     nav { display: flex; gap: 12px; }
     nav a { color: var(--fg); text-decoration: none; border-bottom: 1px solid var(--border); }
+    #chapter-subtitle { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: .25em 1em; min-width: 0; overflow-wrap: anywhere; }
     #progress { flex: 1; min-width: 80px; direction: rtl; }
     #percent { font-variant-numeric: tabular-nums; min-width: 4ch; }
     .chrome-hidden header, .chrome-hidden footer { visibility: hidden; pointer-events: none; }
@@ -286,6 +287,19 @@
     }
   });
   const footer = el('footer');
+  const subtitle = document.querySelector('.p-novel__subtitle');
+  if (subtitle) {
+    const chapterSubtitle = el('div', '', {id: 'chapter-subtitle'});
+    for (const selector of ['.p-novel__subtitle-chapter', '.p-novel__subtitle-episode']) {
+      const text = subtitle.querySelector(selector)?.textContent.trim();
+      if (text) {
+        const part = el('span');
+        part.textContent = text;
+        chapterSubtitle.append(part);
+      }
+    }
+    if (chapterSubtitle.childElementCount) footer.append(chapterSubtitle);
+  }
   const nav = el('nav', '', {'aria-label': '@nav'});
   const pager = document.querySelector('.c-pager, .novel_bn');
   if (pager) for (const link of pager.querySelectorAll('a[href]')) {