Commit Graph

859 Commits

Author SHA1 Message Date
kennethreitz 8f89fe9bfb Improve /offline page design and fix import error
Design improvements:
- Added Quick Access section with links to Books, Stories, Topics, etc.
- Moved technical debug info to collapsible "Technical Details" section
- Added styled quick link grid with hover effects
- Cleaner layout focusing on user-friendly features

Bug fix:
- Fixed import error: use load_all_stories() instead of get_all_stories()

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 01:43:36 -05:00
kennethreitz 47b74af662 Show offline caching progress on page load
- Service worker now responds to GET_CACHE_STATUS message
- /offline page queries caching status when it loads
- If download is in progress, shows progress bar immediately without requiring click

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 01:42:45 -05:00
kennethreitz 684719d34f Add interlinear and story pages to sitemap
- Added all 1,189 interlinear chapter URLs (/book/{book}/chapter/{chapter}/interlinear)
- Added all 186 individual story URLs (/stories/{slug})
- Now the sitemap includes everything for complete offline caching

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 01:42:16 -05:00
kennethreitz 365cef49c7 Disable PDF buttons when offline
- PDF links/buttons are greyed out (40% opacity) when offline
- Adds strikethrough and "not-allowed" cursor
- Shows tooltip "PDF unavailable offline"
- Prevents click events
- Re-enables automatically when back online

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 01:38:32 -05:00
kennethreitz c33dc5813b Dynamic sitemap-based offline caching
Major improvements to offline caching:
- Service worker now parses sitemaps dynamically instead of hardcoded URL lists
- Fetches /sitemap.xml and any child sitemaps (sitemap-main.xml, sitemap-verses.xml)
- Caches ALL pages found in sitemaps including 31,102 individual verse pages
- Much cleaner, smaller service worker (~300 lines vs ~1800 lines)
- Added status messages during sitemap parsing
- Better error handling with retry option

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 01:33:09 -05:00
kennethreitz b8124033bf Improve offline fallback: redirect uncached pages to /offline reader
- Interlinear pages now redirect to offline reader with book/chapter params
- All uncached HTML pages now go to /offline instead of homepage
- Bumped cache version to v5

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 01:30:49 -05:00
kennethreitz c6ae359e16 On-demand offline caching with all stories
Changes:
- Caching now only starts when user clicks "Download for Offline Use" on /offline page
- Added all 186 Bible stories (including kids mode) to cache list
- Added progress bar and status indicators on /offline page
- Bumped cache version to v4
- Total cacheable pages: ~1,500 (1189 chapters + 186 stories + 66 books + resources)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 01:27:24 -05:00
kennethreitz 357243c396 Cache entire site offline: all 1189 Bible chapters + resources
Updated service worker to pre-cache:
- All 1189 chapter pages (Genesis 1 through Revelation 22)
- All 66 book overview pages
- All resource/reference pages (topics, stories, study guides, etc.)
- Total: ~1300+ pages for complete offline access

Also bumped cache version to v3 and increased batch size for faster caching.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 01:24:51 -05:00
kennethreitz 69be068188 Fix service worker registration by serving from root path
Service workers can only control URLs within their scope. A service worker
at /static/sw.js couldn't control the root scope (/) without special headers.

- Add /sw.js route that serves the service worker with Service-Worker-Allowed: /
- Update registration to use /sw.js instead of /static/sw.js

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 01:20:50 -05:00
kennethreitz 94f42ea751 Add 'Enable Offline' link to sidebar navigation
Adds a link to the /offline debug page at the bottom of the sidebar,
allowing users to easily access offline status and cached pages list.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 01:19:29 -05:00
kennethreitz 214d4c565b Add offline debug page with service worker status and cached pages list
- Shows service worker registration status
- Lists all cache storage names
- Checks if Bible data (31,102 verses) is cached
- Displays all cached pages grouped by category (clickable links)
- Shows online/offline connection badge
- Includes Bible reader for reading any chapter from cached JSON

Visit /offline to see what's available without internet.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 01:18:06 -05:00
kennethreitz e21ecfdf44 Fix service worker URL list with 388 verified pages
- Verified all URLs actually return 200 status
- Fixed topic URLs (need capital letters: /topics/Faith not /topics/faith)
- Fixed story URLs (use slugs like /stories/god-creates-the-world)
- Fixed resource URLs (e.g. /fruits-of-the-spirit not /fruits-of-spirit)
- Added all parables, reading plans, study guides
- Total: 388 pages now pre-cached in background

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 01:14:10 -05:00
kennethreitz bc8149ceb7 Add background pre-caching for full offline support
- Service worker now pre-caches ~160 pages in background after install
- Includes all resource pages, topics, study guides, stories, book pages
- Caches in batches of 5 with 1-second delays to avoid overwhelming server
- Progress indicator shows "Caching for offline: X%" in bottom-left
- Shows "Ready for offline! (X pages)" when complete, then fades out
- Bumped cache version to v2 to trigger re-cache

Combined with the Bible JSON (~4.7MB), the entire site is now
available offline after first visit.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 01:09:35 -05:00
kennethreitz 87926fa83c Add offline Bible reader with full 31,102 verses
- Created /offline route with client-side Bible renderer
- Loads verses from cached JSON (verses-1769.json)
- Full book/chapter navigation with dropdowns
- Keyboard navigation (← → for chapters)
- Service worker redirects to offline reader when Bible pages fail
- Pre-caches offline reader page on install
- Auto-parses URL params (?book=Genesis&chapter=1)

When offline, users can read any chapter of the Bible using
the cached JSON data - no need to have visited the page before.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 01:04:32 -05:00
kennethreitz 677f8f05b7 Add Service Worker for offline Bible access
- Created sw.js with caching strategies:
  - Static assets (CSS, JS, fonts) - cache first
  - Bible pages - network first, cache fallback
  - API requests - network first with offline cache
- Pre-caches verses-1769.json (~4.7MB) on install
- Added service worker registration to base.html
- Added offline indicator (red badge in bottom-right)
- Linked manifest.json for PWA support

Users can now read the Bible offline after first visit.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 01:00:29 -05:00
kennethreitz 7f25e58c81 Add left/right arrow navigation for action buttons
- Left/right arrows navigate between Interlinear and PDF buttons
- When in action zone, arrows move horizontally between buttons
- When in verse zone, left/right still navigate chapters as before

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 00:54:29 -05:00
kennethreitz 71462d3097 Add keyboard-selectable action buttons on chapter pages
- Interlinear and PDF buttons now selectable with up/down navigation
- Up from first verse moves to action buttons, down from actions to verses
- Initial selection starts with verses (not actions) as requested
- Fixed read-aloud to exclude sidenotes from verse text
- Added selected state styling for action buttons

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 00:53:38 -05:00
kennethreitz df2272188f Add universal text-to-speech for keyboard-selected content
- Added KJVSpeech global helper using Web Speech API
- Space key reads aloud any element with green box selection
- Works on all pages with keyboard navigation (resources, parables, etc.)
- Chapter page has specialized handler for verse text
- Prefers English voices, cleans up text (removes verse numbers)
- Added Space key to keyboard shortcuts help modal

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 00:50:20 -05:00
kennethreitz 092361426c Add drill-down keyboard navigation to family tree person page
- Navigate sections with up/down arrows
- Enter or Right arrow drills into items within a section
  (family cards, biography text, events, verses)
- Left arrow goes back to section level
- Enter on an item follows its link

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 00:45:00 -05:00
kennethreitz dfb52649b1 Fix parable detail page to include description div when no p tags
When the description content isn't wrapped in <p> tags, now falls
back to selecting the .parable-description div itself for navigation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 00:42:49 -05:00
kennethreitz 10ab6f84c3 Add paragraph-level keyboard navigation to all resource pages
Updated 10 resource index templates with:
- TOC drill-down navigation (Enter/Right to expand, Left to collapse)
- Paragraph-level selection for descriptions and verses
- PDF button in navigation flow
- 'p' shortcut for PDF, 't' shortcut for TOC
- Viewport-aware selection reset

Templates updated:
- parables.html
- biblical_angels.html
- biblical_festivals.html
- biblical_prophets.html
- fruits_of_spirit.html
- women_of_the_bible.html
- biblical_covenants.html
- names_of_god.html
- tetragrammaton.html
- twelve_apostles.html

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 00:42:22 -05:00
kennethreitz 0d9cf71a87 Add viewport-aware keyboard navigation site-wide
Added global KJVNav helpers to base.html and updated 32 templates
to start keyboard selection from the viewport when the current
selection is off-screen. This provides a more intuitive navigation
experience - pressing up/down after scrolling starts from what's
visible rather than jumping to an off-screen location.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 00:39:20 -05:00
kennethreitz ca1f72cd12 Start keyboard navigation from viewport when selection is off-screen
If the currently selected element is not visible in the viewport,
pressing up/down will now start selection from the first visible
element rather than jumping to an off-screen location.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 00:34:39 -05:00
kennethreitz d3adc45260 Include all description content types in keyboard navigation
Added support for p, ul, ol, and blockquote elements within
.resource-item-description for paragraph-level navigation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 00:33:11 -05:00
kennethreitz 631bb1cdce Fix keyboard nav order: PDF -> intro -> TOC -> content
Navigation now follows visual order on the page:
1. PDF button and intro paragraphs (pre-TOC)
2. TOC block (with drill-down to entries)
3. Resource sections (post-TOC)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 00:32:19 -05:00
kennethreitz 0462438290 Fix TOC to be first selectable element on resource index pages
When pressing down arrow with nothing selected, now selects the TOC
block first instead of jumping directly to content elements.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 00:31:11 -05:00
kennethreitz 2da8cc7be7 Fix TOC Enter to correctly find resource-name headings
The h3.resource-name element IS the heading with the ID, not a child
of it. Now checks if the target heading itself has the resource-name
class before searching within sections.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 00:30:13 -05:00
kennethreitz 87f11bcd2b TOC entry Enter jumps to section content instead of anchor navigation
When pressing Enter on a TOC entry, now selects the first content
element (title/paragraph) in that section for keyboard navigation
instead of just scrolling to the anchor.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 00:29:24 -05:00
kennethreitz 79d79b1a00 Add PDF button and TOC shortcuts to resource index keyboard nav
- PDF button is now selectable via arrow navigation
- 'p' key downloads PDF directly
- 't' key jumps to TOC block

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 00:28:45 -05:00
kennethreitz 672a7a1d7b Add section title links to keyboard navigation on resource index pages
- Resource entry titles (h3.resource-name) are now selectable
- Enter on a title navigates to the detail page
- Allows drill-down navigation: section title -> paragraphs -> verses

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 00:27:59 -05:00
kennethreitz 44bfa73157 Add TOC drill-down keyboard navigation on resource index pages
- TOC is now a selectable block that can be navigated to with arrow keys
- Press Enter or Right arrow to drill into individual TOC entries
- Navigate TOC entries with Up/Down, Enter or Right to follow link
- Left arrow exits TOC items back to TOC block

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 00:27:26 -05:00
kennethreitz 58b9c316a6 Add '1' keyboard shortcut to navigate home from anywhere
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 00:26:36 -05:00
kennethreitz 40b86ffaf7 Comprehensive keyboard navigation improvements
- Remove study guides from homepage keyboard nav (too inline/sloppy)
- Add paragraph-level nav to resource_index.html (soteriology, etc.)
- Stories index: add category navigation, Enter jumps to first story in category
- Story kids: add adult callout and PDF button to nav
- Detail pages (topic, resource, reading_plan, parable): include paragraphs,
  verse items, and PDF buttons in keyboard nav
- Chapter page: add 'i' for interlinear, 'p' for PDF shortcuts
- Book page: add 'p' for PDF shortcut
- Chapter interlinear: add 'p' for PDF shortcut

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 00:24:33 -05:00
kennethreitz a401de6b3f Improve keyboard navigation with contextual back and more selectable items
- Left arrow uses history.back() on detail pages (verse, story, story_kids)
  so navigation returns to wherever user came from
- Homepage now includes daily verse, search section, nav links, and study
  guides in keyboard-selectable items
- Enter on search section focuses the input field

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 00:11:27 -05:00
kennethreitz d8e7c999bd Use browser back when navigating from verse-highlighted chapter
Left arrow now uses history.back() when the URL has a verse hash
(indicating the user came from a story or verse link), otherwise
navigates to previous chapter as before.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 00:01:30 -05:00
kennethreitz 090119e0ac Add scripture metadata to story keyboard navigation
- Story meta (scripture refs, characters, themes) now navigable
- Down arrow starts at first paragraph, up goes to metadata
- Enter on metadata follows first scripture link

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 23:57:12 -05:00
kennethreitz 2b6f34b74c Add PDF button to story page keyboard navigation
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 23:56:14 -05:00
kennethreitz b3545fd377 Include kids callout in story page keyboard navigation
- Up/down now includes the kids version callout box
- Enter on kids callout navigates to kids version
- Added Escape to clear selection

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 23:55:56 -05:00
kennethreitz 11ec1a4095 Change keyboard shortcuts: s=Stories, /=Search
- s now goes to /stories
- / now goes to /search (more intuitive)
- Updated keyboard help modal

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 23:54:10 -05:00
kennethreitz ac38d99dec Embed verse text inline in cross-references section
- Display verse text directly below each reference instead of tooltip
- Remove hover tooltip system for cross-references
- Cleaner, more readable presentation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 23:50:08 -05:00
kennethreitz b372653e62 Include sidenotes and marginnotes in verse tooltip areas
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 23:48:00 -05:00
kennethreitz 547a1992fb Restrict verse tooltips to paragraph content only
Skip tooltips on:
- Navigation, headers, footers, TOC, breadcrumbs
- Buttons, actions, download/print buttons
- Share container and share buttons
- Chapter/verse navigation
- Headings (h1, h2, h3)

Only show tooltips on links within:
- Paragraphs, sections, articles
- Verse items, verse text, intro text
- Descriptions, list items

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 23:47:39 -05:00
kennethreitz e09a1d3b6a Fix escaped HTML in verse PDF by adding safe filter
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 23:45:18 -05:00
kennethreitz f3c0a84219 Fix cross-references in verse PDF to use correct field names
- Use ref.text instead of ref.ref for reference string
- Use ref.context instead of ref.note for description
- Add ref.verse_text to show the actual verse text

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 23:44:08 -05:00
kennethreitz ecd6c6faba Move PDF button to Share This Verse section
- Removed standalone PDF button from top of page
- Added PDF option to share buttons (Copy, Tweet, Share, PDF)
- Cleaned up unused CSS

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 23:43:31 -05:00
kennethreitz 5d05e9e1ad Fix verse PDF to use correct commentary field names
- analysis (not theological_significance)
- historical (not historical_context)
- questions (study questions list)
- cross_references from commentary

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 23:42:30 -05:00
kennethreitz 41e3d45bf2 Fix cross-reference field name in verse PDF template
Changed ref.reference to xref.ref to match actual data structure

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 23:41:28 -05:00
kennethreitz 8634e8ad7f Add print CSS to all resource pages and PDF for verse view
Print CSS added to:
- biblical_angels.html
- biblical_covenants.html
- biblical_festivals.html
- biblical_prophets.html
- fruits_of_spirit.html
- names_of_god.html
- parables.html
- resource_index.html
- tetragrammaton.html
- twelve_apostles.html
- women_of_the_bible.html
- verse.html

Verse PDF feature:
- New verse_pdf.html template with commentary, cross-refs, interlinear
- New /book/{book}/chapter/{chapter}/verse/{verse_num}/pdf route
- Download PDF button on verse pages

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 23:40:16 -05:00
kennethreitz 30a59c206d Increase foreign text size in interlinear PDF
Hebrew: 15pt → 20pt, Greek: 14pt → 18pt

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 23:34:08 -05:00
kennethreitz d829041796 Add PDF download for interlinear chapter pages
- Create chapter_interlinear_pdf.html template for PDF export
- Add /book/{book}/chapter/{chapter}/interlinear/pdf route
- Add PDF download button to interlinear page alongside print
- Include Hebrew/Greek text, English translations, and Strong's numbers

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 23:33:17 -05:00