Files
kjvstudy.org/kjvstudy_org/templates/books.html
T
kennethreitz 7606fa8c3a Remove smooth scrolling animation from all keyboard navigation
Changed scrollIntoView behavior from 'smooth' to 'auto' across all
templates for instant, non-animated navigation between selections.

Affected ~75 instances across 50+ template files.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 00:02:24 -05:00

384 lines
11 KiB
HTML

{% extends "base.html" %}
{% block title %}Books of the Bible - KJV Study{% endblock %}
{% block description %}Browse all 66 books of the Authorized King James Version Bible{% endblock %}
{% block head %}
<style>
.book-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
gap: 1rem;
max-width: 90%;
margin: 2rem 0;
}
.book-card {
display: block;
padding: 1rem;
border: 1px solid var(--border-color);
border-radius: 4px;
transition: all 0.2s;
text-decoration: none;
color: var(--text-color);
}
.book-card:hover {
border-color: var(--border-color-darker);
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
cursor: pointer;
}
.book-card.selected {
border-color: #4a7c59;
box-shadow: 0 0 0 2px rgba(74, 124, 89, 0.3);
outline: none;
}
.book-card.selected .book-name {
color: #4a7c59;
}
[data-theme="dark"] .book-card.selected {
border-color: #6b9b7a;
box-shadow: 0 0 0 2px rgba(107, 155, 122, 0.3);
}
[data-theme="dark"] .book-card.selected .book-name {
color: #6b9b7a;
}
.book-name {
font-size: 1.2rem;
font-weight: 600;
margin-bottom: 0.25rem;
color: var(--link-color);
}
.book-card:hover .book-name {
color: var(--link-hover);
}
.book-info {
font-size: 0.9rem;
color: var(--text-secondary);
font-style: italic;
}
.testament-section {
margin: 2rem 0;
}
.testament-header {
font-size: 1.6rem;
margin-bottom: 1rem;
padding-bottom: 0.5rem;
border-bottom: 2px solid var(--border-color);
}
.intro-text {
max-width: 60%;
font-size: 1.2rem;
line-height: 1.9;
margin: 1rem 0;
}
/* Book type color coding - works in both light and dark modes */
.book-card.law {
background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(59, 130, 246, 0.03));
border-left: 3px solid rgba(59, 130, 246, 0.4);
}
.book-card.historical {
background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(34, 197, 94, 0.03));
border-left: 3px solid rgba(34, 197, 94, 0.4);
}
.book-card.wisdom {
background: linear-gradient(135deg, rgba(168, 85, 247, 0.08), rgba(168, 85, 247, 0.03));
border-left: 3px solid rgba(168, 85, 247, 0.4);
}
.book-card.major-prophets {
background: linear-gradient(135deg, rgba(249, 115, 22, 0.08), rgba(249, 115, 22, 0.03));
border-left: 3px solid rgba(249, 115, 22, 0.4);
}
.book-card.minor-prophets {
background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(239, 68, 68, 0.03));
border-left: 3px solid rgba(239, 68, 68, 0.4);
}
.book-card.gospels {
background: linear-gradient(135deg, rgba(234, 179, 8, 0.08), rgba(234, 179, 8, 0.03));
border-left: 3px solid rgba(234, 179, 8, 0.4);
}
.book-card.acts {
background: linear-gradient(135deg, rgba(20, 184, 166, 0.08), rgba(20, 184, 166, 0.03));
border-left: 3px solid rgba(20, 184, 166, 0.4);
}
.book-card.pauline {
background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(99, 102, 241, 0.03));
border-left: 3px solid rgba(99, 102, 241, 0.4);
}
.book-card.general {
background: linear-gradient(135deg, rgba(236, 72, 153, 0.08), rgba(236, 72, 153, 0.03));
border-left: 3px solid rgba(236, 72, 153, 0.4);
}
.book-card.apocalyptic {
background: linear-gradient(135deg, rgba(220, 38, 38, 0.08), rgba(220, 38, 38, 0.03));
border-left: 3px solid rgba(220, 38, 38, 0.4);
}
/* Legend styles */
.legend {
margin: 1.5rem 0 2rem 0;
padding: 1rem;
background: var(--bg-secondary);
border-radius: 4px;
border: 1px solid var(--border-color);
}
.legend-title {
font-size: 0.9rem;
font-weight: 600;
margin-bottom: 0.75rem;
color: var(--text-secondary);
text-transform: uppercase;
letter-spacing: 0.05em;
}
.legend-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
gap: 0.5rem;
}
.legend-item {
display: flex;
align-items: center;
gap: 0.5rem;
font-size: 0.85rem;
}
.legend-color {
width: 24px;
height: 24px;
border-radius: 3px;
flex-shrink: 0;
}
.legend-color.law {
background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(59, 130, 246, 0.03));
border-left: 3px solid rgba(59, 130, 246, 0.4);
}
.legend-color.historical {
background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(34, 197, 94, 0.03));
border-left: 3px solid rgba(34, 197, 94, 0.4);
}
.legend-color.wisdom {
background: linear-gradient(135deg, rgba(168, 85, 247, 0.08), rgba(168, 85, 247, 0.03));
border-left: 3px solid rgba(168, 85, 247, 0.4);
}
.legend-color.major-prophets {
background: linear-gradient(135deg, rgba(249, 115, 22, 0.08), rgba(249, 115, 22, 0.03));
border-left: 3px solid rgba(249, 115, 22, 0.4);
}
.legend-color.minor-prophets {
background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(239, 68, 68, 0.03));
border-left: 3px solid rgba(239, 68, 68, 0.4);
}
.legend-color.gospels {
background: linear-gradient(135deg, rgba(234, 179, 8, 0.08), rgba(234, 179, 8, 0.03));
border-left: 3px solid rgba(234, 179, 8, 0.4);
}
.legend-color.acts {
background: linear-gradient(135deg, rgba(20, 184, 166, 0.08), rgba(20, 184, 166, 0.03));
border-left: 3px solid rgba(20, 184, 166, 0.4);
}
.legend-color.pauline {
background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(99, 102, 241, 0.03));
border-left: 3px solid rgba(99, 102, 241, 0.4);
}
.legend-color.general {
background: linear-gradient(135deg, rgba(236, 72, 153, 0.08), rgba(236, 72, 153, 0.03));
border-left: 3px solid rgba(236, 72, 153, 0.4);
}
.legend-color.apocalyptic {
background: linear-gradient(135deg, rgba(220, 38, 38, 0.08), rgba(220, 38, 38, 0.03));
border-left: 3px solid rgba(220, 38, 38, 0.4);
}
</style>
{% endblock %}
{% block content %}
<h1>Books of the Bible</h1>
<p class="subtitle">The Authorized King James Version</p>
<section class="testament-section">
<h2 class="testament-header">Old Testament</h2>
<div class="book-grid">
{% for book in old_testament %}
{% if book.available %}
<a href="/book/{{ book.name }}" class="book-card {{ book.type }}">
<div class="book-name">{{ book.name }}</div>
<div class="book-info">{{ book.chapters }} {% if book.chapters == 1 %}chapter{% else %}chapters{% endif %}</div>
</a>
{% endif %}
{% endfor %}
</div>
</section>
<section class="testament-section">
<h2 class="testament-header">New Testament</h2>
<div class="book-grid">
{% for book in new_testament %}
{% if book.available %}
<a href="/book/{{ book.name }}" class="book-card {{ book.type }}">
<div class="book-name">{{ book.name }}</div>
<div class="book-info">{{ book.chapters }} {% if book.chapters == 1 %}chapter{% else %}chapters{% endif %}</div>
</a>
{% endif %}
{% endfor %}
</div>
</section>
<div class="legend">
<div class="legend-title">Book Categories</div>
<div class="legend-grid">
<div class="legend-item">
<div class="legend-color law"></div>
<span>Law</span>
</div>
<div class="legend-item">
<div class="legend-color historical"></div>
<span>Historical</span>
</div>
<div class="legend-item">
<div class="legend-color wisdom"></div>
<span>Wisdom</span>
</div>
<div class="legend-item">
<div class="legend-color major-prophets"></div>
<span>Major Prophets</span>
</div>
<div class="legend-item">
<div class="legend-color minor-prophets"></div>
<span>Minor Prophets</span>
</div>
<div class="legend-item">
<div class="legend-color gospels"></div>
<span>Gospels</span>
</div>
<div class="legend-item">
<div class="legend-color acts"></div>
<span>Acts</span>
</div>
<div class="legend-item">
<div class="legend-color pauline"></div>
<span>Pauline Epistles</span>
</div>
<div class="legend-item">
<div class="legend-color general"></div>
<span>General Epistles</span>
</div>
<div class="legend-item">
<div class="legend-color apocalyptic"></div>
<span>Apocalyptic</span>
</div>
</div>
</div>
<script>
(function() {
const cards = Array.from(document.querySelectorAll('.book-card'));
if (cards.length === 0) return;
let selectedIndex = -1;
function getGridColumns() {
// Detect columns based on viewport and grid settings
const grid = document.querySelector('.book-grid');
if (!grid) return 1;
const style = getComputedStyle(grid);
const cols = style.gridTemplateColumns.split(' ').length;
return cols || 1;
}
function selectCard(index) {
// Remove previous selection
if (selectedIndex >= 0 && selectedIndex < cards.length) {
cards[selectedIndex].classList.remove('selected');
}
// Update index with bounds checking
selectedIndex = Math.max(0, Math.min(index, cards.length - 1));
// Add selection to new card
cards[selectedIndex].classList.add('selected');
// Scroll into view
cards[selectedIndex].scrollIntoView({
behavior: 'auto',
block: 'center'
});
}
document.addEventListener('keydown', function(e) {
// Don't handle if user is typing in an input
if (e.target.tagName === 'INPUT' || e.target.tagName === 'TEXTAREA') return;
const cols = getGridColumns();
if (e.key === 'ArrowDown' || e.key === 'j') {
e.preventDefault();
if (selectedIndex < 0) {
selectCard(0);
} else {
selectCard(selectedIndex + cols);
}
} else if (e.key === 'ArrowUp' || e.key === 'k') {
e.preventDefault();
if (selectedIndex < 0) {
selectCard(0);
} else if (selectedIndex - cols >= 0) {
selectCard(selectedIndex - cols);
}
} else if (e.key === 'ArrowRight' || e.key === 'l') {
e.preventDefault();
if (selectedIndex < 0) {
selectCard(0);
} else {
selectCard(selectedIndex + 1);
}
} else if (e.key === 'ArrowLeft' || e.key === 'h') {
e.preventDefault();
if (selectedIndex <= 0) {
history.back();
} else {
selectCard(selectedIndex - 1);
}
} else if (e.key === 'Enter' && selectedIndex >= 0) {
e.preventDefault();
window.location.href = cards[selectedIndex].href;
}
});
// Clicks navigate normally - no interference with default link behavior
})();
</script>
{% endblock %}