-
+
+
Ticket Marketplace
@@ -321,21 +322,26 @@
});
}
// change icon of the dark/light mode
- const menuToggle = document.querySelector('.menu-toggle');
- const navLinks = document.querySelector('.nav-links');
- menuToggle.addEventListener('click', () => {
- navLinks.classList.toggle('active');
- menuToggle.classList.toggle('active');
- // Special effect for hamburger icon
- const bars = menuToggle.querySelectorAll('.bar');
- bars.forEach((bar, index) => {
- if (menuToggle.classList.contains('active')) {
- bar.style.transform = index === 1 ? 'scale(0)' : rotate(${index === 0 ? '45deg' : '-45deg'});
- } else {
- bar.style.transform = 'none';
- }
- });
- });
+ // Change icon of the dark/light mode
+const menuToggle = document.querySelector('.menu-toggle');
+const navLinks = document.querySelector('.nav-links');
+
+if (menuToggle && navLinks) {
+ menuToggle.addEventListener('click', () => {
+ navLinks.classList.toggle('active');
+ menuToggle.classList.toggle('active');
+
+ // Special effect for hamburger icon
+ const bars = menuToggle.querySelectorAll('.bar');
+ bars.forEach((bar, index) => {
+ if (menuToggle.classList.contains('active')) {
+ bar.style.transform = index === 1 ? 'scale(0)' : `rotate(${index === 0 ? '45deg' : '-45deg'})`;
+ } else {
+ bar.style.transform = '';
+ }
+ });
+ });
+}
// Close menu when clicking outside
document.addEventListener('click', (event) => {