From 40b86ffaf7adc6345ccaffa6a60cbe1c3575ca0c Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Sun, 30 Nov 2025 00:24:33 -0500 Subject: [PATCH] Comprehensive keyboard navigation improvements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- kjvstudy_org/templates/book.html | 7 + kjvstudy_org/templates/chapter.html | 16 +- .../templates/chapter_interlinear.html | 4 + kjvstudy_org/templates/index.html | 31 +--- kjvstudy_org/templates/parable_detail.html | 36 ++--- .../templates/reading_plan_detail.html | 43 ++++-- kjvstudy_org/templates/resource_detail.html | 43 ++++-- kjvstudy_org/templates/resource_index.html | 39 +++-- kjvstudy_org/templates/stories_index.html | 139 +++++++++++++++--- kjvstudy_org/templates/story_kids.html | 48 ++++-- kjvstudy_org/templates/topic_detail.html | 42 +++--- 11 files changed, 304 insertions(+), 144 deletions(-) diff --git a/kjvstudy_org/templates/book.html b/kjvstudy_org/templates/book.html index 7bc6906..b893861 100644 --- a/kjvstudy_org/templates/book.html +++ b/kjvstudy_org/templates/book.html @@ -429,6 +429,13 @@ document.addEventListener('DOMContentLoaded', function() { e.preventDefault(); window.location.href = '/book/' + encodeURIComponent(bibleBooks[currentBookIndex + 1]); } + + // p: Download PDF + if (e.key === 'p') { + e.preventDefault(); + var pdfBtn = document.querySelector('.print-btn'); + if (pdfBtn) window.location.href = pdfBtn.href; + } }); // Clicking on chapter links should just navigate normally diff --git a/kjvstudy_org/templates/chapter.html b/kjvstudy_org/templates/chapter.html index f164872..0a1bb95 100644 --- a/kjvstudy_org/templates/chapter.html +++ b/kjvstudy_org/templates/chapter.html @@ -328,7 +328,7 @@ p[id^="verse-"].selected { @@ -515,6 +515,20 @@ document.addEventListener('DOMContentLoaded', function() { } selectedVerseIndex = -1; } + + // i: Go to interlinear view + if (e.key === 'i') { + e.preventDefault(); + var interlinearBtn = document.querySelector('.interlinear-btn'); + if (interlinearBtn) window.location.href = interlinearBtn.href; + } + + // p: Download PDF + if (e.key === 'p') { + e.preventDefault(); + var pdfBtn = document.querySelector('.pdf-btn'); + if (pdfBtn) window.location.href = pdfBtn.href; + } }); // Click to select verse diff --git a/kjvstudy_org/templates/chapter_interlinear.html b/kjvstudy_org/templates/chapter_interlinear.html index 9e56b99..2adf1f0 100644 --- a/kjvstudy_org/templates/chapter_interlinear.html +++ b/kjvstudy_org/templates/chapter_interlinear.html @@ -890,6 +890,10 @@ document.addEventListener('click', function(e) { // Enter word mode at first word selectWord(0); } + } else if (e.key === 'p') { + e.preventDefault(); + var pdfBtn = document.querySelector('.print-btn'); + if (pdfBtn) window.location.href = pdfBtn.href; } }); })(); diff --git a/kjvstudy_org/templates/index.html b/kjvstudy_org/templates/index.html index 3d6c786..4ea72f1 100644 --- a/kjvstudy_org/templates/index.html +++ b/kjvstudy_org/templates/index.html @@ -151,24 +151,6 @@ outline-color: #6b9b7a; } -/* Study guide links */ -.study-guide-link { - padding: 0.15rem 0.4rem; - border-radius: 3px; - transition: all 0.2s; -} - -.study-guide-link.selected { - background: rgba(74, 124, 89, 0.15); - outline: 2px solid #4a7c59; - outline-offset: 2px; -} - -[data-theme="dark"] .study-guide-link.selected { - background: rgba(107, 155, 122, 0.15); - outline-color: #6b9b7a; -} - /* Daily verse link */ .daily-verse-link { padding: 0.15rem 0.4rem; @@ -477,7 +459,7 @@ {% for category, guides in study_guides.items() %}

{{ category }} — - {% for guide in guides %}{{ guide.title }}{% if not loop.last %}, {% endif %}{% endfor %}

+ {% for guide in guides %}{{ guide.title }}{% if not loop.last %}, {% endif %}{% endfor %}

{% endfor %} @@ -592,15 +574,14 @@ function handleSearch(event) { return false; } -// Combined keyboard navigation for daily verse + search + nav links + feature cards + explore links + study guides +// Combined keyboard navigation for daily verse + search + nav links + feature cards + explore links var dailyVerseLink = Array.from(document.querySelectorAll('.daily-verse-link')); var searchSection = document.getElementById('search-section'); var searchItems = searchSection ? [searchSection] : []; var navLinks = Array.from(document.querySelectorAll('.nav-links a')); var featureCards = Array.from(document.querySelectorAll('.feature-card')); var exploreLinks = Array.from(document.querySelectorAll('.explore-link')); -var studyGuideLinks = Array.from(document.querySelectorAll('.study-guide-link')); -var allCards = dailyVerseLink.concat(searchItems).concat(navLinks).concat(featureCards).concat(exploreLinks).concat(studyGuideLinks); +var allCards = dailyVerseLink.concat(searchItems).concat(navLinks).concat(featureCards).concat(exploreLinks); var selectedCardIndex = -1; function getGridColumns() { @@ -609,7 +590,6 @@ function getGridColumns() { var searchEnd = dailyVerseEnd + searchItems.length; var navLinksEnd = searchEnd + navLinks.length; var featureCardsEnd = navLinksEnd + featureCards.length; - var exploreLinksEnd = featureCardsEnd + exploreLinks.length; if (selectedCardIndex < dailyVerseEnd) { // Daily verse is a single item @@ -626,11 +606,6 @@ function getGridColumns() { return navLinks.length; } - if (selectedCardIndex >= exploreLinksEnd) { - // Study guide links - treat as single row navigation - return studyGuideLinks.length; - } - if (window.innerWidth <= 760) { // Mobile: feature cards = 1 col, explore = 2 cols return selectedCardIndex < featureCardsEnd ? 1 : 2; diff --git a/kjvstudy_org/templates/parable_detail.html b/kjvstudy_org/templates/parable_detail.html index 7321ee8..cd9af65 100644 --- a/kjvstudy_org/templates/parable_detail.html +++ b/kjvstudy_org/templates/parable_detail.html @@ -118,20 +118,21 @@