-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathscript.js
More file actions
18 lines (16 loc) · 703 Bytes
/
script.js
File metadata and controls
18 lines (16 loc) · 703 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
const toggleViewBtn = document.getElementById('toggleView');
const contentWrapper = document.getElementById('contentWrapper');
const fruitSection = document.getElementById('fruitSection');
const timersSection = document.getElementById('timersSection');
toggleViewBtn.addEventListener('click', () => {
contentWrapper.classList.toggle('slideToTimers');
if (contentWrapper.classList.contains('slideToTimers')) {
fruitSection.classList.add('hidden');
timersSection.classList.remove('hidden');
toggleViewBtn.textContent = 'Fruit Calculator';
} else {
fruitSection.classList.remove('hidden');
timersSection.classList.add('hidden');
toggleViewBtn.textContent = 'Timers';
}
});