Fix speech toggle button state and font size toggle display

- Show lowercase 'a' for normal mode, uppercase 'A' for large text mode
- Fix speech button not showing stop icon while playing
- Check all speech sources (KJVResourceSpeech, KJVSpeech, speechSynthesis)
- Clear suppressSpace flag on button click to fix toggle behavior

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-12-03 21:17:31 -05:00
parent cb49f5e130
commit c861a671d2
2 changed files with 15 additions and 4 deletions
+10 -1
View File
@@ -218,6 +218,11 @@ function updateReadingPlansBadge() {
// Page speech toggle (for breadcrumb button) - triggers spacebar speech
function togglePageSpeech() {
// Clear suppressSpace flag since this is a button click, not a keyboard repeat
if (window.KJVResourceSpeech) {
window.KJVResourceSpeech.suppressSpace = false;
}
// Simulate spacebar press to use existing speech system
var event = new KeyboardEvent('keydown', { key: ' ', code: 'Space', bubbles: true });
document.dispatchEvent(event);
@@ -230,7 +235,11 @@ function updateSpeechButtonState() {
var btn = document.getElementById('speech-toggle-btn');
if (!btn) return;
if (window.KJVResourceSpeech && window.KJVResourceSpeech.speaking) {
var isSpeaking = (window.KJVResourceSpeech && window.KJVResourceSpeech.speaking) ||
(window.KJVSpeech && window.KJVSpeech.speaking) ||
('speechSynthesis' in window && (speechSynthesis.speaking || speechSynthesis.pending));
if (isSpeaking) {
btn.classList.add('speaking');
} else {
btn.classList.remove('speaking');
+5 -3
View File
@@ -403,12 +403,14 @@
}
.breadcrumb-action-btn.font-toggle {
font-size: 0.85rem;
font-weight: 700;
font-size: 0.9rem;
font-weight: 600;
text-transform: lowercase;
}
[data-font-size="large"] .breadcrumb-action-btn.font-toggle {
font-size: 1.1rem;
font-size: 0.9rem;
text-transform: uppercase;
}
.breadcrumb-action-btn.dark-toggle::before {