diff --git a/TODO.md b/TODO.md index 3a38e13..fb49cee 100644 --- a/TODO.md +++ b/TODO.md @@ -146,6 +146,12 @@ - Сохранение не только пикселей `scrollTop`, но и индекса первого видимого абзаца (`anchor_paragraph_idx`). - Устойчивость к изменению шрифта `Aa` и ориентации экрана: восстановление скролла к конкретному предложению/абзацу, а не слепым пикселям. - Фиксация скролл-контейнера `#reader-scroll-area` с аппаратным ускорением на мобильных. +- [x] **6.5. Сквозное чтение и бесшовная автоподгрузка (Continuous Book View & Seamless Infinite Append)**: + - Режим «Вся книга целиком» (`flowMode: 'continuous'`): объединение всех глав книги в один непрерывный свиток со стильными разделителями глав без необходимости перелистывания. + - Режим «По главам» с автоподгрузкой (`autoLoadNext: true`): бесшовное присоединение следующей главы снизу при приближении к концу текущей главы. + - Навигационный блок завершения главы: эргономичные кнопки «◀ Назад» и «Следующая: [Название] ▶» прямо под текстом (без необходимости тянуться наверх). + - Настройка режима чтения («По главам» / «Вся книга») и переключатель автоподгрузки добавлены в панель настроек `Aa` с автосохранением в `localStorage`. + - Карточка завершения книги (`🎉 Книга прочитана!`) с быстрыми ссылками на тренировку слов и возврат в библиотеку. --- diff --git a/app/static/css/style.css b/app/static/css/style.css index 7b3a54e..5189539 100644 --- a/app/static/css/style.css +++ b/app/static/css/style.css @@ -3875,5 +3875,151 @@ body { vertical-align: middle; } +/* ========================================================================== + Continuous Reading & Chapter End Navigation Card + ========================================================================== */ +/* Chapter Divider (Between chapters in continuous / autoload mode) */ +.reader-chapter-divider { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + margin: 56px 0 36px; + padding: 24px 16px; + border-top: 1px dashed var(--border-color); + border-bottom: 1px dashed var(--border-color); + background: rgba(255, 255, 255, 0.02); + border-radius: var(--radius-md); + text-align: center; + scroll-margin-top: 60px; +} +.reader-chapter-divider .divider-badge { + font-size: 11px; + font-weight: 700; + text-transform: uppercase; + letter-spacing: 0.8px; + color: var(--primary); + background: var(--bg-input); + padding: 4px 12px; + border-radius: 9999px; + border: 1px solid var(--border-color); + margin-bottom: 10px; + display: inline-block; +} + +.reader-chapter-divider .divider-title { + font-size: 22px !important; + font-weight: 700; + color: var(--text-main); + margin: 0 !important; + border-bottom: none !important; + padding-bottom: 0 !important; + text-align: center; +} + +/* Chapter End Navigation Card */ +.reader-chapter-footer { + margin: 48px 0 64px; + padding: 24px 20px; + background: var(--bg-surface); + border: 1px solid var(--border-color); + border-radius: var(--radius-lg); + box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15); + display: flex; + flex-direction: column; + align-items: center; + text-align: center; + gap: 14px; + transition: var(--transition); +} + +.reader-chapter-footer .chapter-footer-status { + display: flex; + align-items: center; + gap: 8px; + font-size: 14px; + font-weight: 600; + color: var(--text-muted); +} + +.reader-chapter-footer .chapter-footer-status .status-check { + display: inline-flex; + align-items: center; + justify-content: center; + width: 24px; + height: 24px; + border-radius: 50%; + background: rgba(34, 197, 94, 0.15); + color: var(--success); + font-size: 13px; + font-weight: 700; +} + +.reader-chapter-footer .chapter-footer-nav { + display: flex; + gap: 12px; + width: 100%; + max-width: 540px; + justify-content: center; + flex-wrap: wrap; +} + +.reader-chapter-footer .reader-footer-nav-btn { + flex: 1; + min-width: 150px; + min-height: 44px; + display: inline-flex; + align-items: center; + justify-content: center; + gap: 6px; + font-size: 14px; + font-weight: 600; + padding: 10px 18px; + border-radius: var(--radius-sm); + cursor: pointer; + transition: var(--transition); +} + +.reader-chapter-footer .chapter-footer-hint { + font-size: 12px; + color: var(--text-dim); + line-height: 1.4; + max-width: 480px; +} + +/* Book Completion Card */ +.reader-chapter-footer.reader-book-finished { + background: linear-gradient(180deg, rgba(56, 189, 248, 0.08) 0%, rgba(20, 24, 32, 0.95) 100%); + border-color: rgba(56, 189, 248, 0.35); +} + +.reader-chapter-footer.reader-book-finished .chapter-footer-hint { + color: var(--text-muted); + font-size: 13px; +} + +/* Reading Theme Adaptations */ +.reader-scroll-area.reader-theme-sepia .reader-chapter-divider, +.reader-scroll-area.reader-theme-light .reader-chapter-divider { + background: rgba(0, 0, 0, 0.025); + border-color: rgba(0, 0, 0, 0.12); +} + +.reader-scroll-area.reader-theme-sepia .reader-chapter-footer, +.reader-scroll-area.reader-theme-light .reader-chapter-footer { + background: rgba(0, 0, 0, 0.03); + border-color: rgba(0, 0, 0, 0.12); + box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06); +} + +.reader-scroll-area.reader-theme-oled .reader-chapter-divider { + background: #080808; + border-color: #222; +} + +.reader-scroll-area.reader-theme-oled .reader-chapter-footer { + background: #0c0c0c; + border-color: #222; +} diff --git a/app/static/index.html b/app/static/index.html index dbfe853..2a5d3b0 100644 --- a/app/static/index.html +++ b/app/static/index.html @@ -5,7 +5,7 @@