Spaces:
Running
Running
Make the purchasing button in nav bar when you click it it expendes and you choose to enter suppliers or purchases orders
Browse files- dashboard.html +41 -7
dashboard.html
CHANGED
|
@@ -32,7 +32,10 @@
|
|
| 32 |
background: rgba(59, 130, 246, 0.2);
|
| 33 |
border-left: 3px solid #3b82f6;
|
| 34 |
}
|
| 35 |
-
.
|
|
|
|
|
|
|
|
|
|
| 36 |
transition: all 0.3s ease;
|
| 37 |
}
|
| 38 |
.kpi-card:hover {
|
|
@@ -71,11 +74,26 @@
|
|
| 71 |
<i data-feather="home" class="w-4 h-4 inline mr-2"></i>
|
| 72 |
Dashboard
|
| 73 |
</a>
|
| 74 |
-
<
|
| 75 |
-
<
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
<i data-feather="truck" class="w-4 h-4 inline mr-2"></i>
|
| 80 |
Logistics
|
| 81 |
</a>
|
|
@@ -292,6 +310,16 @@
|
|
| 292 |
sidebarToggle.addEventListener('click', () => {
|
| 293 |
sidebar.classList.toggle('-translate-x-64');
|
| 294 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 295 |
|
| 296 |
// Close sidebar when clicking outside on mobile
|
| 297 |
document.addEventListener('click', (e) => {
|
|
@@ -300,7 +328,13 @@
|
|
| 300 |
!sidebarToggle.contains(e.target)) {
|
| 301 |
sidebar.classList.add('-translate-x-64');
|
| 302 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 303 |
});
|
| 304 |
-
|
| 305 |
</body>
|
| 306 |
</html>
|
|
|
|
| 32 |
background: rgba(59, 130, 246, 0.2);
|
| 33 |
border-left: 3px solid #3b82f6;
|
| 34 |
}
|
| 35 |
+
.rotate-180 {
|
| 36 |
+
transform: rotate(180deg);
|
| 37 |
+
}
|
| 38 |
+
.kpi-card {
|
| 39 |
transition: all 0.3s ease;
|
| 40 |
}
|
| 41 |
.kpi-card:hover {
|
|
|
|
| 74 |
<i data-feather="home" class="w-4 h-4 inline mr-2"></i>
|
| 75 |
Dashboard
|
| 76 |
</a>
|
| 77 |
+
<div class="relative">
|
| 78 |
+
<button class="nav-link w-full text-left px-3 py-2 text-sm rounded-lg flex items-center justify-between">
|
| 79 |
+
<span class="flex items-center">
|
| 80 |
+
<i data-feather="shopping-cart" class="w-4 h-4 inline mr-2"></i>
|
| 81 |
+
Purchasing
|
| 82 |
+
</span>
|
| 83 |
+
<i data-feather="chevron-down" class="w-4 h-4 transition-transform duration-200"></i>
|
| 84 |
+
</button>
|
| 85 |
+
<div class="mt-1 ml-6 hidden submenu">
|
| 86 |
+
<a href="#" class="nav-link block px-3 py-2 text-sm rounded-lg">
|
| 87 |
+
<i data-feather="users" class="w-4 h-4 inline mr-2"></i>
|
| 88 |
+
Suppliers
|
| 89 |
+
</a>
|
| 90 |
+
<a href="#" class="nav-link block px-3 py-2 text-sm rounded-lg">
|
| 91 |
+
<i data-feather="file-text" class="w-4 h-4 inline mr-2"></i>
|
| 92 |
+
Purchase Orders
|
| 93 |
+
</a>
|
| 94 |
+
</div>
|
| 95 |
+
</div>
|
| 96 |
+
<a href="#" class="nav-link block px-3 py-2 text-sm rounded-lg">
|
| 97 |
<i data-feather="truck" class="w-4 h-4 inline mr-2"></i>
|
| 98 |
Logistics
|
| 99 |
</a>
|
|
|
|
| 310 |
sidebarToggle.addEventListener('click', () => {
|
| 311 |
sidebar.classList.toggle('-translate-x-64');
|
| 312 |
});
|
| 313 |
+
// Toggle purchasing submenu
|
| 314 |
+
const purchasingMenu = document.querySelector('.nav-link button');
|
| 315 |
+
const submenu = document.querySelector('.submenu');
|
| 316 |
+
|
| 317 |
+
purchasingMenu.addEventListener('click', (e) => {
|
| 318 |
+
e.stopPropagation();
|
| 319 |
+
const icon = purchasingMenu.querySelector('i:last-child');
|
| 320 |
+
submenu.classList.toggle('hidden');
|
| 321 |
+
icon.classList.toggle('rotate-180');
|
| 322 |
+
});
|
| 323 |
|
| 324 |
// Close sidebar when clicking outside on mobile
|
| 325 |
document.addEventListener('click', (e) => {
|
|
|
|
| 328 |
!sidebarToggle.contains(e.target)) {
|
| 329 |
sidebar.classList.add('-translate-x-64');
|
| 330 |
}
|
| 331 |
+
|
| 332 |
+
// Close submenu if clicking outside
|
| 333 |
+
if (!purchasingMenu.contains(e.target) && !submenu.contains(e.target)) {
|
| 334 |
+
submenu.classList.add('hidden');
|
| 335 |
+
purchasingMenu.querySelector('i:last-child').classList.remove('rotate-180');
|
| 336 |
+
}
|
| 337 |
});
|
| 338 |
+
</script>
|
| 339 |
</body>
|
| 340 |
</html>
|