-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
511da28
commit c88e85a
Showing
2 changed files
with
45 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Toggle Navigation Menu (for smaller screens) | ||
const toggleNav = () => { | ||
const navLinks = document.querySelector('.nav-links'); | ||
navLinks.classList.toggle('active'); | ||
}; | ||
|
||
document.addEventListener('DOMContentLoaded', () => { | ||
// Add event listener for responsive menu toggle (if applicable) | ||
const menuButton = document.querySelector('.menu-toggle'); | ||
if (menuButton) { | ||
menuButton.addEventListener('click', toggleNav); | ||
} | ||
|
||
// Simulate Progress Bar Animation for User's Group Progress | ||
const progressBars = document.querySelectorAll('.progress-bar'); | ||
progressBars.forEach((bar) => { | ||
const progress = bar.dataset.progress; | ||
bar.style.width = `${progress}%`; | ||
bar.innerText = `${progress}%`; | ||
}); | ||
|
||
// Interactive Modal for Group Chat Popup | ||
const chatButton = document.querySelector('#chat-btn'); | ||
const chatModal = document.querySelector('#chat-modal'); | ||
const closeChat = document.querySelector('#close-chat'); | ||
|
||
if (chatButton && chatModal && closeChat) { | ||
chatButton.addEventListener('click', () => { | ||
chatModal.style.display = 'block'; | ||
}); | ||
|
||
closeChat.addEventListener('click', () => { | ||
chatModal.style.display = 'none'; | ||
}); | ||
|
||
window.addEventListener('click', (e) => { | ||
if (e.target === chatModal) { | ||
chatModal.style.display = 'none'; | ||
} | ||
}); | ||
} | ||
}); |