-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathabout.js
41 lines (37 loc) · 1.22 KB
/
about.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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Get DOM elements
const aboutButton = document.getElementById('about-btn');
const aboutModal = document.getElementById('about-modal');
const closeAboutButton = document.getElementById('close-about');
const sidebarElement = document.getElementById('sidebar');
// Function to close sidebar
function closeSidebar() {
if (sidebarElement) {
sidebarElement.classList.add('hidden');
sidebarElement.classList.remove('active');
document.body.classList.remove('sidebar-open');
}
}
// About button click handler
if (aboutButton) {
aboutButton.addEventListener('click', () => {
// Close the sidebar first
closeSidebar();
// Then show the About modal
if (aboutModal) {
aboutModal.classList.remove('hidden');
aboutModal.classList.add('animate-fade-in');
}
});
}
// Close About modal button handler
if (closeAboutButton) {
closeAboutButton.addEventListener('click', () => {
if (aboutModal) {
aboutModal.classList.add('animate-fade-out');
setTimeout(() => {
aboutModal.classList.add('hidden');
aboutModal.classList.remove('animate-fade-out');
}, 300);
}
});
}