Skip to content

Commit 3c7bd24

Browse files
committed
Updated UI, mostly for mobile but also moved
export/import buttons into settings menu.
1 parent b3620aa commit 3c7bd24

16 files changed

Lines changed: 255 additions & 274 deletions

index.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

main.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ import {
5454
restorePanelStates,
5555
restoreSidebarState,
5656
switchNotesView,
57-
toggleNotes,
5857
togglePanelCollapse,
5958
toggleReferencePanel,
6059
toggleSection,
@@ -112,8 +111,6 @@ function setupEventListeners() {
112111
});
113112
document.getElementById('importFile')
114113
.addEventListener('change', importData);
115-
document.querySelector('.toggle-notes')
116-
.addEventListener('click', toggleNotes);
117114
document.getElementById('prevPassageBtn')
118115
.addEventListener('click', prevPassage);
119116
document.getElementById('nextPassageBtn')

modules/settings.js

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
handleError,
66
showLoading
77
} from '../main.js'
8-
import { getCurrentTranslation } from './navigation.js'
98
import { loadPassage } from './passage.js'
109
import {
1110
deletePDFFromIndexedDB,
@@ -143,20 +142,26 @@ export async function saveSettings() {
143142
}
144143
}
145144
export async function clearCache() {
146-
if (confirm('Clear all cached Bible data? This will remove offline access to previously viewed passages.')) {
147-
try {
148-
if ('serviceWorker' in navigator && navigator.serviceWorker.controller) {
149-
navigator.serviceWorker.controller.postMessage({ type: 'CLEAR_CACHE' });
150-
}
151-
const db = await openDB();
152-
const tx = db.transaction([STORE_NAME], 'readwrite');
153-
const store = tx.objectStore(STORE_NAME);
154-
await store.clear();
155-
alert('Cache cleared successfully');
156-
} catch (err) {
157-
handleError(err, 'clearCache');
158-
alert('Error clearing cache: ' + err.message);
145+
if (!confirm('Clear all cached Bible data? This will remove offline access to previously viewed passages.')) {
146+
return;
147+
}
148+
try {
149+
showLoading(true);
150+
if ('caches' in window) {
151+
const cacheNames = await caches.keys();
152+
await Promise.all(cacheNames.map(name => caches.delete(name)));
159153
}
154+
const db = await openDB();
155+
const tx = db.transaction([STORE_NAME], 'readwrite');
156+
const store = tx.objectStore(STORE_NAME);
157+
await store.clear();
158+
await tx.done;
159+
alert('Cache cleared successfully');
160+
} catch (err) {
161+
handleError(err, 'clearCache');
162+
alert('Error clearing cache: ' + err.message);
163+
} finally {
164+
showLoading(false);
160165
}
161166
}
162167
export async function deleteAllData() {
@@ -223,6 +228,12 @@ export async function deleteAllData() {
223228
if (zoomDisplay) {
224229
zoomDisplay.textContent = '100%';
225230
}
231+
const defaultParams = {
232+
translation: 'BSB',
233+
book: 'Genesis',
234+
chapter: 1
235+
};
236+
updateURL(defaultParams.translation, defaultParams.book, defaultParams.chapter);
226237
await loadPassage();
227238
clearError();
228239
closeSettings();

modules/state.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { handleError } from '../main.js'
22
import { loadPDFFromIndexedDB } from './pdf.js'
3-
export const APP_VERSION = '1.1.05.2025.11.06';
3+
export const APP_VERSION = '1.1.06.2025.11.07';
44
let saveTimeout = null;
55
const SAVE_DEBOUNCE_MS = 500;
66
export const BOOK_ORDER = [

modules/strongs.js

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { state } from './state.js'
22
import { getStepBibleUrl } from './ui.js'
3-
export function showStrongsReference(verseEl) {
3+
export function showStrongsReference(verseEl) {
44
const ref = verseEl.dataset.verse;
55
state.currentVerseElement = verseEl;
66
const textSpan = verseEl.querySelector('.verse-text');
@@ -84,7 +84,7 @@ export function showStrongsReference(verseEl) {
8484
<h3>Quick Links</h3>
8585
<div style="margin-top:15px;">
8686
<a href="https://biblehub.com/strongs.htm" target="_blank"
87-
style="color:var(--accent-color);">BibleHub Strong's Exhaustive Concordance</a><br>
87+
style="color:var(--accent-color);">BibleHub Strong's Concordance</a><br>
8888
<a href="https://netbible.org/bible/${encodeURIComponent(ref)}"
8989
target="_blank" style="color:var(--accent-color);">NET Bible (with comprehensive notes)</a><br>
9090
</div>
@@ -181,7 +181,6 @@ function populateStrongsFootnotes(verseRef) {
181181
container.innerHTML = '<p style="opacity:0.7;text-align:center;padding:20px;">No footnotes available for this verse</p>';
182182
return;
183183
}
184-
console.log('Found stored footnotes:', verseFootnotes);
185184
container.innerHTML = `
186185
<hr class="footnotes-separator">
187186
<h4 class="footnotes-heading">Footnotes</h4>
@@ -206,18 +205,6 @@ function setupStrongsFootnoteHandlers() {
206205
ref.addEventListener('click', function(e) {
207206
e.preventDefault();
208207
e.stopPropagation();
209-
const footnoteNumber = this.dataset.footnoteNumber;
210-
const footnoteElement = document.querySelector(`#strongsFootnotesContainer .footnote[data-footnote-number="${footnoteNumber}"]`);
211-
if (footnoteElement) {
212-
footnoteElement.scrollIntoView({
213-
behavior: 'smooth',
214-
block: 'nearest'
215-
});
216-
footnoteElement.style.backgroundColor = 'var(--verse-hover)';
217-
setTimeout(() => {
218-
footnoteElement.style.backgroundColor = '';
219-
}, 2000);
220-
}
221208
});
222209
});
223210
}

modules/ui.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,6 @@ export function exportNotes(ext) {
8888
document.body.removeChild(a);
8989
URL.revokeObjectURL(url);
9090
}
91-
export function toggleNotes() {
92-
document.getElementById('notesSection').classList.toggle('hidden');
93-
}
9491
export function togglePanelCollapse(panelId) {
9592
const panel = document.getElementById(panelId);
9693
const collapsed = panel.classList.contains('panel-collapsed');

src/css/responsive.css

Lines changed: 32 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -34,34 +34,27 @@
3434
}
3535
}
3636

37-
.toggle-notes {
38-
display: none;
39-
}
40-
4137
@media (max-width: 768px) {
42-
.toggle-notes {
43-
display: inline-block;
44-
}
45-
4638
.header {
4739
padding: 2px 3px;
48-
/* display: flex; */
4940
}
5041

51-
* {
52-
/* scrollbar-width: thin; */
42+
.header h1 {
43+
font-size: 1em;
5344
}
5445

5546
.toolbar {
56-
/* padding: 2px 1px; */
5747
gap: 2px;
58-
/* display: flex; */
59-
/* border-bottom: 1px solid var(--border-color); */
48+
}
49+
50+
.toolbar-info {
51+
display: none;
6052
}
6153

6254
.notes-section {
6355
padding: 4px;
6456
width: 250px;
57+
display: none;
6558
}
6659

6760
.collapse-toggle {
@@ -78,11 +71,11 @@
7871
}
7972

8073
.sidebar {
81-
padding: 10px;
74+
display: none;
8275
}
8376

8477
.btn {
85-
padding: 8px 2px;
78+
padding: 8px 8px;
8679
font-size: 14px;
8780
}
8881

@@ -99,6 +92,26 @@
9992
padding: 2px;
10093
}
10194

95+
.reference-panel-toggle {
96+
display: none;
97+
}
98+
99+
label[for="referenceVersionSetting"] {
100+
display: none;
101+
}
102+
103+
.settings-group #referenceVersionSetting {
104+
display: none;
105+
}
106+
107+
#settingsPdfUploadBtn {
108+
display: none;
109+
}
110+
111+
#customPdfInfo {
112+
display: none;
113+
}
114+
102115
.toolbar-divider {
103116
margin: 0 3px;
104117
}
@@ -109,10 +122,10 @@
109122
}
110123

111124
.highlights-modal {
112-
width: 95%;
125+
width: 90%;
113126
max-width: none;
114-
margin: 10px;
115-
padding: 20px;
127+
margin: 10px 0px;
128+
padding: 10px;
116129
}
117130

118131
.highlights-filters {

src/css/scripture.css

Lines changed: 0 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,6 @@
5656
color: var(--accent-color);
5757
}
5858

59-
/* Plan label */
60-
61-
.plan-label {
62-
font-size: 1.1rem;
63-
font-weight: 500;
64-
color: var(--accent-color);
65-
margin-top: 8px;
66-
margin-bottom: 12px;
67-
}
68-
6959
/* Verse Display & Styling */
7060

7161
.verse {
@@ -236,103 +226,6 @@
236226
border-left-color: var(--accent-color);
237227
}
238228

239-
/* Strong's Popup Footnote Styles */
240-
241-
.strongs-footnotes-container {
242-
display: block !important;
243-
max-height: 200px;
244-
overflow-y: auto;
245-
padding: 2px;
246-
background-color: var(--toolbar-background);
247-
}
248-
249-
.strongs-footnotes-container .footnotes-heading {
250-
color: var(--text-color);
251-
margin-bottom: 15px;
252-
font-size: 1.1em;
253-
font-weight: 600;
254-
}
255-
256-
.strongs-footnotes-container .footnote {
257-
margin-bottom: 12px;
258-
padding: 10px;
259-
border-radius: 4px;
260-
transition: all 0.3s ease;
261-
}
262-
263-
.strongs-footnotes-container .footnote:hover {
264-
background-color: rgba(0, 0, 0, 0.03);
265-
}
266-
267-
.strongs-footnotes-container .footnote-number {
268-
color: var(--accent-color);
269-
font-weight: bold;
270-
margin-right: 8px;
271-
font-size: 0.85em;
272-
background-color: rgba(0, 0, 0, 0.08);
273-
padding: 3px 6px;
274-
border-radius: 3px;
275-
}
276-
277-
.strongs-footnotes-container .footnote-content {
278-
color: var(--text-color);
279-
font-size: 0.9em;
280-
line-height: 1.4;
281-
opacity: 0.95;
282-
}
283-
284-
.strongs-footnotes-container .footnote-ref {
285-
color: var(--accent-color);
286-
font-size: 0.75em;
287-
vertical-align: super;
288-
cursor: pointer;
289-
margin: 0 1px;
290-
text-decoration: none;
291-
font-weight: bold;
292-
background-color: rgba(0, 0, 0, 0.08);
293-
padding: 1px 4px;
294-
border-radius: 3px;
295-
line-height: 1;
296-
transition: all 0.2s ease;
297-
}
298-
299-
.strongs-footnotes-container .footnote-ref:hover {
300-
background-color: var(--accent-color);
301-
color: white;
302-
transform: scale(1.1);
303-
}
304-
305-
#strongsFootnotesContainer .footnote {
306-
margin-bottom: 12px;
307-
padding: 10px;
308-
background-color: var(--toolbar-background);
309-
border-radius: 4px;
310-
}
311-
312-
#strongsFootnotesContainer .footnote-number {
313-
font-weight: bold;
314-
color: var(--accent-color);
315-
margin-right: 8px;
316-
}
317-
318-
#strongsFootnotesContainer .footnote-content {
319-
display: inline;
320-
}
321-
322-
#strongsPopup .footnote {
323-
cursor: pointer;
324-
transition: all 0.2s ease;
325-
}
326-
327-
#strongsPopup .footnote:hover {
328-
background-color: var(--verse-hover);
329-
}
330-
331-
#strongsPopup .footnote:hover .footnote-number {
332-
background-color: var(--accent-color);
333-
color: white;
334-
}
335-
336229
.verse-navigation {
337230
display: flex;
338231
align-items: center;

0 commit comments

Comments
 (0)