-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscripts.js
More file actions
30 lines (25 loc) · 988 Bytes
/
scripts.js
File metadata and controls
30 lines (25 loc) · 988 Bytes
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
document.addEventListener('DOMContentLoaded', () => {
const menuToggle = document.getElementById('menu-toggle');
const dots = document.getElementById('dots');
const dropdown = document.getElementById('dropdown');
const sidebar = document.getElementById('sidebar');
const closeBtn = document.getElementById('close-btn');
menuToggle.addEventListener('click', () => {
sidebar.classList.toggle('open');
});
closeBtn.addEventListener('click', () => {
sidebar.classList.remove('open');
});
dots.addEventListener('click', () => {
dropdown.classList.toggle('show');
});
document.addEventListener('click', (event) => {
if (!dots.contains(event.target) && !dropdown.contains(event.target)) {
dropdown.classList.remove('show');
}
});
});
// async function token((req,res)){
// const token = req.headers.authorization.split(' ')[1];
// return token;
// }