devlucem commited on
Commit
f5f2bc2
·
verified ·
1 Parent(s): 472de45

Add JS functionality to all buttons

Browse files
Files changed (6) hide show
  1. README.md +8 -5
  2. components/footer.js +74 -0
  3. components/navbar.js +102 -0
  4. index.html +213 -19
  5. script.js +263 -0
  6. style.css +34 -18
README.md CHANGED
@@ -1,10 +1,13 @@
1
  ---
2
- title: Cryptoflow Quantum Dashboard
3
- emoji: 🚀
4
- colorFrom: indigo
5
- colorTo: red
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
1
  ---
2
+ title: CryptoFlow Quantum Dashboard 🚀
3
+ colorFrom: blue
4
+ colorTo: yellow
5
+ emoji: 🐳
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite-v3
10
  ---
11
 
12
+ # Welcome to your new DeepSite project!
13
+ This project was created with [DeepSite](https://huggingface.co/deepsite).
components/footer.js ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ class CustomFooter extends HTMLElement {
2
+ connectedCallback() {
3
+ this.attachShadow({ mode: 'open' });
4
+ this.shadowRoot.innerHTML = `
5
+ <style>
6
+ footer {
7
+ background: white;
8
+ color: #4b5563;
9
+ padding: 2rem;
10
+ text-align: center;
11
+ margin-top: auto;
12
+ border-top: 1px solid #e5e7eb;
13
+ }
14
+ .footer-content {
15
+ max-width: 1200px;
16
+ margin: 0 auto;
17
+ display: flex;
18
+ flex-direction: column;
19
+ align-items: center;
20
+ }
21
+ .footer-links {
22
+ display: flex;
23
+ gap: 1.5rem;
24
+ margin-bottom: 1.5rem;
25
+ }
26
+ .footer-link {
27
+ color: #4b5563;
28
+ text-decoration: none;
29
+ font-size: 0.875rem;
30
+ transition: color 0.2s;
31
+ }
32
+ .footer-link:hover {
33
+ color: #1e40af;
34
+ }
35
+ .footer-copyright {
36
+ font-size: 0.875rem;
37
+ color: #6b7280;
38
+ }
39
+ .social-links {
40
+ display: flex;
41
+ gap: 1rem;
42
+ margin-top: 1.5rem;
43
+ }
44
+ .social-link {
45
+ color: #6b7280;
46
+ transition: color 0.2s;
47
+ }
48
+ .social-link:hover {
49
+ color: #3b82f6;
50
+ }
51
+ </style>
52
+ <footer>
53
+ <div class="footer-content">
54
+ <div class="footer-links">
55
+ <a href="#" class="footer-link">About</a>
56
+ <a href="#" class="footer-link">Privacy</a>
57
+ <a href="#" class="footer-link">Terms</a>
58
+ <a href="#" class="footer-link">Contact</a>
59
+ </div>
60
+ <p class="footer-copyright">&copy; ${new Date().getFullYear()} CryptoFlow Analytics. All rights reserved.</p>
61
+ <div class="social-links">
62
+ <a href="#" class="social-link"><i data-feather="twitter"></i></a>
63
+ <a href="#" class="social-link"><i data-feather="github"></i></a>
64
+ <a href="#" class="social-link"><i data-feather="linkedin"></i></a>
65
+ </div>
66
+ </div>
67
+ </footer>
68
+ <script>
69
+ feather.replace();
70
+ </script>
71
+ `;
72
+ }
73
+ }
74
+ customElements.define('custom-footer', CustomFooter);
components/navbar.js ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ class CustomNavbar extends HTMLElement {
2
+ connectedCallback() {
3
+ this.attachShadow({ mode: 'open' });
4
+ this.shadowRoot.innerHTML = `
5
+ <style>
6
+ nav {
7
+ background: white;
8
+ padding: 1rem 2rem;
9
+ display: flex;
10
+ justify-content: space-between;
11
+ align-items: center;
12
+ box-shadow: 0 1px 3px rgba(0,0,0,0.1);
13
+ position: relative;
14
+ z-index: 50;
15
+ }
16
+ .logo {
17
+ font-size: 1.25rem;
18
+ font-weight: 700;
19
+ color: #111827;
20
+ display: flex;
21
+ align-items: center;
22
+ }
23
+ .logo-icon {
24
+ color: #3b82f6;
25
+ margin-right: 0.5rem;
26
+ }
27
+ .nav-links {
28
+ display: flex;
29
+ gap: 1.5rem;
30
+ list-style: none;
31
+ margin: 0;
32
+ padding: 0;
33
+ }
34
+ .nav-link {
35
+ color: #4b5563;
36
+ text-decoration: none;
37
+ font-weight: 500;
38
+ font-size: 0.875rem;
39
+ transition: color 0.2s;
40
+ display: flex;
41
+ align-items: center;
42
+ }
43
+ .nav-link:hover {
44
+ color: #1e40af;
45
+ }
46
+ .nav-link.active {
47
+ color: #1e40af;
48
+ font-weight: 600;
49
+ }
50
+ .nav-link i {
51
+ margin-right: 0.5rem;
52
+ }
53
+ .user-menu {
54
+ display: flex;
55
+ align-items: center;
56
+ gap: 1rem;
57
+ }
58
+ .avatar {
59
+ width: 2rem;
60
+ height: 2rem;
61
+ border-radius: 9999px;
62
+ background-color: #e5e7eb;
63
+ display: flex;
64
+ align-items: center;
65
+ justify-content: center;
66
+ color: #374151;
67
+ font-weight: 600;
68
+ }
69
+ @media (max-width: 768px) {
70
+ nav {
71
+ padding: 1rem;
72
+ }
73
+ .nav-links {
74
+ display: none;
75
+ }
76
+ }
77
+ </style>
78
+ <nav>
79
+ <a href="/" class="logo">
80
+ <i data-feather="activity" class="logo-icon"></i>
81
+ CryptoFlow
82
+ </a>
83
+ <ul class="nav-links">
84
+ <li><a href="/" class="nav-link active"><i data-feather="home"></i> Dashboard</a></li>
85
+ <li><a href="#" class="nav-link"><i data-feather="dollar-sign"></i> Transactions</a></li>
86
+ <li><a href="#" class="nav-link"><i data-feather="pie-chart"></i> Analytics</a></li>
87
+ <li><a href="#" class="nav-link"><i data-feather="settings"></i> Settings</a></li>
88
+ </ul>
89
+ <div class="user-menu">
90
+ <button class="p-1 rounded-full hover:bg-gray-100">
91
+ <i data-feather="bell"></i>
92
+ </button>
93
+ <div class="avatar">JD</div>
94
+ </div>
95
+ </nav>
96
+ <script>
97
+ feather.replace();
98
+ </script>
99
+ `;
100
+ }
101
+ }
102
+ customElements.define('custom-navbar', CustomNavbar);
index.html CHANGED
@@ -1,19 +1,213 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>CryptoFlow Analytics Dashboard</title>
7
+ <link rel="stylesheet" href="style.css">
8
+ <script src="https://cdn.tailwindcss.com"></script>
9
+ <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
10
+ <script src="https://unpkg.com/feather-icons"></script>
11
+ <script src="https://cdn.jsdelivr.net/npm/vanta@latest/dist/vanta.net.min.js"></script>
12
+ </head>
13
+ <body class="bg-gray-50">
14
+ <custom-navbar></custom-navbar>
15
+
16
+ <main class="container mx-auto px-4 py-8">
17
+ <!-- Dashboard Header -->
18
+ <div class="flex flex-col md:flex-row justify-between items-start md:items-center mb-8">
19
+ <div>
20
+ <h1 class="text-3xl font-bold text-gray-800">Transaction Analytics</h1>
21
+ <p class="text-gray-600 mt-2">Visualizing crypto transaction data across networks</p>
22
+ </div>
23
+ <div class="mt-4 md:mt-0 flex space-x-2">
24
+ <div class="relative">
25
+ <select class="time-period-select appearance-none bg-white border border-gray-300 rounded-lg px-4 py-2 pr-8 focus:outline-none focus:ring-2 focus:ring-blue-500">
26
+ <option>Last 30 Days</option>
27
+ <option>Last 60 Days</option>
28
+ <option>Last 90 Days</option>
29
+ <option>All Time</option>
30
+ </select>
31
+ <i data-feather="chevron-down" class="absolute right-3 top-2.5 text-gray-500"></i>
32
+ </div>
33
+ <button class="export-btn bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg flex items-center">
34
+ <i data-feather="download" class="mr-2 w-4 h-4"></i> Export
35
+ </button>
36
+ </div>
37
+ </div>
38
+
39
+ <!-- Stats Cards -->
40
+ <div class="grid grid-cols-1 md:grid-cols-4 gap-6 mb-8">
41
+ <div class="bg-white p-6 rounded-xl shadow-sm border border-gray-100">
42
+ <div class="flex items-center justify-between">
43
+ <div>
44
+ <p class="text-gray-500">Total Transactions</p>
45
+ <h3 class="text-2xl font-bold mt-1">142</h3>
46
+ </div>
47
+ <div class="p-3 rounded-full bg-blue-50 text-blue-600">
48
+ <i data-feather="credit-card"></i>
49
+ </div>
50
+ </div>
51
+ <p class="text-green-500 text-sm mt-2 flex items-center">
52
+ <i data-feather="trending-up" class="mr-1 w-4 h-4"></i> 12.5% from last period
53
+ </p>
54
+ </div>
55
+
56
+ <div class="bg-white p-6 rounded-xl shadow-sm border border-gray-100">
57
+ <div class="flex items-center justify-between">
58
+ <div>
59
+ <p class="text-gray-500">Total Volume</p>
60
+ <h3 class="text-2xl font-bold mt-1">$1,204.87</h3>
61
+ </div>
62
+ <div class="p-3 rounded-full bg-purple-50 text-purple-600">
63
+ <i data-feather="dollar-sign"></i>
64
+ </div>
65
+ </div>
66
+ <p class="text-green-500 text-sm mt-2 flex items-center">
67
+ <i data-feather="trending-up" class="mr-1 w-4 h-4"></i> 8.3% from last period
68
+ </p>
69
+ </div>
70
+
71
+ <div class="bg-white p-6 rounded-xl shadow-sm border border-gray-100">
72
+ <div class="flex items-center justify-between">
73
+ <div>
74
+ <p class="text-gray-500">Avg. Transaction</p>
75
+ <h3 class="text-2xl font-bold mt-1">$8.49</h3>
76
+ </div>
77
+ <div class="p-3 rounded-full bg-green-50 text-green-600">
78
+ <i data-feather="activity"></i>
79
+ </div>
80
+ </div>
81
+ <p class="text-red-500 text-sm mt-2 flex items-center">
82
+ <i data-feather="trending-down" class="mr-1 w-4 h-4"></i> 2.1% from last period
83
+ </p>
84
+ </div>
85
+
86
+ <div class="bg-white p-6 rounded-xl shadow-sm border border-gray-100">
87
+ <div class="flex items-center justify-between">
88
+ <div>
89
+ <p class="text-gray-500">Success Rate</p>
90
+ <h3 class="text-2xl font-bold mt-1">100%</h3>
91
+ </div>
92
+ <div class="p-3 rounded-full bg-yellow-50 text-yellow-600">
93
+ <i data-feather="check-circle"></i>
94
+ </div>
95
+ </div>
96
+ <p class="text-green-500 text-sm mt-2 flex items-center">
97
+ <i data-feather="trending-up" class="mr-1 w-4 h-4"></i> 1.2% from last period
98
+ </p>
99
+ </div>
100
+ </div>
101
+
102
+ <!-- Main Charts -->
103
+ <div class="grid grid-cols-1 lg:grid-cols-2 gap-6 mb-8">
104
+ <!-- Volume by Network -->
105
+ <div class="bg-white p-6 rounded-xl shadow-sm border border-gray-100">
106
+ <div class="flex justify-between items-center mb-4">
107
+ <h2 class="text-lg font-semibold">Volume by Network</h2>
108
+ <div class="relative">
109
+ <select class="asset-select appearance-none bg-white border border-gray-300 rounded-lg px-3 py-1 pr-6 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500">
110
+ <option>USDC</option>
111
+ <option>ETH</option>
112
+ <option>MATIC</option>
113
+ </select>
114
+ <i data-feather="chevron-down" class="absolute right-2 top-1.5 text-gray-500 w-3 h-3"></i>
115
+ </div>
116
+ </div>
117
+ <div class="h-64">
118
+ <canvas id="networkChart"></canvas>
119
+ </div>
120
+ </div>
121
+
122
+ <!-- Transactions Over Time -->
123
+ <div class="bg-white p-6 rounded-xl shadow-sm border border-gray-100">
124
+ <div class="flex justify-between items-center mb-4">
125
+ <h2 class="text-lg font-semibold">Transactions Over Time</h2>
126
+ <div class="flex space-x-1">
127
+ <button class="px-2 py-1 text-xs bg-gray-100 rounded">Day</button>
128
+ <button class="px-2 py-1 text-xs bg-blue-600 text-white rounded">Week</button>
129
+ <button class="px-2 py-1 text-xs bg-gray-100 rounded">Month</button>
130
+ </div>
131
+ </div>
132
+ <div class="h-64">
133
+ <canvas id="timelineChart"></canvas>
134
+ </div>
135
+ </div>
136
+ </div>
137
+
138
+ <!-- Transaction Table -->
139
+ <div class="bg-white rounded-xl shadow-sm border border-gray-100 overflow-hidden mb-8">
140
+ <div class="p-4 border-b border-gray-200 flex justify-between items-center">
141
+ <h2 class="text-lg font-semibold">Recent Transactions</h2>
142
+ <div class="flex items-center space-x-2">
143
+ <div class="relative">
144
+ <i data-feather="search" class="absolute left-3 top-2 text-gray-400"></i>
145
+ <input type="text" placeholder="Search transactions..." class="pl-10 pr-4 py-1.5 border border-gray-300 rounded-lg text-sm focus:outline-none focus:ring-1 focus:ring-blue-500">
146
+ </div>
147
+ <button class="filter-btn p-1.5 rounded-lg border border-gray-300 hover:bg-gray-50">
148
+ <i data-feather="filter" class="w-4 h-4 text-gray-500"></i>
149
+ </button>
150
+ </div>
151
+ </div>
152
+ <div class="overflow-x-auto">
153
+ <table class="min-w-full divide-y divide-gray-200">
154
+ <thead class="bg-gray-50">
155
+ <tr>
156
+ <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Date</th>
157
+ <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Type</th>
158
+ <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Network</th>
159
+ <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Asset</th>
160
+ <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Amount</th>
161
+ <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
162
+ <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th>
163
+ </tr>
164
+ </thead>
165
+ <tbody class="bg-white divide-y divide-gray-200" id="transactionTableBody">
166
+ <!-- Transactions will be populated by JavaScript -->
167
+ </tbody>
168
+ </table>
169
+ </div>
170
+ <div class="px-6 py-4 border-t border-gray-200 flex items-center justify-between">
171
+ <div class="text-sm text-gray-500">
172
+ Showing <span class="font-medium">1</span> to <span class="font-medium">10</span> of <span class="font-medium">142</span> transactions
173
+ </div>
174
+ <div class="flex space-x-2">
175
+ <button class="pagination-btn px-3 py-1 border border-gray-300 rounded-md text-sm font-medium text-gray-700 bg-white hover:bg-gray-50">
176
+ Previous
177
+ </button>
178
+ <button class="pagination-btn px-3 py-1 border border-gray-300 rounded-md text-sm font-medium text-white bg-blue-600 hover:bg-blue-700">
179
+ 1
180
+ </button>
181
+ <button class="pagination-btn px-3 py-1 border border-gray-300 rounded-md text-sm font-medium text-gray-700 bg-white hover:bg-gray-50">
182
+ 2
183
+ </button>
184
+ <button class="pagination-btn px-3 py-1 border border-gray-300 rounded-md text-sm font-medium text-gray-700 bg-white hover:bg-gray-50">
185
+ Next
186
+ </button>
187
+ </div>
188
+ </div>
189
+ </div>
190
+ </main>
191
+
192
+ <custom-footer></custom-footer>
193
+
194
+ <!-- Scripts -->
195
+ <script src="components/navbar.js"></script>
196
+ <script src="components/footer.js"></script>
197
+ <script src="script.js"></script>
198
+ <script>
199
+ feather.replace();
200
+
201
+ // Vanta.js background effect
202
+ VANTA.NET({
203
+ el: "body",
204
+ color: 0x3b82f6,
205
+ backgroundColor: 0xf9fafb,
206
+ points: 12,
207
+ maxDistance: 20,
208
+ spacing: 15
209
+ });
210
+ </script>
211
+ <script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
212
+ </body>
213
+ </html>
script.js ADDED
@@ -0,0 +1,263 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ document.addEventListener('DOMContentLoaded', function() {
3
+ // Button event handlers
4
+ document.addEventListener('click', function(e) {
5
+ // Handle export button
6
+ if (e.target.closest('.export-btn')) {
7
+ alert('Exporting data... This would trigger a CSV download in a real application.');
8
+ }
9
+
10
+ // Handle filter button
11
+ if (e.target.closest('.filter-btn')) {
12
+ alert('Opening filters... This would show filter options in a real application.');
13
+ }
14
+
15
+ // Handle pagination buttons
16
+ if (e.target.closest('.pagination-btn')) {
17
+ const btn = e.target.closest('.pagination-btn');
18
+ if (!btn.classList.contains('bg-blue-600')) {
19
+ alert(`Loading page ${btn.textContent}... This would load new data in a real application.`);
20
+ }
21
+ }
22
+
23
+ // Handle time period selector
24
+ if (e.target.closest('.time-period-select')) {
25
+ const select = e.target.closest('.time-period-select');
26
+ alert(`Changed time period to ${select.value}. This would reload data with new time range in a real application.`);
27
+ }
28
+
29
+ // Handle view transaction button
30
+ if (e.target.closest('.view-btn')) {
31
+ alert('Viewing transaction details... This would open a modal in a real application.');
32
+ }
33
+
34
+ // Handle more options button
35
+ if (e.target.closest('.options-btn')) {
36
+ alert('Showing more options... This would open a dropdown menu in a real application.');
37
+ }
38
+ });
39
+
40
+ // Network selector handler
41
+ document.addEventListener('change', function(e) {
42
+ if (e.target.classList.contains('asset-select')) {
43
+ alert(`Changed asset to ${e.target.value}. This would update the chart in a real application.`);
44
+ }
45
+ });
46
+
47
+ // Sample transaction data (would be replaced with actual data in a real app)
48
+ const transactions = [
49
+ {
50
+ date: '2025-01-02 16:07:48 UTC',
51
+ type: 'Product Checkout',
52
+ product: 'Activation Upgrade',
53
+ network: 'Base',
54
+ asset: 'ETH',
55
+ amount: '$17.97',
56
+ status: 'Completed'
57
+ },
58
+ {
59
+ date: '2025-01-04 18:28:43 UTC',
60
+ type: 'Product Checkout',
61
+ product: 'Activation Upgrade',
62
+ network: 'Polygon',
63
+ asset: 'MATIC',
64
+ amount: '$5.99',
65
+ status: 'Completed'
66
+ },
67
+ {
68
+ date: '2025-01-05 07:30:34 UTC',
69
+ type: 'Product Checkout',
70
+ product: 'Activation Upgrade',
71
+ network: 'Base',
72
+ asset: 'ETH',
73
+ amount: '$17.97',
74
+ status: 'Completed'
75
+ },
76
+ {
77
+ date: '2025-01-05 13:00:08 UTC',
78
+ type: 'Product Checkout',
79
+ product: 'Activation Upgrade',
80
+ network: 'Polygon',
81
+ asset: 'USDC',
82
+ amount: '$5.99',
83
+ status: 'Completed'
84
+ },
85
+ {
86
+ date: '2025-01-06 05:21:18 UTC',
87
+ type: 'Product Checkout',
88
+ product: 'Activation Upgrade',
89
+ network: 'Polygon',
90
+ asset: 'MATIC',
91
+ amount: '$5.99',
92
+ status: 'Completed'
93
+ }
94
+ ];
95
+
96
+ // Populate transaction table
97
+ const tableBody = document.getElementById('transactionTableBody');
98
+ transactions.forEach(tx => {
99
+ const row = document.createElement('tr');
100
+
101
+ const statusClass = tx.status === 'Completed' ?
102
+ 'bg-green-100 text-green-800' :
103
+ 'bg-yellow-100 text-yellow-800';
104
+
105
+ row.innerHTML = `
106
+ <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">${formatDate(tx.date)}</td>
107
+ <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${tx.type}</td>
108
+ <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
109
+ <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-blue-100 text-blue-800">${tx.network}</span>
110
+ </td>
111
+ <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${tx.asset}</td>
112
+ <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">${tx.amount}</td>
113
+ <td class="px-6 py-4 whitespace-nowrap text-sm">
114
+ <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full ${statusClass}">${tx.status}</span>
115
+ </td>
116
+ <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
117
+ <button class="text-blue-600 hover:text-blue-900 mr-2 view-btn">
118
+ <i data-feather="eye" class="w-4 h-4"></i>
119
+ </button>
120
+ <button class="text-gray-600 hover:text-gray-900 options-btn">
121
+ <i data-feather="more-horizontal" class="w-4 h-4"></i>
122
+ </button>
123
+ </td>
124
+ `;
125
+ tableBody.appendChild(row);
126
+ });
127
+
128
+ // Initialize charts
129
+ initCharts();
130
+
131
+ // Refresh feather icons after dynamic content is added
132
+ feather.replace();
133
+ });
134
+
135
+ function formatDate(dateString) {
136
+ const date = new Date(dateString);
137
+ return date.toLocaleDateString() + ' ' + date.toLocaleTimeString([], {hour: '2-digit', minute:'2-digit'});
138
+ }
139
+
140
+ function initCharts() {
141
+ // Network Volume Chart
142
+ const networkCtx = document.getElementById('networkChart').getContext('2d');
143
+ new Chart(networkCtx, {
144
+ type: 'doughnut',
145
+ data: {
146
+ labels: ['Polygon', 'Base', 'Ethereum'],
147
+ datasets: [{
148
+ data: [856.42, 348.45, 0],
149
+ backgroundColor: [
150
+ '#8247e5',
151
+ '#0052ff',
152
+ '#627eea'
153
+ ],
154
+ borderWidth: 0
155
+ }]
156
+ },
157
+ options: {
158
+ responsive: true,
159
+ maintainAspectRatio: false,
160
+ cutout: '70%',
161
+ plugins: {
162
+ legend: {
163
+ position: 'right',
164
+ labels: {
165
+ boxWidth: 12,
166
+ padding: 20,
167
+ usePointStyle: true,
168
+ pointStyle: 'circle'
169
+ }
170
+ }
171
+ }
172
+ }
173
+ });
174
+
175
+ // Timeline Chart
176
+ const timelineCtx = document.getElementById('timelineChart').getContext('2d');
177
+ new Chart(timelineCtx, {
178
+ type: 'line',
179
+ data: {
180
+ labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct'],
181
+ datasets: [
182
+ {
183
+ label: 'Transactions',
184
+ data: [12, 19, 15, 25, 22, 18, 24, 28, 16, 20],
185
+ borderColor: '#3b82f6',
186
+ backgroundColor: 'rgba(59, 130, 246, 0.05)',
187
+ borderWidth: 2,
188
+ tension: 0.3,
189
+ fill: true,
190
+ pointBackgroundColor: '#ffffff',
191
+ pointBorderColor: '#3b82f6',
192
+ pointBorderWidth: 2,
193
+ pointRadius: 4,
194
+ pointHoverRadius: 6
195
+ },
196
+ {
197
+ label: 'Volume (USD)',
198
+ data: [85, 120, 95, 150, 130, 110, 160, 180, 105, 145],
199
+ borderColor: '#8b5cf6',
200
+ backgroundColor: 'rgba(139, 92, 246, 0.05)',
201
+ borderWidth: 2,
202
+ tension: 0.3,
203
+ fill: true,
204
+ pointBackgroundColor: '#ffffff',
205
+ pointBorderColor: '#8b5cf6',
206
+ pointBorderWidth: 2,
207
+ pointRadius: 4,
208
+ pointHoverRadius: 6
209
+ }
210
+ ]
211
+ },
212
+ options: {
213
+ responsive: true,
214
+ maintainAspectRatio: false,
215
+ scales: {
216
+ y: {
217
+ beginAtZero: true,
218
+ grid: {
219
+ drawBorder: false
220
+ }
221
+ },
222
+ x: {
223
+ grid: {
224
+ display: false
225
+ }
226
+ }
227
+ },
228
+ plugins: {
229
+ legend: {
230
+ position: 'top',
231
+ align: 'end',
232
+ labels: {
233
+ boxWidth: 12,
234
+ padding: 16,
235
+ usePointStyle: true,
236
+ pointStyle: 'circle'
237
+ }
238
+ },
239
+ tooltip: {
240
+ backgroundColor: '#1e293b',
241
+ titleFont: {
242
+ size: 14,
243
+ weight: 'bold'
244
+ },
245
+ bodyFont: {
246
+ size: 12
247
+ },
248
+ padding: 12,
249
+ usePointStyle: true,
250
+ callbacks: {
251
+ labelColor: function(context) {
252
+ return {
253
+ borderColor: 'transparent',
254
+ backgroundColor: context.dataset.borderColor,
255
+ borderRadius: 2
256
+ };
257
+ }
258
+ }
259
+ }
260
+ }
261
+ }
262
+ });
263
+ }
style.css CHANGED
@@ -1,28 +1,44 @@
 
1
  body {
2
- padding: 2rem;
3
- font-family: -apple-system, BlinkMacSystemFont, "Arial", sans-serif;
 
 
4
  }
5
 
6
- h1 {
7
- font-size: 16px;
8
- margin-top: 0;
 
9
  }
10
 
11
- p {
12
- color: rgb(107, 114, 128);
13
- font-size: 15px;
14
- margin-bottom: 10px;
15
- margin-top: 5px;
16
  }
17
 
18
- .card {
19
- max-width: 620px;
20
- margin: 0 auto;
21
- padding: 16px;
22
- border: 1px solid lightgray;
23
- border-radius: 16px;
24
  }
25
 
26
- .card p:last-child {
27
- margin-bottom: 0;
28
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Custom styles that extend Tailwind */
2
  body {
3
+ font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
4
+ min-height: 100vh;
5
+ display: flex;
6
+ flex-direction: column;
7
  }
8
 
9
+ /* Custom scrollbar */
10
+ ::-webkit-scrollbar {
11
+ width: 8px;
12
+ height: 8px;
13
  }
14
 
15
+ ::-webkit-scrollbar-track {
16
+ background: #f1f1f1;
17
+ border-radius: 10px;
 
 
18
  }
19
 
20
+ ::-webkit-scrollbar-thumb {
21
+ background: #cbd5e0;
22
+ border-radius: 10px;
 
 
 
23
  }
24
 
25
+ ::-webkit-scrollbar-thumb:hover {
26
+ background: #a0aec0;
27
  }
28
+
29
+ /* Animation for table rows */
30
+ @keyframes fadeIn {
31
+ from { opacity: 0; transform: translateY(10px); }
32
+ to { opacity: 1; transform: translateY(0); }
33
+ }
34
+
35
+ #transactionTableBody tr {
36
+ animation: fadeIn 0.3s ease-out forwards;
37
+ opacity: 0;
38
+ }
39
+
40
+ #transactionTableBody tr:nth-child(1) { animation-delay: 0.1s; }
41
+ #transactionTableBody tr:nth-child(2) { animation-delay: 0.2s; }
42
+ #transactionTableBody tr:nth-child(3) { animation-delay: 0.3s; }
43
+ #transactionTableBody tr:nth-child(4) { animation-delay: 0.4s; }
44
+ #transactionTableBody tr:nth-child(5) { animation-delay: 0.5s; }