Improve bible reader navigation layout and alignment
- Reorganize controls into two logical rows: filters and settings - Fix alignment issues with version selector and toggle button - Center font size controls with other action buttons - Remove version count caption that caused height differences - Maintain full functionality in both normal and reading modes - Improve visual hierarchy and user experience 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -200,6 +200,20 @@ export default function BibleReaderNew() {
|
|||||||
localStorage.setItem('bibleReaderPreferences', JSON.stringify(preferences))
|
localStorage.setItem('bibleReaderPreferences', JSON.stringify(preferences))
|
||||||
}, [preferences])
|
}, [preferences])
|
||||||
|
|
||||||
|
// Handle full screen mode - add/remove CSS class to body
|
||||||
|
useEffect(() => {
|
||||||
|
if (preferences.readingMode) {
|
||||||
|
document.body.classList.add('bible-fullscreen-mode')
|
||||||
|
} else {
|
||||||
|
document.body.classList.remove('bible-fullscreen-mode')
|
||||||
|
}
|
||||||
|
|
||||||
|
// Cleanup on unmount
|
||||||
|
return () => {
|
||||||
|
document.body.classList.remove('bible-fullscreen-mode')
|
||||||
|
}
|
||||||
|
}, [preferences.readingMode])
|
||||||
|
|
||||||
// Save selected version to localStorage
|
// Save selected version to localStorage
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (selectedVersion) {
|
if (selectedVersion) {
|
||||||
@@ -602,6 +616,7 @@ export default function BibleReaderNew() {
|
|||||||
<Box
|
<Box
|
||||||
key={verse.id}
|
key={verse.id}
|
||||||
ref={(el: HTMLDivElement | null) => { if (el) verseRefs.current[verse.verseNum] = el }}
|
ref={(el: HTMLDivElement | null) => { if (el) verseRefs.current[verse.verseNum] = el }}
|
||||||
|
data-verse-container
|
||||||
sx={{
|
sx={{
|
||||||
mb: 1,
|
mb: 1,
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
@@ -674,18 +689,20 @@ export default function BibleReaderNew() {
|
|||||||
|
|
||||||
const renderNavigation = () => (
|
const renderNavigation = () => (
|
||||||
<Paper
|
<Paper
|
||||||
elevation={1}
|
elevation={preferences.readingMode ? 0 : 1}
|
||||||
sx={{
|
sx={{
|
||||||
mb: 2,
|
mb: preferences.readingMode ? 1 : 2,
|
||||||
p: 2,
|
p: preferences.readingMode ? 1 : 2,
|
||||||
...getThemeStyles(),
|
...getThemeStyles(),
|
||||||
border: `1px solid ${getThemeStyles().borderColor}`
|
border: preferences.readingMode ? 'none' : `1px solid ${getThemeStyles().borderColor}`,
|
||||||
|
backgroundColor: preferences.readingMode ? 'transparent' : getThemeStyles().backgroundColor
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Box sx={{ display: 'flex', gap: 2, flexWrap: 'wrap', alignItems: 'center', justifyContent: 'center' }}>
|
{/* First Row: Navigation Filters */}
|
||||||
|
<Box sx={{ display: 'flex', gap: 2, flexWrap: 'wrap', alignItems: 'flex-start', justifyContent: 'center', mb: 2 }}>
|
||||||
{/* Version Selection */}
|
{/* Version Selection */}
|
||||||
<Box sx={{ flex: { xs: '1 1 100%', sm: '1 1 auto' }, minWidth: { sm: 180, md: 200 } }}>
|
<Box sx={{ flex: { xs: '1 1 100%', sm: '1 1 auto' }, minWidth: { sm: 180, md: 200 } }}>
|
||||||
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1, mb: 1 }}>
|
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
|
||||||
<FormControl fullWidth size="small">
|
<FormControl fullWidth size="small">
|
||||||
<InputLabel>{t('version')}</InputLabel>
|
<InputLabel>{t('version')}</InputLabel>
|
||||||
<Select
|
<Select
|
||||||
@@ -726,9 +743,6 @@ export default function BibleReaderNew() {
|
|||||||
</IconButton>
|
</IconButton>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</Box>
|
</Box>
|
||||||
<Typography variant="caption" color="text.secondary" sx={{ fontSize: '0.7em' }}>
|
|
||||||
{showAllVersions ? `${versions.length} versions (all languages)` : `${versions.length} versions (${locale.toUpperCase()})`}
|
|
||||||
</Typography>
|
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
{/* Books Selection */}
|
{/* Books Selection */}
|
||||||
@@ -781,73 +795,67 @@ export default function BibleReaderNew() {
|
|||||||
</Select>
|
</Select>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
</Box>
|
</Box>
|
||||||
|
</Box>
|
||||||
|
|
||||||
|
{/* Second Row: Settings and Controls */}
|
||||||
|
<Box sx={{ display: 'flex', gap: 1, flexWrap: 'wrap', alignItems: 'center', justifyContent: 'center' }}>
|
||||||
{/* Font Size Controls */}
|
{/* Font Size Controls */}
|
||||||
<Box sx={{ flex: { xs: '1 1 100%', sm: '0 1 auto' }, minWidth: { sm: 150 } }}>
|
<IconButton
|
||||||
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
|
size="small"
|
||||||
<IconButton
|
onClick={() => setPreferences(prev => ({
|
||||||
size="small"
|
...prev,
|
||||||
onClick={() => setPreferences(prev => ({
|
fontSize: Math.max(12, prev.fontSize - 1)
|
||||||
...prev,
|
}))}
|
||||||
fontSize: Math.max(12, prev.fontSize - 1)
|
disabled={preferences.fontSize <= 12}
|
||||||
}))}
|
>
|
||||||
disabled={preferences.fontSize <= 12}
|
<Typography variant="h6">A⁻</Typography>
|
||||||
>
|
</IconButton>
|
||||||
<Typography variant="h6">A⁻</Typography>
|
<IconButton
|
||||||
</IconButton>
|
size="small"
|
||||||
<IconButton
|
onClick={() => setPreferences(prev => ({
|
||||||
size="small"
|
...prev,
|
||||||
onClick={() => setPreferences(prev => ({
|
fontSize: Math.min(28, prev.fontSize + 1)
|
||||||
...prev,
|
}))}
|
||||||
fontSize: Math.min(28, prev.fontSize + 1)
|
disabled={preferences.fontSize >= 28}
|
||||||
}))}
|
>
|
||||||
disabled={preferences.fontSize >= 28}
|
<Typography variant="h6">A⁺</Typography>
|
||||||
>
|
</IconButton>
|
||||||
<Typography variant="h6">A⁺</Typography>
|
|
||||||
</IconButton>
|
|
||||||
</Box>
|
|
||||||
</Box>
|
|
||||||
|
|
||||||
{/* Action Buttons */}
|
{/* Action Buttons */}
|
||||||
<Box sx={{ flex: { xs: '1 1 100%', sm: '1 1 auto' } }}>
|
<Tooltip title={t('toggleFullscreen')}>
|
||||||
<Box sx={{ display: 'flex', gap: 1, justifyContent: 'center' }}>
|
<IconButton
|
||||||
<Tooltip title={t('toggleFullscreen')}>
|
size="small"
|
||||||
<IconButton
|
onClick={() => setPreferences(prev => ({ ...prev, readingMode: !prev.readingMode }))}
|
||||||
size="small"
|
sx={{ color: preferences.readingMode ? 'primary.main' : 'inherit' }}
|
||||||
onClick={() => setPreferences(prev => ({ ...prev, readingMode: !prev.readingMode }))}
|
>
|
||||||
sx={{ color: preferences.readingMode ? 'primary.main' : 'inherit' }}
|
{preferences.readingMode ? <FullscreenExit /> : <Fullscreen />}
|
||||||
>
|
</IconButton>
|
||||||
{preferences.readingMode ? <FullscreenExit /> : <Fullscreen />}
|
</Tooltip>
|
||||||
</IconButton>
|
|
||||||
</Tooltip>
|
|
||||||
|
|
||||||
<Tooltip title={t('settings')}>
|
<Tooltip title={t('settings')}>
|
||||||
<IconButton size="small" onClick={() => setSettingsOpen(true)}>
|
<IconButton size="small" onClick={() => setSettingsOpen(true)}>
|
||||||
<Settings />
|
<Settings />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
|
||||||
{user && (
|
{user && (
|
||||||
<Tooltip title={isChapterBookmarked ? t('removeBookmark') : t('addBookmark')}>
|
<Tooltip title={isChapterBookmarked ? t('removeBookmark') : t('addBookmark')}>
|
||||||
<IconButton
|
<IconButton
|
||||||
size="small"
|
size="small"
|
||||||
onClick={handleChapterBookmark}
|
onClick={handleChapterBookmark}
|
||||||
disabled={bookmarkLoading}
|
disabled={bookmarkLoading}
|
||||||
sx={{ color: isChapterBookmarked ? 'warning.main' : 'inherit' }}
|
sx={{ color: isChapterBookmarked ? 'warning.main' : 'inherit' }}
|
||||||
>
|
>
|
||||||
{isChapterBookmarked ? <Bookmark /> : <BookmarkBorder />}
|
{isChapterBookmarked ? <Bookmark /> : <BookmarkBorder />}
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<Tooltip title={t('share')}>
|
|
||||||
<IconButton size="small" onClick={handleShare}>
|
|
||||||
<Share />
|
|
||||||
</IconButton>
|
|
||||||
</Tooltip>
|
|
||||||
</Box>
|
|
||||||
</Box>
|
|
||||||
|
|
||||||
|
<Tooltip title={t('share')}>
|
||||||
|
<IconButton size="small" onClick={handleShare}>
|
||||||
|
<Share />
|
||||||
|
</IconButton>
|
||||||
|
</Tooltip>
|
||||||
</Box>
|
</Box>
|
||||||
</Paper>
|
</Paper>
|
||||||
)
|
)
|
||||||
@@ -1012,12 +1020,12 @@ export default function BibleReaderNew() {
|
|||||||
<Container
|
<Container
|
||||||
maxWidth="lg"
|
maxWidth="lg"
|
||||||
sx={{
|
sx={{
|
||||||
py: preferences.readingMode ? 0 : 3,
|
py: preferences.readingMode ? 2 : 3,
|
||||||
px: preferences.readingMode ? 0 : 3
|
px: preferences.readingMode ? 2 : 3
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{/* Navigation Section */}
|
{/* Navigation Section - Always show but with different styling in reading mode */}
|
||||||
{!preferences.readingMode && renderNavigation()}
|
{renderNavigation()}
|
||||||
|
|
||||||
{/* Reading Content */}
|
{/* Reading Content */}
|
||||||
<Box
|
<Box
|
||||||
|
|||||||
@@ -25,4 +25,20 @@ body {
|
|||||||
|
|
||||||
.verse:hover {
|
.verse:hover {
|
||||||
background-color: rgba(255, 235, 59, 0.2);
|
background-color: rgba(255, 235, 59, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Bible Reader Full Screen Mode - Hide only site-level elements */
|
||||||
|
.bible-fullscreen-mode .MuiAppBar-root:first-child,
|
||||||
|
.bible-fullscreen-mode footer,
|
||||||
|
.bible-fullscreen-mode [data-floating-chat="true"] {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bible-fullscreen-mode {
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bible-fullscreen-mode body {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user