forked from LiquidGalaxyLAB/LG-GeoVisionAI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
41 lines (33 loc) · 1.09 KB
/
app.js
File metadata and controls
41 lines (33 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Utility to handle page display
function showPage(pageId) {
const pages = document.querySelectorAll('.page');
const buttons = document.querySelectorAll('.nav-btn');
pages.forEach(page => {
if (page.id === pageId) {
page.classList.add('active');
} else {
page.classList.remove('active');
}
});
buttons.forEach(btn => {
btn.classList.toggle('active', btn.id === 'btn-' + pageId);
});
}
// Attach event listeners to nav buttons
document.querySelectorAll('.nav-btn').forEach(btn => {
btn.addEventListener('click', () => {
const target = btn.id.replace('btn-', '');
showPage(target);
});
});
// Settings form behavior
const form = document.getElementById('settings-form');
const rateValue = document.getElementById('rateValue');
form.speechRate.addEventListener('input', (e) => {
rateValue.textContent = e.target.value;
});
form.addEventListener('submit', (e) => {
e.preventDefault();
// You can handle save logic here or localStorage etc.
alert('Settings saved!');
});