mirror of
https://github.com/kennethreitz/kjvstudy.org.git
synced 2026-06-05 23:00:16 +00:00
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:
@@ -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');
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user