-
Notifications
You must be signed in to change notification settings - Fork 0
/
scripts.js
25 lines (23 loc) · 869 Bytes
/
scripts.js
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
// scripts.js
document.addEventListener('DOMContentLoaded', function() {
showScreen('mainScreen');
document.querySelectorAll('.accordion-btn').forEach(button => {
button.addEventListener('click', () => {
const content = button.nextElementSibling;
button.classList.toggle('active');
if (button.classList.contains('active')) {
content.style.display = 'block';
} else {
content.style.display = 'none';
}
});
});
});
function showScreen(screenId) {
document.querySelectorAll('.screen').forEach(screen => {
screen.classList.remove('active');
screen.style.display = 'none';
});
document.getElementById(screenId).classList.add('active');
document.getElementById(screenId).style.display = 'block';
}