From 299f20bab8241697ee367067166de7708653e6fe Mon Sep 17 00:00:00 2001 From: jerithlawrence Date: Tue, 18 Nov 2025 14:28:57 +0530 Subject: [PATCH] feat(reader-ui): add paragraph/section/chapter copy buttons --- templates/reader.html | 165 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 165 insertions(+) diff --git a/templates/reader.html b/templates/reader.html index c012edc..ad6d1ea 100644 --- a/templates/reader.html +++ b/templates/reader.html @@ -30,6 +30,17 @@ .book-content h1, .book-content h2, .book-content h3 { font-family: -apple-system, sans-serif; margin-top: 1.5em; color: #333; } .book-content p { margin-bottom: 1.5em; text-align: justify; } + /* Copy Buttons */ + .copy-target { position: relative; padding-left: 38px; } + .copy-btn { border: 1px solid #ced4da; background: #fff; color: #495057; border-radius: 999px; width: 28px; height: 28px; font-size: 0.85em; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background 0.2s, color 0.2s, border-color 0.2s; } + .copy-btn:hover { background: #f1f3f5; } + .copy-btn.copied { background: #d4edda; border-color: #52c41a; color: #2f9e44; } + .copy-btn-inline { position: absolute; left: 0; top: 2px; opacity: 0; pointer-events: none; transition: opacity 0.2s; } + .copy-target:hover .copy-btn-inline:not(.copy-hidden), + .copy-target:focus-within .copy-btn-inline:not(.copy-hidden) { opacity: 1; pointer-events: auto; } + .chapter-copy-bar { display: flex; justify-content: flex-end; margin-bottom: 10px; } + .chapter-copy-btn { width: 34px; height: 34px; font-size: 1em; } + /* Navigation Footer */ .chapter-nav { display: flex; justify-content: space-between; margin-top: 60px; padding-top: 20px; border-top: 1px solid #eee; font-family: -apple-system, sans-serif; } .nav-btn { text-decoration: none; color: #3498db; font-weight: bold; padding: 10px 20px; border: 1px solid #3498db; border-radius: 4px; transition: all 0.2s; } @@ -97,6 +108,15 @@
+
+ +
{{ current_chapter.content | safe }}
@@ -122,6 +142,151 @@