-
-
Notifications
You must be signed in to change notification settings - Fork 82
Expand file tree
/
Copy pathvocabulary.js
More file actions
43 lines (35 loc) · 1.43 KB
/
vocabulary.js
File metadata and controls
43 lines (35 loc) · 1.43 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
42
43
const exploreButton = document.querySelector('button.explore');
const explorePanel = document.querySelector('.explore-panel');
exploreButton.addEventListener('click', (event) => {
explorePanel.classList.toggle('expand');
// Toggle button text between 'View' and 'Close'
if (explorePanel.classList.contains('expand')) {
exploreButton.textContent = 'Close';
} else {
exploreButton.textContent = 'View';
}
});
const menuButton = document.querySelector('button.expand-menu');
const menuPanel = document.querySelector('.primary-menu');
menuButton.addEventListener('click', (event) => {
menuPanel.classList.toggle('expand');
// Toggle button text between 'View' and 'Close'
if (menuPanel.classList.contains('expand')) {
menuButton.textContent = 'Close';
} else {
menuButton.textContent = 'View';
}
});
const attributionButton = document.querySelector('button.expand-attribution');
const attributionPanel = document.querySelector('.attribution-panel');
if (attributionButton !== null && attributionPanel !== null) {
attributionButton.addEventListener('click', (event) => {
attributionPanel.classList.toggle('expand');
// Toggle button text between 'View' and 'Close'
if (attributionPanel.classList.contains('expand')) {
attributionButton.textContent = 'Close';
} else {
attributionButton.textContent = 'View';
}
});
}