Files
kennethreitzandClaude Fable 5 fb0eb239e7 Bring interlinear and Strong's entry pages onto the design system
- chapter_interlinear.html: chapter-head treatment matching the reading
  page, word units as elevated lexicon cards with green glosses and
  bronze Strong's numbers, gold-ruled detail popup with small-caps
  labels, chip-style chapter navigation; removed ~110 lines of
  hardcoded dark-mode overrides now covered by shared tokens
- strongs_entry.html: framed lexicon plate hero with gilt language
  chip, gold-tick info cards, gold-spined related entries, tokenized
  occurrence cards with gilt word highlights, small-caps occurrences
  header with count pill, accent-fill primary nav button; removed all
  hardcoded dark-mode blocks

All 976 tests pass.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-07 23:11:43 -04:00

817 lines
22 KiB
HTML

{% extends "base.html" %}
{% block title %}{{ book }} {{ chapter }} - Interlinear Bible - KJV Study{% endblock %}
{% block description %}Word-by-word Hebrew/Greek interlinear text for {{ book }} chapter {{ chapter }} with Strong's numbers.{% endblock %}
{% block head %}
<style>
.interlinear-page {
max-width: 90%;
}
/* Chapter head — matches the reading page */
.chapter-head-title {
margin-top: 2.5rem;
margin-bottom: 0.75rem;
line-height: 1.1;
}
.chapter-head-title .chapter-book-name {
display: block;
font-size: 2.9rem;
letter-spacing: 0.1em;
text-transform: uppercase;
color: var(--text-strong);
}
.chapter-head-title .chapter-numeral {
display: block;
margin-top: 0.9rem;
font-size: 0.82rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.32em;
color: var(--bronze);
}
.page-header {
max-width: 100%;
margin-bottom: 1.5rem;
}
.page-header .subtitle {
color: var(--text-secondary);
font-size: 1.15rem;
margin: 0.5rem 0 0;
}
/* Chapter navigation */
.chapter-nav {
max-width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 2.5rem;
padding: 1rem 0;
border-bottom: 1px solid var(--border-color);
}
.chapter-nav a {
display: inline-block;
padding: 0.45rem 0.95rem;
font-size: 0.9rem;
color: var(--text-secondary);
background: var(--bg-elevated);
border: 1px solid var(--border-color-dark);
border-radius: 6px;
text-decoration: none;
transition: all 0.2s;
}
.chapter-nav a:hover {
color: var(--accent-strong);
border-color: var(--accent);
background: var(--accent-softer);
}
.chapter-nav-bottom {
margin-top: 2rem;
margin-bottom: 0;
border-bottom: none;
border-top: 1px solid var(--border-color);
padding-top: 1.5rem;
}
/* Verse sections */
.verse-section {
margin-bottom: 3rem;
padding-bottom: 2rem;
border-bottom: 1px solid var(--border-color);
}
.verse-section:last-child {
border-bottom: none;
}
.verse-header {
display: flex;
align-items: baseline;
gap: 1rem;
margin-bottom: 0.75rem;
}
.verse-number {
font-family: et-book-roman-old-style, et-book, Georgia, serif;
font-size: 1.15rem;
font-weight: 600;
color: var(--bronze);
min-width: 2.5rem;
}
.verse-text {
font-size: 1.5rem;
line-height: 2;
color: var(--text-strong);
font-style: italic;
flex: 1;
}
.verse-text a {
color: inherit;
text-decoration: none;
border-bottom: 1px dotted var(--underline);
}
.verse-text a:hover {
border-bottom-style: solid;
color: var(--accent-strong);
}
/* Interlinear flow */
.interlinear-flow {
line-height: 2.8;
font-size: 1rem;
margin: 1rem 0 0 0;
padding: 0.5rem 0;
}
.word-unit {
display: inline-block;
text-align: center;
margin: 0 0.05rem 0.5rem 0.05rem;
vertical-align: top;
cursor: pointer;
position: relative;
padding: 0.25rem 0.35rem;
border-radius: 6px;
transition: all 0.2s ease;
min-width: auto;
background: var(--bg-elevated);
border: 1px solid var(--border-color-dark);
}
.word-unit:hover {
border-color: var(--accent);
transform: translateY(-2px);
box-shadow: var(--shadow-soft);
}
.word-unit.expanded {
background: var(--accent-softer);
border-color: var(--accent);
transform: translateY(-2px);
box-shadow: var(--shadow-soft);
z-index: 101;
}
.word-original {
display: block;
font-size: 2rem;
font-weight: 400;
color: var(--text-strong);
margin-bottom: 0.35rem;
line-height: 1.4;
transition: color 0.2s;
letter-spacing: 0.02em;
}
/* Hebrew text (RTL) */
.word-original.hebrew {
direction: rtl;
font-family: "SBL Hebrew", "Ezra SIL", "Times New Roman", "Noto Serif Hebrew", serif;
font-size: 2.2rem;
letter-spacing: 0.04em;
}
/* Greek text */
.word-original.greek {
font-family: "SBL Greek", "Gentium Plus", "Times New Roman", "Noto Serif", serif;
font-size: 2rem;
letter-spacing: 0.03em;
}
.word-unit:hover .word-original {
color: var(--text-strong);
}
.word-english {
display: block;
font-size: 0.85rem;
color: var(--accent-strong);
font-weight: 600;
line-height: 1.3;
}
.word-strongs {
display: block;
font-size: 0.68rem;
color: var(--bronze);
letter-spacing: 0.05em;
margin-top: 0.2rem;
opacity: 0.8;
transition: opacity 0.2s;
}
.word-unit:hover .word-strongs {
opacity: 1;
}
.word-strongs a {
color: inherit;
text-decoration: none;
border-bottom: none;
}
.word-strongs a:hover {
color: var(--accent-strong);
text-decoration: underline;
}
/* Hover tooltip - full definition */
.word-tooltip {
position: absolute;
bottom: 100%;
left: 50%;
transform: translateX(-50%) translateY(-4px);
background: var(--text-strong);
color: var(--bg-color);
padding: 0.65rem 1rem;
border-radius: 6px;
font-size: 0.95rem;
white-space: normal;
max-width: 380px;
min-width: 200px;
text-align: center;
line-height: 1.5;
opacity: 0;
pointer-events: none;
transition: opacity 0.15s, transform 0.15s;
z-index: 999999999;
}
.word-tooltip::after {
content: "";
position: absolute;
top: 100%;
left: 50%;
transform: translateX(-50%);
border: 5px solid transparent;
border-top-color: var(--text-strong);
}
.word-unit:hover .word-tooltip {
opacity: 1;
transform: translateX(-50%) translateY(-8px);
}
.word-unit.expanded .word-tooltip {
opacity: 0;
}
/* Word detail popup */
.word-detail {
display: none;
position: absolute;
top: 100%;
left: 50%;
transform: translateX(-50%) translateY(8px);
background: var(--bg-elevated);
border: 1px solid var(--border-color-dark);
border-top: 2px solid var(--gold);
border-radius: 8px;
padding: 1rem 1.25rem;
min-width: 260px;
max-width: 320px;
box-shadow: var(--shadow-pop);
z-index: 100;
text-align: left;
line-height: 1.5;
opacity: 0;
transition: opacity 0.2s, transform 0.2s;
}
.word-unit.expanded .word-detail {
display: block;
opacity: 1;
transform: translateX(-50%) translateY(12px);
}
.word-detail-header {
display: flex;
align-items: center;
gap: 0.75rem;
margin-bottom: 0.75rem;
padding-bottom: 0.75rem;
border-bottom: 1px solid var(--border-color);
}
.word-detail-original {
font-size: 2.2rem;
font-weight: 400;
color: var(--text-strong);
line-height: 1.3;
}
.word-detail-original.hebrew {
direction: rtl;
font-family: "SBL Hebrew", "Ezra SIL", "Times New Roman", "Noto Serif Hebrew", serif;
font-size: 2.4rem;
}
.word-detail-original.greek {
font-family: "SBL Greek", "Gentium Plus", "Times New Roman", "Noto Serif", serif;
font-size: 2.2rem;
}
.word-detail-english {
font-size: 1rem;
color: var(--accent-strong);
font-weight: 600;
}
.word-detail-row {
display: flex;
margin-bottom: 0.35rem;
font-size: 0.85rem;
}
.word-detail-row:last-child {
margin-bottom: 0;
}
.word-detail-label {
color: var(--bronze);
font-size: 0.68rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.1em;
line-height: 1.9;
min-width: 95px;
flex-shrink: 0;
}
.word-detail-value {
color: var(--text-color);
}
.word-detail-definition {
margin-top: 0.75rem;
padding-top: 0.75rem;
border-top: 1px solid var(--border-color);
font-size: 0.85rem;
color: var(--text-secondary);
line-height: 1.6;
}
/* No interlinear message */
.no-interlinear {
color: var(--text-secondary);
font-style: italic;
font-size: 0.9rem;
margin-top: 0.5rem;
}
/* Dark mode is handled entirely by the shared design tokens in base.html. */
/* Print button */
.print-actions {
margin: 1rem 0;
}
.print-btn {
display: inline-flex;
align-items: center;
gap: 0.35rem;
padding: 0.45rem 0.9rem;
font-size: 0.9rem;
color: var(--text-secondary);
background: var(--bg-elevated);
border: 1px solid var(--border-color-dark);
border-radius: 6px;
text-decoration: none;
cursor: pointer;
transition: all 0.2s;
}
.print-btn:hover {
background: var(--accent-softer);
border-color: var(--accent);
color: var(--accent-strong);
}
.print-btn svg {
width: 16px;
height: 16px;
}
@media (max-width: 768px) {
.interlinear-page {
max-width: 100%;
}
.page-header,
.breadcrumb,
.chapter-nav {
max-width: 100%;
}
.interlinear-flow {
line-height: 4.5;
}
.word-unit {
margin: 0 0.2rem 1.5rem 0.2rem;
min-width: 50px;
padding: 0.5rem 0.6rem;
}
.word-original {
font-size: 1.8rem;
}
.word-original.hebrew {
font-size: 2rem;
}
.word-original.greek {
font-size: 1.8rem;
}
.word-tooltip {
display: none;
}
.word-detail {
position: fixed;
top: auto;
bottom: 0;
left: 0;
right: 0;
transform: none;
max-width: none;
border-radius: 16px 16px 0 0;
padding: 1.5rem;
box-shadow: 0 -4px 24px rgba(0,0,0,0.15);
}
.word-unit.expanded .word-detail {
transform: none;
}
.verse-header {
flex-direction: column;
gap: 0.5rem;
}
}
/* Print styles */
@media print {
.print-actions,
.print-btn,
.chapter-nav,
.word-tooltip,
.word-detail {
display: none !important;
}
.interlinear-page {
max-width: 100% !important;
}
.page-header {
max-width: 100% !important;
}
.verse-section {
page-break-inside: avoid;
margin-bottom: 1.5rem;
padding-bottom: 1rem;
}
.verse-header {
margin-bottom: 0.5rem;
}
.verse-text {
font-size: 1.2rem !important;
}
.interlinear-flow {
line-height: 2.2;
}
.word-unit {
margin: 0 0.1rem 0.3rem 0.1rem;
padding: 0.15rem 0.2rem;
border: none !important;
cursor: default;
}
.word-unit:hover {
background: none !important;
transform: none !important;
box-shadow: none !important;
}
.word-original {
font-size: 1.4rem !important;
}
.word-original.hebrew {
font-size: 1.5rem !important;
}
.word-original.greek {
font-size: 1.4rem !important;
}
.word-english {
font-size: 0.7rem !important;
}
.word-strongs {
font-size: 0.55rem !important;
}
}
</style>
{% endblock %}
{% block content %}
<div class="interlinear-page">
<div class="page-header">
<h1 class="chapter-head-title"><span class="chapter-book-name">{{ book }}</span> <span class="chapter-numeral">Chapter {{ chapter }} · Interlinear</span></h1>
<p class="subtitle">Word-by-word {% if is_old_testament %}Hebrew{% else %}Greek{% endif %} with Strong's numbers</p>
</div>
{% if pdf_available and pdf_url %}
<div class="print-actions">
<a href="{{ pdf_url }}" class="print-btn">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
</svg>
Download PDF
</a>
</div>
{% endif %}
<nav class="chapter-nav">
<div>
{% if chapter > 1 %}
<a href="/book/{{ book }}/chapter/{{ chapter - 1 }}/interlinear">← Chapter {{ chapter - 1 }}</a>
{% endif %}
</div>
<a href="/book/{{ book }}/chapter/{{ chapter }}">View regular chapter</a>
<div>
{% if chapter < chapters|length %}
<a href="/book/{{ book }}/chapter/{{ chapter + 1 }}/interlinear">Chapter {{ chapter + 1 }} →</a>
{% endif %}
</div>
</nav>
{% for item in verses_with_interlinear %}
<section class="verse-section" id="verse-{{ item.verse.verse }}">
<div class="verse-header">
<span class="verse-number">{{ item.verse.verse }}</span>
<span class="verse-text">{{ item.verse.text }}</span>
</div>
{% if item.interlinear_words %}
<div class="interlinear-flow">
{% for word in item.interlinear_words %}
<div class="word-unit" onclick="toggleWord(this)">
<span class="word-original {% if is_old_testament %}hebrew{% else %}greek{% endif %}">{{ word.original }}</span>
<span class="word-english">{{ word.english }}</span>
<span class="word-strongs">
{% if word.strongs %}
<a href="/strongs/{{ word.strongs }}" onclick="event.stopPropagation()">{{ word.strongs }}</a>
{% endif %}
</span>
<div class="word-detail">
<div class="word-detail-header">
<span class="word-detail-original {% if is_old_testament %}hebrew{% else %}greek{% endif %}">{{ word.original }}</span>
<span class="word-detail-english">{{ word.english }}</span>
</div>
{% if word.transliteration %}
<div class="word-detail-row">
<span class="word-detail-label">Pronunciation:</span>
<span class="word-detail-value">{{ word.transliteration }}</span>
</div>
{% endif %}
<div class="word-detail-row">
<span class="word-detail-label">Strong's:</span>
<span class="word-detail-value">
{% if word.strongs %}
<a href="/strongs/{{ word.strongs }}" style="color: var(--accent-strong);">{{ word.strongs }}</a>
{% else %}
—
{% endif %}
</span>
</div>
{% if word.parsing %}
<div class="word-detail-row">
<span class="word-detail-label">Grammar:</span>
<span class="word-detail-value">{{ word.parsing }}</span>
</div>
{% endif %}
<div class="word-detail-row">
<span class="word-detail-label">Word #:</span>
<span class="word-detail-value">{{ word.position }} of {{ item.interlinear_words|length }}</span>
</div>
{% if word.definition %}
<div class="word-detail-definition">
{{ word.definition }}
</div>
{% endif %}
</div>
</div>
{% endfor %}
</div>
{% else %}
<p class="no-interlinear">Interlinear data not available for this verse.</p>
{% endif %}
</section>
{% endfor %}
<nav class="chapter-nav chapter-nav-bottom">
<div>
{% if chapter > 1 %}
<a href="/book/{{ book }}/chapter/{{ chapter - 1 }}/interlinear">← Chapter {{ chapter - 1 }}</a>
{% endif %}
</div>
<a href="/book/{{ book }}/chapter/{{ chapter }}">View regular chapter</a>
<div>
{% if chapter < chapters|length %}
<a href="/book/{{ book }}/chapter/{{ chapter + 1 }}/interlinear">Chapter {{ chapter + 1 }} →</a>
{% endif %}
</div>
</nav>
</div>
<script>
function toggleWord(el) {
document.querySelectorAll('.word-unit.expanded').forEach(function(word) {
if (word !== el) word.classList.remove('expanded');
});
el.classList.toggle('expanded');
}
document.addEventListener('click', function(e) {
if (!e.target.closest('.word-unit')) {
document.querySelectorAll('.word-unit.expanded').forEach(function(word) {
word.classList.remove('expanded');
});
}
});
// Keyboard navigation
(function() {
const verses = Array.from(document.querySelectorAll('.verse-section'));
if (verses.length === 0) return;
let selectedVerseIndex = -1;
let selectedWordIndex = -1;
function clearWordSelection() {
document.querySelectorAll('.word-unit.expanded').forEach(function(word) {
word.classList.remove('expanded');
});
document.querySelectorAll('.word-unit.keyboard-selected').forEach(function(word) {
word.classList.remove('keyboard-selected');
word.style.outline = '';
word.style.outlineOffset = '';
});
selectedWordIndex = -1;
}
function selectVerse(index) {
// Clear previous verse selection
if (selectedVerseIndex >= 0 && selectedVerseIndex < verses.length) {
verses[selectedVerseIndex].style.outline = '';
verses[selectedVerseIndex].style.outlineOffset = '';
verses[selectedVerseIndex].classList.remove('selected');
}
clearWordSelection();
selectedVerseIndex = Math.max(0, Math.min(index, verses.length - 1));
verses[selectedVerseIndex].style.outline = '2px solid var(--accent)';
verses[selectedVerseIndex].style.outlineOffset = '4px';
verses[selectedVerseIndex].classList.add('selected');
verses[selectedVerseIndex].scrollIntoView({ behavior: 'auto', block: 'start' });
}
function getWordsInVerse(verseIndex) {
if (verseIndex < 0 || verseIndex >= verses.length) return [];
return Array.from(verses[verseIndex].querySelectorAll('.word-unit'));
}
function selectWord(index) {
const words = getWordsInVerse(selectedVerseIndex);
if (words.length === 0) return;
clearWordSelection();
selectedWordIndex = Math.max(0, Math.min(index, words.length - 1));
const word = words[selectedWordIndex];
word.classList.add('keyboard-selected');
word.style.outline = '2px solid var(--accent)';
word.style.outlineOffset = '2px';
word.scrollIntoView({ behavior: 'auto', block: 'center' });
}
function expandSelectedWord() {
const words = getWordsInVerse(selectedVerseIndex);
if (selectedWordIndex >= 0 && selectedWordIndex < words.length) {
document.querySelectorAll('.word-unit.expanded').forEach(function(word) {
if (word !== words[selectedWordIndex]) {
word.classList.remove('expanded');
}
});
toggleWord(words[selectedWordIndex]);
}
}
document.addEventListener('keydown', function(e) {
if (e.target.tagName === 'INPUT' || e.target.tagName === 'TEXTAREA') return;
if (KJVNav.sidebarActive) return;
// Check if we're in word-selection mode (a verse is selected)
const inWordMode = selectedVerseIndex >= 0 && selectedWordIndex >= 0;
if (e.key === 'Escape') {
e.preventDefault();
if (inWordMode) {
clearWordSelection();
} else if (selectedVerseIndex >= 0) {
verses[selectedVerseIndex].style.outline = '';
verses[selectedVerseIndex].style.outlineOffset = '';
verses[selectedVerseIndex].classList.remove('selected');
selectedVerseIndex = -1;
}
document.querySelectorAll('.word-unit.expanded').forEach(function(word) {
word.classList.remove('expanded');
});
} else if (e.key === 'ArrowDown' || e.key === 'j') {
e.preventDefault();
if (inWordMode) {
// Move to next verse
clearWordSelection();
selectVerse(selectedVerseIndex + 1);
} else {
selectVerse(selectedVerseIndex < 0 ? 0 : selectedVerseIndex + 1);
}
} else if (e.key === 'ArrowUp' || e.key === 'k') {
e.preventDefault();
if (inWordMode) {
// Move to previous verse
clearWordSelection();
selectVerse(selectedVerseIndex - 1);
} else if (selectedVerseIndex <= 0) {
selectVerse(0);
} else {
selectVerse(selectedVerseIndex - 1);
}
} else if (e.key === 'ArrowRight' || e.key === 'l') {
e.preventDefault();
if (selectedVerseIndex >= 0) {
// Enter word mode or move to next word
selectWord(selectedWordIndex + 1);
} else {
// Next chapter
{% if chapter < chapters|length %}
window.location.href = '/book/{{ book }}/chapter/{{ chapter + 1 }}/interlinear';
{% endif %}
}
} else if (e.key === 'ArrowLeft' || e.key === 'h') {
e.preventDefault();
if (inWordMode && selectedWordIndex > 0) {
// Move to previous word
selectWord(selectedWordIndex - 1);
} else if (inWordMode) {
// Exit word mode
clearWordSelection();
} else {
// Previous chapter or go back
{% if chapter > 1 %}
window.location.href = '/book/{{ book }}/chapter/{{ chapter - 1 }}/interlinear';
{% else %}
history.back();
{% endif %}
}
} else if (e.key === 'Enter') {
e.preventDefault();
if (selectedWordIndex >= 0) {
expandSelectedWord();
} else if (selectedVerseIndex >= 0) {
// 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;
}
});
})();
</script>
{% endblock %}