Spaces:
Running
Running
i want app ui should exact to i atached video
Browse files- components/data-grid.js +96 -0
- dashboard.html +10 -10
- script.js +24 -1
- style.css +21 -2
components/data-grid.js
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
class DataGrid extends HTMLElement {
|
| 2 |
+
connectedCallback() {
|
| 3 |
+
this.attachShadow({ mode: 'open' });
|
| 4 |
+
this.shadowRoot.innerHTML = `
|
| 5 |
+
<style>
|
| 6 |
+
:host {
|
| 7 |
+
display: block;
|
| 8 |
+
margin: 1rem 0;
|
| 9 |
+
}
|
| 10 |
+
.grid-container {
|
| 11 |
+
overflow-x: auto;
|
| 12 |
+
}
|
| 13 |
+
table {
|
| 14 |
+
width: 100%;
|
| 15 |
+
border-collapse: collapse;
|
| 16 |
+
}
|
| 17 |
+
th, td {
|
| 18 |
+
padding: 0.75rem;
|
| 19 |
+
text-align: left;
|
| 20 |
+
border-bottom: 1px solid #e5e7eb;
|
| 21 |
+
}
|
| 22 |
+
th {
|
| 23 |
+
background-color: #f9fafb;
|
| 24 |
+
font-weight: 600;
|
| 25 |
+
color: #374151;
|
| 26 |
+
}
|
| 27 |
+
tr:hover {
|
| 28 |
+
background-color: #f3f4f6;
|
| 29 |
+
}
|
| 30 |
+
.pagination {
|
| 31 |
+
display: flex;
|
| 32 |
+
justify-content: space-between;
|
| 33 |
+
align-items: center;
|
| 34 |
+
padding: 1rem;
|
| 35 |
+
border-top: 1px solid #e5e7eb;
|
| 36 |
+
}
|
| 37 |
+
.pagination-buttons button {
|
| 38 |
+
margin: 0 0.25rem;
|
| 39 |
+
padding: 0.5rem 0.75rem;
|
| 40 |
+
border: 1px solid #d1d5db;
|
| 41 |
+
background: white;
|
| 42 |
+
border-radius: 0.375rem;
|
| 43 |
+
cursor: pointer;
|
| 44 |
+
}
|
| 45 |
+
.pagination-buttons button:hover {
|
| 46 |
+
background: #f3f4f6;
|
| 47 |
+
}
|
| 48 |
+
.pagination-buttons button[disabled] {
|
| 49 |
+
opacity: 0.5;
|
| 50 |
+
cursor: not-allowed;
|
| 51 |
+
}
|
| 52 |
+
</style>
|
| 53 |
+
<div class="grid-container">
|
| 54 |
+
<table>
|
| 55 |
+
<thead>
|
| 56 |
+
<tr>
|
| 57 |
+
<th>Date</th>
|
| 58 |
+
<th>Activity</th>
|
| 59 |
+
<th>Details</th>
|
| 60 |
+
<th>Amount</th>
|
| 61 |
+
</tr>
|
| 62 |
+
</thead>
|
| 63 |
+
<tbody>
|
| 64 |
+
<tr>
|
| 65 |
+
<td>Today, 10:30 AM</td>
|
| 66 |
+
<td>Production</td>
|
| 67 |
+
<td>9-inch Bricks (1,240 pieces)</td>
|
| 68 |
+
<td>-</td>
|
| 69 |
+
</tr>
|
| 70 |
+
<tr>
|
| 71 |
+
<td>Yesterday, 3:45 PM</td>
|
| 72 |
+
<td>Sale</td>
|
| 73 |
+
<td>To: Rajesh Construction</td>
|
| 74 |
+
<td>₹8,400</td>
|
| 75 |
+
</tr>
|
| 76 |
+
<tr>
|
| 77 |
+
<td>Yesterday, 11:20 AM</td>
|
| 78 |
+
<td>Payment</td>
|
| 79 |
+
<td>From: Gupta Builders</td>
|
| 80 |
+
<td>₹5,000</td>
|
| 81 |
+
</tr>
|
| 82 |
+
</tbody>
|
| 83 |
+
</table>
|
| 84 |
+
<div class="pagination">
|
| 85 |
+
<span class="pagination-info">Showing 1 to 3 of 3 entries</span>
|
| 86 |
+
<div class="pagination-buttons">
|
| 87 |
+
<button disabled>Previous</button>
|
| 88 |
+
<button disabled>Next</button>
|
| 89 |
+
</div>
|
| 90 |
+
</div>
|
| 91 |
+
</div>
|
| 92 |
+
`;
|
| 93 |
+
}
|
| 94 |
+
}
|
| 95 |
+
|
| 96 |
+
customElements.define('data-grid', DataGrid);
|
dashboard.html
CHANGED
|
@@ -78,26 +78,26 @@
|
|
| 78 |
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8">
|
| 79 |
<div class="bg-blue-50 p-4 rounded-lg border border-blue-100">
|
| 80 |
<h3 class="text-sm font-medium text-blue-800 mb-1">Today's Production</h3>
|
| 81 |
-
<p class="text-2xl font-bold text-blue-900">1,240</p>
|
| 82 |
-
|
| 83 |
</div>
|
| 84 |
|
| 85 |
<div class="bg-green-50 p-4 rounded-lg border border-green-100">
|
| 86 |
<h3 class="text-sm font-medium text-green-800 mb-1">Brick Stock</h3>
|
| 87 |
-
<p class="text-2xl font-bold text-green-900">5,680</p>
|
| 88 |
-
|
| 89 |
</div>
|
| 90 |
|
| 91 |
<div class="bg-purple-50 p-4 rounded-lg border border-purple-100">
|
| 92 |
<h3 class="text-sm font-medium text-purple-800 mb-1">Monthly Revenue</h3>
|
| 93 |
-
<p class="text-2xl font-bold text-purple-900">₹42,500</p>
|
| 94 |
-
|
| 95 |
</div>
|
| 96 |
|
| 97 |
<div class="bg-orange-50 p-4 rounded-lg border border-orange-100">
|
| 98 |
<h3 class="text-sm font-medium text-orange-800 mb-1">Outstanding Dues</h3>
|
| 99 |
-
<p class="text-2xl font-bold text-orange-900">₹18,300</p>
|
| 100 |
-
|
| 101 |
</div>
|
| 102 |
</div>
|
| 103 |
|
|
@@ -142,8 +142,8 @@
|
|
| 142 |
<h2 class="text-xl font-bold text-gray-800 mb-4">Recent Activity</h2>
|
| 143 |
<div class="bg-white border border-gray-200 rounded-lg overflow-hidden">
|
| 144 |
<div class="overflow-x-auto">
|
| 145 |
-
|
| 146 |
-
|
| 147 |
<tr>
|
| 148 |
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Date</th>
|
| 149 |
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Activity</th>
|
|
|
|
| 78 |
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8">
|
| 79 |
<div class="bg-blue-50 p-4 rounded-lg border border-blue-100">
|
| 80 |
<h3 class="text-sm font-medium text-blue-800 mb-1">Today's Production</h3>
|
| 81 |
+
<p class="text-2xl font-bold text-blue-900" data-stat="production">1,240</p>
|
| 82 |
+
<p class="text-xs text-blue-600">Bricks</p>
|
| 83 |
</div>
|
| 84 |
|
| 85 |
<div class="bg-green-50 p-4 rounded-lg border border-green-100">
|
| 86 |
<h3 class="text-sm font-medium text-green-800 mb-1">Brick Stock</h3>
|
| 87 |
+
<p class="text-2xl font-bold text-green-900" data-stat="inventory">5,680</p>
|
| 88 |
+
<p class="text-xs text-green-600">Pieces</p>
|
| 89 |
</div>
|
| 90 |
|
| 91 |
<div class="bg-purple-50 p-4 rounded-lg border border-purple-100">
|
| 92 |
<h3 class="text-sm font-medium text-purple-800 mb-1">Monthly Revenue</h3>
|
| 93 |
+
<p class="text-2xl font-bold text-purple-900" data-stat="revenue">₹42,500</p>
|
| 94 |
+
<p class="text-xs text-purple-600">This month</p>
|
| 95 |
</div>
|
| 96 |
|
| 97 |
<div class="bg-orange-50 p-4 rounded-lg border border-orange-100">
|
| 98 |
<h3 class="text-sm font-medium text-orange-800 mb-1">Outstanding Dues</h3>
|
| 99 |
+
<p class="text-2xl font-bold text-orange-900" data-stat="dues">₹18,300</p>
|
| 100 |
+
<p class="text-xs text-orange-600">From customers</p>
|
| 101 |
</div>
|
| 102 |
</div>
|
| 103 |
|
|
|
|
| 142 |
<h2 class="text-xl font-bold text-gray-800 mb-4">Recent Activity</h2>
|
| 143 |
<div class="bg-white border border-gray-200 rounded-lg overflow-hidden">
|
| 144 |
<div class="overflow-x-auto">
|
| 145 |
+
<data-grid></data-grid>
|
| 146 |
+
<thead class="bg-gray-50">
|
| 147 |
<tr>
|
| 148 |
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Date</th>
|
| 149 |
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Activity</th>
|
script.js
CHANGED
|
@@ -1,6 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
// Initialize app
|
| 2 |
document.addEventListener('DOMContentLoaded', function() {
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
// Check subscription status (mock function)
|
| 6 |
function checkSubscription() {
|
|
|
|
| 1 |
+
|
| 2 |
+
// Real-time data simulation
|
| 3 |
+
function simulateData() {
|
| 4 |
+
return {
|
| 5 |
+
production: Math.floor(Math.random() * 500) + 1000,
|
| 6 |
+
inventory: Math.floor(Math.random() * 2000) + 4000,
|
| 7 |
+
revenue: Math.floor(Math.random() * 30000) + 15000,
|
| 8 |
+
dues: Math.floor(Math.random() * 10000) + 8000
|
| 9 |
+
};
|
| 10 |
+
}
|
| 11 |
+
|
| 12 |
+
// Update dashboard stats in real-time
|
| 13 |
+
function updateDashboardStats() {
|
| 14 |
+
const data = simulateData();
|
| 15 |
+
document.querySelectorAll('[data-stat="production"]').forEach(el => el.textContent = data.production.toLocaleString());
|
| 16 |
+
document.querySelectorAll('[data-stat="inventory"]').forEach(el => el.textContent = data.inventory.toLocaleString());
|
| 17 |
+
document.querySelectorAll('[data-stat="revenue"]').forEach(el => `₹${data.revenue.toLocaleString()}`);
|
| 18 |
+
document.querySelectorAll('[data-stat="dues"]').forEach(el => `₹${data.dues.toLocaleString()}`);
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
// Initialize app
|
| 22 |
document.addEventListener('DOMContentLoaded', function() {
|
| 23 |
+
// Start real-time updates
|
| 24 |
+
setInterval(updateDashboardStats, 5000);
|
| 25 |
+
updateDashboardStats();
|
| 26 |
+
console.log('BrickMaster Pro initialized');
|
| 27 |
|
| 28 |
// Check subscription status (mock function)
|
| 29 |
function checkSubscription() {
|
style.css
CHANGED
|
@@ -1,10 +1,29 @@
|
|
| 1 |
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
|
| 2 |
-
|
| 3 |
body {
|
| 4 |
font-family: 'Inter', sans-serif;
|
| 5 |
-
background-color: #
|
| 6 |
}
|
| 7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
/* Custom scrollbar */
|
| 9 |
::-webkit-scrollbar {
|
| 10 |
width: 6px;
|
|
|
|
| 1 |
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
|
|
|
|
| 2 |
body {
|
| 3 |
font-family: 'Inter', sans-serif;
|
| 4 |
+
background-color: #f3f4f6;
|
| 5 |
}
|
| 6 |
|
| 7 |
+
/* Dark mode support */
|
| 8 |
+
@media (prefers-color-scheme: dark) {
|
| 9 |
+
body {
|
| 10 |
+
background-color: #111827;
|
| 11 |
+
color: #f3f4f6;
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
.bg-white {
|
| 15 |
+
background-color: #1f2937 !important;
|
| 16 |
+
color: #f3f4f6;
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
.text-gray-800 {
|
| 20 |
+
color: #e5e7eb !important;
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
.border-gray-200 {
|
| 24 |
+
border-color: #374151 !important;
|
| 25 |
+
}
|
| 26 |
+
}
|
| 27 |
/* Custom scrollbar */
|
| 28 |
::-webkit-scrollbar {
|
| 29 |
width: 6px;
|