Spaces:
Running
Running
ช่วยออกแบบและทำ Dashboard Report ยอดขายของสินค้าทุกตัว ตามนี้ทีข้อมูลการขายรายปีดังนี้
Browse filesคำสั่งดร๊อปชิบ ราคารวม ราคา COD จำนวนกล่อง ARA B4U BC BS CCT CF JBC Cream FOAM PUFF1 PUFF2 LIP LST SR SS XD LS LZ M5 MYS PHK SF Lotion Vs COFFEE WHEY JAI1 JAI2
13996 229007935 0 222273 7297 5914 1484 40572 0 3096 3875 541 2342 160 138 2029 15 533 737 6301 19148 19638 10719 90 24604 1101 1331 10228 53465 0 3663 3252
- README.md +8 -5
- components/footer.js +231 -0
- components/navbar.js +165 -0
- index.html +184 -19
- script.js +252 -0
- style.css +115 -19
README.md
CHANGED
|
@@ -1,10 +1,13 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: SalesFlow Dashboard 📊
|
| 3 |
+
colorFrom: purple
|
| 4 |
+
colorTo: red
|
| 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,231 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
class CustomFooter extends HTMLElement {
|
| 2 |
+
connectedCallback() {
|
| 3 |
+
this.attachShadow({ mode: 'open' });
|
| 4 |
+
this.shadowRoot.innerHTML = `
|
| 5 |
+
<style>
|
| 6 |
+
* {
|
| 7 |
+
box-sizing: border-box;
|
| 8 |
+
margin: 0;
|
| 9 |
+
padding: 0;
|
| 10 |
+
}
|
| 11 |
+
|
| 12 |
+
footer {
|
| 13 |
+
background: #1f2937;
|
| 14 |
+
color: white;
|
| 15 |
+
margin-top: 4rem;
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
.footer-container {
|
| 19 |
+
max-width: 1280px;
|
| 20 |
+
margin: 0 auto;
|
| 21 |
+
padding: 3rem 2rem 1.5rem;
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
.footer-content {
|
| 25 |
+
display: grid;
|
| 26 |
+
grid-template-columns: 2fr 1fr 1fr 1fr;
|
| 27 |
+
gap: 3rem;
|
| 28 |
+
margin-bottom: 2rem;
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
.footer-brand {
|
| 32 |
+
display: flex;
|
| 33 |
+
flex-direction: column;
|
| 34 |
+
gap: 1rem;
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
.brand-name {
|
| 38 |
+
display: flex;
|
| 39 |
+
align-items: center;
|
| 40 |
+
gap: 0.75rem;
|
| 41 |
+
font-size: 1.5rem;
|
| 42 |
+
font-weight: 700;
|
| 43 |
+
color: white;
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
.brand-description {
|
| 47 |
+
color: #9ca3af;
|
| 48 |
+
line-height: 1.6;
|
| 49 |
+
max-width: 350px;
|
| 50 |
+
}
|
| 51 |
+
|
| 52 |
+
.social-links {
|
| 53 |
+
display: flex;
|
| 54 |
+
gap: 0.75rem;
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
.social-link {
|
| 58 |
+
background: rgba(255, 255, 255, 0.1);
|
| 59 |
+
width: 40px;
|
| 60 |
+
height: 40px;
|
| 61 |
+
border-radius: 0.5rem;
|
| 62 |
+
display: flex;
|
| 63 |
+
align-items: center;
|
| 64 |
+
justify-content: center;
|
| 65 |
+
color: white;
|
| 66 |
+
text-decoration: none;
|
| 67 |
+
transition: background 0.2s;
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
.social-link:hover {
|
| 71 |
+
background: rgba(255, 255, 255, 0.2);
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
.footer-section h3 {
|
| 75 |
+
font-size: 1rem;
|
| 76 |
+
font-weight: 600;
|
| 77 |
+
margin-bottom: 1rem;
|
| 78 |
+
color: white;
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
.footer-links {
|
| 82 |
+
list-style: none;
|
| 83 |
+
display: flex;
|
| 84 |
+
flex-direction: column;
|
| 85 |
+
gap: 0.75rem;
|
| 86 |
+
}
|
| 87 |
+
|
| 88 |
+
.footer-links a {
|
| 89 |
+
color: #9ca3af;
|
| 90 |
+
text-decoration: none;
|
| 91 |
+
font-size: 0.875rem;
|
| 92 |
+
transition: color 0.2s;
|
| 93 |
+
}
|
| 94 |
+
|
| 95 |
+
.footer-links a:hover {
|
| 96 |
+
color: white;
|
| 97 |
+
}
|
| 98 |
+
|
| 99 |
+
.footer-bottom {
|
| 100 |
+
border-top: 1px solid #374151;
|
| 101 |
+
padding-top: 1.5rem;
|
| 102 |
+
display: flex;
|
| 103 |
+
justify-content: space-between;
|
| 104 |
+
align-items: center;
|
| 105 |
+
flex-wrap: wrap;
|
| 106 |
+
gap: 1rem;
|
| 107 |
+
}
|
| 108 |
+
|
| 109 |
+
.copyright {
|
| 110 |
+
color: #9ca3af;
|
| 111 |
+
font-size: 0.875rem;
|
| 112 |
+
}
|
| 113 |
+
|
| 114 |
+
.footer-bottom-links {
|
| 115 |
+
display: flex;
|
| 116 |
+
gap: 1.5rem;
|
| 117 |
+
list-style: none;
|
| 118 |
+
}
|
| 119 |
+
|
| 120 |
+
.footer-bottom-links a {
|
| 121 |
+
color: #9ca3af;
|
| 122 |
+
text-decoration: none;
|
| 123 |
+
font-size: 0.875rem;
|
| 124 |
+
transition: color 0.2s;
|
| 125 |
+
}
|
| 126 |
+
|
| 127 |
+
.footer-bottom-links a:hover {
|
| 128 |
+
color: white;
|
| 129 |
+
}
|
| 130 |
+
|
| 131 |
+
@media (max-width: 768px) {
|
| 132 |
+
.footer-content {
|
| 133 |
+
grid-template-columns: 1fr;
|
| 134 |
+
gap: 2rem;
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
.footer-container {
|
| 138 |
+
padding: 2rem 1rem 1rem;
|
| 139 |
+
}
|
| 140 |
+
|
| 141 |
+
.footer-bottom {
|
| 142 |
+
flex-direction: column;
|
| 143 |
+
text-align: center;
|
| 144 |
+
}
|
| 145 |
+
}
|
| 146 |
+
</style>
|
| 147 |
+
<footer>
|
| 148 |
+
<div class="footer-container">
|
| 149 |
+
<div class="footer-content">
|
| 150 |
+
<div class="footer-brand">
|
| 151 |
+
<div class="brand-name">
|
| 152 |
+
<i data-feather="trending-up" style="width: 32px; height: 32px;"></i>
|
| 153 |
+
SalesFlow
|
| 154 |
+
</div>
|
| 155 |
+
<p class="brand-description">
|
| 156 |
+
ระบบวิเคราะห์และรายงานยอดขายที่ช่วยให้คุณติดตามธุรกิจได้อย่างมีประสิทธิภาพ
|
| 157 |
+
</p>
|
| 158 |
+
<div class="social-links">
|
| 159 |
+
<a href="#" class="social-link">
|
| 160 |
+
<i data-feather="facebook"></i>
|
| 161 |
+
</a>
|
| 162 |
+
<a href="#" class="social-link">
|
| 163 |
+
<i data-feather="twitter"></i>
|
| 164 |
+
</a>
|
| 165 |
+
<a href="#" class="social-link">
|
| 166 |
+
<i data-feather="linkedin"></i>
|
| 167 |
+
</a>
|
| 168 |
+
<a href="#" class="social-link">
|
| 169 |
+
<i data-feather="instagram"></i>
|
| 170 |
+
</a>
|
| 171 |
+
</div>
|
| 172 |
+
</div>
|
| 173 |
+
|
| 174 |
+
<div class="footer-section">
|
| 175 |
+
<h3>ผลิตภัณฑ์</h3>
|
| 176 |
+
<ul class="footer-links">
|
| 177 |
+
<li><a href="#">แดชบอร์ด</a></li>
|
| 178 |
+
<li><a href="#">รายงาน</a></li>
|
| 179 |
+
<li><a href="#">การวิเคราะห์</a></li>
|
| 180 |
+
<li><a href="#">การส่งออกข้อมูล</a></li>
|
| 181 |
+
</ul>
|
| 182 |
+
</div>
|
| 183 |
+
|
| 184 |
+
<div class="footer-section">
|
| 185 |
+
<h3>บริษัท</h3>
|
| 186 |
+
<ul class="footer-links">
|
| 187 |
+
<li><a href="#">เกี่ยวกับเรา</a></li>
|
| 188 |
+
<li><a href="#">ทีมงาน</a></li>
|
| 189 |
+
<li><a href="#">อาชีพ</a></li>
|
| 190 |
+
<li><a href="#">ติดต่อเรา</a></li>
|
| 191 |
+
</ul>
|
| 192 |
+
</div>
|
| 193 |
+
|
| 194 |
+
<div class="footer-section">
|
| 195 |
+
<h3>สนับสนุน</h3>
|
| 196 |
+
<ul class="footer-links">
|
| 197 |
+
<li><a href="#">ศูนย์ช่วยเหลือ</a></li>
|
| 198 |
+
<li><a href="#">เอกสาร</a></li>
|
| 199 |
+
<li><a href="#">คู่มือการใช้</a></li>
|
| 200 |
+
<li><a href="#">อัปเดต</a></li>
|
| 201 |
+
</ul>
|
| 202 |
+
</div>
|
| 203 |
+
</div>
|
| 204 |
+
|
| 205 |
+
<div class="footer-bottom">
|
| 206 |
+
<p class="copyright">
|
| 207 |
+
© 2024 SalesFlow. สงวนลิขสิทธิ์
|
| 208 |
+
</p>
|
| 209 |
+
<ul class="footer-bottom-links">
|
| 210 |
+
<li><a href="#">นโยบายความเป็นส่วนตัว</a></li>
|
| 211 |
+
<li><a href="#">เงื่อนไขการใช้งาน</a></li>
|
| 212 |
+
<li><a href="#">คุกกี้</a></li>
|
| 213 |
+
</ul>
|
| 214 |
+
</div>
|
| 215 |
+
</div>
|
| 216 |
+
</footer>
|
| 217 |
+
`;
|
| 218 |
+
|
| 219 |
+
// Initialize Feather Icons inside Shadow DOM
|
| 220 |
+
const icons = this.shadowRoot.querySelectorAll('[data-feather]');
|
| 221 |
+
icons.forEach(icon => {
|
| 222 |
+
const iconName = icon.getAttribute('data-feather');
|
| 223 |
+
icon.outerHTML = feather.icons[iconName].toSvg({
|
| 224 |
+
width: 20,
|
| 225 |
+
height: 20
|
| 226 |
+
});
|
| 227 |
+
});
|
| 228 |
+
}
|
| 229 |
+
}
|
| 230 |
+
|
| 231 |
+
customElements.define('custom-footer', CustomFooter);
|
components/navbar.js
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
class CustomNavbar extends HTMLElement {
|
| 2 |
+
connectedCallback() {
|
| 3 |
+
this.attachShadow({ mode: 'open' });
|
| 4 |
+
this.shadowRoot.innerHTML = `
|
| 5 |
+
<style>
|
| 6 |
+
* {
|
| 7 |
+
box-sizing: border-box;
|
| 8 |
+
margin: 0;
|
| 9 |
+
padding: 0;
|
| 10 |
+
}
|
| 11 |
+
|
| 12 |
+
nav {
|
| 13 |
+
background: linear-gradient(135deg, #10b981 0%, #059669 100%);
|
| 14 |
+
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
.nav-container {
|
| 18 |
+
max-width: 1280px;
|
| 19 |
+
margin: 0 auto;
|
| 20 |
+
padding: 1rem 2rem;
|
| 21 |
+
display: flex;
|
| 22 |
+
justify-content: space-between;
|
| 23 |
+
align-items: center;
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
.logo {
|
| 27 |
+
display: flex;
|
| 28 |
+
align-items: center;
|
| 29 |
+
gap: 0.75rem;
|
| 30 |
+
color: white;
|
| 31 |
+
font-size: 1.25rem;
|
| 32 |
+
font-weight: 700;
|
| 33 |
+
text-decoration: none;
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
.nav-menu {
|
| 37 |
+
display: flex;
|
| 38 |
+
gap: 2rem;
|
| 39 |
+
list-style: none;
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
.nav-link {
|
| 43 |
+
color: rgba(255, 255, 255, 0.9);
|
| 44 |
+
text-decoration: none;
|
| 45 |
+
font-size: 0.95rem;
|
| 46 |
+
font-weight: 500;
|
| 47 |
+
padding: 0.5rem 0;
|
| 48 |
+
transition: color 0.2s;
|
| 49 |
+
position: relative;
|
| 50 |
+
}
|
| 51 |
+
|
| 52 |
+
.nav-link:hover,
|
| 53 |
+
.nav-link.active {
|
| 54 |
+
color: white;
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
.nav-link.active::after {
|
| 58 |
+
content: '';
|
| 59 |
+
position: absolute;
|
| 60 |
+
bottom: -4px;
|
| 61 |
+
left: 0;
|
| 62 |
+
right: 0;
|
| 63 |
+
height: 2px;
|
| 64 |
+
background: #eab308;
|
| 65 |
+
border-radius: 1px;
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
.user-menu {
|
| 69 |
+
display: flex;
|
| 70 |
+
align-items: center;
|
| 71 |
+
gap: 1rem;
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
.notification-btn {
|
| 75 |
+
background: rgba(255, 255, 255, 0.1);
|
| 76 |
+
border: none;
|
| 77 |
+
padding: 0.5rem;
|
| 78 |
+
border-radius: 0.5rem;
|
| 79 |
+
color: white;
|
| 80 |
+
cursor: pointer;
|
| 81 |
+
transition: background 0.2s;
|
| 82 |
+
position: relative;
|
| 83 |
+
}
|
| 84 |
+
|
| 85 |
+
.notification-btn:hover {
|
| 86 |
+
background: rgba(255, 255, 255, 0.2);
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
+
.notification-badge {
|
| 90 |
+
position: absolute;
|
| 91 |
+
top: -2px;
|
| 92 |
+
right: -2px;
|
| 93 |
+
background: #eab308;
|
| 94 |
+
color: #1f2937;
|
| 95 |
+
width: 18px;
|
| 96 |
+
height: 18px;
|
| 97 |
+
border-radius: 50%;
|
| 98 |
+
display: flex;
|
| 99 |
+
align-items: center;
|
| 100 |
+
justify-content: center;
|
| 101 |
+
font-size: 0.7rem;
|
| 102 |
+
font-weight: 700;
|
| 103 |
+
}
|
| 104 |
+
|
| 105 |
+
.user-avatar {
|
| 106 |
+
width: 36px;
|
| 107 |
+
height: 36px;
|
| 108 |
+
border-radius: 50%;
|
| 109 |
+
background: rgba(255, 255, 255, 0.2);
|
| 110 |
+
display: flex;
|
| 111 |
+
align-items: center;
|
| 112 |
+
justify-content: center;
|
| 113 |
+
color: white;
|
| 114 |
+
font-weight: 600;
|
| 115 |
+
}
|
| 116 |
+
|
| 117 |
+
@media (max-width: 768px) {
|
| 118 |
+
.nav-container {
|
| 119 |
+
padding: 1rem;
|
| 120 |
+
}
|
| 121 |
+
|
| 122 |
+
.nav-menu {
|
| 123 |
+
display: none;
|
| 124 |
+
}
|
| 125 |
+
}
|
| 126 |
+
</style>
|
| 127 |
+
<nav>
|
| 128 |
+
<div class="nav-container">
|
| 129 |
+
<a href="#" class="logo">
|
| 130 |
+
<i data-feather="trending-up" style="width: 24px; height: 24px;"></i>
|
| 131 |
+
SalesFlow
|
| 132 |
+
</a>
|
| 133 |
+
|
| 134 |
+
<ul class="nav-menu">
|
| 135 |
+
<li><a href="#" class="nav-link active">แดชบอร์ด</a></li>
|
| 136 |
+
<li><a href="#" class="nav-link">รายงาน</a></li>
|
| 137 |
+
<li><a href="#" class="nav-link">สินค้า</a></li>
|
| 138 |
+
<li><a href="#" class="nav-link">ลูกค้า</a></li>
|
| 139 |
+
<li><a href="#" class="nav-link">การตั้งค่า</a></li>
|
| 140 |
+
</ul>
|
| 141 |
+
|
| 142 |
+
<div class="user-menu">
|
| 143 |
+
<button class="notification-btn">
|
| 144 |
+
<i data-feather="bell" style="width: 20px; height: 20px;"></i>
|
| 145 |
+
<span class="notification-badge">3</span>
|
| 146 |
+
</button>
|
| 147 |
+
<div class="user-avatar">AD</div>
|
| 148 |
+
</div>
|
| 149 |
+
</div>
|
| 150 |
+
</nav>
|
| 151 |
+
`;
|
| 152 |
+
|
| 153 |
+
// Initialize Feather Icons inside Shadow DOM
|
| 154 |
+
const icons = this.shadowRoot.querySelectorAll('[data-feather]');
|
| 155 |
+
icons.forEach(icon => {
|
| 156 |
+
const iconName = icon.getAttribute('data-feather');
|
| 157 |
+
icon.outerHTML = feather.icons[iconName].toSvg({
|
| 158 |
+
width: icon.style.width || '24',
|
| 159 |
+
height: icon.style.height || '24'
|
| 160 |
+
});
|
| 161 |
+
});
|
| 162 |
+
}
|
| 163 |
+
}
|
| 164 |
+
|
| 165 |
+
customElements.define('custom-navbar', CustomNavbar);
|
index.html
CHANGED
|
@@ -1,19 +1,184 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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>SalesFlow 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/feather-icons/dist/feather.min.js"></script>
|
| 10 |
+
<script src="https://unpkg.com/feather-icons"></script>
|
| 11 |
+
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
| 12 |
+
<script src="components/navbar.js"></script>
|
| 13 |
+
<script src="components/footer.js"></script>
|
| 14 |
+
</head>
|
| 15 |
+
<body class="bg-gray-50">
|
| 16 |
+
<!-- Navigation -->
|
| 17 |
+
<custom-navbar></custom-navbar>
|
| 18 |
+
|
| 19 |
+
<!-- Main Content -->
|
| 20 |
+
<main class="container mx-auto px-4 py-8 max-w-7xl">
|
| 21 |
+
<!-- Header Section -->
|
| 22 |
+
<div class="mb-8">
|
| 23 |
+
<h1 class="text-4xl font-bold text-gray-800 mb-2">รายงานยอดขายประจำปี</h1>
|
| 24 |
+
<p class="text-gray-600">ภาพรวมการขายสินค้าทั้งหมด</p>
|
| 25 |
+
</div>
|
| 26 |
+
|
| 27 |
+
<!-- Date Filter -->
|
| 28 |
+
<div class="bg-white rounded-xl shadow-sm p-4 mb-6">
|
| 29 |
+
<div class="flex flex-wrap gap-4 items-center">
|
| 30 |
+
<div class="flex items-center gap-2">
|
| 31 |
+
<i data-feather="calendar" class="w-5 h-5 text-gray-500"></i>
|
| 32 |
+
<label class="text-gray-700 font-medium">ช่วงเวลา:</label>
|
| 33 |
+
</div>
|
| 34 |
+
<select class="px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-emerald-500">
|
| 35 |
+
<option>ปี 2024</option>
|
| 36 |
+
<option>ไตรมาส 4/2024</option>
|
| 37 |
+
<option>เดือน ธันวาคม 2024</option>
|
| 38 |
+
</select>
|
| 39 |
+
<button class="ml-auto px-4 py-2 bg-emerald-500 text-white rounded-lg hover:bg-emerald-600 transition-colors flex items-center gap-2">
|
| 40 |
+
<i data-feather="download" class="w-4 h-4"></i>
|
| 41 |
+
ส่งออกรายงาน
|
| 42 |
+
</button>
|
| 43 |
+
</div>
|
| 44 |
+
</div>
|
| 45 |
+
|
| 46 |
+
<!-- Key Metrics Cards -->
|
| 47 |
+
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8">
|
| 48 |
+
<!-- Total Orders -->
|
| 49 |
+
<div class="bg-white rounded-xl shadow-sm p-6 border-l-4 border-emerald-500">
|
| 50 |
+
<div class="flex items-center justify-between">
|
| 51 |
+
<div>
|
| 52 |
+
<p class="text-gray-500 text-sm mb-1">คำสั่งซื้อทั้งหมด</p>
|
| 53 |
+
<h3 class="text-2xl font-bold text-gray-800">13,996</h3>
|
| 54 |
+
<p class="text-sm text-emerald-600 mt-2 flex items-center gap-1">
|
| 55 |
+
<i data-feather="trending-up" class="w-4 h-4"></i>
|
| 56 |
+
+12.5% จากเดือนที่แล้ว
|
| 57 |
+
</p>
|
| 58 |
+
</div>
|
| 59 |
+
<div class="bg-emerald-100 p-3 rounded-lg">
|
| 60 |
+
<i data-feather="shopping-cart" class="w-6 h-6 text-emerald-600"></i>
|
| 61 |
+
</div>
|
| 62 |
+
</div>
|
| 63 |
+
</div>
|
| 64 |
+
|
| 65 |
+
<!-- Total Revenue -->
|
| 66 |
+
<div class="bg-white rounded-xl shadow-sm p-6 border-l-4 border-yellow-500">
|
| 67 |
+
<div class="flex items-center justify-between">
|
| 68 |
+
<div>
|
| 69 |
+
<p class="text-gray-500 text-sm mb-1">รายได้รวม</p>
|
| 70 |
+
<h3 class="text-2xl font-bold text-gray-800">฿229.01M</h3>
|
| 71 |
+
<p class="text-sm text-yellow-600 mt-2 flex items-center gap-1">
|
| 72 |
+
<i data-feather="trending-up" class="w-4 h-4"></i>
|
| 73 |
+
+8.3% จากเดือนที่แล้ว
|
| 74 |
+
</p>
|
| 75 |
+
</div>
|
| 76 |
+
<div class="bg-yellow-100 p-3 rounded-lg">
|
| 77 |
+
<i data-feather="dollar-sign" class="w-6 h-6 text-yellow-600"></i>
|
| 78 |
+
</div>
|
| 79 |
+
</div>
|
| 80 |
+
</div>
|
| 81 |
+
|
| 82 |
+
<!-- Boxes Sold -->
|
| 83 |
+
<div class="bg-white rounded-xl shadow-sm p-6 border-l-4 border-blue-500">
|
| 84 |
+
<div class="flex items-center justify-between">
|
| 85 |
+
<div>
|
| 86 |
+
<p class="text-gray-500 text-sm mb-1">จำนวนกล่องที่ขาย</p>
|
| 87 |
+
<h3 class="text-2xl font-bold text-gray-800">222,273</h3>
|
| 88 |
+
<p class="text-sm text-blue-600 mt-2 flex items-center gap-1">
|
| 89 |
+
<i data-feather="trending-up" class="w-4 h-4"></i>
|
| 90 |
+
+15.2% จากเดือนที่แล้ว
|
| 91 |
+
</p>
|
| 92 |
+
</div>
|
| 93 |
+
<div class="bg-blue-100 p-3 rounded-lg">
|
| 94 |
+
<i data-feather="package" class="w-6 h-6 text-blue-600"></i>
|
| 95 |
+
</div>
|
| 96 |
+
</div>
|
| 97 |
+
</div>
|
| 98 |
+
|
| 99 |
+
<!-- Average Order Value -->
|
| 100 |
+
<div class="bg-white rounded-xl shadow-sm p-6 border-l-4 border-purple-500">
|
| 101 |
+
<div class="flex items-center justify-between">
|
| 102 |
+
<div>
|
| 103 |
+
<p class="text-gray-500 text-sm mb-1">มูลค่าเฉลี่ย/ออเดอร์</p>
|
| 104 |
+
<h3 class="text-2xl font-bold text-gray-800">฿16,363</h3>
|
| 105 |
+
<p class="text-sm text-purple-600 mt-2 flex items-center gap-1">
|
| 106 |
+
<i data-feather="trending-down" class="w-4 h-4"></i>
|
| 107 |
+
-3.7% จากเดือนที่แล้ว
|
| 108 |
+
</p>
|
| 109 |
+
</div>
|
| 110 |
+
<div class="bg-purple-100 p-3 rounded-lg">
|
| 111 |
+
<i data-feather="bar-chart-2" class="w-6 h-6 text-purple-600"></i>
|
| 112 |
+
</div>
|
| 113 |
+
</div>
|
| 114 |
+
</div>
|
| 115 |
+
</div>
|
| 116 |
+
|
| 117 |
+
<!-- Charts Section -->
|
| 118 |
+
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6 mb-8">
|
| 119 |
+
<!-- Product Sales Chart -->
|
| 120 |
+
<div class="bg-white rounded-xl shadow-sm p-6">
|
| 121 |
+
<div class="flex items-center justify-between mb-4">
|
| 122 |
+
<h2 class="text-lg font-semibold text-gray-800">ยอดขายตามสินค้า</h2>
|
| 123 |
+
<button class="text-sm text-emerald-600 hover:text-emerald-700">ดูทั้งหมด</button>
|
| 124 |
+
</div>
|
| 125 |
+
<canvas id="productChart" width="400" height="300"></canvas>
|
| 126 |
+
</div>
|
| 127 |
+
|
| 128 |
+
<!-- Product Distribution Pie Chart -->
|
| 129 |
+
<div class="bg-white rounded-xl shadow-sm p-6">
|
| 130 |
+
<div class="flex items-center justify-between mb-4">
|
| 131 |
+
<h2 class="text-lg font-semibold text-gray-800">สัดส่วนการขายตามประเภท</h2>
|
| 132 |
+
<button class="text-sm text-emerald-600 hover:text-emerald-700">ดูทั้งหมด</button>
|
| 133 |
+
</div>
|
| 134 |
+
<canvas id="distributionChart" width="400" height="300"></canvas>
|
| 135 |
+
</div>
|
| 136 |
+
</div>
|
| 137 |
+
|
| 138 |
+
<!-- Products Table -->
|
| 139 |
+
<div class="bg-white rounded-xl shadow-sm overflow-hidden">
|
| 140 |
+
<div class="px-6 py-4 border-b border-gray-200 flex items-center justify-between">
|
| 141 |
+
<h2 class="text-lg font-semibold text-gray-800">รายละเอียดสินค้าทั้งหมด</h2>
|
| 142 |
+
<div class="flex items-center gap-2">
|
| 143 |
+
<input type="text" placeholder="ค้นหาสินค้า..." class="px-3 py-2 border border-gray-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-emerald-500">
|
| 144 |
+
<button class="p-2 bg-emerald-500 text-white rounded-lg hover:bg-emerald-600 transition-colors">
|
| 145 |
+
<i data-feather="search" class="w-4 h-4"></i>
|
| 146 |
+
</button>
|
| 147 |
+
</div>
|
| 148 |
+
</div>
|
| 149 |
+
<div class="overflow-x-auto">
|
| 150 |
+
<table class="w-full">
|
| 151 |
+
<thead class="bg-gray-50">
|
| 152 |
+
<tr>
|
| 153 |
+
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">รหัสสินค้า</th>
|
| 154 |
+
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">จำนวนที่ขาย</th>
|
| 155 |
+
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">สัดส่วน (%)</th>
|
| 156 |
+
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">สถานะ</th>
|
| 157 |
+
</tr>
|
| 158 |
+
</thead>
|
| 159 |
+
<tbody id="productTableBody" class="bg-white divide-y divide-gray-200">
|
| 160 |
+
<!-- Table rows will be inserted here by JavaScript -->
|
| 161 |
+
</tbody>
|
| 162 |
+
</table>
|
| 163 |
+
</div>
|
| 164 |
+
<div class="px-6 py-4 border-t border-gray-200 flex items-center justify-between">
|
| 165 |
+
<p class="text-sm text-gray-600">แสดง <span id="showingCount">10</span> จาก <span id="totalCount">30</span> รายการ</p>
|
| 166 |
+
<div class="flex gap-2">
|
| 167 |
+
<button class="px-3 py-1 border border-gray-300 rounded-lg hover:bg-gray-50 transition-colors">ก่อนหน้า</button>
|
| 168 |
+
<button class="px-3 py-1 bg-emerald-500 text-white rounded-lg">1</button>
|
| 169 |
+
<button class="px-3 py-1 border border-gray-300 rounded-lg hover:bg-gray-50 transition-colors">2</button>
|
| 170 |
+
<button class="px-3 py-1 border border-gray-300 rounded-lg hover:bg-gray-50 transition-colors">3</button>
|
| 171 |
+
<button class="px-3 py-1 border border-gray-300 rounded-lg hover:bg-gray-50 transition-colors">ถัดไป</button>
|
| 172 |
+
</div>
|
| 173 |
+
</div>
|
| 174 |
+
</div>
|
| 175 |
+
</main>
|
| 176 |
+
|
| 177 |
+
<!-- Footer -->
|
| 178 |
+
<custom-footer></custom-footer>
|
| 179 |
+
|
| 180 |
+
<script src="script.js"></script>
|
| 181 |
+
<script>feather.replace();</script>
|
| 182 |
+
<script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
|
| 183 |
+
</body>
|
| 184 |
+
</html>
|
script.js
ADDED
|
@@ -0,0 +1,252 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Product data from the provided table
|
| 2 |
+
const productData = {
|
| 3 |
+
'ARA': 7297,
|
| 4 |
+
'B4U': 5914,
|
| 5 |
+
'BC': 1484,
|
| 6 |
+
'BS': 40572,
|
| 7 |
+
'CCT': 0,
|
| 8 |
+
'CF': 3096,
|
| 9 |
+
'JBC': 3875,
|
| 10 |
+
'Cream': 541,
|
| 11 |
+
'FOAM': 2342,
|
| 12 |
+
'PUFF1': 160,
|
| 13 |
+
'PUFF2': 138,
|
| 14 |
+
'LIP': 2029,
|
| 15 |
+
'LST': 15,
|
| 16 |
+
'SR': 533,
|
| 17 |
+
'SS': 737,
|
| 18 |
+
'XD': 6301,
|
| 19 |
+
'LS': 19148,
|
| 20 |
+
'LZ': 19638,
|
| 21 |
+
'M5': 10719,
|
| 22 |
+
'MYS': 90,
|
| 23 |
+
'PHK': 24604,
|
| 24 |
+
'SF': 1101,
|
| 25 |
+
'Lotion': 1331,
|
| 26 |
+
'Vs': 10228,
|
| 27 |
+
'COFFEE': 53465,
|
| 28 |
+
'WHEY': 0,
|
| 29 |
+
'JAI1': 3663,
|
| 30 |
+
'JAI2': 32521
|
| 31 |
+
};
|
| 32 |
+
|
| 33 |
+
// Calculate total and percentages
|
| 34 |
+
const totalBoxes = 222273;
|
| 35 |
+
const productEntries = Object.entries(productData).sort((a, b) => b[1] - a[1]);
|
| 36 |
+
|
| 37 |
+
// Initialize charts when DOM is loaded
|
| 38 |
+
document.addEventListener('DOMContentLoaded', function() {
|
| 39 |
+
initializeProductChart();
|
| 40 |
+
initializeDistributionChart();
|
| 41 |
+
populateProductTable();
|
| 42 |
+
addAnimations();
|
| 43 |
+
});
|
| 44 |
+
|
| 45 |
+
// Product Bar Chart
|
| 46 |
+
function initializeProductChart() {
|
| 47 |
+
const ctx = document.getElementById('productChart').getContext('2d');
|
| 48 |
+
const topProducts = productEntries.slice(0, 10);
|
| 49 |
+
|
| 50 |
+
new Chart(ctx, {
|
| 51 |
+
type: 'bar',
|
| 52 |
+
data: {
|
| 53 |
+
labels: topProducts.map(([name]) => name),
|
| 54 |
+
datasets: [{
|
| 55 |
+
label: 'จำนวนที่ขาย (กล่อง)',
|
| 56 |
+
data: topProducts.map(([, value]) => value),
|
| 57 |
+
backgroundColor: [
|
| 58 |
+
'rgba(16, 185, 129, 0.8)',
|
| 59 |
+
'rgba(234, 179, 8, 0.8)',
|
| 60 |
+
'rgba(59, 130, 246, 0.8)',
|
| 61 |
+
'rgba(168, 85, 247, 0.8)',
|
| 62 |
+
'rgba(236, 72, 153, 0.8)',
|
| 63 |
+
'rgba(34, 197, 94, 0.8)',
|
| 64 |
+
'rgba(251, 146, 60, 0.8)',
|
| 65 |
+
'rgba(147, 51, 234, 0.8)',
|
| 66 |
+
'rgba(239, 68, 68, 0.8)',
|
| 67 |
+
'rgba(14, 165, 233, 0.8)'
|
| 68 |
+
],
|
| 69 |
+
borderColor: [
|
| 70 |
+
'rgb(16, 185, 129)',
|
| 71 |
+
'rgb(234, 179, 8)',
|
| 72 |
+
'rgb(59, 130, 246)',
|
| 73 |
+
'rgb(168, 85, 247)',
|
| 74 |
+
'rgb(236, 72, 153)',
|
| 75 |
+
'rgb(34, 197, 94)',
|
| 76 |
+
'rgb(251, 146, 60)',
|
| 77 |
+
'rgb(147, 51, 234)',
|
| 78 |
+
'rgb(239, 68, 68)',
|
| 79 |
+
'rgb(14, 165, 233)'
|
| 80 |
+
],
|
| 81 |
+
borderWidth: 1
|
| 82 |
+
}]
|
| 83 |
+
},
|
| 84 |
+
options: {
|
| 85 |
+
responsive: true,
|
| 86 |
+
maintainAspectRatio: false,
|
| 87 |
+
plugins: {
|
| 88 |
+
legend: {
|
| 89 |
+
display: false
|
| 90 |
+
},
|
| 91 |
+
tooltip: {
|
| 92 |
+
callbacks: {
|
| 93 |
+
label: function(context) {
|
| 94 |
+
return `จำนวน: ${context.parsed.y.toLocaleString()} กล่อง`;
|
| 95 |
+
}
|
| 96 |
+
}
|
| 97 |
+
}
|
| 98 |
+
},
|
| 99 |
+
scales: {
|
| 100 |
+
y: {
|
| 101 |
+
beginAtZero: true,
|
| 102 |
+
ticks: {
|
| 103 |
+
callback: function(value) {
|
| 104 |
+
return value.toLocaleString();
|
| 105 |
+
}
|
| 106 |
+
}
|
| 107 |
+
}
|
| 108 |
+
}
|
| 109 |
+
}
|
| 110 |
+
});
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
// Distribution Pie Chart
|
| 114 |
+
function initializeDistributionChart() {
|
| 115 |
+
const ctx = document.getElementById('distributionChart').getContext('2d');
|
| 116 |
+
const topProducts = productEntries.slice(0, 8);
|
| 117 |
+
const others = productEntries.slice(8).reduce((sum, [, value]) => sum + value, 0);
|
| 118 |
+
|
| 119 |
+
const chartData = [
|
| 120 |
+
...topProducts.map(([name, value]) => ({ name, value })),
|
| 121 |
+
{ name: 'อื่นๆ', value: others }
|
| 122 |
+
];
|
| 123 |
+
|
| 124 |
+
new Chart(ctx, {
|
| 125 |
+
type: 'doughnut',
|
| 126 |
+
data: {
|
| 127 |
+
labels: chartData.map(({ name }) => name),
|
| 128 |
+
datasets: [{
|
| 129 |
+
data: chartData.map(({ value }) => value),
|
| 130 |
+
backgroundColor: [
|
| 131 |
+
'rgba(16, 185, 129, 0.8)',
|
| 132 |
+
'rgba(234, 179, 8, 0.8)',
|
| 133 |
+
'rgba(59, 130, 246, 0.8)',
|
| 134 |
+
'rgba(168, 85, 247, 0.8)',
|
| 135 |
+
'rgba(236, 72, 153, 0.8)',
|
| 136 |
+
'rgba(34, 197, 94, 0.8)',
|
| 137 |
+
'rgba(251, 146, 60, 0.8)',
|
| 138 |
+
'rgba(147, 51, 234, 0.8)',
|
| 139 |
+
'rgba(156, 163, 175, 0.8)'
|
| 140 |
+
],
|
| 141 |
+
borderColor: [
|
| 142 |
+
'rgb(16, 185, 129)',
|
| 143 |
+
'rgb(234, 179, 8)',
|
| 144 |
+
'rgb(59, 130, 246)',
|
| 145 |
+
'rgb(168, 85, 247)',
|
| 146 |
+
'rgb(236, 72, 153)',
|
| 147 |
+
'rgb(34, 197, 94)',
|
| 148 |
+
'rgb(251, 146, 60)',
|
| 149 |
+
'rgb(147, 51, 234)',
|
| 150 |
+
'rgb(156, 163, 175)'
|
| 151 |
+
],
|
| 152 |
+
borderWidth: 1
|
| 153 |
+
}]
|
| 154 |
+
},
|
| 155 |
+
options: {
|
| 156 |
+
responsive: true,
|
| 157 |
+
maintainAspectRatio: false,
|
| 158 |
+
plugins: {
|
| 159 |
+
legend: {
|
| 160 |
+
position: 'right',
|
| 161 |
+
labels: {
|
| 162 |
+
padding: 15,
|
| 163 |
+
font: {
|
| 164 |
+
size: 11
|
| 165 |
+
}
|
| 166 |
+
}
|
| 167 |
+
},
|
| 168 |
+
tooltip: {
|
| 169 |
+
callbacks: {
|
| 170 |
+
label: function(context) {
|
| 171 |
+
const percentage = ((context.parsed / totalBoxes) * 100).toFixed(1);
|
| 172 |
+
return `${context.label}: ${context.parsed.toLocaleString()} กล่อง (${percentage}%)`;
|
| 173 |
+
}
|
| 174 |
+
}
|
| 175 |
+
}
|
| 176 |
+
}
|
| 177 |
+
}
|
| 178 |
+
});
|
| 179 |
+
}
|
| 180 |
+
|
| 181 |
+
// Populate product table
|
| 182 |
+
function populateProductTable() {
|
| 183 |
+
const tableBody = document.getElementById('productTableBody');
|
| 184 |
+
|
| 185 |
+
productEntries.slice(0, 10).forEach(([name, value], index) => {
|
| 186 |
+
const percentage = ((value / totalBoxes) * 100).toFixed(2);
|
| 187 |
+
const row = document.createElement('tr');
|
| 188 |
+
row.className = 'table-row-hover';
|
| 189 |
+
|
| 190 |
+
// Determine status badge
|
| 191 |
+
let statusBadge = '';
|
| 192 |
+
if (value > 20000) {
|
| 193 |
+
statusBadge = '<span class="badge-success">ขายดี</span>';
|
| 194 |
+
} else if (value > 5000) {
|
| 195 |
+
statusBadge = '<span class="badge-warning">ปานกลาง</span>';
|
| 196 |
+
} else if (value > 0) {
|
| 197 |
+
statusBadge = '<span class="badge-danger">ต่ำ</span>';
|
| 198 |
+
} else {
|
| 199 |
+
statusBadge = '<span class="text-gray-400">ไม่มียอดขาย</span>';
|
| 200 |
+
}
|
| 201 |
+
|
| 202 |
+
row.innerHTML = `
|
| 203 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">${name}</td>
|
| 204 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-700">${value.toLocaleString()}</td>
|
| 205 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-700">${percentage}%</td>
|
| 206 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm">${statusBadge}</td>
|
| 207 |
+
`;
|
| 208 |
+
|
| 209 |
+
tableBody.appendChild(row);
|
| 210 |
+
});
|
| 211 |
+
|
| 212 |
+
// Update counts
|
| 213 |
+
document.getElementById('showingCount').textContent = '10';
|
| 214 |
+
document.getElementById('totalCount').textContent = productEntries.length.toString();
|
| 215 |
+
}
|
| 216 |
+
|
| 217 |
+
// Add animations to elements
|
| 218 |
+
function addAnimations() {
|
| 219 |
+
const observer = new IntersectionObserver((entries) => {
|
| 220 |
+
entries.forEach(entry => {
|
| 221 |
+
if (entry.isIntersecting) {
|
| 222 |
+
entry.target.classList.add('animate-slide-in');
|
| 223 |
+
}
|
| 224 |
+
});
|
| 225 |
+
});
|
| 226 |
+
|
| 227 |
+
document.querySelectorAll('.bg-white').forEach(el => {
|
| 228 |
+
observer.observe(el);
|
| 229 |
+
});
|
| 230 |
+
}
|
| 231 |
+
|
| 232 |
+
// Export functionality
|
| 233 |
+
document.addEventListener('DOMContentLoaded', function() {
|
| 234 |
+
const exportBtn = document.querySelector('button:has(.feather-download)');
|
| 235 |
+
if (exportBtn) {
|
| 236 |
+
exportBtn.addEventListener('click', function() {
|
| 237 |
+
alert('กำลังส่งออกรายงาน...');
|
| 238 |
+
// Here you would implement actual export functionality
|
| 239 |
+
});
|
| 240 |
+
}
|
| 241 |
+
});
|
| 242 |
+
|
| 243 |
+
// Search functionality
|
| 244 |
+
document.addEventListener('DOMContentLoaded', function() {
|
| 245 |
+
const searchInput = document.querySelector('input[placeholder="ค้นหาสินค้า..."]');
|
| 246 |
+
if (searchInput) {
|
| 247 |
+
searchInput.addEventListener('input', function(e) {
|
| 248 |
+
const searchTerm = e.target.value.toLowerCase();
|
| 249 |
+
// Here you would implement actual search functionality
|
| 250 |
+
});
|
| 251 |
+
}
|
| 252 |
+
});
|
style.css
CHANGED
|
@@ -1,28 +1,124 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
}
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
margin-top: 0;
|
| 9 |
}
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
margin-top: 5px;
|
| 16 |
}
|
| 17 |
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
margin: 0 auto;
|
| 21 |
-
padding: 16px;
|
| 22 |
-
border: 1px solid lightgray;
|
| 23 |
-
border-radius: 16px;
|
| 24 |
}
|
| 25 |
|
| 26 |
-
|
| 27 |
-
|
|
|
|
| 28 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* Custom animations and styles */
|
| 2 |
+
@keyframes slideIn {
|
| 3 |
+
from {
|
| 4 |
+
opacity: 0;
|
| 5 |
+
transform: translateY(20px);
|
| 6 |
+
}
|
| 7 |
+
to {
|
| 8 |
+
opacity: 1;
|
| 9 |
+
transform: translateY(0);
|
| 10 |
+
}
|
| 11 |
}
|
| 12 |
|
| 13 |
+
.animate-slide-in {
|
| 14 |
+
animation: slideIn 0.5s ease-out forwards;
|
|
|
|
| 15 |
}
|
| 16 |
|
| 17 |
+
/* Custom scrollbar */
|
| 18 |
+
::-webkit-scrollbar {
|
| 19 |
+
width: 8px;
|
| 20 |
+
height: 8px;
|
|
|
|
| 21 |
}
|
| 22 |
|
| 23 |
+
::-webkit-scrollbar-track {
|
| 24 |
+
background: #f1f1f1;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
}
|
| 26 |
|
| 27 |
+
::-webkit-scrollbar-thumb {
|
| 28 |
+
background: #10b981;
|
| 29 |
+
border-radius: 4px;
|
| 30 |
}
|
| 31 |
+
|
| 32 |
+
::-webkit-scrollbar-thumb:hover {
|
| 33 |
+
background: #059669;
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
/* Hover effects */
|
| 37 |
+
.hover-lift {
|
| 38 |
+
transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
.hover-lift:hover {
|
| 42 |
+
transform: translateY(-2px);
|
| 43 |
+
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
/* Gradient backgrounds */
|
| 47 |
+
.bg-gradient-emerald {
|
| 48 |
+
background: linear-gradient(135deg, #10b981 0%, #059669 100%);
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
.bg-gradient-yellow {
|
| 52 |
+
background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%);
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
/* Loading spinner */
|
| 56 |
+
.spinner {
|
| 57 |
+
border: 3px solid #f3f4f6;
|
| 58 |
+
border-top: 3px solid #10b981;
|
| 59 |
+
border-radius: 50%;
|
| 60 |
+
width: 40px;
|
| 61 |
+
height: 40px;
|
| 62 |
+
animation: spin 1s linear infinite;
|
| 63 |
+
}
|
| 64 |
+
|
| 65 |
+
@keyframes spin {
|
| 66 |
+
0% { transform: rotate(0deg); }
|
| 67 |
+
100% { transform: rotate(360deg); }
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
/* Chart container */
|
| 71 |
+
.chart-container {
|
| 72 |
+
position: relative;
|
| 73 |
+
height: 300px;
|
| 74 |
+
width: 100%;
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
/* Table hover effects */
|
| 78 |
+
.table-row-hover {
|
| 79 |
+
transition: background-color 0.2s ease-in-out;
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
.table-row-hover:hover {
|
| 83 |
+
background-color: #f9fafb;
|
| 84 |
+
}
|
| 85 |
+
|
| 86 |
+
/* Badge styles */
|
| 87 |
+
.badge-success {
|
| 88 |
+
background-color: #10b981;
|
| 89 |
+
color: white;
|
| 90 |
+
padding: 2px 8px;
|
| 91 |
+
border-radius: 12px;
|
| 92 |
+
font-size: 12px;
|
| 93 |
+
font-weight: 600;
|
| 94 |
+
}
|
| 95 |
+
|
| 96 |
+
.badge-warning {
|
| 97 |
+
background-color: #f59e0b;
|
| 98 |
+
color: white;
|
| 99 |
+
padding: 2px 8px;
|
| 100 |
+
border-radius: 12px;
|
| 101 |
+
font-size: 12px;
|
| 102 |
+
font-weight: 600;
|
| 103 |
+
}
|
| 104 |
+
|
| 105 |
+
.badge-danger {
|
| 106 |
+
background-color: #ef4444;
|
| 107 |
+
color: white;
|
| 108 |
+
padding: 2px 8px;
|
| 109 |
+
border-radius: 12px;
|
| 110 |
+
font-size: 12px;
|
| 111 |
+
font-weight: 600;
|
| 112 |
+
}
|
| 113 |
+
|
| 114 |
+
/* Responsive adjustments */
|
| 115 |
+
@media (max-width: 640px) {
|
| 116 |
+
.mobile-hidden {
|
| 117 |
+
display: none;
|
| 118 |
+
}
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
/* Smooth transitions */
|
| 122 |
+
* {
|
| 123 |
+
transition: color 0.2s ease-in-out, background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
|
| 124 |
+
}
|