-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
33 lines (27 loc) · 1.08 KB
/
index.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
const sideMenu = document.querySelector('aside');
const menuBtn = document.getElementById('menu-btn');
const closeBtn = document.getElementById('close-btn');
const darkMode = document.querySelector('.dark-mode');
menuBtn.addEventListener('click', () =>{
sideMenu.style.display = 'block';
});
closeBtn.addEventListener('click', ()=>{
sideMenu.style.display = 'none' ;
});
darkMode.addEventListener('click', ()=>{
document.body.classList.toggle('dark-mode-variables');
darkMode.querySelector('span:nth-child(1)').classList.toggle('active');
darkMode.querySelector('span:nth-child(2)').classList.toggle('active');
})
Orders.forEach(order =>{
const tr = document.createElement('tr');
const trContent = `
<td>${order.productName}</td>
<td>${order.productNumber}</td>
<td>${order.paymentStatus}</td>
<td class="${order.status === 'Declined' ? 'danger' : order.status === 'Pending' ? 'warning' : 'primary'}">${order.status}</td>
<td class="primary">Details</td>
`;
tr.innerHTML = trContent;
document.querySelector('table tbody').appendChild(tr);
});