DatPro commited on
Commit
2eb727c
·
verified ·
1 Parent(s): cf55431

Add 2 files

Browse files
Files changed (2) hide show
  1. index.html +248 -78
  2. prompts.txt +2 -1
index.html CHANGED
@@ -3,7 +3,7 @@
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>Multi-Platform Sales Management</title>
7
  <script src="https://cdn.tailwindcss.com"></script>
8
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9
  <style>
@@ -54,10 +54,124 @@
54
  font-size: 12px;
55
  font-weight: 500;
56
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  </style>
58
  </head>
59
  <body class="bg-gray-100 font-sans">
60
- <div class="flex h-screen overflow-hidden">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  <!-- Sidebar -->
62
  <div class="sidebar bg-indigo-800 text-white w-64 flex-shrink-0 flex flex-col">
63
  <div class="p-4 flex items-center justify-between border-b border-indigo-700">
@@ -75,7 +189,7 @@
75
  <div class="absolute bottom-0 right-0 w-3 h-3 bg-green-500 rounded-full border-2 border-indigo-900"></div>
76
  </div>
77
  <div>
78
- <div class="font-medium">Nguyễn Thị Mai</div>
79
  <div class="text-xs text-indigo-300">Admin</div>
80
  </div>
81
  </div>
@@ -153,7 +267,7 @@
153
  </div>
154
  </nav>
155
  <div class="p-4 border-t border-indigo-700">
156
- <a href="#" class="flex items-center space-x-3 p-2 rounded-lg text-indigo-200 hover:bg-indigo-700 hover:text-white">
157
  <i class="fas fa-sign-out-alt"></i>
158
  <span>Đăng xuất</span>
159
  </a>
@@ -187,7 +301,7 @@
187
  </div>
188
  <div class="flex items-center space-x-2">
189
  <img src="https://randomuser.me/api/portraits/women/44.jpg" alt="User" class="w-8 h-8 rounded-full">
190
- <span class="text-sm font-medium">Mai Nguyễn</span>
191
  </div>
192
  </div>
193
  </div>
@@ -455,91 +569,147 @@
455
 
456
  <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
457
  <script>
458
- // Toggle sidebar on mobile
459
- document.getElementById('sidebarToggle').addEventListener('click', function() {
460
- document.querySelector('.sidebar').classList.toggle('hidden');
 
 
 
461
  });
462
 
463
- // Sales Chart
464
- const salesCtx = document.getElementById('salesChart').getContext('2d');
465
- const salesChart = new Chart(salesCtx, {
466
- type: 'line',
467
- data: {
468
- labels: ['Tháng 1', 'Tháng 2', 'Tháng 3', 'Tháng 4', 'Tháng 5', 'Tháng 6'],
469
- datasets: [{
470
- label: 'Doanh thu',
471
- data: [12500000, 18500000, 21000000, 24500000, 28500000, 32450000],
472
- backgroundColor: 'rgba(99, 102, 241, 0.1)',
473
- borderColor: 'rgba(99, 102, 241, 1)',
474
- borderWidth: 2,
475
- tension: 0.3,
476
- fill: true
477
- }]
478
- },
479
- options: {
480
- responsive: true,
481
- maintainAspectRatio: false,
482
- plugins: {
483
- legend: {
484
- display: false
485
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
486
  },
487
- scales: {
488
- y: {
489
- beginAtZero: true,
490
- grid: {
491
- drawBorder: false
492
- },
493
- ticks: {
494
- callback: function(value) {
495
- return (value / 1000000) + 'M';
496
- }
497
  }
498
  },
499
- x: {
500
- grid: {
501
- display: false
 
 
 
 
 
 
 
 
 
 
 
 
 
502
  }
503
  }
504
  }
505
- }
506
- });
507
 
508
- // Platform Chart
509
- const platformCtx = document.getElementById('platformChart').getContext('2d');
510
- const platformChart = new Chart(platformCtx, {
511
- type: 'doughnut',
512
- data: {
513
- labels: ['Facebook', 'Shopee', 'TikTok Shop', 'Lazada'],
514
- datasets: [{
515
- data: [42, 28, 18, 12],
516
- backgroundColor: [
517
- 'rgba(59, 130, 246, 0.8)',
518
- 'rgba(124, 58, 237, 0.8)',
519
- 'rgba(22, 163, 74, 0.8)',
520
- 'rgba(249, 115, 22, 0.8)'
521
- ],
522
- borderWidth: 0
523
- }]
524
- },
525
- options: {
526
- responsive: true,
527
- maintainAspectRatio: false,
528
- plugins: {
529
- legend: {
530
- display: false
531
- }
532
  },
533
- cutout: '70%'
534
- }
535
- });
 
 
 
 
 
 
 
 
536
 
537
- // Simulate loading
538
- setTimeout(() => {
539
- document.querySelectorAll('.dashboard-card').forEach(card => {
540
- card.classList.remove('opacity-0');
541
  });
542
- }, 300);
543
  </script>
544
  <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=DatPro/sales" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
545
  </html>
 
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>SalesHub - Đăng nhập</title>
7
  <script src="https://cdn.tailwindcss.com"></script>
8
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9
  <style>
 
54
  font-size: 12px;
55
  font-weight: 500;
56
  }
57
+ .login-container {
58
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
59
+ }
60
+ .login-card {
61
+ backdrop-filter: blur(10px);
62
+ background: rgba(255, 255, 255, 0.1);
63
+ border: 1px solid rgba(255, 255, 255, 0.2);
64
+ }
65
+ .input-field {
66
+ background: rgba(255, 255, 255, 0.1);
67
+ border: 1px solid rgba(255, 255, 255, 0.2);
68
+ }
69
+ .input-field:focus {
70
+ background: rgba(255, 255, 255, 0.2);
71
+ }
72
  </style>
73
  </head>
74
  <body class="bg-gray-100 font-sans">
75
+ <!-- Login Screen (shown by default) -->
76
+ <div id="loginScreen" class="min-h-screen flex items-center justify-center login-container p-4">
77
+ <div class="login-card rounded-2xl shadow-xl overflow-hidden w-full max-w-md p-8">
78
+ <div class="text-center mb-8">
79
+ <i class="fas fa-store-alt text-5xl text-white mb-4"></i>
80
+ <h1 class="text-3xl font-bold text-white">SalesHub</h1>
81
+ <p class="text-white opacity-80 mt-2">Hệ thống quản lý bán hàng đa nền tảng</p>
82
+ </div>
83
+
84
+ <form id="loginForm" class="space-y-6">
85
+ <div>
86
+ <label for="username" class="block text-sm font-medium text-white mb-1">Tên đăng nhập</label>
87
+ <div class="relative">
88
+ <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
89
+ <i class="fas fa-user text-white opacity-70"></i>
90
+ </div>
91
+ <input type="text" id="username" name="username" required
92
+ class="input-field w-full pl-10 pr-3 py-3 rounded-lg text-white placeholder-white opacity-80 focus:outline-none focus:ring-2 focus:ring-white">
93
+ </div>
94
+ </div>
95
+
96
+ <div>
97
+ <label for="password" class="block text-sm font-medium text-white mb-1">Mật khẩu</label>
98
+ <div class="relative">
99
+ <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
100
+ <i class="fas fa-lock text-white opacity-70"></i>
101
+ </div>
102
+ <input type="password" id="password" name="password" required
103
+ class="input-field w-full pl-10 pr-3 py-3 rounded-lg text-white placeholder-white opacity-80 focus:outline-none focus:ring-2 focus:ring-white">
104
+ </div>
105
+ </div>
106
+
107
+ <div class="flex items-center justify-between">
108
+ <div class="flex items-center">
109
+ <input id="remember-me" name="remember-me" type="checkbox"
110
+ class="h-4 w-4 text-indigo-600 focus:ring-indigo-500 border-gray-300 rounded">
111
+ <label for="remember-me" class="ml-2 block text-sm text-white opacity-80">
112
+ Ghi nhớ đăng nhập
113
+ </label>
114
+ </div>
115
+
116
+ <div class="text-sm">
117
+ <a href="#" class="font-medium text-white hover:underline">
118
+ Quên mật khẩu?
119
+ </a>
120
+ </div>
121
+ </div>
122
+
123
+ <div>
124
+ <button type="submit"
125
+ class="w-full flex justify-center py-3 px-4 border border-transparent rounded-lg shadow-sm text-sm font-medium text-indigo-700 bg-white hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-white transition duration-150">
126
+ Đăng nhập
127
+ </button>
128
+ </div>
129
+ </form>
130
+
131
+ <div class="mt-6">
132
+ <div class="relative">
133
+ <div class="absolute inset-0 flex items-center">
134
+ <div class="w-full border-t border-white opacity-30"></div>
135
+ </div>
136
+ <div class="relative flex justify-center text-sm">
137
+ <span class="px-2 bg-transparent text-white opacity-80">
138
+ Hoặc đăng nhập bằng
139
+ </span>
140
+ </div>
141
+ </div>
142
+
143
+ <div class="mt-6 grid grid-cols-3 gap-3">
144
+ <div>
145
+ <a href="#" class="w-full inline-flex justify-center py-2 px-4 rounded-lg input-field text-white hover:bg-white hover:bg-opacity-10">
146
+ <i class="fab fa-facebook-f"></i>
147
+ </a>
148
+ </div>
149
+ <div>
150
+ <a href="#" class="w-full inline-flex justify-center py-2 px-4 rounded-lg input-field text-white hover:bg-white hover:bg-opacity-10">
151
+ <i class="fab fa-google"></i>
152
+ </a>
153
+ </div>
154
+ <div>
155
+ <a href="#" class="w-full inline-flex justify-center py-2 px-4 rounded-lg input-field text-white hover:bg-white hover:bg-opacity-10">
156
+ <i class="fab fa-apple"></i>
157
+ </a>
158
+ </div>
159
+ </div>
160
+ </div>
161
+
162
+ <div class="mt-6 text-center">
163
+ <p class="text-sm text-white opacity-80">
164
+ Chưa có tài khoản?
165
+ <a href="#" class="font-medium text-white hover:underline">
166
+ Đăng ký ngay
167
+ </a>
168
+ </p>
169
+ </div>
170
+ </div>
171
+ </div>
172
+
173
+ <!-- Dashboard (hidden by default) -->
174
+ <div id="dashboard" class="hidden flex h-screen overflow-hidden">
175
  <!-- Sidebar -->
176
  <div class="sidebar bg-indigo-800 text-white w-64 flex-shrink-0 flex flex-col">
177
  <div class="p-4 flex items-center justify-between border-b border-indigo-700">
 
189
  <div class="absolute bottom-0 right-0 w-3 h-3 bg-green-500 rounded-full border-2 border-indigo-900"></div>
190
  </div>
191
  <div>
192
+ <div class="font-medium" id="loggedInUsername">Nguyễn Thị Mai</div>
193
  <div class="text-xs text-indigo-300">Admin</div>
194
  </div>
195
  </div>
 
267
  </div>
268
  </nav>
269
  <div class="p-4 border-t border-indigo-700">
270
+ <a href="#" id="logoutBtn" class="flex items-center space-x-3 p-2 rounded-lg text-indigo-200 hover:bg-indigo-700 hover:text-white">
271
  <i class="fas fa-sign-out-alt"></i>
272
  <span>Đăng xuất</span>
273
  </a>
 
301
  </div>
302
  <div class="flex items-center space-x-2">
303
  <img src="https://randomuser.me/api/portraits/women/44.jpg" alt="User" class="w-8 h-8 rounded-full">
304
+ <span class="text-sm font-medium" id="headerUsername">Mai Nguyễn</span>
305
  </div>
306
  </div>
307
  </div>
 
569
 
570
  <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
571
  <script>
572
+ // Check if user is already logged in (from localStorage)
573
+ document.addEventListener('DOMContentLoaded', function() {
574
+ const loggedInUser = localStorage.getItem('loggedInUser');
575
+ if (loggedInUser) {
576
+ showDashboard(JSON.parse(loggedInUser));
577
+ }
578
  });
579
 
580
+ // Login Form Submission
581
+ document.getElementById('loginForm').addEventListener('submit', function(e) {
582
+ e.preventDefault();
583
+
584
+ const username = document.getElementById('username').value;
585
+ const password = document.getElementById('password').value;
586
+ const rememberMe = document.getElementById('remember-me').checked;
587
+
588
+ // Simple validation
589
+ if (!username || !password) {
590
+ alert('Vui lòng nhập tên đăng nhập và mật khẩu');
591
+ return;
592
+ }
593
+
594
+ // In a real app, you would send this to a server for authentication
595
+ // For demo purposes, we'll just simulate a successful login
596
+ const user = {
597
+ username: username,
598
+ fullName: username === 'admin' ? 'Nguyễn Thị Mai (Admin)' : username.charAt(0).toUpperCase() + username.slice(1) + ' Nguyễn',
599
+ role: username === 'admin' ? 'Admin' : 'User'
600
+ };
601
+
602
+ if (rememberMe) {
603
+ localStorage.setItem('loggedInUser', JSON.stringify(user));
604
+ } else {
605
+ sessionStorage.setItem('loggedInUser', JSON.stringify(user));
606
+ }
607
+
608
+ showDashboard(user);
609
+ });
610
+
611
+ // Logout Button
612
+ document.getElementById('logoutBtn').addEventListener('click', function(e) {
613
+ e.preventDefault();
614
+ localStorage.removeItem('loggedInUser');
615
+ sessionStorage.removeItem('loggedInUser');
616
+ location.reload();
617
+ });
618
+
619
+ // Show Dashboard
620
+ function showDashboard(user) {
621
+ document.getElementById('loginScreen').classList.add('hidden');
622
+ document.getElementById('dashboard').classList.remove('hidden');
623
+
624
+ // Update user info in dashboard
625
+ document.getElementById('loggedInUsername').textContent = user.fullName;
626
+ document.getElementById('headerUsername').textContent = user.fullName.split(' ')[0];
627
+
628
+ // Initialize charts
629
+ initCharts();
630
+ }
631
+
632
+ // Initialize Charts
633
+ function initCharts() {
634
+ // Sales Chart
635
+ const salesCtx = document.getElementById('salesChart').getContext('2d');
636
+ const salesChart = new Chart(salesCtx, {
637
+ type: 'line',
638
+ data: {
639
+ labels: ['Tháng 1', 'Tháng 2', 'Tháng 3', 'Tháng 4', 'Tháng 5', 'Tháng 6'],
640
+ datasets: [{
641
+ label: 'Doanh thu',
642
+ data: [12500000, 18500000, 21000000, 24500000, 28500000, 32450000],
643
+ backgroundColor: 'rgba(99, 102, 241, 0.1)',
644
+ borderColor: 'rgba(99, 102, 241, 1)',
645
+ borderWidth: 2,
646
+ tension: 0.3,
647
+ fill: true
648
+ }]
649
  },
650
+ options: {
651
+ responsive: true,
652
+ maintainAspectRatio: false,
653
+ plugins: {
654
+ legend: {
655
+ display: false
 
 
 
 
656
  }
657
  },
658
+ scales: {
659
+ y: {
660
+ beginAtZero: true,
661
+ grid: {
662
+ drawBorder: false
663
+ },
664
+ ticks: {
665
+ callback: function(value) {
666
+ return (value / 1000000) + 'M';
667
+ }
668
+ }
669
+ },
670
+ x: {
671
+ grid: {
672
+ display: false
673
+ }
674
  }
675
  }
676
  }
677
+ });
 
678
 
679
+ // Platform Chart
680
+ const platformCtx = document.getElementById('platformChart').getContext('2d');
681
+ const platformChart = new Chart(platformCtx, {
682
+ type: 'doughnut',
683
+ data: {
684
+ labels: ['Facebook', 'Shopee', 'TikTok Shop', 'Lazada'],
685
+ datasets: [{
686
+ data: [42, 28, 18, 12],
687
+ backgroundColor: [
688
+ 'rgba(59, 130, 246, 0.8)',
689
+ 'rgba(124, 58, 237, 0.8)',
690
+ 'rgba(22, 163, 74, 0.8)',
691
+ 'rgba(249, 115, 22, 0.8)'
692
+ ],
693
+ borderWidth: 0
694
+ }]
 
 
 
 
 
 
 
 
695
  },
696
+ options: {
697
+ responsive: true,
698
+ maintainAspectRatio: false,
699
+ plugins: {
700
+ legend: {
701
+ display: false
702
+ }
703
+ },
704
+ cutout: '70%'
705
+ }
706
+ });
707
 
708
+ // Toggle sidebar on mobile
709
+ document.getElementById('sidebarToggle').addEventListener('click', function() {
710
+ document.querySelector('.sidebar').classList.toggle('hidden');
 
711
  });
712
+ }
713
  </script>
714
  <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=DatPro/sales" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
715
  </html>
prompts.txt CHANGED
@@ -1 +1,2 @@
1
- tạo cho tôi một trang web quản lý bán hàng đa nền tảng
 
 
1
+ tạo cho tôi một trang web quản lý bán hàng đa nền tảng
2
+ Thêm tính năng đăng nhập